Skip to content
Snippets Groups Projects
Commit 7eba8dc1 authored by chris's avatar chris
Browse files

revert editors/editoria

parent 90ce3e2b
No related branches found
No related tags found
1 merge request!611Standard comments
import React, { import React, { useLayoutEffect, useState, useMemo, useRef } from 'react';
useLayoutEffect,
useState,
useMemo,
useRef,
useEffect,
} from 'react';
import { Wax } from 'wax-prosemirror-core'; import { Wax } from 'wax-prosemirror-core';
...@@ -36,48 +30,7 @@ const Editoria = () => { ...@@ -36,48 +30,7 @@ const Editoria = () => {
const [width] = useWindowSize(); const [width] = useWindowSize();
let layout = EditoriaLayout; let layout = EditoriaLayout;
const comments = [ let finalConfig = config;
{
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 key = 'editoria'; let key = 'editoria';
if (width < 600) { if (width < 600) {
...@@ -87,8 +40,6 @@ const Editoria = () => { ...@@ -87,8 +40,6 @@ const Editoria = () => {
} }
const editorRef = useRef(); const editorRef = useRef();
useEffect(() => {}, []);
const EditoriaComponent = useMemo( const EditoriaComponent = useMemo(
() => ( () => (
<> <>
......
...@@ -76,8 +76,127 @@ const getComments = comments => { ...@@ -76,8 +76,127 @@ const getComments = comments => {
console.log(comments); console.log(comments);
}; };
const setComments = () => { const setComments = (
return []; 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 => { const saveTags = tags => {
...@@ -92,7 +211,7 @@ const onWarning = message => { ...@@ -92,7 +211,7 @@ const onWarning = message => {
alert(message); alert(message);
}; };
const config = comments => ({ export default {
MenuService: [ MenuService: [
{ {
templateArea: 'mainMenuToolBar', templateArea: 'mainMenuToolBar',
...@@ -179,9 +298,7 @@ const config = comments => ({ ...@@ -179,9 +298,7 @@ const config = comments => ({
CommentsService: { CommentsService: {
showTitle: true, showTitle: true,
getComments, getComments,
setComments: () => { setComments,
return comments;
},
}, },
CustomTagService: { CustomTagService: {
...@@ -239,10 +356,4 @@ const config = comments => ({ ...@@ -239,10 +356,4 @@ const config = comments => ({
new BottomInfoService(), new BottomInfoService(),
new TransformService(), new TransformService(),
], ],
}); };
export default config;
// export default {
// };
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment