@eigenpal/docx-editor-core 1.0.3 → 1.2.0

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 (266) hide show
  1. package/LICENSE +13 -16
  2. package/dist/agent/index.d.mts +42 -7
  3. package/dist/agent/index.d.ts +42 -7
  4. package/dist/agent/index.js +1 -1
  5. package/dist/agent/index.mjs +1 -1
  6. package/dist/chunk-2EQGBVPV.js +2 -0
  7. package/dist/chunk-2XP6GLA4.mjs +1 -0
  8. package/dist/chunk-44FHVKSI.js +1 -0
  9. package/dist/{chunk-2IE6UDHJ.mjs → chunk-44JKHPGF.mjs} +1 -1
  10. package/dist/{chunk-ABBG4WD2.js → chunk-4QEETB7U.js} +2 -2
  11. package/dist/chunk-53VKL6CG.js +1 -0
  12. package/dist/chunk-5BLQHXWK.mjs +1 -0
  13. package/dist/chunk-5M7TI6TV.js +1 -0
  14. package/dist/chunk-6JKM7TWJ.mjs +1 -0
  15. package/dist/{chunk-EQVNAHL7.mjs → chunk-6Y6LON6Y.mjs} +1 -1
  16. package/dist/{chunk-QVEAQOMR.mjs → chunk-6ZXL3EIP.mjs} +1 -1
  17. package/dist/{chunk-GHQS3I2W.mjs → chunk-7BVHKWEW.mjs} +1 -1
  18. package/dist/chunk-7HANRHHL.js +1 -0
  19. package/dist/chunk-7LRR7RKE.mjs +15 -0
  20. package/dist/chunk-7OW3VCZE.mjs +1 -0
  21. package/dist/chunk-7ZN4WI5N.mjs +4 -0
  22. package/dist/chunk-AMB6Y77B.js +1 -0
  23. package/dist/{chunk-3JXR6YU4.mjs → chunk-BOOHU5EW.mjs} +1 -1
  24. package/dist/{chunk-XBHF5Q2F.js → chunk-BXWOLARZ.js} +1 -1
  25. package/dist/chunk-C45EFOVP.js +1 -0
  26. package/dist/chunk-CCPBNE2F.mjs +2 -0
  27. package/dist/{chunk-XWQB6APW.mjs → chunk-D62KS7QG.mjs} +1 -1
  28. package/dist/chunk-DI6CRWSW.mjs +1 -0
  29. package/dist/chunk-DTTWBKGN.mjs +0 -0
  30. package/dist/chunk-DV6GWBUJ.js +2 -0
  31. package/dist/{chunk-EPX7BBJD.js → chunk-E4JMCA5X.js} +2 -2
  32. package/dist/chunk-EQAORQC3.mjs +1 -0
  33. package/dist/chunk-FO6IX2DB.js +6 -0
  34. package/dist/chunk-FW23IMBF.mjs +1 -0
  35. package/dist/chunk-FYKRDDKG.js +1 -0
  36. package/dist/chunk-GSKMHXHG.js +1 -0
  37. package/dist/chunk-GUQFNJHE.mjs +1 -0
  38. package/dist/{chunk-D536HC5M.js → chunk-HQPWFUP5.js} +1 -1
  39. package/dist/chunk-ICE6NC3S.mjs +1 -0
  40. package/dist/chunk-IFUED5ZS.mjs +1 -0
  41. package/dist/chunk-ISKTBM4L.js +1 -0
  42. package/dist/chunk-IYKBX24M.js +1 -0
  43. package/dist/chunk-KOEWROYV.mjs +6 -0
  44. package/dist/chunk-KRN6YSR2.mjs +1 -0
  45. package/dist/chunk-KZXZWGFX.mjs +1 -0
  46. package/dist/chunk-L24C5TEX.mjs +1 -0
  47. package/dist/chunk-L72YAV5N.js +3 -0
  48. package/dist/chunk-LK6I3HMH.mjs +0 -0
  49. package/dist/{chunk-XBIKSAH6.js → chunk-LTHT4A4S.js} +1 -1
  50. package/dist/chunk-LWH66Q7Q.js +1 -0
  51. package/dist/chunk-MERJFGEP.mjs +59 -0
  52. package/dist/chunk-MJ6XZFVD.mjs +1 -0
  53. package/dist/chunk-MNOHUTKE.js +15 -0
  54. package/dist/chunk-MP4QSEO2.mjs +1 -0
  55. package/dist/{chunk-HL5PQT3A.mjs → chunk-OEXVWIHW.mjs} +1 -1
  56. package/dist/chunk-PVAVS3IU.js +1 -0
  57. package/dist/chunk-QEACB5VG.js +1 -0
  58. package/dist/{chunk-EV6W6KXG.mjs → chunk-QKLY4F2J.mjs} +1 -1
  59. package/dist/chunk-QYF7BRG3.js +2 -0
  60. package/dist/chunk-ROG4MNOR.js +4 -0
  61. package/dist/{chunk-D5E5TA74.js → chunk-RORPREG3.js} +1 -1
  62. package/dist/chunk-SORYYVJ7.js +1 -0
  63. package/dist/chunk-SZIOF5SG.js +59 -0
  64. package/dist/{chunk-SAFW7UQZ.js → chunk-THLJYXFB.js} +1 -1
  65. package/dist/chunk-TUIEV7Q7.js +1 -0
  66. package/dist/{chunk-Z4SJCSTS.js → chunk-U4WUDHDK.js} +1 -1
  67. package/dist/chunk-U4XMGWF7.js +1 -0
  68. package/dist/chunk-U67MWOPZ.mjs +1 -0
  69. package/dist/chunk-VMRUBLPI.js +1 -0
  70. package/dist/chunk-WLDI6N3B.mjs +3 -0
  71. package/dist/chunk-WLHNIXWC.mjs +2 -0
  72. package/dist/chunk-WVERBZZU.js +1 -0
  73. package/dist/chunk-XCKTBNKN.js +1 -0
  74. package/dist/chunk-XPV6VILW.mjs +1 -0
  75. package/dist/chunk-Z5MJYQSD.mjs +1 -0
  76. package/dist/chunk-ZBFNOJGY.js +1 -0
  77. package/dist/chunk-ZX26QZJ5.mjs +1 -0
  78. package/dist/content-CE-ZdMwG.d.mts +1418 -0
  79. package/dist/content-CYXJ2tfQ.d.ts +1418 -0
  80. package/dist/contentControlValues-DAwTWfgR.d.mts +187 -0
  81. package/dist/contentControlValues-gyVPsi6m.d.ts +187 -0
  82. package/dist/core-plugins.d.mts +1 -2
  83. package/dist/core-plugins.d.ts +1 -2
  84. package/dist/core-plugins.js +1 -1
  85. package/dist/core-plugins.mjs +1 -1
  86. package/dist/core.d.mts +6 -7
  87. package/dist/core.d.ts +6 -7
  88. package/dist/core.js +1 -1
  89. package/dist/core.mjs +1 -1
  90. package/dist/{documentSerializer-C1ueey5d.d.mts → documentSerializer-Bghq9rFI.d.mts} +1 -1
  91. package/dist/{documentSerializer-Chn7J1WG.d.ts → documentSerializer-C4lFC60P.d.ts} +1 -1
  92. package/dist/documentStyles-D87dxl18.d.mts +34 -0
  93. package/dist/documentStyles-DToJv9co.d.ts +34 -0
  94. package/dist/docx/index.d.mts +1 -2
  95. package/dist/docx/index.d.ts +1 -2
  96. package/dist/docx/index.js +1 -1
  97. package/dist/docx/index.mjs +1 -1
  98. package/dist/docx/parser.d.mts +1 -2
  99. package/dist/docx/parser.d.ts +1 -2
  100. package/dist/docx/parser.js +1 -1
  101. package/dist/docx/parser.mjs +1 -1
  102. package/dist/docx/rezip.d.mts +1 -2
  103. package/dist/docx/rezip.d.ts +1 -2
  104. package/dist/docx/rezip.js +1 -1
  105. package/dist/docx/rezip.mjs +1 -1
  106. package/dist/docx/serializer/index.d.mts +2 -3
  107. package/dist/docx/serializer/index.d.ts +2 -3
  108. package/dist/docx/serializer/index.js +1 -1
  109. package/dist/docx/serializer/index.mjs +1 -1
  110. package/dist/{fontLoader-QPwbcX5j.d.ts → fontLoader-Cm02v7PO.d.ts} +63 -3
  111. package/dist/{fontLoader-BOt95Jtf.d.mts → fontLoader-Z7pqeNvZ.d.mts} +63 -3
  112. package/dist/{headerFooterLayout-B5LyDpSM.d.ts → headerFooterLayout-Bd58Tum3.d.ts} +74 -2
  113. package/dist/{headerFooterLayout-DVFcJ832.d.mts → headerFooterLayout-CuIJiIzi.d.mts} +74 -2
  114. package/dist/headless.d.mts +7 -6
  115. package/dist/headless.d.ts +7 -6
  116. package/dist/headless.js +1 -1
  117. package/dist/headless.mjs +1 -1
  118. package/dist/layout-bridge/index.d.mts +4 -4
  119. package/dist/layout-bridge/index.d.ts +4 -4
  120. package/dist/layout-bridge/index.js +1 -1
  121. package/dist/layout-bridge/index.mjs +1 -1
  122. package/dist/layout-bridge/measuring/index.d.mts +4 -0
  123. package/dist/layout-bridge/measuring/index.d.ts +4 -0
  124. package/dist/layout-bridge/measuring/index.js +1 -1
  125. package/dist/layout-bridge/measuring/index.mjs +1 -1
  126. package/dist/layout-bridge/tableInsertHover.js +1 -1
  127. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  128. package/dist/layout-bridge/toFlowBlocks.d.mts +2 -1
  129. package/dist/layout-bridge/toFlowBlocks.d.ts +2 -1
  130. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  131. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  132. package/dist/layout-engine/index.d.mts +4 -1
  133. package/dist/layout-engine/index.d.ts +4 -1
  134. package/dist/layout-engine/index.js +1 -1
  135. package/dist/layout-engine/index.mjs +1 -1
  136. package/dist/layout-engine/types.d.mts +74 -1
  137. package/dist/layout-engine/types.d.ts +74 -1
  138. package/dist/layout-painter/index.d.mts +4 -4
  139. package/dist/layout-painter/index.d.ts +4 -4
  140. package/dist/layout-painter/index.js +1 -1
  141. package/dist/layout-painter/index.mjs +1 -1
  142. package/dist/layout-painter/renderPage.d.mts +27 -4
  143. package/dist/layout-painter/renderPage.d.ts +27 -4
  144. package/dist/layout-painter/renderPage.js +1 -1
  145. package/dist/layout-painter/renderPage.mjs +1 -1
  146. package/dist/managers/AutoSaveManager.d.mts +1 -2
  147. package/dist/managers/AutoSaveManager.d.ts +1 -2
  148. package/dist/managers/TableSelectionManager.d.mts +1 -2
  149. package/dist/managers/TableSelectionManager.d.ts +1 -2
  150. package/dist/managers/types.d.mts +1 -2
  151. package/dist/managers/types.d.ts +1 -2
  152. package/dist/mcp-cli.mjs +23 -22
  153. package/dist/mcp.d.mts +1 -2
  154. package/dist/mcp.d.ts +1 -2
  155. package/dist/mcp.js +3 -3
  156. package/dist/mcp.mjs +1 -1
  157. package/dist/{nodes-D7PTUJ2N.d.ts → nodes-BNkRKBBX.d.ts} +64 -3
  158. package/dist/{nodes-CL8M0L-a.d.mts → nodes-Bz-UHhLE.d.mts} +64 -3
  159. package/dist/prosemirror/commands/formatting.js +1 -1
  160. package/dist/prosemirror/commands/formatting.mjs +1 -1
  161. package/dist/prosemirror/commands/index.d.mts +80 -6
  162. package/dist/prosemirror/commands/index.d.ts +80 -6
  163. package/dist/prosemirror/commands/index.js +1 -1
  164. package/dist/prosemirror/commands/index.mjs +1 -1
  165. package/dist/prosemirror/commands/paragraph.js +1 -1
  166. package/dist/prosemirror/commands/paragraph.mjs +1 -1
  167. package/dist/prosemirror/conversion/fromProseDoc.d.mts +2 -3
  168. package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -3
  169. package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
  170. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
  171. package/dist/prosemirror/conversion/index.d.mts +3 -4
  172. package/dist/prosemirror/conversion/index.d.ts +3 -4
  173. package/dist/prosemirror/conversion/index.js +1 -1
  174. package/dist/prosemirror/conversion/index.mjs +1 -1
  175. package/dist/prosemirror/editor.css +302 -95
  176. package/dist/prosemirror/extensions/index.js +1 -1
  177. package/dist/prosemirror/extensions/index.mjs +1 -1
  178. package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -1
  179. package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -1
  180. package/dist/prosemirror/index.d.mts +94 -7
  181. package/dist/prosemirror/index.d.ts +94 -7
  182. package/dist/prosemirror/index.js +3 -1
  183. package/dist/prosemirror/index.mjs +3 -1
  184. package/dist/prosemirror/plugins/index.d.mts +124 -17
  185. package/dist/prosemirror/plugins/index.d.ts +124 -17
  186. package/dist/prosemirror/plugins/index.js +1 -1
  187. package/dist/prosemirror/plugins/index.mjs +1 -1
  188. package/dist/prosemirror/schema/index.d.mts +3 -4
  189. package/dist/prosemirror/schema/index.d.ts +3 -4
  190. package/dist/prosemirror/schema/index.js +1 -1
  191. package/dist/prosemirror/schema/index.mjs +1 -1
  192. package/dist/prosemirror/styles/index.d.mts +9 -0
  193. package/dist/prosemirror/styles/index.d.ts +9 -0
  194. package/dist/prosemirror/styles/index.js +1 -1
  195. package/dist/prosemirror/styles/index.mjs +1 -1
  196. package/dist/prosemirror/utils/extractTrackedChanges.d.mts +44 -22
  197. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +44 -22
  198. package/dist/prosemirror/utils/extractTrackedChanges.js +1 -1
  199. package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -1
  200. package/dist/types/content.d.mts +4 -1167
  201. package/dist/types/content.d.ts +4 -1167
  202. package/dist/types/document.d.mts +2 -4
  203. package/dist/types/document.d.ts +2 -4
  204. package/dist/utils/comments.d.mts +78 -5
  205. package/dist/utils/comments.d.ts +78 -5
  206. package/dist/utils/comments.js +1 -1
  207. package/dist/utils/comments.mjs +1 -1
  208. package/dist/utils/highlightColors.js +1 -1
  209. package/dist/utils/highlightColors.mjs +1 -1
  210. package/dist/utils/index.d.mts +2 -3
  211. package/dist/utils/index.d.ts +2 -3
  212. package/dist/utils/index.js +3 -3
  213. package/dist/utils/index.mjs +3 -3
  214. package/dist/{variableDetector-CAdt8yOr.d.mts → variableDetector-C7BLz9sJ.d.mts} +1 -1
  215. package/dist/{variableDetector-W4XEN9YC.d.ts → variableDetector-HPZbJ_gw.d.ts} +1 -1
  216. package/package.json +3 -3
  217. package/dist/chunk-3AZWLVLC.js +0 -1
  218. package/dist/chunk-3NLVHZMT.js +0 -59
  219. package/dist/chunk-5SU4HPQS.mjs +0 -1
  220. package/dist/chunk-7PX32GLB.mjs +0 -1
  221. package/dist/chunk-AHXPHBMT.js +0 -1
  222. package/dist/chunk-B6LYBJ4H.mjs +0 -1
  223. package/dist/chunk-BFB4PRS4.mjs +0 -1
  224. package/dist/chunk-BRHHK4MG.mjs +0 -2
  225. package/dist/chunk-CP5OSG5Z.mjs +0 -1
  226. package/dist/chunk-CUXXRGPQ.mjs +0 -1
  227. package/dist/chunk-D4RPOJC7.js +0 -1
  228. package/dist/chunk-FWTP7BN7.mjs +0 -4
  229. package/dist/chunk-G7AKYAKU.mjs +0 -1
  230. package/dist/chunk-HAAMO2Z2.mjs +0 -1
  231. package/dist/chunk-ILJUDEZ5.mjs +0 -1
  232. package/dist/chunk-IN6IYQ2X.js +0 -1
  233. package/dist/chunk-IO6HZ7KR.js +0 -2
  234. package/dist/chunk-IP2VXNWG.js +0 -1
  235. package/dist/chunk-KBU6QQFU.js +0 -9
  236. package/dist/chunk-LBKMYD3M.mjs +0 -1
  237. package/dist/chunk-LDKESXXK.mjs +0 -3
  238. package/dist/chunk-MZOVDLYL.js +0 -1
  239. package/dist/chunk-N3EIZN65.js +0 -1
  240. package/dist/chunk-NBLJPT54.mjs +0 -1
  241. package/dist/chunk-NERY274X.js +0 -1
  242. package/dist/chunk-NNQWQOC5.mjs +0 -1
  243. package/dist/chunk-NO5LW2DQ.mjs +0 -1
  244. package/dist/chunk-OCAX2KJQ.js +0 -4
  245. package/dist/chunk-OTDF6PZK.js +0 -1
  246. package/dist/chunk-P3AXSRLG.mjs +0 -1
  247. package/dist/chunk-Q4CKLXWA.js +0 -1
  248. package/dist/chunk-QMLIXLZJ.mjs +0 -4
  249. package/dist/chunk-QXHL67FG.mjs +0 -1
  250. package/dist/chunk-TGPS3SRR.mjs +0 -1
  251. package/dist/chunk-TMISJEGL.js +0 -1
  252. package/dist/chunk-TRJWRZZD.js +0 -1
  253. package/dist/chunk-TRQN2SFW.mjs +0 -59
  254. package/dist/chunk-UGXSKZVM.js +0 -1
  255. package/dist/chunk-V435QKZB.js +0 -3
  256. package/dist/chunk-V6SWUCTS.js +0 -2
  257. package/dist/chunk-VQWZHPWI.mjs +0 -1
  258. package/dist/chunk-X3NB7STJ.js +0 -1
  259. package/dist/chunk-XOH7YAYL.js +0 -1
  260. package/dist/chunk-Y5HZAMND.mjs +0 -9
  261. package/dist/chunk-Y7I5QDCN.mjs +0 -1
  262. package/dist/chunk-YCDB5TA6.js +0 -4
  263. package/dist/chunk-YE357WVA.js +0 -1
  264. package/dist/chunk-YVYB4YCI.js +0 -1
  265. package/dist/lists-CvG_iVK3.d.mts +0 -148
  266. package/dist/lists-UTp_tk7B.d.ts +0 -148
@@ -1,3 +1,16 @@
1
+ /**
2
+ * Layout Engine Types
3
+ *
4
+ * Core types for the paginated layout engine.
5
+ * Converts document blocks + measurements into positioned fragments on pages.
6
+ * @packageDocumentation
7
+ * @public
8
+ */
9
+ import { m as RevisionInfo, n as CellMarker } from '../content-CYXJ2tfQ.js';
10
+ import '../formatting-_OXU8gLB.js';
11
+ import '../colors-C3vA7HUU.js';
12
+ import '../docx/wrapTypes.js';
13
+
1
14
  /**
2
15
  * Layout Engine Types
3
16
  *
@@ -178,6 +191,16 @@ type ImageRun = {
178
191
  cropLeft?: number;
179
192
  /** a:alphaModFix → CSS opacity in [0, 1]. */
180
193
  opacity?: number;
194
+ /** Whether this picture is itself a tracked insertion (`<w:ins>`). */
195
+ isInsertion?: boolean;
196
+ /** Whether this picture is itself a tracked deletion (`<w:del>`). */
197
+ isDeletion?: boolean;
198
+ /** Author of the tracked change wrapping the picture. */
199
+ changeAuthor?: string;
200
+ /** Date of the tracked change wrapping the picture. */
201
+ changeDate?: string;
202
+ /** Revision id of the tracked change (for sidebar matching). */
203
+ changeRevisionId?: number;
181
204
  pmStart?: number;
182
205
  pmEnd?: number;
183
206
  };
@@ -294,6 +317,13 @@ type ParagraphAttrs = {
294
317
  listMarkerFontFamily?: string;
295
318
  listMarkerFontSize?: number;
296
319
  listMarkerSuffix?: 'tab' | 'space' | 'nothing';
320
+ /**
321
+ * Tracked-change state of the list numbering itself. When a list is applied
322
+ * (or removed) under suggesting mode, the marker paints in the insertion /
323
+ * deletion color so an inserted list item's number reads as part of the
324
+ * suggestion, matching Word. `undefined` = numbering is not a pending change.
325
+ */
326
+ listMarkerRevision?: 'ins' | 'del';
297
327
  /** Document-wide `w:defaultTabStop` in twips (§17.6.13). Default 720. */
298
328
  defaultTabStopTwips?: number;
299
329
  defaultFontSize?: number;
@@ -306,11 +336,22 @@ type ParagraphAttrs = {
306
336
  * (#381).
307
337
  */
308
338
  suppressEmptyParagraphHeight?: boolean;
339
+ /**
340
+ * Tracked-change marker on the paragraph mark itself
341
+ * (`<w:pPr><w:rPr><w:ins/>`). The painter renders a pilcrow and margin
342
+ * change bar; the cache key includes presence so two paragraphs with
343
+ * different revisions don't share a measurement.
344
+ */
345
+ pPrIns?: RevisionInfo | null;
346
+ /** Tracked-change marker on the paragraph mark (`<w:pPr><w:rPr><w:del/>`). */
347
+ pPrDel?: RevisionInfo | null;
309
348
  };
310
349
  /**
311
350
  * A paragraph block containing runs.
312
351
  */
313
352
  type ParagraphBlock = {
353
+ /** Enclosing block-SDT group memberships (outermost first), if any. */
354
+ sdtGroups?: SdtGroup[];
314
355
  kind: 'paragraph';
315
356
  id: BlockId;
316
357
  runs: Run[];
@@ -366,6 +407,8 @@ type TableCell = {
366
407
  * — content stays on one line and the cell expands horizontally.
367
408
  */
368
409
  noWrap?: boolean;
410
+ /** Tracked cell marker (`<w:cellIns>` / `<w:cellDel>` / `<w:cellMerge>`) — painter colors the top border. */
411
+ trackedMarker?: CellMarker;
369
412
  };
370
413
  /**
371
414
  * A table row containing cells.
@@ -376,6 +419,9 @@ type TableRow = {
376
419
  height?: number;
377
420
  heightRule?: 'auto' | 'atLeast' | 'exact';
378
421
  isHeader?: boolean;
422
+ /** Tracked row ins / del (`<w:trPr><w:ins/>` / `<w:del/>`). */
423
+ trackedIns?: RevisionInfo;
424
+ /** see trackedIns */ trackedDel?: RevisionInfo;
379
425
  };
380
426
  /**
381
427
  * Floating table positioning info (pixel values).
@@ -396,6 +442,8 @@ type FloatingTablePosition = {
396
442
  * A table block containing rows.
397
443
  */
398
444
  type TableBlock = {
445
+ /** Enclosing block-SDT group memberships (outermost first), if any. */
446
+ sdtGroups?: SdtGroup[];
399
447
  kind: 'table';
400
448
  id: BlockId;
401
449
  rows: TableRow[];
@@ -417,6 +465,8 @@ type TableBlock = {
417
465
  * An anchored/floating image block.
418
466
  */
419
467
  type ImageBlock = {
468
+ /** Enclosing block-SDT group memberships (outermost first), if any. */
469
+ sdtGroups?: SdtGroup[];
420
470
  kind: 'image';
421
471
  id: BlockId;
422
472
  src: string;
@@ -440,6 +490,8 @@ type ImageBlock = {
440
490
  * Section break block defining page layout changes.
441
491
  */
442
492
  type SectionBreakBlock = {
493
+ /** Enclosing block-SDT group memberships (outermost first), if any. */
494
+ sdtGroups?: SdtGroup[];
443
495
  kind: 'sectionBreak';
444
496
  id: BlockId;
445
497
  type?: 'continuous' | 'nextPage' | 'evenPage' | 'oddPage';
@@ -455,6 +507,8 @@ type SectionBreakBlock = {
455
507
  * Explicit page break block.
456
508
  */
457
509
  type PageBreakBlock = {
510
+ /** Enclosing block-SDT group memberships (outermost first), if any. */
511
+ sdtGroups?: SdtGroup[];
458
512
  kind: 'pageBreak';
459
513
  id: BlockId;
460
514
  pmStart?: number;
@@ -464,6 +518,8 @@ type PageBreakBlock = {
464
518
  * Column break block.
465
519
  */
466
520
  type ColumnBreakBlock = {
521
+ /** Enclosing block-SDT group memberships (outermost first), if any. */
522
+ sdtGroups?: SdtGroup[];
467
523
  kind: 'columnBreak';
468
524
  id: BlockId;
469
525
  pmStart?: number;
@@ -482,6 +538,8 @@ declare const DEFAULT_TEXTBOX_WIDTH = 200;
482
538
  * Text box block — positioned container with paragraph content.
483
539
  */
484
540
  type TextBoxBlock = {
541
+ /** Enclosing block-SDT group memberships (outermost first), if any. */
542
+ sdtGroups?: SdtGroup[];
485
543
  kind: 'textBox';
486
544
  id: BlockId;
487
545
  /** Width in pixels */
@@ -525,6 +583,21 @@ type TextBoxBlock = {
525
583
  pmStart?: number;
526
584
  pmEnd?: number;
527
585
  };
586
+ /**
587
+ * Identity of a block-level Structured Document Tag (content control) enclosing
588
+ * a run of flow blocks. Block SDTs flatten into their child flow blocks for
589
+ * pagination; each child carries its group(s) so the painter draws the boundary.
590
+ */
591
+ interface SdtGroup {
592
+ id: string;
593
+ sdtType: string;
594
+ tag?: string;
595
+ alias?: string;
596
+ lock?: string;
597
+ checked?: boolean;
598
+ bound?: boolean;
599
+ repeatingItem?: boolean;
600
+ }
528
601
  /**
529
602
  * Union of every block kind the layout engine knows about.
530
603
  *
@@ -913,4 +986,4 @@ type DocumentPosition = {
913
986
  pmPos?: number;
914
987
  };
915
988
 
916
- export { type BlockId, type BorderStyle, type CellBorderSpec, type CellBorders, type ColumnBreakBlock, type ColumnBreakMeasure, type ColumnLayout, DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, type DocumentPosition, type FieldRun, type FloatingTablePosition, type FlowBlock, type FootnoteContent, type Fragment, type FragmentBase, type HeaderFooterContentHeights, type HeaderFooterLayout, type HitTestResult, type HyperlinkInfo, type ImageBlock, type ImageFragment, type ImageMeasure, type ImageRun, type ImageRunPosition, type Layout, type LayoutOptions, type LineBreakRun, type ListNumPr, type Measure, type MeasuredLine, type MeasuredLineSegment, type Page, type PageBreakBlock, type PageBreakMeasure, type PageMargins, type ParagraphAttrs, type ParagraphBlock, type ParagraphBorders, type ParagraphFragment, type ParagraphIndent, type ParagraphMeasure, type ParagraphSpacing, type Run, type RunFormatting, type SectionBreakBlock, type SectionBreakMeasure, type TabAlignment, type TabRun, type TabStop, type TableBlock, type TableCell, type TableCellMeasure, type TableFragment, type TableMeasure, type TableRow, type TableRowMeasure, type TextBoxBlock, type TextBoxFragment, type TextBoxMeasure, type TextRun, type WrapTextDirection, assertExhaustiveFlowBlock };
989
+ export { type BlockId, type BorderStyle, type CellBorderSpec, type CellBorders, type ColumnBreakBlock, type ColumnBreakMeasure, type ColumnLayout, DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, type DocumentPosition, type FieldRun, type FloatingTablePosition, type FlowBlock, type FootnoteContent, type Fragment, type FragmentBase, type HeaderFooterContentHeights, type HeaderFooterLayout, type HitTestResult, type HyperlinkInfo, type ImageBlock, type ImageFragment, type ImageMeasure, type ImageRun, type ImageRunPosition, type Layout, type LayoutOptions, type LineBreakRun, type ListNumPr, type Measure, type MeasuredLine, type MeasuredLineSegment, type Page, type PageBreakBlock, type PageBreakMeasure, type PageMargins, type ParagraphAttrs, type ParagraphBlock, type ParagraphBorders, type ParagraphFragment, type ParagraphIndent, type ParagraphMeasure, type ParagraphSpacing, type Run, type RunFormatting, type SdtGroup, type SectionBreakBlock, type SectionBreakMeasure, type TabAlignment, type TabRun, type TabStop, type TableBlock, type TableCell, type TableCellMeasure, type TableFragment, type TableMeasure, type TableRow, type TableRowMeasure, type TextBoxBlock, type TextBoxFragment, type TextBoxMeasure, type TextRun, type WrapTextDirection, assertExhaustiveFlowBlock };
@@ -11,13 +11,13 @@
11
11
  * @public
12
12
  */
13
13
  import '../layout-engine/types.mjs';
14
- export { B as BlockLookup, a as BlockLookupEntry, F as FRAGMENT_CLASS_NAMES, I as IMAGE_CLASS_NAMES, b as IMAGE_LAYOUT_OPTIONS, c as ImageHitTestResult, d as ImageLayoutIconHint, e as ImageLayoutOptionDef, L as LAYOUT_IMAGE_CLASSES, f as LayoutPainter, P as PainterOptions, RenderContext, RenderPageOptions, RenderPagesUpdateKind, T as TABLE_CLASS_NAMES, g as TEXTBOX_CLASS_NAMES, h as captureInlinePositionEmu, i as createPainter, j as deriveLayoutChoice, k as findImageElement, l as hitTestImage, isFloatingImageRun, m as isImageLayoutOptionEnabled, isTextWrappingFloatingImageRun, r as renderFragment, n as renderImageFragment, o as renderLine, renderPage, renderPages, p as renderParagraphFragment, q as renderTableFragment, s as renderTextBoxFragment, t as sliceRunsForLine, u as toolbarValueToLayoutTarget } from './renderPage.mjs';
14
+ export { B as BlockLookup, a as BlockLookupEntry, F as FRAGMENT_CLASS_NAMES, I as IMAGE_CLASS_NAMES, b as IMAGE_LAYOUT_OPTIONS, c as ImageHitTestResult, d as ImageLayoutIconHint, e as ImageLayoutOptionDef, L as LAYOUT_IMAGE_CLASSES, f as LayoutPainter, P as PainterOptions, RenderContext, RenderPageOptions, RenderPagesUpdateKind, T as TABLE_CLASS_NAMES, g as TEXTBOX_CLASS_NAMES, h as applySdtFocus, i as captureInlinePositionEmu, j as createPainter, k as deriveLayoutChoice, l as enclosingSdtGroupIds, m as findImageElement, n as hitTestImage, isFloatingImageRun, o as isImageLayoutOptionEnabled, isTextWrappingFloatingImageRun, r as renderFragment, p as renderImageFragment, q as renderLine, renderPage, renderPages, s as renderParagraphFragment, t as renderTableFragment, u as renderTextBoxFragment, v as sliceRunsForLine, w as toolbarValueToLayoutTarget } from './renderPage.mjs';
15
15
  export { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-lCH_P3N3.mjs';
16
- import '../nodes-CL8M0L-a.mjs';
16
+ import '../content-CE-ZdMwG.mjs';
17
17
  import '../formatting-BH4hcZiq.mjs';
18
18
  import '../colors-C3vA7HUU.mjs';
19
- import '../lists-CvG_iVK3.mjs';
20
19
  import '../docx/wrapTypes.mjs';
21
- import '../types/content.mjs';
20
+ import 'prosemirror-model';
21
+ import '../nodes-Bz-UHhLE.mjs';
22
22
  import '../ImageExtension-BN327PNe.mjs';
23
23
  import '../styles-EI2lxeEN.mjs';
@@ -11,13 +11,13 @@
11
11
  * @public
12
12
  */
13
13
  import '../layout-engine/types.js';
14
- export { B as BlockLookup, a as BlockLookupEntry, F as FRAGMENT_CLASS_NAMES, I as IMAGE_CLASS_NAMES, b as IMAGE_LAYOUT_OPTIONS, c as ImageHitTestResult, d as ImageLayoutIconHint, e as ImageLayoutOptionDef, L as LAYOUT_IMAGE_CLASSES, f as LayoutPainter, P as PainterOptions, RenderContext, RenderPageOptions, RenderPagesUpdateKind, T as TABLE_CLASS_NAMES, g as TEXTBOX_CLASS_NAMES, h as captureInlinePositionEmu, i as createPainter, j as deriveLayoutChoice, k as findImageElement, l as hitTestImage, isFloatingImageRun, m as isImageLayoutOptionEnabled, isTextWrappingFloatingImageRun, r as renderFragment, n as renderImageFragment, o as renderLine, renderPage, renderPages, p as renderParagraphFragment, q as renderTableFragment, s as renderTextBoxFragment, t as sliceRunsForLine, u as toolbarValueToLayoutTarget } from './renderPage.js';
14
+ export { B as BlockLookup, a as BlockLookupEntry, F as FRAGMENT_CLASS_NAMES, I as IMAGE_CLASS_NAMES, b as IMAGE_LAYOUT_OPTIONS, c as ImageHitTestResult, d as ImageLayoutIconHint, e as ImageLayoutOptionDef, L as LAYOUT_IMAGE_CLASSES, f as LayoutPainter, P as PainterOptions, RenderContext, RenderPageOptions, RenderPagesUpdateKind, T as TABLE_CLASS_NAMES, g as TEXTBOX_CLASS_NAMES, h as applySdtFocus, i as captureInlinePositionEmu, j as createPainter, k as deriveLayoutChoice, l as enclosingSdtGroupIds, m as findImageElement, n as hitTestImage, isFloatingImageRun, o as isImageLayoutOptionEnabled, isTextWrappingFloatingImageRun, r as renderFragment, p as renderImageFragment, q as renderLine, renderPage, renderPages, s as renderParagraphFragment, t as renderTableFragment, u as renderTextBoxFragment, v as sliceRunsForLine, w as toolbarValueToLayoutTarget } from './renderPage.js';
15
15
  export { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-skVvEHvZ.js';
16
- import '../nodes-D7PTUJ2N.js';
16
+ import '../content-CYXJ2tfQ.js';
17
17
  import '../formatting-_OXU8gLB.js';
18
18
  import '../colors-C3vA7HUU.js';
19
- import '../lists-UTp_tk7B.js';
20
19
  import '../docx/wrapTypes.js';
21
- import '../types/content.js';
20
+ import 'prosemirror-model';
21
+ import '../nodes-BNkRKBBX.js';
22
22
  import '../ImageExtension-BlI5afZD.js';
23
23
  import '../styles-BBv7doYK.js';
@@ -1 +1 @@
1
- 'use strict';var chunkOTDF6PZK_js=require('../chunk-OTDF6PZK.js');require('../chunk-3AZWLVLC.js');var chunkUGXSKZVM_js=require('../chunk-UGXSKZVM.js');require('../chunk-XBIKSAH6.js'),require('../chunk-IMKU4O3P.js'),require('../chunk-DROCYKAR.js'),require('../chunk-YCDB5TA6.js'),require('../chunk-IN6IYQ2X.js'),require('../chunk-X3NB7STJ.js'),require('../chunk-D4RPOJC7.js'),require('../chunk-IP2VXNWG.js'),require('../chunk-JFZIXFRC.js'),require('../chunk-MZOVDLYL.js'),require('../chunk-EPX7BBJD.js'),require('../chunk-D536HC5M.js'),require('../chunk-TMISJEGL.js'),require('../chunk-YVYB4YCI.js'),require('../chunk-IO6HZ7KR.js'),require('../chunk-BHBOAP6Z.js'),require('../chunk-MZ7LW5CH.js'),require('../chunk-N3Y5BUKV.js'),require('../chunk-6LVPRTB6.js'),require('../chunk-NERY274X.js'),require('../chunk-MJ5FQX7Q.js'),require('../chunk-C2BAPYGJ.js'),require('../chunk-Q4CKLXWA.js');var chunk4Q2IP5FW_js=require('../chunk-4Q2IP5FW.js'),chunkDC7S76ZX_js=require('../chunk-DC7S76ZX.js');var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function P(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function v(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function B(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let a=n.getBoundingClientRect(),r=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(chunk4Q2IP5FW_js.f((a.left-r.left)/p)),verticalEmu:Math.round(chunk4Q2IP5FW_js.f((a.top-l.top)/p))}}function C(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var H=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function R(n,e){return true}function A(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}var c=class{constructor(e={}){chunkDC7S76ZX_js.a(this,"container",null);chunkDC7S76ZX_js.a(this,"blockLookup",new Map);chunkDC7S76ZX_js.a(this,"pageStates",[]);chunkDC7S76ZX_js.a(this,"totalPages",0);chunkDC7S76ZX_js.a(this,"options");chunkDC7S76ZX_js.a(this,"doc");chunkDC7S76ZX_js.a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let a=o[t],r={pageNumber:a.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(a,r);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:a.number,fragmentCount:a.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"#ffffff",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let a=this.doc.createElement("div");a.className="layout-page-content",a.style.position="absolute",a.style.top=`${e.margins.top}px`,a.style.left=`${e.margins.left}px`,a.style.right=`${e.margins.right}px`,a.style.bottom=`${e.margins.bottom}px`,a.style.overflow="visible";for(let r of e.fragments){let l=this.renderFragmentWithLookup(r,o);this.applyFragmentPosition(l,r),a.appendChild(l);}return t.appendChild(a),t}renderFragmentWithLookup(e,o){let t=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t){let a=t.block,r=t.measure;return chunkOTDF6PZK_js.r(e,a,r,o,{document:this.doc})}if(e.kind==="table"&&t){let a=t.block,r=t.measure;return chunkOTDF6PZK_js.u(e,a,r,o,{document:this.doc})}if(e.kind==="image"&&t){let a=t.block,r=t.measure;return chunkOTDF6PZK_js.o(e,a,r,o,{document:this.doc})}if(e.kind==="textBox"&&t){let a=t.block,r=t.measure;return chunkOTDF6PZK_js.w(e,a,r,o,{document:this.doc})}return chunkOTDF6PZK_js.m(e,o,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function W(n){return new c(n)}Object.defineProperty(exports,"FRAGMENT_CLASS_NAMES",{enumerable:true,get:function(){return chunkOTDF6PZK_js.l}});Object.defineProperty(exports,"IMAGE_CLASS_NAMES",{enumerable:true,get:function(){return chunkOTDF6PZK_js.n}});Object.defineProperty(exports,"TABLE_CLASS_NAMES",{enumerable:true,get:function(){return chunkOTDF6PZK_js.t}});Object.defineProperty(exports,"TEXTBOX_CLASS_NAMES",{enumerable:true,get:function(){return chunkOTDF6PZK_js.v}});Object.defineProperty(exports,"renderFragment",{enumerable:true,get:function(){return chunkOTDF6PZK_js.m}});Object.defineProperty(exports,"renderImageFragment",{enumerable:true,get:function(){return chunkOTDF6PZK_js.o}});Object.defineProperty(exports,"renderLine",{enumerable:true,get:function(){return chunkOTDF6PZK_js.q}});Object.defineProperty(exports,"renderPage",{enumerable:true,get:function(){return chunkOTDF6PZK_js.B}});Object.defineProperty(exports,"renderPages",{enumerable:true,get:function(){return chunkOTDF6PZK_js.y}});Object.defineProperty(exports,"renderParagraphFragment",{enumerable:true,get:function(){return chunkOTDF6PZK_js.r}});Object.defineProperty(exports,"renderTableFragment",{enumerable:true,get:function(){return chunkOTDF6PZK_js.u}});Object.defineProperty(exports,"renderTextBoxFragment",{enumerable:true,get:function(){return chunkOTDF6PZK_js.w}});Object.defineProperty(exports,"sliceRunsForLine",{enumerable:true,get:function(){return chunkOTDF6PZK_js.p}});Object.defineProperty(exports,"isFloatingImageRun",{enumerable:true,get:function(){return chunkUGXSKZVM_js.f}});Object.defineProperty(exports,"isTextWrappingFloatingImageRun",{enumerable:true,get:function(){return chunkUGXSKZVM_js.g}});exports.IMAGE_LAYOUT_OPTIONS=H;exports.LAYOUT_IMAGE_CLASSES=i;exports.LayoutPainter=c;exports.captureInlinePositionEmu=B;exports.createPainter=W;exports.deriveLayoutChoice=C;exports.findImageElement=v;exports.hitTestImage=P;exports.isImageLayoutOptionEnabled=R;exports.toolbarValueToLayoutTarget=A;
1
+ 'use strict';var chunkXCKTBNKN_js=require('../chunk-XCKTBNKN.js');require('../chunk-AMB6Y77B.js');var chunkSORYYVJ7_js=require('../chunk-SORYYVJ7.js');require('../chunk-LTHT4A4S.js'),require('../chunk-IMKU4O3P.js'),require('../chunk-DROCYKAR.js'),require('../chunk-ROG4MNOR.js'),require('../chunk-44FHVKSI.js'),require('../chunk-ZBFNOJGY.js'),require('../chunk-C45EFOVP.js'),require('../chunk-ISKTBM4L.js'),require('../chunk-JFZIXFRC.js'),require('../chunk-E4JMCA5X.js'),require('../chunk-HQPWFUP5.js'),require('../chunk-DV6GWBUJ.js'),require('../chunk-VMRUBLPI.js'),require('../chunk-2EQGBVPV.js'),require('../chunk-BHBOAP6Z.js'),require('../chunk-MZ7LW5CH.js'),require('../chunk-N3Y5BUKV.js'),require('../chunk-WVERBZZU.js'),require('../chunk-6LVPRTB6.js'),require('../chunk-LWH66Q7Q.js'),require('../chunk-TUIEV7Q7.js'),require('../chunk-7HANRHHL.js'),require('../chunk-MJ5FQX7Q.js'),require('../chunk-C2BAPYGJ.js');var chunk4Q2IP5FW_js=require('../chunk-4Q2IP5FW.js');require('../chunk-GSKMHXHG.js');var chunkDC7S76ZX_js=require('../chunk-DC7S76ZX.js');var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function B(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function C(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function H(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let a=n.getBoundingClientRect(),r=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(chunk4Q2IP5FW_js.f((a.left-r.left)/p)),verticalEmu:Math.round(chunk4Q2IP5FW_js.f((a.top-l.top)/p))}}function R(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var A=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function O(n,e){return true}function _(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}var c=class{constructor(e={}){chunkDC7S76ZX_js.a(this,"container",null);chunkDC7S76ZX_js.a(this,"blockLookup",new Map);chunkDC7S76ZX_js.a(this,"pageStates",[]);chunkDC7S76ZX_js.a(this,"totalPages",0);chunkDC7S76ZX_js.a(this,"options");chunkDC7S76ZX_js.a(this,"doc");chunkDC7S76ZX_js.a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let a=o[t],r={pageNumber:a.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(a,r);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:a.number,fragmentCount:a.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"#ffffff",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let a=this.doc.createElement("div");a.className="layout-page-content",a.style.position="absolute",a.style.top=`${e.margins.top}px`,a.style.left=`${e.margins.left}px`,a.style.right=`${e.margins.right}px`,a.style.bottom=`${e.margins.bottom}px`,a.style.overflow="visible";for(let r of e.fragments){let l=this.renderFragmentWithLookup(r,o);this.applyFragmentPosition(l,r),a.appendChild(l);}return t.appendChild(a),t}renderFragmentWithLookup(e,o){let t=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t){let a=t.block,r=t.measure;return chunkXCKTBNKN_js.t(e,a,r,o,{document:this.doc})}if(e.kind==="table"&&t){let a=t.block,r=t.measure;return chunkXCKTBNKN_js.w(e,a,r,o,{document:this.doc})}if(e.kind==="image"&&t){let a=t.block,r=t.measure;return chunkXCKTBNKN_js.q(e,a,r,o,{document:this.doc})}if(e.kind==="textBox"&&t){let a=t.block,r=t.measure;return chunkXCKTBNKN_js.y(e,a,r,o,{document:this.doc})}return chunkXCKTBNKN_js.o(e,o,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Y(n){return new c(n)}Object.defineProperty(exports,"FRAGMENT_CLASS_NAMES",{enumerable:true,get:function(){return chunkXCKTBNKN_js.n}});Object.defineProperty(exports,"IMAGE_CLASS_NAMES",{enumerable:true,get:function(){return chunkXCKTBNKN_js.p}});Object.defineProperty(exports,"TABLE_CLASS_NAMES",{enumerable:true,get:function(){return chunkXCKTBNKN_js.v}});Object.defineProperty(exports,"TEXTBOX_CLASS_NAMES",{enumerable:true,get:function(){return chunkXCKTBNKN_js.x}});Object.defineProperty(exports,"applySdtFocus",{enumerable:true,get:function(){return chunkXCKTBNKN_js.m}});Object.defineProperty(exports,"enclosingSdtGroupIds",{enumerable:true,get:function(){return chunkXCKTBNKN_js.l}});Object.defineProperty(exports,"renderFragment",{enumerable:true,get:function(){return chunkXCKTBNKN_js.o}});Object.defineProperty(exports,"renderImageFragment",{enumerable:true,get:function(){return chunkXCKTBNKN_js.q}});Object.defineProperty(exports,"renderLine",{enumerable:true,get:function(){return chunkXCKTBNKN_js.s}});Object.defineProperty(exports,"renderPage",{enumerable:true,get:function(){return chunkXCKTBNKN_js.D}});Object.defineProperty(exports,"renderPages",{enumerable:true,get:function(){return chunkXCKTBNKN_js.A}});Object.defineProperty(exports,"renderParagraphFragment",{enumerable:true,get:function(){return chunkXCKTBNKN_js.t}});Object.defineProperty(exports,"renderTableFragment",{enumerable:true,get:function(){return chunkXCKTBNKN_js.w}});Object.defineProperty(exports,"renderTextBoxFragment",{enumerable:true,get:function(){return chunkXCKTBNKN_js.y}});Object.defineProperty(exports,"sliceRunsForLine",{enumerable:true,get:function(){return chunkXCKTBNKN_js.r}});Object.defineProperty(exports,"isFloatingImageRun",{enumerable:true,get:function(){return chunkSORYYVJ7_js.f}});Object.defineProperty(exports,"isTextWrappingFloatingImageRun",{enumerable:true,get:function(){return chunkSORYYVJ7_js.g}});exports.IMAGE_LAYOUT_OPTIONS=A;exports.LAYOUT_IMAGE_CLASSES=i;exports.LayoutPainter=c;exports.captureInlinePositionEmu=H;exports.createPainter=Y;exports.deriveLayoutChoice=R;exports.findImageElement=C;exports.hitTestImage=B;exports.isImageLayoutOptionEnabled=O;exports.toolbarValueToLayoutTarget=_;
@@ -1 +1 @@
1
- import {r,u,o,w,m}from'../chunk-BFB4PRS4.mjs';export{l as FRAGMENT_CLASS_NAMES,n as IMAGE_CLASS_NAMES,t as TABLE_CLASS_NAMES,v as TEXTBOX_CLASS_NAMES,m as renderFragment,o as renderImageFragment,q as renderLine,B as renderPage,y as renderPages,r as renderParagraphFragment,u as renderTableFragment,w as renderTextBoxFragment,p as sliceRunsForLine}from'../chunk-BFB4PRS4.mjs';import'../chunk-5SU4HPQS.mjs';export{f as isFloatingImageRun,g as isTextWrappingFloatingImageRun}from'../chunk-HAAMO2Z2.mjs';import'../chunk-EQVNAHL7.mjs';import'../chunk-FCJWLEKT.mjs';import'../chunk-7E5VBRDL.mjs';import'../chunk-QMLIXLZJ.mjs';import'../chunk-3JXR6YU4.mjs';import'../chunk-NO5LW2DQ.mjs';import'../chunk-LBKMYD3M.mjs';import'../chunk-NBLJPT54.mjs';import'../chunk-QPFJJPIC.mjs';import'../chunk-ILJUDEZ5.mjs';import'../chunk-QVEAQOMR.mjs';import'../chunk-HL5PQT3A.mjs';import'../chunk-B6LYBJ4H.mjs';import'../chunk-TGPS3SRR.mjs';import'../chunk-BRHHK4MG.mjs';import'../chunk-MOKKS75W.mjs';import'../chunk-OZMNIX6U.mjs';import'../chunk-AMENZY5F.mjs';import'../chunk-BGY3CB37.mjs';import'../chunk-CP5OSG5Z.mjs';import'../chunk-67LVRQIR.mjs';import'../chunk-LE67NTCN.mjs';import'../chunk-VQWZHPWI.mjs';import {f}from'../chunk-VW22RZ6C.mjs';import {a}from'../chunk-QYUPLKLP.mjs';var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function P(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function v(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function B(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let a=n.getBoundingClientRect(),r=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(f((a.left-r.left)/p)),verticalEmu:Math.round(f((a.top-l.top)/p))}}function C(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var H=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function R(n,e){return true}function A(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}var c=class{constructor(e={}){a(this,"container",null);a(this,"blockLookup",new Map);a(this,"pageStates",[]);a(this,"totalPages",0);a(this,"options");a(this,"doc");a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let a=o[t],r={pageNumber:a.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(a,r);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:a.number,fragmentCount:a.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"#ffffff",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let a=this.doc.createElement("div");a.className="layout-page-content",a.style.position="absolute",a.style.top=`${e.margins.top}px`,a.style.left=`${e.margins.left}px`,a.style.right=`${e.margins.right}px`,a.style.bottom=`${e.margins.bottom}px`,a.style.overflow="visible";for(let r of e.fragments){let l=this.renderFragmentWithLookup(r,o);this.applyFragmentPosition(l,r),a.appendChild(l);}return t.appendChild(a),t}renderFragmentWithLookup(e,o$1){let t=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t){let a=t.block,r$1=t.measure;return r(e,a,r$1,o$1,{document:this.doc})}if(e.kind==="table"&&t){let a=t.block,r=t.measure;return u(e,a,r,o$1,{document:this.doc})}if(e.kind==="image"&&t){let a=t.block,r=t.measure;return o(e,a,r,o$1,{document:this.doc})}if(e.kind==="textBox"&&t){let a=t.block,r=t.measure;return w(e,a,r,o$1,{document:this.doc})}return m(e,o$1,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function W(n){return new c(n)}export{H as IMAGE_LAYOUT_OPTIONS,i as LAYOUT_IMAGE_CLASSES,c as LayoutPainter,B as captureInlinePositionEmu,W as createPainter,C as deriveLayoutChoice,v as findImageElement,P as hitTestImage,R as isImageLayoutOptionEnabled,A as toolbarValueToLayoutTarget};
1
+ import {t,w,q,y as y$1,o}from'../chunk-L24C5TEX.mjs';export{n as FRAGMENT_CLASS_NAMES,p as IMAGE_CLASS_NAMES,v as TABLE_CLASS_NAMES,x as TEXTBOX_CLASS_NAMES,m as applySdtFocus,l as enclosingSdtGroupIds,o as renderFragment,q as renderImageFragment,s as renderLine,D as renderPage,A as renderPages,t as renderParagraphFragment,w as renderTableFragment,y as renderTextBoxFragment,r as sliceRunsForLine}from'../chunk-L24C5TEX.mjs';import'../chunk-KZXZWGFX.mjs';export{f as isFloatingImageRun,g as isTextWrappingFloatingImageRun}from'../chunk-MP4QSEO2.mjs';import'../chunk-6Y6LON6Y.mjs';import'../chunk-FCJWLEKT.mjs';import'../chunk-7E5VBRDL.mjs';import'../chunk-7ZN4WI5N.mjs';import'../chunk-BOOHU5EW.mjs';import'../chunk-EQAORQC3.mjs';import'../chunk-7OW3VCZE.mjs';import'../chunk-LK6I3HMH.mjs';import'../chunk-QPFJJPIC.mjs';import'../chunk-6ZXL3EIP.mjs';import'../chunk-OEXVWIHW.mjs';import'../chunk-WLHNIXWC.mjs';import'../chunk-ICE6NC3S.mjs';import'../chunk-CCPBNE2F.mjs';import'../chunk-MOKKS75W.mjs';import'../chunk-OZMNIX6U.mjs';import'../chunk-AMENZY5F.mjs';import'../chunk-U67MWOPZ.mjs';import'../chunk-BGY3CB37.mjs';import'../chunk-2XP6GLA4.mjs';import'../chunk-ZX26QZJ5.mjs';import'../chunk-MJ6XZFVD.mjs';import'../chunk-67LVRQIR.mjs';import'../chunk-LE67NTCN.mjs';import {f}from'../chunk-VW22RZ6C.mjs';import'../chunk-DI6CRWSW.mjs';import {a}from'../chunk-QYUPLKLP.mjs';var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function B(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function C(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function H(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let a=n.getBoundingClientRect(),r=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(f((a.left-r.left)/p)),verticalEmu:Math.round(f((a.top-l.top)/p))}}function R(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var A=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function O(n,e){return true}function _(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}var c=class{constructor(e={}){a(this,"container",null);a(this,"blockLookup",new Map);a(this,"pageStates",[]);a(this,"totalPages",0);a(this,"options");a(this,"doc");a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let a=o[t],r={pageNumber:a.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(a,r);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:a.number,fragmentCount:a.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"#ffffff",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let a=this.doc.createElement("div");a.className="layout-page-content",a.style.position="absolute",a.style.top=`${e.margins.top}px`,a.style.left=`${e.margins.left}px`,a.style.right=`${e.margins.right}px`,a.style.bottom=`${e.margins.bottom}px`,a.style.overflow="visible";for(let r of e.fragments){let l=this.renderFragmentWithLookup(r,o);this.applyFragmentPosition(l,r),a.appendChild(l);}return t.appendChild(a),t}renderFragmentWithLookup(e,o$1){let t$1=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t$1){let a=t$1.block,r=t$1.measure;return t(e,a,r,o$1,{document:this.doc})}if(e.kind==="table"&&t$1){let a=t$1.block,r=t$1.measure;return w(e,a,r,o$1,{document:this.doc})}if(e.kind==="image"&&t$1){let a=t$1.block,r=t$1.measure;return q(e,a,r,o$1,{document:this.doc})}if(e.kind==="textBox"&&t$1){let a=t$1.block,r=t$1.measure;return y$1(e,a,r,o$1,{document:this.doc})}return o(e,o$1,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Y(n){return new c(n)}export{A as IMAGE_LAYOUT_OPTIONS,i as LAYOUT_IMAGE_CLASSES,c as LayoutPainter,H as captureInlinePositionEmu,Y as createPainter,R as deriveLayoutChoice,C as findImageElement,B as hitTestImage,O as isImageLayoutOptionEnabled,_ as toolbarValueToLayoutTarget};
@@ -13,16 +13,16 @@
13
13
  * @public
14
14
  */
15
15
  import { ImageRun, Page, ParagraphBlock, MeasuredLine, TabStop, Run, ParagraphFragment, ParagraphMeasure, ParagraphBorders, Fragment, TableFragment, TableBlock, TableMeasure, ImageFragment, ImageBlock, ImageMeasure, TextBoxFragment, TextBoxBlock, TextBoxMeasure, FlowBlock, Measure, Layout } from '../layout-engine/types.mjs';
16
- import { I as ImageAttrs } from '../nodes-CL8M0L-a.mjs';
16
+ import { Node } from 'prosemirror-model';
17
+ import { I as ImageAttrs } from '../nodes-Bz-UHhLE.mjs';
17
18
  import { I as ImageLayoutTarget } from '../ImageExtension-BN327PNe.mjs';
18
19
  import { WrapType } from '../docx/wrapTypes.mjs';
19
20
  import { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-lCH_P3N3.mjs';
20
21
  export { a as HeaderFooterLayoutInfo, r as resolveHeaderFooterFloatingTablePosition } from '../footnotes-lCH_P3N3.mjs';
21
22
  import { B as BorderSpec } from '../colors-C3vA7HUU.mjs';
22
23
  import { T as Theme } from '../styles-EI2lxeEN.mjs';
24
+ import '../content-CE-ZdMwG.mjs';
23
25
  import '../formatting-BH4hcZiq.mjs';
24
- import '../lists-CvG_iVK3.mjs';
25
- import '../types/content.mjs';
26
26
 
27
27
  /**
28
28
  * Whether a floating image record reserves space in the text-wrap calculation.
@@ -466,6 +466,29 @@ interface RenderTextBoxFragmentOptions {
466
466
  */
467
467
  declare function renderTextBoxFragment(fragment: TextBoxFragment, block: TextBoxBlock, measure: TextBoxMeasure, context: RenderContext, options?: RenderTextBoxFragmentOptions): HTMLElement;
468
468
 
469
+ /**
470
+ * Visible boundary chrome for block-level content controls (`w:sdt`) in the
471
+ * paged view. Kept out of `renderPage.ts` so that file stays under its
472
+ * line cap; the body painter calls `renderSdtBoundaryBoxes` once per page.
473
+ */
474
+
475
+ /**
476
+ * Group ids of every block-level content control that encloses the given
477
+ * selection — used to keep a control's boundary visible while the caret is
478
+ * inside it (Word-style focus), independent of mouse hover. The id matches
479
+ * `toFlowBlocks`' `sdt@${pos}` scheme, where `pos` is the SDT node's position;
480
+ * `$pos.before(d)` yields exactly that for an ancestor at depth `d`, so the
481
+ * ids line up with the painted boxes' `data-sdt-group-id`. Both ends of a
482
+ * range are collected so a selection straddling a control still lights it up.
483
+ */
484
+ declare function enclosingSdtGroupIds(doc: Node, from: number, to: number): Set<string>;
485
+ /**
486
+ * Toggle the `.is-focused` reveal class on the painted boundary boxes whose
487
+ * control encloses the caret. Kept separate from the hover-driven `.is-active`
488
+ * class so the two reveal paths never clear each other.
489
+ */
490
+ declare function applySdtFocus(container: HTMLElement, focusedIds: Set<string>): void;
491
+
469
492
  /**
470
493
  * Image layout helpers shared between framework adapters (React, Vue, ...).
471
494
  *
@@ -678,4 +701,4 @@ declare class LayoutPainter {
678
701
  */
679
702
  declare function createPainter(options?: PainterOptions): LayoutPainter;
680
703
 
681
- export { type BlockLookup as B, FRAGMENT_CLASS_NAMES as F, type FloatingImagePaintRecord, type FloatingImagesLayerOptions, FootnoteRenderItem, HeaderFooterContent, IMAGE_CLASS_NAMES as I, LAYOUT_IMAGE_CLASSES as L, type PainterOptions as P, PAGE_CLASS_NAMES, type RenderContext, type RenderPageOptions, type RenderPagesUpdateKind, TABLE_CLASS_NAMES as T, type BlockLookupEntry as a, applyPageStyles, IMAGE_LAYOUT_OPTIONS as b, type ImageHitTestResult as c, type ImageLayoutIconHint as d, type ImageLayoutOptionDef as e, LayoutPainter as f, floatingImageIsBehindDoc, floatingImageWrapsText, TEXTBOX_CLASS_NAMES as g, captureInlinePositionEmu as h, createPainter as i, isFloatingImageRun, isTextWrappingFloatingImageRun, deriveLayoutChoice as j, findImageElement as k, hitTestImage as l, isImageLayoutOptionEnabled as m, renderImageFragment as n, renderLine as o, renderParagraphFragment as p, renderTableFragment as q, renderFragment as r, renderFloatingImagesLayer, renderPage, renderPages, renderTextBoxFragment as s, sliceRunsForLine as t, toolbarValueToLayoutTarget as u };
704
+ export { type BlockLookup as B, FRAGMENT_CLASS_NAMES as F, type FloatingImagePaintRecord, type FloatingImagesLayerOptions, FootnoteRenderItem, HeaderFooterContent, IMAGE_CLASS_NAMES as I, LAYOUT_IMAGE_CLASSES as L, type PainterOptions as P, PAGE_CLASS_NAMES, type RenderContext, type RenderPageOptions, type RenderPagesUpdateKind, TABLE_CLASS_NAMES as T, type BlockLookupEntry as a, applyPageStyles, IMAGE_LAYOUT_OPTIONS as b, type ImageHitTestResult as c, type ImageLayoutIconHint as d, type ImageLayoutOptionDef as e, LayoutPainter as f, floatingImageIsBehindDoc, floatingImageWrapsText, TEXTBOX_CLASS_NAMES as g, applySdtFocus as h, captureInlinePositionEmu as i, isFloatingImageRun, isTextWrappingFloatingImageRun, createPainter as j, deriveLayoutChoice as k, enclosingSdtGroupIds as l, findImageElement as m, hitTestImage as n, isImageLayoutOptionEnabled as o, renderImageFragment as p, renderLine as q, renderFragment as r, renderFloatingImagesLayer, renderPage, renderPages, renderParagraphFragment as s, renderTableFragment as t, renderTextBoxFragment as u, sliceRunsForLine as v, toolbarValueToLayoutTarget as w };
@@ -13,16 +13,16 @@
13
13
  * @public
14
14
  */
15
15
  import { ImageRun, Page, ParagraphBlock, MeasuredLine, TabStop, Run, ParagraphFragment, ParagraphMeasure, ParagraphBorders, Fragment, TableFragment, TableBlock, TableMeasure, ImageFragment, ImageBlock, ImageMeasure, TextBoxFragment, TextBoxBlock, TextBoxMeasure, FlowBlock, Measure, Layout } from '../layout-engine/types.js';
16
- import { I as ImageAttrs } from '../nodes-D7PTUJ2N.js';
16
+ import { Node } from 'prosemirror-model';
17
+ import { I as ImageAttrs } from '../nodes-BNkRKBBX.js';
17
18
  import { I as ImageLayoutTarget } from '../ImageExtension-BlI5afZD.js';
18
19
  import { WrapType } from '../docx/wrapTypes.js';
19
20
  import { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-skVvEHvZ.js';
20
21
  export { a as HeaderFooterLayoutInfo, r as resolveHeaderFooterFloatingTablePosition } from '../footnotes-skVvEHvZ.js';
21
22
  import { B as BorderSpec } from '../colors-C3vA7HUU.js';
22
23
  import { T as Theme } from '../styles-BBv7doYK.js';
24
+ import '../content-CYXJ2tfQ.js';
23
25
  import '../formatting-_OXU8gLB.js';
24
- import '../lists-UTp_tk7B.js';
25
- import '../types/content.js';
26
26
 
27
27
  /**
28
28
  * Whether a floating image record reserves space in the text-wrap calculation.
@@ -466,6 +466,29 @@ interface RenderTextBoxFragmentOptions {
466
466
  */
467
467
  declare function renderTextBoxFragment(fragment: TextBoxFragment, block: TextBoxBlock, measure: TextBoxMeasure, context: RenderContext, options?: RenderTextBoxFragmentOptions): HTMLElement;
468
468
 
469
+ /**
470
+ * Visible boundary chrome for block-level content controls (`w:sdt`) in the
471
+ * paged view. Kept out of `renderPage.ts` so that file stays under its
472
+ * line cap; the body painter calls `renderSdtBoundaryBoxes` once per page.
473
+ */
474
+
475
+ /**
476
+ * Group ids of every block-level content control that encloses the given
477
+ * selection — used to keep a control's boundary visible while the caret is
478
+ * inside it (Word-style focus), independent of mouse hover. The id matches
479
+ * `toFlowBlocks`' `sdt@${pos}` scheme, where `pos` is the SDT node's position;
480
+ * `$pos.before(d)` yields exactly that for an ancestor at depth `d`, so the
481
+ * ids line up with the painted boxes' `data-sdt-group-id`. Both ends of a
482
+ * range are collected so a selection straddling a control still lights it up.
483
+ */
484
+ declare function enclosingSdtGroupIds(doc: Node, from: number, to: number): Set<string>;
485
+ /**
486
+ * Toggle the `.is-focused` reveal class on the painted boundary boxes whose
487
+ * control encloses the caret. Kept separate from the hover-driven `.is-active`
488
+ * class so the two reveal paths never clear each other.
489
+ */
490
+ declare function applySdtFocus(container: HTMLElement, focusedIds: Set<string>): void;
491
+
469
492
  /**
470
493
  * Image layout helpers shared between framework adapters (React, Vue, ...).
471
494
  *
@@ -678,4 +701,4 @@ declare class LayoutPainter {
678
701
  */
679
702
  declare function createPainter(options?: PainterOptions): LayoutPainter;
680
703
 
681
- export { type BlockLookup as B, FRAGMENT_CLASS_NAMES as F, type FloatingImagePaintRecord, type FloatingImagesLayerOptions, FootnoteRenderItem, HeaderFooterContent, IMAGE_CLASS_NAMES as I, LAYOUT_IMAGE_CLASSES as L, type PainterOptions as P, PAGE_CLASS_NAMES, type RenderContext, type RenderPageOptions, type RenderPagesUpdateKind, TABLE_CLASS_NAMES as T, type BlockLookupEntry as a, applyPageStyles, IMAGE_LAYOUT_OPTIONS as b, type ImageHitTestResult as c, type ImageLayoutIconHint as d, type ImageLayoutOptionDef as e, LayoutPainter as f, floatingImageIsBehindDoc, floatingImageWrapsText, TEXTBOX_CLASS_NAMES as g, captureInlinePositionEmu as h, createPainter as i, isFloatingImageRun, isTextWrappingFloatingImageRun, deriveLayoutChoice as j, findImageElement as k, hitTestImage as l, isImageLayoutOptionEnabled as m, renderImageFragment as n, renderLine as o, renderParagraphFragment as p, renderTableFragment as q, renderFragment as r, renderFloatingImagesLayer, renderPage, renderPages, renderTextBoxFragment as s, sliceRunsForLine as t, toolbarValueToLayoutTarget as u };
704
+ export { type BlockLookup as B, FRAGMENT_CLASS_NAMES as F, type FloatingImagePaintRecord, type FloatingImagesLayerOptions, FootnoteRenderItem, HeaderFooterContent, IMAGE_CLASS_NAMES as I, LAYOUT_IMAGE_CLASSES as L, type PainterOptions as P, PAGE_CLASS_NAMES, type RenderContext, type RenderPageOptions, type RenderPagesUpdateKind, TABLE_CLASS_NAMES as T, type BlockLookupEntry as a, applyPageStyles, IMAGE_LAYOUT_OPTIONS as b, type ImageHitTestResult as c, type ImageLayoutIconHint as d, type ImageLayoutOptionDef as e, LayoutPainter as f, floatingImageIsBehindDoc, floatingImageWrapsText, TEXTBOX_CLASS_NAMES as g, applySdtFocus as h, captureInlinePositionEmu as i, isFloatingImageRun, isTextWrappingFloatingImageRun, createPainter as j, deriveLayoutChoice as k, enclosingSdtGroupIds as l, findImageElement as m, hitTestImage as n, isImageLayoutOptionEnabled as o, renderImageFragment as p, renderLine as q, renderFragment as r, renderFloatingImagesLayer, renderPage, renderPages, renderParagraphFragment as s, renderTableFragment as t, renderTextBoxFragment as u, sliceRunsForLine as v, toolbarValueToLayoutTarget as w };
@@ -1 +1 @@
1
- 'use strict';var chunkOTDF6PZK_js=require('../chunk-OTDF6PZK.js');require('../chunk-3AZWLVLC.js');var chunkUGXSKZVM_js=require('../chunk-UGXSKZVM.js');require('../chunk-XBIKSAH6.js'),require('../chunk-IMKU4O3P.js'),require('../chunk-DROCYKAR.js'),require('../chunk-YCDB5TA6.js'),require('../chunk-IN6IYQ2X.js'),require('../chunk-X3NB7STJ.js'),require('../chunk-D4RPOJC7.js'),require('../chunk-IP2VXNWG.js'),require('../chunk-JFZIXFRC.js'),require('../chunk-MZOVDLYL.js'),require('../chunk-EPX7BBJD.js'),require('../chunk-D536HC5M.js'),require('../chunk-TMISJEGL.js'),require('../chunk-YVYB4YCI.js'),require('../chunk-IO6HZ7KR.js'),require('../chunk-BHBOAP6Z.js'),require('../chunk-MZ7LW5CH.js'),require('../chunk-N3Y5BUKV.js'),require('../chunk-6LVPRTB6.js'),require('../chunk-NERY274X.js'),require('../chunk-MJ5FQX7Q.js'),require('../chunk-C2BAPYGJ.js'),require('../chunk-Q4CKLXWA.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"PAGE_CLASS_NAMES",{enumerable:true,get:function(){return chunkOTDF6PZK_js.z}});Object.defineProperty(exports,"applyPageStyles",{enumerable:true,get:function(){return chunkOTDF6PZK_js.A}});Object.defineProperty(exports,"renderFloatingImagesLayer",{enumerable:true,get:function(){return chunkOTDF6PZK_js.s}});Object.defineProperty(exports,"renderPage",{enumerable:true,get:function(){return chunkOTDF6PZK_js.B}});Object.defineProperty(exports,"renderPages",{enumerable:true,get:function(){return chunkOTDF6PZK_js.y}});Object.defineProperty(exports,"resolveHeaderFooterFloatingTablePosition",{enumerable:true,get:function(){return chunkOTDF6PZK_js.x}});Object.defineProperty(exports,"floatingImageIsBehindDoc",{enumerable:true,get:function(){return chunkUGXSKZVM_js.e}});Object.defineProperty(exports,"floatingImageWrapsText",{enumerable:true,get:function(){return chunkUGXSKZVM_js.d}});Object.defineProperty(exports,"isFloatingImageRun",{enumerable:true,get:function(){return chunkUGXSKZVM_js.f}});Object.defineProperty(exports,"isTextWrappingFloatingImageRun",{enumerable:true,get:function(){return chunkUGXSKZVM_js.g}});
1
+ 'use strict';var chunkXCKTBNKN_js=require('../chunk-XCKTBNKN.js');require('../chunk-AMB6Y77B.js');var chunkSORYYVJ7_js=require('../chunk-SORYYVJ7.js');require('../chunk-LTHT4A4S.js'),require('../chunk-IMKU4O3P.js'),require('../chunk-DROCYKAR.js'),require('../chunk-ROG4MNOR.js'),require('../chunk-44FHVKSI.js'),require('../chunk-ZBFNOJGY.js'),require('../chunk-C45EFOVP.js'),require('../chunk-ISKTBM4L.js'),require('../chunk-JFZIXFRC.js'),require('../chunk-E4JMCA5X.js'),require('../chunk-HQPWFUP5.js'),require('../chunk-DV6GWBUJ.js'),require('../chunk-VMRUBLPI.js'),require('../chunk-2EQGBVPV.js'),require('../chunk-BHBOAP6Z.js'),require('../chunk-MZ7LW5CH.js'),require('../chunk-N3Y5BUKV.js'),require('../chunk-WVERBZZU.js'),require('../chunk-6LVPRTB6.js'),require('../chunk-LWH66Q7Q.js'),require('../chunk-TUIEV7Q7.js'),require('../chunk-7HANRHHL.js'),require('../chunk-MJ5FQX7Q.js'),require('../chunk-C2BAPYGJ.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-GSKMHXHG.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"PAGE_CLASS_NAMES",{enumerable:true,get:function(){return chunkXCKTBNKN_js.B}});Object.defineProperty(exports,"applyPageStyles",{enumerable:true,get:function(){return chunkXCKTBNKN_js.C}});Object.defineProperty(exports,"renderFloatingImagesLayer",{enumerable:true,get:function(){return chunkXCKTBNKN_js.u}});Object.defineProperty(exports,"renderPage",{enumerable:true,get:function(){return chunkXCKTBNKN_js.D}});Object.defineProperty(exports,"renderPages",{enumerable:true,get:function(){return chunkXCKTBNKN_js.A}});Object.defineProperty(exports,"resolveHeaderFooterFloatingTablePosition",{enumerable:true,get:function(){return chunkXCKTBNKN_js.z}});Object.defineProperty(exports,"floatingImageIsBehindDoc",{enumerable:true,get:function(){return chunkSORYYVJ7_js.e}});Object.defineProperty(exports,"floatingImageWrapsText",{enumerable:true,get:function(){return chunkSORYYVJ7_js.d}});Object.defineProperty(exports,"isFloatingImageRun",{enumerable:true,get:function(){return chunkSORYYVJ7_js.f}});Object.defineProperty(exports,"isTextWrappingFloatingImageRun",{enumerable:true,get:function(){return chunkSORYYVJ7_js.g}});
@@ -1 +1 @@
1
- export{z as PAGE_CLASS_NAMES,A as applyPageStyles,s as renderFloatingImagesLayer,B as renderPage,y as renderPages,x as resolveHeaderFooterFloatingTablePosition}from'../chunk-BFB4PRS4.mjs';import'../chunk-5SU4HPQS.mjs';export{e as floatingImageIsBehindDoc,d as floatingImageWrapsText,f as isFloatingImageRun,g as isTextWrappingFloatingImageRun}from'../chunk-HAAMO2Z2.mjs';import'../chunk-EQVNAHL7.mjs';import'../chunk-FCJWLEKT.mjs';import'../chunk-7E5VBRDL.mjs';import'../chunk-QMLIXLZJ.mjs';import'../chunk-3JXR6YU4.mjs';import'../chunk-NO5LW2DQ.mjs';import'../chunk-LBKMYD3M.mjs';import'../chunk-NBLJPT54.mjs';import'../chunk-QPFJJPIC.mjs';import'../chunk-ILJUDEZ5.mjs';import'../chunk-QVEAQOMR.mjs';import'../chunk-HL5PQT3A.mjs';import'../chunk-B6LYBJ4H.mjs';import'../chunk-TGPS3SRR.mjs';import'../chunk-BRHHK4MG.mjs';import'../chunk-MOKKS75W.mjs';import'../chunk-OZMNIX6U.mjs';import'../chunk-AMENZY5F.mjs';import'../chunk-BGY3CB37.mjs';import'../chunk-CP5OSG5Z.mjs';import'../chunk-67LVRQIR.mjs';import'../chunk-LE67NTCN.mjs';import'../chunk-VQWZHPWI.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-QYUPLKLP.mjs';
1
+ export{B as PAGE_CLASS_NAMES,C as applyPageStyles,u as renderFloatingImagesLayer,D as renderPage,A as renderPages,z as resolveHeaderFooterFloatingTablePosition}from'../chunk-L24C5TEX.mjs';import'../chunk-KZXZWGFX.mjs';export{e as floatingImageIsBehindDoc,d as floatingImageWrapsText,f as isFloatingImageRun,g as isTextWrappingFloatingImageRun}from'../chunk-MP4QSEO2.mjs';import'../chunk-6Y6LON6Y.mjs';import'../chunk-FCJWLEKT.mjs';import'../chunk-7E5VBRDL.mjs';import'../chunk-7ZN4WI5N.mjs';import'../chunk-BOOHU5EW.mjs';import'../chunk-EQAORQC3.mjs';import'../chunk-7OW3VCZE.mjs';import'../chunk-LK6I3HMH.mjs';import'../chunk-QPFJJPIC.mjs';import'../chunk-6ZXL3EIP.mjs';import'../chunk-OEXVWIHW.mjs';import'../chunk-WLHNIXWC.mjs';import'../chunk-ICE6NC3S.mjs';import'../chunk-CCPBNE2F.mjs';import'../chunk-MOKKS75W.mjs';import'../chunk-OZMNIX6U.mjs';import'../chunk-AMENZY5F.mjs';import'../chunk-U67MWOPZ.mjs';import'../chunk-BGY3CB37.mjs';import'../chunk-2XP6GLA4.mjs';import'../chunk-ZX26QZJ5.mjs';import'../chunk-MJ6XZFVD.mjs';import'../chunk-67LVRQIR.mjs';import'../chunk-LE67NTCN.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-DI6CRWSW.mjs';import'../chunk-QYUPLKLP.mjs';
@@ -17,8 +17,7 @@ import { Document } from '../types/document.mjs';
17
17
  import 'prosemirror-view';
18
18
  import '../colors-C3vA7HUU.mjs';
19
19
  import '../formatting-BH4hcZiq.mjs';
20
- import '../lists-CvG_iVK3.mjs';
21
- import '../types/content.mjs';
20
+ import '../content-CE-ZdMwG.mjs';
22
21
  import '../docx/wrapTypes.mjs';
23
22
  import '../styles-EI2lxeEN.mjs';
24
23
 
@@ -17,8 +17,7 @@ import { Document } from '../types/document.js';
17
17
  import 'prosemirror-view';
18
18
  import '../colors-C3vA7HUU.js';
19
19
  import '../formatting-_OXU8gLB.js';
20
- import '../lists-UTp_tk7B.js';
21
- import '../types/content.js';
20
+ import '../content-CYXJ2tfQ.js';
22
21
  import '../docx/wrapTypes.js';
23
22
  import '../styles-BBv7doYK.js';
24
23
 
@@ -20,11 +20,10 @@
20
20
  import { S as Subscribable } from '../Subscribable-DOz6Ohoo.mjs';
21
21
  import { TableSelectionSnapshot, CellCoordinates } from './types.mjs';
22
22
  import { Document } from '../types/document.mjs';
23
- import { Table } from '../types/content.mjs';
23
+ import { T as Table } from '../content-CE-ZdMwG.mjs';
24
24
  import 'prosemirror-view';
25
25
  import '../colors-C3vA7HUU.mjs';
26
26
  import '../formatting-BH4hcZiq.mjs';
27
- import '../lists-CvG_iVK3.mjs';
28
27
  import '../docx/wrapTypes.mjs';
29
28
  import '../styles-EI2lxeEN.mjs';
30
29
 
@@ -20,11 +20,10 @@
20
20
  import { S as Subscribable } from '../Subscribable-DOz6Ohoo.js';
21
21
  import { TableSelectionSnapshot, CellCoordinates } from './types.js';
22
22
  import { Document } from '../types/document.js';
23
- import { Table } from '../types/content.js';
23
+ import { T as Table } from '../content-CYXJ2tfQ.js';
24
24
  import 'prosemirror-view';
25
25
  import '../colors-C3vA7HUU.js';
26
26
  import '../formatting-_OXU8gLB.js';
27
- import '../lists-UTp_tk7B.js';
28
27
  import '../docx/wrapTypes.js';
29
28
  import '../styles-BBv7doYK.js';
30
29
 
@@ -9,8 +9,7 @@ import { EditorView } from 'prosemirror-view';
9
9
  import { Document } from '../types/document.mjs';
10
10
  import '../colors-C3vA7HUU.mjs';
11
11
  import '../formatting-BH4hcZiq.mjs';
12
- import '../lists-CvG_iVK3.mjs';
13
- import '../types/content.mjs';
12
+ import '../content-CE-ZdMwG.mjs';
14
13
  import '../docx/wrapTypes.mjs';
15
14
  import '../styles-EI2lxeEN.mjs';
16
15
 
@@ -9,8 +9,7 @@ import { EditorView } from 'prosemirror-view';
9
9
  import { Document } from '../types/document.js';
10
10
  import '../colors-C3vA7HUU.js';
11
11
  import '../formatting-_OXU8gLB.js';
12
- import '../lists-UTp_tk7B.js';
13
- import '../types/content.js';
12
+ import '../content-CYXJ2tfQ.js';
14
13
  import '../docx/wrapTypes.js';
15
14
  import '../styles-BBv7doYK.js';
16
15