Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 234 additions & 7 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,239 @@
"www": "0.0.1"
},
"changesets": [
"auto-main-to-next-sync-platejs-ai",
"auto-main-to-next-sync-platejs-core",
"auto-main-to-next-sync-platejs-markdown",
"auto-main-to-next-sync-platejs-utils",
"auto-main-to-next-sync-platejs",
"prepare-v54-beta-core",
"prepare-v54-beta-plite"
"add-cli-deps-command",
"ai-comment-target-ranges",
"ai-semantic-list-streaming",
"ai-typed-property-mutations",
"ai-v54-runtime",
"application-root-policy",
"basic-nodes-plugin-kits",
"basic-styles-v54-runtime",
"bounded-external-code-blocks",
"browser-raw-mobile-receipts",
"callout-v54-runtime",
"calm-cells-contract",
"calm-equations-focus",
"calm-pandas-select",
"calm-tables-move",
"clean-basic-nodes",
"clean-shortcut-selection",
"cli-application-root",
"cli-schema-artifact-consumer",
"clickable-trailing-soft-breaks",
"code-block-commands",
"code-drawing-block-insert",
"combobox-active-view",
"combobox-command-runtime",
"comment-v54-runtime",
"consolidate-platejs-package",
"core-editor-store-boundary",
"core-navigation-flash-scroll",
"core-next-sync-runtime",
"core-plugin-override-contract",
"crisp-basic-styles",
"csv-v54-runtime",
"cursor-dom-editor",
"date-v54-runtime",
"depset-safe-execution",
"diff-replacement-markers",
"dnd-caller-owned-refs",
"dnd-cross-editor-copy",
"dnd-cross-editor-drop",
"document-first-authored-projections",
"document-first-export-contracts",
"docx-package-topology",
"docx-retained-source",
"docx-semantic-lists",
"durable-comment-anchor-history",
"eager-callout-codec",
"editor-selection-presence",
"emoji-v54-runtime",
"excalidraw-v54-runtime",
"external-text-drop-focus",
"fair-code-block-codec",
"files-sdk-uploads",
"find-replace-v54-runtime",
"fix-ai-blockquote-streaming",
"fix-ai-streamed-edits",
"fix-date-arrow-navigation",
"fix-explicit-blur-focus",
"fix-inline-atom-deletion",
"fix-inline-combobox-line-position",
"fix-test-utils-fixtures",
"floating-v54-runtime",
"footnote-v54-runtime",
"fuzzy-tables-wait",
"generated-editor-contracts",
"gentle-date-codec",
"green-mentions-drag-platejs-mention",
"green-mentions-drag-plitejs",
"green-mentions-drag",
"group-contiguous-authored-deletions",
"happy-footnote-codec",
"indent-v54-runtime",
"infer-plite-hyperscript-tags",
"keen-layout-codec",
"keyed-mounted-navigation-feedback",
"layout-v54-runtime",
"link-v54-runtime",
"list-scoped-api",
"live-element-path-contract-plitejs",
"live-element-path-contract",
"lively-link-codec",
"logical-browser-block-text",
"markdown-next-sync-runtime",
"markdown-plite-runtime",
"markdown-schema-owned-block-ids",
"math-transaction-transforms",
"media-caption-clean-break",
"media-html-mapping",
"media-v54-runtime",
"mention-v54-runtime",
"merry-indent-list",
"moved-code-syntax",
"nested-cursor-focus",
"open-markdown-fragments",
"persistence-detached-conversion",
"persistent-nearest-anchor-history",
"plate-compiler-artifacts",
"plate-document-conversion-contracts",
"plate-external-code-blocks",
"plate-graphviz-browser-import",
"plate-html-dom-helpers",
"plate-html-parse-loss",
"plate-plugin-render-contract",
"plate-retained-renderer-context",
"plate-schema-contract",
"plate-testing-facade",
"plate-transient-editor-ui",
"plate-ui-feature-owners",
"platejs-ai-stream-lifecycle",
"platejs-docx-loss-policy",
"platejs-foundation",
"platejs-html-property-accounting",
"platejs-paste-result",
"platejs-product-codecs",
"platejs-static-block-reuse",
"platejs-static-document",
"platejs-url-policy",
"plite-affected-work",
"plite-autofocus-caret",
"plite-block-void-spacing",
"plite-canonical-architecture",
"plite-canonical-validation-selector-routing",
"plite-document-conversion-contracts",
"plite-dom-host-codecs",
"plite-dom-node-error-capture",
"plite-dom-visual-point",
"plite-history-idle-boundary",
"plite-history-persistence",
"plite-idempotent-dom-path-sync",
"plite-ime-caret",
"plite-inactive-selection",
"plite-layout-runtime",
"plite-mounted-dom-owner",
"plite-navigation-scroll",
"plite-post-commit-observers",
"plite-react-cross-editor-drag",
"plite-react-ime-marks",
"plite-react-provider-lifetime",
"plite-react-read-only-provider",
"plite-react-refocus-lifecycle",
"plite-retained-editing",
"plite-text-flow-view-bindings",
"plite-yjs-attribute-keys",
"plite-yjs-substrate",
"plitejs-document-view",
"plitejs-paste-result",
"plitejs-per-transaction-cost",
"plugin-content-attributes",
"plugin-portal-scoped-api",
"preserve-imperative-empty-text-flow",
"prevent-text-cursor-block-drag",
"quick-media-codecs",
"quiet-drag-scroll",
"quiet-tables-tab",
"react-19-compiler-runtime-platejs-basic-nodes",
"react-19-compiler-runtime-platejs-basic-styles",
"react-19-compiler-runtime-platejs-callout",
"react-19-compiler-runtime-platejs-code-block",
"react-19-compiler-runtime-platejs-code-drawing",
"react-19-compiler-runtime-platejs-cursor",
"react-19-compiler-runtime-platejs-date",
"react-19-compiler-runtime-platejs-dnd",
"react-19-compiler-runtime-platejs-emoji",
"react-19-compiler-runtime-platejs-excalidraw",
"react-19-compiler-runtime-platejs-floating",
"react-19-compiler-runtime-platejs-footnote",
"react-19-compiler-runtime-platejs-indent",
"react-19-compiler-runtime-platejs-layout",
"react-19-compiler-runtime-platejs-link",
"react-19-compiler-runtime-platejs-list",
"react-19-compiler-runtime-platejs-math",
"react-19-compiler-runtime-platejs-media",
"react-19-compiler-runtime-platejs-mention",
"react-19-compiler-runtime-platejs-resizable",
"react-19-compiler-runtime-platejs-slash-command",
"react-19-compiler-runtime-platejs-suggestion",
"react-19-compiler-runtime-platejs-tabbable",
"react-19-compiler-runtime-platejs-table",
"react-19-compiler-runtime-platejs-tag",
"react-19-compiler-runtime-platejs-toc",
"react-19-compiler-runtime-platejs-yjs",
"react-19-compiler-runtime-platejs",
"react-19-compiler-runtime-plitejs",
"react-19-compiler-runtime",
"react-hotkeys-lifecycle",
"reset-empty-heading-delete",
"resizable-v54-runtime",
"respect-editor-scroll-padding",
"safe-cross-editor-drag",
"schema-authoring-contract",
"semantic-block-insertion",
"semantic-details",
"shared-plugin-identity",
"single-selection-authority-ai",
"single-selection-authority-browser",
"single-selection-authority-code-block",
"single-selection-authority-combobox",
"single-selection-authority-core",
"single-selection-authority-cursor",
"single-selection-authority-floating",
"single-selection-authority-footnote",
"single-selection-authority-layout",
"single-selection-authority-link",
"single-selection-authority-list",
"single-selection-authority-media",
"single-selection-authority-mention",
"single-selection-authority-plate",
"single-selection-authority-plite-dom",
"single-selection-authority-plite-history",
"single-selection-authority-plite-react",
"single-selection-authority-plite",
"single-selection-authority-suggestion",
"single-selection-authority-table",
"single-selection-authority-tag",
"single-selection-authority-test-utils",
"single-selection-authority-utils",
"single-selection-authority-yjs",
"slash-command-plite-plugin",
"slate-browser-proof-lane",
"stabilize-webkit-virtualized-caret",
"steady-retained-targets",
"structural-document-comparison",
"suggestion-feature-entrypoints",
"suggestion-typed-property-mutations",
"suggestion-v54-runtime",
"tabbable-plite-navigation",
"table-block-insert",
"tag-v54-runtime",
"tidy-retained-caret",
"tidy-suggestion-amendments",
"tidy-suggestion-codec",
"toc-heading-levels",
"toc-v54-runtime",
"transient-editor-geometry",
"utils-plite-node-types"
]
}
38 changes: 30 additions & 8 deletions apps/www/src/generated/release-index.json

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# @platejs/cli

## 54.0.0-beta.1

### Major Changes

- [#5036](https://github.com/udecode/plate/pull/5036) by [@zbeyens](https://github.com/zbeyens) – Add deterministic generated schema contracts for authored editor modules. Export one Plate plugin tuple and an optional application schema from `src/editor.ts`; `plate generate` discovers them by validated runtime shape, independent of their export names. Pass them directly to editor construction, generate committed exact recursive `Value` and editor types, and verify generated artifacts with `plate generate --check`.

Keep raw plugin tuples lightweight: they infer authored API, read, update, and store capabilities plus descriptor-local schema operations while their global `Value` remains broad. Generated types add exact application-wide `Value`, root and transaction mutation namespaces, and schema relationships without recursively evaluating the complete grammar at each editor access. Recursive JSON property edges degrade to `unknown` instead of overflowing the generator or emitting an unsafe recursive expansion; finite declared fields remain exact. Generated plugin bindings expose one flat primary identity at `schema.plugins.<name>.type` or `.key`; application-owned properties remain under `schema.properties`.

Give every element descriptor standard `insert`, `set`, and `remove` updates through `editor.plugin(Plugin).update`. Generated editor types also project them as `editor.update.<name>` and `tx.<name>`. An authored same-name method replaces the standard method when the plugin owns additional semantics. Remove redundant feature aliases such as `insertDate`, `insertExcalidraw`, `insertPlaceholder`, `insertTable`, and `insertToc`.

Generate exact text-block toggle eligibility so closed editor types expose `editor.update.<name>.toggle()` only for default-constructible compatible elements without authored toggle semantics.

Add canonical Plite schema contract serialization and structural diffs. Use `plate migrate new <name>` to create typed application-owned migration snapshots and a pure `FromValue -> ToValue` scaffold. Add each completed step to the editor module's `defineDocumentMigrations` chain and bind the generated source fingerprint for each historical envelope version. Use `plate migrate run` for dry-run and `--check` validation, or add `--write` to atomically replace JSON files through the detached converter. Supply `--from <version|current>` when a batch contains raw documents; envelopes carry their own source identity. The executable runner reads `EditorMigrations` from its entry module by exact export name.

Run `plate generate` with the conventional `src/editor.ts` entry, pass multiple entries for one atomic batch, or add `--watch` to reuse one TypeScript project. The CLI is bin-only; its JavaScript implementation is not a package API.

Generated modules export static `Editor`, `Value`, element/text, mutation, schema-handle, and fingerprint contracts. They never export a runtime plugin kit, wrap authored plugins, validate runtime construction, or act as a hook argument. Runtime composition always uses the authored plugin tuple and optional application schema; CI `--check` is the staleness gate.

Keep compiler scratch in the operating system temp directory and transaction, lock, watcher, staging, and recovery state in the project's deterministic `node_modules/.cache`. Consumer source contains only the intentional generated contracts and needs no Plate-specific ignore rules.

- [#5036](https://github.com/udecode/plate/pull/5036) by [@zbeyens](https://github.com/zbeyens) – Convert persisted documents explicitly at the storage boundary. Define one immutable target with `defineDocumentMigrations({ plugins, schema, sourceFingerprints, steps })`, then call `migrateDocument(input, { migrations, source? })`. The result contains `{ output, applied, source }`; save or load `output` directly.

Plate editors accept current-schema input only. Remove editor `migrations`, plugin `prepareDocument`, `migrateElementIds`, root migration imports, and public v53 manifest imports. Import migration APIs from `platejs/migrations`. Raw documents require `source: number | 'current'`; persisted envelopes carry their own exact schema identity.

`plate migrate run` uses the same detached converter. Pass `--from <version|current>` for raw files; mixed batches apply the flag only to raw documents.

Persist authored state with codec v6 footprints so current checkpoint admission can validate and index retained revisions without decoding their bodies. Older codec versions convert to v6 during admission.

Compile Authored checkpoint construction and admission as a private capability of the installed Authored plugin. Generic Plite internals and Plate's core facade do not export Authored algorithms.

- [#5036](https://github.com/udecode/plate/pull/5036) by [@zbeyens](https://github.com/zbeyens) – Use one nominal `Plugin` descriptor family across Plite and Plate. Author plugins with `definePlugin`, install them through the `plugins` option, and open their exact typed portal with `editor.plugin(Plugin)`. Plate keeps its product compiler while preserving the original descriptor through headless and React authoring stages; dependencies, conflicts, ancestry, editor-local configuration, stores, rollback, retained portals, and view capabilities resolve from that shared identity.

**Migration:** Replace `defineExtension` with `definePlugin`, `extensions` with `plugins`, `editor.extension(Plugin)` with `editor.plugin(Plugin)`, `EditorExtension` with `Plugin`, and `EditorExtensionTypeProvider` with `PluginTypeProvider`. Replace Plate's `defineBasePlugin` and `definePlatePlugin` factories with `definePlugin`. The v54 CLI migration emits one mixed `EditorKit` plugin tuple.

### Patch Changes

- [#5115](https://github.com/udecode/plate/pull/5115) by [@zbeyens](https://github.com/zbeyens) – Add the `plate deps` command for dependency maintenance.

- [#5036](https://github.com/udecode/plate/pull/5036) by [@zbeyens](https://github.com/zbeyens) – Require `platejs@>=54.0.0-beta.1` as a peer dependency.

Generate and migrate editor contracts from application schemas that declare a primary root.

- [#5036](https://github.com/udecode/plate/pull/5036) by [@zbeyens](https://github.com/zbeyens) –

- Generate schema and binding facts through `platejs/compiler`, without activating editor plugins during module evaluation.
- Materialize exact installed property types through type-only compiler projections while preserving discovery and atomic output publication.
- Resolve property type aliases only for schema properties that consume them.

- [#5036](https://github.com/udecode/plate/pull/5036) by [@zbeyens](https://github.com/zbeyens) –

- Run npm lookups without shell interpolation
- Require `--install` before installing in `--yes` mode
- Restore TypeScript declaration builds

- [#5036](https://github.com/udecode/plate/pull/5036) by [@zbeyens](https://github.com/zbeyens) – Add typed block `upsert` operations and make block `insert` apply one semantic empty-block policy across generated and feature-owned plugin portals. Generated editor contracts identify block mutations so inline portals remain excluded.
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@platejs/cli",
"version": "54.0.0-beta.0",
"version": "54.0.0-beta.1",
"description": "Generate exact Plate editor schema contracts and migrations.",
"keywords": [
"codegen",
Expand Down Expand Up @@ -61,6 +61,6 @@
"platejs": "workspace:^"
},
"peerDependencies": {
"platejs": ">=54.0.0-beta.1"
"platejs": ">=54.0.0-beta.2"
}
}
Loading
Loading