platejs 54.0.0-beta.19 → 54.0.0-beta.20
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-C2vnO5Wd.d.ts → EditorStatic-BTyhgdYL.d.ts} +4 -4
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/lib/aiPolicy.internal.js +33 -1
- package/dist/ai/lib/editorAgent.js +405 -37
- package/dist/ai/lib/editorAgentSync.internal.js +4 -1
- package/dist/ai/lib/registerEditorTools.js +20 -4
- package/dist/ai/react/index.d.ts +7 -7
- package/dist/ai/react/useEditorAgent.js +94 -35
- package/dist/authored/index.d.ts +4 -4
- package/dist/{authored-Bx55e8NK-B-3-7x2a.d.ts → authored-CYoZAxr--Ba0JwRbO.d.ts} +3 -3
- package/dist/clipboard-format-key-CMZ3jPZO-DEODtsVZ.d.ts +1 -0
- package/dist/code-block/codemirror/index.d.ts +2 -2
- package/dist/{comment-anchor.internal-BOS8OnAc.d.ts → comment-anchor.internal-DQfEtr1Z.d.ts} +2 -2
- package/dist/compiler/index.d.ts +3 -3
- package/dist/{core-Cd7dbk4H.d.ts → core-ClO5Umhx.d.ts} +26 -6
- package/dist/core.js +2 -2
- package/dist/diff/index.d.ts +2 -2
- package/dist/docs/agents/mcp.md +1 -1
- package/dist/docs/agents.md +1 -1
- package/dist/docs/business/security-kernel.md +4 -4
- package/dist/docs/business/security-proof.md +8 -4
- package/dist/docs/business/verify.md +4 -2
- package/dist/docs/business.md +17 -6
- package/dist/docs/comparison.md +1 -1
- package/dist/docs/controlled.md +20 -0
- package/dist/docs/editor.md +24 -0
- package/dist/docs/installation/manual.md +1 -0
- package/dist/docs/installation/next.md +1 -0
- package/dist/docs/installation/plate-ui.md +6 -5
- package/dist/docs/installation/react.md +36 -0
- package/dist/docs/installation.md +2 -1
- package/dist/docs/license.md +2 -2
- package/dist/docs/live-block.md +189 -0
- package/dist/docs/llms.txt +5 -3
- package/dist/docs/migration-v54.md +361 -0
- package/dist/docs/prompt-editor.md +51 -0
- package/dist/docs/serializing.md +36 -1
- package/dist/docx/export/index.d.ts +6 -6
- 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/facade.js +2 -2
- package/dist/features/board/index.d.ts +1 -1
- package/dist/features/callout/index.d.ts +1 -1
- 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/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/lint/index.d.ts +3 -3
- package/dist/features/lock/index.d.ts +1 -1
- package/dist/features/lock/lib/BaseLockPlugin.js +19 -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 +3 -3
- 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/{htmlConversion-B_pxnQjT.d.ts → htmlConversion-CmUPi9rg.d.ts} +2 -2
- package/dist/{htmlTypes-BNz6ylqQ.d.ts → htmlTypes-C3hHzpRh.d.ts} +11 -4
- package/dist/hyperscript/index.d.ts +1 -1
- package/dist/{index-DYqSYQxA.d.ts → index-5j5BcvLz.d.ts} +3 -3
- package/dist/{index-COzkHycB.d.ts → index-B7vlwvLQ.d.ts} +3 -3
- package/dist/{index-C7vqVA4I.d.ts → index-BFuz7j3F.d.ts} +4 -4
- package/dist/{index-opUVqmJA.d.ts → index-BKiW8Kte.d.ts} +2 -2
- package/dist/{index-LCIv8Dt5.d.ts → index-BTGCF8li.d.ts} +5 -5
- package/dist/{index-C3tSB92f-D0tqBxnQ.d.ts → index-BnqTluVD-D50uRAnI.d.ts} +4 -4
- package/dist/{index-BxSXY0kj.d.ts → index-Bw3p8fsS.d.ts} +5 -5
- package/dist/{index-BBL9Mqec.d.ts → index-BxJ1-Bk3.d.ts} +3 -3
- package/dist/{index-DPQEcaX7.d.ts → index-Byf_lqL7.d.ts} +7 -7
- package/dist/index-CEQXbShY.d.ts +1 -0
- package/dist/{index-BcrleRIo.d.ts → index-CW0A2w5s.d.ts} +2 -2
- package/dist/{index-CQhh6Byb.d.ts → index-CXFQCw_T.d.ts} +3 -3
- package/dist/{index-BphzyHPD.d.ts → index-Cv3NLcDO.d.ts} +3 -3
- package/dist/{index-DhwbLtre.d.ts → index-D17Cz7nd.d.ts} +1 -1
- package/dist/{index-Dpf8e1Y4.d.ts → index-D4gbdWPp.d.ts} +3 -3
- package/dist/{index-BLoL3-VF.d.ts → index-D7LkEoIA.d.ts} +3 -3
- package/dist/{index-B3UDn5_N.d.ts → index-DQAD-81H.d.ts} +3 -3
- package/dist/{index-Y6ZYqjYI-C1ZpAURM.d.ts → index-DgYHSQmu-DLvTjIM2.d.ts} +1 -1
- package/dist/index-DqsRyYXn.d.ts +3 -0
- package/dist/{index-D9mlOgk4.d.ts → index-DzXvKehR.d.ts} +3 -3
- package/dist/{index-CTsfhXok.d.ts → index-KVVMEzVq.d.ts} +3 -3
- package/dist/{index-Er5BwoQd-CULo8twl.d.ts → index-OJ8B_v_P-D5yZA1mD.d.ts} +2 -2
- package/dist/index-Q7hzYYQW.d.ts +1 -0
- package/dist/{index-BVFPEGBD.d.ts → index-RrccNMAA.d.ts} +3 -3
- package/dist/{index-CvAdLvBh.d.ts → index-h-K-xgfs.d.ts} +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/internal/plugin/compilePlateModel.js +18 -1
- package/dist/internal/plugin/pluginStore.js +77 -1
- package/dist/lib/editor/withPlite.js +22 -3
- package/dist/markdown/index.d.ts +1 -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/pagination/index.d.ts +1 -1
- package/dist/pagination/react/index.d.ts +4 -4
- package/dist/{protocol-D7JsIu14-DYm2shgH.d.ts → protocol-o3jVSHir-Bouoin05.d.ts} +1 -1
- package/dist/react/authored/index.d.ts +4 -4
- package/dist/react/core.js +2 -2
- package/dist/react/features/board/index.d.ts +5 -5
- package/dist/react/features/callout/index.d.ts +5 -5
- package/dist/react/features/column/index.d.ts +5 -5
- package/dist/react/features/combobox/index.d.ts +4 -4
- 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/index.d.ts +5 -5
- package/dist/react/features/footnote/index.d.ts +4 -4
- 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 +7 -7
- package/dist/react/index.js +2 -2
- package/dist/react/virtualized.d.ts +3 -3
- package/dist/refusal-hmMeqqsF-DEODtsVZ.d.ts +1 -0
- package/dist/{registerEditorTools-BqW9lr_K.d.ts → registerEditorTools-CxU5qGen.d.ts} +32 -5
- package/dist/root.js +2 -2
- package/dist/shared-room-D0Ch6_0l-DEODtsVZ.d.ts +1 -0
- package/dist/skills/plate/SKILL.md +1 -1
- package/dist/skills/plate/references/pricing.md +15 -8
- package/dist/skills/plate/references/setup.md +13 -2
- package/dist/skills/plate/references/testing.md +2 -2
- package/dist/{source-CVQeCWQ6.d.ts → source-SWPrNfXp.d.ts} +3 -3
- package/dist/static/index.d.ts +5 -5
- package/dist/{storage-C9UY_rG8-BEd5yMOY.d.ts → storage-BiSc0Cnj-BamxXwsJ.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-LHPF4fmj-DrGlFZ_L.d.ts → transport-CWTT3vFK-_eytF0bO.d.ts} +1 -1
- package/dist/{tx-only-BYWUDN_r-CyQXNQp-.d.ts → tx-only-CFSEh_pE-j0KGzcne.d.ts} +1826 -1687
- package/dist/{widths-BmkP0i8h.d.ts → widths-C1tAKF__.d.ts} +5 -5
- package/package.json +2 -2
- package/dist/clipboard-format-key-UUQwwD7--BvFhdd3c.d.ts +0 -1
- package/dist/index-CNEotALg.d.ts +0 -1
- package/dist/index-DH5TuEJa.d.ts +0 -3
- package/dist/index-DPh3NMjm.d.ts +0 -1
- package/dist/refusal-CA1A2E_8-BvFhdd3c.d.ts +0 -1
- package/dist/shared-room-Mvp6W5j0-BvFhdd3c.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./htmlTypes-
|
|
3
|
-
import { N as DataTransferDiagnostic, S as DOMEditor, V as ViewportRect, c as DOMApi, d as DOMCoverageCopyPolicy, f as DOMCoverageMaterializeRangeRole, h as DOMCoverageSelectionPolicy, l as DOMClipboardApi, m as DOMCoverageReason, n as DOMPluginTypes, p as DOMCoverageMaterializeReason, r as DropIndicator, t as DOMPlugin, u as DOMCoverageBoundary } from "./index-
|
|
4
|
-
import { o as Editor$2, st as BasePluginInput } from "./core-
|
|
1
|
+
import { As as Range, Bi as Element$1, Cr as EditorSelectorDependencies, Ea as NamedRootKey, Ft as EditorDocumentValue, Ga as NodeKey, Go as PluginDependencyReferenceFor, Il as StateFieldValueInput, Qi as HistoryOutcome, Ru as Value, Uo as PluginDependencyContractReference, Wl as Text, _u as TransferIntent, bu as TransferOutcome, co as NodeTarget, d as AnyEditor, fu as TransferApi, gu as TransferInput, k as DecorationAttributes, ko as Plugin, nc as RootKey, pu as TransferCheck, wi as EditorUpdatePolicy, wu as TransferPlugin, xo as Path } from "./tx-only-CFSEh_pE-j0KGzcne.js";
|
|
2
|
+
import "./htmlTypes-C3hHzpRh.js";
|
|
3
|
+
import { N as DataTransferDiagnostic, S as DOMEditor, V as ViewportRect, c as DOMApi, d as DOMCoverageCopyPolicy, f as DOMCoverageMaterializeRangeRole, h as DOMCoverageSelectionPolicy, l as DOMClipboardApi, m as DOMCoverageReason, n as DOMPluginTypes, p as DOMCoverageMaterializeReason, r as DropIndicator, t as DOMPlugin, u as DOMCoverageBoundary } from "./index-CW0A2w5s.js";
|
|
4
|
+
import { o as Editor$2, st as BasePluginInput } from "./core-ClO5Umhx.js";
|
|
5
5
|
import React$1, { CSSProperties, KeyboardEvent as KeyboardEvent$1, MouseEventHandler, ReactNode, Ref, RefObject, TextareaHTMLAttributes } from "react";
|
|
6
6
|
type DecorationSlice = Readonly<{
|
|
7
7
|
attributes: DecorationAttributes;
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { AILockedBlockRef, EditorAgent, EditorAgentAccess, EditorAgentExecuteOptions, EditorAgentOptions, EditorAgentPresence, EditorAgentPresenceState, EditorAgentTraceEvent, EditorCommentAction, EditorCommentEntry, EditorCommentThreadItem, EditorCommentsListResult, EditorDebugResult, EditorFindResult, EditorIdempotencyEntry, EditorIdempotencyStore, EditorInkPassage, EditorInkPassageImage, EditorReadBlock, EditorReadInkResult, EditorReadResult, EditorReadSelection, EditorSuggestionsListResult, EditorToolAnnotation, EditorToolCall, EditorToolDefinition, EditorToolErrorCode, EditorToolErrorResult, EditorToolResult, EditorVisibilityFilter, EditorVisibilityPredicate, EditorWriteReceipt, GetEditorToolsOptions, HasEditableAISelectionRefs, LOCKED_BLOCK_PLACEHOLDER_TAG, RegisterEditorToolsOptions, SerializeAIEditContextOptions, SerializeAISelectionMarkdownOptions, SerializedAIEditContext, type SyncServerAgentGrant, type SyncServerAgentHost, type SyncServerAgentOptions, type SyncServerAgentPresenceInput, type SyncServerAgentPresenceOptions, type SyncServerAgentPresencePoint, type SyncServerAgentPresenceSelection, type SyncServerAgentReceipt, type SyncServerAgentRunResult, WebMCPProducerContext, createEditorAgent, createSyncServerAgent, getEditorTools, hasEditableAISelection, registerEditorTools, serializeAIEditContext, serializeAISelectionMarkdown };
|
|
1
|
+
import { $ as SyncServerAgentHost, A as EditorIdempotencyEntry, B as EditorToolCall, C as EditorBlockToolWriteContext, D as EditorCommentsListResult, E as EditorCommentThreadItem, F as EditorReadInkResult, G as EditorVisibilityFilter, H as EditorToolErrorCode, I as EditorReadResult, J as GetEditorToolsOptions, K as EditorVisibilityPredicate, L as EditorReadSelection, M as EditorInkPassage, N as EditorInkPassageImage, O as EditorDebugResult, P as EditorReadBlock, Q as SyncServerAgentGrant, R as EditorSuggestionsListResult, S as EditorBlockToolSchema, T as EditorCommentEntry, U as EditorToolErrorResult, V as EditorToolDefinition, W as EditorToolResult, X as createSyncServerAgent, Y as createEditorAgent, Z as getEditorTools, _ as EditorAgentPresence, a as HasEditableAISelectionRefs, at as SyncServerAgentReceipt, b as EditorBlockToolAdapter, c as SerializeAISelectionMarkdownOptions, d as serializeAIEditContext, et as SyncServerAgentOptions, f as serializeAISelectionMarkdown, g as EditorAgentOptions, h as EditorAgentExecuteOptions, i as AILockedBlockRef, it as SyncServerAgentPresenceSelection, j as EditorIdempotencyStore, k as EditorFindResult, l as SerializedAIEditContext, m as EditorAgentAccess, n as WebMCPProducerContext, nt as SyncServerAgentPresenceOptions, o as LOCKED_BLOCK_PLACEHOLDER_TAG, ot as SyncServerAgentRunResult, p as EditorAgent, q as EditorWriteReceipt, r as registerEditorTools, rt as SyncServerAgentPresencePoint, s as SerializeAIEditContextOptions, t as RegisterEditorToolsOptions, tt as SyncServerAgentPresenceInput, u as hasEditableAISelection, v as EditorAgentPresenceState, w as EditorCommentAction, x as EditorBlockToolReadContext, y as EditorAgentTraceEvent, z as EditorToolAnnotation } from "../registerEditorTools-CxU5qGen.js";
|
|
2
|
+
export { AILockedBlockRef, EditorAgent, EditorAgentAccess, EditorAgentExecuteOptions, EditorAgentOptions, EditorAgentPresence, EditorAgentPresenceState, EditorAgentTraceEvent, EditorBlockToolAdapter, EditorBlockToolReadContext, EditorBlockToolSchema, EditorBlockToolWriteContext, EditorCommentAction, EditorCommentEntry, EditorCommentThreadItem, EditorCommentsListResult, EditorDebugResult, EditorFindResult, EditorIdempotencyEntry, EditorIdempotencyStore, EditorInkPassage, EditorInkPassageImage, EditorReadBlock, EditorReadInkResult, EditorReadResult, EditorReadSelection, EditorSuggestionsListResult, EditorToolAnnotation, EditorToolCall, EditorToolDefinition, EditorToolErrorCode, EditorToolErrorResult, EditorToolResult, EditorVisibilityFilter, EditorVisibilityPredicate, EditorWriteReceipt, GetEditorToolsOptions, HasEditableAISelectionRefs, LOCKED_BLOCK_PLACEHOLDER_TAG, RegisterEditorToolsOptions, SerializeAIEditContextOptions, SerializeAISelectionMarkdownOptions, SerializedAIEditContext, type SyncServerAgentGrant, type SyncServerAgentHost, type SyncServerAgentOptions, type SyncServerAgentPresenceInput, type SyncServerAgentPresenceOptions, type SyncServerAgentPresencePoint, type SyncServerAgentPresenceSelection, type SyncServerAgentReceipt, type SyncServerAgentRunResult, WebMCPProducerContext, createEditorAgent, createSyncServerAgent, getEditorTools, hasEditableAISelection, registerEditorTools, serializeAIEditContext, serializeAISelectionMarkdown };
|
|
@@ -320,6 +320,38 @@ const getElementDisallowedMediaUrls = (node, allowRemoteMediaUrl) => {
|
|
|
320
320
|
}
|
|
321
321
|
return found;
|
|
322
322
|
};
|
|
323
|
+
const STRUCTURED_MEDIA_URL_KEYS = /* @__PURE__ */ new Set([
|
|
324
|
+
"action",
|
|
325
|
+
"formAction",
|
|
326
|
+
"poster",
|
|
327
|
+
"src",
|
|
328
|
+
"url"
|
|
329
|
+
]);
|
|
330
|
+
const MAX_STRUCTURED_MEDIA_SCAN_DEPTH = 24;
|
|
331
|
+
const collectStructuredBlockMediaUrls = (value, allowRemoteMediaUrl, found, seen, depth) => {
|
|
332
|
+
if (!value || typeof value !== "object") return;
|
|
333
|
+
if (depth > MAX_STRUCTURED_MEDIA_SCAN_DEPTH || seen.has(value)) return;
|
|
334
|
+
seen.add(value);
|
|
335
|
+
if (Array.isArray(value)) {
|
|
336
|
+
for (const item of value) collectStructuredBlockMediaUrls(item, allowRemoteMediaUrl, found, seen, depth + 1);
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
for (const [key, entry] of Object.entries(value)) if (typeof entry === "string" && STRUCTURED_MEDIA_URL_KEYS.has(key)) {
|
|
340
|
+
if (isDisallowedRemoteUrl(entry, allowRemoteMediaUrl)) found.push(entry);
|
|
341
|
+
} else if (entry && typeof entry === "object") collectStructuredBlockMediaUrls(entry, allowRemoteMediaUrl, found, seen, depth + 1);
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* Recursively collect unapproved remote media/action URLs (`src`, `poster`,
|
|
345
|
+
* `url`, `action`, `formAction`) inside structured-block properties at bounded
|
|
346
|
+
* depth while leaving navigation `href` to scheme and adapter policy.
|
|
347
|
+
*
|
|
348
|
+
* @internal
|
|
349
|
+
*/
|
|
350
|
+
const findDisallowedRemoteMediaUrlsInStructuredBlock = (props, allowRemoteMediaUrl) => {
|
|
351
|
+
const found = [];
|
|
352
|
+
collectStructuredBlockMediaUrls(props, allowRemoteMediaUrl, found, /* @__PURE__ */ new Set(), 0);
|
|
353
|
+
return found;
|
|
354
|
+
};
|
|
323
355
|
/**
|
|
324
356
|
* Collect all unapproved remote media URLs present in `nodes`.
|
|
325
357
|
*
|
|
@@ -436,4 +468,4 @@ const sanitizeRemoteMediaNodes = (nodes, allowRemoteMediaUrl) => {
|
|
|
436
468
|
};
|
|
437
469
|
};
|
|
438
470
|
//#endregion
|
|
439
|
-
export { buildFilteredSerializeDocument, findDisallowedRemoteMediaUrls, findDisallowedRemoteMediaUrlsInMarkdown, hasHiddenDescendant, isEditorVisibilityFilter, isElementAllowed, isPathVisible, isRangeVisible, isRemoteMediaUrl, pruneHiddenDescendants, resolveVisibilityFilter, sanitizeRemoteMediaNodes };
|
|
471
|
+
export { buildFilteredSerializeDocument, findDisallowedRemoteMediaUrls, findDisallowedRemoteMediaUrlsInMarkdown, findDisallowedRemoteMediaUrlsInStructuredBlock, hasHiddenDescendant, isEditorVisibilityFilter, isElementAllowed, isPathVisible, isRangeVisible, isRemoteMediaUrl, pruneHiddenDescendants, resolveVisibilityFilter, sanitizeRemoteMediaNodes };
|