Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #43

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

fix #43

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions packages/core/src/DreifussWysiwygEditorDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,26 @@ import {DreifussWysiwygEditor} from './index'
import {CustomImageToolbarProps} from '@dreifuss-wysiwyg-editor/image-ui'

const value: any = [
{type: 'action_item', checked: true, children: [{text: 'Slide to the right.'}], id: 10054},
{type: 'action_item', children: [{text: 'Criss-cross.'}], id: 10055},
{type: 'action_item', checked: true, children: [{text: 'Slide to the right.'}]},
{type: 'action_item', children: [{text: 'Criss-cross.'}]},
{type: 'action_item', children: [{text: 'Third item'}]},
{
type: 'paragraph',
children: [{type: 'link', url: 'http://google.com', children: [{text: 'Links: Add links.'}]}],
id: 10052
},
{
type: 'paragraph',
children: [{text: 'Bold: Make the selected text bold.', code: true}],
id: 10055
children: [
{text: ''},
{type: 'link', url: 'http://google.com', children: [{text: 'Links: Add linkss.'}]},
{text: ''}
]
},

{type: 'paragraph', children: [{text: 'Italic: Make the selected text italic.', italic: true}]},
{type: 'paragraph', children: [{text: 'Bold: Make the selected text bold. no?', code: true}]},
{type: 'paragraph', children: [{text: 'Italic: Make the selected text italicc.', italic: true}]},
{
type: 'paragraph',
children: [{text: 'Underline: Underline the selected text.', underline: true}]
children: [{text: 'Underline: Underline the selected textt.', underline: true}]
},
{
type: 'paragraph',
children: [{text: 'Strikethrough: Strikethrough the selected text.', strikethrough: true}]
children: [{text: 'Strikethrough: Strikethrough the selected textt.', strikethrough: true}]
},
{
type: 'paragraph',
Expand Down Expand Up @@ -55,12 +54,12 @@ const value: any = [
type: 'table-cell',
borderColor: '#000000',
children: [{type: 'paragraph', children: [{text: ''}]}],
backgroundColor: '#f31212'
backgroundColor: 'lightgray'
},
{
type: 'table-cell',
children: [{type: 'paragraph', children: [{text: ''}]}],
backgroundColor: '#f31212'
backgroundColor: 'lightgray'
}
]
},
Expand All @@ -71,12 +70,12 @@ const value: any = [
type: 'table-cell',
borderColor: '#000000',
children: [{type: 'paragraph', children: [{text: ''}]}],
backgroundColor: '#f31212'
backgroundColor: 'lightgray'
},
{
type: 'table-cell',
children: [{type: 'paragraph', children: [{text: ''}]}],
backgroundColor: '#f31212'
backgroundColor: 'lightgray'
}
]
}
Expand All @@ -90,7 +89,10 @@ const value: any = [
{text: 'Make', color: '#c21414'},
{text: ' the selected text bold.'}
]
}
},
{type: 'paragraph', children: [{text: ''}]},
{type: 'media_embed', url: 'https://youtu.be/6vcBKwnl_Y0', children: [{text: ''}]},
{type: 'paragraph', children: [{text: ''}]}
]

/**
Expand Down Expand Up @@ -126,7 +128,7 @@ const toolbars = {
const DreifussWysiwygEditorDemo = () => (
<div style={{display: 'flex'}}>
<div style={{minHeight: 400, padding: 30}}>
<h1>RichText Component Demo</h1>
<h1>WePublish Rich Text Editor</h1>
<DreifussWysiwygEditor
enablePlugins={{
basicElements: true,
Expand All @@ -147,7 +149,7 @@ const DreifussWysiwygEditorDemo = () => (
dnd: false
}}
onChange={e => {
// console.log(e)
console.log(JSON.stringify(e))
}}
id="two"
value={value}
Expand Down