Bot releases are hidden (Show)
Published by ifiokjr about 4 years ago
bcf3b2c4
#731 Thanks @ifiokjr! - Bump dependencies with minor and patch updates.
bcf3b2c4
#731 Thanks @ifiokjr! - Fix support for jest-remirror
with versions before the 16
release.
Deprecate jsdomExtras
which has been replaced by jsdomPolyfill
.
8ce923a4
#733 Thanks @ifiokjr! - Fix incorrect usage of endsWith
in ValidityTest
s.
Updated dependencies [bcf3b2c4
]:
Published by ifiokjr about 4 years ago
b030cb6e
#728 Thanks @ifiokjr! - Add text
property to the return value from getMarkRange
. It's a common use case when getting the range of the mark to also extract the text content.a02dd7d1
#730 Thanks @ronnyroeller! - Support forcefully redrawing annotations
Annotations can be styled with a custom getStyle
function. Yet, changes to outcome of the function (e.g. when the color schema is dynamically updated) won't automatically reflect in the editor.
commands.redrawAnnotations
can now be called to force an update.
b674f906
#729 Thanks @ifiokjr! - Make annotation commands chainable.
bdea98bf
#725 Thanks @ronnyroeller! - Fix: Don't extend annotation when typing at end of annotation
Annotations auto-adjust as users enter content, e.g. an annotation grows if the user types in the middle of the annotation. Incorrectly, the annotation also grew when the user added content directly after the annotation. Now, this leads to new, non-annotated content.
b674f906
#729 Thanks @ifiokjr! - Make formatCodeBlock
command chainable.
Updated dependencies [b674f906
, a02dd7d1
, b674f906
, b674f906
, bdea98bf
, b030cb6e
]
Published by ifiokjr about 4 years ago
9fa07878
#721 Thanks @ifiokjr! - Add new helpers getChangedRanges
, getChangedNodeRanges
and getChangedNodes
which take a transaction and return a list of changed ranges, node ranges or nodes with positions.
This is useful for increasing the performance and only checking the parts of the document that have changed between updates.
6f2ababd
#721 Thanks @ifiokjr! - Improve performance of the CodeBlockExtension
by only updating syntax highlighting for the changed code block(s).
ef1f57c2
#718 Thanks @ronnyroeller! - Remove annotations when their content is deleted
Users can create annotations on pieces of content. The annotations are automatically updated as the content is moved around, e.g. if a new word is inserted before the annotation. Yet, the extension missed the case that all annotated content is deleted. Before, this would lead to an empty annotation (to and from parameter are equal). With this commit, annotations are automatically removed when the content is completed deleted.
44754a5d
#723 Thanks @ronnyroeller! - Support multi-line annotations in positioner
The annotation positioner placed the bottom on the bottom of the first line. This meant that a popup placed on the bottom would overlay the rest of a multi-line annotation. Now, the positioner returns the bottom of the last line, allowing to place the popup below all content.
802d5f04
#720 Thanks @ronnyroeller! - Gracefully handle annotations with positions outside the content
Annotations are loaded separately from the content into the editor (helpers.setAnnotations vs setContent). This can lead to situations where annotations are pointing to positions that are outside the content. For example, the editor shows content with annotations. Then, the user requests to change the content to an empty document. At this point, until helpers.setAnnotations() is called, the editor will have an empty document but still a list of annotations.
At that point, helpers.getAnnotations() would throw the following error because it couldn't find the matching text for the from/to positions: TypeError: Cannot read property 'nodeSize' of 'undefined'
.
d33f43bf
#717 Thanks @ifiokjr! - Fix type annotations for createCommands
functions. This was causing issues with inferring all the commands available across the extensions since the types were compiling as any
.
The following should now work with full type inference.
import React from 'react';
import { useRemirror } from 'remirror/react';
const EditorButton = () => {
const { commands, chain } = useRemirror();
return (
<>
<button onClick={() => commands.toggleBulletList()}>Toggle List</button>
<button
onClick={() => chain.toggleBold().toggleStrike().toggleItalic()}
>
Cray!
</button>
</>
);
};
d33f43bf
#717 Thanks @ifiokjr! - Improve type inference for @remirror/styles/emotion
, @remirror/styles/dom
and @remirror/styles/styled-components
.
d33f43bf
#717 Thanks @ifiokjr! - Improve inference for multishift
exports.
Updated dependencies [ef1f57c2
, 44754a5d
, 802d5f04
, 6f2ababd
, 9fa07878
, d33f43bf
]
Published by ifiokjr about 4 years ago
Published by ifiokjr about 4 years ago
e4701dc4
#712 Thanks @ifiokjr! - BREAKING: π₯ Rename Remirror.All
to Remirror.AllExtensionUnion
.
83217437
#712 Thanks @ifiokjr! - π Add findPositionerTracker
, findAllPositionTrackers
and isSelectionEmpty
to builtin helpers.
6644a391
#705 Thanks @ronnyroeller! - Support custom annotations for custom styling (typing)e4701dc4
#712 Thanks @ifiokjr! - Add Remirror.AllExtensionUnion
to the useRemirror
hook. Now the commands and helpers for all extensions should automatically discover their API's.e4701dc4
, 83217437
, e4701dc4
, 6644a391
]Published by ifiokjr about 4 years ago
Published by ifiokjr about 4 years ago
7c5778ed
#700 Thanks @ifiokjr! - π Add support for position tracking to CommandsExtension
.
commands.addPositionTracker
commands.removePositionTracker
.commands.clearPositionTrackers
.@remirror/core
including delayedCommand
which is a building block for creating your own delayed commands.clearRangeSelection
to emptySelection
and fix a bug where it would always select the from
rather than the anchor
.this.store.rawCommands
for access to the original command functions which can sometimes come in handy. Also add it to the manager store and export new type named RawCommandsFromExtensions
initialState
as a property of the BaseFramework
.Framework
to be attached to the manager before any calls to getState
are allowed. If you're using jest-remirror
this change might break some of your tests that don't recreate the editor between tests.commands.insertText
now support delayed commands.commands.insertText
now supports adding marks to the added text.commands.insertText('Hello', {
marks: {
// The empty object `{}` represents the attributes being added.
bold: {},
},
});
227657ae
#700 Thanks @ifiokjr! - BREAKING: π₯ Remove @remirror/position-tracker
extension from the repository and remove remirror/extension/position-tracker
as a potential import.
add65c90
#700 Thanks @ifiokjr! - BREAKING: π₯ Remove exports for flatten
and emptyCommandFunction
which are unused in the codebase and not very practical.
Update API for findChildrenByAttribute
to only support an object of attributeNames and literal value or predicate value.
const mergedCells = findChildrenByAttribute({
node: table,
attrs: { colspan: 2, id: (_, exists) => exists },
});
89bd1e86
#702 Thanks @ronnyroeller! - Visualize the amount of overlapping annotations
The annotation-extension would allow to style individual annotations via a CSS class. This led to issues with overlapping annotations. For example, if an annotation with a red background and another with a green background were overlapping, the editor would show (more or less) randomly one of the two colors. Now, the annotation-extension allows users to style decorations based on all overlapping annotations within a given decoration. The default implementation visualizes overlapping annotations by showing a darker shade the more annotations are overlapping.
07aab2e8
#700 Thanks @ifiokjr! - Improve style output and fix CSS output issues.
643555cc
#700 Thanks @ifiokjr! - Export createEditorView
from @remirror/react
.
cbf15ec4
#698 Thanks @ifiokjr! - Fix bad setState()
warning when rendering a controlled RemirrorProvider
with child component. By wrapping the controlled state update within useLayoutEffect
hook,updates now synchronously happen during the commit phase. useEffect
caused errors in ProseMirror due to the asynchronous update.cbf15ec4
#698 Thanks @ifiokjr! - Check EditorView
has been added to framework before removing the focus and blur listeners.4b1d99a6
#700 Thanks @ifiokjr! - Fix type of RemirrorJSON
attrs to support all Literal
values.1808a9e9
#700 Thanks @ifiokjr! - Pass command through to onMentionChange
to fix #701 and give users control over when they want to ensure the mention is created.7c5778ed
, cbf15ec4
, add65c90
, 89bd1e86
, 4b1d99a6
, cbf15ec4
, fd694d61
, 1808a9e9
, 643555cc
]:
Published by ifiokjr about 4 years ago
Published by ifiokjr about 4 years ago
913e8e68
#689 Thanks @ifiokjr! - BREAKING: π₯ Rename Framework.frameworkHelpers
to baseOutput
and make it protected.
abstract
getter frameworkOutput
.Output
which extends FrameworkOutput
.manager
property from FrameworkOutput
.54ae06d4
#689 Thanks @ifiokjr! - Remove childAsRoot
prop from RemirrorProvider
.
RemirrorProvider
.autoRender
prop to the RemirrorProvider
which automatically adds an editable div
to contain the ProseMirror editor. it can take values start
and end
to determine whether the div is insert before (start
) all other children, or after (end
).6855ee77
#689 Thanks @ifiokjr! - Remove logError
method from the RemirrorError
. Add disableLogging
as a property instead.
8cd47216
#689 Thanks @ifiokjr! - Remove isRemirrorContextProvider
export.
efd2e537
#689 Thanks @ifiokjr! - Add output
property to the RemirrorManager
. The property will throw an error if used before the framework is attached.
Add the frameworkAttached
property to the RemirrorManager
which is true when the manager.output
is available.
14e48698
Thanks @ifiokjr! - Update the selection
, storedMarks
and doc
from the chainableEditorState
whenever the state.tr
property is accessed. This better mimics the behavior expected within commands where the Transaction
is created once at the start and the state is used as a reference point.14e48698
, 913e8e68
, efd2e537
, 8cd47216
, 54ae06d4
, 6855ee77
, 54ae06d4
]:
Published by ifiokjr about 4 years ago
a3383ca4
#686 Thanks @ifiokjr! - BREAKING: π₯ Complete move of useMultiPositioner
and usePositioner
to @remirror/react-hooks
. The imports are no longer available via @remirror/react
after being deprecated for a few weeks.5a3dd95f
#686 Thanks @ifiokjr! - Add all extensions to the Remirror.AllExtensions
interface to support automatic TypeScript inference for every installed extension package.
fb046735
#686 Thanks @ifiokjr! - Add @remirror/pm
as a direct dependency of the remirror
package to reduce the number of packages that need to be installed.
remirror
.9b48d110
#686 Thanks @ifiokjr! - Fix some bugs with the LinkExtension
around auto linking.
autoLink
option now defaults to false
and has an impact on the extension functionality. Fixes #682.Updated dependencies [5a3dd95f
, a3383ca4
, 9b48d110
, 5a3dd95f
]:
Published by ifiokjr about 4 years ago
0876a5cc
#678 Thanks @ifiokjr! - Fix broken TableExtension
lifecycle method for onStateUpdate
. Fixes #677.
0876a5cc
#678 Thanks @ifiokjr! - Add tr
and transactions
property to onStateUpdate
for DOM framework implementation.
Updated dependencies [0876a5cc
, 0876a5cc
]:
Published by ifiokjr about 4 years ago
ffa36163
#676 Thanks @ifiokjr! - Add support for autoLink
in LinkExtension
. The option defaults to false and must be turned on. This is intended to replace the AutoLinkExtension
.
import { LinkExtension } from 'remirror/extension-link';
const link = new LinkExtension({ autoLink: true });
// Or you can turn it on and off during run time.
link.setOptions({ autoLink: true });
34b0f0b3
#676 Thanks @ifiokjr! - Add new store.getCommandParameter
method which returns the properties required to run a command.
4fee3e94
#676 Thanks @ifiokjr! - Add chainableEditorState
which makes the EditorState
chainable with a shared transaction. Also set the @remirror/pm
entry point to export types and utility methods. This is now used in the core libraries.
b155ff47
#676 Thanks @ifiokjr! - Make list commands chainable.
273db89f
#676 Thanks @ifiokjr! - Make table commands chainable.
1b6b2922
#670 Thanks @ifiokjr! - Fixes toggleList
command to only update the transaction when dispatch is provided [#669].
725df02b
#672 Thanks @ifiokjr! - Reduce bundle size by updating babel configuration thanks to help from preconstruct/preconstruct/297. Fixes #358.
f9760792
#676 Thanks @ifiokjr! - Upgrade linaria and other dependencies
2a43f303
#676 Thanks @ifiokjr! - Fix auto-link extension regex when used with a slash. Fixes #673.
3a5ad917
Thanks @ifiokjr! - Pin peerDependencies
for @remirror/react-hooks
.
Updated dependencies [34b0f0b3
, 2a43f303
, 3a5ad917
, 273db89f
, 1b6b2922
, 725df02b
, 4fee3e94
, ec941d73
, ffa36163
, f9760792
, b155ff47
]:
Published by ifiokjr about 4 years ago
175c9461
#676 Thanks @ifiokjr! - π₯checkNextValidSelection
method is now run in the appendTransaction
plugin hook and should only update the provided transaction. It receives the Transaction
now instead of EditorState
and another parameter for matches
provides the name of the changed suggester and the exited suggester. Both can be undefined.
Suggester
Options
caseInsensitive
option for case insensitive matches.multiline
options for matches that can span multiple lines`.appendTransaction
option which when true will run the onChange
handler in the appendTransaction
plugin hook and expect the transaction to be synchronously updated.transaction
parameter to the onChange
handler for when appendTransaction
is true.SuggestState
findNextTextSelection
which can be used to find the next text selection.findMatchAtPosition
which finds the match for the provided suggester name at the given ResolvedPos
. If no suggester name is provided then it looks through all Suggester
s.Other
725df02b
#672 Thanks @ifiokjr! - Reduce bundle size by updating babel configuration thanks to help from preconstruct/preconstruct/297. Fixes #358.
Updated dependencies [725df02b
]:
Published by ifiokjr about 4 years ago
db7165f1
#665 Thanks @ifiokjr! - Refactor RemirrorManager
and rename EditorWrapper
to Framework
.
BaseFramework
interface which is implemented by the abstract Framework
class and used by the RemirrorManager
to keep hold of an instance of the Framework
.attachFramework
method on the manager.doc
property to document
throughout the codebase. doc
could be confused with the doc
node or the actual document. Now it's clearer. Any time doc
is mentioned in the code base it refers to the ProseMirror
node. Any time document
is mentioned it is referring to the DOM.SocialEditorWrapperComponent
export from @remirror/react-social
.5945dffe
#667 Thanks @ifiokjr! - Remove Merge
export from @remirror/core-helpers
.
5945dffe
#667 Thanks @ifiokjr! - Remove unused useMeasure
hook from @remirror/react
.
27b358e4
#668 Thanks @ifiokjr! - Add support for exiting code mark at the end of a block node.
27b358e4
#668 Thanks @ifiokjr! - Add MarkSupportsExit
tag to ExtensionTag
constant export.
Add KeymapExtension
option exitMarksOnArrowPress
which allows the user to exit marks with the MarkSupportExit
tag from the beginning or the end of the document.
Store tags as markTags
, nodeTags
, plainTags
and deprecate the helper methods which were previously doing this.
Add extraTags
option to the extension and RemirrorManager
now extra can be added as part of the configuration.
27b358e4
#668 Thanks @ifiokjr! - Support lazy functions which return an extension list in the createDomManager
.
27b358e4
#668 Thanks @ifiokjr! - Fix node
cursor selection. Now it selects the right node position.
Updated dependencies [27b358e4
, 27b358e4
, db7165f1
, 27b358e4
, 5945dffe
, 5945dffe
]:
Published by ifiokjr about 4 years ago
useSetState
and use default useState
instead.7a34e15d: Add support for returning a Dispose
method from the onCreate
and onView
lifecycle methods for automatic cleanup in the onDestroy
handler.
7a34e15d: 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.
7a34e15d: Update return signature of getMarkRange
from @remirror/core-utils
to also include the mark
found. Additionally, to better support optional chaining it now returns undefined
instead of false
when no range can be found.
7a34e15d: Add invalidMarks
support.
ItalicExtension
regex which was over eager.decorationSet
for the prosemirror-suggest
state.markActiveInRange
, rangeHasMarks
, positionHasMarks
from prosemirror-suggest
.getMarksByTags
and getNodesByTags
to the TagsExtension
.7a34e15d: Add new properties chain
, commands
and helpers
to simplify usage of commands and helpers within extensions. Also allow using setExtensionStore
within the onView
lifecycle handler, which previously was prevented.
Deprecate getCommands
, getChain
and getHelpers
methods on the Remirror.ExtensionStore
interface. They will be removed in a future release.
7a34e15d: Add priority parameter to the addHandler
method. Now hooks which consume the addHandler
methods can alter the priority with which they will be run.
525ac3d8: Add AcceptUndefined
annotation which allows options to accept undefined as their default value.
7a34e15d: Add isSuggesterActive
helper to the SuggestExtension
.
7a34e15d: Enable disabling input rules with a shouldSkip
method. This is now available as a handler for the InputRulesExtension
via shouldSkipInputRule
.
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;
});
}
}
7a34e15d: Add getExtension
and getPreset
methods to the Remirror.ExtensionStore
.
d47bd78f: π 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 like ExtensionTag.Alignment
or ExtensionTag.NodeBlock
. Every matching tag in the Schema
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 match Tag1
OR Tag2
OR Tag3
.
{ "tags": ["Tag1", "Tag2", "Tag3"] }
The type
property (mark | node
) is exclusive and limits the type of matches that will be matched.
92ed4135: Add new AnchorHeadParameter
export and make it a part of PrimitiveSelection
type.
7a34e15d: Skip input rules when the mention
is active or one of the included suggester names are active.
7a34e15d: Add forwardDelete
to jest-remirror
and jest-prosemirror
.
92ed4135: Add support for anchor
and head
cursors when writing tests. Also fix selectText
when position is 0
.
7a34e15d: 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.
92ed4135: Fix editable mentions support for exiting when text is selected. Also update getSelection
to support anchor
and head
selections.
7a34e15d: Fix forward deleting when using the @remirror/extension-mention
#639.
04378b54: Fix text selection causing range error when creating table.
Updated dependencies [7a34e15d]
Updated dependencies [7a34e15d]
Updated dependencies [04378b54]
Updated dependencies [92ed4135]
Updated dependencies [7a34e15d]
Updated dependencies [7a34e15d]
Updated dependencies [7a34e15d]
Updated dependencies [7a34e15d]
Updated dependencies [7a34e15d]
Updated dependencies [525ac3d8]
Updated dependencies [7a34e15d]
Updated dependencies [7a34e15d]
Updated dependencies [7a34e15d]
Updated dependencies [7a34e15d]
Updated dependencies [92ed4135]
Updated dependencies [d47bd78f]
Updated dependencies [92ed4135]
Published by ifiokjr about 4 years ago
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.
remirror/react/hooks
which consume useKeymap
have a priority of ExtensionPriority.High
.useKeymap
is given a priority of ExtensionPriority.Medium
.createKeymap
method for extensions is given a priority of ExtensionPriority.Default
.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.
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
]:
Published by ifiokjr about 4 years ago
e8458bc5
#623 Thanks @ifiokjr! - - π₯ Remove the keyBindings
option and the keyboard handler.
createCommand
handler, since it's up to the developer to interpret the information that's been provided to them.onCharacterPress
keyboard handler.onExit
functionality into the onChange
method and split reason
property into exitReason
and changeReason
only one of which can be defined.FromToEndParameter
to RangeWithCursor
and change the property name of to
=> cursor
and end
=> to
.queryText
=> query
and matchText
=> text
in the onChange
handler parameter.RegExp
.match
to the onChange
handler parameter.priority
property which allows suggesters
to specify importance. Higher priority means being checked for a match first.supportedCharacters
.isValidPosition
handler which is a predicate that is run with the active resolved positioner on each suggester. It allows more advanced criteria for rejecting a suggester
in the dom.See #548 for more details.
Published by ifiokjr about 4 years ago
1a7da61a
#608 Thanks @ifiokjr! - π Update the onError
handler with a new improved type signature for better management of errors. See the following example.
import React from 'react';
import { RemirrorProvider, InvalidContentHandler } from 'remirror/core';
import { RemirrorProvider, useManager } from 'remirror/react';
import { WysiwygPreset } from 'remirror/preset/wysiwyg';
const EditorWrapper = () => {
const onError: InvalidContentHandler = useCallback(
({ json, invalidContent, transformers }) => {
// Automatically remove all invalid nodes and marks.
return transformers.remove(json, invalidContent);
},
[],
);
const manager = useManager([new WysiwygPreset()]);
return (
<RemirrorProvider manager={manager} onError={onError}>
<div />
</RemirrorProvider>
);
};
set
and unset
methods to @remirror/core-helpers
.getInvalidContent
export from @remirror/core-utils
.RemirrorError
for better readability.ErrorConstant.INVALID_CONTENT
constant for content related errors.Manager.createEmptyDoc()
instance method for creating any empty doc (with default content) for the current schema.Fallback
, CreateDocumentErrorHandler
, getLineHeight
, getPluginMeta
, getPluginState
, nodeNameMatchesList
and setPluginMeta
exports from @remirror/core-utils
.getNearestNonTextNode
function to getNearestNonTextElement
.getNearestNonTextNode
function to getNearestNonTextElement
.StateOrTransactionParameter
interface to TrStateParameter
.General refactor of types to use the EditorSchema
rather than any
. If you notice any downstream issues please open an issue.
e8458bc5
#623 Thanks @ifiokjr! - Remove keybindings from createSuggesters
and update packages to match the new prosemirror-suggest
API.
e8458bc5
#623 Thanks @ifiokjr! - Add support for creating mentions as uneditable nodes with a new package @remirror/extension-mention-atom
.
e8458bc5
#623 Thanks @ifiokjr! - New package @remirror/react-hooks
with support for all core hooks`.
e8458bc5
#623 Thanks @ifiokjr! - Add selectText
command to CommandsExtension
. Also add dispatchCommand
for running custom commands to CommandsExtension
.
Fix broken command text selection in jest-remirror
and improve jest-remirror
type inference for the renderEditor().view
property.
e8458bc5
#623 Thanks @ifiokjr! - Add support for using a custom schema when creating the editor.
plugins
and nodeView
's via the manager settings.e8458bc5
#623 Thanks @ifiokjr! - Add manager setting schema
for creating a remirror manager with a custom EditorSchema
. When provided this is used to bypass the default schema creation. Be aware that when this is used extraAttributes
will no longer work.
e8458bc5
, e8458bc5
, 1a7da61a
, e8458bc5
, e8458bc5
, e8458bc5
, e8458bc5
]:
Published by ifiokjr about 4 years ago
de0ba243
#603 Thanks @ifiokjr! - Remove requirement for CorePreset
and ReactPreset
when using the React
framework.de0ba243
]:
Published by ifiokjr about 4 years ago
05446a62
#598 Thanks @ifiokjr! - Fix the broken build in production caused by comparing the mangled Constructor.name
to an expected value.
@types/node
an optional peer dependency of @remirror/core-utils
.05446a62
]:
05446a62
]: