diff --git a/editors/demo/src/Editoria/Editoria.js b/editors/demo/src/Editoria/Editoria.js index 370982c84c5ae3f860e3989c3364dc9aeb6d03bb..e35f93c22ab3676f47c63ca8835efee49858f7f3 100644 --- a/editors/demo/src/Editoria/Editoria.js +++ b/editors/demo/src/Editoria/Editoria.js @@ -1,10 +1,4 @@ -import React, { - useLayoutEffect, - useState, - useMemo, - useRef, - useEffect, -} from 'react'; +import React, { useLayoutEffect, useState, useMemo, useRef } from 'react'; import { Wax } from 'wax-prosemirror-core'; @@ -36,48 +30,7 @@ const Editoria = () => { const [width] = useWindowSize(); let layout = EditoriaLayout; - const comments = [ - { - id: 'c6863c3e-cfb1-4465-a46e-e89718e10245', - from: 83, - to: 94, - data: { - type: 'comment', - pmFrom: 83, - pmTo: 94, - conversation: [ - { - content: '345345435', - displayName: 'admin', - userId: 'b3cfc28e-0f2e-45b5-b505-e66783d4f946', - timestamp: 1721647289866, - }, - { - content: '111', - displayName: 'admin', - userId: 'b3cfc28e-0f2e-45b5-b505-e66783d4f946', - timestamp: 1721647292430, - }, - { - content: '222', - displayName: 'admin', - userId: 'b3cfc28e-0f2e-45b5-b505-e66783d4f946', - timestamp: 1721647294920, - }, - { - content: '444', - displayName: 'admin', - userId: 'b3cfc28e-0f2e-45b5-b505-e66783d4f946', - timestamp: 1721647307447, - }, - ], - title: '353443', - group: 'main', - viewId: 'main', - }, - }, - ]; - let finalConfig = config(comments); + let finalConfig = config; let key = 'editoria'; if (width < 600) { @@ -87,8 +40,6 @@ const Editoria = () => { } const editorRef = useRef(); - useEffect(() => {}, []); - const EditoriaComponent = useMemo( () => ( <> diff --git a/editors/demo/src/Editoria/config/config.js b/editors/demo/src/Editoria/config/config.js index 024e55ddfcfc89a27155f92101d4ec500e44c618..7fa44359dc42d458e7018f346090d316a7945171 100644 --- a/editors/demo/src/Editoria/config/config.js +++ b/editors/demo/src/Editoria/config/config.js @@ -76,8 +76,127 @@ const getComments = comments => { console.log(comments); }; -const setComments = () => { - return []; +const setComments = ( + comments = [ + // { + // id: 'a1', + // from: 5, + // to: 10, + // data: { + // type: 'comment', + // yjsFrom: 5, + // yjsTo: 10, + // pmFrom: 5, + // pmTo: 10, + // conversation: [ + // { + // content: '1111', + // displayName: 'admin', + // userId: 'b3cfc28e-0f2e-45b5-b505-e66783d4f946', + // timestamp: 1710501980537, + // }, + // ], + // title: '111', + // group: 'main', + // viewId: 'main', + // }, + // endHeight: 362.3579406738281, + // }, + // { + // id: 'a2', + // from: 8, + // to: 15, + // data: { + // type: 'comment', + // yjsFrom: 8, + // yjsTo: 15, + // pmFrom: 8, + // pmTo: 15, + // conversation: [ + // { + // content: '222', + // displayName: 'admin', + // userId: 'b3cfc28e-0f2e-45b5-b505-e66783d4f946', + // timestamp: 1710501987197, + // }, + // ], + // title: '222', + // group: 'main', + // viewId: 'main', + // }, + // endHeight: 266.3579406738281, + // }, + // { + // id: 'b8d907d4-1859-49a9-abcd-13788d497758', + // from: { + // type: { + // client: 2887320119, + // clock: 150, + // }, + // tname: null, + // item: { + // client: 2887320119, + // clock: 185, + // }, + // assoc: 0, + // }, + // to: { + // type: { + // client: 2887320119, + // clock: 150, + // }, + // tname: null, + // item: { + // client: 2887320119, + // clock: 195, + // }, + // assoc: 0, + // }, + // data: { + // yjsFrom: { + // type: { + // client: 2887320119, + // clock: 150, + // }, + // tname: null, + // item: { + // client: 2887320119, + // clock: 185, + // }, + // assoc: 0, + // }, + // yjsTo: { + // type: { + // client: 2887320119, + // clock: 150, + // }, + // tname: null, + // item: { + // client: 2887320119, + // clock: 195, + // }, + // assoc: 0, + // }, + // pmFrom: 164, + // pmTo: 174, + // type: 'comment', + // conversation: [ + // { + // content: 'dfgdfgd', + // displayName: 'admin', + // userId: 'b3cfc28e-0f2e-45b5-b505-e66783d4f946', + // timestamp: 1713699155995, + // }, + // ], + // title: 'dgfdgf', + // group: 'main', + // viewId: 'main', + // }, + // endHeight: 406.734375, + // }, + ], +) => { + return comments; }; const saveTags = tags => { @@ -92,7 +211,7 @@ const onWarning = message => { alert(message); }; -const config = comments => ({ +export default { MenuService: [ { templateArea: 'mainMenuToolBar', @@ -179,9 +298,7 @@ const config = comments => ({ CommentsService: { showTitle: true, getComments, - setComments: () => { - return comments; - }, + setComments, }, CustomTagService: { @@ -239,10 +356,4 @@ const config = comments => ({ new BottomInfoService(), new TransformService(), ], -}); - -export default config; - -// export default { - -// }; +};