@platejs/cli
Patch Changes
-
- Narrow
plate generateto emit exactValue,Document, named-root value types, and staticschemahandles without unreachableEditor/Mutationstypes or hardcodedplatejs/reactimports. - Fix JSON property type printing across
Readonly/ utility aliases,node_modulesdeclarations,set-of-jsonproperties (authored), and applicationschema.propertieshandles while rejecting host/callable/deep types. - Derive narrowed per-element text interfaces from
textAllowedByParentType(forcontentMarks: falseblocks), emitprefix+remainderchild tuples with fixed slot properties, and evaluate conditional targets with same-key union merging. - Resolve ESM package entries via
mainFields: ['module', 'main']without app-specific stubs, harden artifact locking and atomic backup swap/rollback, and trimplate migrate newto three files (from.ts,to.ts,migration.ts).
- Narrow
-
- Import
isNominalPluginDescriptorfromplatejs/compilerwhen bundling editor entries inplate generate
- Import
-
- Add
--export <name>toplate migrate run(defaultEditorMigrations) while keeping static single-export bundling. - Allow mixed raw and persisted envelope files in one
plate migrate run --from <version>run, matchingmigrateDocumentraw-fallback behavior. - Include
legacyandmapRangesguidance in theplate migrate newmigration template.
- Add
-
f41097bby @zbeyens – Updateplate codemod plite-to-platediagnostics for removedplitejs/historyinternal type re-exports (CarriedRun,HistoryBatchJSON,HistoryControlTx,SerializedEditorSelection) -
bf9b87cby @zbeyens – Updateplate codemod plite-to-platediagnostics for renamedplitejs/reactusePathand removeduseElementPath,useOptionalElement,useContentRoot, and renderer capability exports -
29bcbd6by @zbeyens – Update theplite-to-platecodemod to handledefinePluginCompartmentalongside legacydefinePluginSlot. -
3c2d532by @zbeyens – Drop removed Yjs codemod mappings and keepplitejs/syncsyncandSyncPluginimports onplitejs/syncwith a manual diagnostic inplate codemod plite-to-plate -
4d4154cby @zbeyens – Update theplite-to-platecodemod classification for the native-DOM pagination surface (PaginationSurface,PaginationSurfaceProps,useTableRowPageBreak) and remove retiredPagedEditorContentand Pretext pagination symbols.
@platejs/test
Published @platejs/test@54.0.0-beta.9.
platejs
Minor Changes
6d42192by @zbeyens – AddBaseLockPlugin.read.containsLockedcovering self, ancestors, descendants, and owned content roots, cache per-table span indices for O(1) row-drag hover vetoes, and migrateUploadPlugintoeditor.api.dom.drag.resolveTarget.
Patch Changes
-
4d4154cby @zbeyens – Replace<PagedEditorContent />, Pretext pagination exports (measurePages,createPretextPageLayoutEngine,createEstimatedPageLayoutEngine,usePageLayoutFragments), and the@chenglou/pretextpeer dependency withPaginationPlugin,PaginationContent,usePageLayout(editableRef?), anduseTableRowPageBreak(element)for zero-remount Pageless and Paged editing on standard<EditorContent />. -
ef4c7e5by @zbeyens – CollapseRenderTextPropsback to a single host type by removingRenderTextHostProps,RenderTextPieceProps, andpiecefromplatejs/react, and drop obsoletedata-editor-insetanddata-editor-text-pieceprojection markers. -
5c8641dby @zbeyens – Set a fallbackaria-label="Autocomplete"on the editor root while an autocomplete occurrence is active and the editor has noaria-labeloraria-labelledby, restoring the root when the popup closes -
d85b122by @zbeyens – Move combobox trigger policy (trigger,triggerPreviousCharPattern,triggerQuery,maxQueryLength,queryPattern,label) andsyncPopupontouseComboboxinplatejs/combobox/react, exportComboboxCompletionandComboboxPopupState, and remove the headlessplatejs/comboboxentrypoint (ComboboxState,ComboboxEditor,filterWords,FilterWordsOptions,FootnotePluginState). -
- Add optional
continuationcallback (({ ...context, block, properties })) onHtmlElementPropertyCreateRule(createsElement: true) to merge schema-admitted properties onto non-nested trailing blocks inside multi-block HTML items - Preserve GitHub code wrappers, custom element and mark wrappers, standalone
<br>blank lines, embedded images inside<p>and<span>, andwhite-space: prespacing when parsing or pasting multi-block HTML lists, and keep display equations as block elements in continuation blocks of list items - Report
html-unsupported-content(action: 'replaced'or'unwrapped',kind: 'element',impact: 'lossy') when acreatesElementHTML mapping replaces or unwraps an unsupported leading block, matching Markdown list loss reporting; parse board clipboard HTML withlossPolicy: 'allow' - Reuse compiled plain-text mappings across repeated
serializePlainText(editor)calls and alignprojectionJSDoc with runtime behavior - Narrow
DocxExportResultto warnings-only on success and an error-first tuple on failure, exportDocxErrorDiagnosticandDocxWarningDiagnosticfromplatejs/docx/export, addimpacttolossy-contentandresource-omittedDOCX diagnostics, and classify unwrapped script-capable links and alt- or caption-preserving script-URL images asimpact: 'lossless'on DOCX export
Migration:
- Strict
editor.api.html.parse(...)andimportDocx(...)callers (lossPolicy: 'reject', the default) that parse HTML or Word lists containing unsupported leading headings, code blocks, blockquotes, or un-listable blocks now receiveok: falsewithhtml-unsupported-content; pass{ lossPolicy: 'allow' }when lossy fallback is desired. DocxExportResultnow narrowsok: truetoreadonly DocxWarningDiagnostic[]andok: falsetoreadonly [DocxErrorDiagnostic, ...DocxDiagnostic[]], andlossy-contentandresource-omittedDOCX diagnostics now requireimpact.
- Add optional
-
- Remove
skipInitialization,shouldNormalizeEditor,useCreateEditor({ enabled }), and unusedPLUGINS.navigationFeedback. OmitinitialValuefor default ormin: 0empty-root initialization, calleditor.update.value.repair()after creation when repair is needed, and conditionally mount the component that callsuseCreateEditor. - Unify
CreateEditorOptionsdefaults and maker overloads acrossplatejsandplatejs/react, fixing headlessinitialValuecallback typing andlifecycleErrorSinktyping. Conditional plugin tuples (such asflag ? [Plugin] : []or[flag ? A : B]) and statically disabled plugins (Plugin.configure({ enabled: false })) no longer expose absent plugin entries on typededitor.api,editor.read, oreditor.update.
- Remove
-
- Collapse
BaseLinkPluginupdates toupsertandunwrap, removinginsert,wrap,upsertText, andexitEnd, plusrangeBeforeOptions,defaultLinkAttributes.href, and unused link option/definition type aliases (LinkAttributes,BaseLinkPluginState,CreateLinkNodeOptions,UnwrapLinkOptions,WrapLinkOptions,UpsertLinkOptions,BaseLinkDefinition,LinkDefinition) - Preserve existing link nodes when expanded-selection link wraps are refused by schema rules, preserve
targetonlink.upsertunless explicitly passed, and preserve live selection whenatis passed - Strip leading wrappers and trailing sentence punctuation in typed autolinks, recognize
www.domains indefaultParseUrl, and fix balanced parentheses, UTF-16 emoji offsets, formatted labels, and inline-void safety inLinkRules.markdown - Fix multi-block URL paste when
keepSelectedTextOnPasteisfalseand align Markdown bare-URL detection across link and table serialization
Migration: Replace
editor.update.link.insert(...),editor.update.link.wrap(...), andeditor.update.link.upsertText(...)witheditor.update.link.upsert(...)(passatdirectly instead ofinsertNodesOptions.at, and passtarget: nullortarget: undefinedto unsettarget). RemoverangeBeforeOptionsfromLinkPlugin.configure({ initialState }), and use inferred types orLinkElementinstead of the removed type aliases. - Collapse
-
e7c50c9by @zbeyens – ExportlinkUrlValidationfor stored navigation URL schema properties and strip floor-refused optionalurlvalues during v53-to-v54 migrations. -
- Remove the legacy
scopestring option fromuseElementSelectorand throw when called outside a matchingElementProvider(pass a plugin descriptor as the first argument to scope to an ancestor element). - Add explicit
editor, field-key, and{ equalityFn }support touseViewStore, matchingusePluginStore, and stop explicit-editorusePluginStoreanduseViewStorecalls from subscribing to editor context changes. - Remove
zustandfromplatejsruntime dependencies.
- Remove the legacy
-
- Fix
usePlateModelRevisionto subscribe only to$configurationpublication commits instead of every editor commit, preventing unnecessary re-renders during typing, selection, focus, and blur. - Fix
useRootEditorto resolve underEditorControllerandEditorProviderwhile preserving editing-area lock isolation insideEditorContent. - Fix
EditorProvideruseEditorContainerRefanduseEditableRefto read live mounted refs, stabilizeEditorContainercontainer ref attachment across active view switches, and fixEditorContentViewnested lock detection andscrollSelectionIntoViewhandler freshness.
- Fix
-
518dcbaby @zbeyens – Unify list and block indentation underBaseIndentPlugin.update.increase/decreasewith flatIndentChangeOptions(at,match,mode) and boolean return values, and removeBaseListPlugin.update.outdentandOutdentListOptions. AddBaseListPlugin.update.setfor idempotent list kind, style (nullresets), and taskcheckedupdates, narrowtoggleto{ type, at? }, and returnbooleanfromclear. ConvertListTypeandListStyleto type-only unions, renameBaseListDefinitiontoListDefinition, exportListLevel/ListLevels, and removeisOrderedListandBULLETED_LIST_STYLES. AddMod+Entertask toggling and create unchecked tasks onEnterat the end of a checked task. -
86110b8by @zbeyens – ReplaceAIChatPlugin,useAIChat,AIChatRequestContext, andfindQuotedSpanwith a zero-AI-SDKplatejs/aicore (getEditorTools,createEditorAgent,registerEditorTools,createAIDraftSession,AIPlugin,useEditorAgent,useWebMCP) and removeai,@ai-sdk/react, andfastest-levenshteinpeer dependencies fromplatejs.- Add framework-agnostic document tools (
editor_read,editor_find,editor_suggest_edit,editor_list_suggestions,editor_withdraw_suggestion, opt-ineditor_list_commentsandeditor_comment, and opt-ineditor_debug_inspect) backed bywritePolicy: 'propose-only', required recursive visibility filtering, default-deny remote media guards, and revision checks. - Add
registerEditorToolsanduseWebMCPto expose multiplexed WebMCP tools per(modelContext, prefix)withallowgating, origin-grant matching, and abort teardown. - Add
createAIDraftSessionandAIPlugin(PLUGINS.ai) for detached streaming generation, provisional selection rewrites that land one minimal-diff suggestion on finish or stop,<Locked>placeholder rewrites viaeditor.api.markdown.parsePlaceholders, pinned table-cell rewrites, and cross-block comment range matching withoutfastest-levenshtein. - Require
filteronserializeAIEditContextandserializeAISelectionMarkdown, and passprojection: 'proposed'conditionally whenAuthoredPluginis installed. - Retarget
CopilotPluginsuppression toAIPluginstore state (status === 'streaming',status === 'reviewing', oropen).
Migration: Replace
AIChatPluginanduseAIChatwithAIPlugin,createEditorAgent, and your own AI SDKuseChattransport, removeai/@ai-sdk/react/fastest-levenshteinpeer expectations onplatejs, and passfiltertoserializeAIEditContextandserializeAISelectionMarkdown:import { AIPlugin, useEditorAgent, useWebMCP } from 'platejs/ai/react'; const plugins = [AIPlugin];
- Add framework-agnostic document tools (
-
- Remove
ElementStatePlugin,ElementStateApi,ElementStateDefinition,PLUGINS.elementState,AffinityPluginUpdate,AffinityEdgeNodes,editor.update.affinity.setSelection,DomPluginState['clipboardFormatKey'],DebugPluginState['isProduction'], stale v1DebugErrorTypetags,AnyObject,createHotkey, and six unused root helper/type exports (isPluginNodeClass,isPluginElementClass,WithRequiredName,PluginOwnUpdate,InferPluginReadGroups,InferPluginUpdateGroups) - Move
isNominalPluginDescriptorfromplatejsandplatejs/reacttoplatejs/compiler - Remove
process.env.NODE_ENVchecks fromDebugPlugin, defaultinglogLevelto'error'(droppingapi.debug.warn,info, andlogcalls in development unlesslogLevelis raised) andthrowErrorstotrueacross all runtimes - Refuse disabling required core plugins (
debug,html,override,inputRules) atcreateEditortime, and subtract statically disabled optional core plugins (HistoryPlugin,AffinityPlugin,TransferPlugin,DOMPlugin) from concrete editor types respecting last-wins plugin tuple order; erased(editor: Editor)helpers expectinghistorynow reject history-disabled concrete editors, whilerenderStaticHtmlaccepts anyEditorReference - Project default element updates method-by-method under application schema policies (
removeandsetstay available across policies,insertandupsertstay available underroot-only schemas, andtogglestays omitted) - Tighten widened
tx.plugin(string)to returnunknown, restorebooleanreturn types oneditor.update.nodes.unwrapandwrap, specialize React plugin portal APIs, and narrow.configure({ enabled: true }) - Reject unknown fields and array inputs with a
TypeErrorindefinePlugin,.extend(),.configure(), andtoReactPlugin(), and refresh derived toggle eligibility across live Plite schema swaps
- Remove
-
273b78eby @zbeyens – Replaceplatejs/suggestionandplatejs/suggestion/reactwithplatejs/authored(AuthoredPlugin,suggestionColorOf,AUTHORED_COLOR_COUNT) andplatejs/authored/react(AuthoredReactPlugin,useAuthoredGroups,useActiveAuthored), removePLUGINS.suggestionanduseSuggestionChanges, adduseCommentThreadIndextoplatejs/comments/react, removeusersandCommentUserfromBaseCommentsPlugin, replacesubscribePending,subscribeVisibleThreadIds, andsubscribeDraftThreadIdswithsubscribeSnapshot, and scope commentactiveIdsper presentation viaapi.activeIds(),api.setActive(), andapi.subscribeActive().Migration: Import
AuthoredPluginfromplatejs/authoredandAuthoredReactPlugin,useAuthoredGroups, anduseActiveAuthoredfromplatejs/authored/react. Move comment author profiles into a React context (such as copiedUserDirectoryProvider), replacesubscribePending/subscribeVisibleThreadIds/subscribeDraftThreadIdswithapi.subscribeSnapshot, and replacestore.get('activeIds')withapi.activeIds()andapi.subscribeActive()(callapi.setActive()on the mounted editor view rather than an unmounted model editor handle). -
8c3001bby @zbeyens – Exposedata-editor-authored-url-before,data-editor-authored-url-after, andtitleattributes on authored link URL edits. -
- Remove unused
BoardDefinitiontype export fromplatejs/board; usetypeof BaseBoardPluginorDefinitionOf<typeof BaseBoardPlugin>. - Make
BoardShaperesize handles ([data-board-handle]) render neutral geometry with no inline fill or border, and hide them when the board view or shape is read-only or locked. Migration: CustomBoardShapeconsumers should style[data-board-handle]in CSS (for example[&_[data-board-handle]]:border [&_[data-board-handle]]:border-ring [&_[data-board-handle]]:bg-background). - Respect
BaseLockPluginlocks across board views, handles, drag/resize/eraser/edit gestures, style targets, and frame moves holding locked shapes while keeping locked shapes selectable, copyable, and Alt-drag-copyable. - Fix
schema.overrideforboardFrameandboardArrow(including swapped element type names) and export customdefineBoardShapetext ontext/markdownclipboard copy without conflicting with explicit shape Markdown encoders.
- Remove unused
-
b95a34eby @zbeyens – Fix board keyboard shortcuts and clipboard inside open shadow roots, under Caps Lock and non-Latin keyboard layouts, onMod+Afrom a focused board with no shapes selected, and on extreme coordinates in copy placement andfit -
049c432by @zbeyens – Disallow formatting marks insidecodeBlockelements viacontentMarks: falsewhile keeping review metadata (authored) allowed, extendCodeBlockRules.markdownwithon: 'space'and language-capturing'space'/'break'fences plusnormalizeLanguage, align cross-block HTML/slice paste on the landing start block, checklowlight.registered(language)on highlight errors, strip disallowed formatting marks from single-text code blocks inmigratePlateV54CodeBlocks, and removeBaseCodeBlockPlugin'sread.entry,read.indentDepth,read.isEmpty, andupdate.resetBlock.Migration:
- Replace
editor.plugin(CodeBlockPlugin).read.entry()witheditor.read.nodes.above({ type: CodeBlockPlugin }). - Replace
read.isEmpty()with!NodeApi.string(block)on the containing code block. - Replace
update.resetBlock()withif (editor.read.nodes.block({ type: CodeBlockPlugin })) editor.plugin(CodeBlockPlugin).update.toggle(). - Apps that persisted unreleased
v54beta envelopes or Yjs rooms with the pre-cut code-block schema fingerprint must strip formatting marks fromcodeBlockleaves or migrate from the prior beta fingerprint before reopening.
- Replace
-
11b3a12by @felixfeng33 – Allow code block text edits, indentation, language changes, and structural conversions to record as proposals in Suggesting mode.BaseCodeBlockPluginnow usesschema.content.text({ default: 'text', min: 1 })withoutmax: 1and removes itsauthoredVeto, while plain code blocks still canonicalize to a single text leaf andBaseCodeHighlightPluginsplits syntax decorations across multi-leaf code blocks. -
- Remove the
ExternalTextDispatchResultre-export fromplatejs/reactand remove duplicate local rollback fromcreateCodeMirrorAdapter. - Preserve decorations across canonical CodeMirror resets and accept typing after unlocking a read-only code block whose composition ended without
compositionend. - Add
slots.externalTextsupport toEditorStatic(RenderElementSlotsandPlateStatic) so components usingslots.externalTextrender cleanly in static output. - Implement
ExternalTextView.scrollIntoViewoncreateCodeMirrorAdaptersoFindBarandapi.dom.scrollIntoViewreveal matches inside scrollable and tall CodeMirror blocks below sticky headers. - Fix
EditorView.lineWrappingvertical boundary navigation and pure-DOM wrapped visual-row column entry (with wrap-pointassoc) increateCodeMirrorAdapter. - Cache CSSOM decoration
styleserialization by object identity in aWeakMapand center wrapped or tall range targets inside.cm-scroller's visible box duringscrollIntoView.
- Remove the
-
c847832by @zbeyens – Renameplatejs/layoutandplatejs/layout/reacttoplatejs/columnandplatejs/column/react, replace string percentagecolumn.widthwith positive finite numeric flex weights (default1, omitted at default), addresizeColumns,unwrap,removeColumn,insertColumn, empty-column Backspace, symmetric HTML codecs, subtree/paste non-nesting, DOCX sibling percentage normalization, and v54 migration support -
- Remove
editor.anchor.save,editor.anchor.restore, andEditorDocumentRangere-exports fromplatejsandplatejs/react - Rebase
comments.creationhistory redo acrosshistory-skipedits and read stored comment anchor coordinates explicitly independent of Authored preview mode
- Remove
-
12abcd6by @zbeyens – Upgradeplatejs/commentsandplatejs/comments/reactto quote-verifiedCommentAnchorpersistence and incremental versioned remote sync:- Replace
CommentRanges,api.ranges(),api.subscribeRanges(),api.replace(), andSavedComments.rangeswithCommentAnchors(CommentAnchorwith block IDs, quote context, and document revision),api.anchors(),api.encodeAnchor(),api.subscribeAnchors(),api.applyRemote({ upserts, deletes })with monotonic versions, tombstones,mutationIdecho reconciliation, and unresolved anchor hydration. - Remove
createDraft,discardDraft,publishDraft,draftThreadIds, andCommentThread.status; addsignal?: AbortSignal,history?: 'record' | 'skip',withHistory, and{ type: 'element' }targets tocreateThread, add{ status: 'aborted' }toCommentMutationResult, passactorId,anchor, andsignalinCommentMutationRequest, and allowbegin()on read-only and preview views. - Add
incarnationandmembersto change targets,elementIdandquoteto attached range attachments, andresolveCommentChangeTargettoplatejs/comments/react. - Update
migrateDocumentinplatejs/migrationsto acceptanchorsor legacyranges, mint permanent element IDs, and returnanchors, and fix DOCX import comment range remapping across inline links and coalesced text.
Migration: Save
api.anchors()instead ofapi.ranges()and passinitialComments: { anchors, threads }. ReplacesubscribeRangeswithsubscribeAnchors,replace()withapplyRemote({ upserts, deletes }), andcreateDraft/publishDraft/discardDraftwith abortablecreateThread({ ..., signal }). Updatemutatehandlers to readrequest.anchorandrequest.actorId, and updatemigrateDocumentcallers to readresult.anchors. - Replace
-
- Move
readEditorSchemaContract,diffEditorSchemaContracts, and theEditorSchemaContract*types fromplatejsandplatejs/reactontoplatejs/compiler. - Remove
restoreEditorSchemaContract,compileEditorSchemaContract,GeneratedEditorTypeProvider, andEditorCompilation.bindings[].authoredToggle. - Extend
EditorPropertyTypes<TPlugins, TSchema = undefined>with an optionalTSchemaparameter that projects applicationschema.propertiestypes, and widenSchemaElementSupportsToggleto accept text-allowing content expressions andschemaContribution.
- Move
-
b94933cby @zbeyens – RewriteCopilotPluginfor streaming inline Markdown completions, parsed-node word acceptance, mark-aware type-ahead, filtered FIM context, and abort-on-accept.- Store parsed inline
suggestionNodesviatx.setField(history: 'skip'), streaming througheditor.api.markdown.stream({ incompleteLinks: 'text', mode: 'inline' }), truncating before newlines, and treating an empty HTTP 200 stream as no completion. - Split parsed inline nodes in
acceptNextWordwith marks preserved across Latin and CJK word boundaries while keeping inline voids (inlineEquation,date,mention) and links atomic and leaving in-flight streams alive for remaining tokens. - Match type-ahead against leading text leaves only when active marks match, rejecting atomic inline elements, mark mismatches, and IME composition.
- Add
filter: EditorVisibilityFilterand build bounded<prefix>/<suffix>FIM context skipping hidden blocks, locked blocks, and code blocks; remove unusedCopilotPlugin.update.setSuggestion. - Abort in-flight completion requests on full
acceptas well as dismiss, cursor movement, readonly transitions, and view unmount.
- Store parsed inline
-
- Compile Plate documents directly to OOXML in
exportDocxvia pluginformats.docxmappings without React static HTML rendering or a browser DOM, removing thehtml-entitiesdependency and thecolor-name,html-to-vdom,juice,mime-types,virtual-dom, andxmlbuilder2optional peer dependencies, and loadingkatexlazily only when exporting equations - Replace
mammothand browserDOMParserusage inimportDocxwith a direct OPC/WordprocessingML reader that runs on the server without DOM globals, removing themammothoptional peer dependency andconverter-messagefromDocxDiagnostic - Extend
formats.docxmappings (DocxNodeMapping) with symmetric{ encode, decode }for element, mark, and element-property plugins, opaqueencodeBlocks/encodeInlinesfragments, andcontentRoot(slot)for named-root export - Round-trip Word footnotes through
word/footnotes.xmlwhen footnote plugins are installed - Replace
DocxExportOptions.{component,presentation,stylesheet}with optional typedstyles?: DocxExportStyles(DocxExportStyles,DocxParagraphStyle,DocxRunStyle), removemissing-static-presentationfromDocxDiagnostic, and omitlinkTargetcustom properties when regenerating an edited retained source - Inherit and report Word style formatting, drop hidden text (
w:vanish/w:webHidden) with a lossy diagnostic, report missing heading/link/table plugins as lossyunsupported-content, unwrapw:customXmlwhile preserving visible text, resolve header/footer/note parts through OPC relationships, and warn without failing strict import on exclusive-mark schema repairs
Migration:
- Replace
stylesheet,presentation, andcomponentoptions onexportDocx(...)with optional typedstyles: DOCX_EXPORT_STYLES(or omitstylesfor neutral Word defaults). - Custom element and mark plugins exported or imported through
exportDocx(...)andimportDocx(...)now declareformats.docx({ encode },{ decode }, or{ dropped }) instead of relying on static React components or HTML intermediaries; unmapped elements and marks emitunsupported-content(impact: 'lossy'). - Remove
color-name,html-to-vdom,juice,mammoth,mime-types,virtual-dom, andxmlbuilder2from app dependencies if they were only installed forplatejs/docx/exportorplatejs/docx/import. - Remove any switch branch handling
diagnostic.code === 'converter-message'ordiagnostic.code === 'missing-static-presentation'.
- Compile Plate documents directly to OOXML in
-
8c37372by @zbeyens – RemoveDataTransferFormatPhasefromplatejs/domand narrowDomPluginUpdatetoAutoScrollPluginUpdate. -
- Remove
DOMResolutionErrorfromplatejs/domand adopt the single nullableeditor.api.domlookup contract (resolve*andresolveWindow(): Window | null).
Migration: Replace
editor.api.dom.assert*with nullableeditor.api.dom.resolve*, replaceeditor.api.dom.getWindow()witheditor.api.dom.resolveWindow(), and replaceeditor.api.dom.findKey(node)/resolvePath(node)/isReadOnly()witheditor.key(node),editor.read.nodes.path(node), andeditor.api.react.isReadOnly(). - Remove
-
- Re-export
ScrollMarginfromplatejs/domalongsideScrollIntoViewOptions.scrollMargin
- Re-export
-
- Remove
ExitBreakPluginandPLUGINS.exitBreak; bind read-only-safetx.break.exitdirectly inExitBreakKit. - Consult
shouldMergeNodesRemovePrevNodefor empty-block Backspace merges, guard unselectable block voids withstate.nodes.isSelectableand facing-edge structural sibling lookups, and fix cross-blockbreak.splitResetwhile preserving required title joins in one Backspace.
- Remove
-
18ff3adby @zbeyens – FixEditorRootcommit observers for named roots, frozen document views, and lazy callbacks- Deliver root-scoped
onSelectionChangeon named-rootEditorRootviews - Skip live owner commit callbacks on frozen document views and avoid replaying prior commits when attaching callbacks after mount
- Deliver root-scoped
-
9e41cf5by @zbeyens – Deliver updated elements synchronously fromElementProvidertouseElementconsumers without a one-frame stale render, while preserving nested-provider isolation and commit-only store updates foruseElementSelector. -
ba572f2by @zbeyens – FixBaseFindPlugincross-root replacement targeting, composed same-transactionreplaceadvancement, rolled-back replace cleanup, identical-text no-op skipping, whole-word lookaround boundaries, and drifted store scalar self-healing. -
- Add
FindOptions(caseSensitive,wholeWord,regexp) toBaseFindPlugin'sapi.search(query, options?) - Add
update.replace(replacement)and single-undoupdate.replaceAll(replacement)onBaseFindPlugin, skipping locked, void, and non-content ranges - Replace
FindPluginState.matchesand directstore.set({ activeIndex })writes with read-only selectors (count,activeMatch),api.matches(options?),api.matchAt(point),api.setActiveIndex(index), and scalarversion
Migration: Read matches via
find.api.matches()(orfind.store.get('activeMatch')/find.store.get('count')) and change the active match withfind.api.setActiveIndex(index)orfind.api.move(delta). - Add
-
- Accept a single map or a non-empty tuple of
defineFormats(...)calls (PluginFormatMapInput) onformatsin plugin constructors and.extend(), evaluate callbackformatsin.extend(), and removeformats: nullfrom plugin types. - Support priority-ordered Markdown element encoders, mark decoders, and mark
wrapwriters (priority?: number) withundefineddecline fallthrough, operation-scoped leaf wrapping, and equal-priority conflict errors for duplicate element encoders and cross-owner overlapping mark writers. - Compose element
plainTextencoders with multi-property element-property wrappers soBaseListPluginpreserves list markers on headings, blockquotes, code blocks, and other configured targets. - Add
DocxNodeMappingInputtuples for multi-property plugins and reject duplicate DOCX declarations targeting the same element, mark, or(plugin, property). - Remove leaked internal format-mapping type exports
PluginProductNodeMappingRegistry,PluginSelfHtmlMappingMap, andPluginForeignHtmlMappingMap.
- Accept a single map or a non-empty tuple of
-
- Re-export the trimmed
platejs/historysurface (Batch,History,HistoryJSON,HistoryStateApi,HistoryTxApi) withtx.history.isolate(),history: 'isolate', andHistory.fromJSON(editor, json, { value }) - Keep consecutive field fills after a role switch grouped in one undo step, isolate find/replace, lint fixes, input-rule follow-ups, and upload insertions as standalone undo steps, and report caught error causes on comment replay failures
- Re-export the trimmed
-
- Prefix all Plate-serialized HTML data attributes with
data-editor-html-and report any unclaimeddata-editor-html-*attribute during HTML parsing. - Overload
HtmlDecodeContext.preserveto accept a descendantElementtarget (preserve(element, ...attributes)), scoping attribute claims to each claimed element instead of inheriting across descendants. - Add
unwraptoHtmlElementPropertyCreateRulesocreatesElementrules control which sibling properties survive unwrapping a non-text leading block. - Add HTML serialization and parsing rules for
BaseCalloutPlugin,BaseDatePlugin,BaseFilePlugin, andBaseTocPlugin. - Re-export
serializeHtml,HtmlSerializeOptions, andHtmlSerializeResultfromplatejs/html/server.
- Prefix all Plate-serialized HTML data attributes with
-
- Bound prepared
text/htmlclipboard payloads exceeding 5 MiB by raw transfer bytes indecodeHtmlDataTransferwhile keeping parser node and depth limits on the prepared HTML - Add
impact('lossless' | 'lossy') tohtml-parser-recovery,html-unsupported-metadata,html-unsupported-root,markdown-tag-repair,markdown-property-omitted,markdown-unsupported-metadata, andmarkdown-unsupported-rootdiagnostics - Include
model.propertyon HTML continuation property omissions and report that property name inimportDocxproperty-droppeddiagnostics
- Bound prepared
-
14fbdbfby @zbeyens – UnifyBaseIndentPluginupdate options and removeBaseTextIndentPlugin.- Flatten
IndentChangeOptionsonBaseIndentPlugin.update.increaseanddecrease, and add list-family-safesetandclearcommands. - Require positive safe integer
indentvalues (validationVersion: 2), clamp or unsetindentMaxsafely, compose callermatchwithtargetPlugins, and skip locked blocks in indent, line-height, and alignment updates. - Remove
BaseTextIndentPlugin,TextIndentPlugin,PLUGINS.textIndent,data-text-indent, and Word pastetextIndentemission, stripping legacyindent: 0and undeclaredtextIndentduring v54 migration.
- Flatten
-
- Extend
inputRuleVetoto a discriminated union ({ element: string } | { mark: string }), contribute{ mark: context.schema.key }fromBaseCodePlugin, and block typing/break input rules inside inline code while keeping URL pastes over selected inline code, bold/smart quotes around inline code, and unclosed-backtick suppression working across all mark rules. - Bind
InputRulesPluginimmediate Backspace revert to the exact committed transaction, view, and root, fixing named-root revert misses, cross-view Backspace corruption, and multi-editeditor.updatebatch corruption. - Accept NBSP (
\u00A0) alongside ASCII space on all space-triggered block shorthand rules (HeadingRules,BlockquoteRules,HorizontalRuleRules,CodeBlockRules, and list rules). - Fix
matchDelimitedInlineacross multi-leaf text spans andrequireClosingDelimiter: true, refuse spans crossing inline elements, voids, or vetoed marks, and decline inline$a$math inside links without throwing. - Remove
createBlockStartInputRule,BlockStartInputRuleConfig,getBlockTextBeforeSelection,InputRulesDefinition,ResolvedInputRule,ResolvedInputRulesMeta,TrailingBlockDefinition, andTrailingBlockPluginState.level; require aPluginReferencedescriptor forTrailingBlockPluginState.type(defaultBaseParagraphPlugin).
Migration:
- Update
inputRuleVeto.of(context.schema.type)toinputRuleVeto.of({ element: context.schema.type })(or{ mark: context.schema.key }for literal marks). - Replace
createBlockStartInputRule(...)withdefineInputRule(...)+matchBlockStart(...), andcontext.getBlockTextBeforeSelection()withcontext.getBlockStartText() ?? ''. - Replace
TrailingBlockPlugin.configure({ initialState: { type: 'paragraph' } })withTrailingBlockPlugin.configure({ initialState: { type: BaseParagraphPlugin } })(or omittypeto use the default).
- Extend
-
d6215c2by @zbeyens – Clean up Markdown mapping types, bare-URL and break-marker serialization, runtime bugs, and default italic delimiter- Remove unused and redundant Markdown mapping fields (
build,previousSibling,serializeUnknown,decodeNodes,isFlow,isPhrasing,preserveEmptyParagraphs,encodeBlocks,resourceLink),MarkdownPluginRegistry,MarkdownNodeKinds,MarkdownDefinition, andMarkdownEditor. Usedecode,encodeFlow,PluginFormatRegistry, andeditor.plugin(MarkdownPlugin).apiinstead. - Serialize bare URLs through the Markdown serializer so CommonMark-only editors emit
<url>autolinks instead of plain text and GFM table cells keep|URLs lossless via escaped-pipe resource links. - Fix carriage-return (

), split CRLF across link boundaries, double<br/>between table-cell media blocks, literalU+200B-only paragraphs, leading BOM diagnostic offsets, CR-only block tags,remarkStringifyOptionspreserving pluginjoin/unsafesettings,<figure>/<figcaption>owned attribute validation, and table-cell list depth validation. - Change default Markdown italic serialization delimiter from
_to*so CJK italic exports without HTML character references underremark-cjk-friendly; passremarkStringifyOptions: { emphasis: '_' }to keep underscores.
- Remove unused and redundant Markdown mapping fields (
-
f38fe35by @zbeyens – Replace statelesspartialandpreviousstreaming options oneditor.api.markdown.parse*with statefuleditor.api.markdown.stream({ mode, incompleteLinks, lossPolicy, limits }).editor.api.markdown.stream()owns single-pass bounded tail healing (emphasis, strikethrough, inline code, inline and block math, links, images, GFM tables, and half-typed registered tags), incremental segment reuse, fixed-width table row and open fence fast paths, revisionedMarkdownStreamDeltapatches, and strictfinish()parity withparseSlice/parseInline.Migration:
- Replace
parseSlice(accumulated, { lossPolicy: 'allow', partial: true, previous })withconst stream = editor.api.markdown.stream()followed bystream.append(chunk)(orstream.set(accumulated)) andstream.finish(). - Remove
partialfromparse,parseSlice, andparseInlineoption objects, and removepreviousfromparseSliceoption objects.
- Replace
-
- Remove
SchemaElementShapeFor,BaseElement,BaseNode,BaseText,BasePoint, andBaseRangere-exports; useSchemaElementFor,Element,Node,Text,Point, andRangeinstead. - Export
SchemaPropertySource,SchemaPropertyDescriptorMap,EditorRuntimeCarrier, andEditorRuntimeOwnerOf. - Add an optional second contributor type parameter to
EditorElementProps<TPlugin, TContributors>inplatejs/reactandplatejs/static.
- Remove
-
- Re-export
PersistedDocument,PersistedSelection, andeditor.read.persisted(options?)fromplatejs, moveSerializedEditorSelectiontoplatejs/history, replaceEditorValueInputwithInitialValue, and removereadEditorSelectionandPlateV54Migration. - Treat
sourceinmigrateDocumentas a raw-input fallback so persisted envelopes always migrate from their verified schema identity and mixed raw-and-envelope stores convert with one call shape. - Fold deterministic, list-ownership-gated
listIdassignment intomigrateV54and remove the standalonemigrateListIdentityexport fromplatejs/migrations.
- Re-export
-
29bcbd6by @zbeyens – Rename thedefinePluginSlotre-export todefinePluginCompartment.Migration: Replace
definePluginSlotimports fromplatejswithdefinePluginCompartment. -
bf9b87cby @zbeyens – RemoveuseContentRoot,ContentRootController, andUseContentRootOptionsfromplatejs/reactMigration: Use
slots.contentRoot,useChildRoot, anduseRootChromefor element-owned child roots. -
3c20b81by @zbeyens – Consolidate Plate React read hooks and selection reads:- Add
editor.read.selection.value()and removereadEditorSelection - Merge
useEditorPluginStoreintousePluginStore(editor, plugin, ...) - Remove
useElementPath,useEditorId,useEditorMounted,useEditorHasSelection,useEditorValue,useEditorSelection, andcreateZustandStorefromplatejs/react
Migration: Replace
readEditorSelection(editor)witheditor.read.selection.value(),useEditorPluginStore(editor, ...)withusePluginStore(editor, ...),useElementPath()withusePath(),useEditorId()withuseEditor().id,useEditorMounted()withuseEditorRootElement(useEditor()) !== null,useEditorHasSelection()withuseEditorSelector((editor) => editor.read.selection() !== null, { dependsOn: 'selection' }),useEditorSelection()withuseEditorSelector((editor) => editor.read.selection(), { dependsOn: ['selection', 'document'] }), anduseEditorValue()withuseEditorSelector((editor) => editor.read.children(), { dependsOn: 'document', equalityFn: Object.is }). - Add
-
3c2d532by @zbeyens – Removeplatejs/yjs(BaseYjsPlugin,YjsPlugin,KEYS.yjs) and its Yjs/Hocuspocus dependencies; migrate collaboration setups toplatejs/sync,platejs/sync/react,platejs/sync/server, andplatejs/sync/cloudflare -
- Remove the re-exported
SelectionValue,SpanApi,SpanInterface, andEditorSelectionTargetOptionsaliases fromplatejsto matchplitejs(useEditorSelectionandLocationApi.isSpan). - Guard
NodeSelectionpointer capture and post-dragfinishFramefocus restoration against synthetic/released pointers, disconnected editables, and focus drift.
- Remove the re-exported
-
21b6496by @zbeyens – Align Plate root exports anduseStateFieldValuewith single-store shared state fields,'configuration'commits, andStateFieldDescriptorcuts- Share default
useStateFieldValueequality for cloned non-JSON field values (Date,Map,Set,Uint8Array) while preserving customfield.compare - Re-export
LocalStateFieldDescriptorandSharedStateFieldDescriptor, removeinvertEffect,mapEffect,encodeEditorEffect, anddecodeEditorEffectfromplatejs, and retirefield.effectoncollab: 'shared'fields
Migration:
- Replace
commit.dirtyStateKeys.includes('$configuration')withcommit.changed.hasAny('configuration'), and add'configuration'todependsOnorcommit.changed.hasAny(...)checks that relied on'state'waking on plugin reconfiguration. - Replace
editor.read.meta()witheditor.read.value().metaoreditor.read.getField(field). - Update shared fields via
tx.setField(field, value)instead oftx.effects.emit(field.effect, ...), and serialize collaborative changes withcommit.changes.toJSON()instead ofencodeEditorEffect/decodeEditorEffect.
- Share default
-
5b6b606by @zbeyens – Isolate static rendering from editing-only plugin behavior and fix static equation round-tripping:- Add
decorate.static?: boolean(defaulttrue) on plugin definitions and setstatic: falseonBaseFindPlugin,BaseLintPlugin,YjsPlugin, andSyncReactPluginso editing overlays never render in<EditorStatic>orrenderStaticHtml. - Filter static decoration sources by plugin name when
renderStaticHtmlreceivespresentation. - Suppress
editOnlycomponents,render.attributes,inject.nodeProps,leafAttributes,textAttributes, and wrapper slots across all static renders, with or withoutpresentation. - Support unbound component-object
afterNodeChildrenslots (such asReact.memo) in<EditorStatic>. - Preserve
attributes.ref(composing withrefwhen both exist) and makepathoptional onEditorElementfromplatejs/static. - Keep surrounding spaces when
parseHtmlcollapses whitespace around static zero-width\uFEFFplaceholders insidedata-editor-stringelements.
- Add
-
ef419a0by @zbeyens – AddcreateSyncServerAgenttoplatejs/aiand re-exportSyncServerRunResultfromplatejs/sync/serverfor server-side document agents running directly over authoritative sync rooms under suggest-only grants, and scope proposed-block reads to dirty clusters for O(page) large-document reads. -
- Unify table column and row sizing onto flat logical
update.resize,api.createResize, andTableResizeHandle, and removeupdate.setColumnWidth,update.setRowHeight,TableColumnWidthOptions,TableRowHeightOptions,edge: 'left',TableDefinition,describeTableSuggestion, anddescribeTableSuggestionGroupfromplatejs/table. - Add
update.select,update.moveColumn, andread.canMoveColumnonBaseTablePluginfor programmatic canonical cell selection and atomic column reordering. - Remove
clampTableSelectionso programmatic selection and pointer drags keep exact cross-edge ranges, resolve explicit table targets directly inupdate.removefor nested tables, negate RTL column resize deltas inuseTableResize, localize RTL cell arrow navigation, collapse Safari IME composition without cancellingwhich === 229, and landShift+Tabat the end of the previous cell.
- Unify table column and row sizing onto flat logical
-
- Add headless table symmetry commands (
read.canMoveRow,read.header,update.moveRow,update.toggleHeader,update.clearCells,update.duplicateRow,update.duplicateColumn,update.distributeColumns), renameTableMoveColumnOptionstoTableAxisMoveOptions, export named table option types, preserve custom border color/style intoggleBorders, and inherit per-column header flags oninsertRow. - Seed column resize sessions from measured DOM widths on fluid (
defaultTableWidth: null) tables, copy adjacent widths when inserting columns on resized tables, and complete multi-cell keyboard handling (Escape,Enter,ArrowUp/ArrowDown, multi-cellTab, 3-stageCmd+A, and DOM-rect horizontal-X vertical exit). - Export UI-neutral
useTableControlsfromplatejs/table/reactfor table edge hit-testing, touch/keyboard resizing,NodeKey-anchored column drag, and single-transaction+extend bars.
- Add headless table symmetry commands (
-
- Preserve the calling view on
ctx.update.*plugin portals, reject root-transaction fallbacks when a plugin defines no update group, and reflectR | undefinedrefusal return types. - Exclude
txOnlymethods andtxOnlyupdate groups from pluginshortcutsat both compile time and runtime.
- Preserve the calling view on
-
- Add typed
editor.update.result(policy?, fn)overloads on Plate editors with full plugin transaction inference. - Export
isAuthoredRefusalfromplatejs/authored,isLockRefusalandLockRefusalfromplatejs/lock, andEditorJsonObjectfromplatejs.
- Add typed
-
164c49dby @zbeyens – KeyUploadRulesbyUploadKindwith standard HTMLacceptpatterns, replaceclient+getUrlwith a single SDK-neutraluploadhandler, add key-localupdate.retry(key)andapi.accept(kind), and fix post-completion caption undo and secondary-root pasted picture uploads.Migration:
- Key
rulesby'audio' | 'file' | 'image' | 'video'with optionalaccept?: readonly string[],maxBytes, andmaxFiles(removingUPLOAD_FILE_TYPES,UploadFileType,UploadRule.kind,UploadRule.minFiles,too-few-files, andallowedTypes). - Replace
clientandgetUrlwithupload: (file, { onProgress, signal }) => Promise<string>(removingUploadClient,missing-client,missing-url-resolver,resolver-error,UploadFailure.result, andfiles-sdkfromplatejsoptional peer dependencies).invalid-urlandcompletion-errornow carryurl, andmissing-uploadreplacesmissing-client.
- Key
-
1cf5f56by @zbeyens – RemoveDOMGeometryRectfromplatejs/domand exportViewportRectforeditor.api.dom.visibleRect.Migration: Replace
DOMGeometryRectimports fromplatejs/domwithViewportRect. -
- Add fingerprint-neutral
slice: { plainText?: boolean }on block text element schemas, flattening semantic pastes at the top ofplanPaste(droppingslice.roots) and skipping rich clipboard formats only whentext/plaindiffers fromtext/html. - Make external drops atomic on refused, no-op, and non-writable targets, and fix
eventCarriesBlockFragmentto unwrap shared open block ancestors before checking for block payloads. - Replace
BaseCodeBlockPlugin's three paste-flattening hooks withslice: { plainText: true }and guardInputRulesPlugininsertDatarules against exact Plite clipboard slices.
- Add fingerprint-neutral
plitejs
Minor Changes
-
6d42192by @zbeyens – Moveeditor.api.dom.resolveDropTargettoeditor.api.dom.drag.resolveTarget, add lossless anchor-preservingeditor.api.dom.clipboard.cut, foldDOMEditorClipboardCapabilityintoDOMClipboardApi, strip embeds from handle drag previews, populateDataTransferfor read-only drags, scalepaddingSideon zoomed roots, and guard drag scroll repaints by session and owner. -
- Add fingerprint-neutral
slice: { plainText?: boolean }on block text element schemas, flattening semantic pastes at the top ofplanPaste(droppingslice.roots) and skipping rich clipboard formats only whentext/plaindiffers fromtext/html. - Make external drops atomic on refused, no-op, and non-writable targets, and fix
eventCarriesBlockFragmentto unwrap shared open block ancestors before checking for block payloads. - Replace
BaseCodeBlockPlugin's three paste-flattening hooks withslice: { plainText: true }and guardInputRulesPlugininsertDatarules against exact Plite clipboard slices.
- Add fingerprint-neutral
-
ea41af5by @zbeyens – Add{ intent?: TransferIntent }toeditor.read.transfer.check, refuse non-writable text transfer sources and targets before commit, and verify owned content-root integrity on range transfers.
Patch Changes
-
4d4154cby @zbeyens – Replace<PagedEditorContent />, Pretext off-DOM layout engines (measurePages,createPretextPageLayoutEngine,createEstimatedPageLayoutEngine,usePageLayoutFragments), live 2-up spread mode, and the@chenglou/pretextpeer dependency with a zero-remount native-DOMPaginationSurfacewrapper,usePageLayout(editableRef), anduseTableRowPageBreak(element)over standard<EditorContent />. -
ef4c7e5by @zbeyens – CollapseRenderTextPropsback to a single host type by removingRenderTextHostProps,RenderTextPieceProps, andpiece, and delete legacy paged-projection, soft-line-end, view-line, and placed-drag internals fromplitejs/domandplitejs/react. -
- Fix Android
insertReplacementTextover non-DOM-sync text so it replaces the expanded target range instead of inserting at the collapsed caret. - Fix Korean and Android composition replacements with explicit toggled marks so mark-on and mark-off states apply to expanded syllable replacements in one undoable edit.
- Fix Android fallback selection reads inside Shadow DOM roots by reading the shadow-root selection before falling back to
window.getSelection(). - Fix Android cross-root
beforeinputrouting to redirect sibling-root selections to the target root editor and skip duplicate desktopinsertTextprobing when noonDOMBeforeInputhandler is attached. - Fix Android line rebuild resolution for nested blocks and inline elements so
rebuildLineremounts the lowest enclosing block(s).
- Fix Android
-
- Add
replaceoption totx.nodes.wrapto replace existing inline wrappers per block atomically without unwrapping refused blocks - Add
editor.read.schema.canWrapto check whether an element can wrap or land at a target location
- Add
-
2647b18by @zbeyens – Stop narrowingcreateEditoranduseCreateEditordocument types frominitialValue, removeEditorValueFromOptionsandPluginsFromOptionsfrom public root exports, and fixuseCreateEditorinherited option handlingMigration: Seeded editors without a schema plugin now infer broad
Value(assignable toEditor). Pass an explicit value type parameter (createEditor<MyValue>()orcreateEditor<MyValue, typeof plugins>({ plugins, initialValue })) or install a schema plugin when you need a narrower document type. -
cd3128cby @zbeyens – Avoid whole-block stringification on plain typing insubscribeTypedTextand reject non-collapsed selection replacements in Suggesting mode -
- Remove
editor.anchor.save,editor.anchor.restore, andEditorDocumentRange(persist plain ranges or feature-level anchors beside the document and recreate live runtime anchors on load) - Project
anchor.resolve()through its capture view by default soanchor.resolve()matchesanchor.resolve(captureView)in Authored previews - Unify v4 ID-addressed point mapping across live anchors, anchor history recovery, history selection restore, and sync presence (threading the confirmed outbox base through unsent presence batches)
- Fix
DecorationSourcerefresh lifecycle bugs: stop auto-retrying throwing observer pushes outside commits, preserve pending typing and outer observer keys across nested observer pushes, guard freshness resets by generation, and run initial full refresh whenobserve()only refreshes partially or throws synchronously
- Remove
-
273b78eby @zbeyens – PreserveauthorIdin<EditorRoot>andcreatePliteRootEditor, isolate<EditorStatic>foreign-document authored reads, moveprojectAuthoredRangetoplitejs/internal, and movecreateAuthoredPluginandAuthoredTestOptionstoplitejs/testing. -
8c37372by @zbeyens – Remove unusedinsertFragmentData,insertTextData,dom({ clipboard: false }),tx.dom.insertData,DOMClipboardInsertDataHandler,DataTransferFormatPhase, six internalplitejs/domclipboard helpers, and five deadplitejs/internalslice exports. -
12abcd6by @zbeyens – AddAuthoredChange.incarnations,authored.read.groupMembers(groupId), and optionalincarnationfiltering onauthored.read.outcome(id, incarnation?), plus internal element-ID minting admission and authored projection helpers used by Plate comments, migrations, and DOCX import. -
- Fix re-entrant commits delivering a later commit's snapshot to outer
subscribeCommitandafterCommitlisteners or rollingeditor.read.lastCommit()backward. - Fix named-root selections leaking onto main-root snapshots built by selection-only commits or cold snapshot reads.
- Type
BaseEditor.subscribeCommitwithEditorCommitListener<V>instead ofEditorCommitListener<any>.
- Fix re-entrant commits delivering a later commit's snapshot to outer
-
- Fix
projectAuthoredDocumentwithout{ editor }keeping split paragraphs and links apart in theacceptedprojection - Fix
proposeComparisonblocking when plugin corrections append blocks or when a comparison merges table cells
- Fix
-
- Move
readEditorSchemaContract,diffEditorSchemaContracts, and theEditorSchemaContract*types offplitejsonto the new public headless subpathplitejs/compiler. - Remove
restoreEditorSchemaContract,compileEditorSchemaContract, and unused compiler exports fromplitejsandplitejs/internal. - Slim serialized
EditorSchemaContractoutput toformatVersion: 2by dropping restoration-only derived tables while keeping aformatVersion: 1compatibility reader inreadEditorSchemaContract. - Fix
COMPILED_SCHEMA_CACHEsorecordSetscallbacks (namedBy.names,keep) are stripped on cache storage and rebound per editor, and includecontentRoots[slot].structurein the compiled schema fingerprint (storageRevision: 4) andEditorSchemaDeltawhile keepingstorageRevision: 3contracts readable.
- Move
-
- Fix cross-grid range deletion starting inside a read-only grid and ending inside a writable grid so writable grid cells are preserved cleanly.
-
d83d8a1by @zbeyens – Hardeneditor.api.dom.clipboard.cutagainst locked owned roots, active reads/updates, authored preview, and focus/selection-only commits duringawait, and report alossydiagnostic when all paste formats are refused. -
aee2a86by @zbeyens – Removetx.fragment.replaceandeditor.update.fragment.replacein favor ofslice.replace(ContentSlice.closed(...)), and exposesliceonEditorCorrectionTransaction. -
7c83372by @zbeyens – Remove 22 internal DOM marker, Android text-diff, hotkey compiler, and engine-detection helpers from publicplitejs/dom, and fixDOMEditor.hasEditableTargetfor interactive controls inside read-only and writable editors.Migration: Inspect
data-editor-*DOM attributes directly when checking rendered DOM elements (or useNodeApi,ElementApi, andTextApifromplitejswhen checking model nodes), useisHotkeyfromplitejs/dominstead ofcreateCompiledHotkeyMatcher, and checkevent.detail === 3instead ofTRIPLE_CLICK. -
d75f0fbby @zbeyens – RemoveDocumentChange.transform,DocumentChange.prototype.correct,DocumentChange.primaryClassification,DocumentChange.rootClassifications, and theisSetValuedoption fromDocumentChange.between. -
- Unify
editor.api.domon one nullable lookup contract by removingassertDOMNode,assertDOMPoint,assertDOMRange,assertDocumentOrShadowRoot,assertEventRange,assertNode,assertPath,assertPoint,assertRange,findKey,hasRange,isReadOnly, andresolvePath, and replacinggetWindow()withresolveWindow(): Window | null. - Remove
DOMResolutionError,Key,DOMCoverage,DOMCoverageSession,DOMCoverageBoundaryEdge,DOMCoveragePointResult,DOMCoverageMaterializeHandler,DOMCoverageMaterializeResult,isTrackedMutation, andgetEditorDOMRootfromplitejs/dom. - Isolate
editor.api.dom.resolveNode,resolvePoint, andresolveRangeper owning view and enforce painted-text freshness oneditor.api.dom.resolveRangeRect.
Migration: Replace
editor.api.dom.assert*with nullableeditor.api.dom.resolve*, replaceeditor.api.dom.getWindow()witheditor.api.dom.resolveWindow(), replaceeditor.api.dom.findKey(node)witheditor.key(node), replaceeditor.api.dom.resolvePath(node)witheditor.read.nodes.path(node), replaceeditor.api.dom.isReadOnly()witheditor.api.react.isReadOnly()(oreditor.read.view.isReadOnly()for document view policy without the<EditorContent readOnly />prop), and replace detachedDOMCoverage.createcalls withslots.contentBoundaryorslots.externalTextpassed to element renderers (RenderElementProps.slots). - Unify
-
164c49dby @zbeyens – AllowDOMDropTargetOptions['files']to accept a readonly array ofEditorElementblocks so file drops can validate multi-kind drafts at drop time. -
- Move slice deletion from
tx.fragment.delete,editor.update.fragment,editorCommands.deleteFragment,EditorFragmentDeletionOptions,EditorTransactionFragmentApi, andDeleteFragmentCommandontotx.slice.delete,editor.update.slice.delete,editorCommands.deleteSlice,EditorSliceDeletionOptions, andDeleteSliceCommand. - Support single-block
NodeSelectionintx.break.exitand refuse inserting default children into read-only containers or read-only-owned roots. - Enforce full-ancestor and owner-root read-only refusal across marks,
tx.blocks.*,NodeSelectiondeletion, and hanging slice replacements. - Unify whole-block landing between commands and raw
tx.text.insert,tx.slice.delete,tx.break.insert, andtx.break.insertSoft. - Guard unselectable block voids on boundary deletion, treat zero-distance collapsed deletes at non-editable nodes as no-ops, prevent extra empty lines on hanging container deletes, stop pulling forward collapsed delete carets into untouched empty non-void inlines, and preserve required prefix occupants on two-block
min: 2forced-layout joins when a default remainder can build.
- Move slice deletion from
-
e490ae5by @zbeyens – AddcontentMarks?: booleanonSchemaElementInput(defaulttrue) so text-admitting elements can rejectrole: 'content'text properties (formatting marks) while keepingrole: 'metadata'text properties (such asauthored) legal across schema compilation, contract/fingerprint serialization,addMark, mixed-rangetoggleMark,getProperty,tracksPlaces, andAuthoredPlugin. -
dca98acby @zbeyens – Enforce root-only transfer admission forslice: { endMatter: true }elements across block drops, side wraps, and text-range point drops, and let plugins adjust colliding end-matter slices during paste landing. -
11b3a12by @felixfeng33 – Allowslots.externalTexton non-void text-only blocks whose schema declaresmin: 1without requiringmax: 1, as long as the rendered element currently holds a single text leaf. Multi-leaf elements (such as code blocks holding pending suggestion marks) can now fall back to nativeslots.children()rendering and remountexternalTextonce back to one leaf. -
- Remove
ExternalTextDispatchResult; external-textdispatch,select,navigateOut, anddeleteOutnow returnvoidand synchronously reset the view (changes: null) when rejected or stale. - Reset active external-text compositions (
changes: null) when the editor or block becomes read-only, and reset on refuseddeleteOutwithout moving focus. - Add
ExternalTextOptions.fallbacksoslots.externalTextfalls back automatically to native children in Suggesting mode, when pending authored changes touch the block, or when the block holds multiple text leaves, while preserving read-only external views in authored previews and handing focus cleanly across mode swaps. - Add optional
ExternalTextView.scrollIntoViewand'scrollIntoView'onEditorLifecycleError, and routeDOMEditor.scrollIntoViewfor ranges, points, and paths targeting external-text views through internal reveal plus outerscrollMarginscrolling. - Replace whole-root external-text
querySelectorAllpreflight scans with O(1) per-runtime projection claims (supporting React StrictMode and<Activity>transitions), cache structural external-text bindings per snapshot while keeping dynamic non-writable checks live, and preserve adapter sync on re-entrant commits and batched split/unsplit transitions.
- Remove
-
ba572f2by @zbeyens – Fix Unicode case-folding in literal case-insensitiveNodeApi.findTextRanges, keep two-axis registeredscrollElementhorizontal scrolling active withscrollMargin, and avoid marking failed or deferred decoration refreshes as fresh. -
- Split inline text runs around inline void elements in
NodeApi.findTextRangesso matches cannot bridge inline voids - Fix case-insensitive literal match offsets in
NodeApi.findTextRangeswhen text contains characters whose lowercase form changes UTF-16 length (such as'İ')
- Split inline text runs around inline void elements in
-
8c3001bby @zbeyens – Fix structural comparison matching and inline diff generation for multi-edit paragraphs, short table cells, shifted void blocks, and inline link delete, merge, wrap, and unwrap edits. -
- Add
history: 'isolate',tx.history.isolate(), and canonical tag'history-isolate'for standalone undo steps that block both automatic and explicit merges, and keephistory: 'new-batch'/tx.history.newBatch()open for compatible follow-up edits withinnewBatchDelay - Add
History.fromJSON(editor, json, { value })to validate saved history against a replacement document for atomictx.value.replace+tx.history.restore, and report an explicit mismatch error when restored history does not match the committed document - Remove internal
unsettle,rest, andcarriedfields from publicBatch, cutCarriedRun,HistoryBatchJSON,HistoryControlTx, andSerializedEditorSelectionre-exports fromplitejs/history, and narrowHistoryJSON.undos/redostoreadonly unknown[] - Clear history on plugin-removal migrations even when schema identity does not change, isolate different property keys on single-node merges, and avoid cloning retained batches when trimming at
maxDepth
- Add
-
- Prevent focus settling and selection guards from reclaiming focus from external iframes
-
- Remove
SchemaElementShapeFor,BaseElement,BaseNode,BaseText,BasePoint, andBaseRange; useSchemaElementFor,Element,Node,Text,Point, andRangeinstead. - Add an optional second element-type parameter to
ElementOf<N, TType>and exportEditorRuntimeCarrierandEditorRuntimeOwnerOf<TEditor>sogetEditorRuntimeOwnerpreserves editor types while stripping view-onlyroot. - Enforce own-key document root lookups and reject
Object.prototyperoot names across document, selection, schema, anchor, history, content-slice, and Yjs boundaries. - Fix view scoping on
tx.break.exit,view.read.schema.{createDefaultChild,copy,canPlace}, andtx.schema.canWrap, prevent prepared-key residue from discarded specs and rolled-back updates, and deduplicate repeated node references in standalone document views.
- Remove
-
- Add
editor.read.persisted(options?)to read canonical{ document, schema, selection? }envelopes across named roots,NodeSelection, authored preview lenses, and captured-document views. - Rename
PersistedDocumentInputtoPersistedDocument, exportPersistedSelection, widenInitialValue<V>to acceptPersistedDocument<V>, widenCreateEditorOptions.initialSelectiontoPersistedSelection, and acceptPersistedDocumentincreateEditor({ initialValue }). - Remove
readEditorSelectionfromplitejs(useeditor.read.persisted({ selection: true })to persist selections) and moveSerializedEditorSelectiontoplitejs/history. - Unify envelope detection to require both
documentandschemawithoutchildren, rejectmeta.__proto__on persisted document ingress, normalize-0invalueCodecs.number, and remove unused persistence exports fromplitejs/internal.
- Add
-
9e41cf5by @zbeyens – Size the empty-block placeholder inside a dedicated[data-editor-placeholder-container]wrapper instead of writing an inlinemin-heightstyle onto the editable host element, so CSSmin-heightclasses work without!important. -
- Memoize named content-root reads during plain-text serialization and skip fallback root traversal when an encoder returns output, preventing exponential work and duplicate diagnostics on nested named roots.
-
- Reject unknown fields in
definePluginwith aTypeErrornaming the unknown key - Preserve validated compiled schema identity through plugin publication so live compartment swaps match validated schema state
- Reject unknown fields in
-
29bcbd6by @zbeyens – RenamedefinePluginSlotandPluginSlot*todefinePluginCompartmentandPluginCompartment*, removePluginSlotLike, enforce nominal compartment identity and sound replaceable capability typing, enforce the 3-lawmigrate/'history-skip'/ Suggesting-mode contract, and tighten view plugin write authority and lifecycle re-entry guards.Migration: Replace
definePluginSlotwithdefinePluginCompartment, replacePluginSlot/PluginSlotValuewithPluginCompartment/PluginCompartmentValue, removePluginSlotLike, and read replaceable compartment plugin APIs througheditor.plugin(MyPlugin)after checkinginstalled.// Before import { definePluginSlot } from 'plitejs'; const mode = definePluginSlot('mode'); const editor = createEditor({ plugins: [mode.of(MyPlugin)] as const }); editor.api.myPlugin.run(); // After import { definePluginCompartment } from 'plitejs'; const mode = definePluginCompartment('mode'); const editor = createEditor({ plugins: [mode.of(MyPlugin)] as const }); const portal = editor.plugin(MyPlugin); if (portal.installed) { portal.api.run(); }
-
- Add headless
writePolicy: 'propose-only'view confinement oncreateEditorView, keeping writes inproposemode out of human undo history and refusing direct mutations,setView,decide, and React mounting. - Propagate
setEditorReadOnly(editor, true)reactively to derived views andproposeComparison, and return{ status: 'blocked' }fromhistory.undo,history.redo, andhistory.recordon read-only orpropose-onlyviews. - Add
editor.update.result(policy?, fn)for structuredcommitted | unchanged | refusedoutcomes without triggering UI refusal listeners, and exportisAuthoredRefusalfromplitejs/authored. - Add reload-stable
editor.read.revision()andeditor.read.nodes.revision(id)(tx.nodes.revision(id)inside updates), and restrict named-rootnodes.byId(id)to the view's own root. - Support atomic same-update
tx.authored.withdraw()+tx.authored.propose()with full rollback on empty or refused replacements, block table withdrawals that cover foreign pending marks, and admit compound batches in native sync (SYNC_RULES = 9). - Add lifecycle-managed per-change
data?: EditorJsonObjectmetadata (authored-meta) ontx.authored.propose,proposeComparison, andAuthoredChange, bulkdecide({ action, all: true, authorId? }), narrowedAuthoredViewunion arms, stored-author ownership enforcement ontx.authored.propose({ changeId }), and uniformauthoredVetoenforcement on forced proposals.
- Add headless
-
e62fe85by @zbeyens – Reposition range geometry overlays and inactive selection carets when preceding sibling elements mount, unmount, or resize above an editable surface. -
bf9b87cby @zbeyens – Clean upplitejs/reacthook exports and drop caller generics fromuseElement- Rename
useElementPathtousePath(keeps returningnulloutside an element renderer) - Remove caller type parameter on
useElement(): Element - Remove
useOptionalElement,useContentRoot,ContentRootController, andUseContentRootOptions - Remove
setDOMTextSyncRendererCapability,setRetainedTextFlowRendererCapability, andDOMTextSyncRendererCapabilityContextfrom publicplitejs/react - Remove
anyfromuseEditorContextanduseOptionalEditorContextreturn types
Migration: Import
usePathinstead ofuseElementPath, remove<T>type arguments onuseElement(), and replaceuseContentRootwithslots.contentRoot,useChildRoot, anduseRootChrome. - Rename
-
18ff3adby @zbeyens – Fix derived view follow state and unmounteduseEditorRootElementscoping- Preserve live focus, composing, and DOM reach on same-root views derived from
useRootEditorwhile keeping sourcereadOnlylocks - Return
nullfromuseEditorRootElementfor unmounted non-following views instead of another view's DOM root
- Preserve live focus, composing, and DOM reach on same-root views derived from
-
3c20b81by @zbeyens – Addeditor.read.selection.value()for whole-document semantic selection reads (preserving named roots andNodeSelection), add optional(selector?, options?)touseElementPath, and removereadEditorSelection,useEditorSelection,useNodeSelector, anduseTextSelectorfrom publicplitejsandplitejs/reactexports.Migration: Replace
readEditorSelection(editor)witheditor.read.selection.value(). ReplaceuseEditorSelection()withuseEditorSelector((editor) => editor.read.selection(), { dependsOn: ['selection', 'document'] }). ReplaceuseNodeSelectoranduseTextSelectorwithuseEditorSelector(using{ nodeKey }independsOn) oruseElementPath. -
3c2d532by @zbeyens – Removeplitejs/yjsanddefineEffectshared-effect collaboration hooks (collab,collabReplay,collabSnapshot,collabTransport,getCollabEffects,getCollabEffectTypes), completing the hard cut to native v4 sync (plitejs/sync,plitejs/sync/server,plitejs/sync/cloudflare, andplitejs/sync/react) -
- Add
ScrollMarginandScrollIntoViewOptions.scrollMarginto clear overlays withscrollMode: 'if-needed'and merge with CSSscroll-marginviaMath.max - Deduplicate commit-triggered decoration reads for node keys an observer already refreshed at the same editor version, keeping first-frame paint fresh while eliminating duplicate reads
- Add
-
- Remove the duplicate
SelectionValuealias (useEditorSelection), the one-methodSpanApiandSpanInterfaceexports (useLocationApi.isSpan), andEditorSelectionTargetOptions; tightenLocationApi.isSpanto reject non-2-length path arrays. - Promote persistent
editor.anchorhandles created during a committingeditor.updateinto live commit tracking so they map across subsequent commits, while keepingtx.anchorand internal transform anchors transaction-scoped. - Split document-view snapshot anchors and shared endpoint mapping into dedicated core modules without altering live or history anchor behavior.
- Preserve named-root metadata when resolving DOM target ranges in
plitejs/reactand recognize expanded target-range boundary spellings (between blocks, next-block offset 0, and adjacent text leaves) without suppressing collapsed cross-block or cross-leaf caret moves.
- Remove the duplicate
-
- Preserve
editor.read.selection()object identity (deep-frozenRange) across repeated reads, unrelated document, metadata, and state-field commits, and named-root views so React selectors comparing unchanged selections hitObject.iswith zero deep walk.
- Preserve
-
8af14abby @zbeyens – Fix Shift+click selections across nested content roots losing their cross-root selection state when pointer release runs beforeselectionchange. -
21b6496by @zbeyens – Storecollab: 'shared'state fields solely inrecords['shared-state'], isolate non-JSON live state values, add'configuration'toEditorCommitChangeKind, tightenStateFieldDescriptor, and removeinvertEffect,mapEffect,encodeEditorEffect,decodeEditorEffect,state.meta(), and sharedfield.effect- Store
collab: 'shared'state fields only inrecords['shared-state'](migrating legacymetaentries on load) sotx.value.replace, late install, and multi-peer sync converge on one store - Isolate non-JSON live field values (
Date,Map,Set,Uint8Array, andSharedArrayBuffer-backed views) across editor creation, persisted reload, reads, anduseStateFieldValue - Add
'configuration'toEditorCommitChangeKindand remove the'$configuration'sentinel fromcommit.dirtyStateKeys - Split
StateFieldDescriptorintoLocalStateFieldDescriptor | SharedStateFieldDescriptor, model omittedinitialasTValue | undefined, and represent absent transition sides safely - Remove
invertEffect,mapEffect,encodeEditorEffect,decodeEditorEffect, andstate.meta()(editor.read.meta(),tx.meta()), and retirefield.effectoncollab: 'shared'fields (which now sync and undo exclusively throughset_registersteps)
Migration:
- Replace
commit.dirtyStateKeys.includes('$configuration')withcommit.changed.hasAny('configuration'), and add'configuration'todependsOnorcommit.changed.hasAny(...)checks that relied on'state'waking on plugin reconfiguration. - Replace
editor.read.meta()witheditor.read.value().metaoreditor.read.getField(field). - Add
persistand removereduceoncollab: 'shared'fields, update shared fields viatx.setField(field, value)instead oftx.effects.emit(field.effect, ...), handleundefined(or supplyinitial) on fields declared withoutinitial, and type runtime field parameters asEditorStateFieldrather thanStateFieldDescriptor. - Serialize collaborative changes with
commit.changes.toJSON()(set_registercarries shared state fields) and history withHistory.toJSON/History.fromJSONinstead of callingencodeEditorEffectordecodeEditorEffect.
- Store
-
ef419a0by @zbeyens – Addserver.runtocreateSyncServerfor serialized server-side read and write turns with per-actor element ID minting, incremental rollback, andwritePolicy: 'propose-only'confinement on suggest-only non-deciding grants. -
- Type
editor.plugin(P).update.*methods as returningR | undefinedon refusal, keepeditor.plugin(P).update(policy)non-callable, and preserve generic<TValue>inference oneditor.update.setField. - Remove unused one-shot helpers
editor.update.annotations,editor.update.effects.all,editor.update(policy).result(fn), and callableeditor.update(policy)(useeditor.update.result(fn)ortx.annotations/tx.effects.all()insideeditor.update((tx) => ...)). - Harden post-commit notification durability and fix view
lastCommit/maxLengthsharing, getter-defined plugin update methods,tx.blocks.setproperty validation, and unfillable block-replacement defaults.
- Type
-
1cf5f56by @zbeyens – RemoveDOMGeometryRectfromplitejs/domand return frozenViewportRectfromeditor.api.dom.visibleRect, widenuseEditableClipto accept any four-edge viewport rect (DOMRect,DOMRectReadOnly, orViewportRect), and avoid scheduling unused animation-frame flushes when onlyuseEditableClipis mounted.Migration: Replace
DOMGeometryRectimports fromplitejs/domwithViewportRect. -
- Add window-scroll virtualization fallback, ignore unbounded
overflow-y: autowrappers, retain active IME composing blocks during scroll, and mount all blocks in static flow on print inVirtualizedEditorContent
- Add window-scroll virtualization fallback, ignore unbounded
-
- Pass
slots.contentRootinRenderVoidPropsand addautoFocussupport to content-root slots so void elements mount schema-owned child roots throughslots.contentRoot(slot)instead of<EditorContent root> - Throw when
<EditorContent root>mounts a schema-owned child root inside its owning element renderer - Guard live DOM selection reads during active IME composition across
beforeinput, WebKit Shadow DOM probes, and hidden-end settles, and expire stale text-input repair echo records
- Pass
Full changelog: v54.0.0-beta.8...v54.0.0-beta.9