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
|
@@ -64,30 +64,33 @@ const registerPrimaryEditableRef = (editor, ref) => {
|
|
|
64
64
|
};
|
|
65
65
|
const PaginationContentNestingContext = createContext(false);
|
|
66
66
|
/**
|
|
67
|
-
* `slots.wrapContent` component for `PaginationPlugin`. Wraps
|
|
68
|
-
* `'main'`
|
|
69
|
-
*
|
|
67
|
+
* `slots.wrapContent` component for `PaginationPlugin`. Wraps matched top-level
|
|
68
|
+
* `<EditorContent />` roots (default `'main'`) in a zero-remount
|
|
69
|
+
* `PaginationSurface` and passes unmatched or nested roots straight through
|
|
70
|
+
* untouched.
|
|
70
71
|
*/
|
|
71
72
|
function PaginationContent(t0) {
|
|
72
|
-
const $ = c(
|
|
73
|
-
const { children, className, page: pageOverride, renderFooter, renderHeader, renderPage, style } = t0;
|
|
73
|
+
const $ = c(24);
|
|
74
|
+
const { children, className, enabled: enabledOverride, matchRoot, page: pageOverride, renderFooter, renderHeader, renderPage, style } = t0;
|
|
74
75
|
const editor = useEditor();
|
|
75
76
|
const editableRef = useEditableRef();
|
|
76
77
|
const alreadyNested = useContext(PaginationContentNestingContext);
|
|
77
78
|
let t1;
|
|
78
|
-
if ($[0] !== alreadyNested || $[1] !== editor) {
|
|
79
|
-
|
|
79
|
+
if ($[0] !== alreadyNested || $[1] !== editor || $[2] !== matchRoot) {
|
|
80
|
+
const currentRoot = editor.read(_temp) ?? "main";
|
|
81
|
+
t1 = !alreadyNested && (matchRoot ? matchRoot(currentRoot) : currentRoot === "main");
|
|
80
82
|
$[0] = alreadyNested;
|
|
81
83
|
$[1] = editor;
|
|
82
|
-
$[2] =
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
$[2] = matchRoot;
|
|
85
|
+
$[3] = t1;
|
|
86
|
+
} else t1 = $[3];
|
|
87
|
+
const isPaginatedRoot = t1;
|
|
85
88
|
let t2;
|
|
86
|
-
if ($[
|
|
89
|
+
if ($[4] !== editor) {
|
|
87
90
|
t2 = getViewPresentation(editor);
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
} else t2 = $[
|
|
91
|
+
$[4] = editor;
|
|
92
|
+
$[5] = t2;
|
|
93
|
+
} else t2 = $[5];
|
|
91
94
|
const presentation = t2;
|
|
92
95
|
const defaultEnabled = usePluginStore(PaginationPlugin, _temp2);
|
|
93
96
|
const defaultPage = usePluginStore(PaginationPlugin, _temp3);
|
|
@@ -97,40 +100,40 @@ function PaginationContent(t0) {
|
|
|
97
100
|
const persistedPage = useStateFieldValue(paginationPageField);
|
|
98
101
|
let t3;
|
|
99
102
|
let t4;
|
|
100
|
-
if ($[
|
|
103
|
+
if ($[6] !== editableRef || $[7] !== isPaginatedRoot || $[8] !== presentation) {
|
|
101
104
|
t3 = () => {
|
|
102
|
-
if (!
|
|
105
|
+
if (!isPaginatedRoot) return;
|
|
103
106
|
return registerPrimaryEditableRef(presentation, editableRef);
|
|
104
107
|
};
|
|
105
108
|
t4 = [
|
|
106
109
|
editableRef,
|
|
107
|
-
|
|
110
|
+
isPaginatedRoot,
|
|
108
111
|
presentation
|
|
109
112
|
];
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
113
|
+
$[6] = editableRef;
|
|
114
|
+
$[7] = isPaginatedRoot;
|
|
115
|
+
$[8] = presentation;
|
|
116
|
+
$[9] = t3;
|
|
117
|
+
$[10] = t4;
|
|
115
118
|
} else {
|
|
116
|
-
t3 = $[
|
|
117
|
-
t4 = $[
|
|
119
|
+
t3 = $[9];
|
|
120
|
+
t4 = $[10];
|
|
118
121
|
}
|
|
119
122
|
useLayoutEffect(t3, t4);
|
|
120
|
-
if (!
|
|
123
|
+
if (!isPaginatedRoot) {
|
|
121
124
|
let t5;
|
|
122
|
-
if ($[
|
|
125
|
+
if ($[11] !== children) {
|
|
123
126
|
t5 = /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
} else t5 = $[
|
|
127
|
+
$[11] = children;
|
|
128
|
+
$[12] = t5;
|
|
129
|
+
} else t5 = $[12];
|
|
127
130
|
return t5;
|
|
128
131
|
}
|
|
129
|
-
const enabled = viewEnabled ?? defaultEnabled;
|
|
132
|
+
const enabled = enabledOverride ?? viewEnabled ?? defaultEnabled;
|
|
130
133
|
const pageGap = viewPageGap ?? defaultPageGap;
|
|
131
134
|
const effectivePage = pageOverride ?? persistedPage ?? defaultPage;
|
|
132
135
|
let t5;
|
|
133
|
-
if ($[
|
|
136
|
+
if ($[13] !== children || $[14] !== className || $[15] !== editableRef || $[16] !== effectivePage || $[17] !== enabled || $[18] !== pageGap || $[19] !== renderFooter || $[20] !== renderHeader || $[21] !== renderPage || $[22] !== style) {
|
|
134
137
|
t5 = /* @__PURE__ */ React.createElement(PaginationContentNestingContext, { value: true }, /* @__PURE__ */ React.createElement(PaginationSurface, {
|
|
135
138
|
className,
|
|
136
139
|
editableRef,
|
|
@@ -142,18 +145,18 @@ function PaginationContent(t0) {
|
|
|
142
145
|
renderPage,
|
|
143
146
|
style
|
|
144
147
|
}, children));
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
} else t5 = $[
|
|
148
|
+
$[13] = children;
|
|
149
|
+
$[14] = className;
|
|
150
|
+
$[15] = editableRef;
|
|
151
|
+
$[16] = effectivePage;
|
|
152
|
+
$[17] = enabled;
|
|
153
|
+
$[18] = pageGap;
|
|
154
|
+
$[19] = renderFooter;
|
|
155
|
+
$[20] = renderHeader;
|
|
156
|
+
$[21] = renderPage;
|
|
157
|
+
$[22] = style;
|
|
158
|
+
$[23] = t5;
|
|
159
|
+
} else t5 = $[23];
|
|
157
160
|
return t5;
|
|
158
161
|
}
|
|
159
162
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { gi as Element$1 } from "../../tx-only-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { fs as RootKey, gi as Element$1 } from "../../tx-only-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import "../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { Tt as Plugin, Wt as WrapContentProps } from "../../index-UuSQ_p3c.js";
|
|
4
|
+
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-h2HH9Rw8.js";
|
|
4
5
|
import React$1 from "react";
|
|
5
6
|
/** Props passed to page sheet, header, and footer renderers inside `PaginationSurface`. */
|
|
6
7
|
type PaginationRenderPageProps = Readonly<{
|
|
@@ -28,6 +29,10 @@ type PaginationViewState = {
|
|
|
28
29
|
/** Props for `PaginationContent`, the `slots.wrapContent` wrapper of `PaginationPlugin`. */
|
|
29
30
|
type PaginationContentProps = WrapContentProps & Readonly<{
|
|
30
31
|
className?: string;
|
|
32
|
+
/** Controlled override for paged vs pageless layout on this matched root (keeps `<Editable>` mounted). */
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
/** Select which top-level roots mount `<PaginationSurface>`. Defaults to `root === 'main'`. */
|
|
35
|
+
matchRoot?: (root: RootKey) => boolean;
|
|
31
36
|
page?: PageSettingsSource;
|
|
32
37
|
renderFooter?: (props: PaginationRenderPageProps) => React$1.ReactNode;
|
|
33
38
|
renderHeader?: (props: PaginationRenderPageProps) => React$1.ReactNode;
|
|
@@ -35,11 +40,12 @@ type PaginationContentProps = WrapContentProps & Readonly<{
|
|
|
35
40
|
style?: React$1.CSSProperties;
|
|
36
41
|
}>;
|
|
37
42
|
/**
|
|
38
|
-
* `slots.wrapContent` component for `PaginationPlugin`. Wraps
|
|
39
|
-
* `'main'`
|
|
40
|
-
*
|
|
43
|
+
* `slots.wrapContent` component for `PaginationPlugin`. Wraps matched top-level
|
|
44
|
+
* `<EditorContent />` roots (default `'main'`) in a zero-remount
|
|
45
|
+
* `PaginationSurface` and passes unmatched or nested roots straight through
|
|
46
|
+
* untouched.
|
|
41
47
|
*/
|
|
42
|
-
declare function PaginationContent({ children, className, page: pageOverride, renderFooter, renderHeader, renderPage, style }: PaginationContentProps): React$1.JSX.Element;
|
|
48
|
+
declare function PaginationContent({ children, className, enabled: enabledOverride, matchRoot, page: pageOverride, renderFooter, renderHeader, renderPage, style }: PaginationContentProps): React$1.JSX.Element;
|
|
43
49
|
/**
|
|
44
50
|
* Native-DOM live pagination plugin for standard `<EditorContent />`.
|
|
45
51
|
* Keeps `<Editable>` mounted across Pageless <-> Paged toggles while
|
|
@@ -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-x32UA-pQ-OQbgWQrN.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-DoxvjG5W.js";
|
|
2
|
+
import { Dt as PluginConfiguration, en as InternalReactPluginAdapterResult } from "../../index-UuSQ_p3c.js";
|
|
3
|
+
import { f as AuthoredGroupQuery } from "../../authored-Cux94E76-fEDdP_BS.js";
|
|
4
|
+
import { r as AuthoredPlugin } from "../../index-B048Z6JD.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-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import "../../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { ct as BlockInsertOptions, p as BasePlugin, st as BasePluginInput } from "../../../core-DoxvjG5W.js";
|
|
4
|
+
import { Tt as Plugin, Yt as EditorElementProps } from "../../../index-UuSQ_p3c.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-BRwhNV78.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-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import "../../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { fo as PluginReference, lt as BlockUpsertOptions, p as BasePlugin, uo as PluginDependency } from "../../../core-DoxvjG5W.js";
|
|
4
|
+
import { Tt as Plugin } from "../../../index-UuSQ_p3c.js";
|
|
5
|
+
import { n as CalloutAction } from "../../../index-1JPYTyFo.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-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import "../../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { ct as BlockInsertOptions, fo as PluginReference, lt as BlockUpsertOptions, p as BasePlugin, uo as PluginDependency } from "../../../core-DoxvjG5W.js";
|
|
4
|
+
import { Tt as Plugin } from "../../../index-UuSQ_p3c.js";
|
|
5
|
+
import { a as ColumnTargetOptions, c as ResizeColumnsOptions, l as SetColumnsOptions, o as InsertColumnGroupInput, s as InsertColumnOptions, u as ToggleColumnGroupOptions } from "../../../index-YNMmixU5.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<{
|
|
@@ -2,6 +2,19 @@ import { PathApi, PointApi, RangeApi, TextApi } from "../../../core.js";
|
|
|
2
2
|
//#region src/react/features/combobox/combobox.internal.ts
|
|
3
3
|
const stateless = (pattern) => pattern.global || pattern.sticky ? new RegExp(pattern.source, pattern.flags.replace(/[gy]/g, "")) : pattern;
|
|
4
4
|
const rootOf = (point) => point.root ?? "main";
|
|
5
|
+
const isAdjacentTextBoundary = (read, from, to) => {
|
|
6
|
+
if (rootOf(from) !== rootOf(to) || !PathApi.equals(PathApi.parent(from.path), PathApi.parent(to.path)) || PointApi.isAfter(from, to)) return false;
|
|
7
|
+
const parent = PathApi.parent(from.path);
|
|
8
|
+
const first = from.path.at(-1) ?? 0;
|
|
9
|
+
const last = to.path.at(-1) ?? 0;
|
|
10
|
+
for (let index = first; index <= last; index += 1) {
|
|
11
|
+
const node = read.nodes.get([...parent, index])?.[0];
|
|
12
|
+
if (!TextApi.isText(node)) return false;
|
|
13
|
+
const start = index === first ? from.offset : 0;
|
|
14
|
+
if ((index === last ? to.offset : node.text.length) > start) return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
};
|
|
5
18
|
const readTextBeforeCaret = (read, caret, length) => {
|
|
6
19
|
const parent = PathApi.parent(caret.path);
|
|
7
20
|
const leaves = [];
|
|
@@ -21,10 +34,10 @@ const readTextBeforeCaret = (read, caret, length) => {
|
|
|
21
34
|
}
|
|
22
35
|
leaves.reverse();
|
|
23
36
|
const text = leaves.map((leaf) => leaf.text).join("");
|
|
24
|
-
const pointAt = (offset) => {
|
|
37
|
+
const pointAt = (offset, edge) => {
|
|
25
38
|
let rest = offset;
|
|
26
39
|
for (const leaf of leaves) {
|
|
27
|
-
if (rest <= leaf.text.length) return {
|
|
40
|
+
if (edge === "start" ? rest < leaf.text.length : leaf.text.length > 0 && rest <= leaf.text.length) return {
|
|
28
41
|
...caret,
|
|
29
42
|
offset: leaf.start + rest,
|
|
30
43
|
path: leaf.path
|
|
@@ -71,29 +84,29 @@ const readTriggerAndQuery = (read, start, end, caret, maxTotalLength) => {
|
|
|
71
84
|
trigger: run.slice(0, triggerLen)
|
|
72
85
|
};
|
|
73
86
|
};
|
|
74
|
-
const findLastTrigger = (text, typedFrom, trigger) => {
|
|
75
|
-
if (!trigger) return null;
|
|
76
|
-
const start = text.lastIndexOf(trigger);
|
|
77
|
-
const end = start + trigger.length;
|
|
78
|
-
return start !== -1 && end > typedFrom ? {
|
|
79
|
-
end,
|
|
80
|
-
start
|
|
81
|
-
} : null;
|
|
82
|
-
};
|
|
83
87
|
const findTypedTrigger = (read, { caret, length }, policy) => {
|
|
84
88
|
if (!policy.trigger) return null;
|
|
85
89
|
const run = readTextBeforeCaret(read, caret, length + policy.trigger.length + 1);
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
90
|
+
const typedFrom = Math.max(0, run.text.length - length);
|
|
91
|
+
const previousPattern = policy.triggerPreviousCharPattern ? stateless(policy.triggerPreviousCharPattern) : null;
|
|
92
|
+
let searchFrom = run.text.length;
|
|
93
|
+
while (searchFrom >= 0) {
|
|
94
|
+
const start = run.text.lastIndexOf(policy.trigger, searchFrom);
|
|
95
|
+
if (start === -1) return null;
|
|
96
|
+
const end = start + policy.trigger.length;
|
|
97
|
+
if (end <= typedFrom) return null;
|
|
98
|
+
if (!previousPattern) return {
|
|
99
|
+
anchor: run.pointAt(start, "start"),
|
|
100
|
+
focus: run.pointAt(end, "end")
|
|
101
|
+
};
|
|
102
|
+
const previousChar = start > 0 ? run.text.slice(start - 1, start) : "";
|
|
103
|
+
if (previousPattern.test(previousChar)) return {
|
|
104
|
+
anchor: run.pointAt(start, "start"),
|
|
105
|
+
focus: run.pointAt(end, "end")
|
|
106
|
+
};
|
|
107
|
+
searchFrom = start - 1;
|
|
92
108
|
}
|
|
93
|
-
return
|
|
94
|
-
anchor: start,
|
|
95
|
-
focus: run.pointAt(found.end)
|
|
96
|
-
};
|
|
109
|
+
return null;
|
|
97
110
|
};
|
|
98
111
|
const readComboboxQuery = (read, { caret, typedExtentEnd, trigger, triggerText }, policy) => {
|
|
99
112
|
const [start, end] = RangeApi.edges(trigger);
|
|
@@ -103,4 +116,4 @@ const readComboboxQuery = (read, { caret, typedExtentEnd, trigger, triggerText }
|
|
|
103
116
|
return isComboboxQuery(run.query, policy) ? run.query : null;
|
|
104
117
|
};
|
|
105
118
|
//#endregion
|
|
106
|
-
export { findTypedTrigger, isComboboxQuery, readComboboxQuery };
|
|
119
|
+
export { findTypedTrigger, isAdjacentTextBoundary, isComboboxQuery, readComboboxQuery };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { RangeApi, hasNonWritableAt, subscribeEditorViewState } from "../../../facade.js";
|
|
2
|
+
import { hasInputRuleVetoAt } from "../../../lib/plugins/input-rules/inputRuleVeto.internal.js";
|
|
2
3
|
import { PointApi } from "../../../core.js";
|
|
3
4
|
import { isImeConfirmKeyEvent } from "../../utils/dispatchPlateShortcut.internal.js";
|
|
4
5
|
import { claimEditableKeyDown } from "../../utils/editableKeyDown.internal.js";
|
|
5
|
-
import { findTypedTrigger, isComboboxQuery, readComboboxQuery } from "./combobox.internal.js";
|
|
6
|
+
import { findTypedTrigger, isAdjacentTextBoundary, isComboboxQuery, readComboboxQuery } from "./combobox.internal.js";
|
|
6
7
|
//#region src/react/features/combobox/comboboxOwner.internal.ts
|
|
7
8
|
const POPUP_KEYS = /* @__PURE__ */ new Set([
|
|
8
9
|
"ArrowDown",
|
|
@@ -62,6 +63,9 @@ var ComboboxOwner = class {
|
|
|
62
63
|
if (!trigger || !typedExtent || !selection || !RangeApi.isCollapsed(selection) || !this.isEditable() || hasNonWritableAt(this.view, {
|
|
63
64
|
anchor: RangeApi.start(trigger),
|
|
64
65
|
focus: selection.focus
|
|
66
|
+
}) || hasInputRuleVetoAt(this.view, tx, {
|
|
67
|
+
anchor: RangeApi.start(trigger),
|
|
68
|
+
focus: selection.focus
|
|
65
69
|
}) || readComboboxQuery(tx, {
|
|
66
70
|
caret: selection.focus,
|
|
67
71
|
typedExtentEnd: RangeApi.end(typedExtent),
|
|
@@ -109,6 +113,7 @@ var ComboboxOwner = class {
|
|
|
109
113
|
};
|
|
110
114
|
syncAria() {
|
|
111
115
|
const popup = this.match ? this.occurrence?.popup : void 0;
|
|
116
|
+
if (!popup && this.replaced.size === 0) return;
|
|
112
117
|
const currentLabel = this.element.getAttribute("aria-label");
|
|
113
118
|
const hasAppLabel = this.element.hasAttribute("aria-labelledby") || currentLabel !== null && !(this.replaced.has("aria-label") && currentLabel === this.written.get("aria-label"));
|
|
114
119
|
const next = popup ? {
|
|
@@ -165,7 +170,10 @@ var ComboboxOwner = class {
|
|
|
165
170
|
for (const popup of this.popups) {
|
|
166
171
|
const { policy } = popup;
|
|
167
172
|
const trigger = findTypedTrigger(this.view.read, insertion, policy);
|
|
168
|
-
if (trigger && (!latest || PointApi.isAfter(RangeApi.start(trigger), RangeApi.start(latest.trigger))) && (
|
|
173
|
+
if (trigger && (!latest || PointApi.isAfter(RangeApi.start(trigger), RangeApi.start(latest.trigger))) && !hasInputRuleVetoAt(this.view, this.view.read, {
|
|
174
|
+
anchor: RangeApi.start(trigger),
|
|
175
|
+
focus: insertion.caret
|
|
176
|
+
}) && (!policy.triggerQuery || policy.triggerQuery(this.view))) latest = {
|
|
169
177
|
popup,
|
|
170
178
|
trigger
|
|
171
179
|
};
|
|
@@ -187,6 +195,22 @@ var ComboboxOwner = class {
|
|
|
187
195
|
triggerText: this.view.read.text.string(trigger)
|
|
188
196
|
};
|
|
189
197
|
this.match = null;
|
|
198
|
+
} else if (this.occurrence) {
|
|
199
|
+
const { occurrence } = this;
|
|
200
|
+
const trigger = occurrence.trigger.resolve(this.view);
|
|
201
|
+
const typedExtent = occurrence.typedExtent.resolve(this.view);
|
|
202
|
+
const insertStart = RangeApi.start(range);
|
|
203
|
+
const insertEnd = RangeApi.end(range);
|
|
204
|
+
if (trigger && typedExtent && PointApi.isAfter(insertEnd, RangeApi.end(typedExtent)) && isAdjacentTextBoundary(this.view.read, RangeApi.end(typedExtent), insertStart)) {
|
|
205
|
+
occurrence.typedExtent.release();
|
|
206
|
+
occurrence.typedExtent = this.view.anchor({
|
|
207
|
+
anchor: RangeApi.start(trigger),
|
|
208
|
+
focus: insertEnd
|
|
209
|
+
}, {
|
|
210
|
+
association: "outward",
|
|
211
|
+
deletion: "nearest"
|
|
212
|
+
});
|
|
213
|
+
}
|
|
190
214
|
}
|
|
191
215
|
}
|
|
192
216
|
}
|
|
@@ -211,6 +235,9 @@ var ComboboxOwner = class {
|
|
|
211
235
|
if (!occurrence || !trigger || !typedExtent || !policy || !selection || !RangeApi.isCollapsed(selection) || !this.isEditable() || this.isAnotherEditorFocused() || hasNonWritableAt(this.view, {
|
|
212
236
|
anchor: RangeApi.start(trigger),
|
|
213
237
|
focus: selection.focus
|
|
238
|
+
}) || hasInputRuleVetoAt(this.view, this.view.read, {
|
|
239
|
+
anchor: RangeApi.start(trigger),
|
|
240
|
+
focus: selection.focus
|
|
214
241
|
})) return null;
|
|
215
242
|
const composing = this.view.api.react.isComposing();
|
|
216
243
|
const query = readComboboxQuery(this.view.read, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $o as Range } from "../../../tx-only-
|
|
2
|
-
import "../../../htmlTypes-
|
|
3
|
-
import { Ct as PluginTransaction } from "../../../core-
|
|
4
|
-
import { ot as Editor } from "../../../index-
|
|
1
|
+
import { $o as Range } from "../../../tx-only-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import "../../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { Ct as PluginTransaction } from "../../../core-DoxvjG5W.js";
|
|
4
|
+
import { ot as Editor } from "../../../index-UuSQ_p3c.js";
|
|
5
5
|
import React$1 from "react";
|
|
6
6
|
/** The open query an autocomplete popup offers options for. */
|
|
7
7
|
type ComboboxMatch = Readonly<{
|
|
@@ -57,8 +57,10 @@ type UseComboboxOptions = {
|
|
|
57
57
|
*/
|
|
58
58
|
triggerPreviousCharPattern?: RegExp | null;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
60
|
+
* Optional app predicate; return `false` to keep a typed trigger as plain
|
|
61
|
+
* text in custom contexts. Literal-text elements and marks contributing to
|
|
62
|
+
* `inputRuleVeto` (such as code blocks and inline code) are always skipped.
|
|
63
|
+
* Defaults to `null`.
|
|
62
64
|
*/
|
|
63
65
|
triggerQuery?: ((editor: Editor) => boolean) | null;
|
|
64
66
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $o as Range, Bi as Location, Po as Point, Wl as Value, Yi as NamedRootKey, ma as NodeKey } from "../../../tx-only-
|
|
2
|
-
import "../../../htmlTypes-
|
|
3
|
-
import "../../../core-
|
|
4
|
-
import { Tt as Plugin } from "../../../index-
|
|
5
|
-
import { i as CommentAnchors } from "../../../comment-anchor.internal-
|
|
6
|
-
import { A as PendingComment, C as CommentsChange, N as CommentAttachmentChange, O as CreateCommentThreadInput, S as CommentThread, b as CommentResolution, d as CommentMessage, f as CommentMutationDecision, h as CommentMutationResult, i as CommentAttachment, l as CommentDataValue, m as CommentMutationRequest, p as CommentMutationOptions, s as CommentData, v as CommentRemoteUpdate, w as CommentsLoadIssue, x as CommentTarget } from "../../../index-
|
|
1
|
+
import { $o as Range, Bi as Location, Po as Point, Wl as Value, Yi as NamedRootKey, ma as NodeKey } from "../../../tx-only-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import "../../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import "../../../core-DoxvjG5W.js";
|
|
4
|
+
import { Tt as Plugin } from "../../../index-UuSQ_p3c.js";
|
|
5
|
+
import { i as CommentAnchors } from "../../../comment-anchor.internal-Ck30WbG4.js";
|
|
6
|
+
import { A as PendingComment, C as CommentsChange, N as CommentAttachmentChange, O as CreateCommentThreadInput, S as CommentThread, b as CommentResolution, d as CommentMessage, f as CommentMutationDecision, h as CommentMutationResult, i as CommentAttachment, l as CommentDataValue, m as CommentMutationRequest, p as CommentMutationOptions, s as CommentData, v as CommentRemoteUpdate, w as CommentsLoadIssue, x as CommentTarget } from "../../../index-DsKfZoY4.js";
|
|
7
7
|
/** Comment data and mapped anchors with interaction for the exact mounted view. */
|
|
8
8
|
declare const CommentsPlugin: Plugin<Readonly<{
|
|
9
9
|
readonly initialState: {
|
|
@@ -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-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import "../../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { vt as NodeInsertOptions } from "../../../core-DoxvjG5W.js";
|
|
4
|
+
import { Tt as Plugin } from "../../../index-UuSQ_p3c.js";
|
|
5
5
|
declare const DatePlugin: Plugin<Readonly<{
|
|
6
6
|
readonly __pluginWritableProperties: Readonly<{
|
|
7
7
|
descriptor: PropertyStringDescriptor<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Bi as Location, Da as NodeSelection, Es as SchemaContentRule, Mt as EditorJsonValue, Vl as TxDeclaredMethod, Vo as PropertyJsonDescriptor, gs as SchemaContentDefault, ma as NodeKey, ys as SchemaContentPrefixSlot } from "../../../tx-only-
|
|
2
|
-
import "../../../htmlTypes-
|
|
3
|
-
import { Sa as HeadingLevel, ct as BlockInsertOptions, 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, Vl as TxDeclaredMethod, Vo as PropertyJsonDescriptor, gs as SchemaContentDefault, ma as NodeKey, ys as SchemaContentPrefixSlot } from "../../../tx-only-x32UA-pQ-OQbgWQrN.js";
|
|
2
|
+
import "../../../htmlTypes-9HQ8p7c5.js";
|
|
3
|
+
import { Sa as HeadingLevel, ct as BlockInsertOptions, fo as PluginReference, lt as BlockUpsertOptions, p as BasePlugin, uo as PluginDependency } from "../../../core-DoxvjG5W.js";
|
|
4
|
+
import { Tt as Plugin } from "../../../index-UuSQ_p3c.js";
|
|
5
5
|
declare const DetailsSummaryPlugin: Plugin<Readonly<{
|
|
6
6
|
formats: true;
|
|
7
7
|
}> & Readonly<{
|
|
@@ -3,7 +3,7 @@ import { useEditorSelector } from "../../stores/plate/useEditorSelector.js";
|
|
|
3
3
|
import { useEditor } from "../../stores/plate/useEditor.js";
|
|
4
4
|
import { usePluginStore } from "../../stores/plate/usePluginStore.js";
|
|
5
5
|
import { toReactPlugin } from "../../plugin/toReactPlugin.js";
|
|
6
|
-
import { isFieldLockInstalled,
|
|
6
|
+
import { isFieldLockInstalled, readFieldWithAccess } from "../../../features/field/lib/fieldCache.internal.js";
|
|
7
7
|
import { BaseFieldPlugin } from "../../../features/field/lib/BaseFieldPlugin.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
9
9
|
//#region src/react/features/field/FieldPlugin.tsx
|
|
@@ -29,7 +29,7 @@ const useFieldRead = (fieldId) => {
|
|
|
29
29
|
const watchAuthored = hasAuthoredRuntime(editor) && (fillRole !== null || isFieldLockInstalled(editor));
|
|
30
30
|
let t0;
|
|
31
31
|
if ($[0] !== fieldId) {
|
|
32
|
-
t0 = (current) =>
|
|
32
|
+
t0 = (current) => readFieldWithAccess(current, fieldId);
|
|
33
33
|
$[0] = fieldId;
|
|
34
34
|
$[1] = t0;
|
|
35
35
|
} else t0 = $[1];
|