How to use the @remirror/core-helpers.includes function in @remirror/core-helpers

To help you get started, we’ve selected a few @remirror/core-helpers 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 / packages / multishift / src / multishift.ts View on Github external
onKeyDown: callAllEventHandlers(onKeyDown, event => {
        const key = getKeyName(event);
        if (includes(SPECIAL_INPUT_KEYS, key)) {
          actions.inputSpecialKeyDown(createKeyDownPayload(event, key, disabled.current));
          event.preventDefault();
        }
      }),
      // TODO test this blur handler.
github ifiokjr / remirror / packages / test-keyboard / src / test-keyboard.ts View on Github external
private fireAllEvents({ options, typing = false }: OptionsWithTypingParams) {
    this.keyDown({ options });
    if (
      !includes(noKeyPress, options.key) ||
      (typing && isUSKeyboardCharacter(options.key) && usKeyboardLayout[options.key].text)
    ) {
      this.keyPress({ options });
    }
    if (!includes(noKeyUp, options.key)) {
      this.keyUp({ options });
    }

    return this;
  }
github ifiokjr / remirror / packages / test-keyboard / src / test-keyboard.ts View on Github external
private fireAllEvents({ options, typing = false }: OptionsWithTypingParams) {
    this.keyDown({ options });
    if (
      !includes(noKeyPress, options.key) ||
      (typing && isUSKeyboardCharacter(options.key) && usKeyboardLayout[options.key].text)
    ) {
      this.keyPress({ options });
    }
    if (!includes(noKeyUp, options.key)) {
      this.keyUp({ options });
    }

    return this;
  }
github ifiokjr / remirror / packages / multishift / src / multishift.ts View on Github external
onKeyDown: callAllEventHandlers(onKeyDown, event => {
        const key = getKeyName(event);

        if (isInternalEvent(event)) {
          return;
        }

        if (includes(SPECIAL_TOGGLE_BUTTON_KEYS, key)) {
          actions.toggleButtonSpecialKeyDown(createKeyDownPayload(event, key, disabled.current));
          event.preventDefault();
        }
      }),
      onBlur: callAllEventHandlers(onBlur, event => {
github ifiokjr / remirror / packages / multishift / src / multishift.ts View on Github external
onKeyDown: callAllEventHandlers(onKeyDown, event => {
        const key = getKeyName(event);

        if (includes(SPECIAL_MENU_KEYS, key)) {
          actions.menuSpecialKeyDown(createKeyDownPayload(event, key, disabled.current));

          if (key !== 'Tab') {
            event.preventDefault();
          }
        } else if (isValidCharacterKey(key)) {
          actions.menuCharacterKeyDown(key);
        }
      }),
      onBlur: callAllEventHandlers(onBlur, event => {