remirror

ProseMirror toolkit for React 🎉

MIT License

Downloads
14.7M
Stars
2.6K
Committers
81

Bot releases are hidden (Show)

remirror - v1.0.0-next.28

Published by ifiokjr about 4 years ago

Major Changes

  • 0400fbc8 #591 Thanks @ifiokjr! - Add support for nested content within ReactComponent node views. Also support adding multiple components to the manager via the nodeViewComponents setting. Currently ReactNodeView components must be defined at initialization, and marks are not supported.

    • Also enforce minimum required extensions for the manager passed to the RemirrorProvider.
    • Some general cleanup and refactoring.
    • Add support for composing refs when using getRootProps. Now you can add your own ref to the getRootProps({ ref }) function call which will be populated at the same time.
    • Test the names of Extension's and Preset's in with extensionValidityTest.
    • BREAKING CHANGES 💥
      • Rename: ReactSSRExtension => ReactSsrExtension
      • Rename: ReactComponentExtension.name from reactNodeView => reactComponent.
      • Rename: NodeViewsExtension => NodeViewExtension
      • Rename: NodeViewsExtension => NodeViewExtension
      • Rename: SuggestExtension.name from suggestions => suggest

Patch Changes

remirror - v1.0.0-next.27

Published by ifiokjr about 4 years ago

Major Changes

  • a7436f03: 🎉 Add support for consuming styles with styled-components and emotion as requested
    by a sponsor - #550.

💥 BREAKING CHANGE - Remove exports from @remirror/theme.

  • createAtomClasses
  • defaultRemirrorAtoms
remirror - v1.0.0-next.26

Published by ifiokjr about 4 years ago

Major Changes

  • a2bc3bfb: Support for extending the ExtensionTag with your own custom types and names to close
    #465. Deprecates NodeGroup and MarkGroup which will be removed in a future version.
    • A small breaking change removes some related type exports from @remirror/core.
    • Add the ability to mutateTag for creating custom tags in custom extensions.
    • Update several to use tags as a replacement for the spec group.

Minor Changes

  • 147d0f2a: 🚀 Now featuring support for DynamicExtraAttributes as mentioned in
    #387.
    • Also add support for action method being passed to findChildren, findTextNodes,
      findInlineNodes, findBlockNodes, findChildrenByAttribute, findChildrenByNode,
      findChildrenByMark and containsNodesOfType.
    • Deprecate flattenNodeDescendants. findChildren is now the preferred method and automatically
      flattens the returned output.

Patch Changes

remirror - v1.0.0-next.25

Published by ifiokjr about 4 years ago

Minor Changes

  • e37d64de: Add range parameter to commands.insertText. Closes #327.
  • 3f2625bf: Add a new mark input rule parameter property, updateCaptured which allows the
    developer to tweak the details of the captured detail rule. This provides a workaround for the a
    lack of support for the lookbehind regex in Safari and other browsers. Fixes #574.

Patch Changes

remirror - v1.0.0-next.24

Published by ifiokjr about 4 years ago

Minor Changes

remirror - v1.0.0-next.23

Published by ifiokjr about 4 years ago

Patch Changes

remirror - v1.0.0-next.22

Published by ifiokjr about 4 years ago

Major Changes

  • 45d82746: 💥 Remove AttributesWithClass.
  • 💥 Add selectTextOnClick and default to false. Previously the whole link would be selected when clicking on a link. Now it's configurable.
  • 113560bb: Required temporary fix to resolve issue with unlinked packages in prerelease mode. See the issue for more details.
  • 9ab1d0f3: Remove ExtensionType enum which is no longer used.

Minor Changes

  • Export emptyCoords object from @remirror/extension-positioner.
  • Add second parameter to usePositioner hook which can override when a positioner should be set to active.
  • 🚀 Add NodeAttributes and MarkAttributes exports which can be extended in the Remirror.ExtraNodeAttributes and Remirror.ExtraMarkAttributes.
  • 🚀 Add isAllSelection which checks if the user has selected everything in the active editor.

Patch Changes

remirror - v1.0.0-next.21

Published by ifiokjr about 4 years ago

Major Changes

  • 8c34030e: 💥 Remove property updateSelection from the nodeInputRule, markInputRule and
    plainInputRule functions. You should use the new beforeDispatch method instead.

    Add new beforeDispatch method to the nodeInputRule, markInputRule and plainInputRule
    parameter. This method allows users to add extra steps to the transaction after a matching input
    rule has been run and just before it is dispatched.

    import { nodeInputRule } from 'remirror/core';
    
    nodeInputRule({
      type,
      regexp: /abc/,
      beforeDispatch: ({ tr }) => tr.insertText('hello'),
    });
    

Minor Changes

  • baf3f56d: Add ignoreWhitespace option to markInputRule for ignoring a matching input rule if
    the capture groups is only whitespace. Apply to all wrapping input rules for MarkExtension's in
    the project.

    Fix #506 ItalicExtension issue with input rule being greedy and capturing one preceding
    character when activated within a text block.

Patch Changes

remirror - v1.0.0-next.20

Published by ifiokjr about 4 years ago

Major Changes

  • 6d7edc85: Rename areSchemaCompatible to areSchemasCompatible.

Minor Changes

  • Fix the controlled editor when used in StrictMode.

  • 8f9eb16c: Enable all selection when setting initial content and focusing on the editor.

    import { useRemirror } from 'remirror/react';
    
    const { focus } = useRemirror();
    focus('all');
    

Patch Changes

remirror - v1.0.0-next.19

Published by ifiokjr about 4 years ago

Patch Changes

remirror - v1.0.0-next.18

Published by ifiokjr about 4 years ago

Patch Changes

  • 2059da35: Fix broken entry point remirror/extension/annotation from remirror.
remirror - v1.0.0-next.17

Published by ifiokjr about 4 years ago

Major Changes

  • 4498814f: Rename UsePositionerHookReturn and UseMultiPositionerHookReturn to
    UsePositionerReturn and UseMultiPositionerReturn.

Patch Changes

remirror - v1.0.0-next.16

Published by ifiokjr about 4 years ago

Major Changes

  • e518ef1d: Rewrite the positioner extension with a new API for creating positioners.

    Positioners now return an array of VirtualPositions or an empty array if no positions extension.

    @remirror/react - Add useMultiPositioner. @remirror/react - Add virtualNode property for
    compatibility with popper-react

    An example of creating a new positioner with the new API is below.

    import { Positioner, Coords, hasStateChanged } from '@remirror/extension-positioner';
    
    export const cursorPopupPositioner = Positioner.create<Coords>({
      hasChanged: hasStateChanged,
    
      /**
       * Only active when the selection is empty (one character)
       */
      getActive: (parameter) => {
        const { state, view } = parameter;
    
        if (!state.selection.empty) {
          return [];
        }
    
        return [view.coordsAtPos(state.selection.from)];
      },
    
      getPosition(parameter) {
        const { element, data: cursor } = parameter;
        const parent = element.offsetParent;
    
        if (!parent) {
          return emptyVirtualPosition;
        }
    
        // The box in which the bubble menu is positioned, to use as an anchor
        const parentBox = parent.getBoundingClientRect();
    
        // The popup menu element
        const elementBox = element.getBoundingClientRect();
    
        const calculatedLeft = cursor.left - parentBox.left;
        const calculatedRight = parentBox.right - cursor.right;
    
        const bottom = Math.trunc(cursor.bottom - parentBox.top);
        const top = Math.trunc(cursor.top - parentBox.top);
        const rect = new DOMRect(cursor.left, cursor.top, 0, cursor.bottom - cursor.top);
        const left =
          calculatedLeft + elementBox.width > parentBox.width
            ? calculatedLeft - elementBox.width
            : calculatedLeft;
        const right =
          calculatedRight + elementBox.width > parentBox.width
            ? calculatedRight - elementBox.width
            : calculatedRight;
    
        return { rect, right, left, bottom, top };
      },
    });
    
  • be9a9c17: Move all keymap functionality to KeymapExtension from @remirror/core. Remove all
    references to @remirror/extension-base-keymap.

Minor Changes

  • 206c1405: Extension to annotate content in your editor
  • f032db7e: Remove isEmptyParagraphNode and absoluteCoordinates exports from
    @remirror/core-utils.
  • 2592b7b3: Allow runtime updates of PlaceholderExtension emptyNodeClass option.

Patch Changes

remirror - v1.0.0-next.15

Published by ifiokjr about 4 years ago

Major Changes

  • cdc5b801: Add three new helpers to @remirror/core-utils / @remirror/core: isStateEqual,
    areSchemaCompatible and getRemirrorJSON.

    BREAKING: 💥 Rename getObjectNode to getRemirrorJSON.

  • 0ff4fd5c: Default to inserting a new paragraph node after the HorizontalRuleExtension.

    BREAKING: 💥 Rename horizonalRule command to insertHorizontalRule.

    Add a new option insertionNode to the HorizontalRuleExtension which sets the default node to
    automatically append after insertion.

    Update the css styles for the default hr tag.

    Closes #417

Minor Changes

  • 44516da4: Support chained commands and multiple command updates in controlled editors.

    Fixes #418

  • e5ea0c84: Add support for Handler options with custom return values and early returns.

    Previously handlers would ignore any return values. Now a handler will honour the return value.
    The earlyReturn value can be specified in the static options using the extensionDecorator.
    Currently it only supports primitives. Support for a function to check the return value will be
    added later.

  • 08e51078: Add insertHardBreak command.

    Add inline documentation instructing developers to use the TrailingNodeExtension when using
    hardBreak to exit a codeBlock.

  • f91dcab1: 🎉 New extension @remirror/extension-events.

    This extension adds handlers for the events happening within the remirror editor. The extension is
    part of the CorePreset but it doesn't make it's handlers available to the preset. In order to
    use the handlers you will need direct access to the EventsExtension.

    import { EventsExtension } from 'remirror/extension-events';
    import { useExtension } from 'remirror/react';
    
    const Editor = () => {
      useExtension(
        EventsExtension,
        ({ addHandler }) => {
          addHandler('focus', () => log('focused'));
        },
        [],
      );
    };
    

    To begin with the only events added are focus and blur.

Patch Changes

remirror - v1.0.0-next.3

Published by ifiokjr over 4 years ago

Patch Changes

  • @remirror/pm - Update ProseMirror dependencies to the latest versions.
remirror - v1.0.0-next.2

Published by ifiokjr over 4 years ago

Major Changes

  • The whole API for remirror has completely changed. These pre-release versions are a breaking
    change across all packages. The best way to know what's changed is to read the documentaion on the
    new documentation site https://remirror.io.

  • 28bd8bea: This is a breaking change to the structure of published npm packages.

    • Move build directory from lib to dist
    • Remove option for multiple entry points. It is no longer possible to import module from
      '@remirror/core/lib/custom'
    • Only use one entry file.
    • Remove declaration source mapping for declaration files
    • Remove the src directory from being published.
  • 7b817ac2: Rename all types and interfaces postfixed with Params to use the postfix Parameter.
    If your code was importing any matching interface you will need to update the name.

  • 09e990cb: Update EditorManager / ExtensionManager name to be **RemirrorManager.

Minor Changes

  • Previously the useRemirror hook only updated when the provider was updated. There are times when
    you want to listen to specific changes from inside the editor.

    The useRemirror hook now takes an optional onChange argument which is called on every change
    to the editor state. With this you can react to updates in your editor and add some really cool
    effects.

  • Add support for React.StrictMode.

    Previously, activating StrictMode would cause the components to render twice and break
    functionality of RemirrorProvider due to an outdated check on whether getRootProps had been
    called. This check has been removed since it isn't needed anymore.

remirror - v0.7.0

Published by ifiokjr almost 5 years ago

  • 🚀 @remirror/react, @remirror/editor-wysiwyg, @remirror/editor-social: New extensions props on the RemirrorManager for injecting additional extensions into prebuilt editors https://github.com/ifiokjr/remirror/pull/176.
remirror - v0.6.0

Published by ifiokjr about 5 years ago

Added

  • jest-prosemirror: New snapshot serializer exported as prosemirrorSerializer.
  • jest-prosemirror: New debug method which logs the editor's prettified html to the console.
  • prosemirror-suggest: Now supports ignoring activation characters to prevent matches from appearing in ignored sections.

Changes

  • @remirror/extension-mention: Fix a long standing bug where the editor crashes after deleting a single character mention.
remirror - v0.5.0

Published by ifiokjr about 5 years ago

Added

  • 🚀 @remirror/react-hooks: New package for shared react hooks.

  • 🚀 @remirror/react-portals: New package for the remirror / react portals.

  • 🚀 @remirror/react-node-view: New package for prosemirror node views built with react components.

  • 🚀 @remirror/dev: New package developing extensions and components.

  • 🚀 prosemirror-suggest: New package for managing prosemirror suggestions.

  • 🚀 test-keyboard: New package for dispatching keyboard events.

  • 🚀 @remirror/ui, @remirror/ui-buttons, @remirror/ui-dropdown, @remirror/ui-icons, @remirror/ui-menus, @remirror/ui-modal, @remirror/ui-text: New packages and several utilities for managing the ui of a remirror editor.

  • 🚀 @remirror/core: Introduce the concept of meta tags for extensions. These allow an extension to tag itself and these tags are made available through the tag object which is passed to all extension methods.

  • 🚀 @remirror/core: Add a helpers method to extensions. These are similar to commands except they don't have access to the view and shouldn't directly affect the editor. They can also return data and receive custom parameters. They can be accessed with manager.data.helpers.myHelper().

  • 🚀 @remirror/core-extensions: Add TrailingNodeExtension to always append a specified node to the end of the dom.

  • @remirror/core: Add getExtraAttrs method to the extension which can be used in the (Mark/Node)Extension.

  • 🚀 @remirror/core: Add DropCursorExtension for a cursor to show up at the exact location an item will be dropped.

  • 🚀 @remirror/core: Add GapCursorExtension for support of tricky to select locations.

  • Introduce new @builtin annotation to show when an extension is included by default.

  • Introduce new @schema annotation for extension options to indicated that an option should not be updated after creating or it will change the schema.

  • New command yarn generate:json which auto generates json files for support/rollup/rollup.config.js, support/storybook/.babelrc.js, support/tsconfig.paths.json and .size-limit.json. Previously these were maintained manually.

Changes

  • 💥 BREAKING @remirror/react-renderer: Updated the name of @remirror/renderer-react for consistency.

  • 💥 BREAKING @remirror/core: @emotion/core is now a peerDependency. When adding this library to your project you will need to yarn add @emotion/core as well. This is required to prevent bugs with version conflicts within the EmotionThemeProvider.

  • 💥 BREAKING @remirror/core: deepMerge now takes multiple parameters instead of one array of objects to merge.

  • 💥 BREAKING @remirror/core @remirror/core-extensions and all extensions: Refactor ExtensionTypes with a whole set of helpers for better type checking and self documenting types. Now the remirror component can receive the List of Extensions and from this infer the nodes, marks and actions available on any editor. Currently this inference has only been added to the Wysiwyg editor but will be added to the Twitter editor and all future editors.

  • 💥 BREAKING @remirror/core @remirror/core-extensions: Move ParagraphExtension from core to core-extensions. The reason is to not pollute the core library with formatting methods which are primarily just for extensions.

  • 💥 BREAKING @remirror/core: Rename ExtensionType.EXTENSION = 'extension' to ExtensionType.Plain = 'plain'.

  • 💥 BREAKING @remirror/ui: Rename @remirror/react-components to @remirror/ui. It is now the base component that will be used for all ui related functionality.

  • 💥 BREAKING @remirror/react-utils: Refactor the type signature of node views and improve their design. Now node view takes attrs and options.

  • 💥 BREAKING @remirror/react: Rename NodeViewPortalComponent to RemirrorPortals since it now supports decorations.

  • 💥 BREAKING @remirror/react: Change the name of useRemirror to useRemirrorContext.

  • 💥 BREAKING @remirror/editor-social: Rename @remirror/editor-twitter to @remirror/editor-social for branding reasons.

  • 💥 BREAKING @remirror/core: Rename NodeViewPortalContainer to PortalContainer.

  • 💥 BREAKING @remirror/core: Refactor the type signature of SSRComponents to only take a node and options extraAttrs configuration to enable parsing the dom.

  • 💥 BREAKING jest-prosemirror: Names of matchers have been changed. transformsPMNode is now toTransformNode and toEqualPMNode is now toEqualProsemirrorNode.

  • @remirror/core: Update extraAttrs configuration to enable parsing the dom.

  • @remirror/core: Make default priority level for extensions 3 instead of 2. A lower number means the extension is deemed more important and ordered earlier in lists.

  • @remirror/core-extensions: Add extraAttrs to the following extensions: LinkExtension, ParagraphExtension, HeadingExtension.

Remove

  • 💥 BREAKING @remirror/renderer-react: Removed package.
  • 💥 BREAKING @remirror/react-utils: Remove placeholder prop from the RemirrorManager.
  • 💥 BREAKING @remirror/react: Remove higher order components.
  • 💥 BREAKING @remirror/react: Remove withoutEmotion prop. This should now be configured via the RemirrorThemeProvider component.
remirror - v0.4.2-canary.2

Published by ifiokjr about 5 years ago

Major Changes

  • Refactor: react-node-view: 7f5da5f852db06fb7ca4848db4d0b12ee430edd6
  • Refactor: remove placeholder prop from manager: 681a269388494306d6fbe84ad1a5bc2ee01195c8

Minor Changes

  • Feat: new package @remirror/dev: #136
  • Refactor: change default priority from 3 to 2: eed449c5849052786ed53cf2e2e9aea5ad2cff92
  • Fix: wysiwyg ordering of marks: f14a68cb84d110a96144b0fbaf752679fa4298b0
  • Feat: add hook and context support for portals: bdf2f82f967897661e40d90d749866f9e7cc7a4c
  • Feat: auto delete portals on container removal: cfdb0470dfb7dea98b86d759e3e15d729cf14ff1
  • Feat: add helper methods to extensions: 59547d534cac2559090f4e21cbc3d140bc006336
  • Feat: new position tracker extension: d6f09ecb1fc8bf5aaa583877b7f16c744732bfbb
  • Feat: add new get utility method: 0b879d3cae27b85a83404b764f256ab193926dbf

Patches

  • Refactor: update remirror styles to use css fn: e3574c4906544c07e618c57eb69a109821ee847e
  • Refactor: remirror-portals: ba5d0c95c08ddc85354c4f8083e66a75c85733b1
  • Refactor: append mutation observer to head not body: 8420f67c56bd95ce39fd3ad9509a83b95d5c03f0
  • Refactor: further changes to react-node-view: eecd93094600361b090d14d9532dd44bb560c187