platejs 54.0.0-beta.13 → 54.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EditorStatic-CKG5xM3y.d.ts → EditorStatic-ldAMJg-F.d.ts} +4 -4
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/lib/aiDraftSession.js +9 -7
- package/dist/ai/lib/aiPolicy.internal.js +43 -6
- package/dist/ai/lib/editorAgent.js +30 -21
- package/dist/ai/lib/editorAgentSync.internal.js +2 -2
- package/dist/ai/lib/lockedContext.js +5 -4
- package/dist/ai/react/copilotInline.internal.js +6 -5
- package/dist/ai/react/index.d.ts +7 -7
- package/dist/ai/react/useEditorAgent.js +14 -3
- package/dist/authored/index.d.ts +4 -4
- package/dist/{authored-CJL7S8qI-BxC9ip4d.d.ts → authored-Cux94E76-fEDdP_BS.d.ts} +3 -3
- package/dist/clipboard-format-key-B_rCped5-BJzbgrSZ.d.ts +1 -0
- package/dist/code-block/codemirror/index.d.ts +2 -2
- package/dist/{comment-anchor.internal-DTBP1huU.d.ts → comment-anchor.internal-Ck30WbG4.d.ts} +2 -2
- package/dist/compiler/index.d.ts +3 -3
- package/dist/{core-CTB0OBoh.d.ts → core-DoxvjG5W.d.ts} +69 -23
- package/dist/diff/index.d.ts +2 -2
- package/dist/docs/agents/skills.md +6 -2
- package/dist/docs/agents.md +1 -1
- package/dist/docs/ai-agents.md +8 -4
- package/dist/docs/ai.md +5 -0
- package/dist/docs/api/plate.md +15 -7
- package/dist/docs/api/react-hooks.md +32 -2
- package/dist/docs/authored-changes.md +4 -0
- package/dist/docs/block-menu.md +4 -0
- package/dist/docs/board.md +4 -0
- package/dist/docs/callout.md +63 -9
- package/dist/docs/collaboration.md +6 -1
- package/dist/docs/combobox.md +9 -2
- package/dist/docs/comment.md +8 -4
- package/dist/docs/components/toolbar-buttons.md +1 -1
- package/dist/docs/copilot.md +4 -0
- package/dist/docs/deck.md +173 -0
- package/dist/docs/details.md +4 -0
- package/dist/docs/diff.md +4 -0
- package/dist/docs/discussion.md +4 -0
- package/dist/docs/dnd.md +4 -0
- package/dist/docs/docx.md +6 -0
- package/dist/docs/emoji.md +2 -2
- package/dist/docs/equation.md +4 -0
- package/dist/docs/examples/collaboration-example.md +4 -0
- package/dist/docs/examples/export.md +41 -31
- package/dist/docs/examples/merge.md +4 -0
- package/dist/docs/examples/version-history.md +4 -0
- package/dist/docs/field.md +4 -0
- package/dist/docs/footnote.md +4 -0
- package/dist/docs/format-painter.md +1 -1
- package/dist/docs/html.md +4 -0
- package/dist/docs/index.md +4 -0
- package/dist/docs/ink.md +6 -0
- package/dist/docs/installation/manual.md +2 -4
- package/dist/docs/installation/next.md +1 -3
- package/dist/docs/installation/plate-ui.md +6 -2
- package/dist/docs/installation/rsc.md +1 -1
- package/dist/docs/installation.md +4 -0
- package/dist/docs/link.md +6 -0
- package/dist/docs/lint.md +18 -0
- package/dist/docs/llms.txt +4 -1
- package/dist/docs/lock.md +34 -2
- package/dist/docs/markdown.md +8 -0
- package/dist/docs/media.md +4 -0
- package/dist/docs/mention.md +5 -0
- package/dist/docs/mobile.md +415 -0
- package/dist/docs/pagination.md +4 -0
- package/dist/docs/prompt-editor.md +17 -1
- package/dist/docs/reference.md +192 -0
- package/dist/docs/roots.md +34 -0
- package/dist/docs/serializing.md +23 -0
- package/dist/docs/slash-command.md +58 -4
- package/dist/docs/static.md +29 -20
- package/dist/docs/suggestion.md +4 -0
- package/dist/docs/sync.md +4 -0
- package/dist/docs/table.md +31 -0
- package/dist/docs/toc.md +14 -0
- package/dist/docs/toolbar.md +4 -0
- package/dist/docs/unit-testing.md +4 -0
- package/dist/docs/upload.md +4 -0
- package/dist/docx/export/index.d.ts +5 -5
- package/dist/docx/import/index.d.ts +5 -5
- package/dist/docx/paste/index.d.ts +4 -4
- package/dist/dom/index.d.ts +1 -1
- package/dist/features/basic-nodes/lib/BaseMarkPlugins.js +1 -1
- package/dist/features/basic-styles/lib/BaseFormattingPlugin.js +61 -28
- package/dist/features/basic-styles/lib/BaseStylePlugins.js +28 -7
- package/dist/features/board/index.d.ts +1 -1
- package/dist/features/callout/index.d.ts +2 -160
- package/dist/features/callout/lib/BaseCalloutPlugin.js +109 -9
- package/dist/features/column/index.d.ts +1 -1
- package/dist/features/comments/index.d.ts +2 -2
- package/dist/features/date/index.d.ts +3 -3
- package/dist/features/details/index.d.ts +3 -3
- package/dist/features/field/index.d.ts +1 -1
- package/dist/features/field/lib/BaseFieldPlugin.js +111 -53
- package/dist/features/field/lib/fieldCache.internal.js +9 -21
- package/dist/features/find/index.d.ts +3 -3
- package/dist/features/footnote/index.d.ts +3 -3
- package/dist/features/ink/index.d.ts +1 -1
- package/dist/features/link/lib/BaseLinkPlugin.js +5 -2
- package/dist/features/lint/index.d.ts +3 -3
- package/dist/features/list/lib/listKeyboard.internal.js +7 -2
- package/dist/features/lock/index.d.ts +1 -1
- package/dist/features/media/index.d.ts +1 -1
- package/dist/features/mention/index.d.ts +1 -1
- package/dist/features/reference/index.d.ts +240 -0
- package/dist/features/reference/index.js +2 -0
- package/dist/features/reference/lib/BaseReferencePlugin.js +598 -0
- package/dist/features/table/index.d.ts +2 -2
- package/dist/features/toc/index.d.ts +1 -1
- package/dist/features/upload/index.d.ts +1 -1
- package/dist/history/index.d.ts +1 -1
- package/dist/html/index.d.ts +4 -4
- package/dist/html/server/index.d.ts +2 -2
- package/dist/html/server/serverCssParser.internal.js +14 -25
- package/dist/html/server/serverCssStyle.internal.js +4 -7
- package/dist/{htmlConversion-Y-M6PLRi.d.ts → htmlConversion-CHcWrkh5.d.ts} +2 -2
- package/dist/{htmlTypes-CNhoCFjK.d.ts → htmlTypes-9HQ8p7c5.d.ts} +3 -3
- package/dist/hyperscript/index.d.ts +1 -1
- package/dist/index-1JPYTyFo.d.ts +305 -0
- package/dist/index-B-SGl9uM.d.ts +1 -0
- package/dist/{index-qqrnWAk_.d.ts → index-B048Z6JD.d.ts} +7 -7
- package/dist/index-BFkl1TNK.d.ts +1 -0
- package/dist/{index-DYuqsDrP.d.ts → index-BRwhNV78.d.ts} +3 -3
- package/dist/{index-B0R9sXv2-T1dxG9oM.d.ts → index-BYv6zIL_-DWmaXzbX.d.ts} +4 -4
- package/dist/{index-B-8L9f6a2.d.ts → index-Bm8V8SS4.d.ts} +5 -5
- package/dist/{index-B8JeECEk.d.ts → index-BujEk356.d.ts} +2 -2
- package/dist/{index-CHud6Aa-.d.ts → index-C4KIDKwP.d.ts} +3 -3
- package/dist/{index-B4aToRMv.d.ts → index-CAFKQNqu.d.ts} +3 -3
- package/dist/{index-Bqva6PJc.d.ts → index-CXJwwbAJ.d.ts} +3 -3
- package/dist/index-CfqQvdcO.d.ts +3 -0
- package/dist/{index-D54VPeky.d.ts → index-Cj09P2Qp.d.ts} +2 -2
- package/dist/{index-mcBtG6pK-CitQV9Bq.d.ts → index-CnumypT3-DGx8_6Ye.d.ts} +2 -2
- package/dist/{index-CWutqVQ_-BO-UgVeK.d.ts → index-DTTSk3WQ-D0TA0B5z.d.ts} +1 -1
- package/dist/{index-CLPMcGC5.d.ts → index-DsKfZoY4.d.ts} +4 -4
- package/dist/{index-UYpvOBXG.d.ts → index-UrJ6V3_e.d.ts} +2 -2
- package/dist/{index-DXCdafUk.d.ts → index-UuSQ_p3c.d.ts} +43 -20
- package/dist/{index-BEXBAmJf.d.ts → index-YNMmixU5.d.ts} +3 -3
- package/dist/{index-CXd5hwaH.d.ts → index-Zj4bj9bZ.d.ts} +1 -1
- package/dist/{index-BfJKfAwk.d.ts → index-eWzk-bcU.d.ts} +3 -3
- package/dist/{index-DhsryaAC.d.ts → index-h2HH9Rw8.d.ts} +1 -1
- package/dist/{index-DJhwDkfd.d.ts → index-l9R_LyGx.d.ts} +3 -3
- package/dist/{index-BFWK852j.d.ts → index-lD9iIU3j.d.ts} +3 -3
- package/dist/{index-D3bhjdRz.d.ts → index-lgeYbG68.d.ts} +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/internal/plugin/compilePlateModel.js +24 -5
- package/dist/internal/plugin/pluginInjectNodeProps.js +33 -5
- package/dist/internal/utils/urlPolicy.js +11 -1
- package/dist/lib/editor/withPlite.js +8 -6
- package/dist/lib/plugins/html/cssLexer.internal.js +144 -37
- package/dist/lib/plugins/html/cssSafety.internal.js +100 -0
- package/dist/lib/plugins/html/htmlDecode.internal.js +2 -2
- package/dist/lib/plugins/html/htmlMatcher.internal.js +1 -1
- package/dist/lib/plugins/html/htmlRules.internal.js +2 -13
- package/dist/lib/plugins/html/htmlSafety.js +28 -27
- package/dist/lib/plugins/html/htmlSerialize.internal.js +16 -2
- package/dist/lib/plugins/html/htmlStyleInline.internal.js +38 -31
- package/dist/lib/plugins/input-rules/inputRuleVeto.internal.js +27 -1
- package/dist/markdown/index.d.ts +1 -1
- package/dist/markdown/lib/internal/markdownAttributes.js +16 -7
- package/dist/markdown/lib/internal/markdownMappings.js +123 -16
- package/dist/markdown/lib/serializer/convertPhrasingSerialize.js +16 -1
- package/dist/math/index.d.ts +3 -3
- package/dist/math/react/index.d.ts +4 -4
- package/dist/migrations/index.d.ts +4 -4
- package/dist/migrations/migratePlateV54Urls.internal.js +63 -1
- package/dist/pagination/index.d.ts +1 -1
- package/dist/pagination/react/PaginationPlugin.js +46 -43
- package/dist/pagination/react/index.d.ts +13 -7
- package/dist/{protocol-CSuP7AWG-DAorqpaF.d.ts → protocol-CYflJUT3-CRJPCqOO.d.ts} +1 -1
- package/dist/react/authored/index.d.ts +4 -4
- package/dist/react/components/PlateView.js +7 -1
- package/dist/react/features/board/index.d.ts +5 -5
- package/dist/react/features/callout/index.d.ts +93 -4
- package/dist/react/features/column/index.d.ts +5 -5
- package/dist/react/features/combobox/combobox.internal.js +35 -22
- package/dist/react/features/combobox/comboboxOwner.internal.js +29 -2
- package/dist/react/features/combobox/index.d.ts +8 -6
- package/dist/react/features/comments/index.d.ts +6 -6
- package/dist/react/features/date/index.d.ts +4 -4
- package/dist/react/features/details/index.d.ts +4 -4
- package/dist/react/features/field/FieldPlugin.js +2 -2
- package/dist/react/features/field/index.d.ts +5 -5
- package/dist/react/features/footnote/index.d.ts +4 -4
- package/dist/react/features/format-painter/FormatPainterPlugin.js +27 -34
- package/dist/react/features/format-painter/index.d.ts +4 -4
- package/dist/react/features/ink/index.d.ts +5 -5
- package/dist/react/features/lock/index.d.ts +5 -5
- package/dist/react/features/media/index.d.ts +5 -5
- package/dist/react/features/mention/index.d.ts +4 -4
- package/dist/react/features/table/index.d.ts +6 -6
- package/dist/react/features/toc/index.d.ts +2 -2
- package/dist/react/features/upload/index.d.ts +5 -5
- package/dist/react/index.d.ts +6 -6
- package/dist/react/virtualized.d.ts +3 -3
- package/dist/refusal-VX2Y6Wmd-BJzbgrSZ.d.ts +1 -0
- package/dist/{registerEditorTools-Cl-o_Wnq.d.ts → registerEditorTools-DoRs57-M.d.ts} +16 -8
- package/dist/shared-room-BZxUmqjV-BJzbgrSZ.d.ts +1 -0
- package/dist/skills/plate/SKILL.md +4 -3
- package/dist/skills/plate/references/ai-and-agents.md +2 -2
- package/dist/skills/plate/references/pricing.md +3 -3
- package/dist/skills/plate/references/setup.md +6 -0
- package/dist/skills/plate/references/ui-and-sync.md +4 -3
- package/dist/{source-DUP5aKcT.d.ts → source-PTxjcq4_.d.ts} +3 -3
- package/dist/static/index.d.ts +23 -9
- package/dist/static/internal/staticPendingMedia.internal.js +2 -1
- package/dist/static/internal/staticPresentation.js +1 -0
- package/dist/static/renderStaticHtml.js +85 -39
- package/dist/{storage-EzfLDqRy-Cu4DQ-Rf.d.ts → storage-CkRL-SHq-CBP6PGqr.d.ts} +2 -2
- package/dist/sync/cloudflare/index.d.ts +3 -3
- package/dist/sync/index.d.ts +4 -4
- package/dist/sync/postgres/index.d.ts +1 -1
- package/dist/sync/react/index.d.ts +6 -6
- package/dist/sync/server/index.d.ts +5 -5
- package/dist/tabbable/react/index.d.ts +4 -4
- package/dist/testing/index.d.ts +3 -3
- package/dist/{transport-DAforzBt-BFwAhC-N.d.ts → transport-2koNcrqA-Dp_RYE3n.d.ts} +1 -1
- package/dist/utils/plate-keys.js +1 -0
- package/dist/{widths-BjIZxtaJ.d.ts → widths-DN1W6m66.d.ts} +5 -5
- package/package.json +9 -2
- package/dist/clipboard-format-key-D9rnh20X-CR00YA0H.d.ts +0 -1
- package/dist/index-CKAkaSJK.d.ts +0 -3
- package/dist/index-CxyK4HrT.d.ts +0 -1
- package/dist/index-zcb_RtZC.d.ts +0 -1
- package/dist/refusal-DCzeB9nD-CR00YA0H.d.ts +0 -1
- package/dist/shared-room-Bg8qMvm1-CR00YA0H.d.ts +0 -1
- /package/dist/{tx-only-CWT-IURY-BqIFhy44.d.ts → tx-only-x32UA-pQ-OQbgWQrN.d.ts} +0 -0
package/dist/docs/combobox.md
CHANGED
|
@@ -149,6 +149,7 @@ _Type : followed by a keyword to filter and insert an emoji from the inline comb
|
|
|
149
149
|
## Behavior
|
|
150
150
|
|
|
151
151
|
- The popup opens when the user types the trigger. Moving the caret after existing trigger text, undo, paste and remote edits never open it.
|
|
152
|
+
- Elements and marks that declare `inputRuleVeto` (such as code blocks and inline code) keep typed triggers as plain text. A trigger that straddles a veto mark never opens, and converting an open query into a veto block closes the popup and refuses completion.
|
|
152
153
|
- The query is the text from the trigger to the caret, across marks, inside one block. It ends when the caret moves before the trigger or past the typed text, a character fails `queryPattern`, it starts with whitespace or it grows past `maxQueryLength`.
|
|
153
154
|
- Escape closes the popup and leaves the typed text. Typing more does not reopen it; typing the trigger again does.
|
|
154
155
|
- Completion deletes the trigger and query and runs your insertion in one transaction. Undo restores the typed text.
|
|
@@ -172,7 +173,7 @@ While a typed trigger's query is open, the editor reports itself as a combobox.
|
|
|
172
173
|
- **Default:** `/^\s?$/`
|
|
173
174
|
- `triggerQuery` (`((editor: Editor) => boolean) | null` *(optional)*):
|
|
174
175
|
|
|
175
|
-
Return `false` to keep a typed trigger as plain text
|
|
176
|
+
Additional app veto tested after `inputRuleVeto` (code blocks, inline code, and custom veto elements or marks are always skipped). Return `false` to keep a typed trigger as plain text.
|
|
176
177
|
- **Default:** `null`
|
|
177
178
|
- `queryPattern` (`RegExp | null` *(optional)*):
|
|
178
179
|
|
|
@@ -200,6 +201,12 @@ While a typed trigger's query is open, the editor reports itself as a combobox.
|
|
|
200
201
|
|
|
201
202
|
## Registry UI
|
|
202
203
|
|
|
203
|
-
The copied `inline-combobox` component wraps `useCombobox` with a Floating UI listbox. It owns the active option
|
|
204
|
+
The copied `inline-combobox` component wraps `useCombobox` with a Floating UI listbox. It owns the active option, viewport clipping, and popup placement at the trigger.
|
|
205
|
+
|
|
206
|
+
- **`InlineCombobox`**: accepts `useCombobox` options plus `hideWhenNoValue` (wait for a non-empty query before opening), `loading` (keep Enter and Tab from completing while options load, and hold trailing-space auto-dismiss), and `onKeyDown` (runs before default list keys; return `true` to handle the key, such as Escape to pop a submenu).
|
|
207
|
+
- **`InlineComboboxContent`**: renders the portaled listbox and forwards `aria-busy` so child components can signal async searches while keeping keyboard navigation intact.
|
|
208
|
+
- **`InlineComboboxGroup`** and **`InlineComboboxGroupLabel`**: group options under an accessible label, hide empty groups, and draw dividers only between visible groups.
|
|
209
|
+
- **`InlineComboboxItem`**: inserts the completion in `onSelect` using its inferred transaction (return `false` to refuse and keep the query). Pass `complete={false}` for submenu drill-down or deferred actions that run `onClick` without deleting the trigger, and `focusEditor={false}` to keep focus outside the editor after completion.
|
|
210
|
+
- **Context hooks and ranking**: call `useInlineComboboxQuery()`, `useInlineComboboxMatch()`, and `useInlineComboboxDismiss()` inside the popup. Pass options and the query to `rankOptions(options, query)` to sort exact label or keyword matches first, then label prefix, later word prefix, and keyword or group matches; equal matches keep their input order, and a blank query keeps every option.
|
|
204
211
|
|
|
205
212
|
_Registry item `inline-combobox`: `npx shadcn@latest add @plate/inline-combobox`._
|
package/dist/docs/comment.md
CHANGED
|
@@ -16,10 +16,10 @@ For comments alongside proposed edits, see [Discussion](/docs/discussion).
|
|
|
16
16
|
- Highlights that follow document edits, undo, and redo
|
|
17
17
|
- Session undo and redo for successful local thread creation
|
|
18
18
|
- Overlapping threads and comments spanning text segments
|
|
19
|
-
- Document-level discovery
|
|
19
|
+
- Document-level discovery with instant search and **All**, **Open**, **Mine**, and **Resolved** filters
|
|
20
20
|
- Thread rows in your own tables, and quote-verified `CommentAnchor` records saved with each document revision
|
|
21
21
|
- Incremental remote sync via versioned `applyRemote({ upserts, deletes })`
|
|
22
|
-
- App data on threads and messages
|
|
22
|
+
- App data on threads and messages, including per-message emoji reactions in the copied UI
|
|
23
23
|
- Comments under another author, such as an AI
|
|
24
24
|
- Read-only and preview-view commenting plus static highlights
|
|
25
25
|
|
|
@@ -197,7 +197,7 @@ The `data` passed to `createThread` belongs to the thread; its first message get
|
|
|
197
197
|
|
|
198
198
|
### Discover conversations
|
|
199
199
|
|
|
200
|
-
Render `AllCommentsButton` inside a toolbar whenever the editor installs Comments. It opens a lazy, paginated dialog over published records and works without a document selection, in read-only views, and without Suggestions. The **All**, **Open**, and **Resolved** filters
|
|
200
|
+
Render `AllCommentsButton` inside a toolbar whenever the editor installs Comments. It opens a lazy, paginated dialog over published records and works without a document selection, in read-only views, and without Suggestions. The **All**, **Open**, **Mine**, and **Resolved** filters show live counts and pair with instant search over quoted excerpts, message text, and author names; target availability does not remove a record from those filters.
|
|
201
201
|
|
|
202
202
|
Each row labels its target. A target the current view can show reads **Attached to document**, and a range it cannot show reads **Target unavailable in this view**. A thread on a suggestion says what the review did once the suggestion is no longer pending: **Suggestion accepted**, **Suggestion rejected**, **Suggestion accepted and rejected** when it holds both verdicts, or **Suggestion deleted** when it left with no verdict, such as when accepting a struck table took it. These labels read the same after a reload. A pending suggestion reads **Target unavailable in this view** under a preview, because its ranges name places of the stored document.
|
|
203
203
|
|
|
@@ -622,8 +622,12 @@ A listener runs after its action's outcome is decided, except a `subscribeAnchor
|
|
|
622
622
|
|
|
623
623
|
### Copied UI
|
|
624
624
|
|
|
625
|
-
`CommentKit` from the copied `comment` item configures highlight styling, and `useActiveCommentIds()` reads the mounted view's `activeIds()`. `DiscussionKit` adds block buttons and the floating thread view. `UserDirectoryProvider`, `useUser`, and `useUserDirectory` from the copied `user-directory` item supply `UserProfile` records above `EditorRoot`. Use the exported `CommentThreadCard` and `CommentComposer` to build a custom thread layout.
|
|
625
|
+
`CommentKit` from the copied `comment` item configures highlight styling, and `useActiveCommentIds()` reads the mounted view's `activeIds()`. `DiscussionKit` adds block buttons and the floating thread view. `UserDirectoryProvider`, `useUser`, and `useUserDirectory` from the copied `user-directory` item supply `UserProfile` records above `EditorRoot`. Use the exported `CommentThreadCard` and `CommentComposer` to build a custom thread layout; `CommentThreadCard` persists per-message emoji reactions under `message.data.reactions` through `api.setData`.
|
|
626
626
|
|
|
627
627
|
### `CommentComposer`
|
|
628
628
|
|
|
629
629
|
`onSubmit(body)` returns `Promise<CommentMutationResult<string | undefined>>`. Return the awaited durable action's result; the composer clears input only for `status: 'applied'`. It preserves rich input while saving and blocks duplicate submissions. Failed actions retain the draft and display a retry message.
|
|
630
|
+
|
|
631
|
+
## Pro and Business
|
|
632
|
+
|
|
633
|
+
Plate Pro ships `@plate-pro/floating-discussion` for wide-screen collision-free margin cards (`expanded`, `minimal`, and `hidden` density modes, Paged and Pageless zoom geometry, and a fail-closed `platejs/sync` realtime comment bridge) alongside the `Potion v2` and `Paper v2` flagship templates. Plate Business adds `@plate-business/security-kernel` (`policy.comments` quote redaction, internal-only ethical walls, `actorId` spoofing refusal, and zero-PII hash-chained WORM comment audits) verified by `plate verify` CI. See [Pricing](/pricing).
|
|
@@ -16,7 +16,7 @@ For the container bars that host these buttons, see [Fixed Toolbar](/docs/compon
|
|
|
16
16
|
| Draw Toolbar Button | A toolbar button that turns the ink Draw tool on or off with the last tool used, and the brush preferences each tool remembers per editor. | `npx shadcn@latest add @plate/draw-toolbar-button` |
|
|
17
17
|
| Emoji Toolbar Button | An emoji picker toolbar button. | `npx shadcn@latest add @plate/emoji-toolbar-button` |
|
|
18
18
|
| Equation Toolbar Button | A toolbar button for inserting and editing equations. | `npx shadcn@latest add @plate/equation-toolbar-button` |
|
|
19
|
-
| Export Toolbar Button |
|
|
19
|
+
| Export Toolbar Button | An anchored export popover for Word, PDF/Print, Markdown, and HTML with clean-copy, suggestion, page layout, and theme controls. | `npx shadcn@latest add @plate/export-toolbar-button` |
|
|
20
20
|
| Field Toolbar Button | A toolbar menu that inserts a field of each kind. | `npx shadcn@latest add @plate/field-toolbar-button` |
|
|
21
21
|
| Font Color Toolbar Button | A color picker toolbar button with text and background color controls. | `npx shadcn@latest add @plate/font-color-toolbar-button` |
|
|
22
22
|
| Font Size Toolbar Button | A toolbar control for adjusting font size. | `npx shadcn@latest add @plate/font-size-toolbar-button` |
|
package/dist/docs/copilot.md
CHANGED
|
@@ -449,3 +449,7 @@ Example shortcut: `Ctrl+Space`
|
|
|
449
449
|
### `editor.plugin(CopilotPlugin).api.stop()`
|
|
450
450
|
|
|
451
451
|
Cancels any debounced trigger, aborts the active completion request, and clears loading state.
|
|
452
|
+
|
|
453
|
+
## Pro and Business
|
|
454
|
+
|
|
455
|
+
Plate Pro ships the `Potion v2` and `Paper v2` flagship templates with Copilot wired alongside inline AI editing, real-time sync, and self-host deploy skills (`plate-deploy-cloudflare`, `plate-deploy-vercel`). See [Pricing](/pricing).
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Deck
|
|
2
|
+
|
|
3
|
+
Present structured documents and board frames as a live slide deck with speaker notes and 16:9 print export.
|
|
4
|
+
|
|
5
|
+
_Example `deck-demo` in the Plate repository: `apps/www/src/registry/examples/deck-demo.tsx`._
|
|
6
|
+
|
|
7
|
+
_Open Present deck from the toolbar to step through heading slides, board frames, speaker notes, and the slide overview._
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Projects headings (`h1` and `h2`), horizontal rules (`horizontalRule`), and embedded `board` frames (`boardFrame`) directly into slides with no separate presentation format or document migration.
|
|
12
|
+
- Extracts speaker notes before rendering audience slides, keeping notes out of the audience stage across `details` blocks, `callout` blocks (`variant: 'speaker-notes'`), board sticky notes, and trailing `Notes: <Frame>` disclosure blocks.
|
|
13
|
+
- Hides slides and sub-sections prefixed with `[draft]` or `[hidden]` (along with nested headings, boards, frames, and footnote definitions inside hidden sections) and prunes orphaned footnote definitions.
|
|
14
|
+
- Presents a full-screen 16:9 stage with keyboard navigation, slide overview grid (`O` or `G`), blackout (`B` or `.`), fullscreen toggle (`F`), and a single-screen speaker notes drawer (`S`) with a timer and next-slide preview.
|
|
15
|
+
- Syncs presenter and audience browser tabs through `createDeckSyncChannel` (`BroadcastChannel` with `localStorage` fallback).
|
|
16
|
+
- Prints slides to 16:9 PDF through `printDeck`, defaulting to accepted content when `AuthoredPlugin` is installed so pending suggestions never leak into handouts.
|
|
17
|
+
|
|
18
|
+
## Kit usage
|
|
19
|
+
|
|
20
|
+
### Installation
|
|
21
|
+
|
|
22
|
+
The `deck` registry item installs the pure slide projector, full-screen presenter stage, and toolbar menu into your project.
|
|
23
|
+
|
|
24
|
+
_Registry item `deck`: `npx shadcn@latest add @plate/deck`._
|
|
25
|
+
|
|
26
|
+
- `deck-projection.ts`: pure `projectDeck` function that splits documents and board frames into typed slides while stripping speaker notes and hidden sections.
|
|
27
|
+
- `deck-presenter.tsx`: `DeckPresenter`, `DEFAULT_DECK_PRESENTATION`, `createDeckSyncChannel`, and `printDeck`.
|
|
28
|
+
- `deck-toolbar-button.tsx`: `DeckToolbarButton` dropdown menu for launching Present deck, Present board frames, and Print slides (PDF).
|
|
29
|
+
|
|
30
|
+
### Add toolbar button
|
|
31
|
+
|
|
32
|
+
Render `DeckToolbarButton` inside your editor toolbar. It reads the active editor from `Plate` context and opens `DeckPresenter` in a portal.
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { DeckToolbarButton } from '@/components/editor/deck-toolbar-button';
|
|
36
|
+
import { FixedToolbar } from '@/components/editor/fixed-toolbar';
|
|
37
|
+
import { ToolbarGroup } from '@/components/editor/toolbar';
|
|
38
|
+
|
|
39
|
+
export function MyToolbar() {
|
|
40
|
+
return (
|
|
41
|
+
<FixedToolbar>
|
|
42
|
+
<ToolbarGroup>
|
|
43
|
+
<DeckToolbarButton />
|
|
44
|
+
</ToolbarGroup>
|
|
45
|
+
</FixedToolbar>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Manual usage
|
|
51
|
+
|
|
52
|
+
Control presentation mode directly with `DeckPresenter`, or call `projectDeck` to build a custom slide strip or export pipeline.
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
'use client';
|
|
56
|
+
|
|
57
|
+
import * as React from 'react';
|
|
58
|
+
import { useModelEditor } from 'platejs/react';
|
|
59
|
+
|
|
60
|
+
import {
|
|
61
|
+
DEFAULT_DECK_PRESENTATION,
|
|
62
|
+
DeckPresenter,
|
|
63
|
+
printDeck,
|
|
64
|
+
} from '@/components/editor/deck-presenter';
|
|
65
|
+
|
|
66
|
+
export function CustomDeckControls() {
|
|
67
|
+
const editor = useModelEditor();
|
|
68
|
+
const [open, setOpen] = React.useState(false);
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<>
|
|
72
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
73
|
+
Present
|
|
74
|
+
</button>
|
|
75
|
+
<button
|
|
76
|
+
type="button"
|
|
77
|
+
onClick={() => {
|
|
78
|
+
void printDeck(editor, {
|
|
79
|
+
presentation: DEFAULT_DECK_PRESENTATION,
|
|
80
|
+
});
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
Print 16:9 PDF
|
|
84
|
+
</button>
|
|
85
|
+
<DeckPresenter
|
|
86
|
+
channelId="team-review"
|
|
87
|
+
editor={editor}
|
|
88
|
+
onOpenChange={setOpen}
|
|
89
|
+
open={open}
|
|
90
|
+
/>
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Slide boundaries
|
|
97
|
+
|
|
98
|
+
`projectDeck(document, options)` derives slides without mutating the source document:
|
|
99
|
+
|
|
100
|
+
- `splitBy: 'auto'` (default): starts a new slide on every top-level `horizontalRule`, every top-level heading whose level is in `headingLevels` (defaults to `[1, 2]`), and every visible `boardFrame` inside an embedded `board`.
|
|
101
|
+
- `splitBy: 'headings'`: splits only on top-level headings in `headingLevels`.
|
|
102
|
+
- `splitBy: 'hr'`: splits only on top-level `horizontalRule` blocks.
|
|
103
|
+
- `splitBy: 'frames'`: projects only visible `boardFrame` slides from boards in the document.
|
|
104
|
+
|
|
105
|
+
Board frame slides render each kept member shape relative to the frame origin in canonical board paint order, excluding off-frame scratchpad shapes and frame wrapper chrome.
|
|
106
|
+
|
|
107
|
+
## Speaker notes and hidden slides
|
|
108
|
+
|
|
109
|
+
Notes are extracted into `slide.notesText` and `slide.notesBlocks`, then removed from the audience slide AST before rendering:
|
|
110
|
+
|
|
111
|
+
- A `details` block whose first `summary` child matches `Speaker notes`, `Presenter notes`, `Notes`, or `备注` (case-insensitive).
|
|
112
|
+
- A `callout` block with `variant: 'speaker-notes'`.
|
|
113
|
+
- A board sticky note (`boardNote`) inside a frame whose text begins with `Speaker notes:`, `Presenter notes:`, `Notes:`, or `备注:`.
|
|
114
|
+
- A trailing `details` block after a framed board whose `summary` matches `Notes: <Frame Title>` (or `Speaker notes: <Frame Title>` / `备注: <Frame Title>`), which attaches to the matching board frame slide.
|
|
115
|
+
|
|
116
|
+
Any heading or board frame title starting with `[draft]` or `[hidden]` (case-insensitive) is omitted from the projected deck, along with lower-level sub-headings, nested headings inside containers, embedded boards, and footnote definitions inside that section.
|
|
117
|
+
|
|
118
|
+
## Keyboard shortcuts
|
|
119
|
+
|
|
120
|
+
Shortcuts are active while `DeckPresenter` is open and focus is not inside an editable field.
|
|
121
|
+
|
|
122
|
+
| Key | Action |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| `ArrowRight`, `ArrowDown`, `PageDown`, `Space`, `N` | Next slide |
|
|
125
|
+
| `ArrowLeft`, `ArrowUp`, `PageUp`, `P` | Previous slide |
|
|
126
|
+
| `Home` / `End` | First / last slide |
|
|
127
|
+
| `S` | Toggle speaker notes drawer |
|
|
128
|
+
| `O`, `G` | Toggle slide overview grid |
|
|
129
|
+
| `B`, `.` | Toggle blackout screen |
|
|
130
|
+
| `F` | Toggle browser fullscreen |
|
|
131
|
+
| `Escape` | Close active overlay or exit presenter |
|
|
132
|
+
|
|
133
|
+
## API Reference
|
|
134
|
+
|
|
135
|
+
### `projectDeck(document, options?)`
|
|
136
|
+
|
|
137
|
+
Projects a Plate document (`{ children, roots? }`) into a `DeckProjection` (`{ slides, stats, title }`).
|
|
138
|
+
|
|
139
|
+
| Option | Type | Default | Description |
|
|
140
|
+
| --- | --- | --- | --- |
|
|
141
|
+
| `splitBy` | `'auto' \| 'headings' \| 'hr' \| 'frames'` | `'auto'` | Controls which boundaries start new slides. |
|
|
142
|
+
| `headingLevels` | `readonly number[]` | `[1, 2]` | Heading levels that start a slide in `'auto'` and `'headings'` modes. |
|
|
143
|
+
| `frameOrder` | `'spatial' \| 'stored'` | `'spatial'` | Orders board frames left-to-right by row (`'spatial'`) or document order (`'stored'`). |
|
|
144
|
+
| `defaultStageSize` | `{ width: number; height: number }` | `{ width: 1280, height: 720 }` | Target stage size in pixels for document slides. |
|
|
145
|
+
| `includeHidden` | `boolean` | `false` | Keeps `[draft]` and `[hidden]` slides when `true`. |
|
|
146
|
+
| `title` | `string` | First visible slide title | Overrides the projected deck title. |
|
|
147
|
+
| `getHeadingLevel` | `(node: DeckJsonNode) => number \| null` | Built-in heading resolver | Resolves heading levels for custom schemas. |
|
|
148
|
+
| `isHiddenSlide` | `(candidate: DeckHiddenSlideCandidate) => boolean` | `[draft]` / `[hidden]` prefix | Custom predicate for hidden slides and frames. |
|
|
149
|
+
| `isSpeakerNote` | `(node: DeckJsonNode, context: DeckSpeakerNoteContext) => boolean` | Built-in note matchers | Custom predicate for speaker note blocks and stickies. |
|
|
150
|
+
| `types` | `Partial<DeckNodeTypes>` | Standard Plate keys | Overrides node type names for custom schemas. |
|
|
151
|
+
|
|
152
|
+
### `DeckPresenter`
|
|
153
|
+
|
|
154
|
+
Full-screen modal portal stage that renders projected slides with `EditorStatic`.
|
|
155
|
+
|
|
156
|
+
| Prop | Type | Default | Description |
|
|
157
|
+
| --- | --- | --- | --- |
|
|
158
|
+
| `open` | `boolean` | Required | Controls whether the presentation overlay is mounted. |
|
|
159
|
+
| `onOpenChange` | `(open: boolean) => void` | Required | Called when the presenter closes via button or `Escape`. |
|
|
160
|
+
| `editor` | `Editor` | Context editor | Optional editor instance when rendered outside `EditorRoot`. |
|
|
161
|
+
| `presentation` | `readonly BasePluginInput[]` | `DEFAULT_DECK_PRESENTATION` | Static plugin kit passed to `EditorStatic`. |
|
|
162
|
+
| `projection` | `'accepted' \| 'proposed'` | `'accepted'` | Authored-change view used when `AuthoredPlugin` is active. |
|
|
163
|
+
| `options` | `ProjectDeckOptions` | `{}` | Options forwarded to `projectDeck`. |
|
|
164
|
+
| `channelId` | `string` | `undefined` | Enables cross-tab slide and blackout sync through `createDeckSyncChannel`. |
|
|
165
|
+
| `initialSlideId` | `string` | First slide | Slide id to display when opening the presenter. |
|
|
166
|
+
|
|
167
|
+
### `printDeck(editor, options?)`
|
|
168
|
+
|
|
169
|
+
Renders the projected deck into a hidden 16:9 print iframe, waits for fonts and images, triggers `window.print()`, and cleans up on `afterprint`. Accepts all `ProjectDeckOptions` plus `includeNotes`, `presentation`, and `projection` (defaults to `'accepted'`).
|
|
170
|
+
|
|
171
|
+
## Pro and Business
|
|
172
|
+
|
|
173
|
+
Plate Pro ships `@plate-pro/deck` for self-hosted HTML and print slide exports, presenter-to-audience HTTP follow rooms on Cloudflare Durable Objects, and `plate-deploy-cloudflare` Worker recipes. Plate Business adds `@plate-business/security-kernel` for fail-closed speaker-note and section RBAC stripping, forensic slide watermarks, zero-network redacted 16:9 PDF export, and hash-chained WORM audit logs, verified in CI by `plate verify --suite sync-security`. See [Pricing](/pricing).
|
package/dist/docs/details.md
CHANGED
|
@@ -322,3 +322,7 @@ _Verified by 11 automated tests._
|
|
|
322
322
|
- [x] Keeps the caret on the visible Summary after deleting the selected block following closed Details (`EDIT-DETAILS-BS-AFTER-CLOSED-001`)
|
|
323
323
|
- [x] Keeps the first of the whole paragraphs deleted after closed Details, with the caret in it (`EDIT-DETAILS-BS-AFTER-CLOSED-001`)
|
|
324
324
|
- [x] Returns Backspace after closed Details to its visible summary (`EDIT-DETAILS-BS-AFTER-CLOSED-001`)
|
|
325
|
+
|
|
326
|
+
## Pro and Business
|
|
327
|
+
|
|
328
|
+
Plate Pro ships `@plate-pro/procedures` for collapsible procedure branches combining `DetailsKit`, `CalloutKit`, and `FieldKit` with canonical SHA-256 revision pinning and Stop-Step DAG enforcement. See [Pricing](/pricing).
|
package/dist/docs/diff.md
CHANGED
|
@@ -104,3 +104,7 @@ See the interactive [Merge demo](/docs/examples/merge) for `<MergeView>` conflic
|
|
|
104
104
|
|
|
105
105
|
- Use `platejs/diff` when the user compares saved snapshots or merges diverged drafts and applies the chosen result directly in one undoable step.
|
|
106
106
|
- Use [Authored Changes](/docs/authored-changes) (`AuthoredPlugin.api.proposeComparison(...)`) and [Suggestions](/docs/suggestion) when edits must stay inside the document as attributed review marks for collaborative accept/reject workflows.
|
|
107
|
+
|
|
108
|
+
## Pro and Business
|
|
109
|
+
|
|
110
|
+
Plate Pro ships `@plate-pro/change-requests` for Word `.docx` tracked-change intake (propose-over-current and direct redline modes with `lossy-content` diagnostics) and headless multi-author change-request review helpers built on `platejs/diff` and `AuthoredPlugin`. See [Pricing](/pricing).
|
package/dist/docs/discussion.md
CHANGED
|
@@ -178,3 +178,7 @@ Install the copied kit in the editor plugin list. It includes `CommentKit` and t
|
|
|
178
178
|
### `DiscussionSlots`
|
|
179
179
|
|
|
180
180
|
For custom composition, pass the complete value to `CommentsPlugin.configure({ slots: DiscussionSlots })`. It owns the shared discussion index, block triggers, review cards, and Floating Discussion together.
|
|
181
|
+
|
|
182
|
+
## Pro and Business
|
|
183
|
+
|
|
184
|
+
Plate Pro ships `@plate-pro/floating-discussion` for wide-screen margin comment and authored-suggestion columns (`expanded`, `minimal`, and `hidden` density modes, Paged and Pageless zoom geometry, and a `platejs/sync` realtime comment bridge), plus the `Potion v2` and `Paper v2` flagship templates. Plate Business adds `@plate-business/security-kernel` (`policy.comments` quote redaction, internal-only visibility isolation, `actorId` spoofing refusal, and hash-chained WORM comment audits) verified by `plate verify` CI. See [Pricing](/pricing).
|
package/dist/docs/dnd.md
CHANGED
|
@@ -346,3 +346,7 @@ Takes the same input as `move` and keeps the source.
|
|
|
346
346
|
### DOM drag API
|
|
347
347
|
|
|
348
348
|
[`editor.api.dom.drag.start`](/docs/api/dom#drag-and-drop), `editor.api.dom.drag.indicate` and `editor.api.dom.drag.resolveTarget` drive a drag from code, such as a custom handle that is not a native draggable.
|
|
349
|
+
|
|
350
|
+
## Pro and Business
|
|
351
|
+
|
|
352
|
+
Plate Pro ships the `Potion v2` and `Paper v2` flagship templates with block drag handles, multi-column drop layouts, and cross-browser Playwright checks in `@plate-pro/playwright-suite`. See [Pricing](/pricing).
|
package/dist/docs/docx.md
CHANGED
|
@@ -265,6 +265,8 @@ In detached mode, `formats.docx.encode` receives `readPlugin()` returning `undef
|
|
|
265
265
|
|
|
266
266
|
Choose `accepted` to omit pending changes, `proposed` to apply them, or `review` to write Word tracked-change markup. Accepted and proposed exports warn about the pending changes they decided.
|
|
267
267
|
|
|
268
|
+
To produce a clean external copy without comments, pending suggestions, review XML parts, or retained source packages, pass `projection: 'accepted'` and omit both `comments` and `source`. The copied `ExportToolbarButton` provides a **Clean copy** switch in its Word export popover wired to this exact export path.
|
|
269
|
+
|
|
268
270
|
A review file contains what Word displays: text, comments, and tracked revisions with their authors. It also stores each main-root top-level block that holds a pending change, with the document's review records, in a custom XML part, and binds each block to its Word paragraphs with a bookmark when that block compiles once on its own without sharing an enclosing table or container with a foreign root or another main block (blocks that cannot bind safely fall back to Word tracked revisions). Importing the file restores the bound blocks Word left unchanged, as [Import tracked revisions](#import-tracked-revisions) describes. Named roots emitted by a plugin's `formats.docx` encoder (using `contentRoot(slot)` and `encodeBlocks`) export their text, comments, and tracked revisions to Word, while unrendered named roots and document metadata are omitted. To keep named roots and document metadata intact for round-trip, save `editor.read.value()` as JSON beside the file, as [Serializing](/docs/serializing) describes.
|
|
269
271
|
|
|
270
272
|
### Define DOCX mappings
|
|
@@ -512,3 +514,7 @@ exportDocx(
|
|
|
512
514
|
A successful result (`ok: true`) contains `blob` and `readonly DocxWarningDiagnostic[]` (warnings only). A failed result (`ok: false`) contains a nonempty error-first diagnostic tuple (`readonly [DocxErrorDiagnostic, ...DocxDiagnostic[]]`) and no `blob`. `platejs/docx/export` exports `DocxDiagnostic`, `DocxErrorDiagnostic`, and `DocxWarningDiagnostic`.
|
|
513
515
|
|
|
514
516
|
See [Authored Changes](/docs/authored-changes) for the editor's accepted, proposed, and review projections.
|
|
517
|
+
|
|
518
|
+
## Pro and Business
|
|
519
|
+
|
|
520
|
+
Plate Pro ships `@plate-pro/change-requests` for Word `.docx` tracked-change intake (`propose` and `direct` redline modes with `lossy-content` diagnostics) and `@plate-pro/disclosure` for clean audience DOCX exports. See [Pricing](/pricing).
|
package/dist/docs/emoji.md
CHANGED
|
@@ -63,7 +63,7 @@ _Registry item `emoji-toolbar-button`: `npx shadcn@latest add @plate/emoji-toolb
|
|
|
63
63
|
|
|
64
64
|
| Layer | Owner | What It Does |
|
|
65
65
|
|-------|-------|--------------|
|
|
66
|
-
| `emoji` | Registry | Defines `EmojiPlugin` (with closing-colon `:shortcode:` input rule) and `EmojiCombobox` (with its `:` trigger policy
|
|
66
|
+
| `emoji` | Registry | Defines `EmojiPlugin` (with closing-colon `:shortcode:` input rule) and `EmojiCombobox` (with its `:` trigger policy). |
|
|
67
67
|
| `emoji-data` | Registry | Loads Emojibase once, joins GitHub shortcodes, ranks searches, and stores browser-local frequent picks and skin tone. |
|
|
68
68
|
| `emoji-picker` | Registry UI | Owns the popover, category tabs, search results, frimousse grid, skin tone selector, and frequent picks. |
|
|
69
69
|
| `emoji-toolbar-button` | Registry UI | Opens `EmojiPicker` from the toolbar and inserts the pick. |
|
|
@@ -128,7 +128,7 @@ input rule.
|
|
|
128
128
|
|------|--------|
|
|
129
129
|
| Type `:` | `EmojiCombobox` `trigger` prop. |
|
|
130
130
|
| Previous character must match `/^\s?$/` | Start of block or whitespace by default. |
|
|
131
|
-
| Not inside code | `
|
|
131
|
+
| Not inside code | Plate's `inputRuleVeto` blocks both the `:` popup and closing-colon conversion inside code blocks and inline code. |
|
|
132
132
|
| Type the shortcode | `queryPattern` admits letters, digits, `_`, `+`, `-` and `:`; a space closes the popup. |
|
|
133
133
|
| Close with `:` | `EmojiPlugin`'s input rule replaces an exact loaded shortcode such as `:smile:` immediately, undoable in one step. |
|
|
134
134
|
| Search emoji data | The `:` popup calls `useEmojiSearch(query)`, applies the persisted skin tone, and displays each match's `:shortcode:`. |
|
package/dist/docs/equation.md
CHANGED
|
@@ -279,3 +279,7 @@ _Verified by 4 automated tests._
|
|
|
279
279
|
- [x] DeleteBackward from the next block selects the equation instead of deleting through it (`EDIT-MATH-BLOCK-BS-START-001`)
|
|
280
280
|
- [x] Undo and redo after saving a new block equation keep its editor closed and take one step per press (`EDIT-MATH-REDO-001`)
|
|
281
281
|
- [x] Undo and redo after saving a new inline equation keep its editor closed and take one step per press (`EDIT-MATH-INLINE-UNDO-001`)
|
|
282
|
+
|
|
283
|
+
## Pro and Business
|
|
284
|
+
|
|
285
|
+
Plate Pro ships `@plate-pro/docs-press` for Typst `.typ` and CSS `@page` PDF publishing of documents containing equations, plus the `Potion v2` and `Paper v2` flagship templates. See [Pricing](/pricing).
|
|
@@ -46,3 +46,7 @@ Type in either editor to see remote document and cursor updates. Click **Go offl
|
|
|
46
46
|
## Related
|
|
47
47
|
|
|
48
48
|
- [Sync](/docs/sync) covers server setup, `webSocketTransport`, Cloudflare Durable Objects, kept-conflict review, and React hooks.
|
|
49
|
+
|
|
50
|
+
## Pro and Business
|
|
51
|
+
|
|
52
|
+
Plate Pro ships `@plate-pro/collab-do` for production Cloudflare Durable Object rooms with D1 projection, plus the `Potion v2` and `Paper v2` flagship templates. Plate Business adds `@plate-business/security-kernel` for wire-level read redaction and WORM audit trails. See [Pricing](/pricing).
|
|
@@ -2,37 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
Export a Plate document to HTML, Markdown, Word, clipboard Markdown, or print.
|
|
4
4
|
|
|
5
|
-
The registry `export-toolbar-button`
|
|
6
|
-
|
|
7
|
-
browser's print and Save as PDF dialog. The
|
|
5
|
+
The registry `export-toolbar-button` opens an anchored export popover to
|
|
6
|
+
download the current document as Word, HTML, or Markdown, copy Markdown to the
|
|
7
|
+
clipboard, or print through the browser's print and Save as PDF dialog. The
|
|
8
|
+
demo mounts it in the fixed toolbar.
|
|
8
9
|
|
|
9
10
|
## Demo
|
|
10
11
|
|
|
11
12
|
_Example `export-demo` in the Plate repository: `apps/www/src/registry/examples/export-demo.tsx`._
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
_Open Export to pick a format, configure page layout, HTML theme, or Clean copy, and download or copy Markdown._
|
|
14
15
|
|
|
15
16
|
## Toolbar source
|
|
16
17
|
|
|
17
18
|
Install the [Export Toolbar Button](/docs/components/export-toolbar-button)
|
|
18
|
-
component to add the
|
|
19
|
+
component to add the export popover to an editor toolbar.
|
|
19
20
|
|
|
20
21
|
_Registry item `export-toolbar-button`: `npx shadcn@latest add @plate/export-toolbar-button`._
|
|
21
22
|
|
|
22
23
|
Pass an optional `filename` prop to override the download stem and HTML title.
|
|
23
|
-
Without `filename`, the
|
|
24
|
+
Without `filename`, the popover names downloads after the first heading in the
|
|
24
25
|
exported projection (using `proposed` for `review` exports) and falls back to
|
|
25
|
-
`document`.
|
|
26
|
+
`document`. A live summary line above the footer previews the filename and
|
|
27
|
+
included metadata before export.
|
|
26
28
|
|
|
27
29
|
## Export formats
|
|
28
30
|
|
|
29
|
-
| Action
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
31
|
+
| Format / Action | Implementation | Output |
|
|
32
|
+
| ------------------- | -------------- | ------ |
|
|
33
|
+
| Word (`.docx`) | `exportDocx(model, { comments, pageNumber, pageSize, projection, source, styles })` from `platejs/docx/export` (omits `styles` when `source` is retained for `review`) | `<stem>.docx` |
|
|
34
|
+
| PDF / Print | `renderStaticHtml(...)` rendered in a light-mode sandboxed hidden iframe with `@page` size (defaulting to persisted `PaginationPlugin` `layout.page` settings when present, or `Letter`/`A4`), optional `@bottom-center` page numbers, and `window.print()` | Browser print dialog |
|
|
35
|
+
| Markdown (`.md`) | `model.plugin(MarkdownPlugin).api.serialize({ projection })` (shown when `MarkdownPlugin` is installed) | `<stem>.md` |
|
|
36
|
+
| HTML (`.html`) | `renderStaticHtml(model, { component: EditorStatic, presentation: BaseEditorKit, projection })` from `platejs/static`, with selectable **Theme** (`Match app`, `Light`, `Dark`) and DOM-matched CSS pruning | `<stem>.html` |
|
|
37
|
+
| Copy MD | `model.plugin(MarkdownPlugin).api.serialize({ projection })` written via `navigator.clipboard.writeText` (footer button when `MarkdownPlugin` is installed; forces `projection: 'accepted'` while Word **Clean copy** is enabled) | Clipboard text |
|
|
38
|
+
|
|
39
|
+
Format-specific controls adapt to the selected format:
|
|
40
|
+
|
|
41
|
+
- **Word (`.docx`)**: **Clean copy** forces `projection: 'accepted'`, skips `toDocxComments`, and omits retained Word source packages so external copies contain accepted text only. **Page size** defaults to **Original** when a retained Word source is present (keeping exact byte-for-byte reuse on unchanged documents) or **Letter** otherwise, with **Letter** and **A4** presets. **Page numbers** enables `pageNumber: true` to add a page-number footer.
|
|
42
|
+
- **PDF / Print**: **Page size** defaults to **Document** when persisted `PaginationPlugin` `layout.page` settings exist (or **Letter** otherwise) with **Letter** and **A4** presets. **Page numbers** adds CSS Paged Media `@bottom-center` page numbering (`counter(page) / counter(pages)`).
|
|
43
|
+
- **HTML (`.html`)**: **Theme** chooses **Match app**, **Light**, or **Dark**, independent of the host app's current dark mode setting.
|
|
36
44
|
|
|
37
45
|
Every format captures the same complete document and explicit authored
|
|
38
46
|
projection from `useModelEditor()`. Export reads model content rather than the
|
|
@@ -47,29 +55,27 @@ static component, HTML export draws its content without one and adds a
|
|
|
47
55
|
`missing-static-presentation` warning. Word export compiles the model directly
|
|
48
56
|
to OOXML through installed `formats.docx` mappings and optional typed `styles`.
|
|
49
57
|
|
|
50
|
-
The HTML file
|
|
51
|
-
classes. Cross-origin stylesheets stay as links. Print / Save as PDF always
|
|
52
|
-
prints on white paper regardless of the app's dark mode setting.
|
|
58
|
+
The HTML file prunes unused host-site CSS rules against the rendered document while keeping theme/base layers, `:root`/`.dark` tokens, `@font-face`, and matched Tailwind rules, and copies the page's `body` classes. Cross-origin stylesheets stay as links. Print / Save as PDF always prints on white paper inside a sandboxed hidden iframe regardless of the app's dark mode setting.
|
|
53
59
|
|
|
54
60
|
## Suggestions
|
|
55
61
|
|
|
56
|
-
When the document has unresolved [suggestions](/docs/suggestion)
|
|
57
|
-
|
|
62
|
+
When the document has unresolved [suggestions](/docs/suggestion) and **Clean
|
|
63
|
+
copy** is off, the popover shows a **Suggestions** selector:
|
|
58
64
|
|
|
59
|
-
| Choice
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
65
|
+
| Choice | Projection | Formats | Result |
|
|
66
|
+
| --------------- | ---------- | ------------------- | -------------------------------------------------- |
|
|
67
|
+
| Track changes | `review` | Word | Writes pending suggestions as Word tracked changes |
|
|
68
|
+
| Include changes | `proposed` | All formats | The document with pending suggestions applied |
|
|
69
|
+
| Exclude changes | `accepted` | All formats | The document without pending suggestions |
|
|
63
70
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
revisions. A conflict has no faithful Word revision, so review export returns an
|
|
68
|
-
error until the conflict is resolved.
|
|
71
|
+
Word defaults to **Track changes** (`review`), while HTML, Markdown, and PDF /
|
|
72
|
+
Print follow the mounted view. A conflict has no faithful Word revision, so
|
|
73
|
+
review export returns an error until the conflict is resolved.
|
|
69
74
|
|
|
70
|
-
Without unresolved suggestions, Word export uses `review
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
Without unresolved suggestions, Word export uses `review` when **Clean copy**
|
|
76
|
+
is off. A retained, unchanged imported DOCX with default **Original** page size
|
|
77
|
+
and **Page numbers** off returns byte for byte. Each exporter returns
|
|
78
|
+
diagnostics, which the popover presents as warning or error toasts.
|
|
73
79
|
|
|
74
80
|
## DOCX presentation
|
|
75
81
|
|
|
@@ -84,3 +90,7 @@ _Registry item `docx-export`: `npx shadcn@latest add @plate/docx-export`._
|
|
|
84
90
|
- [Markdown](/docs/markdown) covers Markdown serialization.
|
|
85
91
|
- [Static Rendering](/docs/static) covers static rendering and HTML serialization.
|
|
86
92
|
- [Authored Changes](/docs/authored-changes) covers visible HTML/Markdown projections, authored JSON, and DOCX review.
|
|
93
|
+
|
|
94
|
+
## Pro and Business
|
|
95
|
+
|
|
96
|
+
Plate Pro ships `@plate-pro/docs-press` for `/llms.txt`, `.md`, CSS `@page`, and Typst PDF publishing workers, `@plate-pro/emailpress` for single-source Bento newsletter compilation into Outlook/Gmail/dark-mode table HTML email with Resend Batch, Cloudflare D1, and RFC 8058 one-click unsubscribe, plus `@plate-pro/disclosure` for clean audience exports across DOCX, HTML, Markdown, plain text, and JSON. Plate Business adds `@plate-business/compliance-pdf` for zero-network AST-redacted compliance PDFs with forensic watermarks and signed SHA-256 attestations, plus `@plate-business/security-kernel` server-side subscriber-tier paywall stripping, per-grant broadcast isolation, `pep1.` publication seals, and `plate verify` leak CI probes. See [Pricing](/pricing).
|
|
@@ -44,3 +44,7 @@ if (result.kind === "ready") {
|
|
|
44
44
|
If the live document changes in an unrelated paragraph while you review conflicts, deterministic conflict IDs keep your existing choices intact. If the live document changes before `applyDiff` runs, `applyDiff` returns `{ kind: "stale" }` without overwriting newer edits.
|
|
45
45
|
|
|
46
46
|
See [Version History](/docs/examples/version-history) for two-way revision comparison and selective restore, or [Authored Changes](/docs/authored-changes) to review changes as tracked suggestions instead of applying them directly.
|
|
47
|
+
|
|
48
|
+
## Pro and Business
|
|
49
|
+
|
|
50
|
+
Plate Pro ships `@plate-pro/change-requests` for Word `.docx` tracked-change intake and multi-author change-request review helpers built on `platejs/diff` and `AuthoredPlugin`. See [Pricing](/pricing).
|
|
@@ -70,3 +70,7 @@ const reloaded = createEditor({
|
|
|
70
70
|
The fresh editor starts with empty local undo and redo stacks. If the document has comments, save `comments.anchors()` with the same revision, keep thread rows in your tables, and load both through `initialComments: { anchors, threads }`; document undo does not rewind the discussion.
|
|
71
71
|
|
|
72
72
|
See [Authored Changes](/docs/authored-changes) to propose and review changes as suggestions instead of applying them directly.
|
|
73
|
+
|
|
74
|
+
## Pro and Business
|
|
75
|
+
|
|
76
|
+
Plate Pro ships `@plate-pro/change-requests` for multi-author change-request review and Word `.docx` redline intake. Plate Business adds `@plate-business/security-kernel` for revision-pinned approval gates and crash-safe SHA-256 WORM audit logs. See [Pricing](/pricing).
|
package/dist/docs/field.md
CHANGED
|
@@ -677,3 +677,7 @@ Plain text, through `serializePlainText` from `platejs`, writes the same text as
|
|
|
677
677
|
| `FIELD_TESTS` | `platejs/field` | The tests a condition may use on each kind. |
|
|
678
678
|
| `FieldAccess` | `platejs/field/react` | Live editor access state (`locked`, `waitsForReview`) returned alongside `FieldRead` by `useFieldRead`. |
|
|
679
679
|
| `FieldElement`, `FieldSettings`, `FieldPatch`, `FieldRead`, `FieldCondition`, `FieldConditionTest`, `FieldProblem`, `FieldKind`, `FieldTest`, `FieldValue`, `FieldOption`, `FieldSubmission`, `FieldRefusal`, `FieldApplyResult`, `FieldAnswer` | `platejs/field` | Field types. |
|
|
680
|
+
|
|
681
|
+
## Pro and Business
|
|
682
|
+
|
|
683
|
+
For conditional `if`/`else` clauses, repeating table rows, schema-derived intake forms, and local batch mail-merge over `platejs/field` and `platejs/lock`, install the MIT `@plate/template` registry item (previewed at `/blocks/template-demo`). Plate Pro ships `@plate-pro/templates` (Cloudflare Worker/D1 intake, mail-merge, and sequential freeze-at-send signing handlers) and `@plate-pro/procedures` for conditional workflow branch gating built on `platejs/field`. Plate Business adds `@plate-business/security-kernel` (`SchemaFillFirewall`, zero-oracle server clause pruning, cross-row mail-merge isolation, and `pts1.` WORM signing attestation alongside section and field ACL redaction) and `plate verify` CI probes. See [Pricing](/pricing).
|
package/dist/docs/footnote.md
CHANGED
|
@@ -534,3 +534,7 @@ _Verified by 4 automated tests._
|
|
|
534
534
|
- [Markdown](/docs/markdown)
|
|
535
535
|
- [Navigation Feedback](/docs/navigation-feedback)
|
|
536
536
|
- [Editor Methods](/docs/editor-methods)
|
|
537
|
+
|
|
538
|
+
## Pro and Business
|
|
539
|
+
|
|
540
|
+
For multi-target Typst, CSP-locked Tufte HTML, and Word OOXML `SEQ`/`REF` citation compilation with BibTeX and CSL styles, Plate Pro ships `@plate-pro/citations` alongside `@plate-pro/sources` (cross-document backlinks and drift checks) and `@plate-pro/docs-press` (Typst and CSS `@page` PDF publishing). For self-hosted dataroom ethical-wall isolation, corpus-grounded citation admission (`verifyCitations`), WORM citation audit chains, and `plate verify` hallucination probes, Plate Business ships `@plate-business/security-kernel` and `@plate-business/security-proof`. See [Pricing](/pricing).
|
|
@@ -117,7 +117,7 @@ export function PainterButton() {
|
|
|
117
117
|
| A link | The source's link is not copied. A painted link keeps its `url`. |
|
|
118
118
|
| A target that cannot hold part of the look | Each text and block takes every copied style it can hold where it sits, and skips the rest. |
|
|
119
119
|
| Suggesting mode | Records the change as suggestions. |
|
|
120
|
-
| Touch or pen |
|
|
120
|
+
| Touch or pen | Tap paints the word under the tap; touch long-press selection paints the selected range. Cancelled touch scrolls leave the brush armed. |
|
|
121
121
|
| A read-only view | Paints nothing, and `Mod+Alt+V` and `Escape` do nothing. Only the brush button puts an armed brush down. |
|
|
122
122
|
| `Escape` | Puts an armed brush down in an editable view. With the brush down, `Escape` reaches other handlers. |
|
|
123
123
|
|
package/dist/docs/html.md
CHANGED
|
@@ -415,3 +415,7 @@ Direct parse options require `plugins` and accept `schema`, `limits`,
|
|
|
415
415
|
`plugins` and accept `schema`, `projection`, and `lossPolicy`. Installed editor
|
|
416
416
|
methods omit `plugins` and `schema` because the plugin captures them from the
|
|
417
417
|
editor.
|
|
418
|
+
|
|
419
|
+
## Pro and Business
|
|
420
|
+
|
|
421
|
+
Plate Pro ships `@plate-pro/docs-press` for CSS `@page` print stylesheets and self-hosted PDF workers, plus `@plate-pro/disclosure` for clean audience HTML exports. Plate Business adds `@plate-business/compliance-pdf` for zero-network AST-redacted HTML-to-PDF rendering with forensic watermarks and signed SHA-256 attestations. See [Pricing](/pricing).
|
package/dist/docs/index.md
CHANGED
|
@@ -54,6 +54,10 @@ Building with Claude Code, Codex, or Cursor? Open [Agents](/docs/agents) for the
|
|
|
54
54
|
- [Plugins](/docs/plugins): Compose blocks, marks, tables, mentions, collaboration, AI, and Markdown or DOCX codecs.
|
|
55
55
|
- [Components](/docs/components): Inspect copied editor containers, toolbars, toolbar buttons, and node elements.
|
|
56
56
|
|
|
57
|
+
## Pro and Business
|
|
58
|
+
|
|
59
|
+
Every `platejs` package, plugin, codec, and copied UI kit stays MIT open source. For teams shipping full workspaces faster, Plate Pro adds the `Potion v2` and `Paper v2` flagship templates, copy-owned `@plate-pro/*` slices, and self-host deploy and upgrade skills. For regulated apps, Plate Business adds self-hosted `@plate-business/security-kernel`, `@plate-business/compliance-pdf`, and `plate verify` CI on your own infrastructure. See [Pricing](/pricing).
|
|
60
|
+
|
|
57
61
|
## Credits
|
|
58
62
|
|
|
59
63
|
- [shadcn/ui](https://ui.shadcn.com/): Open-code component model and CLI.
|
package/dist/docs/ink.md
CHANGED
|
@@ -8,6 +8,8 @@ _Turn on Draw to sketch or highlight over text and images, then click Send to pa
|
|
|
8
8
|
|
|
9
9
|
Open [the full-page Ink demo](/blocks/ink-demo) to test drawing over text and media, blended highlighters, stylus eraser-end erasing, atomic delete and undo, and 1-tap Send to `AgentChat` with local persistence. The demo saves its document and comment threads under one local storage key. Configure your AI Gateway API key in Settings (or `AI_GATEWAY_API_KEY` on the server) before sending ink to the agent.
|
|
10
10
|
|
|
11
|
+
To see client-side handwriting synthesis on top of `InkPlugin`, open [the PenGPT notebook demo](/blocks/pengpt-demo) (`npx shadcn@latest add @plate/pengpt`), which adds a ruled `PenSheetPlugin` canvas and runs a 6 MB handwriting model in a browser Web Worker.
|
|
12
|
+
|
|
11
13
|
## Features
|
|
12
14
|
|
|
13
15
|
- Floating bottom `InkDock` with Pen, Highlighter, Eraser, and Lasso tools, an Okabe-Ito colorblind-safe pen palette plus an adaptive `"Ink"` (`currentColor`) swatch, a custom color picker, a non-blocking width and **Finger draws** flyout, a 3-state **Dim** toggle (`hide`, `dim`, `show`) for addressed ink, a 1-tap author-scoped **Send** button with round tracking and `"Sent"` feedback, an optional host-registered **Approve** button (`registerInkApproveHandler`), and a collapse toggle. Brush colors and widths persist per editor across toggles while tool state stays per mounted view.
|
|
@@ -260,3 +262,7 @@ Headless plugin (`platejs/ink`) that uses core element IDs and owns the `ink-mar
|
|
|
260
262
|
| `registerInkSendHandler(editor, handler)`, `registerInkApproveHandler(editor, handler)` | `ink-dock.tsx` | Reactive host hooks that enable the dock's **Send** and optional **Approve** actions without coupling `InkDock` to a specific chat or workflow component. |
|
|
261
263
|
| `createEditorAgent` / `useEditorAgent({ ink: true })` | `platejs/ai`, `platejs/ai/react` | Opts into `<prefix>_read_ink` (`author?`, `roundId?`, `includePrior?`, returning `clusters`, `suggestions`, and pure-JS `svg` when Canvas 2D PNGs are absent, or `code: 'denied'` when `BaseInkPlugin` is uninstalled), `<prefix>_set_ink_digitized` (`roundId?`, `changeIds?`, `threadIds?`), and `<prefix>_comment` (`kind?: 'answer' \| 'note' \| 'question'` and `CommentInvalidReason` errors). Bridges mounted `InkPlugin.api.images` in React and strips raw PNG data URLs from WebMCP tool outputs. |
|
|
262
264
|
| `createSyncServerAgent(server, { ink: true, ... })` | `platejs/ai` | Enables synchronous single-revision `<prefix>_read_ink` (returning pure-JS `svg`, `clusters`, `suggestions`, and `blockRevisions`) and `<prefix>_set_ink_digitized` on an authoritative sync room under `access: 'suggest'` or `'edit'` (edit-only; anchored comments stay client-side until synced comment records land). |
|
|
265
|
+
|
|
266
|
+
## Pro and Business
|
|
267
|
+
|
|
268
|
+
Plate Pro ships `@plate-pro/ink-loop` for an end-to-end handwriting annotation and server-side AI review room built on `BaseInkPlugin`, `createSyncServerAgent({ ink: true })`, and `@plate-pro/collab-do`, plus `@plate-pro/playwright-suite` for automated Ink draw-and-send browser proofs. See [Pricing](/pricing).
|
|
@@ -331,9 +331,7 @@ export default function App() {
|
|
|
331
331
|
<div style={{ padding: '8px 0' }}>
|
|
332
332
|
<button
|
|
333
333
|
onClick={() => {
|
|
334
|
-
editor.update(
|
|
335
|
-
tx.value.replace({ children: initialValue });
|
|
336
|
-
});
|
|
334
|
+
editor.update.value.replace({ children: initialValue });
|
|
337
335
|
}}
|
|
338
336
|
style={{
|
|
339
337
|
padding: '4px 8px',
|
|
@@ -381,7 +379,7 @@ You've now set up a basic Plate editor manually! From here, you can:
|
|
|
381
379
|
* For a quick start with pre-built components, consider using [Plate UI](/docs/installation/plate-ui)
|
|
382
380
|
* Or continue styling manually using CSS, CSS-in-JS libraries, or your preferred styling solution
|
|
383
381
|
* **[Add Plugins](/docs/plugins):** Plate has a rich ecosystem of plugins for features like tables, mentions, images, lists, and more. Install their packages (e.g., `platejs`) and add them to your `plugins` array.
|
|
384
|
-
* **[Build a Toolbar](/docs/toolbar):** Create React components for toolbar buttons that use the [Editor Transforms](/docs/api/editor-transforms) to apply formatting (e.g., `editor.update.bold.toggle()`, `editor.plugin(HeadingPlugin).update.toggle({ level: 1 })`). You can also use the editor state with the [Editor API](/docs/api).
|
|
382
|
+
* **[Build a Toolbar](/docs/toolbar):** Create React components for toolbar buttons that use the [Editor Transforms](/docs/api/editor-transforms) to apply formatting (e.g., `editor.update.bold.toggle()`, `editor.plugin(HeadingPlugin).update.toggle({ level: 1 })`). You can also use the editor state with the [Editor API](/docs/api/editor-api).
|
|
385
383
|
* **Learn More:**
|
|
386
384
|
* [Editor Configuration](/docs/editor)
|
|
387
385
|
* [Plugin Configuration](/docs/plugin)
|
|
@@ -330,9 +330,7 @@ function MyEditor({ value }: { value: Value }) {
|
|
|
330
330
|
<ToolbarButton
|
|
331
331
|
className="px-2"
|
|
332
332
|
onClick={() => {
|
|
333
|
-
editor.update(
|
|
334
|
-
tx.value.replace({ children: initialValue });
|
|
335
|
-
});
|
|
333
|
+
editor.update.value.replace({ children: initialValue });
|
|
336
334
|
}}
|
|
337
335
|
>
|
|
338
336
|
Reset
|