Skip to content
Snippets Groups Projects
Commit 9a452c61 authored by Christos's avatar Christos
Browse files

Merge branch 'matching' into 'master'

remove wax-selection-plugin

See merge request !385
parents 67c94e65 487809b9
No related branches found
No related tags found
1 merge request!385remove wax-selection-plugin
......@@ -36,7 +36,6 @@ import {
CustomTagService,
} from 'wax-prosemirror-services';
import { WaxSelectionPlugin } from 'wax-prosemirror-plugins';
import { DefaultSchema } from 'wax-prosemirror-utilities';
import invisibles, {
......@@ -81,12 +80,7 @@ export default {
TitleService: { updateTitle },
EnableTrackChangeService: { enabled: false },
PmPlugins: [
columnResizing(),
tableEditing(),
invisibles([hardBreak()]),
WaxSelectionPlugin,
],
PmPlugins: [columnResizing(), tableEditing(), invisibles([hardBreak()])],
CustomTagService: {
tags: [
{ label: 'custom-tag-label-1', tagType: 'inline' },
......
......@@ -4,7 +4,6 @@ export { default as HideShowPlugin } from './src/trackChanges/HideShowPlugin';
export { default as CommentPlugin } from './src/comments/CommentPlugin';
export { default as CopyPasteCommentPlugin } from './src/comments/CopyPasteCommentPlugin';
export { default as WaxSelectionPlugin } from './src/WaxSelectionPlugin';
export { default as highlightPlugin } from './src/highlightPlugin';
export { default as mathPlugin } from './src/math/math-plugin';
......
import { Decoration, DecorationSet } from 'prosemirror-view';
import { Plugin, PluginKey } from 'prosemirror-state';
const waxSelectionPlugin = new PluginKey('waxSelectionPlugin');
const WaxSelectionPlugin = new Plugin({
key: waxSelectionPlugin,
state: {
init(config, instance) {
return { deco: DecorationSet.empty };
},
apply(tr, prev, previousState, newState) {
const { selection } = tr;
const createDecoration = DecorationSet.create(newState.doc, [
Decoration.inline(selection.$from.pos, selection.$to.pos, {
class: 'wax-selection-marker',
}),
]);
return { createDecoration };
},
},
props: {
decorations(state) {
const waxSelectionPluginState =
state && waxSelectionPlugin.getState(state);
return waxSelectionPluginState.createDecoration;
},
},
});
export default WaxSelectionPlugin;
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