How to use the prosemirror-suggest.isRemovedReason function in prosemirror-suggest

To help you get started, we’ve selected a few prosemirror-suggest 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 ifiokjr / remirror / @remirror / extension-mention / src / mention-extension.ts View on Github external
} = match;
          const create = getActions('createMention');
          const update = getActions('updateMention');
          const remove = getActions('removeMention');
          const isActive = isMarkActive({
            from: match.range.from,
            to: match.range.end,
            type: type,

            state: getState(),
          });

          const fn = isActive ? update : create;
          const isSplit = isSplitReason(reason);
          const isInvalid = isInvalidSplitReason(reason);
          const isRemoved = isRemovedReason(reason);

          const removeCommand = () => {
            setMarkRemoved();
            try {
              // This might fail when a deletion has taken place.
              isInvalid ? remove({ range: match.range }) : noop();
            } catch {
              // This sometimes fails and it's best to ignore until more is
              // known about the impact.
            }
          };

          const createCommand = ({
            replacementType = isSplit ? 'partial' : 'full',
            id = match.queryText[replacementType],
            label = match.matchText[replacementType],

prosemirror-suggest

Primitives for building your prosemirror suggestion and autocomplete functionality

MIT
Latest version published 3 months ago

Package Health Score

84 / 100
Full package analysis

Similar packages