Major Changes
- 92ed413: BREAKING: 💥 Remove export of
useSetState
and use defaultuseState
instead.
Minor Changes
-
7a34e15: Add support for returning a
Dispose
method from theonCreate
andonView
lifecycle methods for automatic cleanup in theonDestroy
handler. -
7a34e15: Add support for early return handler predicate checks. Now it's possible to use a function to check if the value received from a handler should trigger an early return.
-
7a34e15: Update return signature of
getMarkRange
from@remirror/core-utils
to also include themark
found. Additionally, to better support optional chaining it now returnsundefined
instead offalse
when no range can be found. -
7a34e15: Add
invalidMarks
support.- Add the ability to disable all input rules if a certain mark is active.
- Fix the
ItalicExtension
regex which was over eager. - Expose
decorationSet
for theprosemirror-suggest
state. - Export
markActiveInRange
,rangeHasMarks
,positionHasMarks
fromprosemirror-suggest
. - Add helpers
getMarksByTags
andgetNodesByTags
to theTagsExtension
.
-
7a34e15: Add new properties
chain
,commands
andhelpers
to simplify usage of commands and helpers within extensions. Also allow usingsetExtensionStore
within theonView
lifecycle handler, which previously was prevented.Deprecate
getCommands
,getChain
andgetHelpers
methods on theRemirror.ExtensionStore
interface. They will be removed in a future release. -
7a34e15: Add priority parameter to the
addHandler
method. Now hooks which consume theaddHandler
methods can alter the priority with which they will be run. -
525ac3d: Add
AcceptUndefined
annotation which allows options to accept undefined as their default value. -
7a34e15: Add
isSuggesterActive
helper to theSuggestExtension
. -
7a34e15: Enable disabling input rules with a
shouldSkip
method. This is now available as a handler for theInputRulesExtension
viashouldSkipInputRule
.Consuming this API looks something like this.
import { PlainExtension, Dispose } from 'remirror/core'; class CoolExtension extends PlainExtension { get name() { return 'cool'; } onCreate(): Dispose { // Add the `shouldSkip` predicate check to this extension. return this.store.getExtension(InputRulesExtension).addHandler('shouldSkipInputRule', () => { if (something) { return true; } return false; }); } }
-
7a34e15: Add
getExtension
andgetPreset
methods to theRemirror.ExtensionStore
. -
d47bd78: 🎉 Brings support for adding extra attributes to the
RemirrorManager
via extension tags. Attributes can now be added to all nodes and marks with a specific tag likeExtensionTag.Alignment
orExtensionTag.NodeBlock
. Every matching tag in theSchema
receives the extra attributes defined.With tags, you can select a specific sub selection of marks and nodes. This will be the basis for adding advanced formatting to
remirror
.import { ExtensionTag } from 'remirror/core'; import { createCoreManager, CorePreset } from 'remirror/preset/core'; import { WysiwygPreset } from 'remirror/preset/wysiwyg'; const manager = createCoreManager(() => [new WysiwygPreset(), new CorePreset()], { extraAttributes: [ { identifiers: { tags: [ExtensionTag.NodeBlock], // Can be limited by type to `node | mark`. type: 'node', }, attributes: { role: 'presentation' }, }, ], });
Each item in the tags array should be read as an
OR
so the following would matchTag1
ORTag2
ORTag3
.{ "tags": ["Tag1", "Tag2", "Tag3"] }
The
type
property (mark | node
) is exclusive and limits the type of matches that will be matched. -
92ed413: Add new
AnchorHeadParameter
export and make it a part ofPrimitiveSelection
type. -
7a34e15: Skip input rules when the
mention
is active or one of the included suggester names are active. -
7a34e15: Add
forwardDelete
tojest-remirror
andjest-prosemirror
. -
92ed413: Add support for
anchor
andhead
cursors when writing tests. Also fixselectText
when position is0
. -
7a34e15: Multiple improvements to the
prosemirror-suggest
implementation.Add support for setting a function to determine whether decorations should be ignored.
ShouldDisableDecorations
takes the current state and the active match and returns true when decorations should be disabled.Add support for
checkNextValidSelection
which is called for all suggesters to provide the opportunity to peek forward into the next valid text selection and decide whether or not any action should be taken. This is used in the@remirror/extension-mention
to fix #639.Add option
emptySelectionsOnly
to prevent matches when the text selection is not empty.Prevent non-text selection from triggering matches.
Adds missing range check to
invalidMarks
tests.
Patch Changes
-
92ed413: Fix editable mentions support for exiting when text is selected. Also update
getSelection
to supportanchor
andhead
selections. -
7a34e15: Fix forward deleting when using the
@remirror/extension-mention
#639. -
04378b5: Fix text selection causing range error when creating table.
-
Updated dependencies [7a34e15]
-
Updated dependencies [7a34e15]
-
Updated dependencies [04378b5]
-
Updated dependencies [92ed413]
-
Updated dependencies [7a34e15]
-
Updated dependencies [7a34e15]
-
Updated dependencies [7a34e15]
-
Updated dependencies [7a34e15]
-
Updated dependencies [7a34e15]
-
Updated dependencies [525ac3d]
-
Updated dependencies [7a34e15]
-
Updated dependencies [7a34e15]
-
Updated dependencies [7a34e15]
-
Updated dependencies [7a34e15]
-
Updated dependencies [92ed413]
-
Updated dependencies [d47bd78]
-
Updated dependencies [92ed413]
- @remirror/extension-mention@1.0.0-next.33
- @remirror/core@1.0.0-next.33
- @remirror/preset-table@1.0.0-next.33
- @remirror/core-utils@1.0.0-next.33
- @remirror/core-constants@1.0.0-next.33
- @remirror/extension-italic@1.0.0-next.33
- @remirror/core-types@1.0.0-next.33
- @remirror/extension-history@1.0.0-next.33
- @remirror/react@1.0.0-next.33
- @remirror/react-hooks@1.0.0-next.33
- @remirror/preset-social@1.0.0-next.33
- @remirror/react-social@1.0.0-next.33
- @remirror/dom@1.0.0-next.33
- @remirror/extension-annotation@1.0.0-next.33
- @remirror/extension-auto-link@1.0.0-next.33
- @remirror/extension-bidi@1.0.0-next.33
- @remirror/extension-blockquote@1.0.0-next.33
- @remirror/extension-bold@1.0.0-next.33
- @remirror/extension-code@1.0.0-next.33
- @remirror/extension-code-block@1.0.0-next.33
- @remirror/extension-collaboration@1.0.0-next.33
- @remirror/extension-diff@1.0.0-next.33
- @remirror/extension-doc@1.0.0-next.33
- @remirror/extension-drop-cursor@1.0.0-next.33
- @remirror/extension-emoji@1.0.0-next.33
- @remirror/extension-epic-mode@1.0.0-next.33
- @remirror/extension-events@1.0.0-next.33
- @remirror/extension-gap-cursor@1.0.0-next.33
- @remirror/extension-hard-break@1.0.0-next.33
- @remirror/extension-heading@1.0.0-next.33
- @remirror/extension-horizontal-rule@1.0.0-next.33
- @remirror/extension-image@1.0.0-next.33
- @remirror/extension-link@1.0.0-next.33
- @remirror/extension-mention-atom@1.0.0-next.33
- @remirror/extension-paragraph@1.0.0-next.33
- @remirror/extension-placeholder@1.0.0-next.33
- @remirror/extension-position-tracker@1.0.0-next.33
- @remirror/extension-positioner@1.0.0-next.33
- @remirror/extension-react-component@1.0.0-next.33
- @remirror/extension-react-ssr@1.0.0-next.33
- @remirror/extension-search@1.0.0-next.33
- @remirror/extension-strike@1.0.0-next.33
- @remirror/extension-text@1.0.0-next.33
- @remirror/extension-trailing-node@1.0.0-next.33
- @remirror/extension-underline@1.0.0-next.33
- @remirror/extension-yjs@1.0.0-next.33
- @remirror/preset-core@1.0.0-next.33
- @remirror/preset-embed@1.0.0-next.33
- @remirror/preset-list@1.0.0-next.33
- @remirror/preset-react@1.0.0-next.33
- @remirror/preset-wysiwyg@1.0.0-next.33
- @remirror/react-wysiwyg@1.0.0-next.33
- @remirror/core-helpers@1.0.0-next.33
- @remirror/react-utils@1.0.0-next.33
- @remirror/theme@1.0.0-next.33