diff --git a/editors/demo/src/Editors.js b/editors/demo/src/Editors.js index 0e36a5c07cdfbce6f7c2095a8b1470e6f4c781f5..78a82dca42828507ad8168cf3eb705360720ee0d 100644 --- a/editors/demo/src/Editors.js +++ b/editors/demo/src/Editors.js @@ -90,7 +90,7 @@ const Editors = () => { case 'oen': return <OEN />; default: - return <HHMI />; + return <Editoria />; } }; diff --git a/wax-prosemirror-services/src/CommentsService/CommentsService.js b/wax-prosemirror-services/src/CommentsService/CommentsService.js index fc32e5b5cfb5aa2c662071a32bd24f2ecdfcb9c1..0c72ad14cf5f1c021402c41b54412a08f82fd17a 100644 --- a/wax-prosemirror-services/src/CommentsService/CommentsService.js +++ b/wax-prosemirror-services/src/CommentsService/CommentsService.js @@ -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( diff --git a/wax-prosemirror-services/src/CommentsService/plugins/AnnotationPlugin.js b/wax-prosemirror-services/src/CommentsService/plugins/AnnotationPlugin.js index 66a3a0194abe1253bf35763ef39363f683012040..06928ce4022f9a57391e20202404cb68e187fcb7 100644 --- a/wax-prosemirror-services/src/CommentsService/plugins/AnnotationPlugin.js +++ b/wax-prosemirror-services/src/CommentsService/plugins/AnnotationPlugin.js @@ -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: {