How to use the prosemirror-view.DecorationSet.empty function in prosemirror-view

To help you get started, we’ve selected a few prosemirror-view examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pubpub / pubpub-editor / packages / pubpub-prose / src / prosemirror-setup / plugins / mentionsPlugin.js View on Github external
const shouldMark = startLetter === '@' && nextCh.charCodeAt(0) === 32;
				if (shouldMark) {
					const substring = currentLine.substring(startIndex + 1, nextChIndex) || ' ';
					const start = currentPos.pos - currentPos.parentOffset + startIndex;
					const end = currentPos.pos - currentPos.parentOffset + startIndex + 1 + substring.length;
					const decorations = [Decoration.inline(start, end, { class: 'mention-marker' })];
					const decos = DecorationSet.create(editorState.doc, decorations);

					// updateMentions(currentLine.substring(start - 1, currentPos.pos) || ' ');
					updateMentions(substring);
					return { decos: decos, start, end };
				}

			}
			updateMentions('');
			return { decos: DecorationSet.empty, start: null, end: null };
		}
	},
github ProseMirror / website / example / track / index.js View on Github external
    init() { return {deco: DecorationSet.empty, commit: null} },
    apply(tr, prev, oldState, state) {
github pubpub / pubpub-editor / src / schema / setup / selectPlugin.js View on Github external
init() {
			return { deco: DecorationSet.empty };
		},
		apply(transaction, state, prevEditorState, editorState) {
github pubpub / pubpub-editor / packages / pubpub-editor / src / prosemirror-setup / plugins / diffPlugin.js View on Github external
init(config, instance) {
			const {DecorationSet, Decoration} = require("prosemirror-view");
      return {deco: DecorationSet.empty,
        linkedEditor: config.linkedEditor,
        originalEditor: config.originalEditor,
        showAsAdditions: config.showAsAdditions,
      };
    },
    apply(action, state, prevEditorState, editorState) {
github ProseMirror / website / example / upload / index.js View on Github external
    init() { return DecorationSet.empty },
    apply(tr, set) {
github pubpub / pubpub-editor / packages / pubpub-prose / src / editors / baseEditor.js View on Github external
_createDecorations = (editorState) => {
    const {DecorationSet} = require("prosemirror-view");
    return DecorationSet.empty;
  }
github ifiokjr / remirror / @remirror / extension-drop-cursor / src / drop-cursor-plugin.tsx View on Github external
public isDragging = () =>
    this.view.dragging ?? (this.decorationSet !== DecorationSet.empty || !isUndefined(this.target));
github guardian / prosemirror-invisibles / src / js / index.js View on Github external
init: (_, state) => {
        const { from, to } = new AllSelection(state.doc);
        return addDecosBetween(from, to, state.doc, DecorationSet.empty);
      },
      apply: (tr, prevDecos, _, state) =>