platejs 54.0.0-beta.13 → 54.0.0-beta.14

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.
Files changed (221) hide show
  1. package/dist/{EditorStatic-CKG5xM3y.d.ts → EditorStatic-eXOA489B.d.ts} +4 -4
  2. package/dist/ai/index.d.ts +2 -2
  3. package/dist/ai/lib/aiDraftSession.js +9 -7
  4. package/dist/ai/lib/aiPolicy.internal.js +43 -6
  5. package/dist/ai/lib/editorAgent.js +30 -21
  6. package/dist/ai/lib/editorAgentSync.internal.js +2 -2
  7. package/dist/ai/lib/lockedContext.js +5 -4
  8. package/dist/ai/react/copilotInline.internal.js +6 -5
  9. package/dist/ai/react/index.d.ts +7 -7
  10. package/dist/ai/react/useEditorAgent.js +14 -3
  11. package/dist/authored/index.d.ts +4 -4
  12. package/dist/{authored-CJL7S8qI-BxC9ip4d.d.ts → authored-qetvpvU--DSWESzxK.d.ts} +3 -3
  13. package/dist/clipboard-format-key-BBu85J9m-BLhtd159.d.ts +1 -0
  14. package/dist/code-block/codemirror/index.d.ts +2 -2
  15. package/dist/{comment-anchor.internal-DTBP1huU.d.ts → comment-anchor.internal-CoNK9gTD.d.ts} +2 -2
  16. package/dist/compiler/index.d.ts +3 -3
  17. package/dist/{core-CTB0OBoh.d.ts → core-By92GWYW.d.ts} +45 -20
  18. package/dist/diff/index.d.ts +2 -2
  19. package/dist/docs/agents/skills.md +6 -2
  20. package/dist/docs/agents.md +1 -1
  21. package/dist/docs/ai-agents.md +8 -4
  22. package/dist/docs/ai.md +5 -0
  23. package/dist/docs/api/plate.md +15 -7
  24. package/dist/docs/api/react-hooks.md +32 -2
  25. package/dist/docs/authored-changes.md +4 -0
  26. package/dist/docs/block-menu.md +4 -0
  27. package/dist/docs/board.md +4 -0
  28. package/dist/docs/callout.md +63 -9
  29. package/dist/docs/collaboration.md +6 -1
  30. package/dist/docs/combobox.md +9 -2
  31. package/dist/docs/comment.md +4 -0
  32. package/dist/docs/components/toolbar-buttons.md +1 -1
  33. package/dist/docs/copilot.md +4 -0
  34. package/dist/docs/deck.md +173 -0
  35. package/dist/docs/details.md +4 -0
  36. package/dist/docs/diff.md +4 -0
  37. package/dist/docs/discussion.md +4 -0
  38. package/dist/docs/dnd.md +4 -0
  39. package/dist/docs/docx.md +6 -0
  40. package/dist/docs/emoji.md +2 -2
  41. package/dist/docs/equation.md +4 -0
  42. package/dist/docs/examples/collaboration-example.md +4 -0
  43. package/dist/docs/examples/export.md +40 -28
  44. package/dist/docs/examples/merge.md +4 -0
  45. package/dist/docs/examples/version-history.md +4 -0
  46. package/dist/docs/field.md +4 -0
  47. package/dist/docs/footnote.md +4 -0
  48. package/dist/docs/format-painter.md +1 -1
  49. package/dist/docs/html.md +4 -0
  50. package/dist/docs/index.md +4 -0
  51. package/dist/docs/ink.md +6 -0
  52. package/dist/docs/installation/manual.md +2 -4
  53. package/dist/docs/installation/next.md +1 -3
  54. package/dist/docs/installation/plate-ui.md +6 -2
  55. package/dist/docs/installation/rsc.md +1 -1
  56. package/dist/docs/installation.md +4 -0
  57. package/dist/docs/link.md +4 -0
  58. package/dist/docs/llms.txt +3 -1
  59. package/dist/docs/lock.md +34 -2
  60. package/dist/docs/markdown.md +4 -0
  61. package/dist/docs/media.md +4 -0
  62. package/dist/docs/mention.md +5 -0
  63. package/dist/docs/pagination.md +4 -0
  64. package/dist/docs/prompt-editor.md +17 -1
  65. package/dist/docs/reference.md +192 -0
  66. package/dist/docs/roots.md +4 -0
  67. package/dist/docs/serializing.md +23 -0
  68. package/dist/docs/slash-command.md +58 -4
  69. package/dist/docs/static.md +29 -20
  70. package/dist/docs/suggestion.md +4 -0
  71. package/dist/docs/sync.md +4 -0
  72. package/dist/docs/table.md +31 -0
  73. package/dist/docs/toolbar.md +4 -0
  74. package/dist/docs/unit-testing.md +4 -0
  75. package/dist/docs/upload.md +4 -0
  76. package/dist/docx/export/index.d.ts +5 -5
  77. package/dist/docx/import/index.d.ts +5 -5
  78. package/dist/docx/paste/index.d.ts +4 -4
  79. package/dist/dom/index.d.ts +1 -1
  80. package/dist/features/basic-nodes/lib/BaseMarkPlugins.js +1 -1
  81. package/dist/features/basic-styles/lib/BaseFormattingPlugin.js +61 -28
  82. package/dist/features/basic-styles/lib/BaseStylePlugins.js +28 -7
  83. package/dist/features/board/index.d.ts +1 -1
  84. package/dist/features/callout/index.d.ts +2 -160
  85. package/dist/features/callout/lib/BaseCalloutPlugin.js +109 -9
  86. package/dist/features/column/index.d.ts +1 -1
  87. package/dist/features/comments/index.d.ts +2 -2
  88. package/dist/features/date/index.d.ts +3 -3
  89. package/dist/features/details/index.d.ts +3 -3
  90. package/dist/features/field/index.d.ts +1 -1
  91. package/dist/features/field/lib/BaseFieldPlugin.js +111 -53
  92. package/dist/features/field/lib/fieldCache.internal.js +9 -21
  93. package/dist/features/find/index.d.ts +3 -3
  94. package/dist/features/footnote/index.d.ts +3 -3
  95. package/dist/features/ink/index.d.ts +1 -1
  96. package/dist/features/link/lib/BaseLinkPlugin.js +5 -2
  97. package/dist/features/lint/index.d.ts +3 -3
  98. package/dist/features/list/lib/listKeyboard.internal.js +7 -2
  99. package/dist/features/lock/index.d.ts +1 -1
  100. package/dist/features/media/index.d.ts +1 -1
  101. package/dist/features/mention/index.d.ts +1 -1
  102. package/dist/features/reference/index.d.ts +236 -0
  103. package/dist/features/reference/index.js +2 -0
  104. package/dist/features/reference/lib/BaseReferencePlugin.js +589 -0
  105. package/dist/features/table/index.d.ts +2 -2
  106. package/dist/features/toc/index.d.ts +1 -1
  107. package/dist/features/upload/index.d.ts +1 -1
  108. package/dist/history/index.d.ts +1 -1
  109. package/dist/html/index.d.ts +4 -4
  110. package/dist/html/server/index.d.ts +2 -2
  111. package/dist/html/server/serverCssParser.internal.js +14 -25
  112. package/dist/html/server/serverCssStyle.internal.js +4 -7
  113. package/dist/{htmlConversion-Y-M6PLRi.d.ts → htmlConversion-CRnxMGw-.d.ts} +2 -2
  114. package/dist/{htmlTypes-CNhoCFjK.d.ts → htmlTypes-3laowz-3.d.ts} +3 -3
  115. package/dist/hyperscript/index.d.ts +1 -1
  116. package/dist/{index-B-8L9f6a2.d.ts → index-B3VOCxNR.d.ts} +5 -5
  117. package/dist/{index-B8JeECEk.d.ts → index-B9UlNijk.d.ts} +2 -2
  118. package/dist/{index-Bqva6PJc.d.ts → index-BJPT0Tv_.d.ts} +3 -3
  119. package/dist/{index-CWutqVQ_-BO-UgVeK.d.ts → index-BKPWmnLg-Bp_vItjr.d.ts} +1 -1
  120. package/dist/{index-BFWK852j.d.ts → index-BcD2RAB9.d.ts} +3 -3
  121. package/dist/{index-DhsryaAC.d.ts → index-C5Xw3JDc.d.ts} +1 -1
  122. package/dist/{index-BEXBAmJf.d.ts → index-CAshLTjV.d.ts} +3 -3
  123. package/dist/{index-qqrnWAk_.d.ts → index-CHlITvuq.d.ts} +7 -7
  124. package/dist/index-CKSwab_O.d.ts +1 -0
  125. package/dist/{index-DJhwDkfd.d.ts → index-CRQoHk18.d.ts} +3 -3
  126. package/dist/index-CyY3O6c7.d.ts +3 -0
  127. package/dist/index-D8EGVCeT.d.ts +305 -0
  128. package/dist/{index-B0R9sXv2-T1dxG9oM.d.ts → index-DAKucat0--VOaL_NN.d.ts} +4 -4
  129. package/dist/{index-UYpvOBXG.d.ts → index-DCTRNYwy.d.ts} +2 -2
  130. package/dist/{index-CXd5hwaH.d.ts → index-DQpHoxDX.d.ts} +1 -1
  131. package/dist/{index-BfJKfAwk.d.ts → index-DTd1D-BF.d.ts} +3 -3
  132. package/dist/index-DUhUT9bV.d.ts +1 -0
  133. package/dist/{index-B4aToRMv.d.ts → index-DXm_v0Qq.d.ts} +3 -3
  134. package/dist/{index-D3bhjdRz.d.ts → index-Djwcl0Ff.d.ts} +3 -3
  135. package/dist/{index-DYuqsDrP.d.ts → index-Dyw6BJx8.d.ts} +3 -3
  136. package/dist/{index-CLPMcGC5.d.ts → index-KG95XVaC.d.ts} +4 -4
  137. package/dist/{index-mcBtG6pK-CitQV9Bq.d.ts → index-LEcSTRgn-BR_p4GVY.d.ts} +2 -2
  138. package/dist/{index-D54VPeky.d.ts → index-k-wvVxKl.d.ts} +2 -2
  139. package/dist/{index-CHud6Aa-.d.ts → index-s34W6hUI.d.ts} +3 -3
  140. package/dist/{index-DXCdafUk.d.ts → index-wEkvA-wI.d.ts} +43 -20
  141. package/dist/index.d.ts +3 -3
  142. package/dist/internal/plugin/pluginInjectNodeProps.js +33 -5
  143. package/dist/internal/utils/urlPolicy.js +11 -1
  144. package/dist/lib/editor/withPlite.js +8 -6
  145. package/dist/lib/plugins/html/cssLexer.internal.js +126 -29
  146. package/dist/lib/plugins/html/cssSafety.internal.js +100 -0
  147. package/dist/lib/plugins/html/htmlDecode.internal.js +2 -2
  148. package/dist/lib/plugins/html/htmlMatcher.internal.js +1 -1
  149. package/dist/lib/plugins/html/htmlRules.internal.js +2 -13
  150. package/dist/lib/plugins/html/htmlSafety.js +17 -24
  151. package/dist/lib/plugins/html/htmlSerialize.internal.js +16 -2
  152. package/dist/lib/plugins/html/htmlStyleInline.internal.js +22 -23
  153. package/dist/lib/plugins/input-rules/inputRuleVeto.internal.js +27 -1
  154. package/dist/markdown/index.d.ts +1 -1
  155. package/dist/markdown/lib/internal/markdownAttributes.js +16 -7
  156. package/dist/markdown/lib/internal/markdownMappings.js +123 -16
  157. package/dist/markdown/lib/serializer/convertPhrasingSerialize.js +16 -1
  158. package/dist/math/index.d.ts +3 -3
  159. package/dist/math/react/index.d.ts +4 -4
  160. package/dist/migrations/index.d.ts +4 -4
  161. package/dist/migrations/migratePlateV54Urls.internal.js +63 -1
  162. package/dist/pagination/index.d.ts +1 -1
  163. package/dist/pagination/react/index.d.ts +3 -3
  164. package/dist/{protocol-CSuP7AWG-DAorqpaF.d.ts → protocol-Cp9xayOe-0OSfTMnt.d.ts} +1 -1
  165. package/dist/react/authored/index.d.ts +4 -4
  166. package/dist/react/components/PlateView.js +7 -1
  167. package/dist/react/features/board/index.d.ts +5 -5
  168. package/dist/react/features/callout/index.d.ts +93 -4
  169. package/dist/react/features/column/index.d.ts +5 -5
  170. package/dist/react/features/combobox/combobox.internal.js +35 -22
  171. package/dist/react/features/combobox/comboboxOwner.internal.js +29 -2
  172. package/dist/react/features/combobox/index.d.ts +8 -6
  173. package/dist/react/features/comments/index.d.ts +6 -6
  174. package/dist/react/features/date/index.d.ts +4 -4
  175. package/dist/react/features/details/index.d.ts +4 -4
  176. package/dist/react/features/field/FieldPlugin.js +2 -2
  177. package/dist/react/features/field/index.d.ts +5 -5
  178. package/dist/react/features/footnote/index.d.ts +4 -4
  179. package/dist/react/features/format-painter/FormatPainterPlugin.js +27 -34
  180. package/dist/react/features/format-painter/index.d.ts +4 -4
  181. package/dist/react/features/ink/index.d.ts +5 -5
  182. package/dist/react/features/lock/index.d.ts +5 -5
  183. package/dist/react/features/media/index.d.ts +5 -5
  184. package/dist/react/features/mention/index.d.ts +4 -4
  185. package/dist/react/features/table/index.d.ts +6 -6
  186. package/dist/react/features/toc/index.d.ts +2 -2
  187. package/dist/react/features/upload/index.d.ts +5 -5
  188. package/dist/react/index.d.ts +6 -6
  189. package/dist/react/virtualized.d.ts +3 -3
  190. package/dist/refusal-CwFxNUf7-BLhtd159.d.ts +1 -0
  191. package/dist/{registerEditorTools-Cl-o_Wnq.d.ts → registerEditorTools-D_3hPpTx.d.ts} +16 -8
  192. package/dist/shared-room-26tNRhZE-BLhtd159.d.ts +1 -0
  193. package/dist/skills/plate/SKILL.md +4 -3
  194. package/dist/skills/plate/references/ai-and-agents.md +2 -2
  195. package/dist/skills/plate/references/pricing.md +3 -3
  196. package/dist/skills/plate/references/setup.md +6 -0
  197. package/dist/skills/plate/references/ui-and-sync.md +4 -3
  198. package/dist/{source-DUP5aKcT.d.ts → source-BW7JD_oS.d.ts} +3 -3
  199. package/dist/static/index.d.ts +23 -9
  200. package/dist/static/internal/staticPendingMedia.internal.js +2 -1
  201. package/dist/static/internal/staticPresentation.js +1 -0
  202. package/dist/static/renderStaticHtml.js +85 -39
  203. package/dist/{storage-EzfLDqRy-Cu4DQ-Rf.d.ts → storage-C7xSH1I5-BJLoUfo9.d.ts} +2 -2
  204. package/dist/sync/cloudflare/index.d.ts +3 -3
  205. package/dist/sync/index.d.ts +4 -4
  206. package/dist/sync/postgres/index.d.ts +1 -1
  207. package/dist/sync/react/index.d.ts +6 -6
  208. package/dist/sync/server/index.d.ts +5 -5
  209. package/dist/tabbable/react/index.d.ts +4 -4
  210. package/dist/testing/index.d.ts +3 -3
  211. package/dist/{transport-DAforzBt-BFwAhC-N.d.ts → transport-B-ON68Y4-DCfT5-eN.d.ts} +1 -1
  212. package/dist/utils/plate-keys.js +1 -0
  213. package/dist/{widths-BjIZxtaJ.d.ts → widths-9NNziDRW.d.ts} +5 -5
  214. package/package.json +9 -2
  215. package/dist/clipboard-format-key-D9rnh20X-CR00YA0H.d.ts +0 -1
  216. package/dist/index-CKAkaSJK.d.ts +0 -3
  217. package/dist/index-CxyK4HrT.d.ts +0 -1
  218. package/dist/index-zcb_RtZC.d.ts +0 -1
  219. package/dist/refusal-DCzeB9nD-CR00YA0H.d.ts +0 -1
  220. package/dist/shared-room-Bg8qMvm1-CR00YA0H.d.ts +0 -1
  221. /package/dist/{tx-only-CWT-IURY-BqIFhy44.d.ts → tx-only-sIj7BcYh-BMFkGMuq.d.ts} +0 -0
package/dist/docs/lock.md CHANGED
@@ -16,9 +16,10 @@ _Try editing or dragging a locked block to see it refuse writes while keeping te
16
16
  - Protect locked clauses and locked table cells during AI edits by replacing locked blocks with indexed `<Locked ref="lN" />` Markdown AST placeholders, rewriting unlocked runs around them in one reviewable proposal, and excluding locked cells from multi-cell table edits with live writability revalidation.
17
17
  - Drop `locked` on copy, paste, duplicate, and block splits while preserving `data-editor-html-locked="true"` on programmatic HTML serialization and reporting `property-dropped` / `markdown-property-omitted` warnings on DOCX and Markdown export.
18
18
  - Skip standalone lock toggles in undo history while blocking local undo replays that would mutate a currently locked block, and commit lock toggles directly in Suggesting mode without recording a formatting suggestion.
19
+ - Enforce locked blocks and locked content roots during MIT `SyncServer` peer admission (`'sync-admit'`), refusing unauthorized peer writes with a non-abuse `'policy'` receipt (`code: 'block-locked'`) while keeping `lockWriteExemption` fills, standalone `edit` lock toggles, and trusted `server.run` turns working.
19
20
  - Announce refused edits on locked blocks to screen readers with cooldown throttling.
20
21
 
21
- Client-side block locks prevent accidental edits in templates, contracts, and shared drafts. They do not enforce server authorization or per-user access control.
22
+ `BaseLockPlugin` protects locked blocks in both client editors (preventing accidental edits, deletes, drags, and undo replays) and MIT `SyncServer` rooms (refusing stale or compromised peer writes tagged with `'sync-admit'`). It enforces document-level lock integrity, not per-user role authorization or wire read redaction: restrict which `edit` peers may lock or unlock blocks in `SyncServerOptions.onAdmit`, and use Plate Business for section/field ACLs and wire redaction.
22
23
 
23
24
  ## Kit usage
24
25
 
@@ -167,18 +168,45 @@ const selectionMarkdown = serializeAISelectionMarkdown(editor, {
167
168
  });
168
169
  ```
169
170
 
171
+ ### Server sync admission (`'sync-admit'`)
172
+
173
+ Install `BaseLockPlugin` inside the `editor` factory passed to `createSyncServer` from `platejs/sync/server` so locked blocks hold against stale or compromised peer submits, not only client UI checks.
174
+
175
+ ```ts
176
+ import { createEditor } from 'platejs';
177
+ import { BaseFieldPlugin } from 'platejs/field';
178
+ import { BaseLockPlugin } from 'platejs/lock';
179
+ import { createSyncServer, memoryStorage } from 'platejs/sync/server';
180
+
181
+ const server = createSyncServer({
182
+ authorize: ({ token }) => ({ access: 'edit', actor: token, decide: true }),
183
+ editor: () =>
184
+ createEditor({
185
+ plugins: [BaseFieldPlugin, BaseLockPlugin],
186
+ }),
187
+ storage: memoryStorage(),
188
+ });
189
+ ```
190
+
191
+ When `SyncServer` evaluates a peer submit, it tags the room editor admission commit with `'sync-admit'` (alongside `'collaboration'` and `'history-skip'`). `BaseLockPlugin` runs its full admission checks on `'sync-admit'` commits while continuing to accept settled remote collaboration broadcasts that omit `'sync-admit'`.
192
+
193
+ - **Refused peer writes:** Text edits, property changes, deletes, wraps, unwraps, moves, merges, and authored `decide` commits touching a locked block or locked content root are refused with a non-abuse `'policy'` receipt (`{ status: 'refused', reason: 'policy', code: 'block-locked' }`) reported to `onRefused`. Combining an unlock with a content edit in one peer submit is refused, and `suggest` peers cannot insert a locked pending suggestion or toggle `locked`.
194
+ - **Allowed server writes:** Validated `lockWriteExemption` writes (such as `BaseFieldPlugin` inline field fills) inside locked blocks pass peer admission. Standalone `locked` toggles from authorized `edit` peers pass admission when no pending authored insertion sits on the node. Trusted `server.run` turns commit with `source: 'server'` (without `'sync-admit'`), so server code can unlock, edit, and relock a block in one turn.
195
+ - **Per-actor lock authority:** `BaseLockPlugin` does not decide which `edit` peers may lock or unlock blocks. Add role checks for `locked` transitions in `SyncServerOptions.onAdmit` and return `{ allow: false, reason: 'policy', code: 'lock-authority' }` for unauthorized actors.
196
+
170
197
  ## Behavior
171
198
 
172
199
  - **Selection, copy, and Cut.** Users can select, search, and copy (`Mod+C`) text inside locked blocks. Pasted copies drop `locked` so copied clauses become editable at the destination. Native Cut (`Mod+X`) and drag-handle Cut refuse before modifying the clipboard or removing blocks.
173
200
  - **Enter at block edges.** Pressing `Enter` inside a locked block is refused. Pressing `Enter` at the exact start or end of a locked block inserts a new unlocked sibling using the parent's default block (a paragraph at the document root).
174
201
  - **History and Suggesting mode.** Standalone `.lock()`, `.unlock()`, and `.toggle()` updates skip undo history and commit directly in Suggesting mode without creating a formatting suggestion. Local undo or redo steps that would edit a currently locked block are refused without dropping the undo stack.
202
+ - **Sync server admission (`'sync-admit'`).** When `BaseLockPlugin` is installed on a `SyncServer` room editor, peer candidate writes tagged with `'sync-admit'` obey the same lock guards and return non-abuse `'policy'` receipts with `code: 'block-locked'`, while settled broadcasts without `'sync-admit'` and trusted `server.run` turns apply normally. Locking a block that already holds pending suggestions refuses peer `decide` commits until an authorized `edit` peer unlocks the block.
175
203
  - **HTML, Markdown, and DOCX.** Programmatic `editor.api.html.serialize()` and `editor.api.html.parse()` round-trip `data-editor-html-locked="true"`. Clipboard paste drops `locked`. Markdown serialization reports a `markdown-property-omitted` warning, and `exportDocx` reports a `property-dropped` warning for locked blocks.
176
204
 
177
205
  ## Plugins
178
206
 
179
207
  ### `BaseLockPlugin`
180
208
 
181
- Headless plugin from `platejs/lock`. Declares the optional boolean `locked` property on block elements, enforces per-section commit protection and structural/transfer vetoes, handles edge `Enter` insertion, maps HTML/DOCX formats, and announces throttled refusal messages to screen readers.
209
+ Headless plugin from `platejs/lock`. Declares the optional boolean `locked` property on block elements, enforces per-section commit protection across local edits, undo replays, and MIT `SyncServer` peer admission (`'sync-admit'`), enforces structural/transfer vetoes, handles edge `Enter` insertion, maps HTML/DOCX formats, and announces throttled refusal messages to screen readers.
182
210
 
183
211
  ### `LockPlugin`
184
212
 
@@ -259,3 +287,7 @@ Helper from `platejs/ai` that serializes the selected blocks for multi-block AI
259
287
  ### `serializeAISelectionMarkdown(editor, options?)`
260
288
 
261
289
  Helper from `platejs/ai` that serializes the active selection to Markdown without mutating the editor, splicing `<Selection>` markers into a cloned JSON copy when `includeSelectionMarkers` is `true`.
290
+
291
+ ## Pro and Business
292
+
293
+ Plate Pro ships `@plate-pro/disclosure` for audience document projection and compartmentalized counterparty sub-rooms. Plate Business adds `@plate-business/security-kernel` for server-enforced section and field ACLs, wire-level read redaction, and revision-pinned approval gates, verified by `plate verify --suite sync-security`. See [Pricing](/pricing).
@@ -816,3 +816,7 @@ Exports from `platejs/markdown`:
816
816
  | `MarkdownPlugin` | `const` | `MarkdownPlugin: BasePlugin<Readonly<{` | - |
817
817
  | `parseMarkdown` | `const` | `parseMarkdown: (source: string, options: MarkdownParseOptions) => MarkdownDocumentParseResult` | - |
818
818
  | `serializeMarkdown` | `const` | `serializeMarkdown: (document: EditorDocumentValue, options: MarkdownSerializeOptions) => MarkdownSerializeResult` | - |
819
+
820
+ ## Pro and Business
821
+
822
+ Plate Pro ships `@plate-pro/docs-press` for `llmstxt.org` v2.1 `/llms.txt`, per-page `.md`, and `Accept: text/markdown` content negotiation, plus `@plate-pro/disclosure` for clean audience Markdown exports. Plate Business adds `@plate-business/security-kernel` for redacted `/llms.txt` and Markdown feed compilation. See [Pricing](/pricing).
@@ -634,3 +634,7 @@ export type ParsedMediaEmbed =
634
634
  url: string;
635
635
  };
636
636
  ```
637
+
638
+ ## Pro and Business
639
+
640
+ Plate Pro includes Cloudflare R2 media uploads in the `Potion v2` and `Paper v2` flagship templates and `plate-deploy-cloudflare` skill. Plate Business adds `@plate-business/compliance-pdf` and `@plate-business/security-kernel` for SSRF-hardened raster media inlining and allowlisted remote media guards. See [Pricing](/pricing).
@@ -153,6 +153,7 @@ The popup opens when the user types `@` and the [combobox rules](/docs/combobox#
153
153
  |------|--------|
154
154
  | Typed text matches `trigger` | `string` prop on `InlineCombobox` (`'@'` in `MentionCombobox`). |
155
155
  | Previous character matches `triggerPreviousCharPattern` | Defaults to `/^\s?$/`; `MentionCombobox` uses `/^$\|^[\s"']$/`. |
156
+ | Not inside `inputRuleVeto` | Built into `useCombobox`; skips code blocks, inline code, and custom veto elements or marks. |
156
157
  | `triggerQuery(editor)` returns true | Optional app veto for custom contexts. |
157
158
 
158
159
  Until an item is selected, `@` and the query are ordinary text in the document. Escape closes the popup and keeps that text.
@@ -182,3 +183,7 @@ Exports with a fixed `@` prefix (`@${label ?? ref}`). DOCX export carries instal
182
183
  | `editor.plugin(MentionPlugin).update.insert({ ref, label? }, options?)` | `BaseMentionPlugin` update | Inserts the mention node at the current selection (or `options.at`), optionally adding a trailing space at block end when `options.trailingSpace` is `true`. |
183
184
  | `useCombobox` | `platejs/combobox/react` | Opens the popup on a typed `@` and completes the query. |
184
185
  | `inline-combobox` | Copied registry UI | Handles the listbox and keyboard navigation for the mention popup, and exports the `rankOptions` that orders its items. |
186
+
187
+ ## Pro and Business
188
+
189
+ Plate Pro ships `@plate-pro/context-chips` for multi-source `@` context registries and server-side `<mention>` XML context expansion. Plate Business adds `@plate-business/security-kernel` for fail-closed context-chip ACLs and redaction before model calls. See [Pricing](/pricing).
@@ -181,3 +181,7 @@ measurement activates after hydration without swapping the editable DOM node.
181
181
  `PageLayoutSnapshot` (or `null` when disabled).
182
182
  - `useTableRowPageBreak(element)`: returns the spacer height in pixels for a
183
183
  table row element starting on a new page.
184
+
185
+ ## Pro and Business
186
+
187
+ Plate Pro ships `@plate-pro/docs-press` for CSS `@page` print stylesheets and Typst PDF workers matching paged document layouts. Plate Business adds `@plate-business/compliance-pdf` for zero-network redacted PDF rendering with `preferCSSPageSize`, forensic watermarks, and signed SHA-256 attestations. See [Pricing](/pricing).
@@ -82,6 +82,14 @@ Enter presses the form's first submit button, so the form sends from `onSubmit`
82
82
 
83
83
  ## Examples
84
84
 
85
+ ### Multi-source `@` context chips, parameterized `/` commands, and `Cmd+K`
86
+
87
+ Pass `sources` for grouped `@` categories (`Files`, `Diffs`, `Docs`, `People`) with drill-down and async `search`, `commands` for parameterized `/` commands with a caret-anchored argument popover, and `CommandBar` (`npx shadcn@latest add @plate/command-bar`) for a unified `Cmd+K` palette. Clicking a chip or pressing `Alt+Enter` on a selected chip opens its preview popover.
88
+
89
+ _Registry item `context-chips-demo`: `npx shadcn@latest add @plate/context-chips-demo`._
90
+
91
+ _Type @ to drill into Files, Diffs, Docs, or People, click a chip to expand its preview, type /review for parameterized arguments, or press Cmd+K to open the command bar._
92
+
85
93
  ### AI SDK chat
86
94
 
87
95
  The demo sends the message and its attached files through the AI SDK's `useChat`, with a local transport that streams a fixed reply instead of calling a model. Pasted and dropped files go to `onFiles`, and removing one moves focus back to the field through its `ref`.
@@ -202,7 +210,11 @@ Edit `PromptEditorPlugin` in the copied `prompt-editor.tsx` to change these rule
202
210
 
203
211
  **Props**
204
212
 
205
- - `items` (`readonly PromptEditorItem[]` *(optional)*): What the @ menu offers (`{ label, ref, description? }`). The menu displays `description` under `label` when provided and matches the start of any word in `label`, `ref`, or `description`.
213
+ - `items` (`readonly PromptEditorItem[]` *(optional)*): What the @ menu offers (`{ label, ref, description?, group?, keywords?, preview? }`). The menu displays `description` under `label` when provided and matches the start of any word in `label`, `ref`, `group`, `keywords`, or `description`.
214
+ - `sources` (`readonly PromptContextSource[]` *(optional)*): Multi-source `@` context categories (`{ id, label, icon?, items?, search?(query, signal) }`) with category drill-down (`Escape` pops back to all sources) and abortable async search.
215
+ - `commands` (`readonly PromptCommand[]` *(optional)*): Parameterized `/` commands (`{ name, label, arguments?, onRun({ args, insertMention, insertText, message, setMessage }) }`) rendered with a caret-anchored argument popover.
216
+ - `loadChipPreview` (`(element: { label?: string; ref: string }, signal: AbortSignal) => Promise<React.ReactNode>` *(optional)*): Async preview loader for expanded chips with cancellation on close, unmount, or ref change.
217
+ - `searchTimeoutMs` (`number` *(optional)*): Timeout in milliseconds for async `sources[].search` calls. Defaults to `5000`.
206
218
  - `name` (`string` *(optional)*): The key the message takes in the form's `FormData`.
207
219
  - `value` (`string` *(optional)*): The message of a controlled field.
208
220
  - `onChange` (`(message: string) => void` *(optional)*): Called with the message after each change, and before Enter sends.
@@ -230,3 +242,7 @@ Edit `PromptEditorPlugin` in the copied `prompt-editor.tsx` to change these rule
230
242
  | Name | Type | Description |
231
243
  | --- | --- | --- |
232
244
  | `message` | `string` | A serialized prompt message containing plain text and `<mention ref="…">label</mention>` tags. |
245
+
246
+ ## Pro and Business
247
+
248
+ Plate Pro ships `@plate-pro/context-chips` for multi-source `@` context registries, server-side `<mention>` XML context expansion, and validated parameterized command execution. Plate Business adds `@plate-business/security-kernel` for fail-closed context-chip ACLs and command allowlists, verified in CI by `plate verify --suite ai-sandbox`. See [Pricing](/pricing).
@@ -0,0 +1,192 @@
1
+ # Reference
2
+
3
+ Insert rename-safe wikilinks, backlinks, hover transclusion cards, and version-pinned citations.
4
+
5
+ Typing `[[` opens an inline popup that searches workspace documents and blocks. Selecting an item inserts a markable void `reference` node storing a stable document `ref` and optional `blockId`, `root`, `label`, `alias`, `revision`, and `quote`. The package owns node schema validation, insertion, lossless Markdown and HTML serialization, detached reference extraction, and citation drift evaluation. The copied registry UI owns the `[[` combobox trigger, reactive workspace title lookup, async hover transclusion cards, and the Backlinks panel.
6
+
7
+ _Example `reference-demo` in the Plate repository: `apps/www/src/registry/examples/reference-demo.tsx`._
8
+
9
+ _Switch documents, rename the active document title to watch wikilinks and backlinks update in place, click a reference chip to inspect its hover transclusion card, or toggle a Security Policy clause edit to see citation drift and Update pin._
10
+
11
+ ## Features
12
+
13
+ - Inline markable void `reference` nodes with a required non-blank `ref` and optional `blockId`, `root`, `label`, `alias`, `revision`, and `quote`.
14
+ - Rename-safe live title resolution through `ReferenceWorkspaceProvider`, with explicit `alias` overrides (`[[Policy|Residency Clause`) kept intact across renames.
15
+ - Async `FloatingPopover` hover transclusion cards with request cancellation, stale-response rejection, ancestor cycle detection, keyboard/pointer support, and `Update pin` actions.
16
+ - Detached `extractDocumentReferences(document)` across `main` and named `roots` (skipping authored-deleted nodes by default) and `evaluateReferenceDrift(reference, target)` for version-pinned quote verification.
17
+ - Portable RFC 3986 Markdown (`[display](ref:docId?root=...&rev=...&label=...&alias=1#blockId "quote")`), HTML (`data-editor-html-reference-*`), DOCX, and plain-text output.
18
+
19
+ ## Kit usage
20
+
21
+ ### Add the kit
22
+
23
+ `ReferenceKit` adapts `BaseReferencePlugin` locally via `toReactPlugin(BaseReferencePlugin)` with `ReferenceElement` and the `ReferenceCombobox` (`[[`) slot. Wrap your editor and `BacklinksPanel` in `ReferenceWorkspaceProvider`.
24
+
25
+ _Registry item `reference`: `npx shadcn@latest add @plate/reference`._
26
+
27
+ ```tsx
28
+ import { createEditor } from 'platejs/react';
29
+
30
+ import {
31
+ BacklinksPanel,
32
+ createReferenceWorkspaceStore,
33
+ ReferenceKit,
34
+ ReferenceWorkspaceProvider,
35
+ } from '@/components/editor/reference';
36
+
37
+ export const editor = createEditor({
38
+ plugins: ReferenceKit,
39
+ });
40
+ ```
41
+
42
+ ### Add static rendering
43
+
44
+ `reference-static` pairs `BaseReferencePlugin` with `ReferenceElementStatic` for server-safe read-only rendering without recursive transclusion.
45
+
46
+ _Registry item `reference-static`: `npx shadcn@latest add @plate/reference-static`._
47
+
48
+ ## Ownership
49
+
50
+ | Layer | Owner | What It Does |
51
+ |-------|-------|--------------|
52
+ | `platejs/reference` | Package | Exports `BaseReferencePlugin`, `extractDocumentReferences`, `evaluateReferenceDrift`, and reference TypeScript contracts. |
53
+ | `platejs/combobox/react` | Package | Exports `useCombobox`, which opens the `[[` popup on typed input. |
54
+ | `reference` | Registry UI | Adapts `BaseReferencePlugin` via `toReactPlugin`, and owns `ReferenceWorkspaceProvider`, `ReferenceElement`, `ReferenceCombobox`, `BacklinksPanel`, and `ReferenceKit`. |
55
+ | `reference-static` | Registry UI | Configures `BaseReferencePlugin` with `ReferenceElementStatic` in `BaseReferenceKit`. |
56
+ | `platejs/markdown` | Package | Serializes references as `ref:` links at priority `11` and parses them back alongside mentions and ordinary links. |
57
+
58
+ ## Manual usage
59
+
60
+ ### Install package
61
+
62
+ ```bash
63
+ npm install platejs
64
+ ```
65
+
66
+ ### Register the plugin
67
+
68
+ ```tsx
69
+ import { BaseReferencePlugin } from 'platejs/reference';
70
+ import { createEditor, toReactPlugin } from 'platejs/react';
71
+
72
+ import {
73
+ ReferenceCombobox,
74
+ ReferenceElement,
75
+ } from '@/components/editor/reference';
76
+
77
+ const ReferencePlugin = toReactPlugin(BaseReferencePlugin);
78
+
79
+ export const editor = createEditor({
80
+ plugins: [
81
+ ReferencePlugin.configure({
82
+ component: ReferenceElement,
83
+ slots: { afterEditable: ReferenceCombobox },
84
+ }),
85
+ ],
86
+ });
87
+ ```
88
+
89
+ ### Insert a reference or pinned citation
90
+
91
+ Call `update.insert` inside a transaction. Pass `{ trailingSpace: true }` to insert a trailing space when the reference lands at the end of a block.
92
+
93
+ ```tsx
94
+ editor.update((tx) => {
95
+ tx.plugin(BaseReferencePlugin).insert(
96
+ {
97
+ blockId: 'clause-4',
98
+ label: 'Security Policy # Clause 4',
99
+ quote: 'Customer data must remain within customer-owned infrastructure.',
100
+ ref: 'doc-security-policy',
101
+ revision: 'v1',
102
+ },
103
+ { trailingSpace: true }
104
+ );
105
+ });
106
+ ```
107
+
108
+ ### Extract backlinks and check citation drift
109
+
110
+ Use `extractDocumentReferences` and `evaluateReferenceDrift` on detached `EditorDocumentValue` payloads without constructing a live editor.
111
+
112
+ ```ts
113
+ import {
114
+ evaluateReferenceDrift,
115
+ extractDocumentReferences,
116
+ } from 'platejs/reference';
117
+
118
+ const references = extractDocumentReferences(sourceDocument);
119
+ const drift = evaluateReferenceDrift(references[0], {
120
+ document: targetDocument,
121
+ revision: targetRevision,
122
+ });
123
+ ```
124
+
125
+ ## Value shape
126
+
127
+ `PLUGINS.reference` identifies the capability and its default persisted element type is `reference`.
128
+
129
+ ```tsx
130
+ const value = [
131
+ {
132
+ children: [
133
+ { text: 'Enforces ' },
134
+ {
135
+ alias: 'Residency Clause',
136
+ blockId: 'clause-4',
137
+ children: [{ text: '' }],
138
+ label: 'Security Policy',
139
+ quote: 'Customer data must remain within customer-owned infrastructure.',
140
+ ref: 'doc-security-policy',
141
+ revision: 'v1',
142
+ type: 'reference',
143
+ },
144
+ { text: '.' },
145
+ ],
146
+ type: 'paragraph',
147
+ },
148
+ ];
149
+ ```
150
+
151
+ | Field | Type | Notes |
152
+ |-------|------|-------|
153
+ | `type` | `'reference'` | Inline markable void reference node. |
154
+ | `ref` | `string` | Required non-blank target document or source identifier (no NUL bytes). |
155
+ | `blockId` | `string` | Optional non-blank block or clause ID in the target document; preserved unchanged across copy and paste. |
156
+ | `root` | `string` | Optional non-blank named root for whole-tab references; block lookups search across all roots by `blockId`. |
157
+ | `label` | `string` | Optional offline and export fallback title snapshot; yields to the live workspace title on rename. |
158
+ | `alias` | `string` | Optional explicit display override that stays unchanged when the target document is renamed. |
159
+ | `revision` | `string` | Optional opaque app or content version token pinned alongside a citation. |
160
+ | `quote` | `string` | Optional verbatim quote verified independently of `revision` equality during drift evaluation. |
161
+ | `children` | `[{ text: '' }]` | Empty child required for Plate inline void nodes. |
162
+
163
+ ## Formats
164
+
165
+ ### Markdown
166
+
167
+ `platejs/markdown` writes references at priority `11` (distinct from `BaseMentionPlugin` at `10` and `BaseLinkPlugin` at `0`) using RFC 3986 query-before-fragment `ref:` URLs: `[display](ref:<ref>[?root=...&rev=...&label=...&alias=1&quote=...][#<blockId>] "quote")`. Single-line quotes serialize in the CommonMark link title; multiline quotes serialize in the `quote` query parameter so blank lines remain lossless. Uniform marks on the reference child leaf round-trip cleanly; partial marks report a lossy diagnostic.
168
+
169
+ ### HTML
170
+
171
+ Serializes as `<span data-editor-html-reference data-editor-html-reference-ref="..." ...>display</span>` with optional `block-id`, `root`, `label`, `alias`, `revision`, and `quote` attributes, wrapped by installed mark tags and parsed back losslessly.
172
+
173
+ ### DOCX and plain text
174
+
175
+ Exports the resolved display text (`alias ?? label ?? ref`) without a prefix. DOCX export is encode-only and writes plain display text rather than overriding `BaseLinkPlugin`'s hyperlink decoder.
176
+
177
+ ## API Reference
178
+
179
+ | API | Package | Use |
180
+ |-----|---------|-----|
181
+ | `BaseReferencePlugin` | `platejs/reference` | Stateless headless inline markable void reference plugin with insertion and format mappings. |
182
+ | `ReferenceInsertInput`, `ReferenceInsertOptions` | `platejs/reference` | Input payload and insertion options (`trailingSpace?: boolean`) for `update.insert`. |
183
+ | `ReferenceDefinition`, `ReferenceElement` | `platejs/reference` | Derived plugin definition and element types for `BaseReferencePlugin`. |
184
+ | `extractDocumentReferences(document, options?)` | `platejs/reference` | Pure detached extractor returning outgoing reference occurrences across `main` and named `roots`. |
185
+ | `evaluateReferenceDrift(reference, target)` | `platejs/reference` | Pure drift evaluator returning `'unpinned' \| 'unavailable' \| 'unverifiable' \| 'current' \| 'drifted'`, always verifying `quote` independently of `revision`. |
186
+ | `ExtractedDocumentReference`, `ExtractDocumentReferencesOptions`, `ReferenceDriftTarget`, `ReferenceDriftResult` | `platejs/reference` | Type contracts for detached extraction and citation drift evaluation. |
187
+ | `ReferenceWorkspaceProvider`, `createReferenceWorkspaceStore`, `ReferenceElement`, `ReferenceCombobox`, `BacklinksPanel`, `ReferenceKit` | Copied registry UI (`reference`) | Workspace title store, rename-safe inline chip with async hover transclusion card, `[[` combobox, and Backlinks panel. |
188
+ | `ReferenceElementStatic`, `BaseReferenceKit` | Copied registry UI (`reference-static`) | Server-safe static reference renderer and kit. |
189
+
190
+ ## Pro and Business
191
+
192
+ Plate Pro ships `@plate-pro/sources` for a location-only D1 and in-memory backlink index with rename safety, a cycle- and node-budgeted transclusion resolver, and a workspace citation drift scanner. Plate Business adds `@plate-business/security-kernel` for complete-atom reference redaction, authorized backlinks and transclusion, and hash-chained WORM citation audit logs, verified by `plate verify --suite sync-security`. See [Pricing](/pricing).
@@ -397,3 +397,7 @@ Use content roots for synced blocks, editable cards, and element-owned editable
397
397
  regions. Use [DOM coverage boundaries](/docs/dom-coverage)
398
398
  when the content is in the same root but intentionally not mounted, such as a
399
399
  closed accordion body or inactive tab panel.
400
+
401
+ ## Pro and Business
402
+
403
+ Plate Pro ships `@plate-pro/synced-block` for cross-document `synced:` root references with subscriber sync and flush policies, plus `@plate-pro/disclosure` for named-tab audience projection and counterparty sub-rooms. Plate Business adds `@plate-business/security-kernel` for server-side multi-tab and named-root redaction. See [Pricing](/pricing).
@@ -168,6 +168,25 @@ when another Plate editor must recover named roots or metadata.
168
168
  See [DOCX](/docs/docx) for cancellation, package limits, comments, and retained
169
169
  source.
170
170
 
171
+ ## Render static HTML
172
+
173
+ `renderStaticHtml` renders component-styled HTML from either a detached
174
+ `EditorDocumentValue` (with `plugins` and optional `schema`) or a live editor:
175
+
176
+ ```ts
177
+ import { renderStaticHtml } from 'platejs/static';
178
+ import { BaseEditorKit } from '@/components/editor/plugins-static';
179
+
180
+ const detached = await renderStaticHtml(document, {
181
+ plugins: BaseEditorKit,
182
+ projection: 'accepted',
183
+ });
184
+ ```
185
+
186
+ Detached calls run on a dormant per-call owner without activating plugins and
187
+ dispose it after rendering. See [Static Rendering](/docs/static) for live
188
+ editor `presentation` overrides and diagnostics.
189
+
171
190
  ## Handle results
172
191
 
173
192
  HTML, Markdown, and DOCX use format-specific diagnosed results. Success carries
@@ -214,3 +233,7 @@ if (result.ok) editor.update.slice.replace(result.slice);
214
233
 
215
234
  Do not turn a complete document into `children` before replacement; that drops
216
235
  named roots and metadata. Do not invent a destination during detached parsing.
236
+
237
+ ## Pro and Business
238
+
239
+ Plate Pro ships `@plate-pro/docs-press` for `/llms.txt`, per-page `.md`, CSS `@page`, and Typst PDF publishing, plus `@plate-pro/disclosure` for multi-format 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. See [Pricing](/pricing).
@@ -48,7 +48,7 @@ npx shadcn@latest add @plate/slash
48
48
 
49
49
  ### Add plugins
50
50
 
51
- The copied `slash` file defines `SlashPlugin`, which mounts `SlashCombobox` in its `afterEditable` slot and holds the items your app adds, and `SlashCombobox`, which configures the `/` trigger and code guard on `InlineCombobox`:
51
+ The copied `slash` file defines `SlashPlugin`, which mounts `SlashCombobox` in its `afterEditable` slot and holds the items your app adds, and `SlashCombobox`, which configures the `/` trigger on `InlineCombobox`:
52
52
 
53
53
  ```tsx
54
54
  import { createEditor } from 'platejs/react';
@@ -63,7 +63,7 @@ const editor = createEditor({
63
63
  });
64
64
  ```
65
65
 
66
- A `/` opens the menu at the start of a line or after a space, and `triggerQuery` keeps a `/` typed in a code block or inline code as plain text. Edit `SlashCombobox` in the copied file to change either.
66
+ A `/` opens the menu at the start of a line or after a space, and `inputRuleVeto` keeps a `/` typed in a code block or inline code as plain text. Edit `SlashCombobox` in the copied file to change the trigger policy.
67
67
 
68
68
  ## Add app items
69
69
 
@@ -103,6 +103,55 @@ const editor = createEditor({
103
103
 
104
104
  An item takes `label`, `icon`, `group`, optional `isAvailable`, `keywords`, `description`, `shortcut`, and `onSelect` or `onClick`. Its `icon` is a function that returns the icon, such as `() => <PenLineIcon />`, because plugin state holds data and functions rather than React elements. `onSelect` runs inside the menu's transaction and replaces the typed `/` and query; return `false` to keep them.
105
105
 
106
+ ## Parameterized commands and `CommandBar`
107
+
108
+ Add `arguments` (`text` or `select`) and `onRun(editor, tx, args)` to any `SlashItem` to collect typed arguments in a caret-anchored popover before running the command in a single undoable transaction. Pair `SlashPlugin` with `CommandBarPlugin` (`npx shadcn@latest add @plate/command-bar`) to expose the same catalog via `Cmd+Shift+K` (`LinkPlugin` keeps `Cmd+K`).
109
+
110
+ ```tsx
111
+ import { BookOpenCheck } from 'lucide-react';
112
+ import { createEditor } from 'platejs/react';
113
+
114
+ import { CommandBarPlugin } from '@/components/editor/command-bar';
115
+ import { SlashPlugin } from '@/components/editor/slash';
116
+
117
+ const editor = createEditor({
118
+ plugins: [
119
+ SlashPlugin.configure({
120
+ initialState: {
121
+ items: [
122
+ {
123
+ arguments: [
124
+ {
125
+ defaultValue: 'fr',
126
+ label: 'Language',
127
+ name: 'language',
128
+ options: [
129
+ { label: 'French', value: 'fr' },
130
+ { label: 'Spanish', value: 'es' },
131
+ ],
132
+ required: true,
133
+ type: 'select',
134
+ },
135
+ ],
136
+ group: 'Commands',
137
+ icon: () => <BookOpenCheck className="size-4" />,
138
+ label: 'Translate',
139
+ onRun: (_editor, tx, args) => {
140
+ tx.text.insert(`[Translate -> ${args.language}] `);
141
+ },
142
+ },
143
+ ],
144
+ },
145
+ }),
146
+ CommandBarPlugin,
147
+ ],
148
+ });
149
+ ```
150
+
151
+ _Registry item `context-chips-demo`: `npx shadcn@latest add @plate/context-chips-demo`._
152
+
153
+ _Type /Translate or /Review stamp in the document editor to open the parameterized argument popover, or press Cmd+Shift+K to open the command bar._
154
+
106
155
  ## Usage
107
156
 
108
157
  How to use slash commands:
@@ -126,6 +175,11 @@ Available options include:
126
175
  | API | Source | Use |
127
176
  |-----|--------|-----|
128
177
  | `SlashPlugin` | `slash` registry | Edit-only plugin that mounts `SlashCombobox` in `afterEditable` and holds app `items` in state. |
129
- | `SlashItem` | `slash` registry | One app item: `label`, `icon` function, `group`, optional `isAvailable`, `keywords`, `description`, `shortcut`, and `onSelect` or `onClick`. |
178
+ | `SlashItem` | `slash` registry | One app item: `label`, `icon` function, `group`, optional `isAvailable`, `keywords`, `description`, `shortcut`, `arguments`, `canRun`, `onRun`, and `onSelect` or `onClick`. |
179
+ | `CommandBarPlugin` | `command-bar` registry | Edit-only plugin exposing `SlashPlugin` items and custom actions in a `Cmd+Shift+K` dialog with inline typed argument forms. |
130
180
  | `SlashKit` | `slash` registry | Single-element kit containing `SlashPlugin`. |
131
- | `SlashCombobox` | `slash` registry | The slash menu, passing `trigger="/"` and the code `triggerQuery` to `InlineCombobox`, built from the file's `groups` list merged with the plugin's `items`. Edit `groups` to remove or reorder built-in options. While you type, the menu lists matches best first and keeps list order only between equal matches. |
181
+ | `SlashCombobox` | `slash` registry | The slash menu, passing `trigger="/"` to `InlineCombobox`, built from the file's `groups` list merged with the plugin's `items`. Edit `groups` to remove or reorder built-in options. While you type, the menu lists matches best first and keeps list order only between equal matches. |
182
+
183
+ ## Pro and Business
184
+
185
+ Plate Pro ships `@plate-pro/context-chips` for validated parameterized command orchestration, `@plate-pro/playwright-suite` for automated slash-command browser proofs, and the `Potion v2` and `Paper v2` flagship templates. Plate Business adds `@plate-business/security-kernel` for server-side command allowlists. See [Pricing](/pricing).
@@ -345,34 +345,37 @@ not a semantic HTML interchange serializer.
345
345
  omits editing-surface slots such as `slots.wrapContent`; wrap `result.data` in
346
346
  application presentation when the exported document needs an outer shell.
347
347
 
348
+ ### Render a detached document
349
+
350
+ Pass a stored `EditorDocumentValue` with `plugins` (and optional `schema`) to
351
+ render without creating or managing a live editor. Each detached call builds a
352
+ dormant owner without running plugin `activate` hooks and disposes it when
353
+ rendering finishes, keeping renders isolated across requests:
354
+
348
355
  ```ts title="lib/html-serializer.ts"
349
- import { createEditor } from 'platejs';
356
+ import type { EditorDocumentValue } from 'platejs';
350
357
  import { renderStaticHtml } from 'platejs/static';
351
358
  import { BaseBasicBlocksKit } from '@/components/editor/basic-blocks-static';
352
359
 
353
- async function getDocumentAsHtml(value: any[]) {
354
- const editor = createEditor({
355
- plugins: [...BaseBasicBlocksKit],
356
- initialValue: value,
357
- });
358
-
359
- const result = await renderStaticHtml(editor, {
360
- // component: EditorStatic, // Optional: Defaults to EditorStatic
361
- props: { className: 'prose max-w-none' }, // Example: Pass props to the root div
360
+ async function getDocumentAsHtml(document: EditorDocumentValue) {
361
+ const result = await renderStaticHtml(document, {
362
+ plugins: BaseBasicBlocksKit,
363
+ projection: 'accepted',
364
+ props: { className: 'prose max-w-none' },
362
365
  });
363
366
 
364
367
  return result.data;
365
368
  }
366
-
367
- // Example Usage:
368
- // const value = [ { type: 'heading', level: 1, children: [{ text: 'My Document' }] } ];
369
- // getDocumentAsHtml(value).then(console.log);
370
369
  ```
371
370
 
371
+ Passing `document` in options on a detached call throws a `TypeError`. Passing
372
+ `plugins` or `schema` on a live-editor call throws a `TypeError`.
373
+
372
374
  `props` takes appearance props for the root element, such as `className` or
373
375
  `style`. It throws a `TypeError` for `editor`, `document`, `fragment`,
374
- `inertRemoteMedia`, or `presentation`. Pass the editor as the first argument
375
- and `document` or `presentation` as top-level options.
376
+ `inertRemoteMedia`, or `presentation`. Pass the editor or detached document as
377
+ the first argument and `document` (live mode only) or `presentation` as
378
+ top-level options.
376
379
 
377
380
  ### Export a live editor
378
381
 
@@ -476,17 +479,19 @@ interface EditorStaticProps<E = Editor>
476
479
  - **`inertRemoteMedia`**: Marks rendered main and child-root element attributes with `data-editor-inert-media` for inert static media previews.
477
480
  - **`presentation`**: Static plugin array supplying element, mark, and function wrapper drawings while the live editor keeps the document, schema, and plugin settings.
478
481
 
479
- ### `renderStaticHtml(editor, options?)`
482
+ ### `renderStaticHtml(editor, options?)` and `renderStaticHtml(document, options)`
480
483
 
481
- Renders one document snapshot to an HTML string and returns `{ data, diagnostics }`.
484
+ Renders one document snapshot to an HTML string and returns `{ data, diagnostics }`. Pass either a live editor (`RenderStaticHtmlOptions`) or a detached `EditorDocumentValue` with `plugins` (`RenderStaticHtmlDocumentOptions`).
482
485
 
483
486
  | Option | Type | Description |
484
487
  | --- | --- | --- |
485
488
  | `component` | `React.ComponentType<T>` | Static root component. Defaults to `EditorStatic`. |
486
- | `document` | `EditorDocumentValue` | Document snapshot to render. Defaults to `editor.read.value()`. |
487
- | `presentation` | `readonly BasePluginInput[]` | Static plugins supplying element, mark, and wrapper drawings while the live editor keeps the document and plugin settings. |
489
+ | `document` | `EditorDocumentValue` | Live-editor mode only. Document snapshot to render instead of `editor.read.value()`. Throws `TypeError` in detached mode. |
490
+ | `plugins` | `readonly RuntimePluginReference[]` | Detached mode only (required). Plugins used to validate and render the document on a dormant per-call owner. Throws `TypeError` in live-editor mode. |
491
+ | `presentation` | `readonly BasePluginInput[]` | Static plugins supplying element, mark, and wrapper drawings while the owner keeps the document and plugin settings. |
488
492
  | `projection` | `'accepted' \| 'proposed'` | Required when pending authored changes exist; `'accepted'` drops pending changes and `'proposed'` applies them as plain content. |
489
493
  | `props` | `Partial<Omit<T, 'document' \| 'editor' \| 'fragment' \| 'inertRemoteMedia' \| 'presentation'>>` | Appearance props forwarded to `component` (`editor`, `document`, `fragment`, `inertRemoteMedia`, and `presentation` throw a `TypeError`). |
494
+ | `schema` | `EditorApplicationSchema` | Detached mode only. Optional application schema validated alongside `plugins`. Throws `TypeError` in live-editor mode. |
490
495
 
491
496
  `diagnostics` contains `authored-lossy-projection` warnings (when projecting pending changes) and `missing-static-presentation` warnings naming any `plugin` omitted from `presentation`.
492
497
 
@@ -495,3 +500,7 @@ Renders one document snapshot to an HTML string and returns `{ data, diagnostics
495
500
  - Explore [HTML Serialization](/docs/html) for exporting content.
496
501
  - Learn about using Plate in [React Server Components](/docs/installation/rsc).
497
502
  - Refer to individual plugin documentation for their base (non-React) imports.
503
+
504
+ ## Pro and Business
505
+
506
+ Plate Pro ships `@plate-pro/docs-press` for static `/llms.txt`, `.md`, and self-hosted CSS `@page` or Typst PDF workers built on `renderStaticHtml`. Plate Business adds `@plate-business/compliance-pdf` for zero-network redacted HTML-to-PDF rendering with forensic watermarks, PDF metadata scrubbing, and signed SHA-256 attestations. See [Pricing](/pricing).
@@ -349,3 +349,7 @@ Import from `platejs/authored/react`. It extends `AuthoredPlugin` with exact-vie
349
349
  ### `SuggestionKit`
350
350
 
351
351
  The copied registry kit configures `AuthoredReactPlugin` with content-root styles. Generic editor components remain independent of suggestions. Review cards, Comments integration, toolbars, and popovers remain in registry code.
352
+
353
+ ## Pro and Business
354
+
355
+ Plate Pro ships `@plate-pro/change-requests` for Word `.docx` tracked-change intake and multi-author change-request review helpers, plus `@plate-pro/floating-discussion` for margin suggestion cards. Plate Business adds `@plate-business/security-kernel` for revision-pinned approval gates and immutable audit logs. See [Pricing](/pricing).
package/dist/docs/sync.md CHANGED
@@ -352,3 +352,7 @@ Use `isSyncRefusal(value)` to narrow `editor.update.result(...)` refusals emitte
352
352
  - [Authored Changes](/docs/authored-changes)
353
353
  - [History](/docs/history)
354
354
  - [Editor](/docs/editor)
355
+
356
+ ## Pro and Business
357
+
358
+ Plate Pro ships `@plate-pro/collab-do` for hibernatable Cloudflare Durable Object rooms with debounced D1 projection, HMAC-SHA256 room tokens, and a Streamable HTTP MCP agent endpoint, paired with `plate-deploy-cloudflare` and `plate-deploy-vercel`. Plate Business adds `@plate-business/security-kernel` for wire-level `projectRead` redaction and hash-chained WORM audit logs, plus `plate verify --suite sync-security` CI. See [Pricing](/pricing).
@@ -44,6 +44,33 @@ const editor = createEditor({
44
44
  });
45
45
  ```
46
46
 
47
+ ## Examples
48
+
49
+ ### Calculated ledger and workspace query views
50
+
51
+ Install the copied `@plate/records` registry bundle to add exact-decimal formula evaluation (`=qty * unit_price`, `=SUM(D2:D5)`), a live footer summary row, CSV export, and Obsidian-Bases style ` ```base ` live query views (`table`, `board`, `cards`, `list`) over workspace frontmatter without adding runtime dependencies or modifying table core.
52
+
53
+ ```bash
54
+ pnpm dlx shadcn@latest add @plate/records
55
+ ```
56
+
57
+ ```tsx
58
+ import { createEditor } from 'platejs/react';
59
+
60
+ import {
61
+ LedgerTableKit,
62
+ RecordsQueryKit,
63
+ } from '@/components/editor/records';
64
+
65
+ const editor = createEditor({
66
+ plugins: [...LedgerTableKit, ...RecordsQueryKit],
67
+ });
68
+ ```
69
+
70
+ _Registry item `records-demo`: `npx shadcn@latest add @plate/records-demo`._
71
+
72
+ _Edit a Qty cell to recalculate line totals and footer sums live, export sanitized CSV, switch between Table, Board, and Cards query views, or edit workspace YAML frontmatter to update matching rows._
73
+
47
74
  ## Usage
48
75
 
49
76
  Use the installed table descriptor for insertion, selection reads, and updates:
@@ -360,3 +387,7 @@ _Verified by 16 automated tests._
360
387
  ### When inserting a table row
361
388
 
362
389
  - [x] Inserts a tr with empty cells (`EDIT-TABLE-ROW-INSERT-001`)
390
+
391
+ ## Pro and Business
392
+
393
+ Plate Pro ships `@plate-pro/database-block` for structured database table and board views with column schema validation and D1 or Postgres row persistence, plus `@plate-pro/playwright-suite` for cross-browser table navigation proofs. See [Pricing](/pricing).
@@ -299,3 +299,7 @@ Plugin that renders a floating toolbar that appears on text selection, or a bar
299
299
  | Name | Type | Description |
300
300
  | --- | --- | --- |
301
301
  | `slots.caret` | `EditableSiblingComponent` | Renders the floating toolbar as an overlay after the editor, on the view that holds the caret. Contains FloatingToolbarButtons by default. |
302
+
303
+ ## Pro and Business
304
+
305
+ Plate Pro ships the `Potion v2` and `Paper v2` flagship templates with fixed and floating toolbars wired to AI menus, review controls, and export actions. See [Pricing](/pricing).