v0.4.0
Pre-releaseThis 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 commandstoggleCodeBlock,createCodeBlock,updateCodeBlockandformatCodeBlock, add keymap support for formatting, add backspace support for better navigation and other features. -
@remirror/core: AddCommandNodeTypeParams,CommandMarkTypeParams,CommandTypeParamswhich is now passed to thecommandsmethod for extensions. -
@remirror/react-utils,@remirror/react: AddsuppressHydrationWarningprop toRemirrorcomponent. Set to true to ignore the hydration warning for a mismatch between the server and client content. -
@remirror/core: Add newextensionDatamethod to theExtensionManagerwhich 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: AddgetActionsto the params of all extension manager methods. This will throw an error if called before initialization. -
@remirror/core: Allow extensions to overridebaseExtensionin theRemirrorManagercomponent. -
@remirror/core: AddensureTrailingParagraphas 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 thecreateEditormethod. For example, now it is possible to intercept transactions with thedispatchTransactionhook. -
@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
Wysiwygeditor.
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 usageisEnabledandisActivewhich 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 ofactiveandenabled. -
π₯ BREAKING
@remirror/core: RenamegetEditorStatetogetState. -
π₯ BREAKING
@remirror/core: Change methodgetPortalContainerto propertyportalContaineron 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: ChangeMentionExtensionfromNodeTypetoMarkType. Text is now editable after a mention is created. -
π₯ BREAKING
@remirror/react: RenamesetChildAsRoottochildAsRootonRemirrorContextProviderPropsand all it consumers. This affects theRemirrorContextProvider,RemirrorProviderandManagedRemirrorProviderexports. The prop now can take a boolean or the object with props to inject into the root. -
π₯ BREAKING
@remirror/react: All RemirrorProviders now require achildrenprop. This prevents a bug when rendering in non-dom environments. -
π₯ BREAKING
@remirror/react:dispatchTransactionhas been renamed toonDispatchTransaction. It now must return atransactionand 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 fromComponenttoComponentType. -
π
@remirror/editor-twitter: Fix bug where text area didn't expand to the full height of editor container.