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
|
@@ -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"e=...][#<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).
|
package/dist/docs/roots.md
CHANGED
|
@@ -397,3 +397,37 @@ 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
|
+
## Synced blocks and live components
|
|
402
|
+
|
|
403
|
+
Install the copied `@plate/synced-block` registry item to embed live two-way
|
|
404
|
+
synced portals, voting tables, and status trackers across documents on top of
|
|
405
|
+
shared `synced:<id>` content roots:
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
npx shadcn@latest add @plate/synced-block
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
The kit stores shared rich text and structured component state (`voting_table`
|
|
412
|
+
and `status_tracker`) inside the shared `synced:<id>` root rather than on each
|
|
413
|
+
host portal element, so edits, votes, and status updates mirror across every
|
|
414
|
+
mounted portal without nested editors. Use `attachSyncedBlockPortal` to attach a
|
|
415
|
+
shared portal inside bound sync rooms, `unsyncSyncedBlockPortal` to unwrap a
|
|
416
|
+
local portal into ordinary blocks, and `validateSyncedGraph` to reject cyclic or
|
|
417
|
+
overly deep embeds.
|
|
418
|
+
|
|
419
|
+
_Example `synced-block-demo` in the Plate repository: `apps/www/src/registry/examples/synced-block-demo.tsx`._
|
|
420
|
+
|
|
421
|
+
_Edit text, cast votes, or cycle tracker statuses in either document to see live mirroring across synced portals, or switch to External Guest to verify restricted components stay opaque._
|
|
422
|
+
|
|
423
|
+
## Pro and Business
|
|
424
|
+
|
|
425
|
+
Plate Pro ships `@plate-pro/synced-block` (with `plate-deploy-cloudflare` deploy
|
|
426
|
+
automation) for cross-document `synced:` root replication, Cloudflare Durable
|
|
427
|
+
Object fanout, D1 canonical CAS storage, and reconnect reconciliation, plus
|
|
428
|
+
`@plate-pro/disclosure` for named-tab audience projection and counterparty
|
|
429
|
+
sub-rooms. Plate Business adds `@plate-business/security-kernel` and
|
|
430
|
+
`@plate-business/security-proof` (plus `plate verify` CI) for server-enforced
|
|
431
|
+
multi-root write ACLs (`canWriteRoot`), zero-existence-oracle component
|
|
432
|
+
projection, DAG cycle/depth guards, signed `psv1.` vote/quorum receipts, and
|
|
433
|
+
WORM audit chains. See [Pricing](/pricing).
|
package/dist/docs/serializing.md
CHANGED
|
@@ -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
|
|
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 `
|
|
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="/"`
|
|
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).
|
package/dist/docs/static.md
CHANGED
|
@@ -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 {
|
|
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(
|
|
354
|
-
const
|
|
355
|
-
plugins:
|
|
356
|
-
|
|
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
|
|
375
|
-
and `document` or `presentation` as
|
|
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
|
|
487
|
-
| `
|
|
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).
|
package/dist/docs/suggestion.md
CHANGED
|
@@ -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).
|
package/dist/docs/table.md
CHANGED
|
@@ -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).
|
package/dist/docs/toc.md
CHANGED
|
@@ -255,3 +255,17 @@ The copied [`toc`](/docs/components/toc) component owns scrolling and
|
|
|
255
255
|
navigation feedback. Keep those product-facing interaction choices beside the
|
|
256
256
|
renderer; the package plugin owns heading discovery through
|
|
257
257
|
`editor.plugin(TocPlugin).read.headings()`.
|
|
258
|
+
|
|
259
|
+
For multi-root documents organized into up to three levels of nested tabs and
|
|
260
|
+
subtabs with per-tab heading outlines, `?tab=` deep links, independent Pageless
|
|
261
|
+
or Paged layouts, and scoped Markdown or HTML exports, install the copied
|
|
262
|
+
`@plate/document-tabs` registry component (`document-tabs-demo`).
|
|
263
|
+
|
|
264
|
+
## Pro and Business
|
|
265
|
+
|
|
266
|
+
Install `@plate-pro/document-tabs` for a self-hosted Cloudflare Worker and D1
|
|
267
|
+
workspace serving per-tab `.md`, `/llms.txt`, `/llms-full.txt`, and rewritten
|
|
268
|
+
cross-tab ZIP bundles. Pair it with `@plate-business/security-kernel`
|
|
269
|
+
(`policy.tabAccess`) and `plate verify` CI for wire-level cascading tab
|
|
270
|
+
redaction, server-side agent tab-write scoping, and zero-oracle `/llms.txt`
|
|
271
|
+
tab redaction; see [Pricing](/pricing).
|
package/dist/docs/toolbar.md
CHANGED
|
@@ -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).
|
|
@@ -365,3 +365,7 @@ Pass `propertyValues` in options when a custom plugin declares a required
|
|
|
365
365
|
property with a runtime `validate` function that cannot be inferred from the
|
|
366
366
|
JSON contract alone. Compose with `fast-check` using
|
|
367
367
|
`fc.integer().map(arbitrary.generate)`.
|
|
368
|
+
|
|
369
|
+
## Pro and Business
|
|
370
|
+
|
|
371
|
+
Plate Pro ships `@plate-pro/playwright-suite`, a customer-runnable Playwright browser proof suite covering typing, IME composition, slash commands, table navigation, two-tab sync, Ink draw-and-send, and mobile viewports. Plate Business adds `@plate-business/security-proof` adversarial canaries and `plate verify` CI for schema-derived fuzzing, shrunk counterexamples, and zero-PII PR verification. See [Pricing](/pricing).
|
package/dist/docs/upload.md
CHANGED
|
@@ -370,3 +370,7 @@ URL and ordinary media fields. JSON preserves unresolved drafts; external HTML,
|
|
|
370
370
|
Markdown, and static rendering omit them. An editor that loads drafts for
|
|
371
371
|
static rendering must include `BaseUploadPlugin`; completed media alone needs only the media
|
|
372
372
|
plugins.
|
|
373
|
+
|
|
374
|
+
## Pro and Business
|
|
375
|
+
|
|
376
|
+
Plate Pro includes Cloudflare R2 `files-sdk` upload wiring inside the `Potion v2` flagship template and `plate-deploy-cloudflare` deploy skill. Plate Business adds `@plate-business/compliance-pdf` for SSRF-hardened raster media inlining into zero-network compliance PDFs. See [Pricing](/pricing).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Eo as PluginReference, _t as EditorDocumentValue } from "../../tx-only-
|
|
2
|
-
import { h as EditorApplicationSchema } from "../../htmlTypes-
|
|
3
|
-
import { o as Editor } from "../../core-
|
|
4
|
-
import { i as DocxErrorDiagnostic, n as DocxComment, r as DocxDiagnostic, s as DocxWarningDiagnostic, t as DocxSource } from "../../source-
|
|
5
|
-
import "../../widths-
|
|
1
|
+
import { Eo as PluginReference, _t as EditorDocumentValue } from "../../tx-only-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import { h as EditorApplicationSchema } from "../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { o as Editor } from "../../core-DoxvjG5W.js";
|
|
4
|
+
import { i as DocxErrorDiagnostic, n as DocxComment, r as DocxDiagnostic, s as DocxWarningDiagnostic, t as DocxSource } from "../../source-PTxjcq4_.js";
|
|
5
|
+
import "../../widths-DN1W6m66.js";
|
|
6
6
|
/**
|
|
7
7
|
* Character-level visual styling for Word runs in `DocxExportStyles`.
|
|
8
8
|
* All color values accept CSS hex, rgb/rgba, hsl/hsla, or standard CSS named colors.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Eo as PluginReference, Wl as Value, _t as EditorDocumentValue } from "../../tx-only-
|
|
2
|
-
import { h as EditorApplicationSchema } from "../../htmlTypes-
|
|
3
|
-
import { o as Editor } from "../../core-
|
|
4
|
-
import { y as CommentRemoteUpsert } from "../../index-
|
|
5
|
-
import { a as DocxImportLimits, i as DocxErrorDiagnostic, n as DocxComment, o as DocxSourceLocation, r as DocxDiagnostic, s as DocxWarningDiagnostic, t as DocxSource } from "../../source-
|
|
1
|
+
import { Eo as PluginReference, Wl as Value, _t as EditorDocumentValue } from "../../tx-only-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import { h as EditorApplicationSchema } from "../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { o as Editor } from "../../core-DoxvjG5W.js";
|
|
4
|
+
import { y as CommentRemoteUpsert } from "../../index-DsKfZoY4.js";
|
|
5
|
+
import { a as DocxImportLimits, i as DocxErrorDiagnostic, n as DocxComment, o as DocxSourceLocation, r as DocxDiagnostic, s as DocxWarningDiagnostic, t as DocxSource } from "../../source-PTxjcq4_.js";
|
|
6
6
|
/** Author profile generated for one imported Word comment. */
|
|
7
7
|
type DocxCommentUser = Readonly<{
|
|
8
8
|
id: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Wl as Value, gt as EditorDocumentRecords } from "../../tx-only-
|
|
2
|
-
import { d as HtmlSerializeResult, f as HtmlSliceParseResult, i as HtmlEditorParseOptions, r as HtmlDocumentParseResult } from "../../htmlTypes-
|
|
3
|
-
import { fo as PluginReference, p as BasePlugin, uo as PluginDependency } from "../../core-
|
|
4
|
-
import "../../index-
|
|
1
|
+
import { Wl as Value, gt as EditorDocumentRecords } from "../../tx-only-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import { d as HtmlSerializeResult, f as HtmlSliceParseResult, i as HtmlEditorParseOptions, r as HtmlDocumentParseResult } from "../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { fo as PluginReference, p as BasePlugin, uo as PluginDependency } from "../../core-DoxvjG5W.js";
|
|
4
|
+
import "../../index-CfqQvdcO.js";
|
|
5
5
|
/** Normalizes Word clipboard payloads before the installed HTML parser runs. */
|
|
6
6
|
declare const WordPastePlugin: BasePlugin<Readonly<{
|
|
7
7
|
readonly dependencies: readonly [PluginReference<"html"> & PluginDependency<Readonly<{
|
package/dist/dom/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as DOMVisualPoint, B as ScrollMargin, C as DOMElement, D as DOMSelection, E as DOMRange, F as DataTransferFormat, G as HotkeyMatchOptions, H as dataTransferFormats, I as DataTransferSchemaClaim, J as KeyboardEventLike, K as HotkeyPlatform, L as DataTransferSnapshot, M as DataTransferDecodeContext, N as DataTransferDiagnostic, O as DOMStaticRange, P as DataTransferEncodeContext, R as ScrollIntoViewOptions, T as DOMPoint, U as domCommands, V as ViewportRect, W as writeDataTransferFragment, Y as ariaKeyShortcuts, _ as DOMDragStart, a as usesAppleDOMHotkeys, b as DOMDropTargetInput, c as DOMApi, g as DOMDragApi, i as isHotkey, j as DOMVisualPointOptions, k as DOMText, l as DOMClipboardApi, o as ClipboardSliceRead, q as HotkeySpec, r as DropIndicator, s as ClipboardSliceWrite, v as DOMDropEdge, w as DOMNode, x as DOMDropTargetOptions, y as DOMDropTarget, z as ScrollIntoViewTarget } from "../index-
|
|
1
|
+
import { A as DOMVisualPoint, B as ScrollMargin, C as DOMElement, D as DOMSelection, E as DOMRange, F as DataTransferFormat, G as HotkeyMatchOptions, H as dataTransferFormats, I as DataTransferSchemaClaim, J as KeyboardEventLike, K as HotkeyPlatform, L as DataTransferSnapshot, M as DataTransferDecodeContext, N as DataTransferDiagnostic, O as DOMStaticRange, P as DataTransferEncodeContext, R as ScrollIntoViewOptions, T as DOMPoint, U as domCommands, V as ViewportRect, W as writeDataTransferFragment, Y as ariaKeyShortcuts, _ as DOMDragStart, a as usesAppleDOMHotkeys, b as DOMDropTargetInput, c as DOMApi, g as DOMDragApi, i as isHotkey, j as DOMVisualPointOptions, k as DOMText, l as DOMClipboardApi, o as ClipboardSliceRead, q as HotkeySpec, r as DropIndicator, s as ClipboardSliceWrite, v as DOMDropEdge, w as DOMNode, x as DOMDropTargetOptions, y as DOMDropTarget, z as ScrollIntoViewTarget } from "../index-BujEk356.js";
|
|
2
2
|
export { type ClipboardSliceRead, type ClipboardSliceWrite, type DOMApi, type DOMClipboardApi, type DOMDragApi, type DOMDragStart, type DOMDropEdge, type DOMDropTarget, type DOMDropTargetInput, type DOMDropTargetOptions, type DOMElement, type DOMNode, type DOMPoint, type DOMRange, type DOMSelection, type DOMStaticRange, type DOMText, type DOMVisualPoint, type DOMVisualPointOptions, type DataTransferDecodeContext, type DataTransferDiagnostic, type DataTransferEncodeContext, type DataTransferFormat, type DataTransferSchemaClaim, type DataTransferSnapshot, type DropIndicator, type HotkeyMatchOptions, type HotkeyPlatform, type HotkeySpec, type KeyboardEventLike, type ScrollIntoViewOptions, type ScrollIntoViewTarget, type ScrollMargin, type ViewportRect, ariaKeyShortcuts, dataTransferFormats, domCommands, isHotkey, usesAppleDOMHotkeys, writeDataTransferFragment };
|