Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@portabletext/block-tools@5.0.1
Patch Changes
e695d2bThanks @christianhg! - docs: update description@portabletext/editor@4.3.6
Patch Changes
#2147
30f57d3Thanks @christianhg! - fix: discard deferred patches that conflict with incoming patchesWhen the editor is initialised it runs normalization on the content to ensure
spans have
marksand blocks havemarkDefsetc.The editor deliberately defers these local patches util it is marked dirty (a
non-normalization and non-remote operation happens in the editor). This is to
make sure the editor doesn't perform side effects just by being initialised.
This, however, can cause problems in a collaborative setting.
Imagine that:
markson a spanmarks: [], but defers the patch until theeditor is dirty
marksto[], then a patch to setmarksto['strong']editors.
marksto[]along with thediffMatchPatchfor the user's typing.Now the text is bold in Editor A but not in Editor B.
To fix this, we now check if incoming patches conflict with deferred local
patches and if they do, the local patches are discarded.
In the case of a a value sync (someone sends an `update value` event to the
editor, deferred local patches are discarded without checking for conflicts.
The incoming value is either:
normalization runs again -> fresh patches are generated if needed
redundant -> someone else already did the work
In both cases, the held-back patches are either stale (will be regenerated) or
redundant (already reflected remotely). Discarding them is the safest thing to
do.
Updated dependencies [
e695d2b]:@portabletext/plugin-character-pair-decorator@5.0.21
Patch Changes
30f57d3]:@portabletext/plugin-emoji-picker@4.0.21
Patch Changes
30f57d3]:@portabletext/plugin-input-rule@2.0.21
Patch Changes
30f57d3]:@portabletext/plugin-markdown-shortcuts@5.0.21
Patch Changes
30f57d3]:@portabletext/plugin-one-line@4.0.21
Patch Changes
30f57d3]:@portabletext/plugin-sdk-value@4.0.21
Patch Changes
30f57d3]:@portabletext/plugin-typeahead-picker@2.0.6
Patch Changes
30f57d3]:@portabletext/plugin-typography@5.0.21
Patch Changes
30f57d3]:@portabletext/toolbar@5.0.21
Patch Changes
30f57d3]: