Newer
Older
import CommentBubbleComponent from './components/ui/comments/CommentBubbleComponent';
import RightArea from './components/RightArea';
import CommentPlugin from './plugins/CommentPlugin';
import CopyPasteCommentPlugin from './plugins/CopyPasteCommentPlugin';
export default class CommentsService extends Service {
boot() {
this.app.PmPlugins.add(PLUGIN_KEY, CommentPlugin(PLUGIN_KEY));
this.app.PmPlugins.add(
'copyPasteCommentPlugin',
CopyPasteCommentPlugin('copyPasteCommentPlugin', this.app.context),
);
const options = {
styles: {
rightFragment: '',
leftFragment: '',
normal: '',
middleFragment: '',
},
onSelectionChange: items => console.log(items),
onAnnotationListChange: items => console.log(items),
document: this.app.context.pmViews?.main?.state.doc,
};
this.app.PmPlugins.add(
'AnnotationPlugin',
AnnotationPlugin('AnnotationPlugin', options),
);
const createOverlay = this.container.get('CreateOverlay');
const layout = this.container.get('Layout');
const commentConfig = this.config.get('config.CommentsService');
comment: commentMark(commentConfig?.showTitle || false),