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.
Files changed (226) hide show
  1. package/dist/{EditorStatic-CKG5xM3y.d.ts → EditorStatic-ldAMJg-F.d.ts} +4 -4
  2. package/dist/ai/index.d.ts +2 -2
  3. package/dist/ai/lib/aiDraftSession.js +9 -7
  4. package/dist/ai/lib/aiPolicy.internal.js +43 -6
  5. package/dist/ai/lib/editorAgent.js +30 -21
  6. package/dist/ai/lib/editorAgentSync.internal.js +2 -2
  7. package/dist/ai/lib/lockedContext.js +5 -4
  8. package/dist/ai/react/copilotInline.internal.js +6 -5
  9. package/dist/ai/react/index.d.ts +7 -7
  10. package/dist/ai/react/useEditorAgent.js +14 -3
  11. package/dist/authored/index.d.ts +4 -4
  12. package/dist/{authored-CJL7S8qI-BxC9ip4d.d.ts → authored-Cux94E76-fEDdP_BS.d.ts} +3 -3
  13. package/dist/clipboard-format-key-B_rCped5-BJzbgrSZ.d.ts +1 -0
  14. package/dist/code-block/codemirror/index.d.ts +2 -2
  15. package/dist/{comment-anchor.internal-DTBP1huU.d.ts → comment-anchor.internal-Ck30WbG4.d.ts} +2 -2
  16. package/dist/compiler/index.d.ts +3 -3
  17. package/dist/{core-CTB0OBoh.d.ts → core-DoxvjG5W.d.ts} +69 -23
  18. package/dist/diff/index.d.ts +2 -2
  19. package/dist/docs/agents/skills.md +6 -2
  20. package/dist/docs/agents.md +1 -1
  21. package/dist/docs/ai-agents.md +8 -4
  22. package/dist/docs/ai.md +5 -0
  23. package/dist/docs/api/plate.md +15 -7
  24. package/dist/docs/api/react-hooks.md +32 -2
  25. package/dist/docs/authored-changes.md +4 -0
  26. package/dist/docs/block-menu.md +4 -0
  27. package/dist/docs/board.md +4 -0
  28. package/dist/docs/callout.md +63 -9
  29. package/dist/docs/collaboration.md +6 -1
  30. package/dist/docs/combobox.md +9 -2
  31. package/dist/docs/comment.md +8 -4
  32. package/dist/docs/components/toolbar-buttons.md +1 -1
  33. package/dist/docs/copilot.md +4 -0
  34. package/dist/docs/deck.md +173 -0
  35. package/dist/docs/details.md +4 -0
  36. package/dist/docs/diff.md +4 -0
  37. package/dist/docs/discussion.md +4 -0
  38. package/dist/docs/dnd.md +4 -0
  39. package/dist/docs/docx.md +6 -0
  40. package/dist/docs/emoji.md +2 -2
  41. package/dist/docs/equation.md +4 -0
  42. package/dist/docs/examples/collaboration-example.md +4 -0
  43. package/dist/docs/examples/export.md +41 -31
  44. package/dist/docs/examples/merge.md +4 -0
  45. package/dist/docs/examples/version-history.md +4 -0
  46. package/dist/docs/field.md +4 -0
  47. package/dist/docs/footnote.md +4 -0
  48. package/dist/docs/format-painter.md +1 -1
  49. package/dist/docs/html.md +4 -0
  50. package/dist/docs/index.md +4 -0
  51. package/dist/docs/ink.md +6 -0
  52. package/dist/docs/installation/manual.md +2 -4
  53. package/dist/docs/installation/next.md +1 -3
  54. package/dist/docs/installation/plate-ui.md +6 -2
  55. package/dist/docs/installation/rsc.md +1 -1
  56. package/dist/docs/installation.md +4 -0
  57. package/dist/docs/link.md +6 -0
  58. package/dist/docs/lint.md +18 -0
  59. package/dist/docs/llms.txt +4 -1
  60. package/dist/docs/lock.md +34 -2
  61. package/dist/docs/markdown.md +8 -0
  62. package/dist/docs/media.md +4 -0
  63. package/dist/docs/mention.md +5 -0
  64. package/dist/docs/mobile.md +415 -0
  65. package/dist/docs/pagination.md +4 -0
  66. package/dist/docs/prompt-editor.md +17 -1
  67. package/dist/docs/reference.md +192 -0
  68. package/dist/docs/roots.md +34 -0
  69. package/dist/docs/serializing.md +23 -0
  70. package/dist/docs/slash-command.md +58 -4
  71. package/dist/docs/static.md +29 -20
  72. package/dist/docs/suggestion.md +4 -0
  73. package/dist/docs/sync.md +4 -0
  74. package/dist/docs/table.md +31 -0
  75. package/dist/docs/toc.md +14 -0
  76. package/dist/docs/toolbar.md +4 -0
  77. package/dist/docs/unit-testing.md +4 -0
  78. package/dist/docs/upload.md +4 -0
  79. package/dist/docx/export/index.d.ts +5 -5
  80. package/dist/docx/import/index.d.ts +5 -5
  81. package/dist/docx/paste/index.d.ts +4 -4
  82. package/dist/dom/index.d.ts +1 -1
  83. package/dist/features/basic-nodes/lib/BaseMarkPlugins.js +1 -1
  84. package/dist/features/basic-styles/lib/BaseFormattingPlugin.js +61 -28
  85. package/dist/features/basic-styles/lib/BaseStylePlugins.js +28 -7
  86. package/dist/features/board/index.d.ts +1 -1
  87. package/dist/features/callout/index.d.ts +2 -160
  88. package/dist/features/callout/lib/BaseCalloutPlugin.js +109 -9
  89. package/dist/features/column/index.d.ts +1 -1
  90. package/dist/features/comments/index.d.ts +2 -2
  91. package/dist/features/date/index.d.ts +3 -3
  92. package/dist/features/details/index.d.ts +3 -3
  93. package/dist/features/field/index.d.ts +1 -1
  94. package/dist/features/field/lib/BaseFieldPlugin.js +111 -53
  95. package/dist/features/field/lib/fieldCache.internal.js +9 -21
  96. package/dist/features/find/index.d.ts +3 -3
  97. package/dist/features/footnote/index.d.ts +3 -3
  98. package/dist/features/ink/index.d.ts +1 -1
  99. package/dist/features/link/lib/BaseLinkPlugin.js +5 -2
  100. package/dist/features/lint/index.d.ts +3 -3
  101. package/dist/features/list/lib/listKeyboard.internal.js +7 -2
  102. package/dist/features/lock/index.d.ts +1 -1
  103. package/dist/features/media/index.d.ts +1 -1
  104. package/dist/features/mention/index.d.ts +1 -1
  105. package/dist/features/reference/index.d.ts +240 -0
  106. package/dist/features/reference/index.js +2 -0
  107. package/dist/features/reference/lib/BaseReferencePlugin.js +598 -0
  108. package/dist/features/table/index.d.ts +2 -2
  109. package/dist/features/toc/index.d.ts +1 -1
  110. package/dist/features/upload/index.d.ts +1 -1
  111. package/dist/history/index.d.ts +1 -1
  112. package/dist/html/index.d.ts +4 -4
  113. package/dist/html/server/index.d.ts +2 -2
  114. package/dist/html/server/serverCssParser.internal.js +14 -25
  115. package/dist/html/server/serverCssStyle.internal.js +4 -7
  116. package/dist/{htmlConversion-Y-M6PLRi.d.ts → htmlConversion-CHcWrkh5.d.ts} +2 -2
  117. package/dist/{htmlTypes-CNhoCFjK.d.ts → htmlTypes-9HQ8p7c5.d.ts} +3 -3
  118. package/dist/hyperscript/index.d.ts +1 -1
  119. package/dist/index-1JPYTyFo.d.ts +305 -0
  120. package/dist/index-B-SGl9uM.d.ts +1 -0
  121. package/dist/{index-qqrnWAk_.d.ts → index-B048Z6JD.d.ts} +7 -7
  122. package/dist/index-BFkl1TNK.d.ts +1 -0
  123. package/dist/{index-DYuqsDrP.d.ts → index-BRwhNV78.d.ts} +3 -3
  124. package/dist/{index-B0R9sXv2-T1dxG9oM.d.ts → index-BYv6zIL_-DWmaXzbX.d.ts} +4 -4
  125. package/dist/{index-B-8L9f6a2.d.ts → index-Bm8V8SS4.d.ts} +5 -5
  126. package/dist/{index-B8JeECEk.d.ts → index-BujEk356.d.ts} +2 -2
  127. package/dist/{index-CHud6Aa-.d.ts → index-C4KIDKwP.d.ts} +3 -3
  128. package/dist/{index-B4aToRMv.d.ts → index-CAFKQNqu.d.ts} +3 -3
  129. package/dist/{index-Bqva6PJc.d.ts → index-CXJwwbAJ.d.ts} +3 -3
  130. package/dist/index-CfqQvdcO.d.ts +3 -0
  131. package/dist/{index-D54VPeky.d.ts → index-Cj09P2Qp.d.ts} +2 -2
  132. package/dist/{index-mcBtG6pK-CitQV9Bq.d.ts → index-CnumypT3-DGx8_6Ye.d.ts} +2 -2
  133. package/dist/{index-CWutqVQ_-BO-UgVeK.d.ts → index-DTTSk3WQ-D0TA0B5z.d.ts} +1 -1
  134. package/dist/{index-CLPMcGC5.d.ts → index-DsKfZoY4.d.ts} +4 -4
  135. package/dist/{index-UYpvOBXG.d.ts → index-UrJ6V3_e.d.ts} +2 -2
  136. package/dist/{index-DXCdafUk.d.ts → index-UuSQ_p3c.d.ts} +43 -20
  137. package/dist/{index-BEXBAmJf.d.ts → index-YNMmixU5.d.ts} +3 -3
  138. package/dist/{index-CXd5hwaH.d.ts → index-Zj4bj9bZ.d.ts} +1 -1
  139. package/dist/{index-BfJKfAwk.d.ts → index-eWzk-bcU.d.ts} +3 -3
  140. package/dist/{index-DhsryaAC.d.ts → index-h2HH9Rw8.d.ts} +1 -1
  141. package/dist/{index-DJhwDkfd.d.ts → index-l9R_LyGx.d.ts} +3 -3
  142. package/dist/{index-BFWK852j.d.ts → index-lD9iIU3j.d.ts} +3 -3
  143. package/dist/{index-D3bhjdRz.d.ts → index-lgeYbG68.d.ts} +3 -3
  144. package/dist/index.d.ts +3 -3
  145. package/dist/internal/plugin/compilePlateModel.js +24 -5
  146. package/dist/internal/plugin/pluginInjectNodeProps.js +33 -5
  147. package/dist/internal/utils/urlPolicy.js +11 -1
  148. package/dist/lib/editor/withPlite.js +8 -6
  149. package/dist/lib/plugins/html/cssLexer.internal.js +144 -37
  150. package/dist/lib/plugins/html/cssSafety.internal.js +100 -0
  151. package/dist/lib/plugins/html/htmlDecode.internal.js +2 -2
  152. package/dist/lib/plugins/html/htmlMatcher.internal.js +1 -1
  153. package/dist/lib/plugins/html/htmlRules.internal.js +2 -13
  154. package/dist/lib/plugins/html/htmlSafety.js +28 -27
  155. package/dist/lib/plugins/html/htmlSerialize.internal.js +16 -2
  156. package/dist/lib/plugins/html/htmlStyleInline.internal.js +38 -31
  157. package/dist/lib/plugins/input-rules/inputRuleVeto.internal.js +27 -1
  158. package/dist/markdown/index.d.ts +1 -1
  159. package/dist/markdown/lib/internal/markdownAttributes.js +16 -7
  160. package/dist/markdown/lib/internal/markdownMappings.js +123 -16
  161. package/dist/markdown/lib/serializer/convertPhrasingSerialize.js +16 -1
  162. package/dist/math/index.d.ts +3 -3
  163. package/dist/math/react/index.d.ts +4 -4
  164. package/dist/migrations/index.d.ts +4 -4
  165. package/dist/migrations/migratePlateV54Urls.internal.js +63 -1
  166. package/dist/pagination/index.d.ts +1 -1
  167. package/dist/pagination/react/PaginationPlugin.js +46 -43
  168. package/dist/pagination/react/index.d.ts +13 -7
  169. package/dist/{protocol-CSuP7AWG-DAorqpaF.d.ts → protocol-CYflJUT3-CRJPCqOO.d.ts} +1 -1
  170. package/dist/react/authored/index.d.ts +4 -4
  171. package/dist/react/components/PlateView.js +7 -1
  172. package/dist/react/features/board/index.d.ts +5 -5
  173. package/dist/react/features/callout/index.d.ts +93 -4
  174. package/dist/react/features/column/index.d.ts +5 -5
  175. package/dist/react/features/combobox/combobox.internal.js +35 -22
  176. package/dist/react/features/combobox/comboboxOwner.internal.js +29 -2
  177. package/dist/react/features/combobox/index.d.ts +8 -6
  178. package/dist/react/features/comments/index.d.ts +6 -6
  179. package/dist/react/features/date/index.d.ts +4 -4
  180. package/dist/react/features/details/index.d.ts +4 -4
  181. package/dist/react/features/field/FieldPlugin.js +2 -2
  182. package/dist/react/features/field/index.d.ts +5 -5
  183. package/dist/react/features/footnote/index.d.ts +4 -4
  184. package/dist/react/features/format-painter/FormatPainterPlugin.js +27 -34
  185. package/dist/react/features/format-painter/index.d.ts +4 -4
  186. package/dist/react/features/ink/index.d.ts +5 -5
  187. package/dist/react/features/lock/index.d.ts +5 -5
  188. package/dist/react/features/media/index.d.ts +5 -5
  189. package/dist/react/features/mention/index.d.ts +4 -4
  190. package/dist/react/features/table/index.d.ts +6 -6
  191. package/dist/react/features/toc/index.d.ts +2 -2
  192. package/dist/react/features/upload/index.d.ts +5 -5
  193. package/dist/react/index.d.ts +6 -6
  194. package/dist/react/virtualized.d.ts +3 -3
  195. package/dist/refusal-VX2Y6Wmd-BJzbgrSZ.d.ts +1 -0
  196. package/dist/{registerEditorTools-Cl-o_Wnq.d.ts → registerEditorTools-DoRs57-M.d.ts} +16 -8
  197. package/dist/shared-room-BZxUmqjV-BJzbgrSZ.d.ts +1 -0
  198. package/dist/skills/plate/SKILL.md +4 -3
  199. package/dist/skills/plate/references/ai-and-agents.md +2 -2
  200. package/dist/skills/plate/references/pricing.md +3 -3
  201. package/dist/skills/plate/references/setup.md +6 -0
  202. package/dist/skills/plate/references/ui-and-sync.md +4 -3
  203. package/dist/{source-DUP5aKcT.d.ts → source-PTxjcq4_.d.ts} +3 -3
  204. package/dist/static/index.d.ts +23 -9
  205. package/dist/static/internal/staticPendingMedia.internal.js +2 -1
  206. package/dist/static/internal/staticPresentation.js +1 -0
  207. package/dist/static/renderStaticHtml.js +85 -39
  208. package/dist/{storage-EzfLDqRy-Cu4DQ-Rf.d.ts → storage-CkRL-SHq-CBP6PGqr.d.ts} +2 -2
  209. package/dist/sync/cloudflare/index.d.ts +3 -3
  210. package/dist/sync/index.d.ts +4 -4
  211. package/dist/sync/postgres/index.d.ts +1 -1
  212. package/dist/sync/react/index.d.ts +6 -6
  213. package/dist/sync/server/index.d.ts +5 -5
  214. package/dist/tabbable/react/index.d.ts +4 -4
  215. package/dist/testing/index.d.ts +3 -3
  216. package/dist/{transport-DAforzBt-BFwAhC-N.d.ts → transport-2koNcrqA-Dp_RYE3n.d.ts} +1 -1
  217. package/dist/utils/plate-keys.js +1 -0
  218. package/dist/{widths-BjIZxtaJ.d.ts → widths-DN1W6m66.d.ts} +5 -5
  219. package/package.json +9 -2
  220. package/dist/clipboard-format-key-D9rnh20X-CR00YA0H.d.ts +0 -1
  221. package/dist/index-CKAkaSJK.d.ts +0 -3
  222. package/dist/index-CxyK4HrT.d.ts +0 -1
  223. package/dist/index-zcb_RtZC.d.ts +0 -1
  224. package/dist/refusal-DCzeB9nD-CR00YA0H.d.ts +0 -1
  225. package/dist/shared-room-Bg8qMvm1-CR00YA0H.d.ts +0 -1
  226. /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 the primary
68
- * `'main'` `<EditorContent />` in a zero-remount `PaginationSurface` and passes
69
- * nested roots (`root !== 'main'`) straight through untouched.
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(23);
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
- t1 = !alreadyNested && editor.read(_temp) === void 0;
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] = t1;
83
- } else t1 = $[2];
84
- const isPrimaryRoot = t1;
84
+ $[2] = matchRoot;
85
+ $[3] = t1;
86
+ } else t1 = $[3];
87
+ const isPaginatedRoot = t1;
85
88
  let t2;
86
- if ($[3] !== editor) {
89
+ if ($[4] !== editor) {
87
90
  t2 = getViewPresentation(editor);
88
- $[3] = editor;
89
- $[4] = t2;
90
- } else t2 = $[4];
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 ($[5] !== editableRef || $[6] !== isPrimaryRoot || $[7] !== presentation) {
103
+ if ($[6] !== editableRef || $[7] !== isPaginatedRoot || $[8] !== presentation) {
101
104
  t3 = () => {
102
- if (!isPrimaryRoot) return;
105
+ if (!isPaginatedRoot) return;
103
106
  return registerPrimaryEditableRef(presentation, editableRef);
104
107
  };
105
108
  t4 = [
106
109
  editableRef,
107
- isPrimaryRoot,
110
+ isPaginatedRoot,
108
111
  presentation
109
112
  ];
110
- $[5] = editableRef;
111
- $[6] = isPrimaryRoot;
112
- $[7] = presentation;
113
- $[8] = t3;
114
- $[9] = t4;
113
+ $[6] = editableRef;
114
+ $[7] = isPaginatedRoot;
115
+ $[8] = presentation;
116
+ $[9] = t3;
117
+ $[10] = t4;
115
118
  } else {
116
- t3 = $[8];
117
- t4 = $[9];
119
+ t3 = $[9];
120
+ t4 = $[10];
118
121
  }
119
122
  useLayoutEffect(t3, t4);
120
- if (!isPrimaryRoot) {
123
+ if (!isPaginatedRoot) {
121
124
  let t5;
122
- if ($[10] !== children) {
125
+ if ($[11] !== children) {
123
126
  t5 = /* @__PURE__ */ React.createElement(React.Fragment, null, children);
124
- $[10] = children;
125
- $[11] = t5;
126
- } else t5 = $[11];
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 ($[12] !== children || $[13] !== className || $[14] !== editableRef || $[15] !== effectivePage || $[16] !== enabled || $[17] !== pageGap || $[18] !== renderFooter || $[19] !== renderHeader || $[20] !== renderPage || $[21] !== style) {
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
- $[12] = children;
146
- $[13] = className;
147
- $[14] = editableRef;
148
- $[15] = effectivePage;
149
- $[16] = enabled;
150
- $[17] = pageGap;
151
- $[18] = renderFooter;
152
- $[19] = renderHeader;
153
- $[20] = renderPage;
154
- $[21] = style;
155
- $[22] = t5;
156
- } else t5 = $[22];
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-CWT-IURY-BqIFhy44.js";
2
- import { Tt as Plugin, Wt as WrapContentProps } from "../../index-DXCdafUk.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-DhsryaAC.js";
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 the primary
39
- * `'main'` `<EditorContent />` in a zero-remount `PaginationSurface` and passes
40
- * nested roots (`root !== 'main'`) straight through untouched.
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-CWT-IURY-BqIFhy44.js";
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-CTB0OBoh.js";
2
- import { Dt as PluginConfiguration, en as InternalReactPluginAdapterResult } from "../../index-DXCdafUk.js";
3
- import { f as AuthoredGroupQuery } from "../../authored-CJL7S8qI-BxC9ip4d.js";
4
- import { r as AuthoredPlugin } from "../../index-qqrnWAk_.js";
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-CWT-IURY-BqIFhy44.js";
2
- import "../../../htmlTypes-CNhoCFjK.js";
3
- import { ct as BlockInsertOptions, p as BasePlugin, st as BasePluginInput } from "../../../core-CTB0OBoh.js";
4
- import { Tt as Plugin, Yt as EditorElementProps } from "../../../index-DXCdafUk.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-DYuqsDrP.js";
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-CWT-IURY-BqIFhy44.js";
2
- import "../../../htmlTypes-CNhoCFjK.js";
3
- import { fo as PluginReference, lt as BlockUpsertOptions, p as BasePlugin, uo as PluginDependency } from "../../../core-CTB0OBoh.js";
4
- import { Tt as Plugin } from "../../../index-DXCdafUk.js";
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-CWT-IURY-BqIFhy44.js";
2
- import "../../../htmlTypes-CNhoCFjK.js";
3
- import { ct as BlockInsertOptions, fo as PluginReference, lt as BlockUpsertOptions, p as BasePlugin, uo as PluginDependency } from "../../../core-CTB0OBoh.js";
4
- import { Tt as Plugin } from "../../../index-DXCdafUk.js";
5
- import { a as ColumnTargetOptions, c as ResizeColumnsOptions, l as SetColumnsOptions, o as InsertColumnGroupInput, s as InsertColumnOptions, u as ToggleColumnGroupOptions } from "../../../index-BEXBAmJf.js";
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 found = findLastTrigger(run.text, Math.max(0, run.text.length - length), policy.trigger);
87
- if (!found) return null;
88
- const start = run.pointAt(found.start);
89
- if (policy.triggerPreviousCharPattern) {
90
- const previousChar = found.start > 0 ? run.text.slice(found.start - 1, found.start) : "";
91
- if (!stateless(policy.triggerPreviousCharPattern).test(previousChar)) return null;
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))) && (!policy.triggerQuery || policy.triggerQuery(this.view))) latest = {
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-CWT-IURY-BqIFhy44.js";
2
- import "../../../htmlTypes-CNhoCFjK.js";
3
- import { Ct as PluginTransaction } from "../../../core-CTB0OBoh.js";
4
- import { ot as Editor } from "../../../index-DXCdafUk.js";
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
- * Return `false` to keep a typed trigger as plain text, for example inside
61
- * a code block. Defaults to `null`.
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-CWT-IURY-BqIFhy44.js";
2
- import "../../../htmlTypes-CNhoCFjK.js";
3
- import "../../../core-CTB0OBoh.js";
4
- import { Tt as Plugin } from "../../../index-DXCdafUk.js";
5
- import { i as CommentAnchors } from "../../../comment-anchor.internal-DTBP1huU.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-CLPMcGC5.js";
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-CWT-IURY-BqIFhy44.js";
2
- import "../../../htmlTypes-CNhoCFjK.js";
3
- import { vt as NodeInsertOptions } from "../../../core-CTB0OBoh.js";
4
- import { Tt as Plugin } from "../../../index-DXCdafUk.js";
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-CWT-IURY-BqIFhy44.js";
2
- import "../../../htmlTypes-CNhoCFjK.js";
3
- import { Sa as HeadingLevel, ct as BlockInsertOptions, fo as PluginReference, lt as BlockUpsertOptions, p as BasePlugin, uo as PluginDependency } from "../../../core-CTB0OBoh.js";
4
- import { Tt as Plugin } from "../../../index-DXCdafUk.js";
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, readWithFieldAccess } from "../../../features/field/lib/fieldCache.internal.js";
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) => readWithFieldAccess(() => current.plugin(BaseFieldPlugin).read.field(fieldId));
32
+ t0 = (current) => readFieldWithAccess(current, fieldId);
33
33
  $[0] = fieldId;
34
34
  $[1] = t0;
35
35
  } else t0 = $[1];