2022-04-21
- Avoid adding
pluginState
to the constructor, as it leading to sharing between multiple instances
2022-04-20
-
Fix an error with auto link preventing input rules at the end of a document
-
Updated dependencies []:
- @remirror/core-utils@1.1.8
2022-03-25
-
Add an
isViewEditable
helper to determine if the view content is editable.Expose the return type of
onAppendTransaction
2022-03-17
- Expose appended transactions via the onChange handler
2022-02-22
-
Fix auto link behaviour when performing an undo.
Return only unique ranges from
getChangedRanges
. -
Updated dependencies []:
- @remirror/core-utils@1.1.7
2022-02-08
-
Add support for attribute filtering for
useActive
anduseAttrs
hooks when used with marks.This provides consistent behaviour for the hook, aligning with functionality provided for node types.
const active = useActive(); // Previously this ignored passed attributes and only checked the mark's type // // Now this will only return true if mark type is active AND its color attribute is red const isActive = active.textColor({ color: 'red' });
-
Updated dependencies []:
- @remirror/core-utils@1.1.6
2022-02-04
-
Simplify how auto link works in the link extension, to simplify maintainance and fix a few issues.
-
Updated dependencies []:
- @remirror/core-utils@1.1.5
2022-01-03
-
Make sure that "main", "module" and "types" fields within the
package.json
are prefixed with./
. This is a best practice according to node.js, esbuild and vite's documentation. -
Updated dependencies []:
- @remirror/core-constants@1.0.2
- @remirror/core-helpers@1.0.5
- @remirror/core-types@1.0.4
- @remirror/core-utils@1.1.4
- @remirror/pm@1.0.10
- @remirror/i18n@1.0.8
- @remirror/icons@1.0.7
- @remirror/messages@1.0.6
2021-11-23
-
Fix the browser exports paths in
package.json
. -
Updated dependencies []:
- @remirror/i18n@1.0.7
- @remirror/icons@1.0.6
- @remirror/pm@1.0.8
2021-11-23
-
Fix an issue that causes uploading files failed to be updated after a replace step.
-
Updated dependencies []:
- @remirror/pm@1.0.7
2021-11-10
- Add new method
hasHandlers
to extensions.
2021-11-04
-
Always reset regexp lastIndex before matching.
-
Updated dependencies []:
- @remirror/core-helpers@1.0.4
- @remirror/core-utils@1.1.3
- @remirror/i18n@1.0.6
- @remirror/icons@1.0.5
- @remirror/messages@1.0.5
- @remirror/pm@1.0.6
2021-10-23
-
Fix types so extraAttributes can be any JSON primitivee value
Previously only strings were allowed, now any JSON primitive value maybe used as an extraAttributes value
-
Updated dependencies []:
- @remirror/core-helpers@1.0.3
- @remirror/core-types@1.0.3
- @remirror/core-utils@1.1.2
- @remirror/i18n@1.0.5
- @remirror/icons@1.0.4
- @remirror/messages@1.0.4
- @remirror/pm@1.0.4
2021-10-20
-
BREAKING CHANGE: The option
persistentSelectionClass
forDecorationsExtension
is nowundefined
by default. It needs to be explicitly configured to enable persistent selection. You can set it as'selection'
to match the default styles provided by@remirror/styles
.If you are using
@remirror/react
, you can enable it like this:import { Remirror, ThemeProvider, useRemirror } from '@remirror/react'; function Editor(): JSX.Element { const { manager } = useRemirror({ builtin: { persistentSelectionClass: 'selection' } }); return ( <ThemeProvider> <Remirror manager={manager} /> </ThemeProvider> ); }
In the interest of performance, the persistent selection will only be displayed if the editor loses focus.
-
Exposes a function
hasUploadingFile
to determine if file uploads are currently taking place.When a user drops a file, a file node is created without a href attribute - this attribute is set once the file has uploaded.
However if a user saves content, before uploads are complete we can be left with "broken" file nodes. This exposed function allows us to check if file uploads are still in progress.
Addtionally file nodes now render valid DOM attributes. Rather than
href
anderror
, they now renderdata-url
anddata-error
.
2021-10-01
- Set correct label and icon for task list (#1157).
- Correct the error message for
ErrorConstant.REACT_PROVIDER_CONTEXT
.
-
Stop hiding error details in production.
-
Updated dependencies []:
- @remirror/i18n@1.0.4
- @remirror/messages@1.0.3
- @remirror/core-utils@1.1.1
- @remirror/core-helpers@1.0.2
- @remirror/icons@1.0.3
- @remirror/pm@1.0.3
- @remirror/core-constants@1.0.1
- @remirror/core-types@1.0.2
2021-09-17
- Improve performance for dynamic attributes.
2021-09-07
- Unchained commands should use a new transaction to prevent leaking of previous command steps
2021-08-29
-
Add a new
UploadExtension
to the built-in preset, which will manage all upload states fromFileExtension
and other extensions in the future.Breaking changes:
UploadContext
andFileUploader
are now exported by@remirror/core
instead of@remirror/extension-file
.
- Don't install
@remirror/theme
as a dependency of@remirror/core
.
2021-08-22
-
Set
sideEffect
from@remirror/i18n
's package.json as true. -
Updated dependencies []:
- @remirror/i18n@1.0.3
2021-07-26
2021-07-17
-
#1002
b3ea6f10d
Thanks @ifiokjr! - Use carets^
for versioning ofremirror
packages. -
Updated dependencies [
b3ea6f10d
]:- @remirror/core-helpers@1.0.1
- @remirror/core-types@1.0.1
- @remirror/core-utils@1.0.1
- @remirror/i18n@1.0.1
- @remirror/icons@1.0.1
- @remirror/messages@1.0.1
- @remirror/pm@1.0.1
- @remirror/theme@1.0.1
2021-07-17
For information on what's changed in this release see the v1.0.0
release.
-
#905
270edd91b
Thanks @ifiokjr! - Make chainable commands lazy. Previously, chainable commands would immediately update the transaction. Now the transaction is only updated whenrun
is called.In this way the chainable command, now has no side effects until the
run
ortr
methods are called.Add
tr
method andenabled
method to chainable commands.enabled
checks to see whether the current chain can be run. Returns true if it is possible.tr
runs all the transactions added without dispatching the command into the editor. Produces the side effects.
-
#706
b4dfcad36
Thanks @ifiokjr! - Removecustom
andrestore
chainable commands. Instead thechain
command object is now callable. In order to pass in a custom transaction it should be called with something like the followingimport { useChainableCommands, useEditorView } from '@remirror/react'; function useInsertHello() { const view = useEditorView(); const chain = useChainableCommands(); return () => chain(view.state.tr).insertText(' Hello '); }
- #965
6ab7d2224
Thanks @ifiokjr! - Fix #962 so that inline html can now be added viacommands.insertHtml()
.
- #905
270edd91b
Thanks @ifiokjr! - Fix decoration placeholders. This fixes the image upload placeholder.
-
#864
03d0ae485
Thanks @ifiokjr! - Initialize theExtension#store
property with apreviousState
ofundefined
to prevent a crash in certain conditions. This closes #863. -
Updated dependencies [
adfb12a4c
,7d9f43837
,033144c84
,3e0925f1d
,9096de83f
,7f3569729
,96818fbd2
,5f4ea1f1e
,e9b10fa5a
,ac37ea7f4
,033144c84
,270edd91b
,5befadd0d
,6ab7d2224
,9c496262b
,9c496262b
,b6f29f0e3
,62a494c14
,f52405b4b
]:- @remirror/core-constants@1.0.0
- @remirror/core-helpers@1.0.0
- @remirror/core-types@1.0.0
- @remirror/core-utils@1.0.0
- @remirror/i18n@1.0.0
- @remirror/icons@1.0.0
- @remirror/messages@1.0.0
- @remirror/pm@1.0.0
- @remirror/theme@1.0.0
2020-12-17
-
Forced update in pre-release mode.
-
Updated dependencies [
4504aadb
,4504aadb
,4504aadb
,4504aadb
]:- @remirror/core-utils@1.0.0-next.60
- @remirror/core-constants@1.0.0-next.60
- @remirror/core-helpers@1.0.0-next.60
- @remirror/core-types@1.0.0-next.60
- @remirror/pm@1.0.0-next.60
2020-12-12
-
Forced update in pre-release mode.
-
Updated dependencies [
e69115f1
]:- @remirror/core-constants@1.0.0-next.59
- @remirror/core-helpers@1.0.0-next.59
- @remirror/core-types@1.0.0-next.59
- @remirror/pm@1.0.0-next.59
- @remirror/core-utils@1.0.0-next.59
2020-11-29
-
3d3da227
#815 Thanks @ifiokjr! - Allow access toextension.store.currentState
before the first state update. This fixes #814. -
Updated dependencies []:
- @remirror/core-constants@1.0.0-next.58
- @remirror/core-helpers@1.0.0-next.58
- @remirror/core-types@1.0.0-next.58
- @remirror/core-utils@1.0.0-next.58
- @remirror/pm@1.0.0-next.58
2020-11-25
-
Forced update in pre-release mode.
-
Updated dependencies []:
- @remirror/core-constants@1.0.0-next.57
- @remirror/core-helpers@1.0.0-next.57
- @remirror/core-types@1.0.0-next.57
- @remirror/core-utils@1.0.0-next.57
- @remirror/pm@1.0.0-next.57
2020-11-24
-
Forced update in pre-release mode.
-
Updated dependencies []:
- @remirror/core-constants@1.0.0-next.56
- @remirror/core-helpers@1.0.0-next.56
- @remirror/core-types@1.0.0-next.56
- @remirror/core-utils@1.0.0-next.56
- @remirror/pm@1.0.0-next.56
2020-11-20
-
1adea88a
#801 Thanks @ifiokjr! - Add new primitive commands toCommandsExtension
.setBlockNodeType
toggleWrappingNode
toggleBlockNodeItem
wrapInNode
removeMark
- Updated dependencies [
1adea88a
,ee1ab4f3
,1adea88a
]:- @remirror/core-constants@1.0.0-next.55
- @remirror/core-helpers@1.0.0-next.55
- @remirror/core-types@1.0.0-next.55
- @remirror/pm@1.0.0-next.55
- @remirror/core-utils@1.0.0-next.55
2020-11-19
e9d95fa4
#786 Thanks @ifiokjr! - ExportPrioritizedKeyBindings
from@remirror/core
andremirror/core
entry points.
- Updated dependencies [
1a0348e7
]:- @remirror/core-utils@1.0.0-next.54
- @remirror/core-constants@1.0.0-next.54
- @remirror/core-helpers@1.0.0-next.54
- @remirror/core-types@1.0.0-next.54
- @remirror/pm@1.0.0-next.54
2020-11-12
-
a1d65df6
#775 Thanks @whawker! - Fixes extensions that were erroneously adding extra attributes to the DOM twice.Attributes were correctly added using their toDOM handler, but also incorrectly in their raw form.
Example
const linkExtension = new LinkExtension({ extraAttributes: { custom: { default: 'my default', parseDOM: (dom) => dom.getAttribute('data-custom'), toDOM: (attrs) => ['data-custom', attrs.custom], }, }, });
Resulted in
<a data-custom="my default" custom="my default" <!-- extra attribute rendered in raw form --> href="https://remirror.io" rel="noopener noreferrer nofollow"></a >
- Updated dependencies [
a1d65df6
]:- @remirror/core-utils@1.0.0-next.53
- @remirror/core-constants@1.0.0-next.53
- @remirror/core-helpers@1.0.0-next.53
- @remirror/core-types@1.0.0-next.53
- @remirror/pm@1.0.0-next.53
2020-11-06
-
Forced update in pre-release mode.
-
Updated dependencies []:
- @remirror/core-constants@1.0.0-next.52
- @remirror/core-helpers@1.0.0-next.52
- @remirror/core-types@1.0.0-next.52
- @remirror/core-utils@1.0.0-next.52
- @remirror/pm@1.0.0-next.52
2020-10-27
-
Forced update in pre-release mode.
-
Updated dependencies [
997eb56a
]:- @remirror/core-constants@1.0.0-next.51
- @remirror/core-helpers@1.0.0-next.51
- @remirror/core-types@1.0.0-next.51
- @remirror/core-utils@1.0.0-next.51
- @remirror/pm@1.0.0-next.51
2020-10-15
-
Updated dependencies [
bd8ac67d
,d27c6e1a
]:- @remirror/core-constants@1.0.0-next.50
- @remirror/core-helpers@1.0.0-next.50
- @remirror/core-types@1.0.0-next.50
- @remirror/core-utils@1.0.0-next.50
- @remirror/pm@1.0.0-next.50
2020-10-10
-
Forced update in pre-release mode.
-
Updated dependencies []:
- @remirror/core-constants@1.0.0-next.49
- @remirror/core-helpers@1.0.0-next.49
- @remirror/core-types@1.0.0-next.49
- @remirror/core-utils@1.0.0-next.49
- @remirror/pm@1.0.0-next.49
2020-10-08
a2fa2c2b
#745 Thanks @ifiokjr! - Add better iOS focus support. Now usingfocus
on iOS will actually focus the editor.
- Updated dependencies [
a2fa2c2b
]:- @remirror/core-utils@1.0.0-next.48
2020-10-08
-
Updated dependencies [
4658d45c
]:- @remirror/core-helpers@1.0.0-next.47
- @remirror/core-types@1.0.0-next.47
- @remirror/core-utils@1.0.0-next.47
- @remirror/pm@1.0.0-next.47
2020-10-01
2175be1d
Thanks @ifiokjr! - FixCommandExtension
error when editor started without an attached framework.
2020-09-30
- Updated dependencies [
bcf3b2c4
]:- @remirror/pm@1.0.0-next.44
- @remirror/core-types@1.0.0-next.44
- @remirror/core-utils@1.0.0-next.44
- @remirror/core-helpers@1.0.0-next.44
2020-09-28
- Updated dependencies [
b030cb6e
]:- @remirror/core-utils@1.0.0-next.43
2020-09-26
- Updated dependencies [
9fa07878
]:- @remirror/core-utils@1.0.0-next.42
2020-09-26
83217437
#712 Thanks @ifiokjr! - π AddfindPositionerTracker
,findAllPositionTrackers
andisSelectionEmpty
to builtin helpers.
2020-09-24
-
7c5778ed
#700 Thanks @ifiokjr! - π Add support for position tracking toCommandsExtension
.- New commands are available.
commands.addPositionTracker
commands.removePositionTracker
.commands.clearPositionTrackers
.
- New exports from
@remirror/core
includingdelayedCommand
which is a building block for creating your own delayed commands. - BREAKING: π₯ Rename
clearRangeSelection
toemptySelection
and fix a bug where it would always select thefrom
rather than theanchor
. - Add store property
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 namedRawCommandsFromExtensions
- Add
initialState
as a property of theBaseFramework
. - BREAKING π₯ Require the
Framework
to be attached to the manager before any calls togetState
are allowed. If you're usingjest-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: {}, }, });
- New commands are available.
-
cbf15ec4
#698 Thanks @ifiokjr! - CheckEditorView
has been added to framework before removing the focus and blur listeners. -
Updated dependencies [
add65c90
,4b1d99a6
,fd694d61
]:- @remirror/core-utils@1.0.0-next.40
- @remirror/core-types@1.0.0-next.40
- @remirror/pm@1.0.0-next.40
- @remirror/core-helpers@1.0.0-next.40
2020-09-16
- Updated dependencies [
61894188
]:- @remirror/pm@1.0.0-next.39
- @remirror/core-types@1.0.0-next.39
- @remirror/core-utils@1.0.0-next.39
- @remirror/core-helpers@1.0.0-next.39
2020-09-16
-
913e8e68
#689 Thanks @ifiokjr! - BREAKING: π₯ RenameFramework.frameworkHelpers
tobaseOutput
and make it protected.- Add required
abstract
getterframeworkOutput
. - Add third generic property
Output
which extendsFrameworkOutput
. - Remove
manager
property fromFrameworkOutput
.
- Add required
-
efd2e537
#689 Thanks @ifiokjr! - Addoutput
property to theRemirrorManager
. The property will throw an error if used before the framework is attached.Add the
frameworkAttached
property to theRemirrorManager
which is true when themanager.output
is available.
- Updated dependencies [
14e48698
,6855ee77
]:- @remirror/pm@1.0.0-next.38
- @remirror/core-helpers@1.0.0-next.38
- @remirror/core-types@1.0.0-next.38
- @remirror/core-utils@1.0.0-next.38
2020-09-14
5a3dd95f
#686 Thanks @ifiokjr! - Add all extensions to theRemirror.AllExtensions
interface to support automatic TypeScript inference for every installed extension package.
- Updated dependencies [
5a3dd95f
]:- @remirror/pm@1.0.0-next.37
- @remirror/core-types@1.0.0-next.37
- @remirror/core-utils@1.0.0-next.37
- @remirror/core-helpers@1.0.0-next.37
2020-09-13
34b0f0b3
#676 Thanks @ifiokjr! - Add newstore.getCommandParameter
method which returns the properties required to run a command.
4fee3e94
#676 Thanks @ifiokjr! - AddchainableEditorState
which makes theEditorState
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.
1b6b2922
#670 Thanks @ifiokjr! - FixestoggleList
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 -
Updated dependencies [
1b6b2922
,725df02b
,4fee3e94
]:- @remirror/core-utils@1.0.0-next.35
- @remirror/core-constants@1.0.0-next.35
- @remirror/core-helpers@1.0.0-next.35
- @remirror/core-types@1.0.0-next.35
- @remirror/pm@1.0.0-next.35
2020-09-10
-
db7165f1
#665 Thanks @ifiokjr! - RefactorRemirrorManager
and renameEditorWrapper
toFramework
.- New
BaseFramework
interface which is implemented by the abstractFramework
class and used by theRemirrorManager
to keep hold of an instance of theFramework
. - New
attachFramework
method on the manager. - Update
doc
property todocument
throughout the codebase.doc
could be confused with thedoc
node or the actual document. Now it's clearer. Any timedoc
is mentioned in the code base it refers to theProseMirror
node. Any timedocument
is mentioned it is referring to the DOM. - Remove
SocialEditorWrapperComponent
export from@remirror/react-social
.
- New
-
27b358e4
#668 Thanks @ifiokjr! - AddMarkSupportsExit
tag toExtensionTag
constant export.Add
KeymapExtension
optionexitMarksOnArrowPress
which allows the user to exit marks with theMarkSupportExit
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 andRemirrorManager
now extra can be added as part of the configuration.
- Updated dependencies [
27b358e4
,5945dffe
]:- @remirror/core-constants@1.0.0-next.34
- @remirror/core-helpers@1.0.0-next.34
- @remirror/core-types@1.0.0-next.34
- @remirror/core-utils@1.0.0-next.34
- @remirror/pm@1.0.0-next.34
2020-09-07
-
7a34e15d: Add support for returning a
Dispose
method from theonCreate
andonView
lifecycle methods for automatic cleanup in theonDestroy
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 themark
found. Additionally, to better support optional chaining it now returnsundefined
instead offalse
when no range can be found. -
7a34e15d: 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
.
-
7a34e15d: 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. -
7a34e15d: Add priority parameter to the
addHandler
method. Now hooks which consume theaddHandler
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 theSuggestExtension
. -
7a34e15d: 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 { Dispose, PlainExtension } 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
andgetPreset
methods to theRemirror.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 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 { CorePreset, createCoreManager } 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.
- Updated dependencies [92ed4135]
- Updated dependencies [7a34e15d]
- Updated dependencies [7a34e15d]
- Updated dependencies [525ac3d8]
- Updated dependencies [7a34e15d]
- Updated dependencies [92ed4135]
- @remirror/core-utils@1.0.0-next.33
- @remirror/core-constants@1.0.0-next.33
- @remirror/core-types@1.0.0-next.33
- @remirror/core-helpers@1.0.0-next.33
2020-09-05
-
5786901c
#645 Thanks @ifiokjr! - Add support for prioritized keymaps. It's now possible to make sure that a hook which consumesuseKeymap
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.
- Hooks within
remirror/react/hooks
which consumeuseKeymap
have a priority ofExtensionPriority.High
. useKeymap
is given a priority ofExtensionPriority.Medium
.- The
createKeymap
method for extensions is given a priority ofExtensionPriority.Default
. - The
baseKeymap
which is added by default is given a priority ofExtensionPriority.Low
.
To change the default priority of the
createKeymap
method in a custom extension wrap theKeyBindings
return in a tuple with the priority as the first parameter.import { ExtensionPriority, KeyBindings, KeyBindingsTuple, PlainExtension } from 'remirror/core'; class CustomExtension extends PlainExtension { get name() { return 'custom' as const; } createKeymap(): KeyBindingsTuple { const bindings = { Enter: () => true, Backspace: () => true, }; return [ExtensionPriority.High, bindings]; } }
- Hooks within
aa27e968
#635 Thanks @ifiokjr! - AddonError
andstringHandler
methods to theRemirror.ManagerSettings
.
a830c70f
#633 Thanks @ifiokjr! - Makefocus
command chainable and addmanager.tr
property for creating chainable commands. This means that thefocus
method returned byuseRemirror()
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 textThis 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.
-
5786901c
#645 Thanks @ifiokjr! - Fix broken styles for firefox as raised on discord. -
Updated dependencies [
a830c70f
,e7b0bb0f
,aa27e968
,a830c70f
]:- @remirror/core-constants@1.0.0-next.32
- @remirror/core-utils@1.0.0-next.32
- @remirror/core-helpers@1.0.0-next.32
- @remirror/core-types@1.0.0-next.32
- @remirror/pm@1.0.0-next.32
2020-09-03
-
1a7da61a
#608 Thanks @ifiokjr! - π Update theonError
handler with a new improved type signature for better management of errors. See the following example.import React from 'react'; import { InvalidContentHandler, RemirrorProvider } from 'remirror/core'; import { WysiwygPreset } from 'remirror/preset/wysiwyg'; import { RemirrorProvider, useManager } from '@remirror/react'; 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> ); };
- π Add
set
andunset
methods to@remirror/core-helpers
. - π Add
getInvalidContent
export from@remirror/core-utils
. - π Add logging support for
RemirrorError
for better readability. - π Add new
ErrorConstant.INVALID_CONTENT
constant for content related errors. - π Add
Manager.createEmptyDoc()
instance method for creating any empty doc (with default content) for the current schema. - π₯ Remove
Fallback
,CreateDocumentErrorHandler
,getLineHeight
,getPluginMeta
,getPluginState
,nodeNameMatchesList
andsetPluginMeta
exports from@remirror/core-utils
. - π₯ Rename
getNearestNonTextNode
function togetNearestNonTextElement
. - π₯ Rename
getNearestNonTextNode
function togetNearestNonTextElement
. - π₯ Rename
StateOrTransactionParameter
interface toTrStateParameter
.
General refactor of types to use the
EditorSchema
rather thanany
. If you notice any downstream issues please open an issue. - π Add
e8458bc5
#623 Thanks @ifiokjr! - Remove keybindings fromcreateSuggesters
and update packages to match the newprosemirror-suggest
API.
-
e8458bc5
#623 Thanks @ifiokjr! - AddselectText
command toCommandsExtension
. Also adddispatchCommand
for running custom commands toCommandsExtension
.Fix broken command text selection in
jest-remirror
and improvejest-remirror
type inference for therenderEditor().view
property.
-
e8458bc5
#623 Thanks @ifiokjr! - Add support for using a custom schema when creating the editor.- Also add support for additional
plugins
andnodeView
's via the manager settings.
- Also add support for additional
e8458bc5
#623 Thanks @ifiokjr! - Add manager settingschema
for creating a remirror manager with a customEditorSchema
. When provided this is used to bypass the default schema creation. Be aware that when this is usedextraAttributes
will no longer work.
- Updated dependencies [
1a7da61a
]:- @remirror/core-helpers@1.0.0-next.31
- @remirror/core-utils@1.0.0-next.31
2020-08-28
-
05446a62
#598 Thanks @ifiokjr! - Fix the broken build in production caused by comparing the mangledConstructor.name
to an expected value.- Make
@types/node
an optional peer dependency of@remirror/core-utils
.
- Make
-
Updated dependencies [
05446a62
]:- @remirror/core-utils@1.0.0-next.29
2020-08-27
-
0400fbc8
#591 Thanks @ifiokjr! - Add support for nested content withinReactComponent
node views. Also support adding multiple components to the manager via thenodeViewComponents
setting. CurrentlyReactNodeView
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 thegetRootProps({ ref })
function call which will be populated at the same time. - Test the names of
Extension
's andPreset
's in withextensionValidityTest
. - BREAKING CHANGES π₯
- Rename:
ReactSSRExtension
=>ReactSsrExtension
- Rename:
ReactComponentExtension.name
fromreactNodeView
=>reactComponent
. - Rename:
NodeViewsExtension
=>NodeViewExtension
- Rename:
NodeViewsExtension
=>NodeViewExtension
- Rename:
SuggestExtension.name
fromsuggestions
=>suggest
- Rename:
- Also enforce minimum required extensions for the manager passed to the
c0dce043
#595 Thanks @ifiokjr! - Fix a bug onChrome
which caused the autofocus="false" to trigger the autofocus action. Nowautofocus
being falsey removes the attribute from the dom.
-
d23a0434
#593 Thanks @ifiokjr! - Fix issue with focusing the editor after every command. -
Updated dependencies [
d5bbeb4e
,d5bbeb4e
]:- @remirror/pm@1.0.0-next.28
- @remirror/core-helpers@1.0.0-next.28
- @remirror/core-types@1.0.0-next.28
- @remirror/core-utils@1.0.0-next.28
2020-08-24
-
a2bc3bfb: Support for extending the
ExtensionTag
with your own custom types and names to close #465. DeprecatesNodeGroup
andMarkGroup
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.
- A small breaking change removes some related type exports from
-
147d0f2a: π Now featuring support for
DynamicExtraAttributes
as mentioned in #387.- Also add support for
action
method being passed tofindChildren
,findTextNodes
,findInlineNodes
,findBlockNodes
,findChildrenByAttribute
,findChildrenByNode
,findChildrenByMark
andcontainsNodesOfType
. - Deprecate
flattenNodeDescendants
.findChildren
is now the preferred method and automatically flattens the returned output.
- Also add support for
- Updated dependencies [a2bc3bfb]
- Updated dependencies [147d0f2a]
- @remirror/core-constants@1.0.0-next.26
- @remirror/core-utils@1.0.0-next.26
- @remirror/core-helpers@1.0.0-next.26
- @remirror/core-types@1.0.0-next.26
- @remirror/pm@1.0.0-next.26
2020-08-23
-
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 thelookbehind
regex in Safari and other browsers.Fixes #574.
- Updated dependencies [3f2625bf]
- @remirror/core-utils@1.0.0-next.25
2020-08-20
- 65a7ea24: Add command to clear current range selection
2020-08-17
-
9ab1d0f3: Remove
ExtensionType
enum which is no longer used. -
45d82746: π₯ Remove
AttributesWithClass
.π Add
NodeAttributes
andMarkAttributes
exports which can be extended in theRemirror.ExtraNodeAttributes
andRemirror.ExtraMarkAttributes
.π Add
isAllSelection
which checks if the user has selected everything in the active editor.
- Updated dependencies [9ab1d0f3]
- Updated dependencies [45d82746]
- @remirror/core-constants@1.0.0-next.22
- @remirror/core-types@1.0.0-next.22
- @remirror/core-utils@1.0.0-next.22
- @remirror/core-helpers@1.0.0-next.22
- @remirror/pm@1.0.0-next.22
2020-08-15
-
8c34030e: π₯ Remove property
updateSelection
from thenodeInputRule
,markInputRule
andplainInputRule
functions. You should use the newbeforeDispatch
method instead.Add new
beforeDispatch
method to thenodeInputRule
,markInputRule
andplainInputRule
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'), });
-
baf3f56d: Add
ignoreWhitespace
option tomarkInputRule
for ignoring a matching input rule if the capture groups is only whitespace. Apply to all wrapping input rules forMarkExtension
's in theproject
.Fix #506
ItalicExtension
issue with input rule being greedy and capturing one preceding character when activated within a text block.
-
3673a0f0: Fix #518 caused by the way the
EditorWrapper
was setting up listeners to events from theRemirrorManager
. Previously the failure became apparent when used in an uncontrolled editor inStrictMode
.Set the default
CommandFunction
type parameter to beEditorSchema
for better code completion when creating an extension. -
Updated dependencies [3673a0f0]
-
Updated dependencies [8c34030e]
-
Updated dependencies [baf3f56d]
- @remirror/core-types@1.0.0-next.21
- @remirror/core-utils@1.0.0-next.21
- @remirror/core-helpers@1.0.0-next.21
- @remirror/pm@1.0.0-next.21
2020-08-14
- Updated dependencies [6d7edc85]
- Updated dependencies [8f9eb16c]
- Updated dependencies [770e3d4a]
- Updated dependencies [7c603a5e]
- Updated dependencies [92653907]
- @remirror/core-utils@1.0.0-next.20
- @remirror/core-types@1.0.0-next.20
- @remirror/core-helpers@1.0.0-next.20
- @remirror/pm@1.0.0-next.20
2020-08-02
- 898c62e0: Export
BuiltinOptions
interface from@remirror/core
.
2020-08-01
-
f032db7e: Remove
isEmptyParagraphNode
andabsoluteCoordinates
exports from@remirror/core-utils
. -
6e8b749a: Rename
nodeEqualsType
toisNodeOfType
. -
982a6b15: BREAKING:: rename
createSuggestions
tocreateSuggesters
to keep in line with the update fromprosemirror-suggest
.BREAKING:
@remirror-core
- renameSuggestionsExtension
toSuggestExtension
@remirror-core
- Addbuiltins
parameter toRemirror.ManagerSettings
. -
6c6d524e: Breaking Changes π₯
Rename
contains
tocontainsNodesOfType
.Make
isValidPresetConstructor
internal only.Remove
EMPTY_CSS_VALUE
,CSS_ROTATE_PATTERN
from@remirror/core-constants
.Remove method:
clean() | coerce() | fragment() | markFactory() | nodeFactory() | offsetTags() | sequence() | slice() | text() | isTaggedNode() | replaceSelection()
and type:BaseFactoryParameter | MarkWithAttributes | MarkWithoutAttributes | NodeWithAttributes | NodeWithoutAttributes | TagTracker | TaggedContent | TaggedContentItem | TaggedContentWithText | Tags
exports fromjest-remirror
.Remove
SPECIAL_INPUT_KEYS | SPECIAL_KEYS | SPECIAL_MENU_KEYS | SPECIAL_TOGGLE_BUTTON_KEYS
frommultishift
.
- be9a9c17: Move all keymap functionality to
KeymapExtension
from@remirror/core
. Remove all references to@remirror/extension-base-keymap
. - 720c9b43: Public
dynamicKeys
property now available onExtension
's andPreset
's.
-
a7037832: Use exact versions for
@remirror
packagedependencies
andpeerDepedencies
.Closes #435
-
dcccc5fc: Add browser entrypoint to packages and shrink bundle size.
-
231f664b: Upgrade dependencies.
-
6c6d524e: Remove use of
export *
for better tree shaking.Closes #406
-
Updated dependencies [6528323e]
-
Updated dependencies [f032db7e]
-
Updated dependencies [a7037832]
-
Updated dependencies [6e8b749a]
-
Updated dependencies [dcccc5fc]
-
Updated dependencies [231f664b]
-
Updated dependencies [6c6d524e]
-
Updated dependencies [6c6d524e]
- @remirror/core-types@1.0.0-next.16
- @remirror/core-utils@1.0.0-next.16
- @remirror/core-constants@1.0.0-next.16
- @remirror/core-helpers@1.0.0-next.16
- @remirror/pm@1.0.0-next.16
2020-07-31
-
cdc5b801: Add three new helpers to
@remirror/core-utils
/@remirror/core
:isStateEqual
,areSchemaCompatible
andgetRemirrorJSON
.BREAKING: π₯ Rename
getObjectNode
togetRemirrorJSON
. -
a404f5a1: Add the option
excludeExtensions
toCorePreset
'sconstructor
to exclude any extensions.Remove the option
excludeHistory
fromCorePreset
'sconstructor
.
-
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. -
6c3b278b: Make sure the
transaction
has all the latest updates if changed betweenonStateUpdate
events. This allows chaining to be supported properly.
- Updated dependencies [cdc5b801]
- Updated dependencies [44516da4]
- @remirror/core-utils@1.0.0-next.15
2020-07-29
- 92342ab0: Throw error in
Preset
andExtension
when attempting to update a non-dynamic option at runtime.
-
e45706e5: Add new
extensionDecorator
function which augments the static properties of anExtension
constructor when used as a decorator.The following code will add a decorator to the extension.
import { extensionDecorator, ExtensionPriority, PlainExtension } from 'remirror/core'; interface ExampleOptions { color?: string; /** * This option is annotated as a handler and needs a static property. **/ onChange?: Handler<() => void>; } @extensionDecorator<ExampleOptions>({ defaultOptions: { color: 'red' }, defaultPriority: ExtensionPriority.Lowest, handlerKeys: ['onChange'], }) class ExampleExtension extends PlainExtension<ExampleOptions> { get name() { return 'example' as const; } }
The extension decorator updates the static properties of the extension. If you prefer not to use decorators it can also be called as a function. The
Extension
constructor is mutated by the function call and does not need to be returned.extensionDecorator({ defaultSettings: { color: 'red' } })(ExampleExtension);
-
f3155b5f: Add new
presetDecorator
function which augments the static properties of anPreset
constructor when used as a decorator.The following code will add a decorator to the preset.
import { Preset, presetDecorator } from 'remirror/core'; interface ExampleOptions { color?: string; /** * This option is annotated as a handler and needs a static property. **/ onChange?: Handler<() => void>; } @presetDecorator<ExampleOptions>({ defaultOptions: { color: 'red' }, handlerKeys: ['onChange'], }) class ExamplePreset extends Preset<ExampleOptions> { get name() { return 'example' as const; } }
The preset decorator updates the static properties of the preset. If you prefer not to use decorators it can also be called as a function. The
Preset
constructor is mutated by the function call and does not need to be returned.presetDecorator({ defaultSettings: { color: 'red' }, handlerKeys: ['onChange'] })(ExamplePreset);
-
4571a447: Use methods for
addHandler
andaddCustomHandler
@remirror/react
- BindaddHandler
andaddCustomHandler
forPreset
andExtension
hooks.
-
d877adb3: Switch to using method signatures for extension class methods as discussed in #360. The following methods have been affected:
createKeymap createInputRules createPasteRules
-
cc5c1c1c: Remove static properties and use the
@extensionDecorator
instead. -
Updated dependencies [e45706e5]
-
Updated dependencies [92342ab0]
- @remirror/core-types@1.0.0-next.13
- @remirror/core-constants@1.0.0-next.13
- @remirror/core-helpers@1.0.0-next.13
2020-07-28
- 19b3595f:
isNodeActive
now matches partial attribute objects. Fixes #385. - d8aa2432: Remove type guard from
isEmptyArray
andisEmptyObject
as they were incorrect.
- Updated dependencies [19b3595f]
- Updated dependencies [d8aa2432]
- @remirror/core-utils@1.0.0-next.12
- @remirror/core-helpers@1.0.0-next.12
2020-07-26
-
54461006: Remove the first parameter
extensions
from the lifecycle methodsonCreate
,onView
andonDestroy
.Switch to using method signatures for extension class methods as discussed in #360. The following methods have been affected:
onCreate onView onStateUpdate onDestroy createAttributes createCommands createPlugin createExternalPlugins createSuggestions createHelpers fromObject onSetOptions
- Updated dependencies [21a9650c]
- @remirror/core-helpers@1.0.0-next.11
2020-07-26
- 6468058a:
RemirrorManager.create
can now accept a function to which returns an array of extensions and presets. This lazy creation allows for optimizations to be made elsewhere in the codebase.
2020-07-23
-
02fdafff: - Rename
change
event toupdated
.updated
is called with theEventListenerParameter
.- Add new manager
stateUpdate
to theeditorWrapper
- Add
autoUpdate
option touseRemirror
hook from@remirror/react
which means that the context object returned by the hook is always up to date with the latest editor state. It will also cause the component to rerender so be careful to only use it when necessary.
import React from 'react'; const Editor = () => { const { active, commands } = useRemirror({ autoUpdate: true }); return ( <button onClick={() => commands.toggleBold} style={{ fontWeight: active.bold() ? 'bold' : undefined }} > B </button> ); };
- Fix broken
onChangeHandler
parameter for the useuseRemirror
hook.
- Add new manager
2020-07-16
- 64edeec2: Add blur method to the editor context which is used in the
@remirror/react
and@remirror/dom
libraries. - 9f495078: Move
suppressHydrationWarning
prop from core to to react editor. It makes no sense for it to be in core since it only impacts the react editor.
- 5d5970ae: Update repository and website field to point to HEAD rather than a specific branch.
- Updated dependencies [5d5970ae]
- @remirror/core-constants@1.0.0-next.4
- @remirror/core-helpers@1.0.0-next.4
- @remirror/core-types@1.0.0-next.4
- @remirror/core-utils@1.0.0-next.4
- @remirror/pm@1.0.0-next.4
2020-07-11
- Updated dependencies [e90bc748]
- @remirror/pm@1.0.0-next.3
- @remirror/core-types@1.0.0-next.3
- @remirror/core-utils@1.0.0-next.3
2020-07-06
-
Add support for
React.StrictMode
.Previously, activating
StrictMode
would cause the components to render twice and break functionality ofRemirrorProvider
due to an outdated check on whethergetRootProps
had been called. This check has been removed since it isn't needed anymore.
2020-07-05
- Fix missing dist files from previous publish.
- Updated dependencies [undefined]
- @remirror/core-constants@1.0.0-next.1
- @remirror/core-helpers@1.0.0-next.1
- @remirror/core-types@1.0.0-next.1
- @remirror/core-utils@1.0.0-next.1
- @remirror/pm@1.0.0-next.1
2020-07-05
-
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
todist
- 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.
- Move build directory from
-
7b817ac2: Rename all types and interfaces postfixed with
Params
to use the postfixParameter
. If your code was importing any matching interface you will need to update the name. -
09e990cb: Update
EditorManager
/ExtensionManager
name to be **RemirrorManager
.
-
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 optionalonChange
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.
- Updated dependencies [undefined]
- Updated dependencies [28bd8bea]
- Updated dependencies [7b817ac2]
- @remirror/core-constants@1.0.0-next.0
- @remirror/core-helpers@1.0.0-next.0
- @remirror/core-types@1.0.0-next.0
- @remirror/core-utils@1.0.0-next.0
- @remirror/pm@1.0.0-next.0
- c2237aa0: Allow empty string default value for extraAttrs
- 0300d01c: - Auto defined
isEnabled
via commands withdispatch=undefined
.HistoryExtension
now checks that whetherdispatch=undefined
.- Remove
CommandStatusCheck
. - Add new type
ExtensionIsActiveFunction
which doesn't take the command name. - Remove
isEnabled
fromExtension
interface.
- Updated dependencies [c4645570]
- Updated dependencies [0300d01c]
- @remirror/core-utils@0.8.0
- @remirror/core-types@0.9.0
- prosemirror-suggest@0.7.6
- @remirror/core-helpers@0.7.6
- 2904ebfd: Fix problem with build outputting native classes which can't be extended when the build process converts classes to their ES% function equivalent.
-
24f83413: - Change the signature of
CommandFunction
to only accept one parameter which containsdispatch
,view
,state
.- Create a new exported
ProsemirrorCommandFunction
type to describe the prosemirror commands which are still used in the codebase. - Rename
KeyboardBindings
toKeyBindings
. AllowCommandFunctionParams
to provide extra parameters likenext
in the newly namedKeyBindings
. - Create a new
KeyBindingCommandFunction
to describe theExtension.keys()
return type. Update the name of theExcludeOptions.keymaps
->ExcludeOptions.keys
.
BREAKING CHANGE
- Create a new exported
-
24f83413: Improve the way
ExtensionManager
callsExtension.keys
methods. Keys now use the new api for CommandFunctions which provides anext
method. This method allows for better control when deciding whether or not to defer to the next keybinding in the chain.To override, create a new keybinding with another extension. Make sure the extension is created with a higher priority. The keybinding you create can either return true or false. By default if it returns true, no other keybindings will run. However if it returns
false
all other keybindings will be run until one returnstrue
next
basically calls the every lower priority keybinding in the extensions list. It gives you full control of how the bindings are called.
- Updated dependencies [24f83413]
- @remirror/core-types@0.8.0
- @remirror/core-helpers@0.7.5
- @remirror/core-utils@0.7.5
- prosemirror-suggest@0.7.5
- 7380e18f: Update repository url from ifiokjr/remirror to remirror/remirror to reflect new GitHub organisation.
- Updated dependencies [7380e18f]
- @remirror/core-constants@0.7.4
- @remirror/core-helpers@0.7.4
- @remirror/core-types@0.7.4
- @remirror/core-utils@0.7.4
- @remirror/react-portals@0.7.4
- prosemirror-suggest@0.7.4
- 5f85c0de: Bump a new version to test out the changeset API.
- Updated dependencies [5f85c0de]
- @remirror/core-helpers@0.7.3
- @remirror/core-constants@0.7.3
- @remirror/core-types@0.7.3
- @remirror/core-utils@0.7.3
- @remirror/react-portals@0.7.3
- prosemirror-suggest@0.7.3