github remirror/remirror v1.0.0-next.32

3 years ago

Major Changes

Minor Changes

  • 5786901c #645 Thanks @ifiokjr! - Add support for prioritized keymaps. It's now possible to make sure that a hook which consumes useKeymap runs before the extension keybindings.

    import React from 'react';
    import { ExtensionPriority } from 'remirror/core';
    import { useKeymap } from 'remirror/react/hooks';
    
    const KeymapHook = () => {
      // Make sure this keybinding group is run first!
      useKeymap({ Enter: () => doSomething() }, ExtensionPriority.Highest);
    
      // This one we don't care about 🤷‍♀️
      useKeymap({ 'Shift-Delete': () => notImportant() }, ExtensionPriority.Lowest);
    
      return <div />;
    };

    Here is a breakdown of the default priorities when consuming keymaps.

    • Hooks within remirror/react/hooks which consume useKeymap have a priority of ExtensionPriority.High.
    • useKeymap is given a priority of ExtensionPriority.Medium.
    • The createKeymap method for extensions is given a priority of ExtensionPriority.Default.
    • The baseKeymap which is added by default is given a priority of ExtensionPriority.Low.

    To change the default priority of the createKeymap method in a custom extension wrap the KeyBindings return in a tuple with the priority as the first parameter.

    import { PlainExtension, KeyBindingsTuple, ExtensionPriority, KeyBindings } from 'remirror/core';
    
    class CustomExtension extends PlainExtension {
      get name() {
        return 'custom' as const;
      }
    
      createKeymap(): KeyBindingsTuple {
        const bindings = {
          Enter: () => return true,
          Backspace: () => return true,
        }
    
        return [ExtensionPriority.High, bindings];
      }
    }
  • aa27e968 #635 Thanks @ifiokjr! - Add onError and stringHandler methods to the Remirror.ManagerSettings.

  • a830c70f #633 Thanks @ifiokjr! - Make focus command chainable and add manager.tr property for creating chainable commands. This means that the focus method returned by useRemirror() can now be safely used within a controlled editor. It uses the shared chainable transaction so that the state update does not override other state updates.

  • bed5a9e3 #616 Thanks @ankon! - Optionally allow to style the currently selected text

    This adds a new option for the builtin preset, persistentSelectionClass. If that is set to a valid CSS class name any selection in the editor will be decorated with this class.

    This can be used to keep an indication for the current selection even when the focus changes away from the editor.

  • e7b0bb0f #641 Thanks @ifiokjr! - Move isEmptyBlockNode function from @remirror/extension-positioner to @remirror/core-utils. Re-export to prevent breaking change.

  • 55e11ba3 #634 Thanks @ifiokjr! - Make mentionAtom selectable.

  • 28d1fd48 #642 Thanks @ifiokjr! - Add new signature return for useExtension and usePreset. If only provided the constructor they return a the extension or preset instance from within the manager.

Patch Changes

  • 5786901c #645 Thanks @ifiokjr! - Deprecate @remirror/react exports for usePositioner and useMultiPositioner to push adoption of remirror/react/hooks.

  • 5786901c #645 Thanks @ifiokjr! - Fix broken styles for firefox as raised on discord.

  • 28d1fd48 #642 Thanks @ifiokjr! - Fix issue with useEmoji, useKeymap and useEvents when used together with useRemirror({ autoUpdate: true }) causing an infinite loop.

  • a830c70f #633 Thanks @ifiokjr! - Fix missing version bump from last release.

  • e7b0bb0f #641 Thanks @ifiokjr! - Fix commands.insertHorizontalRule inserting the line in the wrong position.

  • Updated dependencies [55e11ba3, 28d1fd48, a830c70f, 5786901c, e7b0bb0f, e7b0bb0f, 28d1fd48, aa27e968, c8239120, a830c70f, 5786901c, 3bf621c5, bed5a9e3, 5786901c]:

    • @remirror/extension-mention-atom@1.0.0-next.32
    • @remirror/react@1.0.0-next.32
    • @remirror/core-constants@1.0.0-next.32
    • @remirror/core@1.0.0-next.32
    • @remirror/react-hooks@1.0.0-next.32
    • @remirror/core-utils@1.0.0-next.32
    • @remirror/extension-positioner@1.0.0-next.32
    • @remirror/extension-horizontal-rule@1.0.0-next.32
    • @remirror/core-helpers@1.0.0-next.32
    • @remirror/extension-code-block@1.0.0-next.32
    • @remirror/react-social@1.0.0-next.32
    • @remirror/react-wysiwyg@1.0.0-next.32
    • @remirror/core-types@1.0.0-next.32
    • @remirror/react-utils@1.0.0-next.32
    • @remirror/dom@1.0.0-next.32
    • @remirror/extension-annotation@1.0.0-next.32
    • @remirror/extension-auto-link@1.0.0-next.32
    • @remirror/extension-bidi@1.0.0-next.32
    • @remirror/extension-blockquote@1.0.0-next.32
    • @remirror/extension-bold@1.0.0-next.32
    • @remirror/extension-code@1.0.0-next.32
    • @remirror/extension-collaboration@1.0.0-next.32
    • @remirror/extension-diff@1.0.0-next.32
    • @remirror/extension-doc@1.0.0-next.32
    • @remirror/extension-drop-cursor@1.0.0-next.32
    • @remirror/extension-emoji@1.0.0-next.32
    • @remirror/extension-epic-mode@1.0.0-next.32
    • @remirror/extension-events@1.0.0-next.32
    • @remirror/extension-gap-cursor@1.0.0-next.32
    • @remirror/extension-hard-break@1.0.0-next.32
    • @remirror/extension-heading@1.0.0-next.32
    • @remirror/extension-history@1.0.0-next.32
    • @remirror/extension-image@1.0.0-next.32
    • @remirror/extension-italic@1.0.0-next.32
    • @remirror/extension-link@1.0.0-next.32
    • @remirror/extension-mention@1.0.0-next.32
    • @remirror/extension-paragraph@1.0.0-next.32
    • @remirror/extension-placeholder@1.0.0-next.32
    • @remirror/extension-position-tracker@1.0.0-next.32
    • @remirror/extension-react-component@1.0.0-next.32
    • @remirror/extension-react-ssr@1.0.0-next.32
    • @remirror/extension-search@1.0.0-next.32
    • @remirror/extension-strike@1.0.0-next.32
    • @remirror/extension-text@1.0.0-next.32
    • @remirror/extension-trailing-node@1.0.0-next.32
    • @remirror/extension-underline@1.0.0-next.32
    • @remirror/extension-yjs@1.0.0-next.32
    • @remirror/preset-core@1.0.0-next.32
    • @remirror/preset-embed@1.0.0-next.32
    • @remirror/preset-list@1.0.0-next.32
    • @remirror/preset-react@1.0.0-next.32
    • @remirror/preset-social@1.0.0-next.32
    • @remirror/preset-table@1.0.0-next.32
    • @remirror/preset-wysiwyg@1.0.0-next.32
    • @remirror/theme@1.0.0-next.32
    • @remirror/pm@1.0.0-next.32

Don't miss a new remirror release

NewReleases is sending notifications on new releases.