@platejs/cli
Patch Changes
2c357bbby @zbeyens – Addplate codemod plite-to-plateto automate migrating Plite projects to Plate (rewriting imports, JSX components,DOMEditorcalls, plugin options, andpackage.json, with structured diagnostics andTODOcomments for manual steps), and markplatejsas an optional peer dependency
@platejs/test
Published @platejs/test@54.0.0-beta.7.
platejs
Minor Changes
-
fe90073by @zbeyens – Re-exportuseEditorEditableElement,UseEditorSelectorOptions, andUseStateFieldValueOptionsby identity fromplatejs/react. -
38eb5deby @zbeyens – Re-export the eight drag and geometry types (DOMDragApi,DOMDragStart,DOMDropEdge,DOMDropTarget,DOMDropTargetInput,DOMDropTargetOptions,DOMGeometryRect,DropIndicator) fromplatejs/dom,GaveWriteandSplitGavefromplatejs/authored, andTypedTextandTypedTextListenerfromplatejs/reactby identity. Rename the internalinkRecordsplugin name from'ink-records'to'inkRecords'. -
f988d66by @zbeyens – Search every document root inBaseFindPluginin recursive owner reading order, update changed roots incrementally without polling unchanged boards, isolate match decorations and observer notifications per view root, and allowupdate.select()to select matches in any root from any view. -
d2cc369by @zbeyens – AcceptclipboardFormatKeyonplatejs/react'screateEditoranduseCreateEditorviaDOMPluginstore state and chained pluginactivatestages, validateeditor.install,tx.plugins.reconfigure, and slotted plugin inputs before any cleanup to reject Plate plugins with acreateEditor({ plugins })andstore.set({ ... })error, reject unsupportedschemakeys at runtime on both object and factory schemas, and drophistory,HistoryOptions,HistoryPlugin,HistoryPluginTypes, andHistoryPluginTypeProviderfromplatejs/historyin favor ofHistoryPlugin.configure(...). -
353fcecby @zbeyens – ReplaceshouldUpdateonuseEditorSelectoranduseEditorStatewith declarativedependsOn, and re-exportEditorSelectorDependencyandEditorSelectorDependenciesfromplatejs/react.- Migrate
UseEditorSelectorOptionsandUseEditorStateOptionsto{ dependsOn?, equalityFn? }and update Plate's built-in hooks,NodeSelection,FieldPlugin, andListPluginto declare their dependencies withdependsOn. - Commit normalized
dependsOnchanges in a layout effect rather than mutating selector filters during render, and includeequalityFninuseEditorSelector's snapshot cache key.
- Migrate
Patch Changes
-
- Block ink tool activation and pen, eraser, or lasso edits while a view is in Authored Preview
- Store optional inline-void display labels on
InkCopysoInkCopyViewrenders mention text instead of rawU+FFFC - Translate text marks horizontally when their block shifts, prune unreferenced
ink-gonerecords indropDigitized, and restore viewport-scoped ink placement onafterprint - Remove experimental
54.0.0-beta.2ink record compatibility; saved ink uses the packed format only
-
55025b2by @zbeyens – FixEditorRootonValueChangeto emit commit-scopedEditorDocumentValuewithout replaying commits across ReactActivityreconnects or forcing lazy state codecs on ephemeral writes, exportUseStateFieldValueOptionsfromplatejs/react, and default selector option generics tounknown -
c06c7deby @zbeyens – Re-exportuseEditorRootAreasandEditorRootAreasfromplatejs/react. -
42e913dby @zbeyens – Add experimentaltx.plugin(BaseInkPlugin).dropDigitized(ids?)to permanently drop digitized ink marks, their digitized records, and any saved block copies no remaining mark references. -
93af01dby @zbeyens – Merge derived-read React hooks (useEditorState,useEditorRuntimeState,useRuntimeState,useRootState, anduseEditorViewState) intouseEditorSelectorwith both context and explicit-editor overloads plus view-statedependsOntokens ('authored','composing','focused','readOnly', and'view'). -
c39072cby @zbeyens – Add optionalwithHistorycallback toCreateCommentThreadInputonBaseCommentsPluginfor atomic record-only history writes after comment creation commits, and include margin notes inBaseInkPlugin.read.passageswithmarginside metadata onInkPassageMark. -
132c1ceby @zbeyens – Renameplatejs/reactplugin attributes typeNodePropstoNodeAttributessoplatejs/reactre-exports coreNodePropsMigration: Update plugin
render.attributestype annotations fromNodePropstoNodeAttributes:import type { NodeAttributes } from 'platejs/react';
-
- Add free text to boards (
BaseBoardTextPlugin,BoardTextPlugin,setTool('text')with theTshortcut, and double-clicking an empty spot on the board). Clicking places auto-sized text that grows in width and height as you type (autoSize: true); dragging or resizing locks a fixed wrapping width (autoSize: false). In Editing mode, leaving an unmodified newly clicked text box discards it without adding an undo step. Typing near a board edge pans the camera to keep the caret in view without changing the document, andexportPicturemeasures both width and height of auto-sized free text.
- Add free text to boards (
-
e6f8893by @zbeyens – Keep the caret inside an edited board note or shape when clicking empty paper or padding outside its text -
- Grow board notes with their text while keeping each note's stored size as its height floor, update bound arrows and hit tests to the grown height, preserve dragged heights on resize and drawn arrow ends when a note is removed, and measure static notes marked with
data-board-textduringexportPictureso exported notes and arrows draw whole.
- Grow board notes with their text while keeping each note's stored size as its height floor, update bound arrows and hit tests to the grown height, preserve dragged heights on resize and drawn arrow ends when a note is removed, and measure static notes marked with
-
- Place each board shape's root in a
divthat carries the shape's box, stacking rank and drag offset, and make the root fill it. Read a shape's inlineleft,top,width,height,z-indexortranslate, and itsoffsetLeftandoffsetTop, on the root'sparentElement. A private@layer board-shapesstyle rule prepended to the root makes the wrapper take no press and restorespointer-events: autoon[data-board-shape](setinerton an ancestor to disable pointer input on a board). The root keeps itsclassName, marks and non-placementstyle, usesbox-sizing: border-box, and ignoresall, offsets, margins,width,height,positionand grid placement or self-alignment keys fromstyle.
- Place each board shape's root in a
-
e63d5c7by @zbeyens – Index DOCX export hosts once per render so comments and review revisions anchor inside rendered named roots without colon-delimited key collisions, fix multi-comment offset shifts on shared text nodes, paint review marks across every rendered copy of a shared named root without spanning v1 review bookmarks over foreign roots, and warn onnamed-rootonly for stored roots not rendered into the DOCX output. -
d0fc717by @zbeyens – Support multi-test field conditions ({ all: FieldConditionTest[] }and{ any: FieldConditionTest[] }) with three-valued evaluation shared by the fill view andapplyFieldValues. ExportFieldConditionTest, include other roles waited on by optional fields inpending, name the first waiting role in UTF-16 code-unit order inwaitingrefusals, map every testrefon paste, duplicate and table fill, compare condition lists in any order across named field groups, and allowupdateto repair broken rules one at a time while refusing newly introduced problems or loops.Migration:
- TypeScript callers:
FieldConditionis now a union ofFieldConditionTest,{ all: readonly FieldConditionTest[] }, and{ any: readonly FieldConditionTest[] }. Narrow a condition ('ref' in condition,'all' in condition, or'any' in condition) before readingref,test, orvalue. pendingon optional fields:applyFieldValuesandstartFieldValuesnow include any other role waited on by an unsubmitted role's optional field inpending, so existing templates where an optional field waits on another role return that role inpendinguntil it submits.- Reserved keys on legacy single-test conditions:
allandanyare now reserved discriminators onFieldCondition. If a saved single-test document attached a custom extra key namedallorany, rename that key before loading. - Schema fingerprint (
validationVersion: 2): Widening theconditionvalidator changes the derived schema fingerprint for editors usingBaseFieldPluginorFieldPlugin:- Apps with a named schema: bump
schema.version, register the previous schema fingerprint, and return each document unchanged (after renaming any customall/anykey on legacy single tests). - Apps storing
{ document, schema }envelopes on the default derived identity: reopen each document throughcreateEditorand save it again. - Apps storing bare document JSON: no migration required unless a single test holds a custom
all/anykey. - Populated Yjs rooms: start a new room seeded with the converted document.
- Apps with a named schema: bump
- TypeScript callers:
-
c3f69d6by @zbeyens – Addread.conditionTargets(fieldId)toBaseFieldPluginto return the field ids in document order that a condition onfieldIdmay target without closing a loop, plus any field the condition already names. Check name-group condition conflicts without recursion so deep chains of named fields do not overflow the stack. -
b7b55b5by @zbeyens – Add themultiplefield kind with optionalmin(>= 2) andmax(>= 1) count bounds,includesandnot-includescondition tests, order-insensitive comparison across name groups,answer-conflictandstartFieldValues, comma-joined option labels in plain text and Word export,data-field-minanddata-field-maxHTML attributes (mapping importedmin=1onmultiplefields torequired: true), and{ kind: 'multiple', value?: readonly string[] }inreadFieldAnswers. Remove the unuseddefaultValuefield property anddata-field-default-valueHTML attribute.Migration:
- Removed
defaultValue: Delete thedefaultValuekey (do not leavedefaultValue: undefined) from everyfieldnode before loading documents under the closed schema or passing them to the field helpers.applyFieldValuesandstartFieldValuesrefuse a field carryingdefaultValueasmalformed, andreadFieldAnswersandfieldSubmissionsilently skip malformed fields. RemovedefaultValuefrom anyinsertorupdatecall. Apps that store application defaults keep them outside the field schema or prefill withstartFieldValues. - TypeScript callers:
FieldValuenow includesreadonly string[],FieldKindincludes'multiple',FieldTestincludes'includes'and'not-includes', andFieldAnswerincludes{ kind: 'multiple'; value?: readonly string[] }. Note thatArray.isArray(value)does not excludereadonly string[]from the false branch in TypeScript; narrow withtypeof value === 'object'or avalue is readonly string[]predicate where a scalar value is expected. - Schema fingerprint: Adding
'multiple',min,max, wideningvalue(validationVersion: 2) andcondition(validationVersion: 3), and removingdefaultValuechange the derived schema fingerprint for editors usingBaseFieldPluginorFieldPlugin:- Apps with a named schema: bump
schema.version, register the previous schema fingerprint, and deletedefaultValuefrom eachfieldnode in the migration step. - Apps storing
{ document, schema }envelopes on the default derived identity: verify the previous fingerprint, deletedefaultValuefrom eachfieldnode inenvelope.document, open withcreateEditor({ initialValue: migratedDocument, initialSelection: envelope.selection, plugins }), and save a fresh envelope. - Apps storing bare document JSON: delete
defaultValuefrom eachfieldnode before callingcreateEditor,applyFieldValues,startFieldValues,fieldSubmission, orreadFieldAnswers. - Populated Yjs rooms: start a new room seeded with the migrated document.
- Apps with a named schema: bump
- Removed
-
7b6db1cby @zbeyens – Scope footnote anchors, HTML serialization, and static rendering by content root, and omit fragment targets for unresolved named-root footnotes. -
3a8a547by @zbeyens – Keep ink marks attached to their words across edits elsewhere in the same paragraph and across line wraps with shape-aware reflow (flow,box,span,rigid), addBaseInkPlugin.read.liveMarks(), and support live-block passages (InkPassage.block) and{ block, start, end }ranges inread.rangeandInkPlugin.api.images. -
- Add experimental digitized ink state on
BaseInkPlugin: theink-digitizedrecord set,tx.plugin(BaseInkPlugin).setDigitized(ids, value)andeditor.plugin(BaseInkPlugin).read.shownMarks(). Digitized marks stay saved without showing signs or deleted signs, leave withremove, and drop orphan digitized records on load.
- Add experimental digitized ink state on
-
- Add experimental
editor.plugin(InkPlugin).api.images(passages, { maxSide })(withInkImagesOptionsandInkPassageImagestypes) to renderinkAloneandinkOnTextCanvas 2D PNGs, pixel mark boxes, and inline void text from the live view.
- Add experimental
-
- Add experimental
read.passages(ids)andread.range({ copy, start, end })onBaseInkPlugin(withInkPassage,InkPassageMark,InkPassageWord, andInkRangeInputtypes) to read marked line passages and resolve saved copy character offsets to live ranges.
- Add experimental
-
- Update
InkPluginandInkContentplacement, lasso, Backspace, and Delete to read shown marks viaread.shownMarks(), skipping digitized marks on default passes and leaving faded digitized marks untouched by the eraser, Backspace, and Delete. - Add experimental
editor.plugin(InkPlugin).api.setShowDigitized(value)(withshowDigitizedonInkViewStateand optionaldigitizedonInkSign) to show digitized marks faded over their words or as separate digitized signs and let the lasso pick them.
- Update
-
f4f653bby @zbeyens – Preserve another focused field's DOM selection whenNodeSelectionDragreleases after a focus redirect or receives key events while unfocused -
- Remove
EditableProps,LeafNodeProps,TextNodeProps,RenderElementFn,RenderLeafFnandRenderTextFn. UseEditorContentPropsforEditorContentprops, and write a plugin'sleafAttributesandtextAttributescallbacks inline, where Plate infers their props. - Type
context.editoras Plate'sEditorin everyEditorContenthandler that takes a context, such asonKeyDown,onClickandonPaste, and in the handler types, such asEditableKeyDownHandler.scrollSelectionIntoViewgets Plate'sEditortoo. ExportEditablePointerSelectionEndHandlerfromplatejs/react. - Accept a plugin in
PluginPortalandBasePluginPortal, as inPluginPortal<typeof MyPlugin>, distribute over unions of plugins, and keep an erasedPluginReferenceportal'sschemaoptional and kind-dependent. - Export
EditorReference, typeuseRootEditorto return Plate'sEditor, and refuse at compile time anEditorRooteditortyped as a non-editor value or a raw Plite editor or view. A generic component that passes its editor toEditorRootconstrains it, as in<E extends EditorReference>. - Remove
namefromPluginDefinitionInputandBasePluginDefinitionInput. - Refuse at compile time a
definePluginschemakey other thancontentRoots,element,markandproperties, including explicit unions containing Plite-only keys.
- Remove
-
- Remove
useAnnotationStore,useAnnotation,useAnnotations,UseAnnotationStoreOptions,Annotation*re-exports, and unusedViewSource*(ViewSourceOptions,ViewSourceStatus,ViewSourceError,ViewSourceErrorSink,ViewSourcePhase) exports fromplatejs/react. - Export
CommentAttachmentChangefromplatejs/commentsas the payload type forsubscribeAttachments.
Migration: Replace
useAnnotation*witheditor.anchor,commit.changed.anchors(), andDecorationSource. UpdatesubscribeAttachmentslistener types fromAnnotationChangetoCommentAttachmentChangefromplatejs/comments. - Remove
-
82c983dby @zbeyens – RemoveElementIdPluginand reserveidacross every editor schemaplitejsschemas now refuse declaring an elementidproperty (naming the reservedidkey), and editor readers type returned elements with a requiredid: stringwhile detached inputs (ElementIn,InitialValue) and element guards (ElementApi.isElement) keepidoptional.- Removed
ElementIdPlugin, itsgenerateIdoption,HtmlExportKit/HtmlExportSchemaKit, and the internalreadElementByIdhelper; Markdown<block id>, Ink, HTML export, and document migrations now read core's reservediddirectly.
-
39fa61eby @zbeyens – Remove unusedjotai,jotai-x,jotai-optics, andoptics-tsdependencies so apps using Jotai no longer install duplicate copies -
- Move render prop types off root
platejs: importRenderElementProps,RenderLeafProps,RenderTextProps,RenderTextHostProps, andRenderTextPiecePropsfromplatejs/react, and importStaticRenderLeafProps,RenderStaticNodeWrapper,RenderStaticNodeWrapperFunction, andRenderStaticNodeWrapperPropsfromplatejs/static. - Pass
attributesintorender.mark.textAttributescallbacks during static HTML rendering, matching React rendering.
- Move render prop types off root
-
cc06ae9by @zbeyens – Allow whole row, column and table format suggestions in Suggesting mode, preserve displayed column widths when copying across a pending column deletion, and keep merged cells, row moves, container edits around tables, and a second row, column, or format suggestion already visible to the writer refused up front. -
170132fby @zbeyens – Enforce zero-argument runtime guards onuseEditor()anduseOptionalEditor(), tightenuseCreateEditor()typing, and rebinduseStateFieldValueanduseSetStateFieldto Plate'suseEditor().useEditor()anduseOptionalEditor()inplatejs/reactnow throw when passed any argument (includingundefined), matchingplitejs/react.- Zero-argument
useCreateEditor()now returns a non-null default editor and refuses caller-supplied generics without an options object. useStateFieldValueanduseSetStateFieldnow resolve through Plate'suseEditor(), so components under a passiveEditorProviderread and update the provider's editor. Plate'sUseStateFieldValueOptionsomitsdeferredto matchuseEditorStateanduseEditorSelector.- Inside
<EditorContent readOnly>, Plate's per-node renderreadOnlynow reportstrue.
plitejs
Major Changes
-
fe90073by @zbeyens – Unify Plite selector options, read-only hook, and DOM API with Plate:- Rename
EditorSelectorOptionstoUseEditorSelectorOptions, add= unknowndefault onUseStateFieldValueOptions, and remove publicdeferredfromUseEditorSelectorOptions,UseStateFieldValueOptions, andEditorRuntimeSelectorOptions(wrap selector results with ReactuseDeferredValueinstead). - Remove
useOptionalEditorReadOnlyfromplitejs/react; useuseEditorReadOnly()directly (returnsfalseoutside providers). - Unexport
DOMEditor(value and type) fromplitejs/dom; useeditor.api.dom.*andeditor.api.dom.clipboard.*.
- Rename
Minor Changes
-
38eb5deby @zbeyens – Rename theauthoredRecordsplugin name from'authored-records'to'authoredRecords'to match the lower camel case plugin naming convention. -
353fcecby @zbeyens – Replace theshouldUpdatecallback option and internal options (runtimeEventSource,profileId,includeRootOrderChanges,nodeKey,nodeKeys) on public React selector hooks (useEditorSelector,useEditorState,useEditorRuntimeState,useRuntimeState,useRootState) with declarativedependsOn.- Export
EditorSelectorDependencyandEditorSelectorDependenciesfromplitejs/react. Pass commit change kinds (such as'selection','document', or['properties', 'structure']),defineStateFielddescriptors, or{ nodeKey, kind? }/{ nodeKeys, kind? }objects todependsOn. - Remove
shouldUpdateandruntimeEventSourcefrom public selector option types, and drop the unused secondTEditortype parameter onEditorRuntimeStateSelectorOptions<T = unknown>(callers passing two type arguments drop the second one); internal mounted-render subscriptions stay private insideplitejs/react. - Keep
useNodeSelectoranduseTextSelectorfrom accepting internal render-skip policies through forwarded option objects, and removeuseRootState's unconditional root prefilter so record-only writes and version reads stay fresh.
- Export
Patch Changes
-
82c983dby @zbeyens – RemoveElementIdPluginand reserveidacross every editor schemaplitejsschemas now refuse declaring an elementidproperty (naming the reservedidkey), and editor readers type returned elements with a requiredid: stringwhile detached inputs (ElementIn,InitialValue) and element guards (ElementApi.isElement) keepidoptional.- Removed
ElementIdPlugin, itsgenerateIdoption,HtmlExportKit/HtmlExportSchemaKit, and the internalreadElementByIdhelper; Markdown<block id>, Ink, HTML export, and document migrations now read core's reservediddirectly.
-
- Fix collapsed deletes, merges, and
points.before/points.afterinside or beside non-selectable blocks, childless block atoms, isolating siblings, trailing-inline line breaks, and container hanging ranges
- Fix collapsed deletes, merges, and
-
c06c7deby @zbeyens – AdduseEditorRootAreasto read which named roots have standalone editing areas in the view's presentation and whether a view is the active copy for its root. -
93af01dby @zbeyens – Merge derived-read React hooks (useEditorState,useEditorRuntimeState,useRuntimeState,useRootState, anduseEditorViewState) intouseEditorSelector, add view-statedependsOntokens ('authored','composing','focused','readOnly', and'view'), exportuseModelEditorfromplitejs/react, and fix stale-viewreadOnlylocking for absent roots. -
132c1ceby @zbeyens – RemoveEditorElement,EditorLeaf, andEditorTextfromplitejs/reactpublic exportsMigration: Spread
attributesonto your own element inrenderElement,renderLeaf, orrenderText:const renderElement = ({ attributes, children }: RenderElementProps) => ( <p {...attributes}>{children}</p> );
-
55025b2by @zbeyens – UnifyEditorRootonValueChangeto emit the fullEditorDocumentValueon document or persisted-state changes, alignCommitContext,SelectionChangeContext, andValueChangeContextto take<E>, drop unusedauthorIdanddocumentprops fromEditorRootProps, and recreateuseCreateEditorwhenoptions.idchangesMigration: Read
value.children(orvalue.roots) inonValueChangehandlers, and pass the editor type (for exampleValueChangeContext<typeof editor>) instead of a value array type to commit context generics. -
48ff60fby @felixfeng33 – Fix creating theauthoredplugin at module scope on Cloudflare Workers, which threw because it drew a random id on creation -
caeb87eby @felixfeng33 – Fix Backspace or typing over a block selection in Editing mode leaving another author's pending deletion struck when the selected blocks hold all of it. The write now accepts that deletion, as it already did over a text selection. -
- When app code moves focus during an editor focus call, a selection export, a caret repair or a queued selection clear, focus and the caret stay where the app put them, and the editor no longer marks itself focused while it does not hold focus
-
- Clear a root's pending DOM selection import hold when selection leaves that root or the root blurs, so returning focus within the selectionchange throttle window still exports the root's saved caret to the DOM
-
9515b86by @zbeyens – Addcommit.changed.anchors()and theReadonlyAnchortype so commit listeners can read the live anchors whose stored value a commit changed without polling every anchor, and restore history anchors immediately on undo and redo commits. -
5cad385by @zbeyens – Keep anchors, peer rebases, and history intact in untouched roots when another named root is created, edited, or deleted in the same update -
- Fix a crash when starting an IME composition over a selection that spans an inline element such as a link
-
d3a3d25by @felixfeng33 – Fix an Editing or Suggesting delete across two quotes that threwcannot contain "quote"when another author's pending deletion strikes a quote between them -
f4f653bby @zbeyens – Preserve another field or nested editable's DOM selection whenDOMEditor.focus, WebKit blur, or projected drag clears run without owning the selection -
1cc288eby @zbeyens – Remove block voids spanned by a hanging selection on delete and text insert -
1a2a3faby @felixfeng33 – Addeditor.api.history.record(effect, value, { firstWrite })to record a session step, withHistoryRecordResult,HistoryRecordOptionsandEditorEffectHistoryKindexported fromplitejs. While afirstWritepromise runs, the step stays in undo and holds the redo it cleared, so redo returnsbusy. A first write that resolvesblockedtakes the step back and gives back the redo it held. The session effect's replay reads the promise asfirstWriteonEditorEffectHistoryReplayContext, and a first write that rejects reports to the lifecycle error sink with phaseapply.Migration:
tx.effects.emitandeditor.update.effects.emitnow refuse a session effect, one defined withhistory: { replay }, both in types and at runtime. Record it outside any update instead:// Before editor.update((tx) => tx.effects.emit(threadEffect, step)); // After editor.api.history.record(threadEffect, step);
EditorEffectType<T>andEditorEffect<T>now stand for an effect of any history kind, soemitrefuses them in types. A state field'seffect, the effectsgetCollabEffectsreturns and the effectdefineEffectreturns for apushorskipeffect keep emitting as before. Type your own parameterEditorEffectType<T, EditorJsonValue, StateFieldHistoryPolicy>to emit it. -
- Keep focus in the active external text control, editor view, or outside button when an undo or redo runs from another external control, a
focusPolicy: 'preserve'history control, oreditor.api.history.undo(). - Return focus and the caret to the forked synced-block copy after keyboard redo of an Unsync and after button undo of single- or nested-level Unsyncs, including keyed and delayed-mount slots.
- Return focus to the last-used slot view when a history control replays a child root rendered by two panes sharing an owner element.
- Keep focus in the active external text control, editor view, or outside button when an undo or redo runs from another external control, a
-
d2cc369by @zbeyens – ExportsetDOMClipboardFormatKeyandgetPluginSlotInputfromplitejs/internalfor Plate's DOM plugin activation and dynamic plugin input validation. -
83cefabby @felixfeng33 – Fix a redo whose owner answers late: it keeps its place in undo when a skipped edit removed the step below it, it leaves undo when the undo limit would have dropped it, and a redo whose every effect a skipped edit removed no longer leaves an undo step that does nothing -
- Publish multi-source native typing and deferred decoration refreshes in one repaint per node while keeping fast typing across editors with multiple decoration sources.
- Remove the
plitejs/annotationsentrypoint,useAnnotationStore,useAnnotation,useAnnotations,UseAnnotationStoreOptions, and unusedViewSource*(ViewSourceOptions,ViewSourceStatus,ViewSourceError,ViewSourceErrorSink,ViewSourcePhase) exports fromplitejs/react.
Migration: Replace
plitejs/annotationsanduseAnnotation*witheditor.anchor,commit.changed.anchors(), and aDecorationSourceregistered throughEditorRootor a plugin. -
487d022by @felixfeng33 – Keep one author's change that starts inside that author's previous insertion or deletion on the same review card, such as a join inside a deletion of both its lines, so accepting the card no longer returnsblocked -
ee42782by @zbeyens – Keep the destination line's key and stored id when pasting a matching block over an empty or wholly selected line (including inside quotes and underreplaceEmptylanding policies), and restore the original document when rejecting a suggested multi-line paste at a line's end or over an empty line -
815c8e3by @zbeyens – Record blocks pasted over part of a paragraph's text or at the end of a paragraph or quote as insertions in Suggesting, even when the document holds another pending change. Rejecting the suggestion now removes the pasted block instead of keeping it or refusing one-text blocks such as code blocks. -
d31dbf4by @zbeyens – Stamp pending DOM selection imports with the editor's placement generation and route deferred selection clears, settles, and caret repair retries through one freshness check so stale timers and pre-placement flags cannot overwrite newer browser or model selections. -
12a911eby @felixfeng33 – Fix a letter typed after Backspace removes the last letter of a line that another author's pending join strikes landing at the end of the line before. The letter now stays on that line, in Editing and Suggesting, and accepting the join still puts it after the text of the line before. -
170132fby @zbeyens – Renameplitejs/react's editor-creation hook touseCreateEditor, makeuseEditor()anduseOptionalEditor()read the active editor from context, align React read hooks withuseEditor(), and removeuseCaretEditorandUseEditorOptions.- Replace
useEditor(options, deps)withuseCreateEditor(options, deps)(andUseEditorOptionswithCreateEditorOptions). Zero-argumentuseCreateEditor()returnsEditor<Value, readonly []>and rejects input-free type parameters. useEditor()anduseOptionalEditor()take no arguments (passing any argument, includingundefined, throws at runtime) and return the editing area's editor inside anEditableor the active caret root's editor (falling back toEditorRoot's own root) outside every editing area. Note for apps upgrading from bareuseEditor()with no arguments:useEditor()now reads from context instead of creating an empty editor, so switch creation calls touseCreateEditor().- Replace
useCaretEditor()withuseEditor(). useEditorSelector,useEditorState,useEditorSelection,useEditorFocused,useEditorComposing,useEditorReadOnly,useStateFieldValue, anduseSetStateFieldnow followuseEditor()so toolbars read and act on the same active root editor.
- Replace
-
- Allow
tx.records.putandtx.records.dropin the sameeditor.updateafter a text or node edit whose intermediate draft is not yet canonical, normalizing and validating the draft at commit as usual.
- Allow
-
39fa61eby @zbeyens – Remove unused@noble/hashesdependency -
14beff3by @zbeyens – Store a core-generatedidon every element in every editor- Every editor whose schema declares no
idelement property now stores a unique non-empty stringidon every element, including kept elements underpreserveschemas, and supportsnodes.byId(id)andat: { id }without declaring anidproperty. - New elements created by insert, split, wrap, paste, or live duplicate repair receive
<scope>.<counter>ids from each editor's own mint, while loading a document without ids fills missing ids deterministically asfill.<n>across roots, spare lines, and Yjs rooms. - Empty strings and non-string element ids are refused locally, from peers, and on load with
EditorSchemaValidationError. - Schema fingerprints now include the reserved
id, so saved envelopes, native sync rooms, Yjs rooms, and saved history created before this change refuse to open with a schema-mismatch error; pass the plain document value to load it with filled ids.
- Every editor whose schema declares no
-
ef3675fby @zbeyens – Invoke an editable root's registered viewport reveal handler and schedule one cancelable retry whenDOMEditor.scrollIntoViewmisses a culled block or range. -
e6f8893by @zbeyens – Keep right-clicks and middle-clicks from starting projected text drags or collapsing model selection beforecontextmenufires -
ee0a8d7by @felixfeng33 – Keep the key of a content root declaredownership: 'shared'when its owner is copied, pasted, duplicated or dragged, so the copy shows the same root instead of a clone. A root declared by its grammar alone is nowexclusive: a second owner is refused, an open schema drops the root with its last owner, and aneachtable fill gives each cell its own copy.Migration: Declare
ownership: 'shared'on a root that several blocks should show.body: { content: schema.content.text(), ownership: 'shared' }
-
6606f85by @felixfeng33 – Fix deciding a suggested line split in a different order giving a different document once someone moved the split's lower line: rejecting the split now joins the line it cut with the line now after it, as Google Docs does, and waits for another pending suggestion on that next line. -
- Include
PluginReferenceinEditorStateField, the typedefineStateFieldreturns, so TypeScript accepts a state field wherever it accepts a plugin reference, such as inplugins. Make a state field withdefineStateField, because an object you build by hand no longer types as one.
- Include
-
- Hold one pending row, column or format suggestion per table. Suggesting a second one, adding or removing a single cell, changing a span (including inside an author's own pending inserted table), moving or splitting a row, adding, deleting, wrapping or unwrapping a block or outer table that holds a table, and an undo or redo that changes a table whose value or block window changed since its step while any pending mark waits there or the replayed step held one now refuse with cause-specific messages. After a history restore, an undo or redo that changes a table refuses in a document that holds a verdict or another authored record, unless it withdraws the writer's own pending change. A writer's own undo or redo of their pending row or column goes through when the sync room would take it.
- Record a whole column as one suggestion in a forced proposal.
- Refuse in Editing, while a table holds such a suggestion, inserting a row or column, moving a row or cell, removing some but not all columns, merging or splitting cells, and writing a property on the table, a row or a cell.
- Add
read.authored.gridLocked(node), which says whether a table waits as a suggested deletion or holds a pending row, column or format suggestion.
-
c59e6ecby @zbeyens – Keep select-all in a virtualized editor from drawing a duplicate native selection highlight while mount focus settles. -
c945376by @felixfeng33 – Fix Yjs peers reading the upper line's set-valued property on the lower line after one update changed that property on a line and split the line at its start.
Full changelog: v54.0.0-beta.6...v54.0.0-beta.7