Skip to content

v54.0.0-beta.12 (2026-12-01)

Pre-release
Pre-release

Choose a tag to compare

@zbeyens zbeyens released this 01 Dec 12:38

@platejs/cli

Published @platejs/cli@54.0.0-beta.12.

@platejs/test

Patch Changes

  • e02d156 by @zbeyens – Remove @platejs/test/proof, @platejs/test/browser, openExampleWithOptions, defineBrowserFeatureContract, and createBrowserFeatureContractRegistry, and export PlaceholderShape from @platejs/test/playwright.

    Migration: Call openExample(page, name, options) from @platejs/test/playwright instead of openExampleWithOptions, and import test utilities from @platejs/test, @platejs/test/react, or @platejs/test/playwright.

platejs

Minor Changes

  • af255eb by @zbeyens – Enable remote sync server ink agents, richer platejs/ai ink/comment tools, SVG-first WebMCP outputs, and automatic ink restore on suggestion rejection:

    • Add ink?: boolean to SyncServerAgentOptions (createSyncServerAgent), exposing synchronous single-revision <prefix>_read_ink (with svg, clusters, suggestions, and blockRevisions) and <prefix>_set_ink_digitized under suggest and edit grants.
    • Widen <prefix>_read_ink with author, roundId, and includePrior filters, attach clusters, priorMarkIds, leaf-level suggestions, and pure-JS svg to EditorInkPassage, and return code: 'denied' when BaseInkPlugin is not installed.
    • Widen <prefix>_set_ink_digitized with roundId, changeIds, and threadIds stored in InkDigitizedMeta, and automatically restore digitized ink when a mounted ink agent observes all linked changeIds rejected and no linked threadIds remain.
    • Widen <prefix>_comment with kind?: 'answer' | 'note' | 'question' (explicit kind wins over question's 'answer' default) and surface CommentInvalidReason on invalid comment mutations.
    • Strip raw base64 PNG data URLs from WebMCP <prefix>_read_ink tool results in registerEditorTools.

Patch Changes

  • 842897a by @zbeyens –

    • Add BaseDetailsPlugin.update.toggle(), return boolean atomically from wrap and unwrap with schema and lock pre-checks, and defer reveal, insert, and wrap view-store opens until transaction end without leaking guards or mutating during editor.can dry runs.
    • Forward callout.variant through DOCX export and add DocxCalloutVariantStyle (DocxExportStyles['callout']['variants']) for neutral caller-supplied callout variant shading and left accent borders.
  • 2e533f7 by @zbeyens –

    • Validate lossPolicy and parse limits upfront before plugin compilation, browser DOM lookup, projection, or document assertion across HTML and Markdown serializers, parsers, and parsePlaceholders
    • Accept EditorView instances in exportDocx alongside root Editor instances
    • Project editor state during editor.api.markdown.serialize() so serializer callbacks observe the requested document and authored projection
    • Enforce maxBytes on untrimmed input in editor.api.markdown.parseInline() and inline editor.api.markdown.stream(), and validate both preview and final inline output against the editor schema (markdown-schema-invalid)
    • Avoid false named-root omission warnings when exportDocx reuses an exact retained DOCX source
    • Unwrap malformed navigation URLs and trim link URLs before custom link decoders run during importDocx
    • Compare Markdown default property values structurally in property-omission diagnostics
  • 31ff880 by @zbeyens – Remove platejs/excalidraw and platejs/excalidraw/react in favor of platejs/board, and convert legacy v53 excalidraw drawings in migrateV54

    • Remove the platejs/excalidraw and platejs/excalidraw/react entrypoints, the @excalidraw/excalidraw optional peer dependency, and PLUGINS.excalidraw (replaced by PLUGINS.board).
    • Convert legacy v53 excalidraw elements on a best-effort basis to board blocks with an exclusive shapes content root inside migrateV54 whenever the target schema installs BaseBoardPlugin and does not declare a custom excalidraw element (rotation angles, unsupported element types such as embeds/iframes, and schema-rejected image URLs such as SVG data URLs are dropped).

    Migration: Replace platejs/excalidraw and platejs/excalidraw/react with platejs/board and platejs/board/react, and run migrateDocument with migrateV54 on stored v53 documents. Apps that keep Excalidraw's file format can define a custom excalidraw void element plugin, which migrateV54 leaves untouched.

  • fafcb2b by @zbeyens –

    • Remove the optional jszip peer dependency from platejs/docx/import so import-only apps load without installing jszip
    • Validate lossPolicy and limits objects consistently across HTML, Markdown, and DOCX import and serialization APIs
    • Order failed Markdown stream snapshots with errors before warnings, report canonical schema property keys on invalid aliased Markdown attributes, route DOCX footnote definition diagnostics through lossPolicy and property-dropped aggregation, and fix Word HTML paste fontStyle, shaded-cell span wrapping, and RTF hex decoding
  • 2de5d39 by @zbeyens –

    • Fix plain-text paste dropping leading and trailing spaces when MarkdownPlugin is installed, preserving active marks and inline containment for single-line plain text and keeping edge spaces on Markdown-parsed paragraphs.
  • 2d67216 by @zbeyens –

    • Remove CreateCommentThreadInput.withHistory, resolveCommentChangeTarget, ResolvedCommentChangeTarget, and BaseCommentsPlugin.api.encodeAnchor from platejs/comments.
    • Replace BaseCommentsPlugin.api.encodeAnchor(range) with stateless encodeCommentAnchor(editor, range) from platejs/comments, returning null when destroyed, cross-root, invalid, or empty.
    • Resolve { type: 'change' } targets directly in api.attachment(id) with status ('pending' | 'accepted' | 'rejected' | 'contested' | 'deleted' | 'unavailable'), activeChangeId, groupId, ranges, and locations (clearing stored coordinates under authored preview).
    • Enforce document and propose-only view write and composer confinement on comment mutations, applyRemote, and discardOrphan.
    • Fix collapsed live anchor preservation with Tier-1/2 remote recovery, Redo local-undo tombstone and anchor persistence, settledMutationIds version upgrades, collaboration snapshot block-deletion handling, and activeStores presentation cleanup.
    • Eliminate per-thread metadata serialization and cloning in useCommentThreadIndex.
    • Fix DOCX comment import empty-root author and date promotion without phantom users and guard getStoredDocxCommentEditor on document views.
  • 27232f2 by @felixfeng33 –

    • Fix typing over a DOM selection spanning multiple table cells throwing RangeError in Editing and Suggesting modes, and prevent multi-cell text inserts from clearing read-only cells or clobbering unrelated explicit targets.
  • a4811c9 by @zbeyens –

    • Resolve Shadow DOM targets via event.composedPath() in NodeSelection keydown and pointer-end listeners so arrow navigation and lostpointercapture work inside a ShadowRoot.
    • Route NodeSelection arrow selection updates through setShownSelectionAsView so authored preview views lift projected paths to stored targets.
  • b7b5f91 by @zbeyens –

    • Fix table Backspace after a table with a node-selected empty paragraph and route table NodeSelection reads directly through state.selection.value()
    • Fix Shadow DOM and nested-editor pointer and right-click containment in NodeSelection
    • Remove internal EditorTargetRuntime and TargetFreshnessRequest re-exports from root barrels
  • caeaa41 by @zbeyens –

    • Re-export SyncConnectedPeer from platejs/sync/server and SyncTokenResult from platejs/sync.
  • 9c0cbe6 by @zbeyens – Harden platejs/ai and platejs/ai/react agent tools, pagination, and lifecycle

    • Remove createAIDraftSession and its draft-session types from platejs/ai and re-export AIPlugin's draft types (AIDraftActionResult, AIDraftCommentMatch, AIDraftMode, AIDraftSnapshot, AIDraftTableCellRecord, AIPluginStatus) from platejs/ai/react.
    • Return nextCursor: string | null from editor_list_suggestions and editor_list_comments, return the created message ID as commentId in editor_comment, and map block-locked / node-write-veto update refusals to 'locked' in editor_suggest_edit and editor_set_ink_digitized.
    • Reject invalid or mismatched editorId inputs on unnamed agents before calling allow in registerEditorTools and createEditorAgent.
    • Revive useEditorAgent in layout effect on React StrictMode remounts and apply runtime debounceDelay changes in CopilotPlugin.
  • 46d35cc by @felixfeng33 – Promote AI agents to first-class collaborative authors in platejs/ai and platejs/ai/react: unify editor_suggest_edit into editor_edit with decoupled access: 'suggest' | 'edit', enforce an unconditional 'suggest' ceiling across WebMCP contexts, publish anchor-mapped live agent presence (presence, setPresence, subscribePresence, useEditorAgentPresence, useEditorAgentCaretGeometry), and wire createSyncServerAgent to server.setPresence leases.

  • 16c6afc by @zbeyens – Re-export AuthoredGroupQuery and expose place-scoped decide({ action, at, authorId? }), optional read.groups(query?), and read.changes({ kind }) on platejs/authored.

  • bc54649 by @zbeyens – Re-export SyncRoomEvent, SyncBroadcastMatch, SYNC_MAX_EVENT_BYTES, SyncPresenceMeta, and SYNC_MAX_PRESENCE_META_BYTES from platejs/sync and platejs/sync/server. Upgrade createAIDraftSession to per-block revision anchoring, atomic single-commit withdraw + propose replacement, and direct refusal handling.

  • 5a19ae4 by @zbeyens –

    • Remove clearSyncCache, SyncPersistenceMode, SyncPluginOptions.persistence, and SyncStatus.saveFailed from platejs/sync, rename SyncApi.resetOutbox() to recover(), and remove remoteCursorDecoration from platejs/sync/react
    • Add view-bound useSyncApi() and AnyEditor | null safety across platejs/sync/react hooks, expose SyncStatus.decide, re-export SyncPresenceMeta and SYNC_MAX_PRESENCE_META_BYTES from platejs/sync/server, and support synced-room conditional-head applyDiff() via platejs/diff
  • 675f4a0 by @zbeyens –

    • Add reason: CommentInvalidReason to { status: 'invalid' } results returned by BaseCommentsPlugin mutations, and return { status: 'stale' } for calls against a destroyed editor.
    • Move resolveCommentChangeTarget, CommentChangeTargetStatus, and ResolvedCommentChangeTarget from platejs/comments/react to platejs/comments.
    • Add fromDocxComments to platejs/docx/import and toDocxComments to platejs/docx/export to map Word comments to and from BaseCommentsPlugin with exact source reuse, reopened-comment export, and pending suggestion-comment export.
  • bf86051 by @zbeyens –

    • Hydrate unresolved comment anchors via quote verification and re-verify touched live comment anchors on 'collaboration-snapshot' sync commits in BaseCommentsPlugin.
  • 122ae04 by @felixfeng33 – Re-export three-way merge() and MergeConflict / MergeResolution / MergeResult types from platejs/diff.

  • 76ae983 by @felixfeng33 – Re-export prepareDiff, applyDiff, and compare({ identity: 'authoritative' }) from platejs/diff for checked selective direct application without suggestions.

  • b2a6d3f by @felixfeng33 – Add presentation, fragment, and inertRemoteMedia props to EditorStatic and EditorPreview in platejs/static, allowing live editors to render static previews and block fragments without schema drift while keeping remote media inert, and reject those reserved keys on renderStaticHtml props.

  • 2de2c33 by @zbeyens –

    • Fix normalize.removeEmpty deleting elements that contain inline voids, atoms, objects, or content roots, and skip removal on locked or read-only nodes
    • Delegate insertBreak on locked or read-only blocks from OverridePlugin so BaseLockPlugin can insert an escape paragraph cleanly
    • Fix AffinityPlugin trapping arrow-key movement at block boundaries on single-mark hard-affinity text and leaking metadata text properties such as authored into pending marks
    • Prevent plugin keyboard shortcuts and editOnly DOM handlers from running or throwing in AuthoredPlugin preview views
    • Pass a root-scoped editor to BlockPlaceholderPlugin query callbacks inside named content roots
  • e02d156 by @zbeyens – Export BrowserHandleRead from platejs/testing for typed read access to the browser handle attached under BROWSER_HANDLE_KEY.

  • a266833 by @zbeyens –

    • Add ink-rounds (submitRound, read.round, read.rounds) with ownerField: 'author' on ink-marks and ink-rounds plus client read.canRemoveMark filtering
    • Widen setDigitized to store structured InkDigitizedMeta (read.digitized) and enrich InkPassage with spatial clusters and { author, kind, roundId?, shape } on InkPassageMark
    • Export pure-JS zero-DOM renderInkPassageSvg from platejs/ink
  • c00a868 by @zbeyens –

    • Preserve bare URL serialization and incremental Markdown streaming fast paths in minified production bundles.
    • Parse GitHub-style same-line <details><summary>...</summary> openers with their body and closing tag cleanly, and report loss instead of silently dropping void/media blocks inside <summary>.
    • Round-trip GFM table column alignment (:---, :---:, ---:) via textAlign when BaseTextAlignPlugin is installed, and report markdown-property-omitted when the schema cannot store it.
    • Strip leading BOM and align diagnostic source offsets in editor.api.markdown.parseInline and inline streams, and preserve leading/trailing spaces on plain-text paste surrounded by blank lines.
  • d4437a6 by @zbeyens –

    • Simplify MarkdownStream: remove MarkdownStreamDelta, revision, baseRevision, stableCount, done, optional slice?, and stream.snapshot; narrow MarkdownStreamSnapshot to a discriminated union (ok: true with frozen nodes and warning diagnostics, ok: false with error-first diagnostics and no nodes); return MarkdownSliceParseResult directly from stream.finish().
      • Migration: check snapshot.ok before reading snapshot.nodes, read final.slice.content from stream.finish() when final.ok, and reconcile live previews from frozen === object identity on committed blocks and table rows instead of snapshot.delta or snapshot.revision.
    • Fix MarkdownStream inline-mode BOM/whitespace handling and surface stream.finish() parse errors in createAIDraftSession.
  • 7a2234c by @zbeyens –

    • Refuse combining legacy suggestion_* marks with native node .authored marks or authored-* document record sets in migrateV54 instead of silently overwriting native marks.
    • Preserve fill.* element IDs when migrateDocument validates an already-current envelope with no migration steps or comment anchor/range mappings, restoring strict idempotency for plate migrate run --check.
  • 04d0e75 by @zbeyens –

    • Export Editor as an interface on platejs and platejs/react and inline internal return aliases on toReactPlugin and .extend() so consumer .d.ts files emit without TS2883 errors
    • Preserve base plugin dependencies in toReactPlugin (replacing same-family entries with React descriptors and appending new dependencies), freeze returned descriptors, and throw when passing adapter options to a configured base plugin
    • Keep TransferPlugin required in React createEditor (only HistoryPlugin and AffinityPlugin are optional on React)
    • Remove applyDeepToNodes, ApplyDeepToNodesOptions, defaultsDeepToNodes, mergeDeepToNodes, and PluginName from platejs
  • 1afc3a5 by @felixfeng33 – Pin the current user's own suggestions to palette slot 0 and map other authors to slots 1 through 6 via suggestionColorOf(authorId, { userId })

  • 8639d6e by @zbeyens – Remove duplicate editor.plugin(UploadPlugin).api.accept(kind) in favor of editor.plugin(UploadPlugin).store.get('accept', kind) (and usePluginStore(UploadPlugin, 'accept', kind) in React). Reject pending-deleted drafts in admit().fill() and submit({ slot }), and fix the .odt fallback MIME mapping to application/vnd.oasis.opendocument.text.

  • e7096b5 by @zbeyens – Report lossy diagnostics through onPasteResult when HTML, Markdown, or exact table pastes crop onto a smaller multi-cell selection, and trim ragged pasted tables to the selection bounds before padding.

plitejs

Patch Changes

  • 87fa537 by @zbeyens – Keep authored completion spares across partial decisions in containers whose minimum child count exceeds their default slot count

  • e7096b5 by @zbeyens – Flatten rich slices on copy-drags into slice.plainText blocks consistently with paste, and block native read-only cut defaults even when clipboardData is absent.

  • 0ea198c by @zbeyens –

    • Keep pointer caret placement on the clicked text when a sibling inline span on the same line is taller (such as a comment-decorated link, superscript, or subscript)
  • 9ae8d9a by @felixfeng33 – Fix editor.api.dom.scrollIntoView to reveal targets in outer scrollable ancestors and the window when a registered scroll container sits outside the viewport, while keeping smooth-scroll displacement clamped to each container's bounds.

  • a4811c9 by @zbeyens –

    • Keep scoped-view tx.selection.setNodes calls in the active view root even after an earlier transaction step moved selection to another root.
    • Require matching endpoint roots across stateless range, selection, anchor, and unhangRange boundaries so mixed-root ranges fail loudly instead of mutating the wrong root.
    • Normalize endpoint roots in setSelection and whole-block landings, preserve Span inputs in stripLocationRoots, and compare aliased roots against live target roots during block drops from proposed previews.
  • b7b5f91 by @zbeyens –

    • Validate, copy, and freeze SelectionApi.text output symmetrically with SelectionApi.nodes
    • Tighten LocationApi.{isPath,isPoint,isRange}, PathApi.isPath, PointApi.isPoint, and RangeApi.isRange to reject sparse arrays, malformed indices/offsets, Span passed as Path, and cross-root ranges
    • Exclude NodeSelection from useElementSelected({ mode: 'collapsed' })
    • Prevent NodeSelection replacement, deletion, and cut from removing or shifting grid cells out of rows
    • Fix Shadow DOM probe latch recovery, refused parked-export recording, named-root anchor/unhang handling, and move internal EditorTargetRuntime/TargetFreshnessRequest types from the root barrel to plitejs/internal
  • caeaa41 by @zbeyens –

    • Add SyncServer.listPeers(room) and optional/predicate SyncServer.disconnect(room, match?) so hosts can enumerate connected peers and refresh or revoke all grants across Cloudflare Durable Object hibernation.
    • Support { stop: 'auth' | 'room' } (SyncTokenResult) from webSocketTransport token() callbacks to halt reconnects with terminal stoppedReason instead of retrying permanent access loss.
    • Coalesce contiguous offline edits into one SyncKeptItem card on read-only downgrade, outbox reset, or snapshot catch-up instead of creating one kept item per keystroke.
  • 46d35cc by @felixfeng33 – Add non-socket versioned server presence leases (server.setPresence), per-actor SyncGrant.delegatedActors access policies (SyncDelegatedActor), Cloudflare Durable Object sync_presence_leases persistence, non-AuthoredPlugin delegated plain-edit routing, and exact epoch / version metadata on read-only server.run results.

  • 16c6afc by @zbeyens – Add { action, at, authorId? } range/node decisions to AuthoredDecision, optional { at?, authorId? } filtering to read.authored.groups(), and kind filtering to read.authored.changes().

  • 7444992 by @zbeyens –

    • Fix wire-deserialized v4 DocumentChange.fromJSON compound withdraw + propose sync admission when withdrawing a structural wrap (at head and across remote gaps)
    • Mint causal authored-events for explicit tx.authored.propose(...) and api.authored.proposeComparison(...) calls
    • Refuse duplicate tx.authored.propose(...) calls in the same update and cap authored-meta data at 16 KiB UTF-8 with no own __proto__ keys
    • Reuse unchanged named roots and keep live-preview nodes.byId / nodes.byUnique directory updates O(changed named roots)
    • Forward post-mount view.api.authored.setView(...) updates into uncontrolled <EditorRoot editor={view}>
  • bc54649 by @zbeyens – Add one-way server room broadcast events (server.broadcast, sync.subscribeEvent, SYNC_MAX_EVENT_BYTES) and the 'collaboration-snapshot' canonical update tag on true sync snapshot installs. Add bounded p: presence metadata (sync.setPresenceMeta, SyncRemoteCursor.meta, SYNC_MAX_PRESENCE_META_BYTES = 256) with bidirectional projectRead masking and view-keyed indexed cursor decorations. Bump SYNC_RULES to 11 with compound withdraw + propose gap admission across client and server, own-actor delegated withdrawal verdicts, narrowed element format-mark staleness checks, container-aware take-back checks, and suggest-grant admission for property mutations on an author's own innermost pending insertions (including upload completion).

  • 5a19ae4 by @zbeyens –

    • Switch plitejs/sync to online-first in-memory reconnect buffering with a browser beforeunload warning when unsent > 0; remove clearSyncCache, SyncPersistenceMode, SyncPluginOptions.persistence, and SyncStatus.saveFailed, and rename SyncApi.resetOutbox() to recover()
    • Enforce SyncGrant continuously across read-only state (core/view-state), AuthoredPlugin Suggesting clamping, SyncStatus.decide, live delegatedActors revocation, and fail-closed server.broadcast() under projectRead
    • Add conditional-head CAS to synced applyDiff() (prepareDiff({ editor }) / merge({ editor })) and server.run() / server.update() ({ ifHead }), add 'suggest' recovery to SyncApi.decide(), add view-bound useSyncApi() to plitejs/sync/react, widen loopbackTransport token to SyncTokenResult, and re-export presence metadata types from plitejs/sync/server
    • Fix nested human/delegated suggestions mixing actors in commitAuthoredActors, in-flight batch stalling after edit -> read -> edit grant transitions, and stale kept cards remaining after retried entries settle
  • 04d0e75 by @zbeyens – Export SchemaPlugin from plitejs, return it from defineEditorSchema, and default EditorCommand to the core editor without referencing internal types in generated consumer .d.ts files.

  • 122ae04 by @felixfeng33 – Add pure stateless three-way merge() and MergeConflict / MergeResolution / MergeResult types to plitejs/diff.

  • 76ae983 by @felixfeng33 – Add prepareDiff, applyDiff, and compare({ identity: 'authoritative' }) to plitejs/diff for checked selective direct application without suggestions.

  • 5f2895d by @zbeyens – Preserve matched element IDs, native V4 move_node steps, and live anchor mapping across ID-stripped and cross-editor (shifted, differing, asymmetric, or partial element ID) document comparisons, authored imports, and undo; fix shifted mark-boundary tracking in containers and inline-bearing blocks; bound matcher split/join and word-move work on large edits; and improve structural matching for moved items, renumbered lists, short paragraphs, cross-moved sections, and moved table columns.

  • bd9256f by @zbeyens – Fix shared content-root loss checks on block copies, enforce non-writable block and file transfer guards uniformly, fix RTL horizontal drop edge and indicator geometry, and guard inline-void drag starts without adjacent text siblings.

  • e02d156 by @zbeyens – Export BrowserHandleRead from plitejs/testing for typed read access to the browser handle attached under BROWSER_HANDLE_KEY.

  • 2de2c33 by @zbeyens – Allow built-in keyboard actions to run when an onKeyDown handler calls event.stopPropagation() without event.preventDefault() or returning true

  • 64bdbc2 by @zbeyens –

    • Fix leaked keyboard and pointer listeners and stale press state on unmount or root swap during Shift selection extension and read-only presses
    • Fix Shadow DOM selection lookup and getComposedRanges unwrapping in editor.api.dom.resolveVisualPoint and multi-editor Shadow DOM selectionchange routing
    • Ignore cross-realm form input selectionchange events inside mounted editors
  • a705114 by @felixfeng33 – Route DOMEditor.textToCaret, DOMEditor.resolveRange, isSelectableDOMSelection, and react/editable/ selection readers through Shadow DOM getComposedRanges, fix Android zero-width span cleanup (textContent), clear activeSelectionExport and advance syncSelectionRepairId on root swap/unmount, and collapse duplicate keydown classification into single-pass resolveEditableKeyDownClassification.

  • 7a2234c by @zbeyens –

    • Reject malformed records['shared-state'] entries (missing/extra keys, empty writeId, or non-JSON encoded) fail-closed across createEditor, schema.assertDocument, schema.fitDocument, and tx.value.replace.
    • Remove legacy pre-release v1-v4 node selection decoders from history selection decoding and zero-pad fingerprintEditorJson output halves to fixed width.
  • 26c9b72 by @zbeyens –

    • Add SchemaRecordSet.ownerField to enforce per-author record ownership under access: 'suggest' grants
    • Protect namedBy record sets under access: 'suggest' (put-if-absent and drop only when unreferenced) and refuse set_register writes to owned or namedBy sets
    • Allow propose-only views to write suggestWritable record sets
  • 914d9ae by @zbeyens –

    • Fix v4 replay container validation to check the post-rebase document instead of the pre-rebase base, and reject set_props steps that mutate reserved element id properties during v4 step validation
    • Enforce consistent created element ID collision checks across scoped and computeAfter: false v4 rebases, and replace ID-changed elements with balanced element replacements under preserveElementIds

Full changelog: v54.0.0-beta.11...v54.0.0-beta.12