diff --git a/app/components/Editor/changes.js b/app/components/Editor/changes.js index 7a182994..9c44c28b 100644 --- a/app/components/Editor/changes.js +++ b/app/components/Editor/changes.js @@ -9,11 +9,10 @@ const { changes } = EditList; type Options = { type: string | Object, wrapper?: string | Object, - append?: string | Object, }; export function splitAndInsertBlock(change: Change, options: Options) { - const { type, wrapper, append } = options; + const { type, wrapper } = options; const parent = change.value.document.getParent(change.value.startBlock.key); // lists get some special treatment @@ -28,8 +27,6 @@ export function splitAndInsertBlock(change: Change, options: Options) { change.insertBlock(type); if (wrapper) change.wrapBlock(wrapper); - if (append) change.insertBlock(append); - return change; } @@ -40,7 +37,6 @@ export async function insertImageFile( onImageUploadStop: () => void ) { onImageUploadStart(); - console.log(file); try { // load the file as a data URL const id = uuid.v4(); @@ -55,7 +51,6 @@ export async function insertImageFile( isVoid: true, data: { src, id, alt, loading: true }, }); - console.log('insertBlock', change); }); reader.readAsDataURL(file); @@ -69,7 +64,6 @@ export async function insertImageFile( const placeholder = change.value.document.findDescendant( node => node.data && node.data.get('id') === id ); - console.log('placeholder', placeholder); return change.setNodeByKey(placeholder.key, { data: { src, alt, loading: false }, diff --git a/app/components/Editor/components/ListItem.js b/app/components/Editor/components/ListItem.js index abb1283c..227a3ad1 100644 --- a/app/components/Editor/components/ListItem.js +++ b/app/components/Editor/components/ListItem.js @@ -10,7 +10,6 @@ export default function ListItem({ ...props }: SlateNodeProps) { const checked = node.data.get('checked'); - console.log('ListItem.checked', checked); if (checked !== undefined) { return ( diff --git a/app/components/Editor/components/Toolbar/BlockToolbar.js b/app/components/Editor/components/Toolbar/BlockToolbar.js index cd94d9db..26c114ce 100644 --- a/app/components/Editor/components/Toolbar/BlockToolbar.js +++ b/app/components/Editor/components/Toolbar/BlockToolbar.js @@ -26,7 +26,6 @@ type Props = SlateNodeProps & { type Options = { type: string | Object, wrapper?: string | Object, - append?: string | Object, }; class BlockToolbar extends Component { diff --git a/app/components/Editor/plugins.js b/app/components/Editor/plugins.js index e8dc46aa..217bfd1c 100644 --- a/app/components/Editor/plugins.js +++ b/app/components/Editor/plugins.js @@ -25,7 +25,7 @@ const createPlugins = ({ onImageUploadStart, onImageUploadStop }: Options) => { }), InsertImages({ extensions: ['png', 'jpg', 'gif'], - insertImage(change, file) { + insertImage: (change, file) => { return change.call( insertImageFile, file, diff --git a/app/components/Editor/schema.js b/app/components/Editor/schema.js index a8331e3d..8e2abcc2 100644 --- a/app/components/Editor/schema.js +++ b/app/components/Editor/schema.js @@ -2,26 +2,23 @@ import { Block, Change, Node, Mark } from 'slate'; const schema = { - // blocks: { - // heading1: { marks: [''] }, - // heading2: { marks: [''] }, - // heading3: { marks: [''] }, - // heading4: { marks: [''] }, - // heading5: { marks: [''] }, - // heading6: { marks: [''] }, - // table: { - // nodes: [{ types: ['table-row', 'table-head', 'table-cell'] }], - // }, - // image: { - // isVoid: true, - // }, - // 'horizontal-rule': { - // isVoid: true, - // }, - // 'block-toolbar': { - // isVoid: true, - // }, - // }, + blocks: { + heading1: { marks: [''] }, + heading2: { marks: [''] }, + heading3: { marks: [''] }, + heading4: { marks: [''] }, + heading5: { marks: [''] }, + heading6: { marks: [''] }, + table: { + nodes: [{ types: ['table-row', 'table-head', 'table-cell'] }], + }, + 'horizontal-rule': { + isVoid: true, + }, + 'block-toolbar': { + isVoid: true, + }, + }, document: { nodes: [ { types: ['heading1'], min: 1, max: 1 },