github remirror/remirror v0.4.0

This is a large release with a number of breaking changes.

Added

  • 🚀 @remirror/extension-collaboration: Collaboration library added based on the brilliant example available in tiptap.

  • 🚀 @remirror/extension-mention: Mentions can now be picked up from pasting data.

  • 🚀 @remirror/extension-code-block: Add commands toggleCodeBlock, createCodeBlock, updateCodeBlock and formatCodeBlock, add keymap support for formatting, add backspace support for better navigation and other features.

  • @remirror/core: Add CommandNodeTypeParams, CommandMarkTypeParams, CommandTypeParams which is now passed to the commands method for extensions.

  • @remirror/react-utils, @remirror/react: Add suppressHydrationWarning prop to Remirror component. Set to true to ignore the hydration warning for a mismatch between the server and client content.

  • @remirror/core: Add new extensionData method to the ExtensionManager which allows the extension to provide data on every transaction which will be available for consumption in the renderProp, React Context hooks and HOC's.

  • @remirror/core: Add getActions to the params of all extension manager methods. This will throw an error if called before initialization.

  • @remirror/core: Allow extensions to override baseExtension in the RemirrorManager component.

  • @remirror/core: Add ensureTrailingParagraph as a configuration option for the paragraph node. In some scenarios, it is difficult to place a cursor after the last element. This ensures there's always space to select the position afterwards and fixes a whole range of issues. It defaults to false otherwise it breaks a lot of tests.

  • jest-prosemirror: Enable editorViewOptions for the createEditor method. For example, now it is possible to intercept transactions with the dispatchTransaction hook.

  • @remirror/renderer-react: Pass extension options through to SSR components as a prop.

  • Add internal modifier key functions for puppeteer testing.

  • Add integration editor tests for the Wysiwyg editor.

Changes

  • 💥 BREAKING @remirror/core: Change the way commands are configured. The command function on extensions now only accepts an object with the command names being globally unique. For example, the heading extension used to return a function now it returns an object with the following signature.
{
  toggleHeading(attrs?: Attrs<{level: number}>): CommandFunction;
}

This command can now be accessed via actions.toggleHeading({ level: 2 })

This is a large breaking change and may cause a lot of your existing code to stop working 😢. However, it paves the way for a better development experience, a simpler to manage library and some exciting features using type inference. Please do bear with me as I make these changes. I truly believe they'll be worthwhile.

  • 💥 BREAKING @remirror/core: Change usage isEnabled and isActive which are now methods on the command. e.g. actions.toggleHeading.isEnabled() would check whether the toggle heading button can be used at this moment.

  • 💥 BREAKING @remirror/core: Change Extension function signature actions of active and enabled.

  • 💥 BREAKING @remirror/core: Rename getEditorState to getState.

  • 💥 BREAKING @remirror/core: Change method getPortalContainer to property portalContainer on the extension manager.

  • 💥 BREAKING @remirror/extension-mention: Complete rewrite of internals and public API with better tests and more robust editing.

  • 💥 BREAKING @remirror/extension-mention: Change MentionExtension from NodeType to MarkType. Text is now editable after a mention is created.

  • 💥 BREAKING @remirror/react: Rename setChildAsRoot to childAsRoot on RemirrorContextProviderProps and all it consumers. This affects the RemirrorContextProvider, RemirrorProvider and ManagedRemirrorProvider exports. The prop now can take a boolean or the object with props to inject into the root.

  • 💥 BREAKING @remirror/react: All RemirrorProviders now require a children prop. This prevents a bug when rendering in non-dom environments.

  • 💥 BREAKING @remirror/react: dispatchTransaction has been renamed to onDispatchTransaction. It now must return a transaction and can be used to edit the transaction that will be used to create a new state.

  • 🐛 @remirror/core: Fix bug with extension manager failing to provide attributes from the extensions.

  • 🐛 @remirror/core: Fix TypeScript type of SSRComponent. Change from Component to ComponentType.

  • 🐛 @remirror/editor-twitter: Fix bug where text area didn't expand to the full height of editor container.

Don't miss a new remirror release

NewReleases is sending notifications on new releases.