Skip to content
Snippets Groups Projects
Commit 604741fe authored by chris's avatar chris
Browse files

start plugin

parent b823801b
No related branches found
No related tags found
2 merge requests!548Merge yjs with standard comments,!545Overlapping comments
......@@ -90,7 +90,7 @@ const Editors = () => {
case 'oen':
return <OEN />;
default:
return <HHMI />;
return <Editoria />;
}
};
......
......@@ -4,6 +4,7 @@ import RightArea from './components/RightArea';
import commentMark from './schema/commentMark';
import CommentPlugin from './plugins/CommentPlugin';
import CopyPasteCommentPlugin from './plugins/CopyPasteCommentPlugin';
import { AnnotationPlugin } from './plugins/AnnotationPlugin';
import './comments.css';
const PLUGIN_KEY = 'commentPlugin';
......@@ -15,6 +16,25 @@ export default class CommentsService extends Service {
'copyPasteCommentPlugin',
CopyPasteCommentPlugin('copyPasteCommentPlugin', this.app.context),
);
const options = {
styles: {
rightFragment: '',
leftFragment: '',
normal: '',
middleFragment: '',
},
onSelectionChange: items => items,
onAnnotationListChange: items => items,
document: null,
field: 'annotations',
instance: '',
};
this.app.PmPlugins.add(
'AnnotationPlugin',
AnnotationPlugin('AnnotationPlugin', options),
);
const createOverlay = this.container.get('CreateOverlay');
const layout = this.container.get('Layout');
createOverlay(
......
......@@ -3,7 +3,8 @@ import AnnotationState from './AnnotationState';
export const AnnotationPluginKey = new PluginKey('annotation-magic');
export const AnnotationPlugin = options => {
export const AnnotationPlugin = (name, options) => {
console.log(options);
return new Plugin({
key: AnnotationPluginKey,
state: {
......
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