Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 };
}
},
init() { return {deco: DecorationSet.empty, commit: null} },
apply(tr, prev, oldState, state) {
init() {
return { deco: DecorationSet.empty };
},
apply(transaction, state, prevEditorState, editorState) {
init() {
return DecorationSet.empty
},
apply: (tr, old) => {
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) {
init() {
return DecorationSet.empty;
},
init() { return DecorationSet.empty },
apply(tr, set) {
_createDecorations = (editorState) => {
const {DecorationSet} = require("prosemirror-view");
return DecorationSet.empty;
}
public isDragging = () =>
this.view.dragging ?? (this.decorationSet !== DecorationSet.empty || !isUndefined(this.target));
init: (_, state) => {
const { from, to } = new AllSelection(state.doc);
return addDecosBetween(from, to, state.doc, DecorationSet.empty);
},
apply: (tr, prevDecos, _, state) =>