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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as EditorCommandDispatch, $o as Range, $r as EditorUpdateContext, $s as SchemaPropertyDefinition, Al as TransferPlugin$1, As as SchemaElementFor, Bi as Location, Bo as PropertyEnumDescriptor, D as Decoration, Da as NodeSelection, Di as HistoryApi, Do as PluginTypeProvider, En as EditorSchemaElement, Eo as PluginReference$1, Es as SchemaContentRule, Et as EditorGenericMethod, Fn as EditorSchemaPlugin, Fs as SchemaElementProperty, Ft as EditorLifecycleErrorSink, Gn as EditorSchemaSourceProvider, Gr as EditorTransactionSpecBuilder, H as EditorAboveOptions, Hl as TxMethodDeclarations, Ht as EditorNodeGetOptions, In as EditorSchemaPluginProvider, Is as SchemaElementPropertyDefinition, Js as SchemaNodeTypeProvider, Jt as EditorPreviousOptions, Ki as MaximizeMode, Kl as WithNodeTarget, Kt as EditorNodesReadOptions, L as DescendantIn, Mo as PluginWitnessFor, Mt as EditorJsonValue, N as Descendant, Ni as InitialValue, Nt as EditorLevelsOptions, O as DecorationAttributes, Oo as PluginTypeProviderOf, Os as SchemaElement, Po as Point$1, Ps as SchemaElementPropertiesFor, Qa as Plugin, Qo as PropertyValueOptions, Ra as NodeTypeSelector, Ri as LeafPosition, Ro as PropertyBooleanDescriptor, Rt as EditorNextOptions, Sn as EditorSchemaDeclaration, Sr as EditorTextChangeContext, T as ContentSlice$1, Ta as NodeRemoveNodesOptions, Tn as EditorSchemaDerivedDefinition, U as EditorBlockOptions, Uc as StripTxOnly, Uo as PropertyNumberDescriptor, Ur as EditorTransactionSelectionApi, Us as SchemaElementTypes, Ut as EditorNodeTypeProvider, V as Editor$1, Vl as TxDeclaredMethod, Vo as PropertyJsonDescriptor, Wa as Path, Wl as Value, Wo as PropertyOptionsOf, Wt as EditorNodeUnsetOptions, Xa as PersistedSelection, Xc as Text$1, Xi as Node$1, Xs as SchemaPluginsOf, Yo as PropertyValueDescriptor, Zo as PropertyValueOf, Zs as SchemaProperty, _a as NodeMatch, _c as SchemaTextPropertyDefinition, _t as EditorDocumentValue, bc as SchemaTypesTarget, ci as EditorUpdateTransactionProvider, co as PluginContribution, do as PluginDefinitionInput, dt as EditorCoreStateView, ei as EditorUpdateMethods, en as EditorReadMethodRecord, er as EditorSelectionBlockOptions, fc as SchemaTarget, fi as EditorValueTypeProvider, fl as TextTarget, fo as PluginDependencyContractReference, fs as RootKey, gc as SchemaTextProperty, gi as Element$1, gl as TransactionSpec, go as PluginInstalledCapabilitiesOf, gs as SchemaContentDefault, gt as EditorDocumentRecords, hc as SchemaTextProperties, hs as SchemaContent, ht as EditorDirectUpdate, ia as NodeEntry, ic as SchemaPropertyKey, io as PluginCapabilities, j as DefinitionOf$1, ja as NodeTarget, jl as TransferRead, jr as EditorTransactionChangeContext, k as DecorationRefresh, ka as NodeSetNodesOptions, ks as SchemaElementConstructionPropertiesFor, kt as EditorInstalledUpdateGroups, la as NodeIn, li as EditorUpdateValueFromPlugin, mo as PluginDependencyReferenceFor, mr as EditorStateSelectionApi, nn as EditorReadMethods, oi as EditorUpdateTransaction, ol as TextInsertTextOptions, p as AuthoredProjectionDiagnostic, pc as SchemaText, pn as EditorSchemaContract, po as PluginDependencyReference, pr as EditorStateSchemaApi, ps as SchemaBlockContentOptions, qo as PropertyStringDescriptor, qs as SchemaKeyPrefix, qt as EditorParentOptions, ri as EditorUpdateResult, si as EditorUpdateTransactionOf, st as EditorCommitContext, tc as SchemaPropertyHandle, ti as EditorUpdatePolicy, tn as EditorReadMethodTree, ua as NodeInsertNodesOptions, uo as PluginDefinition, v as BlockInsertOptions$1, va as NodeMatchPredicate, vl as TransferApi, wi as ElementOf, wr as EditorToggleBlockOptions, xn as EditorSchemaContribution, xr as EditorStateViewProvider, xs as SchemaContentRootContribution, yc as SchemaTextPropertyOptions, yo as PluginPortal, yr as EditorStateView, zt as EditorNodeChangeContext } from "./tx-only-
|
|
2
|
-
import { d as HtmlSerializeResult, f as HtmlSliceParseResult, g as StructuralPlainTextDiagnostic, h as EditorApplicationSchema, i as HtmlEditorParseOptions, r as HtmlDocumentParseResult, t as HtmlApi } from "./htmlTypes-
|
|
3
|
-
import { B as ScrollMargin, M as DataTransferDecodeContext, P as DataTransferEncodeContext, R as ScrollIntoViewOptions, c as DOMApi, l as DOMClipboardApi, q as HotkeySpec } from "./index-
|
|
4
|
-
import { a as HistoryStateApi, i as HistoryPlugin$1, o as HistoryTxApi } from "./index-
|
|
1
|
+
import { $ as EditorCommandDispatch, $o as Range, $r as EditorUpdateContext, $s as SchemaPropertyDefinition, Al as TransferPlugin$1, As as SchemaElementFor, Bi as Location, Bo as PropertyEnumDescriptor, D as Decoration, Da as NodeSelection, Di as HistoryApi, Do as PluginTypeProvider, En as EditorSchemaElement, Eo as PluginReference$1, Es as SchemaContentRule, Et as EditorGenericMethod, Fn as EditorSchemaPlugin, Fs as SchemaElementProperty, Ft as EditorLifecycleErrorSink, Gn as EditorSchemaSourceProvider, Gr as EditorTransactionSpecBuilder, H as EditorAboveOptions, Hl as TxMethodDeclarations, Ht as EditorNodeGetOptions, In as EditorSchemaPluginProvider, Is as SchemaElementPropertyDefinition, Js as SchemaNodeTypeProvider, Jt as EditorPreviousOptions, Ki as MaximizeMode, Kl as WithNodeTarget, Kt as EditorNodesReadOptions, L as DescendantIn, Mo as PluginWitnessFor, Mt as EditorJsonValue, N as Descendant, Ni as InitialValue, Nt as EditorLevelsOptions, O as DecorationAttributes, Oo as PluginTypeProviderOf, Os as SchemaElement, Po as Point$1, Ps as SchemaElementPropertiesFor, Qa as Plugin, Qo as PropertyValueOptions, Ra as NodeTypeSelector, Ri as LeafPosition, Ro as PropertyBooleanDescriptor, Rt as EditorNextOptions, Sn as EditorSchemaDeclaration, Sr as EditorTextChangeContext, T as ContentSlice$1, Ta as NodeRemoveNodesOptions, Tn as EditorSchemaDerivedDefinition, U as EditorBlockOptions, Uc as StripTxOnly, Uo as PropertyNumberDescriptor, Ur as EditorTransactionSelectionApi, Us as SchemaElementTypes, Ut as EditorNodeTypeProvider, V as Editor$1, Vl as TxDeclaredMethod, Vo as PropertyJsonDescriptor, Wa as Path, Wl as Value, Wo as PropertyOptionsOf, Wt as EditorNodeUnsetOptions, Xa as PersistedSelection, Xc as Text$1, Xi as Node$1, Xs as SchemaPluginsOf, Yo as PropertyValueDescriptor, Zo as PropertyValueOf, Zs as SchemaProperty, _a as NodeMatch, _c as SchemaTextPropertyDefinition, _t as EditorDocumentValue, bc as SchemaTypesTarget, ci as EditorUpdateTransactionProvider, co as PluginContribution, do as PluginDefinitionInput, dt as EditorCoreStateView, ei as EditorUpdateMethods, en as EditorReadMethodRecord, er as EditorSelectionBlockOptions, fc as SchemaTarget, fi as EditorValueTypeProvider, fl as TextTarget, fo as PluginDependencyContractReference, fs as RootKey, gc as SchemaTextProperty, gi as Element$1, gl as TransactionSpec, go as PluginInstalledCapabilitiesOf, gs as SchemaContentDefault, gt as EditorDocumentRecords, hc as SchemaTextProperties, hs as SchemaContent, ht as EditorDirectUpdate, ia as NodeEntry, ic as SchemaPropertyKey, io as PluginCapabilities, j as DefinitionOf$1, ja as NodeTarget, jl as TransferRead, jr as EditorTransactionChangeContext, k as DecorationRefresh, ka as NodeSetNodesOptions, ks as SchemaElementConstructionPropertiesFor, kt as EditorInstalledUpdateGroups, la as NodeIn, li as EditorUpdateValueFromPlugin, mo as PluginDependencyReferenceFor, mr as EditorStateSelectionApi, nn as EditorReadMethods, oi as EditorUpdateTransaction, ol as TextInsertTextOptions, p as AuthoredProjectionDiagnostic, pc as SchemaText, pn as EditorSchemaContract, po as PluginDependencyReference, pr as EditorStateSchemaApi, ps as SchemaBlockContentOptions, qo as PropertyStringDescriptor, qs as SchemaKeyPrefix, qt as EditorParentOptions, ri as EditorUpdateResult, si as EditorUpdateTransactionOf, st as EditorCommitContext, tc as SchemaPropertyHandle, ti as EditorUpdatePolicy, tn as EditorReadMethodTree, ua as NodeInsertNodesOptions, uo as PluginDefinition, v as BlockInsertOptions$1, va as NodeMatchPredicate, vl as TransferApi, wi as ElementOf, wr as EditorToggleBlockOptions, xn as EditorSchemaContribution, xr as EditorStateViewProvider, xs as SchemaContentRootContribution, yc as SchemaTextPropertyOptions, yo as PluginPortal, yr as EditorStateView, zt as EditorNodeChangeContext } from "./tx-only-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import { d as HtmlSerializeResult, f as HtmlSliceParseResult, g as StructuralPlainTextDiagnostic, h as EditorApplicationSchema, i as HtmlEditorParseOptions, r as HtmlDocumentParseResult, t as HtmlApi } from "./htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { B as ScrollMargin, M as DataTransferDecodeContext, P as DataTransferEncodeContext, R as ScrollIntoViewOptions, c as DOMApi, l as DOMClipboardApi, q as HotkeySpec } from "./index-BujEk356.js";
|
|
4
|
+
import { a as HistoryStateApi, i as HistoryPlugin$1, o as HistoryTxApi } from "./index-Zj4bj9bZ.js";
|
|
5
5
|
import { Draft } from "mutative";
|
|
6
6
|
import { BlockContent, Blockquote, Break, Code, DefinitionContent, Delete, Emphasis, FootnoteDefinition, FootnoteReference, Heading, Html, Image, InlineCode, Link, List, ListItem, Paragraph, PhrasingContent, RootContent, Strong, Table, TableCell, TableRow, Text, ThematicBreak } from "mdast";
|
|
7
7
|
import { InlineMath, Math } from "mdast-util-math";
|
|
@@ -93,6 +93,11 @@ type PluginDeclarationProperties<TDeclaration> = TDeclaration extends Readonly<{
|
|
|
93
93
|
type PluginDeclarationContentRoots<TDeclaration> = TDeclaration extends Readonly<{
|
|
94
94
|
contentRoots: infer TContentRoots extends readonly SchemaContentRootContribution[];
|
|
95
95
|
}> ? TContentRoots : readonly [];
|
|
96
|
+
type PluginDeclarationRoots<TDeclaration> = TDeclaration extends Readonly<{
|
|
97
|
+
roots: infer TRoots extends Readonly<Record<string, SchemaContent>>;
|
|
98
|
+
}> ? Readonly<{
|
|
99
|
+
roots: TRoots;
|
|
100
|
+
}> : unknown;
|
|
96
101
|
type PluginMarkDescriptor<TMark> = TMark extends PropertyValueDescriptor ? TMark : TMark extends Readonly<{
|
|
97
102
|
property: infer TDescriptor extends PropertyValueDescriptor;
|
|
98
103
|
}> ? TDescriptor : never;
|
|
@@ -108,7 +113,7 @@ type LowerPluginSchemaDeclaration<TDeclaration, TElementType extends string, TPr
|
|
|
108
113
|
element: infer TElement extends SchemaElement;
|
|
109
114
|
}> ? Readonly<{ [TKey in TElementType]: TElement; }> : Readonly<Record<never, never>>;
|
|
110
115
|
properties: readonly [...PluginDeclarationProperties<TDeclaration>, ...PluginMarkProperties<TDeclaration, TPropertyKey>];
|
|
111
|
-
}>;
|
|
116
|
+
}> & PluginDeclarationRoots<TDeclaration>;
|
|
112
117
|
type InferExactPluginSchemaContributionForDefinition<C extends AnyBasePluginDefinition> = C extends Readonly<{
|
|
113
118
|
schema: infer TSchema extends PluginSchemaDeclaration;
|
|
114
119
|
}> ? LowerPluginSchemaDeclaration<ResolvePluginSchemaDeclaration<TSchema>, InferPluginElementType<C>, InferPluginMarkKey<C>> : never;
|
|
@@ -398,31 +403,44 @@ type PluginSchemaElement = SchemaElement & Readonly<{
|
|
|
398
403
|
type?: string;
|
|
399
404
|
}>;
|
|
400
405
|
type PluginSchemaPropertyMap = Readonly<Record<string, SchemaPropertyDefinition | SchemaProperty>>;
|
|
406
|
+
/** Named secondary document roots contributed by a plugin schema (excluding reserved `main`). */
|
|
407
|
+
type PluginSchemaRootMap = Readonly<Record<string, SchemaContent>>;
|
|
401
408
|
type PluginElementSchemaDeclaration = Readonly<{
|
|
402
409
|
contentRoots?: readonly SchemaContentRootContribution[];
|
|
403
410
|
element: PluginSchemaElement;
|
|
404
411
|
mark?: never;
|
|
405
412
|
properties?: PluginSchemaPropertyMap;
|
|
413
|
+
roots?: PluginSchemaRootMap;
|
|
406
414
|
}>;
|
|
407
415
|
type PluginSchemaText = Readonly<{
|
|
408
416
|
contentRoots?: readonly SchemaContentRootContribution[];
|
|
409
417
|
element?: never;
|
|
410
418
|
mark: PluginSchemaMark;
|
|
411
419
|
properties?: PluginSchemaPropertyMap;
|
|
420
|
+
roots?: PluginSchemaRootMap;
|
|
412
421
|
}>;
|
|
413
422
|
type PluginSchemaProperties = Readonly<{
|
|
414
423
|
contentRoots?: readonly SchemaContentRootContribution[];
|
|
415
424
|
element?: never;
|
|
416
425
|
mark?: never;
|
|
417
426
|
properties: PluginSchemaPropertyMap;
|
|
427
|
+
roots?: PluginSchemaRootMap;
|
|
418
428
|
}>;
|
|
419
429
|
type PluginSchemaContentRoots = Readonly<{
|
|
420
430
|
contentRoots: readonly SchemaContentRootContribution[];
|
|
421
431
|
element?: never;
|
|
422
432
|
mark?: never;
|
|
423
433
|
properties?: PluginSchemaPropertyMap;
|
|
434
|
+
roots?: PluginSchemaRootMap;
|
|
424
435
|
}>;
|
|
425
|
-
type
|
|
436
|
+
type PluginSchemaRoots = Readonly<{
|
|
437
|
+
contentRoots?: readonly SchemaContentRootContribution[];
|
|
438
|
+
element?: never;
|
|
439
|
+
mark?: never;
|
|
440
|
+
properties?: PluginSchemaPropertyMap;
|
|
441
|
+
roots: PluginSchemaRootMap;
|
|
442
|
+
}>;
|
|
443
|
+
type PluginSchemaDeclaration = PluginSchemaContentRoots | PluginElementSchemaDeclaration | PluginSchemaProperties | PluginSchemaRoots | PluginSchemaText;
|
|
426
444
|
/** A frozen schema contribution or a pure configured contribution factory. */
|
|
427
445
|
type PluginSchema<C extends AnyBasePluginDefinition = BasePluginDefinition> = ((context: PluginSchemaContext<C>) => PluginSchemaDeclaration) | PluginSchemaDeclaration;
|
|
428
446
|
type PluginRuntimeContext<C extends AnyBasePluginDefinition = BasePluginDefinition> = Readonly<{
|
|
@@ -1139,12 +1157,7 @@ declare const BaseItalicPlugin: BasePlugin<Readonly<{
|
|
|
1139
1157
|
}>>;
|
|
1140
1158
|
/** Enables support for keyboard-input formatting. */
|
|
1141
1159
|
declare const BaseKbdPlugin: BasePlugin<Readonly<{
|
|
1142
|
-
|
|
1143
|
-
rules: true;
|
|
1144
|
-
}> & Readonly<{
|
|
1145
|
-
name: "kbd";
|
|
1146
|
-
}> & Readonly<Record<never, never>> & Readonly<{
|
|
1147
|
-
__pluginWritableProperties: Readonly<{
|
|
1160
|
+
readonly __pluginWritableProperties: Readonly<{
|
|
1148
1161
|
descriptor: PropertyBooleanDescriptor<{
|
|
1149
1162
|
readonly default: false;
|
|
1150
1163
|
readonly omitDefault: true;
|
|
@@ -1156,13 +1169,17 @@ declare const BaseKbdPlugin: BasePlugin<Readonly<{
|
|
|
1156
1169
|
unaliased: true;
|
|
1157
1170
|
value: boolean;
|
|
1158
1171
|
}>;
|
|
1159
|
-
schema: {
|
|
1172
|
+
readonly schema: {
|
|
1160
1173
|
readonly mark: PropertyBooleanDescriptor<{
|
|
1161
1174
|
readonly default: false;
|
|
1162
1175
|
readonly omitDefault: true;
|
|
1163
1176
|
}>;
|
|
1164
1177
|
};
|
|
1165
|
-
|
|
1178
|
+
readonly name: "kbd";
|
|
1179
|
+
readonly contributions: true;
|
|
1180
|
+
readonly formats: true;
|
|
1181
|
+
readonly rules: true;
|
|
1182
|
+
}>> & Readonly<Record<never, never>>;
|
|
1166
1183
|
/** Enables subscript and superscript through one enum-valued mark. */
|
|
1167
1184
|
declare const BaseScriptPlugin: BasePlugin<Readonly<{
|
|
1168
1185
|
formats: true;
|
|
@@ -1571,6 +1588,7 @@ declare const BaseFormattingPlugin: BasePlugin<Readonly<{}> & Readonly<{
|
|
|
1571
1588
|
}>>;
|
|
1572
1589
|
declare const isLineHeight: (value: unknown) => value is number;
|
|
1573
1590
|
type Alignment = 'center' | 'end' | 'justify' | 'left' | 'right' | 'start';
|
|
1591
|
+
declare const isSafeStyleString: (value: unknown) => value is string;
|
|
1574
1592
|
declare const BaseFontBackgroundColorPlugin: BasePlugin<Readonly<{
|
|
1575
1593
|
formats: true;
|
|
1576
1594
|
inject: true;
|
|
@@ -1578,7 +1596,10 @@ declare const BaseFontBackgroundColorPlugin: BasePlugin<Readonly<{
|
|
|
1578
1596
|
name: "backgroundColor";
|
|
1579
1597
|
}> & Readonly<Record<never, never>> & Readonly<{
|
|
1580
1598
|
__pluginWritableProperties: Readonly<{
|
|
1581
|
-
descriptor: PropertyStringDescriptor<
|
|
1599
|
+
descriptor: PropertyStringDescriptor<{
|
|
1600
|
+
readonly validate: typeof isSafeStyleString;
|
|
1601
|
+
readonly validationVersion: 1;
|
|
1602
|
+
}>;
|
|
1582
1603
|
key: "backgroundColor";
|
|
1583
1604
|
localId: "backgroundColor";
|
|
1584
1605
|
ownerName: "backgroundColor";
|
|
@@ -1587,7 +1608,10 @@ declare const BaseFontBackgroundColorPlugin: BasePlugin<Readonly<{
|
|
|
1587
1608
|
value: string;
|
|
1588
1609
|
}>;
|
|
1589
1610
|
schema: {
|
|
1590
|
-
readonly mark: PropertyStringDescriptor<
|
|
1611
|
+
readonly mark: PropertyStringDescriptor<{
|
|
1612
|
+
readonly validate: typeof isSafeStyleString;
|
|
1613
|
+
readonly validationVersion: 1;
|
|
1614
|
+
}>;
|
|
1591
1615
|
};
|
|
1592
1616
|
}>>;
|
|
1593
1617
|
declare const BaseFontColorPlugin: BasePlugin<Readonly<{
|
|
@@ -1597,7 +1621,10 @@ declare const BaseFontColorPlugin: BasePlugin<Readonly<{
|
|
|
1597
1621
|
name: "color";
|
|
1598
1622
|
}> & Readonly<Record<never, never>> & Readonly<{
|
|
1599
1623
|
__pluginWritableProperties: Readonly<{
|
|
1600
|
-
descriptor: PropertyStringDescriptor<
|
|
1624
|
+
descriptor: PropertyStringDescriptor<{
|
|
1625
|
+
readonly validate: typeof isSafeStyleString;
|
|
1626
|
+
readonly validationVersion: 1;
|
|
1627
|
+
}>;
|
|
1601
1628
|
key: "color";
|
|
1602
1629
|
localId: "color";
|
|
1603
1630
|
ownerName: "color";
|
|
@@ -1606,7 +1633,10 @@ declare const BaseFontColorPlugin: BasePlugin<Readonly<{
|
|
|
1606
1633
|
value: string;
|
|
1607
1634
|
}>;
|
|
1608
1635
|
schema: {
|
|
1609
|
-
readonly mark: PropertyStringDescriptor<
|
|
1636
|
+
readonly mark: PropertyStringDescriptor<{
|
|
1637
|
+
readonly validate: typeof isSafeStyleString;
|
|
1638
|
+
readonly validationVersion: 1;
|
|
1639
|
+
}>;
|
|
1610
1640
|
};
|
|
1611
1641
|
}>>;
|
|
1612
1642
|
declare const BaseFontFamilyPlugin: BasePlugin<Readonly<{
|
|
@@ -1616,7 +1646,10 @@ declare const BaseFontFamilyPlugin: BasePlugin<Readonly<{
|
|
|
1616
1646
|
name: "fontFamily";
|
|
1617
1647
|
}> & Readonly<Record<never, never>> & Readonly<{
|
|
1618
1648
|
__pluginWritableProperties: Readonly<{
|
|
1619
|
-
descriptor: PropertyStringDescriptor<
|
|
1649
|
+
descriptor: PropertyStringDescriptor<{
|
|
1650
|
+
readonly validate: typeof isSafeStyleString;
|
|
1651
|
+
readonly validationVersion: 1;
|
|
1652
|
+
}>;
|
|
1620
1653
|
key: "fontFamily";
|
|
1621
1654
|
localId: "fontFamily";
|
|
1622
1655
|
ownerName: "fontFamily";
|
|
@@ -1625,7 +1658,10 @@ declare const BaseFontFamilyPlugin: BasePlugin<Readonly<{
|
|
|
1625
1658
|
value: string;
|
|
1626
1659
|
}>;
|
|
1627
1660
|
schema: {
|
|
1628
|
-
readonly mark: PropertyStringDescriptor<
|
|
1661
|
+
readonly mark: PropertyStringDescriptor<{
|
|
1662
|
+
readonly validate: typeof isSafeStyleString;
|
|
1663
|
+
readonly validationVersion: 1;
|
|
1664
|
+
}>;
|
|
1629
1665
|
};
|
|
1630
1666
|
}>>;
|
|
1631
1667
|
declare const BaseFontSizePlugin: BasePlugin<Readonly<{
|
|
@@ -1635,7 +1671,10 @@ declare const BaseFontSizePlugin: BasePlugin<Readonly<{
|
|
|
1635
1671
|
name: "fontSize";
|
|
1636
1672
|
}> & Readonly<Record<never, never>> & Readonly<{
|
|
1637
1673
|
__pluginWritableProperties: Readonly<{
|
|
1638
|
-
descriptor: PropertyStringDescriptor<
|
|
1674
|
+
descriptor: PropertyStringDescriptor<{
|
|
1675
|
+
readonly validate: typeof isSafeStyleString;
|
|
1676
|
+
readonly validationVersion: 1;
|
|
1677
|
+
}>;
|
|
1639
1678
|
key: "fontSize";
|
|
1640
1679
|
localId: "fontSize";
|
|
1641
1680
|
ownerName: "fontSize";
|
|
@@ -1644,7 +1683,10 @@ declare const BaseFontSizePlugin: BasePlugin<Readonly<{
|
|
|
1644
1683
|
value: string;
|
|
1645
1684
|
}>;
|
|
1646
1685
|
schema: {
|
|
1647
|
-
readonly mark: PropertyStringDescriptor<
|
|
1686
|
+
readonly mark: PropertyStringDescriptor<{
|
|
1687
|
+
readonly validate: typeof isSafeStyleString;
|
|
1688
|
+
readonly validationVersion: 1;
|
|
1689
|
+
}>;
|
|
1648
1690
|
};
|
|
1649
1691
|
}>>;
|
|
1650
1692
|
/** Enables configurable line spacing on targeted block elements. */
|
|
@@ -6831,6 +6873,9 @@ type ExactSchemaContribution<C> = C extends Readonly<{
|
|
|
6831
6873
|
type SchemaContributionElements<TContribution> = TContribution extends Readonly<{
|
|
6832
6874
|
elements?: infer TElements;
|
|
6833
6875
|
}> ? Extract<NonNullable<TElements>, Readonly<Record<string, SchemaElement>>> : never;
|
|
6876
|
+
type SchemaContributionRoots<TContribution> = TContribution extends Readonly<{
|
|
6877
|
+
roots?: infer TRoots;
|
|
6878
|
+
}> ? Extract<NonNullable<TRoots>, NonNullable<EditorSchemaContribution['roots']>> : never;
|
|
6834
6879
|
type ThreeValuedTruth = 'no' | 'unknown' | 'yes';
|
|
6835
6880
|
type NegateThreeValuedTruth<TTruth extends ThreeValuedTruth> = [TTruth] extends ['yes'] ? 'no' : [TTruth] extends ['no'] ? 'yes' : 'unknown';
|
|
6836
6881
|
type AndThreeValuedTruth<TTruth extends ThreeValuedTruth> = [TTruth] extends [never] ? 'yes' : 'no' extends TTruth ? 'no' : 'unknown' extends TTruth ? 'unknown' : 'yes';
|
|
@@ -6924,7 +6969,7 @@ type InstalledPluginElementTypesForPlugins<D, TPlugins extends ReadonlyArray<Plu
|
|
|
6924
6969
|
type ResolvePluginTargetProperty<TInstalledDefinition, D extends AnyBasePluginDefinition, TProperty> = TProperty extends SchemaElementProperty<infer TKey, infer TDescriptor, infer TTarget> ? TTarget extends SchemaTypesTarget<infer TTypes> ? string extends TTypes[number] ? InferTargetPlugins<D> extends (infer TPlugins extends ReadonlyArray<PluginReference | string>) ? TPlugins extends readonly [] ? TProperty : SchemaElementProperty<TKey, TDescriptor, SchemaTypesTarget<InstalledPluginElementTypesForPlugins<TInstalledDefinition, TPlugins>>> : never : TProperty : TProperty : TProperty;
|
|
6925
6970
|
type ExactComposedSchemaProperty<TProperty> = TProperty extends SchemaProperty ? string extends TProperty['key'] ? never : TProperty : never;
|
|
6926
6971
|
type ResolvedSchemaContributionProperty<D, TInstalledDefinition = D> = D extends AnyBasePluginDefinition ? SchemaContributionProperty<ExactSchemaContribution<D>> extends (infer TProperty) ? ExactComposedSchemaProperty<ResolvePluginTargetProperty<TInstalledDefinition, D, TProperty>> : never : never;
|
|
6927
|
-
type RawSchemaDeclaration<D> = true extends IsBroadPluginDefinition<D> ? EditorSchemaContribution : EditorSchemaContribution<MergeObjectIntersection<SchemaContributionElements<ExactSchemaContribution<D>>>, ReadonlyArray<ResolvedSchemaContributionProperty<D>>, NonNullable<EditorSchemaContribution['groups']>, NonNullable<EditorSchemaContribution['roots']
|
|
6972
|
+
type RawSchemaDeclaration<D> = true extends IsBroadPluginDefinition<D> ? EditorSchemaContribution : EditorSchemaContribution<MergeObjectIntersection<SchemaContributionElements<ExactSchemaContribution<D>>>, ReadonlyArray<ResolvedSchemaContributionProperty<D>>, NonNullable<EditorSchemaContribution['groups']>, [SchemaContributionRoots<ExactSchemaContribution<D>>] extends [never] ? NonNullable<EditorSchemaContribution['roots']> : MergeObjectIntersection<SchemaContributionRoots<ExactSchemaContribution<D>>>, ReadonlyArray<SchemaContributionContentRoot<ExactSchemaContribution<D>>>>;
|
|
6928
6973
|
type SchemaDefinition<D> = EditorSchemaDerivedDefinition<NonNullable<RawSchemaDeclaration<D>['elements']>, NonNullable<RawSchemaDeclaration<D>['properties']>, NonNullable<RawSchemaDeclaration<D>['groups']>, NonNullable<RawSchemaDeclaration<D>['roots']>, NonNullable<RawSchemaDeclaration<D>['contentRoots']>>;
|
|
6929
6974
|
type SchemaPlugin<D> = EditorSchemaPlugin<SchemaDefinition<D>, 'installed-plugins'>;
|
|
6930
6975
|
type DependencySchemaProviders<TDependencies extends readonly unknown[]> = { readonly [TIndex in keyof TDependencies]: TDependencies[TIndex] extends EditorSchemaPluginProvider<infer TSchema> ? EditorSchemaPluginProvider<TSchema> : never; };
|
|
@@ -8602,6 +8647,7 @@ declare const PLUGINS: {
|
|
|
8602
8647
|
readonly mention: 'mention';
|
|
8603
8648
|
readonly override: 'override';
|
|
8604
8649
|
readonly paragraph: 'paragraph';
|
|
8650
|
+
readonly reference: 'reference';
|
|
8605
8651
|
readonly script: 'script';
|
|
8606
8652
|
readonly singleBlock: 'singleBlock';
|
|
8607
8653
|
readonly singleLine: 'singleLine';
|
package/dist/diff/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as applyDiff, a as ComparisonDiagnostic, b as prepareDiff, c as ComparisonSpan, d as MergeConflictReason, f as MergeRegion, g as PreparedDiff, h as PrepareDiffResult, i as ComparisonCorrespondence, l as MergeConflict, m as MergeResult, n as ComparedChange, o as ComparisonEffect, p as MergeResolution, r as Comparison, s as ComparisonSnapshot, t as ApplyDiffResult, u as MergeConflictProperty, v as compare, y as merge } from "../index-
|
|
2
|
-
import "../index-
|
|
1
|
+
import { _ as applyDiff, a as ComparisonDiagnostic, b as prepareDiff, c as ComparisonSpan, d as MergeConflictReason, f as MergeRegion, g as PreparedDiff, h as PrepareDiffResult, i as ComparisonCorrespondence, l as MergeConflict, m as MergeResult, n as ComparedChange, o as ComparisonEffect, p as MergeResolution, r as Comparison, s as ComparisonSnapshot, t as ApplyDiffResult, u as MergeConflictProperty, v as compare, y as merge } from "../index-CnumypT3-DGx8_6Ye.js";
|
|
2
|
+
import "../index-B-SGl9uM.js";
|
|
3
3
|
export { ApplyDiffResult, ComparedChange, Comparison, ComparisonCorrespondence, ComparisonDiagnostic, ComparisonEffect, ComparisonSnapshot, ComparisonSpan, MergeConflict, MergeConflictProperty, MergeConflictReason, MergeRegion, MergeResolution, MergeResult, PrepareDiffResult, PreparedDiff, applyDiff, compare, merge, prepareDiff };
|
|
@@ -12,10 +12,10 @@ Install from GitHub:
|
|
|
12
12
|
npx skills add udecode/plate --skill plate
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Or install through well-known site discovery:
|
|
15
|
+
Or install through well-known site discovery (use `https://beta.platejs.org` during v2 beta):
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npx skills add https://platejs.org --skill plate
|
|
18
|
+
npx skills add https://beta.platejs.org --skill plate
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Every `platejs` package release also bundles the exact version-matched skill directory at `node_modules/platejs/dist/skills/plate/`, which works with `npx skills experimental_sync`.
|
|
@@ -65,3 +65,7 @@ Follow the plate skill. Read node_modules/platejs/dist/docs/llms.txt first, chec
|
|
|
65
65
|
## Reporting a Plate bug
|
|
66
66
|
|
|
67
67
|
When an agent hits a failure inside `platejs` rather than your app code, `references/report-a-bug.md` instructs it to write a minimal reproduction outside your app, check open issues in `udecode/plate`, show you the draft report, and wait for your confirmation before filing.
|
|
68
|
+
|
|
69
|
+
## Pro and Business
|
|
70
|
+
|
|
71
|
+
Plate Pro ships `plate-deploy-cloudflare`, `plate-deploy-expo`, `plate-deploy-vercel`, and `plate-upgrade` through `plate skills sync` for 1-command self-host deployment, Expo EAS builds, and 3-way upgrades across customized Plate UI files. Plate Business adds the `plate-security-hardening` skill alongside `@plate-business/security-kernel`, `@plate-business/compliance-pdf`, `@plate-business/security-proof`, and `plate verify` CI. See [Pricing](/pricing).
|
package/dist/docs/agents.md
CHANGED
|
@@ -10,7 +10,7 @@ Copy a setup prompt for your stack. It installs Plate, writes an `AGENTS.md` poi
|
|
|
10
10
|
|
|
11
11
|
```text
|
|
12
12
|
Set up Plate UI in this Next.js project. It needs React 19.2+, Tailwind CSS v4, and shadcn/ui.
|
|
13
|
-
If the folder is empty, scaffold the starter first: npx shadcn@latest create
|
|
13
|
+
If the folder is empty, scaffold the starter first: npx shadcn@latest create https://beta.platejs.org/r/base-nova/editor-basic.json --preset b0 --base base --template next
|
|
14
14
|
|
|
15
15
|
1. In an existing project, keep any already-installed platejs version, configure @plate in components.json, and add the basic editor: npx shadcn@latest add @plate/editor-basic
|
|
16
16
|
If this is a new Plate v2 beta project, install platejs@beta so node_modules/platejs/dist/docs/llms.txt is available, and point @plate in components.json to "https://beta.platejs.org/r/{style}/{name}.json".
|
package/dist/docs/ai-agents.md
CHANGED
|
@@ -11,7 +11,7 @@ Plate ships AI capabilities for end users inside your editor as a layered stack:
|
|
|
11
11
|
| Workflow | Entrypoint or kit | Page |
|
|
12
12
|
| --- | --- | --- |
|
|
13
13
|
| Inline Ask AI menu, draft preview, and suggestion diffs | `AIKit`, `AIPlugin`, `AIMenu`, `AILoadingBar` | [AI](/docs/ai) |
|
|
14
|
-
| Multi-turn sidebar chat with `@`
|
|
14
|
+
| Multi-turn sidebar chat with `@` context chips, parameterized commands, and tool markers | `AgentChat`, `PromptEditor`, `CommandBar` | [AI](/docs/ai), [Prompt Editor](/docs/prompt-editor), [Command Bar](/docs/components/command-bar) |
|
|
15
15
|
| Headless document tools, traces, and server-side sync agents | `getEditorTools`, `createEditorAgent`, `createSyncServerAgent`, `onTrace` (`platejs/ai`), `@plate/agent-trace-drawer` | [AI](/docs/ai) |
|
|
16
16
|
| Expose editor tools to browser agents and in-app MCP clients | `registerEditorTools`, `useWebMCP` (`platejs/ai`) | [AI](/docs/ai) |
|
|
17
17
|
| Pen markup over text and media with 1-tap Send to `AgentChat` | `InkKit`, `useEditorAgent({ ink: true })` | [Ink](/docs/ink) |
|
|
@@ -23,7 +23,7 @@ All Plate AI surfaces share the same document model, visibility filters, and rev
|
|
|
23
23
|
|
|
24
24
|
- **One tool catalog across UI, browser, and server.** `platejs/ai` exports zero-React, zero-AI-SDK document tools (`getEditorTools`) so your sidebar `AgentChat`, WebMCP browser clients (`registerEditorTools`), and headless sync workers (`createSyncServerAgent`) execute the same structured operations against the editor schema.
|
|
25
25
|
- **Reviewable proposals instead of silent overwrites.** Selection edits, multi-cell table edits, and Ink-to-Agent replies land as authored proposals (`AuthoredPlugin`) or anchored comments (`CommentsPlugin`) so users accept or reject changes with full undo support.
|
|
26
|
-
- **Consistent safety boundaries.** Recursive visibility filtering (`filter`), `<Locked ref="lN" />` placeholders for [locked blocks](/docs/lock), and default-deny remote media guards (`allowRemoteMediaUrl`, `InertRemoteMediaPlugin`) prevent hidden content leaks and unsafe writes.
|
|
26
|
+
- **Consistent safety boundaries.** Recursive visibility filtering (`filter` as a per-block `EditorVisibilityPredicate` or document-scoped `{ forDocument }` compiler), `<Locked ref="lN" />` placeholders for [locked blocks](/docs/lock), and default-deny remote media guards (`allowRemoteMediaUrl`, `InertRemoteMediaPlugin`) prevent hidden content leaks and unsafe writes.
|
|
27
27
|
|
|
28
28
|
## Quick setup
|
|
29
29
|
|
|
@@ -64,9 +64,9 @@ Add the backing `/api/ai/command` route and model credentials from [AI](/docs/ai
|
|
|
64
64
|
|
|
65
65
|
## Pair AI with collaboration and pen markup
|
|
66
66
|
|
|
67
|
-
- **Run multiple agents inside real-time sync rooms.** Use `createSyncServerAgent` from `platejs/ai` alongside [Sync](/docs/sync) with a `'suggest'` grant so server agents show live presence carets and propose reviewable edits under their own author identity without direct-edit privileges. Forward `onTrace` events through `server.broadcast(room, { name: 'agent-trace', payload: event })` and render
|
|
67
|
+
- **Run multiple agents inside real-time sync rooms.** Use `createSyncServerAgent` from `platejs/ai` alongside [Sync](/docs/sync) with a `'suggest'` grant so server agents show live presence carets and propose reviewable edits under their own author identity without direct-edit privileges. Forward `onTrace` events through `server.broadcast(room, { name: 'agent-trace', payload: event })` and render [Agent Trace Drawer](/docs/components/agent-trace-drawer) (`@plate/agent-trace-drawer`) to inspect each agent's tool calls and jump to affected blocks.
|
|
68
68
|
- **Send handwritten markup straight to the agent.** Pair [Ink](/docs/ink) with `AgentChat` and `useEditorAgent({ ink: true })` to capture visible passages plus Canvas 2D snapshots and receive inline suggestions or anchored comments without locking typing.
|
|
69
|
-
- **Build
|
|
69
|
+
- **Build multi-source `@` prompt inputs and command palettes.** Use [Prompt Editor](/docs/prompt-editor) with `sources` and parameterized `commands` to serialize `@` context chips into `<mention>` tags, or pair it with [Command Bar](/docs/components/command-bar) (`@plate/command-bar`) for a `Cmd+K` command palette.
|
|
70
70
|
|
|
71
71
|
## Next steps
|
|
72
72
|
|
|
@@ -74,3 +74,7 @@ Add the backing `/api/ai/command` route and model credentials from [AI](/docs/ai
|
|
|
74
74
|
- Add ghost-text autocomplete in [Copilot](/docs/copilot).
|
|
75
75
|
- Add pen markup and 1-tap Send to the document agent in [Ink](/docs/ink).
|
|
76
76
|
- Combine AI suggestions with real-time rooms and permissions in [Collaboration](/docs/collaboration).
|
|
77
|
+
|
|
78
|
+
## Pro and Business
|
|
79
|
+
|
|
80
|
+
Plate Pro ships `@plate-pro/collab-do` with a Streamable HTTP MCP agent room endpoint, `@plate-pro/context-chips` for multi-source `@` context expansion and parameterized commands, and `@plate-pro/ink-loop` for server-side handwriting review. Plate Business adds `@plate-business/security-kernel` for server-enforced propose-only agent grants, mutation budgets, and trace redaction, paired with `plate verify --suite ai-sandbox` CI. See [Pricing](/pricing).
|
package/dist/docs/ai.md
CHANGED
|
@@ -771,6 +771,7 @@ Headless exports from `platejs/ai`:
|
|
|
771
771
|
- `getEditorTools(options?: GetEditorToolsOptions): readonly EditorToolDefinition[]` builds the JSON Schema tool list (`access` defaults to `'suggest'`, `prefix` defaults to `'editor'`, and `comments`, `debug`, and `ink` default to `false`).
|
|
772
772
|
- `createEditorAgent(editor, options: EditorAgentOptions): EditorAgent` executes those tools serially against `editor` with required `authorId` and `filter`, plus optional `onTrace?: (event: EditorAgentTraceEvent) => void`.
|
|
773
773
|
- `createSyncServerAgent(server, options: SyncServerAgentOptions): EditorAgent` executes those tools against an authoritative sync server room (`server.run`) under a fixed `{ access, actor: authorId, decide: false }` grant (`access` defaults to `'suggest'`; `comments` is always `false`) with optional `onTrace?: (event: EditorAgentTraceEvent) => void`.
|
|
774
|
+
- `EditorVisibilityFilter` accepts `'allow-all'`, a per-block `EditorVisibilityPredicate` (`({ block, path, root? }) => boolean`), or `{ forDocument: (document: EditorDocumentValue) => EditorVisibilityPredicate }`. Document-scoped `{ forDocument }` filters compile once per document revision and cache their predicate across block lookups, which supports section-wide heading inheritance and owned `childRoots` checks without rescanning the tree per block.
|
|
774
775
|
- `EditorAgentTraceEvent` is the structured lifecycle trace payload (`'running' | 'done' | 'denied' | 'error'`) emitted by `onTrace`.
|
|
775
776
|
- `registerEditorTools(agent, options: RegisterEditorToolsOptions): () => void` registers the agent on `document.modelContext`, `navigator.modelContext`, or explicit `modelContext` targets (no-op on SSR) and returns an idempotent teardown function.
|
|
776
777
|
|
|
@@ -823,3 +824,7 @@ Review states switch automatically inside `AIMenuItems`:
|
|
|
823
824
|
- `hasSuggestion` (`mode === 'suggestion' && changeId !== null`): shows Accept, Discard, and Try again.
|
|
824
825
|
- `hasDraft` (`draftNodes.length > 0`): shows Accept (or Replace selection and Insert below for edit drafts without `AuthoredPlugin`), Discard, and Try again.
|
|
825
826
|
- Idle: shows `SELECTION_COMMANDS` when text or blocks are selected, or `CURSOR_COMMANDS` at a collapsed caret.
|
|
827
|
+
|
|
828
|
+
## Pro and Business
|
|
829
|
+
|
|
830
|
+
Plate Pro ships `@plate-pro/collab-do` with a Streamable HTTP MCP agent room endpoint, `@plate-pro/context-chips` for multi-source `@` context expansion, and the `Potion v2` and `Paper v2` flagship templates. Plate Business adds `@plate-business/security-kernel` for server-enforced propose-only agent sandboxes, mutation budgets, and agent trace redaction, plus `plate verify --suite ai-sandbox` CI. See [Pricing](/pricing).
|
package/dist/docs/api/plate.md
CHANGED
|
@@ -20,14 +20,22 @@ the React and static paths need React.
|
|
|
20
20
|
| Import | Use | Optional peer |
|
|
21
21
|
| --- | --- | --- |
|
|
22
22
|
| `platejs` | Headless editor creation, Plate plugins, editor APIs, core types, and utilities. | None |
|
|
23
|
-
| `platejs/react` | React editor creation, components, hooks, stores, and React plugins. |
|
|
24
|
-
| `platejs/react/virtualized` | `VirtualizedEditorContent`, which omits offscreen top-level blocks from the DOM. | `@tanstack/react-virtual`,
|
|
25
|
-
| `platejs/static` | `EditorStatic`,
|
|
23
|
+
| `platejs/react` | React editor creation, components, hooks, stores, and React plugins. | `react`, `react-dom` |
|
|
24
|
+
| `platejs/react/virtualized` | `VirtualizedEditorContent`, which omits offscreen top-level blocks from the DOM. | `@tanstack/react-virtual`, `react`, `react-dom` |
|
|
25
|
+
| `platejs/static` | `EditorStatic`, `renderStaticHtml`, and static node renderers. | `react`, `react-dom` |
|
|
26
26
|
| `platejs/dom`, `platejs/history`, `platejs/hyperscript` | DOM and clipboard integration, history persistence, and JSX fixtures. | None |
|
|
27
|
-
|
|
|
28
|
-
| `platejs/
|
|
29
|
-
| `platejs/
|
|
30
|
-
| `platejs/
|
|
27
|
+
| `platejs/compiler`, `platejs/migrations`, `platejs/testing` | Schema compiler, storage-boundary document migrations, and headless test utilities. | None |
|
|
28
|
+
| `platejs/ai`, `platejs/ai/react` | Document-agent tools, `createSyncServerAgent`, visibility filters, WebMCP, and React AI hooks. | `react`, `react-dom` for `/react` |
|
|
29
|
+
| `platejs/authored`, `platejs/authored/react` | Authored change projections, proposals, and `useAuthoredGroups` / `useActiveAuthored`. | `react`, `react-dom` for `/react` |
|
|
30
|
+
| `platejs/sync`, `platejs/sync/server`, `platejs/sync/cloudflare`, `platejs/sync/postgres`, `platejs/sync/react` | Real-time sync client, authoritative room server, Durable Objects / PostgreSQL storage adapters, and React sync hooks. | `react`, `react-dom` for `/react` |
|
|
31
|
+
| `platejs/comments`, `platejs/comments/react`, `platejs/lock`, `platejs/lock/react` | Anchored comment threads and client-side block locks. | `react`, `react-dom` for `/react` |
|
|
32
|
+
| `platejs/markdown`, `platejs/html`, `platejs/html/server`, `platejs/docx/export`, `platejs/docx/import`, `platejs/docx/paste` | Markdown, HTML (browser and server), and Word DOCX serialization and import codecs. | `unified`, `remark-parse`, `remark-stringify` for `/markdown`; `linkedom` for `/html/server` |
|
|
33
|
+
| `platejs/pagination`, `platejs/pagination/react` | Page settings codec, `PaginationPlugin`, `PaginationContent`, and page layout hooks. | `react`, `react-dom` for `/react` |
|
|
34
|
+
| `platejs/diff` | Document diff and three-way merge helpers. | `diff-match-patch-ts` |
|
|
35
|
+
| `platejs/<feature>`, `platejs/<feature>/react` | Per-feature plugin subpaths (`board`, `callout`, `code-block/codemirror`, `column`, `combobox/react`, `date`, `details`, `field`, `find`, `footnote`, `format-painter/react`, `ink`, `lint`, `math`, `media`, `mention`, `reference`, `resizable/react`, `tabbable/react`, `table`, `toc`, `upload`). | Feature-specific (`katex` for `/math`, `@codemirror/*` for `/code-block/codemirror`, `tabbable` for `/tabbable/react`, plus `react` / `react-dom` for `/react`) |
|
|
36
|
+
| `@platejs/test` | Node-safe editor fixtures, schema arbitraries, and environment-specific test harnesses. | `react` and Testing Library for `/react`; Playwright for `/playwright` |
|
|
37
|
+
|
|
38
|
+
Inspect `node_modules/platejs/package.json` (`exports`) for the full list of subpaths in your installed version.
|
|
31
39
|
|
|
32
40
|
## Base runtime
|
|
33
41
|
|
|
@@ -13,6 +13,7 @@ hooks for rendered nodes, and geometry hooks for anchored floating UI.
|
|
|
13
13
|
- [Element And Node Hooks](/docs/api/react-hooks#element-and-node-hooks)
|
|
14
14
|
- [Geometry Hooks](/docs/api/react-hooks#geometry-hooks)
|
|
15
15
|
- [Selector Results](/docs/api/react-hooks#selector-results)
|
|
16
|
+
- [Feature Subpath Hooks](/docs/api/react-hooks#feature-subpath-hooks)
|
|
16
17
|
|
|
17
18
|
## Editor hooks
|
|
18
19
|
|
|
@@ -68,8 +69,22 @@ room cleanly without holding a duplicate lock.
|
|
|
68
69
|
Get the active editor from the nearest `EditorRoot` provider. Inside an
|
|
69
70
|
`EditorContent`, `useEditor()` returns that editing area's editor. Outside every
|
|
70
71
|
`EditorContent`, such as in a toolbar, it returns the editor of the root holding
|
|
71
|
-
the caret, or the `EditorRoot`'s own root editor while nothing is selected.
|
|
72
|
-
|
|
72
|
+
the caret, or the `EditorRoot`'s own root editor while nothing is selected.
|
|
73
|
+
|
|
74
|
+
#### `useOptionalEditor(): Editor | null`
|
|
75
|
+
|
|
76
|
+
Get the active editor from the nearest `EditorRoot`, `EditorController`, or
|
|
77
|
+
`EditorProvider`, or return `null` when rendered outside every provider.
|
|
78
|
+
|
|
79
|
+
#### `useEditableRef(): React.RefObject<HTMLElement | null>`
|
|
80
|
+
|
|
81
|
+
Get the ref object attached to the selected view's `EditorContent` host element.
|
|
82
|
+
Its `current` value is `null` before mount or outside a mounted view.
|
|
83
|
+
|
|
84
|
+
#### `useEditorContainerRef(): React.RefObject<HTMLDivElement | null>`
|
|
85
|
+
|
|
86
|
+
Get the ref object attached to the selected editor's container element. Its
|
|
87
|
+
`current` value is `null` before mount or outside a provider.
|
|
73
88
|
|
|
74
89
|
#### `useEditorComposing(): boolean`
|
|
75
90
|
|
|
@@ -690,3 +705,18 @@ const version = useEditorSelector(
|
|
|
690
705
|
(editor) => editor.read.runtime.snapshot().version
|
|
691
706
|
);
|
|
692
707
|
```
|
|
708
|
+
|
|
709
|
+
## Feature subpath hooks
|
|
710
|
+
|
|
711
|
+
Domain-specific hooks ship from their feature React subpaths rather than `platejs/react`:
|
|
712
|
+
|
|
713
|
+
| Hooks | Subpath | Guide |
|
|
714
|
+
| --- | --- | --- |
|
|
715
|
+
| `useEditorAgent`, `useWebMCP` | `platejs/ai/react` | [AI](/docs/ai) |
|
|
716
|
+
| `useAuthoredGroups`, `useActiveAuthored` | `platejs/authored/react` | [Authored Changes](/docs/authored-changes), [Suggestions](/docs/suggestion) |
|
|
717
|
+
| `useSyncApi`, `useSyncStatus`, `useSyncKept` | `platejs/sync/react` | [Sync](/docs/sync) |
|
|
718
|
+
| `useCommentThreadIndex` | `platejs/comments/react` | [Comments](/docs/comment) |
|
|
719
|
+
| `useFieldRead` | `platejs/field/react` | [Field](/docs/field) |
|
|
720
|
+
| `useIsLocked`, `useIsOwnLocked` | `platejs/lock/react` | [Block Lock](/docs/lock) |
|
|
721
|
+
| `useCombobox` | `platejs/combobox/react` | [Combobox](/docs/combobox) |
|
|
722
|
+
| `usePageLayout`, `useTableRowPageBreak` | `platejs/pagination/react` | [Pagination](/docs/pagination) |
|
|
@@ -458,3 +458,7 @@ content. With `editor`, a document with pending changes returns an
|
|
|
458
458
|
returns one, with the code `authored-uncovered`, when the projection builds an
|
|
459
459
|
element that needs a generated value and the document stores no spare block for
|
|
460
460
|
it, such as a document another tool wrote.
|
|
461
|
+
|
|
462
|
+
## Pro and Business
|
|
463
|
+
|
|
464
|
+
Plate Pro ships `@plate-pro/change-requests` for Word `.docx` tracked-change intake and multi-author review helpers, `@plate-pro/floating-discussion` for margin review cards, and the `Paper v2` flagship template. Plate Business adds `@plate-business/security-kernel` for revision-pinned approval gates and crash-safe SHA-256 WORM audit logs. See [Pricing](/pricing).
|
package/dist/docs/block-menu.md
CHANGED
|
@@ -70,3 +70,7 @@ actions disabled when the current selection shape is unsupported.
|
|
|
70
70
|
|
|
71
71
|
`BlockContextMenu` is the public copied component. There is no menu-state or
|
|
72
72
|
separate selection package API.
|
|
73
|
+
|
|
74
|
+
## Pro and Business
|
|
75
|
+
|
|
76
|
+
Plate Pro ships the `Potion v2` and `Paper v2` flagship templates with block menus wired alongside AI actions, block locks, drag and drop, and real-time sync. See [Pricing](/pricing).
|
package/dist/docs/board.md
CHANGED
|
@@ -723,3 +723,7 @@ The image shape, `boardImage`: an object block that holds at most one `image` el
|
|
|
723
723
|
| `BoardPicture`, `BoardPictureOptions`, `BoardPictureWarning` | `platejs/board/react` | What `exportPicture` resolves, what it takes, and each warning in the picture's `warnings`. A warning's `code` is `content-undrawn`, `downscaled`, `font-missing`, `image-unreadable` or `shape-undrawn`, and the last two also name the `shapeId`. |
|
|
724
724
|
| `BoardArrowPath`, `BoardArrowhead`, `BoardArrowLabel` | `platejs/board/react` | Draw an arrow inside its `BoardShape`. `BoardArrowPath` is an SVG `path` whose `d` runs between the arrow's ends. `BoardArrowhead` is an SVG `g` that draws its children at the arrow's end, turned so that the positive x axis points along the arrow. It sets its own `transform` and `display`, so style the head through its children. `BoardArrowLabel` is an absolutely positioned `div` that holds the arrow's text, centered on the arrow's middle. It sets its own `left` and `top`, and a `style` can override its `position` and the `translate` that centers it. All three follow a moved, dragged, or resized shape, or a growing note or free text, without a render of the arrow. An arrow's `BoardShape` is an empty box at the board's origin, and `d` is in board coordinates. So draw the path and the head in a 1 by 1 `svg`, because Firefox draws nothing in an `svg` of zero size. Give that `svg` visible overflow and `pointer-events: none`, and put it inside an element with `contentEditable={false}`. A press picks an arrow only when it lands on one of the arrow's elements, so give one path `pointerEvents="stroke"`, such as a wide transparent `BoardArrowPath`. Until the arrow has a drawing, the path has no `d` and the head and the label are hidden. Each throws outside an arrow's `BoardShape`. |
|
|
725
725
|
| `useStrokePath(element)` | `platejs/board/react` | The drawn path of a pen line in a mounted board. It returns the `BoardStrokePath` that `strokePath(id)` reads, or `undefined` when the element is not a pen line of that board. |
|
|
726
|
+
|
|
727
|
+
## Pro and Business
|
|
728
|
+
|
|
729
|
+
Plate Pro ships `@plate-pro/board-workspace`, a copy-owned visual canvas workspace combining `BaseBoardPlugin`, all seven shape plugins, `AuthoredPlugin`, confined headless and `SyncServer` board-agent tools (`board_read`, `board_edit` with `$ref` batch ops and propose-only mode), and ephemeral spatial canvas overlay projection (`board-agent-overlay`) wired for real-time sync with `@plate-pro/collab-do`. See [Pricing](/pricing).
|
package/dist/docs/callout.md
CHANGED
|
@@ -9,19 +9,28 @@ _Edit inside the callout block and pick a variant or emoji icon from its header
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
11
|
- Multi-block callout container holding paragraphs, lists, code blocks, quotes, and nested blocks
|
|
12
|
-
- Neutral optional `variant`, `icon`, and `
|
|
12
|
+
- Neutral optional `variant`, `icon`, `backgroundColor`, and `actions` document properties with copied-UI styling, background color swatches, emoji picker, and clickable workflow buttons
|
|
13
13
|
- Wrap, unwrap, toggle, insert, and upsert transforms
|
|
14
|
-
- Dual Markdown serialization: GitHub Flavored Markdown Alerts (`> [!NOTE]` .. `> [!CAUTION]`) with `<callout>` MDX fallback for custom icons, colors, and extra properties
|
|
14
|
+
- Dual Markdown serialization: GitHub Flavored Markdown Alerts (`> [!NOTE]` .. `> [!CAUTION]`) with `<callout>` MDX fallback for custom icons, colors, workflow actions, and extra properties
|
|
15
15
|
|
|
16
16
|
## Document model
|
|
17
17
|
|
|
18
|
-
A Callout node is a block container (`blockContent`, `min: 1`) with optional neutral metadata
|
|
18
|
+
A Callout node is a block container (`blockContent`, `min: 1`) with optional neutral metadata and optional declarative workflow `actions`:
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
21
|
const value = [
|
|
22
22
|
{
|
|
23
23
|
type: 'callout',
|
|
24
|
-
variant: '
|
|
24
|
+
variant: 'warning',
|
|
25
|
+
actions: [
|
|
26
|
+
{
|
|
27
|
+
id: 'trigger-rollback',
|
|
28
|
+
label: 'Rollback release',
|
|
29
|
+
kind: 'webhook',
|
|
30
|
+
confirm: 'Roll back production to the previous build?',
|
|
31
|
+
payload: { webhookKey: 'deploy-rollback' },
|
|
32
|
+
},
|
|
33
|
+
],
|
|
25
34
|
children: [
|
|
26
35
|
{ type: 'paragraph', children: [{ text: 'First paragraph.' }] },
|
|
27
36
|
{
|
|
@@ -35,17 +44,46 @@ const value = [
|
|
|
35
44
|
];
|
|
36
45
|
```
|
|
37
46
|
|
|
38
|
-
`BaseCalloutPlugin` sets no default `icon`, `variant`, or `
|
|
47
|
+
`BaseCalloutPlugin` sets no default `icon`, `variant`, `backgroundColor`, or `actions` on the node. When `actions` is set, it must be a non-empty array of 1 to 16 `CalloutAction` objects with unique non-empty `id` values, non-empty `label` strings, optional `kind` and `confirm` strings, and optional plain-JSON `payload` objects (without prototype-polluting keys). Remove the `actions` property with `unset('actions')` instead of storing an empty array.
|
|
48
|
+
|
|
49
|
+
Copied UI (`CalloutElement` and `CalloutElementStatic`) owns visual styling, fallback icons, and button rendering. HTML serialization stores valid `actions` in `data-editor-html-callout-actions` and omits malformed values on import. For Word export, `exportDocx` keeps callouts neutral by default, applies per-variant tint shading and a left accent border when `styles.callout.variants` is provided (configured in `DOCX_EXPORT_STYLES`), and appends a readable `Actions: [Label]` paragraph with a `lossy-content` diagnostic when `actions` are present.
|
|
39
50
|
|
|
40
51
|
## Markdown serialization
|
|
41
52
|
|
|
42
53
|
`BaseCalloutPlugin` registers two Markdown mappings:
|
|
43
54
|
|
|
44
|
-
- **GFM Alerts (priority `5`):** Decodes GitHub alert blockquotes (`> [!NOTE]`, `> [!TIP]`, `> [!IMPORTANT]`, `> [!WARNING]`, `> [!CAUTION]`) into `callout` nodes with lowercase `variant`. Encodes clean alert callouts (one of those five variants and no custom `icon`, `backgroundColor`, or extra block properties) back to GFM alert syntax.
|
|
45
|
-
- **`<callout>` MDX fallback (priority `0`):** Decodes and encodes `<callout>` flow elements when custom `icon`, `backgroundColor`, custom `variant`, or extra block properties (such as `indent`) are present.
|
|
55
|
+
- **GFM Alerts (priority `5`):** Decodes GitHub alert blockquotes (`> [!NOTE]`, `> [!TIP]`, `> [!IMPORTANT]`, `> [!WARNING]`, `> [!CAUTION]`) into `callout` nodes with lowercase `variant`. Encodes clean alert callouts (one of those five variants and no custom `icon`, `backgroundColor`, `actions`, or extra block properties) back to GFM alert syntax.
|
|
56
|
+
- **`<callout>` MDX fallback (priority `0`):** Decodes and encodes `<callout>` flow elements when custom `icon`, `backgroundColor`, `actions` (encoded as a quoted JSON attribute), custom `variant`, or extra block properties (such as `indent`) are present.
|
|
46
57
|
|
|
47
58
|
A custom Markdown mapping at priority `10` overrides both built-in mappings.
|
|
48
59
|
|
|
60
|
+
## Workflow actions and run view
|
|
61
|
+
|
|
62
|
+
Wrap an editor in `CalloutActionProvider` from `@/components/editor/callout` to handle clickable workflow buttons, runtime disabled or completed states, and inline confirmation prompts. Set `mode="run"` to hide author-only variant, color, emoji, and action-editing controls while keeping workflow buttons interactive inside a read-only run view.
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { CalloutActionProvider } from '@/components/editor/callout';
|
|
66
|
+
|
|
67
|
+
<CalloutActionProvider
|
|
68
|
+
mode="run"
|
|
69
|
+
getActionState={(calloutId, action) => ({
|
|
70
|
+
disabled: false,
|
|
71
|
+
status: 'idle',
|
|
72
|
+
})}
|
|
73
|
+
onAction={async ({ action, calloutId }) => {
|
|
74
|
+
await runWorkflowAction(calloutId, action);
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
77
|
+
{children}
|
|
78
|
+
</CalloutActionProvider>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
For repeatable checklists, diagnostic branches, and runbooks whose runs stay separate from the authored template, install [Procedure Runner](/docs/components/procedure-runner) (`@plate/procedure-runner`, exporting `ProcedureRunView` and pure runner helpers) alongside `CalloutKit`, `ListKit`, `DetailsKit`, and `FieldKit`.
|
|
82
|
+
|
|
83
|
+
_Example `procedure-demo` in the Plate repository: `apps/www/src/registry/examples/procedure-demo.tsx`._
|
|
84
|
+
|
|
85
|
+
_Switch between Template and Run View, complete the Stop Step, answer the diagnostic field to reveal a branch, and trigger the confirmed workflow callout button without mutating the template._
|
|
86
|
+
|
|
49
87
|
## Kit usage
|
|
50
88
|
|
|
51
89
|
### Installation
|
|
@@ -135,6 +173,7 @@ Insert a multi-block callout element seeded with one empty paragraph.
|
|
|
135
173
|
| `props.variant` | `string` *(optional)* | Optional callout variant token (for example `'note'`, `'tip'`, `'important'`, `'warning'`, `'caution'`). |
|
|
136
174
|
| `props.icon` | `string` *(optional)* | Optional callout icon or emoji. Omitted unless set. |
|
|
137
175
|
| `props.backgroundColor` | `string` *(optional)* | Optional background color override. |
|
|
176
|
+
| `props.actions` | `readonly CalloutAction[]` *(optional)* | Optional non-empty list of 1 to 16 declarative workflow actions. |
|
|
138
177
|
| `options` | `BlockInsertOptions` *(optional)* | Standard block insertion options such as `at`, `after`, `before`, and `select`. |
|
|
139
178
|
|
|
140
179
|
### `editor.plugin(BaseCalloutPlugin).update.upsert`
|
|
@@ -158,10 +197,10 @@ Unwrap when every selected block is inside a callout; otherwise wrap the selecte
|
|
|
158
197
|
### `CalloutElement`
|
|
159
198
|
|
|
160
199
|
```typescript
|
|
161
|
-
import type { CalloutElement } from 'platejs/callout';
|
|
200
|
+
import type { CalloutAction, CalloutElement } from 'platejs/callout';
|
|
162
201
|
```
|
|
163
202
|
|
|
164
|
-
`CalloutElement` is derived from `BaseCalloutPlugin`. Its schema holds block children (`min: 1`) and exposes optional `backgroundColor`, `icon`, and `variant` properties.
|
|
203
|
+
`CalloutElement` is derived from `BaseCalloutPlugin`. Its schema holds block children (`min: 1`) and exposes optional `actions`, `backgroundColor`, `icon`, and `variant` properties.
|
|
165
204
|
|
|
166
205
|
**Attributes**
|
|
167
206
|
|
|
@@ -170,3 +209,18 @@ import type { CalloutElement } from 'platejs/callout';
|
|
|
170
209
|
| `variant` | `string` *(optional)* | Optional variant token of the callout. |
|
|
171
210
|
| `icon` | `string` *(optional)* | Optional icon or emoji to display. |
|
|
172
211
|
| `backgroundColor` | `string` *(optional)* | Optional background color override. |
|
|
212
|
+
| `actions` | `readonly CalloutAction[]` *(optional)* | Optional non-empty list of 1 to 16 declarative workflow actions. |
|
|
213
|
+
|
|
214
|
+
### `CalloutAction`
|
|
215
|
+
|
|
216
|
+
| Name | Type | Description |
|
|
217
|
+
| --- | --- | --- |
|
|
218
|
+
| `id` | `string` | Required unique trimmed action identifier within the callout (up to 64 characters). |
|
|
219
|
+
| `label` | `string` | Required non-empty trimmed button label (up to 120 characters). |
|
|
220
|
+
| `kind` | `string` *(optional)* | Optional action category token such as `'webhook'`, `'approve'`, `'notify'`, or `'run'` (up to 64 characters). |
|
|
221
|
+
| `confirm` | `string` *(optional)* | Optional confirmation prompt text shown before running the action (up to 500 characters). |
|
|
222
|
+
| `payload` | `Readonly<Record<string, EditorJsonValue>>` *(optional)* | Optional plain-JSON metadata object (depth up to 6, up to 64 keys, no prototype-polluting keys). |
|
|
223
|
+
|
|
224
|
+
## Pro and Business
|
|
225
|
+
|
|
226
|
+
Plate Pro ships `@plate-pro/procedures` with canonical template and rules SHA-256 revision pinning, Stop-Step DAG enforcement, `platejs/field` branch gating, workflow callout builders, and human and agent run tools. Plate Business adds `@plate-business/security-kernel` for server-owned `ProcedureRunStore` persistence (Memory, DO SQLite, Postgres), WORM audit recovery, separation-of-duties sign-offs, and SSRF-safe signed webhooks, verified by `plate verify --suite ai-sandbox`. See [Pricing](/pricing).
|
|
@@ -12,7 +12,8 @@ Build collaborative editing by composing independent layers instead of coupling
|
|
|
12
12
|
| PostgreSQL or Cloudflare Durable Objects room storage | `platejs/sync/postgres`, `platejs/sync/cloudflare` | [Sync](/docs/sync) |
|
|
13
13
|
| Proposed edits and review decisions in the document | `platejs/authored`, `SuggestionKit` | [Suggestions](/docs/suggestion), [Authored Changes](/docs/authored-changes) |
|
|
14
14
|
| Anchored comment threads and replies | `platejs/comments`, `platejs/comments/react` | [Comments](/docs/comment) |
|
|
15
|
-
| Combined per-block comment and suggestion cards | `DiscussionKit`, `UserDirectoryProvider` | [Discussion](/docs/discussion) |
|
|
15
|
+
| Combined per-block comment and suggestion cards | `DiscussionKit`, `UserDirectoryProvider`, `SuggestionReviewBar` | [Discussion](/docs/discussion), [Suggestion Review Bar](/docs/components/suggestion-review-bar) |
|
|
16
|
+
| Live multi-agent room trace inspection | `createSyncServerAgent` (`platejs/ai`), `AgentTraceDrawer` | [AI & Editor Agents](/docs/ai-agents), [Agent Trace Drawer](/docs/components/agent-trace-drawer) |
|
|
16
17
|
| Client-side edit protection on chosen blocks | `LockPlugin`, `LockKit` | [Block Lock](/docs/lock) |
|
|
17
18
|
|
|
18
19
|
## How the layers compose
|
|
@@ -120,3 +121,7 @@ Do not rely on UI mode or client-side plugins for access control:
|
|
|
120
121
|
- Configure proposing, accepting, and rejecting edits in [Suggestions](/docs/suggestion) and [Authored Changes](/docs/authored-changes).
|
|
121
122
|
- Attach threaded conversations to text ranges or proposals in [Comments](/docs/comment) and [Discussion](/docs/discussion).
|
|
122
123
|
- Protect template regions against accidental edits in [Block Lock](/docs/lock).
|
|
124
|
+
|
|
125
|
+
## Pro and Business
|
|
126
|
+
|
|
127
|
+
Plate Pro ships `@plate-pro/collab-do` for hibernatable Cloudflare Durable Object rooms with D1 projection, `@plate-pro/synced-block` for cross-document synced roots, and `@plate-pro/disclosure` for audience projection and counterparty sub-rooms, alongside the `Potion v2` and `Paper v2` flagship templates. Plate Business adds `@plate-business/security-kernel` for wire-level read redaction and hash-chained WORM audit logs, plus `@plate-business/security-proof` and `plate verify --suite sync-security` CI. See [Pricing](/pricing).
|