platejs 54.0.0-beta.13 → 54.0.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EditorStatic-CKG5xM3y.d.ts → EditorStatic-eXOA489B.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-qetvpvU--DSWESzxK.d.ts} +3 -3
- package/dist/clipboard-format-key-BBu85J9m-BLhtd159.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-CoNK9gTD.d.ts} +2 -2
- package/dist/compiler/index.d.ts +3 -3
- package/dist/{core-CTB0OBoh.d.ts → core-By92GWYW.d.ts} +45 -20
- 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 +4 -0
- 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 +40 -28
- 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 +4 -0
- package/dist/docs/llms.txt +3 -1
- package/dist/docs/lock.md +34 -2
- package/dist/docs/markdown.md +4 -0
- package/dist/docs/media.md +4 -0
- package/dist/docs/mention.md +5 -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 +4 -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/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 +236 -0
- package/dist/features/reference/index.js +2 -0
- package/dist/features/reference/lib/BaseReferencePlugin.js +589 -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-CRnxMGw-.d.ts} +2 -2
- package/dist/{htmlTypes-CNhoCFjK.d.ts → htmlTypes-3laowz-3.d.ts} +3 -3
- package/dist/hyperscript/index.d.ts +1 -1
- package/dist/{index-B-8L9f6a2.d.ts → index-B3VOCxNR.d.ts} +5 -5
- package/dist/{index-B8JeECEk.d.ts → index-B9UlNijk.d.ts} +2 -2
- package/dist/{index-Bqva6PJc.d.ts → index-BJPT0Tv_.d.ts} +3 -3
- package/dist/{index-CWutqVQ_-BO-UgVeK.d.ts → index-BKPWmnLg-Bp_vItjr.d.ts} +1 -1
- package/dist/{index-BFWK852j.d.ts → index-BcD2RAB9.d.ts} +3 -3
- package/dist/{index-DhsryaAC.d.ts → index-C5Xw3JDc.d.ts} +1 -1
- package/dist/{index-BEXBAmJf.d.ts → index-CAshLTjV.d.ts} +3 -3
- package/dist/{index-qqrnWAk_.d.ts → index-CHlITvuq.d.ts} +7 -7
- package/dist/index-CKSwab_O.d.ts +1 -0
- package/dist/{index-DJhwDkfd.d.ts → index-CRQoHk18.d.ts} +3 -3
- package/dist/index-CyY3O6c7.d.ts +3 -0
- package/dist/index-D8EGVCeT.d.ts +305 -0
- package/dist/{index-B0R9sXv2-T1dxG9oM.d.ts → index-DAKucat0--VOaL_NN.d.ts} +4 -4
- package/dist/{index-UYpvOBXG.d.ts → index-DCTRNYwy.d.ts} +2 -2
- package/dist/{index-CXd5hwaH.d.ts → index-DQpHoxDX.d.ts} +1 -1
- package/dist/{index-BfJKfAwk.d.ts → index-DTd1D-BF.d.ts} +3 -3
- package/dist/index-DUhUT9bV.d.ts +1 -0
- package/dist/{index-B4aToRMv.d.ts → index-DXm_v0Qq.d.ts} +3 -3
- package/dist/{index-D3bhjdRz.d.ts → index-Djwcl0Ff.d.ts} +3 -3
- package/dist/{index-DYuqsDrP.d.ts → index-Dyw6BJx8.d.ts} +3 -3
- package/dist/{index-CLPMcGC5.d.ts → index-KG95XVaC.d.ts} +4 -4
- package/dist/{index-mcBtG6pK-CitQV9Bq.d.ts → index-LEcSTRgn-BR_p4GVY.d.ts} +2 -2
- package/dist/{index-D54VPeky.d.ts → index-k-wvVxKl.d.ts} +2 -2
- package/dist/{index-CHud6Aa-.d.ts → index-s34W6hUI.d.ts} +3 -3
- package/dist/{index-DXCdafUk.d.ts → index-wEkvA-wI.d.ts} +43 -20
- package/dist/index.d.ts +3 -3
- 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 +126 -29
- 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 +17 -24
- package/dist/lib/plugins/html/htmlSerialize.internal.js +16 -2
- package/dist/lib/plugins/html/htmlStyleInline.internal.js +22 -23
- 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/index.d.ts +3 -3
- package/dist/{protocol-CSuP7AWG-DAorqpaF.d.ts → protocol-Cp9xayOe-0OSfTMnt.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-CwFxNUf7-BLhtd159.d.ts +1 -0
- package/dist/{registerEditorTools-Cl-o_Wnq.d.ts → registerEditorTools-D_3hPpTx.d.ts} +16 -8
- package/dist/shared-room-26tNRhZE-BLhtd159.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-BW7JD_oS.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-C7xSH1I5-BJLoUfo9.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-B-ON68Y4-DCfT5-eN.d.ts} +1 -1
- package/dist/utils/plate-keys.js +1 -0
- package/dist/{widths-BjIZxtaJ.d.ts → widths-9NNziDRW.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-sIj7BcYh-BMFkGMuq.d.ts} +0 -0
package/dist/markdown/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as MarkdownSyncPluggable, C as MarkdownSerializePolicy, D as MarkdownStream, E as MarkdownSourceLocation, M as MarkdownSyncTransformer, N as MarkdownWarningDiagnostic, O as MarkdownStreamOptions, S as MarkdownSerializeOptions, T as MarkdownSliceParseResult, _ as MarkdownParseOptions, a as serializeMarkdown, b as MarkdownPlaceholderParseResult, d as MarkdownDocumentParseResult, f as MarkdownEditorSerializeOptions, g as MarkdownParseLimits, h as MarkdownModelLocation, i as parseMarkdown, j as MarkdownSyncPlugin, k as MarkdownStreamSnapshot, l as getMarkdownFrontmatter, m as MarkdownFrontmatter, n as MarkdownPlugin, p as MarkdownErrorDiagnostic, r as MarkdownPluginState, t as MarkdownApi, u as MarkdownDiagnostic, v as MarkdownParsePolicy, w as MarkdownSerializeResult, x as MarkdownPlaceholderSegment, y as MarkdownPlaceholderParseOptions } from "../index-
|
|
1
|
+
import { A as MarkdownSyncPluggable, C as MarkdownSerializePolicy, D as MarkdownStream, E as MarkdownSourceLocation, M as MarkdownSyncTransformer, N as MarkdownWarningDiagnostic, O as MarkdownStreamOptions, S as MarkdownSerializeOptions, T as MarkdownSliceParseResult, _ as MarkdownParseOptions, a as serializeMarkdown, b as MarkdownPlaceholderParseResult, d as MarkdownDocumentParseResult, f as MarkdownEditorSerializeOptions, g as MarkdownParseLimits, h as MarkdownModelLocation, i as parseMarkdown, j as MarkdownSyncPlugin, k as MarkdownStreamSnapshot, l as getMarkdownFrontmatter, m as MarkdownFrontmatter, n as MarkdownPlugin, p as MarkdownErrorDiagnostic, r as MarkdownPluginState, t as MarkdownApi, u as MarkdownDiagnostic, v as MarkdownParsePolicy, w as MarkdownSerializeResult, x as MarkdownPlaceholderSegment, y as MarkdownPlaceholderParseOptions } from "../index-s34W6hUI.js";
|
|
2
2
|
export { type MarkdownApi, type MarkdownDiagnostic, type MarkdownDocumentParseResult, type MarkdownEditorSerializeOptions, type MarkdownErrorDiagnostic, type MarkdownFrontmatter, type MarkdownModelLocation, type MarkdownParseLimits, type MarkdownParseOptions, type MarkdownParsePolicy, type MarkdownPlaceholderParseOptions, type MarkdownPlaceholderParseResult, type MarkdownPlaceholderSegment, MarkdownPlugin, type MarkdownPluginState, type MarkdownSerializeOptions, type MarkdownSerializePolicy, type MarkdownSerializeResult, type MarkdownSliceParseResult, type MarkdownSourceLocation, type MarkdownStream, type MarkdownStreamOptions, type MarkdownStreamSnapshot, type MarkdownSyncPluggable, type MarkdownSyncPlugin, type MarkdownSyncTransformer, type MarkdownWarningDiagnostic, getMarkdownFrontmatter, parseMarkdown, serializeMarkdown };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findTopLevelCssColon, splitCssDeclarations } from "../../../lib/plugins/html/cssLexer.internal.js";
|
|
1
2
|
import { dequal } from "dequal";
|
|
2
3
|
//#region src/markdown/lib/internal/markdownAttributes.ts
|
|
3
4
|
const NUMBER = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
|
|
@@ -88,14 +89,22 @@ const readMarkdownTagAttributes = (tag) => Object.fromEntries(tag.attributes.fla
|
|
|
88
89
|
if (value === null || value === void 0) return [[name, true]];
|
|
89
90
|
return [[name, typeof value === "string" ? value : value.value]];
|
|
90
91
|
}));
|
|
91
|
-
/**
|
|
92
|
-
const
|
|
92
|
+
/** Parse all top-level CSS declarations from a tag's `style` attribute. */
|
|
93
|
+
const readMarkdownStyleDeclarations = (tag) => {
|
|
93
94
|
const { style } = readMarkdownTagAttributes(tag);
|
|
94
|
-
if (typeof style !== "string") return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
if (typeof style !== "string") return [];
|
|
96
|
+
const declarations = [];
|
|
97
|
+
for (const declaration of splitCssDeclarations(style)) {
|
|
98
|
+
const separator = findTopLevelCssColon(declaration);
|
|
99
|
+
if (separator === -1) continue;
|
|
100
|
+
const property = declaration.slice(0, separator).trim().toLowerCase();
|
|
101
|
+
const value = declaration.slice(separator + 1).trim();
|
|
102
|
+
if (property && value) declarations.push({
|
|
103
|
+
property,
|
|
104
|
+
value
|
|
105
|
+
});
|
|
98
106
|
}
|
|
107
|
+
return declarations;
|
|
99
108
|
};
|
|
100
109
|
const isElidedDefault = (descriptor, value) => descriptor?.omitDefault === true && dequal(descriptor.default, value);
|
|
101
110
|
/**
|
|
@@ -176,4 +185,4 @@ const encodeMarkdownNodeAttributes = (state, type, owned, node, excluded) => {
|
|
|
176
185
|
};
|
|
177
186
|
};
|
|
178
187
|
//#endregion
|
|
179
|
-
export { decodeMarkdownNodeProperties, encodeMarkdownNodeAttributes, encodeMarkdownTagAttributes,
|
|
188
|
+
export { decodeMarkdownNodeProperties, encodeMarkdownNodeAttributes, encodeMarkdownTagAttributes, readMarkdownStyleDeclarations, readMarkdownTagAttributes };
|
|
@@ -4,6 +4,7 @@ import { getPlateRuntimeOwner } from "../../../internal/plugin/plateRuntime.js";
|
|
|
4
4
|
import { getCompiledPlateModel, getCompiledPlatePluginList } from "../../../internal/plugin/compilePlateModel.js";
|
|
5
5
|
import { createPluginFormatModelView, createPluginFormatOperationContext } from "../../../internal/plugin/pluginFormatOperation.js";
|
|
6
6
|
import { isScriptUrl } from "../../../internal/utils/urlPolicy.js";
|
|
7
|
+
import { isResourceBearingCss, isSafeStyleValue } from "../../../lib/plugins/html/cssSafety.internal.js";
|
|
7
8
|
import { getPlateNodeMappingContributions } from "../../../internal/plugin/collectPlateNodeMappings.js";
|
|
8
9
|
import { PLUGINS } from "../../../utils/plate-keys.js";
|
|
9
10
|
import { ElementApi } from "../../../core.js";
|
|
@@ -16,9 +17,53 @@ import { markdownIntrinsicDecoders } from "./markdownIntrinsics.js";
|
|
|
16
17
|
import { isMdFlowContent, isMdPhrasingContent } from "../serializer/mdastContent.js";
|
|
17
18
|
import { commitMarkdownListAudit } from "../serializer/listToMdastTree.js";
|
|
18
19
|
import { convertNodesSerialize } from "../serializer/convertNodesSerialize.js";
|
|
19
|
-
import { decodeMarkdownNodeProperties, encodeMarkdownNodeAttributes, encodeMarkdownTagAttributes,
|
|
20
|
+
import { decodeMarkdownNodeProperties, encodeMarkdownNodeAttributes, encodeMarkdownTagAttributes, readMarkdownStyleDeclarations, readMarkdownTagAttributes } from "./markdownAttributes.js";
|
|
20
21
|
import { decodeMarkdownLine, encodeMarkdownLine } from "./markdownLine.js";
|
|
21
22
|
//#region src/markdown/lib/internal/markdownMappings.ts
|
|
23
|
+
const UNSAFE_MARK_STYLE = Symbol("unsafe-mark-style");
|
|
24
|
+
const UNRELATED_UNSAFE_STYLE = Symbol("unrelated-unsafe-style");
|
|
25
|
+
const scannedTagStyleCache = /* @__PURE__ */ new WeakMap();
|
|
26
|
+
const scanMarkdownTagStyles = (tag, options) => {
|
|
27
|
+
const cached = scannedTagStyleCache.get(tag);
|
|
28
|
+
if (cached) return cached;
|
|
29
|
+
const safeValues = /* @__PURE__ */ new Map();
|
|
30
|
+
const unsafeProperties = /* @__PURE__ */ new Set();
|
|
31
|
+
const unsafeMessages = [];
|
|
32
|
+
const rawStyle = readMarkdownTagAttributes(tag).style;
|
|
33
|
+
let hasAnyUnsafe = false;
|
|
34
|
+
for (const declaration of readMarkdownStyleDeclarations(tag)) {
|
|
35
|
+
if (!isSafeStyleValue(declaration.value)) {
|
|
36
|
+
hasAnyUnsafe = true;
|
|
37
|
+
unsafeProperties.add(declaration.property);
|
|
38
|
+
unsafeMessages.push(`Markdown style "${declaration.property}" on <${tag.name ?? "span"}> is not safe and was removed.`);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (!safeValues.has(declaration.property)) safeValues.set(declaration.property, declaration.value);
|
|
42
|
+
}
|
|
43
|
+
if (!hasAnyUnsafe && typeof rawStyle === "string" && isResourceBearingCss(rawStyle)) {
|
|
44
|
+
hasAnyUnsafe = true;
|
|
45
|
+
unsafeMessages.push(`Markdown style attribute on <${tag.name ?? "span"}> is not safe and was removed.`);
|
|
46
|
+
}
|
|
47
|
+
if (hasAnyUnsafe) {
|
|
48
|
+
const message = unsafeMessages.length === 1 ? unsafeMessages[0] ?? "" : `Markdown style attribute on <${tag.name ?? "span"}> contains unsafe declarations that were removed.`;
|
|
49
|
+
options.report({
|
|
50
|
+
code: "markdown-unsafe-content",
|
|
51
|
+
impact: "lossy",
|
|
52
|
+
message,
|
|
53
|
+
nodeType: tag.name ?? "span",
|
|
54
|
+
phase: "parse",
|
|
55
|
+
severity: options.lossPolicy === "allow" ? "warning" : "error",
|
|
56
|
+
source: options.sourceLocation(tag)
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const result = {
|
|
60
|
+
hasAnyUnsafe,
|
|
61
|
+
safeValues,
|
|
62
|
+
unsafeProperties
|
|
63
|
+
};
|
|
64
|
+
scannedTagStyleCache.set(tag, result);
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
22
67
|
const MARKDOWN_MAPPING_FIELDS = /* @__PURE__ */ new Set([
|
|
23
68
|
"attributes",
|
|
24
69
|
"decode",
|
|
@@ -493,6 +538,31 @@ const createMarkWrapper = (compiled, wrap) => (node, options) => {
|
|
|
493
538
|
for (const root of attemptReadRoots) options.readRoots.add(root);
|
|
494
539
|
for (const diagnostic of attemptDiagnostics) options.report(diagnostic);
|
|
495
540
|
const resolvedWrapper = wrapper;
|
|
541
|
+
if (resolvedWrapper.type === "mdxJsxTextElement") {
|
|
542
|
+
const tagName = resolvedWrapper.name ?? "span";
|
|
543
|
+
for (const attr of resolvedWrapper.attributes ?? []) {
|
|
544
|
+
if (!attr || typeof attr !== "object" || !("name" in attr) || typeof attr.name !== "string" || attr.name.toLowerCase() !== "style") continue;
|
|
545
|
+
if (typeof attr.value !== "string") return {
|
|
546
|
+
kind: "unsafe",
|
|
547
|
+
message: `Markdown style attribute on <${tagName}> is not safe and was removed.`,
|
|
548
|
+
nodeType: tagName
|
|
549
|
+
};
|
|
550
|
+
const unsafeDecl = readMarkdownStyleDeclarations({
|
|
551
|
+
attributes: [{
|
|
552
|
+
name: "style",
|
|
553
|
+
type: "mdxJsxAttribute",
|
|
554
|
+
value: attr.value
|
|
555
|
+
}],
|
|
556
|
+
name: tagName,
|
|
557
|
+
type: "mdxJsxTextElement"
|
|
558
|
+
}).find((decl) => !isSafeStyleValue(decl.value));
|
|
559
|
+
if (unsafeDecl || isResourceBearingCss(attr.value)) return {
|
|
560
|
+
kind: "unsafe",
|
|
561
|
+
message: unsafeDecl ? `Markdown style "${unsafeDecl.property}" on <${tagName}> is not safe and was removed.` : `Markdown style attribute on <${tagName}> is not safe and was removed.`,
|
|
562
|
+
nodeType: tagName
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
}
|
|
496
566
|
return {
|
|
497
567
|
kind: "node",
|
|
498
568
|
node: resolvedWrapper.type === "mdxJsxTextElement" ? {
|
|
@@ -505,19 +575,38 @@ const createMarkWrapper = (compiled, wrap) => (node, options) => {
|
|
|
505
575
|
}
|
|
506
576
|
};
|
|
507
577
|
};
|
|
508
|
-
const createTagWrapper = (name, key, style) => (node) =>
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
578
|
+
const createTagWrapper = (name, key, style) => (node) => {
|
|
579
|
+
if (style) {
|
|
580
|
+
const value = String(node[key]);
|
|
581
|
+
if (!isSafeStyleValue(value)) return {
|
|
582
|
+
kind: "unsafe",
|
|
583
|
+
message: `Markdown style "${style}" on <${name}> is not safe and was removed.`,
|
|
584
|
+
nodeType: name
|
|
585
|
+
};
|
|
586
|
+
return {
|
|
587
|
+
kind: "node",
|
|
588
|
+
node: {
|
|
589
|
+
attributes: [{
|
|
590
|
+
name: "style",
|
|
591
|
+
type: "mdxJsxAttribute",
|
|
592
|
+
value: `${style}: ${value};`
|
|
593
|
+
}],
|
|
594
|
+
children: [],
|
|
595
|
+
name,
|
|
596
|
+
type: "mdxJsxTextElement"
|
|
597
|
+
}
|
|
598
|
+
};
|
|
519
599
|
}
|
|
520
|
-
|
|
600
|
+
return {
|
|
601
|
+
kind: "node",
|
|
602
|
+
node: {
|
|
603
|
+
attributes: [],
|
|
604
|
+
children: [],
|
|
605
|
+
name,
|
|
606
|
+
type: "mdxJsxTextElement"
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
};
|
|
521
610
|
const isPresent = (value) => value !== void 0 && value !== null && value !== false;
|
|
522
611
|
const markAcceptanceOverlaps = (left, right) => {
|
|
523
612
|
if (left.kind === "all" || right.kind === "all") return true;
|
|
@@ -664,7 +753,15 @@ const compileMarkdownMappings = (editor) => {
|
|
|
664
753
|
const { mapping } = compiled;
|
|
665
754
|
const key = compiled.targetKey ?? failInvariant("Expected a mark target key.");
|
|
666
755
|
const { decode, style } = mapping;
|
|
667
|
-
if (mapping.tag !== void 0 || mapping.node !== void 0) addDecoder(compiled, decode ? (node, marks, options) => decode(createDecodeContext(compiled, node, marks, options)) : style ? (node
|
|
756
|
+
if (mapping.tag !== void 0 || mapping.node !== void 0) addDecoder(compiled, decode ? (node, marks, options) => decode(createDecodeContext(compiled, node, marks, options)) : style ? (node, _marks, options) => {
|
|
757
|
+
const tag = node;
|
|
758
|
+
const target = style.toLowerCase();
|
|
759
|
+
const scanned = scanMarkdownTagStyles(tag, options);
|
|
760
|
+
if (scanned.unsafeProperties.has(target)) return UNSAFE_MARK_STYLE;
|
|
761
|
+
const matched = scanned.safeValues.get(target);
|
|
762
|
+
if (matched !== void 0) return matched;
|
|
763
|
+
return scanned.hasAnyUnsafe ? UNRELATED_UNSAFE_STYLE : void 0;
|
|
764
|
+
} : () => mapping.value ?? true);
|
|
668
765
|
const writer = createMarkWriter(compiled);
|
|
669
766
|
if (!writer) return;
|
|
670
767
|
const existing = markWriters.get(key) ?? [];
|
|
@@ -741,11 +838,21 @@ const withInlineText = (decoded, options) => decoded.map((item) => {
|
|
|
741
838
|
const runMarkdownDecoders = (decoders, node, marks, options, previousSibling = null) => {
|
|
742
839
|
if (decoders[0]?.mark) {
|
|
743
840
|
let marked;
|
|
841
|
+
let strippedUnsafe = false;
|
|
744
842
|
const claimedKeys = /* @__PURE__ */ new Set();
|
|
745
843
|
for (const decoder of decoders) {
|
|
746
844
|
const key = decoder.targetKey ?? failInvariant("Expected a mark target key.");
|
|
747
845
|
if (claimedKeys.has(key)) continue;
|
|
748
846
|
const contribution = decoder.decode(node, marks, options, previousSibling);
|
|
847
|
+
if (contribution === UNSAFE_MARK_STYLE) {
|
|
848
|
+
claimedKeys.add(key);
|
|
849
|
+
strippedUnsafe = true;
|
|
850
|
+
continue;
|
|
851
|
+
}
|
|
852
|
+
if (contribution === UNRELATED_UNSAFE_STYLE) {
|
|
853
|
+
strippedUnsafe = true;
|
|
854
|
+
continue;
|
|
855
|
+
}
|
|
749
856
|
if (contribution !== void 0) {
|
|
750
857
|
claimedKeys.add(key);
|
|
751
858
|
marked = {
|
|
@@ -754,8 +861,8 @@ const runMarkdownDecoders = (decoders, node, marks, options, previousSibling = n
|
|
|
754
861
|
};
|
|
755
862
|
}
|
|
756
863
|
}
|
|
757
|
-
if (!marked) return void 0;
|
|
758
|
-
if ("children" in node && Array.isArray(node.children)) return convertChildrenDeserialize(node.children, marked, options);
|
|
864
|
+
if (!marked && !strippedUnsafe) return void 0;
|
|
865
|
+
if ("children" in node && Array.isArray(node.children)) return convertChildrenDeserialize(node.children, marked ?? marks, options);
|
|
759
866
|
const value = "value" in node && typeof node.value === "string" ? node.value : "";
|
|
760
867
|
return [{
|
|
761
868
|
...marked,
|
|
@@ -52,7 +52,7 @@ const resolveLeafMark = (leaf, key, options) => {
|
|
|
52
52
|
lastDeclinedOwner = writer.owner;
|
|
53
53
|
continue;
|
|
54
54
|
}
|
|
55
|
-
if (wrapped.kind === "refused") {
|
|
55
|
+
if (wrapped.kind === "refused" || wrapped.kind === "unsafe") {
|
|
56
56
|
resolved = wrapped;
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
@@ -125,6 +125,21 @@ const convertPhrasingSerialize = (nodes, options, encodeInline, hardBreaks) => {
|
|
|
125
125
|
})?.role === "metadata") continue;
|
|
126
126
|
const resolved = resolveLeafMark(leaf, key, phrasingOptions);
|
|
127
127
|
if (resolved.kind === "container" || resolved.kind === "inlineCode") continue;
|
|
128
|
+
if (resolved.kind === "unsafe") {
|
|
129
|
+
options.report({
|
|
130
|
+
code: "markdown-unsafe-content",
|
|
131
|
+
impact: "lossy",
|
|
132
|
+
message: resolved.message,
|
|
133
|
+
model: {
|
|
134
|
+
...options.modelLocation(leaf),
|
|
135
|
+
property: key
|
|
136
|
+
},
|
|
137
|
+
nodeType: resolved.nodeType,
|
|
138
|
+
phase: "serialize",
|
|
139
|
+
severity: options.lossPolicy === "allow" ? "warning" : "error"
|
|
140
|
+
});
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
128
143
|
options.report({
|
|
129
144
|
code: "markdown-property-omitted",
|
|
130
145
|
impact: "lossy",
|
package/dist/math/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $o as Range, Vl as TxDeclaredMethod, Wl as Value, qo as PropertyStringDescriptor, wi as ElementOf } from "../tx-only-
|
|
2
|
-
import "../htmlTypes-
|
|
3
|
-
import { Tn as SelectionInputRuleContext, _n as InsertTextInputRule, en as BlockFenceInputRuleMatch, fo as PluginReference, ln as InsertBreakInputRule, o as Editor, p as BasePlugin, vt as NodeInsertOptions } from "../core-
|
|
1
|
+
import { $o as Range, Vl as TxDeclaredMethod, Wl as Value, qo as PropertyStringDescriptor, wi as ElementOf } from "../tx-only-sIj7BcYh-BMFkGMuq.js";
|
|
2
|
+
import "../htmlTypes-3laowz-3.js";
|
|
3
|
+
import { Tn as SelectionInputRuleContext, _n as InsertTextInputRule, en as BlockFenceInputRuleMatch, fo as PluginReference, ln as InsertBreakInputRule, o as Editor, p as BasePlugin, vt as NodeInsertOptions } from "../core-By92GWYW.js";
|
|
4
4
|
declare const BaseEquationPlugin: BasePlugin<Readonly<{
|
|
5
5
|
readonly __pluginWritableProperties: Readonly<{
|
|
6
6
|
descriptor: PropertyStringDescriptor<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Vl as TxDeclaredMethod, qo as PropertyStringDescriptor } from "../../tx-only-
|
|
2
|
-
import "../../htmlTypes-
|
|
3
|
-
import { vt as NodeInsertOptions } from "../../core-
|
|
4
|
-
import { Tt as Plugin } from "../../index-
|
|
1
|
+
import { Vl as TxDeclaredMethod, qo as PropertyStringDescriptor } from "../../tx-only-sIj7BcYh-BMFkGMuq.js";
|
|
2
|
+
import "../../htmlTypes-3laowz-3.js";
|
|
3
|
+
import { vt as NodeInsertOptions } from "../../core-By92GWYW.js";
|
|
4
|
+
import { Tt as Plugin } from "../../index-wEkvA-wI.js";
|
|
5
5
|
declare const EquationPlugin: Plugin<Readonly<{
|
|
6
6
|
readonly __pluginWritableProperties: Readonly<{
|
|
7
7
|
descriptor: PropertyStringDescriptor<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $o as Range, Cc as Selection, Eo as PluginReference, Mt as EditorJsonValue, N as Descendant, Wa as Path, Ya as PersistedDocument, _t as EditorDocumentValue, pr as EditorStateSchemaApi } from "../tx-only-
|
|
2
|
-
import { h as EditorApplicationSchema } from "../htmlTypes-
|
|
3
|
-
import "../core-
|
|
4
|
-
import { i as CommentAnchors, t as CommentAnchor } from "../comment-anchor.internal-
|
|
1
|
+
import { $o as Range, Cc as Selection, Eo as PluginReference, Mt as EditorJsonValue, N as Descendant, Wa as Path, Ya as PersistedDocument, _t as EditorDocumentValue, pr as EditorStateSchemaApi } from "../tx-only-sIj7BcYh-BMFkGMuq.js";
|
|
2
|
+
import { h as EditorApplicationSchema } from "../htmlTypes-3laowz-3.js";
|
|
3
|
+
import "../core-By92GWYW.js";
|
|
4
|
+
import { i as CommentAnchors, t as CommentAnchor } from "../comment-anchor.internal-CoNK9gTD.js";
|
|
5
5
|
type NamedEditorApplicationSchema = EditorApplicationSchema & Readonly<{
|
|
6
6
|
id: string;
|
|
7
7
|
version: number;
|
|
@@ -16,6 +16,68 @@ const migratePlateV54Urls = ({ document, target: conversionTarget }) => {
|
|
|
16
16
|
})?.value.validate;
|
|
17
17
|
return Object.hasOwn(element, key) && typeof value === "string" && validate !== void 0 && !validate(value);
|
|
18
18
|
};
|
|
19
|
+
const styleMarkKeys = /* @__PURE__ */ new Set([
|
|
20
|
+
"backgroundColor",
|
|
21
|
+
"color",
|
|
22
|
+
"fontFamily",
|
|
23
|
+
"fontSize"
|
|
24
|
+
]);
|
|
25
|
+
const isUnsafeStyleMarkValue = (key, value) => {
|
|
26
|
+
if (!styleMarkKeys.has(key) || typeof value !== "string") return false;
|
|
27
|
+
const validate = conversionTarget.schema.property({
|
|
28
|
+
key,
|
|
29
|
+
placement: "text"
|
|
30
|
+
})?.value.validate;
|
|
31
|
+
return validate !== void 0 && !validate(value);
|
|
32
|
+
};
|
|
33
|
+
const stripUnsafeStyleMarks = (leaf) => {
|
|
34
|
+
let next;
|
|
35
|
+
for (const key of styleMarkKeys) {
|
|
36
|
+
if (!Object.hasOwn(leaf, key)) continue;
|
|
37
|
+
if (isUnsafeStyleMarkValue(key, Reflect.get(leaf, key))) {
|
|
38
|
+
next ??= { ...leaf };
|
|
39
|
+
delete next[key];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const authored = Reflect.get(leaf, "authored");
|
|
43
|
+
if (Array.isArray(authored)) {
|
|
44
|
+
let authoredChanged = false;
|
|
45
|
+
const sanitized = [];
|
|
46
|
+
for (const entry of authored) {
|
|
47
|
+
if (!entry || typeof entry !== "object" || Reflect.get(entry, "kind") !== "format") {
|
|
48
|
+
sanitized.push(entry);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const key = Reflect.get(entry, "key");
|
|
52
|
+
if (typeof key !== "string" || !styleMarkKeys.has(key)) {
|
|
53
|
+
sanitized.push(entry);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const hasBefore = Object.hasOwn(entry, "before");
|
|
57
|
+
const beforeUnsafe = hasBefore && isUnsafeStyleMarkValue(key, Reflect.get(entry, "before"));
|
|
58
|
+
const write = Reflect.get(entry, "write");
|
|
59
|
+
const writeUnsafe = !!write && typeof write === "object" && Reflect.get(write, "kind") === "set" && isUnsafeStyleMarkValue(key, Reflect.get(write, "value"));
|
|
60
|
+
if (!beforeUnsafe && !writeUnsafe) {
|
|
61
|
+
sanitized.push(entry);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
authoredChanged = true;
|
|
65
|
+
const nextHasBefore = hasBefore && !beforeUnsafe;
|
|
66
|
+
const nextWrite = writeUnsafe ? { kind: "remove" } : write;
|
|
67
|
+
if (!nextHasBefore && nextWrite && typeof nextWrite === "object" && Reflect.get(nextWrite, "kind") === "remove") continue;
|
|
68
|
+
const cleaned = { ...entry };
|
|
69
|
+
if (beforeUnsafe) delete cleaned.before;
|
|
70
|
+
if (writeUnsafe) cleaned.write = nextWrite;
|
|
71
|
+
sanitized.push(cleaned);
|
|
72
|
+
}
|
|
73
|
+
if (authoredChanged) {
|
|
74
|
+
next ??= { ...leaf };
|
|
75
|
+
if (sanitized.length > 0) next.authored = sanitized;
|
|
76
|
+
else delete next.authored;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return next ?? leaf;
|
|
80
|
+
};
|
|
19
81
|
const pointMappings = /* @__PURE__ */ new Map();
|
|
20
82
|
const elementTargets = /* @__PURE__ */ new Map();
|
|
21
83
|
const recordedKeys = [];
|
|
@@ -29,7 +91,7 @@ const migratePlateV54Urls = ({ document, target: conversionTarget }) => {
|
|
|
29
91
|
});
|
|
30
92
|
recordedKeys.push(key);
|
|
31
93
|
}
|
|
32
|
-
return [input];
|
|
94
|
+
return [stripUnsafeStyleMarks(input)];
|
|
33
95
|
}
|
|
34
96
|
const unwrap = input.type === linkType && rejects(input, "url");
|
|
35
97
|
const replace = !unwrap && mediaTypes.has(input.type) && rejects(input, "url");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PageRect, c as PageSettingsSource, i as PagePreset, l as pageSettingsCodec, n as PageLayoutSnapshot, o as PageSettings, r as PageMargins, s as PageSettingsJson, t as PageLayoutPage } from "../index-
|
|
1
|
+
import { a as PageRect, c as PageSettingsSource, i as PagePreset, l as pageSettingsCodec, n as PageLayoutSnapshot, o as PageSettings, r as PageMargins, s as PageSettingsJson, t as PageLayoutPage } from "../index-C5Xw3JDc.js";
|
|
2
2
|
export { type PageLayoutPage, type PageLayoutSnapshot, type PageMargins, type PagePreset, type PageRect, type PageSettings, type PageSettingsJson, type PageSettingsSource, pageSettingsCodec };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { gi as Element$1 } from "../../tx-only-
|
|
2
|
-
import { Tt as Plugin, Wt as WrapContentProps } from "../../index-
|
|
3
|
-
import { a as PageRect, c as PageSettingsSource, i as PagePreset, l as pageSettingsCodec, n as PageLayoutSnapshot, o as PageSettings, r as PageMargins, s as PageSettingsJson, t as PageLayoutPage } from "../../index-
|
|
1
|
+
import { gi as Element$1 } from "../../tx-only-sIj7BcYh-BMFkGMuq.js";
|
|
2
|
+
import { Tt as Plugin, Wt as WrapContentProps } from "../../index-wEkvA-wI.js";
|
|
3
|
+
import { a as PageRect, c as PageSettingsSource, i as PagePreset, l as pageSettingsCodec, n as PageLayoutSnapshot, o as PageSettings, r as PageMargins, s as PageSettingsJson, t as PageLayoutPage } from "../../index-C5Xw3JDc.js";
|
|
4
4
|
import React$1 from "react";
|
|
5
5
|
/** Props passed to page sheet, header, and footer renderers inside `PaginationSurface`. */
|
|
6
6
|
type PaginationRenderPageProps = Readonly<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as DocumentChangeJson, Fi as JsonEditorValue, Kc as SyncDelegatedActor, Wc as SyncAccess } from "./tx-only-
|
|
1
|
+
import { B as DocumentChangeJson, Fi as JsonEditorValue, Kc as SyncDelegatedActor, Wc as SyncAccess } from "./tx-only-sIj7BcYh-BMFkGMuq.js";
|
|
2
2
|
/** WebSocket subprotocol identifier negotiated on sync room upgrades. */
|
|
3
3
|
declare const SYNC_WEBSOCKET_PROTOCOL = "editor-sync.1";
|
|
4
4
|
/** Largest UTF-8 byte size allowed for one serialized server room event frame. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Ma as InternalPluginDefinitionOf } from "../../core-
|
|
2
|
-
import { Dt as PluginConfiguration, en as InternalReactPluginAdapterResult } from "../../index-
|
|
3
|
-
import { f as AuthoredGroupQuery } from "../../authored-
|
|
4
|
-
import { r as AuthoredPlugin } from "../../index-
|
|
1
|
+
import { Ma as InternalPluginDefinitionOf } from "../../core-By92GWYW.js";
|
|
2
|
+
import { Dt as PluginConfiguration, en as InternalReactPluginAdapterResult } from "../../index-wEkvA-wI.js";
|
|
3
|
+
import { f as AuthoredGroupQuery } from "../../authored-qetvpvU--DSWESzxK.js";
|
|
4
|
+
import { r as AuthoredPlugin } from "../../index-CHlITvuq.js";
|
|
5
5
|
/** Per-presentation review interaction state owned by `AuthoredReactPlugin`. */
|
|
6
6
|
type AuthoredReactViewState = Readonly<{
|
|
7
7
|
activeId: string | null;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { isDOMElement } from "../../dom/plite-dom.internal.js";
|
|
1
2
|
import { getStaticDocumentView } from "../../static/internal/staticDocumentView.js";
|
|
2
3
|
import { EditorStatic } from "../../static/components/EditorStatic.js";
|
|
3
4
|
import { writeStaticSelectionClipboardData } from "./writeStaticSelectionClipboardData.internal.js";
|
|
4
5
|
import React from "react";
|
|
5
6
|
import { c } from "react/compiler-runtime";
|
|
6
7
|
//#region src/react/components/PlateView.tsx
|
|
8
|
+
const isNativeInputTarget = (target) => {
|
|
9
|
+
if (!isDOMElement(target)) return false;
|
|
10
|
+
const view = target.ownerDocument.defaultView;
|
|
11
|
+
return typeof HTMLInputElement === "function" && target instanceof HTMLInputElement || typeof HTMLTextAreaElement === "function" && target instanceof HTMLTextAreaElement || typeof view?.HTMLInputElement === "function" && target instanceof view.HTMLInputElement || typeof view?.HTMLTextAreaElement === "function" && target instanceof view.HTMLTextAreaElement;
|
|
12
|
+
};
|
|
7
13
|
const EditorPreview = (props) => {
|
|
8
14
|
const $ = c(12);
|
|
9
15
|
const { document, editor, fragment, inertRemoteMedia, onCopy: onCopyProp, presentation } = props;
|
|
@@ -28,7 +34,7 @@ const EditorPreview = (props) => {
|
|
|
28
34
|
if ($[6] !== onCopyProp || $[7] !== view) {
|
|
29
35
|
t2 = (event) => {
|
|
30
36
|
onCopyProp?.(event);
|
|
31
|
-
if (!event.defaultPrevented && writeStaticSelectionClipboardData(view, event.clipboardData, event.currentTarget)) event.preventDefault();
|
|
37
|
+
if (!event.defaultPrevented && !isNativeInputTarget(event.target) && event.clipboardData && writeStaticSelectionClipboardData(view, event.clipboardData, event.currentTarget)) event.preventDefault();
|
|
32
38
|
};
|
|
33
39
|
$[6] = onCopyProp;
|
|
34
40
|
$[7] = view;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Bo as PropertyEnumDescriptor, Is as SchemaElementPropertyDefinition, Mt as EditorJsonValue, N as Descendant, Qo as PropertyValueOptions, Qs as SchemaPropertyCopyPolicy, Ro as PropertyBooleanDescriptor, T as ContentSlice$1, Uo as PropertyNumberDescriptor, Vl as TxDeclaredMethod, Vo as PropertyJsonDescriptor, Xo as PropertyValueKind, Yo as PropertyValueDescriptor, ac as SchemaPropertyLandingPolicy, cc as SchemaPropertySplitPolicy, gi as Element$1, lc as SchemaPropertyTypeChangePolicy, ma as NodeKey, qo as PropertyStringDescriptor, sc as SchemaPropertyRole } from "../../../tx-only-
|
|
2
|
-
import "../../../htmlTypes-
|
|
3
|
-
import { ct as BlockInsertOptions, p as BasePlugin, st as BasePluginInput } from "../../../core-
|
|
4
|
-
import { Tt as Plugin, Yt as EditorElementProps } from "../../../index-
|
|
5
|
-
import { A as BoardArrowEnd, B as isBoardFramePlace, D as BoardStyleProperties, E as BOARD_STROKE_STYLES, G as isBoardSize, H as BoardPlace, I as BoardMemberEntry, K as isStackingKey, M as BoardArrowSide, N as isBoardArrowEnd, O as BoardStyles, T as BOARD_ARROW_STYLES, U as BoardRestackDirection, V as isBoardShapePlace, W as BoardSize, c as BoardStrokePath, g as BoardGeo, j as BoardArrowEnds, k as BoardArrowAnchor, l as BoardStrokePoints, s as BoardInkPoint, u as isBoardStrokePoints, v as BoardShapeInsertProps, w as BoardArrowEndInput, z as BoardShapePlace } from "../../../index-
|
|
1
|
+
import { Bo as PropertyEnumDescriptor, Is as SchemaElementPropertyDefinition, Mt as EditorJsonValue, N as Descendant, Qo as PropertyValueOptions, Qs as SchemaPropertyCopyPolicy, Ro as PropertyBooleanDescriptor, T as ContentSlice$1, Uo as PropertyNumberDescriptor, Vl as TxDeclaredMethod, Vo as PropertyJsonDescriptor, Xo as PropertyValueKind, Yo as PropertyValueDescriptor, ac as SchemaPropertyLandingPolicy, cc as SchemaPropertySplitPolicy, gi as Element$1, lc as SchemaPropertyTypeChangePolicy, ma as NodeKey, qo as PropertyStringDescriptor, sc as SchemaPropertyRole } from "../../../tx-only-sIj7BcYh-BMFkGMuq.js";
|
|
2
|
+
import "../../../htmlTypes-3laowz-3.js";
|
|
3
|
+
import { ct as BlockInsertOptions, p as BasePlugin, st as BasePluginInput } from "../../../core-By92GWYW.js";
|
|
4
|
+
import { Tt as Plugin, Yt as EditorElementProps } from "../../../index-wEkvA-wI.js";
|
|
5
|
+
import { A as BoardArrowEnd, B as isBoardFramePlace, D as BoardStyleProperties, E as BOARD_STROKE_STYLES, G as isBoardSize, H as BoardPlace, I as BoardMemberEntry, K as isStackingKey, M as BoardArrowSide, N as isBoardArrowEnd, O as BoardStyles, T as BOARD_ARROW_STYLES, U as BoardRestackDirection, V as isBoardShapePlace, W as BoardSize, c as BoardStrokePath, g as BoardGeo, j as BoardArrowEnds, k as BoardArrowAnchor, l as BoardStrokePoints, s as BoardInkPoint, u as isBoardStrokePoints, v as BoardShapeInsertProps, w as BoardArrowEndInput, z as BoardShapePlace } from "../../../index-Dyw6BJx8.js";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import "rbush";
|
|
8
8
|
declare const BoardPlugin: Plugin<Readonly<{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Bi as Location, Da as NodeSelection, Es as SchemaContentRule, Mt as EditorJsonValue, Qo as PropertyValueOptions, Vl as TxDeclaredMethod, gs as SchemaContentDefault, qo as PropertyStringDescriptor } from "../../../tx-only-
|
|
2
|
-
import "../../../htmlTypes-
|
|
3
|
-
import { fo as PluginReference, lt as BlockUpsertOptions, p as BasePlugin, uo as PluginDependency } from "../../../core-
|
|
4
|
-
import { Tt as Plugin } from "../../../index-
|
|
1
|
+
import { Bi as Location, Da as NodeSelection, Es as SchemaContentRule, Mt as EditorJsonValue, Qo as PropertyValueOptions, Vl as TxDeclaredMethod, Vo as PropertyJsonDescriptor, gs as SchemaContentDefault, qo as PropertyStringDescriptor } from "../../../tx-only-sIj7BcYh-BMFkGMuq.js";
|
|
2
|
+
import "../../../htmlTypes-3laowz-3.js";
|
|
3
|
+
import { fo as PluginReference, lt as BlockUpsertOptions, p as BasePlugin, uo as PluginDependency } from "../../../core-By92GWYW.js";
|
|
4
|
+
import { Tt as Plugin } from "../../../index-wEkvA-wI.js";
|
|
5
|
+
import { n as CalloutAction } from "../../../index-D8EGVCeT.js";
|
|
5
6
|
declare const CalloutPlugin: Plugin<Readonly<{
|
|
6
7
|
formats: true;
|
|
7
8
|
rules: true;
|
|
@@ -92,6 +93,7 @@ declare const CalloutPlugin: Plugin<Readonly<{
|
|
|
92
93
|
}> & Readonly<Record<never, never>> & Readonly<{
|
|
93
94
|
update: {
|
|
94
95
|
readonly toggle: TxDeclaredMethod<(options?: Readonly<{
|
|
96
|
+
actions?: readonly CalloutAction[];
|
|
95
97
|
backgroundColor?: string;
|
|
96
98
|
icon?: string;
|
|
97
99
|
variant?: string;
|
|
@@ -102,11 +104,13 @@ declare const CalloutPlugin: Plugin<Readonly<{
|
|
|
102
104
|
at?: Location | NodeSelection;
|
|
103
105
|
}) => boolean>;
|
|
104
106
|
readonly upsert: TxDeclaredMethod<(data?: Readonly<{
|
|
107
|
+
actions?: readonly CalloutAction[];
|
|
105
108
|
backgroundColor?: string;
|
|
106
109
|
icon?: string;
|
|
107
110
|
variant?: string;
|
|
108
111
|
}>, options?: BlockUpsertOptions) => boolean>;
|
|
109
112
|
readonly wrap: TxDeclaredMethod<({ at, ...rest }?: Readonly<{
|
|
113
|
+
actions?: readonly CalloutAction[];
|
|
110
114
|
backgroundColor?: string;
|
|
111
115
|
icon?: string;
|
|
112
116
|
variant?: string;
|
|
@@ -116,6 +120,55 @@ declare const CalloutPlugin: Plugin<Readonly<{
|
|
|
116
120
|
};
|
|
117
121
|
}> & Readonly<{
|
|
118
122
|
__pluginWritableProperties: Readonly<{
|
|
123
|
+
descriptor: PropertyJsonDescriptor<readonly Readonly<{
|
|
124
|
+
confirm?: string;
|
|
125
|
+
id: string;
|
|
126
|
+
kind?: string;
|
|
127
|
+
label: string;
|
|
128
|
+
payload?: Readonly<Record<string, EditorJsonValue>>;
|
|
129
|
+
}>[], {
|
|
130
|
+
readonly validate: (value: unknown) => value is readonly CalloutAction[];
|
|
131
|
+
readonly validationVersion: 1;
|
|
132
|
+
} & Readonly<{
|
|
133
|
+
default?: readonly Readonly<{
|
|
134
|
+
confirm?: string;
|
|
135
|
+
id: string;
|
|
136
|
+
kind?: string;
|
|
137
|
+
label: string;
|
|
138
|
+
payload?: Readonly<Record<string, EditorJsonValue>>;
|
|
139
|
+
}>[] | undefined;
|
|
140
|
+
generate?: (() => readonly Readonly<{
|
|
141
|
+
confirm?: string;
|
|
142
|
+
id: string;
|
|
143
|
+
kind?: string;
|
|
144
|
+
label: string;
|
|
145
|
+
payload?: Readonly<Record<string, EditorJsonValue>>;
|
|
146
|
+
}>[]) | undefined;
|
|
147
|
+
omitDefault?: boolean;
|
|
148
|
+
required?: boolean;
|
|
149
|
+
}> & Readonly<{
|
|
150
|
+
validate: (value: unknown) => value is readonly Readonly<{
|
|
151
|
+
confirm?: string;
|
|
152
|
+
id: string;
|
|
153
|
+
kind?: string;
|
|
154
|
+
label: string;
|
|
155
|
+
payload?: Readonly<Record<string, EditorJsonValue>>;
|
|
156
|
+
}>[];
|
|
157
|
+
validationVersion: number;
|
|
158
|
+
}>>;
|
|
159
|
+
key: "actions";
|
|
160
|
+
localId: "actions";
|
|
161
|
+
ownerName: "callout";
|
|
162
|
+
placement: "element";
|
|
163
|
+
unaliased: true;
|
|
164
|
+
value: readonly Readonly<{
|
|
165
|
+
confirm?: string;
|
|
166
|
+
id: string;
|
|
167
|
+
kind?: string;
|
|
168
|
+
label: string;
|
|
169
|
+
payload?: Readonly<Record<string, EditorJsonValue>>;
|
|
170
|
+
}>[];
|
|
171
|
+
}> | Readonly<{
|
|
119
172
|
descriptor: PropertyStringDescriptor<PropertyValueOptions<string>>;
|
|
120
173
|
key: "backgroundColor";
|
|
121
174
|
localId: "backgroundColor";
|
|
@@ -157,6 +210,42 @@ declare const CalloutPlugin: Plugin<Readonly<{
|
|
|
157
210
|
min?: number;
|
|
158
211
|
}>>;
|
|
159
212
|
properties: {
|
|
213
|
+
actions: PropertyJsonDescriptor<readonly Readonly<{
|
|
214
|
+
confirm?: string;
|
|
215
|
+
id: string;
|
|
216
|
+
kind?: string;
|
|
217
|
+
label: string;
|
|
218
|
+
payload?: Readonly<Record<string, EditorJsonValue>>;
|
|
219
|
+
}>[], {
|
|
220
|
+
readonly validate: (value: unknown) => value is readonly CalloutAction[];
|
|
221
|
+
readonly validationVersion: 1;
|
|
222
|
+
} & Readonly<{
|
|
223
|
+
default?: readonly Readonly<{
|
|
224
|
+
confirm?: string;
|
|
225
|
+
id: string;
|
|
226
|
+
kind?: string;
|
|
227
|
+
label: string;
|
|
228
|
+
payload?: Readonly<Record<string, EditorJsonValue>>;
|
|
229
|
+
}>[] | undefined;
|
|
230
|
+
generate?: (() => readonly Readonly<{
|
|
231
|
+
confirm?: string;
|
|
232
|
+
id: string;
|
|
233
|
+
kind?: string;
|
|
234
|
+
label: string;
|
|
235
|
+
payload?: Readonly<Record<string, EditorJsonValue>>;
|
|
236
|
+
}>[]) | undefined;
|
|
237
|
+
omitDefault?: boolean;
|
|
238
|
+
required?: boolean;
|
|
239
|
+
}> & Readonly<{
|
|
240
|
+
validate: (value: unknown) => value is readonly Readonly<{
|
|
241
|
+
confirm?: string;
|
|
242
|
+
id: string;
|
|
243
|
+
kind?: string;
|
|
244
|
+
label: string;
|
|
245
|
+
payload?: Readonly<Record<string, EditorJsonValue>>;
|
|
246
|
+
}>[];
|
|
247
|
+
validationVersion: number;
|
|
248
|
+
}>>;
|
|
160
249
|
backgroundColor: PropertyStringDescriptor<PropertyValueOptions<string>>;
|
|
161
250
|
icon: PropertyStringDescriptor<PropertyValueOptions<string>>;
|
|
162
251
|
variant: PropertyStringDescriptor<PropertyValueOptions<string>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Es as SchemaContentRule, Mt as EditorJsonValue, Uo as PropertyNumberDescriptor, Vl as TxDeclaredMethod, gs as SchemaContentDefault } from "../../../tx-only-
|
|
2
|
-
import "../../../htmlTypes-
|
|
3
|
-
import { ct as BlockInsertOptions, fo as PluginReference, lt as BlockUpsertOptions, p as BasePlugin, uo as PluginDependency } from "../../../core-
|
|
4
|
-
import { Tt as Plugin } from "../../../index-
|
|
5
|
-
import { a as ColumnTargetOptions, c as ResizeColumnsOptions, l as SetColumnsOptions, o as InsertColumnGroupInput, s as InsertColumnOptions, u as ToggleColumnGroupOptions } from "../../../index-
|
|
1
|
+
import { Es as SchemaContentRule, Mt as EditorJsonValue, Uo as PropertyNumberDescriptor, Vl as TxDeclaredMethod, gs as SchemaContentDefault } from "../../../tx-only-sIj7BcYh-BMFkGMuq.js";
|
|
2
|
+
import "../../../htmlTypes-3laowz-3.js";
|
|
3
|
+
import { ct as BlockInsertOptions, fo as PluginReference, lt as BlockUpsertOptions, p as BasePlugin, uo as PluginDependency } from "../../../core-By92GWYW.js";
|
|
4
|
+
import { Tt as Plugin } from "../../../index-wEkvA-wI.js";
|
|
5
|
+
import { a as ColumnTargetOptions, c as ResizeColumnsOptions, l as SetColumnsOptions, o as InsertColumnGroupInput, s as InsertColumnOptions, u as ToggleColumnGroupOptions } from "../../../index-CAshLTjV.js";
|
|
6
6
|
/** React adapter for individual columns inside a column group. */
|
|
7
7
|
declare const ColumnItemPlugin: Plugin<Readonly<{
|
|
8
8
|
readonly dependencies: readonly [PluginReference<"paragraph"> & PluginDependency<Readonly<{
|