ooxml-core 1.50.2 → 1.51.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 (361) hide show
  1. package/README.md +11 -0
  2. package/dist/{PptxHandler-PVQW47CY.mjs → PptxHandler-6GRVJRHP.mjs} +2 -2
  3. package/dist/PptxHandler-E6QYPF7X.mjs +8 -0
  4. package/dist/PptxHandler-UNQVCIGM.cjs +17 -0
  5. package/dist/PresentationBuilder-DVDJSV5R.mjs +8 -0
  6. package/dist/PresentationBuilder-F5UWRF6H.cjs +25 -0
  7. package/dist/{PresentationBuilder-ZOOVSBPR.mjs → PresentationBuilder-T6YKWPF7.mjs} +2 -2
  8. package/dist/automation/index.cjs +5806 -4494
  9. package/dist/automation/index.mjs +5806 -4494
  10. package/dist/chunk-25IJEN7R.cjs +36 -0
  11. package/dist/chunk-25JN3ZQM.mjs +58 -0
  12. package/dist/{chunk-7XYVFUB3.cjs → chunk-2IO523MM.cjs} +1 -0
  13. package/dist/{chunk-53KMIHYN.mjs → chunk-4LUZHBTT.mjs} +83 -31
  14. package/dist/chunk-554UZLPS.mjs +237 -0
  15. package/dist/{chunk-VLKUMQGT.mjs → chunk-63RAF3TS.mjs} +1 -1
  16. package/dist/{chunk-7UM5IFPR.mjs → chunk-6IUYKP77.mjs} +1 -1
  17. package/dist/{chunk-VK2G4BGX.mjs → chunk-BIMV5FVL.mjs} +481 -193
  18. package/dist/{chunk-CODMW5KF.cjs → chunk-CVUMILG3.cjs} +1 -0
  19. package/dist/{chunk-NBMXEVHL.mjs → chunk-FX6WL42B.mjs} +1 -0
  20. package/dist/chunk-GI4Y6BBX.mjs +21 -0
  21. package/dist/{chunk-MX2GFMZS.mjs → chunk-GZL4ERW3.mjs} +1 -1
  22. package/dist/chunk-HWL2AGLD.cjs +98 -0
  23. package/dist/chunk-HZAB3YDO.cjs +234 -0
  24. package/dist/chunk-IDATIFCG.mjs +226 -0
  25. package/dist/chunk-LO55N7VL.cjs +247 -0
  26. package/dist/{chunk-FFLU4LUQ.cjs → chunk-LUBPW5NP.cjs} +1629 -1609
  27. package/dist/chunk-MUNEIE2J.cjs +62 -0
  28. package/dist/{chunk-ZCKEKP7N.mjs → chunk-RYUADJV6.mjs} +4 -4
  29. package/dist/chunk-TOBK5FC4.mjs +88 -0
  30. package/dist/chunk-UV4LMGVZ.mjs +31 -0
  31. package/dist/{chunk-O3YGBYGZ.mjs → chunk-VRVHM6TJ.mjs} +1 -0
  32. package/dist/chunk-W7LVJC32.cjs +25 -0
  33. package/dist/chunk-WAZ7T2BL.cjs +169 -0
  34. package/dist/{chunk-3OKY56UM.mjs → chunk-YX33WEKS.mjs} +411 -391
  35. package/dist/docx/auto-number-fields.d.ts +22 -0
  36. package/dist/docx/auto-number-fields.d.ts.map +1 -0
  37. package/dist/docx/block-parser.d.ts.map +1 -1
  38. package/dist/docx/character-styles.d.ts.map +1 -1
  39. package/dist/docx/clipboard/css.d.ts +21 -0
  40. package/dist/docx/clipboard/css.d.ts.map +1 -0
  41. package/dist/docx/clipboard/html-tokens.d.ts +38 -0
  42. package/dist/docx/clipboard/html-tokens.d.ts.map +1 -0
  43. package/dist/docx/clipboard/index.d.ts +6 -0
  44. package/dist/docx/clipboard/index.d.ts.map +1 -0
  45. package/dist/docx/clipboard/word-fields.d.ts +13 -0
  46. package/dist/docx/clipboard/word-fields.d.ts.map +1 -0
  47. package/dist/docx/clipboard/word-fragment.d.ts +14 -0
  48. package/dist/docx/clipboard/word-fragment.d.ts.map +1 -0
  49. package/dist/docx/clipboard/word-html.d.ts +22 -0
  50. package/dist/docx/clipboard/word-html.d.ts.map +1 -0
  51. package/dist/docx/clipboard/word-list-scan.d.ts +25 -0
  52. package/dist/docx/clipboard/word-list-scan.d.ts.map +1 -0
  53. package/dist/docx/clipboard/word-lists.d.ts +13 -0
  54. package/dist/docx/clipboard/word-lists.d.ts.map +1 -0
  55. package/dist/docx/clipboard/word-runs.d.ts +18 -0
  56. package/dist/docx/clipboard/word-runs.d.ts.map +1 -0
  57. package/dist/docx/clipboard/word-styles.d.ts +35 -0
  58. package/dist/docx/clipboard/word-styles.d.ts.map +1 -0
  59. package/dist/docx/compare/build.d.ts +48 -0
  60. package/dist/docx/compare/build.d.ts.map +1 -0
  61. package/dist/docx/compare/compare.d.ts +18 -0
  62. package/dist/docx/compare/compare.d.ts.map +1 -0
  63. package/dist/docx/compare/context.d.ts +42 -0
  64. package/dist/docx/compare/context.d.ts.map +1 -0
  65. package/dist/docx/compare/diff.d.ts +20 -0
  66. package/dist/docx/compare/diff.d.ts.map +1 -0
  67. package/dist/docx/compare/index.d.ts +4 -0
  68. package/dist/docx/compare/index.d.ts.map +1 -0
  69. package/dist/docx/compare/slide.d.ts +9 -0
  70. package/dist/docx/compare/slide.d.ts.map +1 -0
  71. package/dist/docx/compare/spans.d.ts +13 -0
  72. package/dist/docx/compare/spans.d.ts.map +1 -0
  73. package/dist/docx/compare/story.d.ts +7 -0
  74. package/dist/docx/compare/story.d.ts.map +1 -0
  75. package/dist/docx/compare/table.d.ts +23 -0
  76. package/dist/docx/compare/table.d.ts.map +1 -0
  77. package/dist/docx/compare/tokens.d.ts +50 -0
  78. package/dist/docx/compare/tokens.d.ts.map +1 -0
  79. package/dist/docx/compare/types.d.ts +51 -0
  80. package/dist/docx/compare/types.d.ts.map +1 -0
  81. package/dist/docx/compatibility.d.ts +46 -0
  82. package/dist/docx/compatibility.d.ts.map +1 -0
  83. package/dist/docx/computed-fields.d.ts +39 -0
  84. package/dist/docx/computed-fields.d.ts.map +1 -0
  85. package/dist/docx/doc-property-field.d.ts +17 -0
  86. package/dist/docx/doc-property-field.d.ts.map +1 -0
  87. package/dist/docx/document-parts.d.ts +2 -0
  88. package/dist/docx/document-parts.d.ts.map +1 -1
  89. package/dist/docx/drawing-wrap.d.ts +21 -0
  90. package/dist/docx/drawing-wrap.d.ts.map +1 -0
  91. package/dist/docx/drawing.d.ts.map +1 -1
  92. package/dist/docx/embedded.cjs +3965 -2313
  93. package/dist/docx/embedded.mjs +3965 -2313
  94. package/dist/docx/field-format.d.ts +45 -0
  95. package/dist/docx/field-format.d.ts.map +1 -0
  96. package/dist/docx/field-result-spans.d.ts +62 -0
  97. package/dist/docx/field-result-spans.d.ts.map +1 -0
  98. package/dist/docx/field-runs.d.ts.map +1 -1
  99. package/dist/docx/field-stories.d.ts +9 -0
  100. package/dist/docx/field-stories.d.ts.map +1 -0
  101. package/dist/docx/find-stories.d.ts +27 -0
  102. package/dist/docx/find-stories.d.ts.map +1 -0
  103. package/dist/docx/highlight.d.ts +19 -0
  104. package/dist/docx/highlight.d.ts.map +1 -1
  105. package/dist/docx/hyperlink.d.ts +7 -0
  106. package/dist/docx/hyperlink.d.ts.map +1 -1
  107. package/dist/docx/index.cjs +7359 -3476
  108. package/dist/docx/index.d.ts +13 -1
  109. package/dist/docx/index.d.ts.map +1 -1
  110. package/dist/docx/index.mjs +7327 -3476
  111. package/dist/docx/inline-model.d.ts +21 -0
  112. package/dist/docx/inline-model.d.ts.map +1 -1
  113. package/dist/docx/inline-slots.d.ts.map +1 -1
  114. package/dist/docx/inspect-document.d.ts +21 -0
  115. package/dist/docx/inspect-document.d.ts.map +1 -0
  116. package/dist/docx/kinsoku-settings.d.ts +9 -0
  117. package/dist/docx/kinsoku-settings.d.ts.map +1 -0
  118. package/dist/docx/layout/adapt-table-floating.d.ts +11 -0
  119. package/dist/docx/layout/adapt-table-floating.d.ts.map +1 -0
  120. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  121. package/dist/docx/layout/adapter.d.ts.map +1 -1
  122. package/dist/docx/layout/computed-field-runs.d.ts +8 -0
  123. package/dist/docx/layout/computed-field-runs.d.ts.map +1 -0
  124. package/dist/docx/layout/floats.d.ts +3 -1
  125. package/dist/docx/layout/floats.d.ts.map +1 -1
  126. package/dist/docx/layout/flow-floating-table.d.ts +13 -0
  127. package/dist/docx/layout/flow-floating-table.d.ts.map +1 -0
  128. package/dist/docx/layout/flow-table.d.ts +1 -1
  129. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  130. package/dist/docx/layout/index.cjs +2280 -941
  131. package/dist/docx/layout/index.mjs +2276 -942
  132. package/dist/docx/layout/input.d.ts +50 -0
  133. package/dist/docx/layout/input.d.ts.map +1 -1
  134. package/dist/docx/layout/layout.d.ts.map +1 -1
  135. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  136. package/dist/docx/layout/page-flow.d.ts.map +1 -1
  137. package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
  138. package/dist/docx/layout/paragraph-tokens.d.ts +6 -0
  139. package/dist/docx/layout/paragraph-tokens.d.ts.map +1 -1
  140. package/dist/docx/layout/result.d.ts +12 -0
  141. package/dist/docx/layout/result.d.ts.map +1 -1
  142. package/dist/docx/layout/section-flow.d.ts.map +1 -1
  143. package/dist/docx/layout/table-autofit-distribute.d.ts +18 -0
  144. package/dist/docx/layout/table-autofit-distribute.d.ts.map +1 -0
  145. package/dist/docx/layout/table-autofit-measure.d.ts +15 -0
  146. package/dist/docx/layout/table-autofit-measure.d.ts.map +1 -0
  147. package/dist/docx/layout/table-autofit.d.ts +10 -0
  148. package/dist/docx/layout/table-autofit.d.ts.map +1 -0
  149. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -1
  150. package/dist/docx/layout/text-breaks.d.ts +38 -13
  151. package/dist/docx/layout/text-breaks.d.ts.map +1 -1
  152. package/dist/docx/layout/wrap.d.ts +1 -1
  153. package/dist/docx/layout/wrap.d.ts.map +1 -1
  154. package/dist/docx/list-number-fields.d.ts +25 -0
  155. package/dist/docx/list-number-fields.d.ts.map +1 -0
  156. package/dist/docx/load/index.cjs +4355 -2703
  157. package/dist/docx/load/index.mjs +4355 -2703
  158. package/dist/docx/model-paragraph.d.ts +12 -1
  159. package/dist/docx/model-paragraph.d.ts.map +1 -1
  160. package/dist/docx/model.d.ts +26 -1
  161. package/dist/docx/model.d.ts.map +1 -1
  162. package/dist/docx/note-convert.d.ts +45 -0
  163. package/dist/docx/note-convert.d.ts.map +1 -0
  164. package/dist/docx/numbering-counters.d.ts +17 -0
  165. package/dist/docx/numbering-counters.d.ts.map +1 -0
  166. package/dist/docx/numbering-format.d.ts +11 -2
  167. package/dist/docx/numbering-format.d.ts.map +1 -1
  168. package/dist/docx/outline-numbering.d.ts +6 -0
  169. package/dist/docx/outline-numbering.d.ts.map +1 -0
  170. package/dist/docx/package-information-save.d.ts +9 -0
  171. package/dist/docx/package-information-save.d.ts.map +1 -0
  172. package/dist/docx/package-information.d.ts +43 -0
  173. package/dist/docx/package-information.d.ts.map +1 -0
  174. package/dist/docx/package-properties.d.ts +5 -0
  175. package/dist/docx/package-properties.d.ts.map +1 -0
  176. package/dist/docx/paragraph-styles.d.ts +2 -0
  177. package/dist/docx/paragraph-styles.d.ts.map +1 -1
  178. package/dist/docx/parse-revisions.d.ts +2 -0
  179. package/dist/docx/parse-revisions.d.ts.map +1 -1
  180. package/dist/docx/parse-table-floating.d.ts +5 -0
  181. package/dist/docx/parse-table-floating.d.ts.map +1 -0
  182. package/dist/docx/parse-table.d.ts.map +1 -1
  183. package/dist/docx/parse.d.ts.map +1 -1
  184. package/dist/docx/part-relationships.d.ts.map +1 -1
  185. package/dist/docx/personal-information.d.ts +18 -0
  186. package/dist/docx/personal-information.d.ts.map +1 -0
  187. package/dist/docx/picture-crop-edit.d.ts +18 -0
  188. package/dist/docx/picture-crop-edit.d.ts.map +1 -0
  189. package/dist/docx/picture-watermark.d.ts +29 -0
  190. package/dist/docx/picture-watermark.d.ts.map +1 -0
  191. package/dist/docx/relationship-allocator.d.ts.map +1 -1
  192. package/dist/docx/remove-document-information.d.ts +8 -0
  193. package/dist/docx/remove-document-information.d.ts.map +1 -0
  194. package/dist/docx/revision-commands.d.ts +6 -1
  195. package/dist/docx/revision-commands.d.ts.map +1 -1
  196. package/dist/docx/revision-ids.d.ts.map +1 -1
  197. package/dist/docx/run-language.d.ts +9 -0
  198. package/dist/docx/run-language.d.ts.map +1 -0
  199. package/dist/docx/run-properties-snapshot.d.ts +9 -0
  200. package/dist/docx/run-properties-snapshot.d.ts.map +1 -0
  201. package/dist/docx/run-style-model.d.ts +4 -0
  202. package/dist/docx/run-style-model.d.ts.map +1 -1
  203. package/dist/docx/save-modified.d.ts +2 -1
  204. package/dist/docx/save-modified.d.ts.map +1 -1
  205. package/dist/docx/save.d.ts.map +1 -1
  206. package/dist/docx/style-ref-fields.d.ts +1 -8
  207. package/dist/docx/style-ref-fields.d.ts.map +1 -1
  208. package/dist/docx/symbol-field.d.ts +21 -0
  209. package/dist/docx/symbol-field.d.ts.map +1 -0
  210. package/dist/docx/table-cell-write.d.ts.map +1 -1
  211. package/dist/docx/table-defaults.d.ts +2 -0
  212. package/dist/docx/table-defaults.d.ts.map +1 -1
  213. package/dist/docx/table-margins.d.ts +18 -0
  214. package/dist/docx/table-margins.d.ts.map +1 -0
  215. package/dist/docx/table-model.d.ts +23 -0
  216. package/dist/docx/table-model.d.ts.map +1 -1
  217. package/dist/docx/table-structure-check.d.ts.map +1 -1
  218. package/dist/docx/table-styles.d.ts.map +1 -1
  219. package/dist/docx/ui/index.cjs +787 -435
  220. package/dist/docx/ui/index.d.ts +1 -0
  221. package/dist/docx/ui/index.d.ts.map +1 -1
  222. package/dist/docx/ui/index.mjs +784 -436
  223. package/dist/docx/ui/inline-content-schema.d.ts.map +1 -1
  224. package/dist/docx/ui/paragraph-attributes.d.ts +6 -0
  225. package/dist/docx/ui/paragraph-attributes.d.ts.map +1 -1
  226. package/dist/docx/ui/ribbon-action-ids.d.ts +1 -1
  227. package/dist/docx/ui/ribbon-action-ids.d.ts.map +1 -1
  228. package/dist/docx/ui/ribbon-legacy-labels.d.ts +1 -1
  229. package/dist/docx/ui/ribbon-legacy-labels.d.ts.map +1 -1
  230. package/dist/docx/ui/run-adapter.d.ts.map +1 -1
  231. package/dist/docx/ui/schema-marks.d.ts +2 -19
  232. package/dist/docx/ui/schema-marks.d.ts.map +1 -1
  233. package/dist/docx/ui/track-run-formatting.d.ts.map +1 -1
  234. package/dist/docx/ui/yjs-document-attributes.d.ts +5 -0
  235. package/dist/docx/ui/yjs-document-attributes.d.ts.map +1 -1
  236. package/dist/docx/write-drawing-wrap.d.ts +22 -0
  237. package/dist/docx/write-drawing-wrap.d.ts.map +1 -0
  238. package/dist/docx/write-drawing.d.ts.map +1 -1
  239. package/dist/docx/write-revisions.d.ts +3 -1
  240. package/dist/docx/write-revisions.d.ts.map +1 -1
  241. package/dist/docx/write-shape.d.ts.map +1 -1
  242. package/dist/docx/write-table-properties.d.ts.map +1 -1
  243. package/dist/docx/write.d.ts.map +1 -1
  244. package/dist/drawingml/html-text-paste.d.ts +28 -0
  245. package/dist/drawingml/html-text-paste.d.ts.map +1 -0
  246. package/dist/drawingml/html-text-style.d.ts +18 -0
  247. package/dist/drawingml/html-text-style.d.ts.map +1 -0
  248. package/dist/drawingml/index.cjs +762 -0
  249. package/dist/drawingml/index.d.ts +1 -0
  250. package/dist/drawingml/index.d.ts.map +1 -1
  251. package/dist/drawingml/index.mjs +760 -1
  252. package/dist/index.cjs +1147 -251
  253. package/dist/index.mjs +1147 -251
  254. package/dist/pptx/automation/index.cjs +561 -180
  255. package/dist/pptx/automation/index.d.ts +4 -4
  256. package/dist/pptx/automation/index.mjs +6 -5
  257. package/dist/pptx/chunks/{index-BCy58n13.d.ts → index-8ZfPndYR.d.ts} +2 -2
  258. package/dist/pptx/chunks/{index-BCy58n13.d.ts.map → index-8ZfPndYR.d.ts.map} +1 -1
  259. package/dist/pptx/chunks/{index-OwiX5IVw.d.ts → index-DVhD9Kd5.d.ts} +4 -4
  260. package/dist/pptx/chunks/{index-OwiX5IVw.d.ts.map → index-DVhD9Kd5.d.ts.map} +1 -1
  261. package/dist/pptx/chunks/{index-oQHWAO7M.d.ts → index-DsUnUj-V.d.ts} +5 -5
  262. package/dist/pptx/chunks/{index-oQHWAO7M.d.ts.map → index-DsUnUj-V.d.ts.map} +1 -1
  263. package/dist/pptx/chunks/{index-AZN38e6S.d.ts → index-xB7MDLI7.d.ts} +4 -4
  264. package/dist/pptx/chunks/{index-AZN38e6S.d.ts.map → index-xB7MDLI7.d.ts.map} +1 -1
  265. package/dist/pptx/chunks/{presentation-DOaYIW-l.d.ts → presentation-BvnVkFPJ.d.ts} +26 -2
  266. package/dist/pptx/chunks/{presentation-DOaYIW-l.d.ts.map → presentation-BvnVkFPJ.d.ts.map} +1 -1
  267. package/dist/pptx/chunks/{text-operations-CYSXno9L.d.ts → text-operations-D7TCPhlv.d.ts} +2 -2
  268. package/dist/pptx/chunks/{text-operations-CYSXno9L.d.ts.map → text-operations-D7TCPhlv.d.ts.map} +1 -1
  269. package/dist/pptx/cli/index.cjs +504 -124
  270. package/dist/pptx/cli/index.d.ts +1 -1
  271. package/dist/pptx/cli/index.mjs +4 -4
  272. package/dist/pptx/converter/index.d.ts +1 -1
  273. package/dist/pptx/converter/index.mjs +2 -2
  274. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  275. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  276. package/dist/pptx/editor/render/find-replace.cjs +16 -15
  277. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  278. package/dist/pptx/editor/render/find-replace.mjs +3 -2
  279. package/dist/pptx/editor/render/font-family-update.d.ts +2 -2
  280. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +2 -2
  281. package/dist/pptx/editor/render/segments-text-edit.cjs +159 -0
  282. package/dist/pptx/editor/render/segments-text-edit.d.ts +26 -0
  283. package/dist/pptx/editor/render/segments-text-edit.d.ts.map +1 -0
  284. package/dist/pptx/editor/render/segments-text-edit.mjs +156 -0
  285. package/dist/pptx/editor/render/slide-operations.cjs +12 -9
  286. package/dist/pptx/editor/render/slide-operations.mjs +6 -3
  287. package/dist/pptx/editor/render/table-cell-edit.cjs +5 -5
  288. package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
  289. package/dist/pptx/editor/render/table-cell-edit.mjs +1 -1
  290. package/dist/pptx/editor/render/table-cell-merge.cjs +3 -3
  291. package/dist/pptx/editor/render/table-cell-merge.mjs +1 -1
  292. package/dist/pptx/editor/render/table-cell-rich-text.cjs +41 -0
  293. package/dist/pptx/editor/render/table-cell-rich-text.d.ts +50 -0
  294. package/dist/pptx/editor/render/table-cell-rich-text.d.ts.map +1 -0
  295. package/dist/pptx/editor/render/table-cell-rich-text.mjs +8 -0
  296. package/dist/pptx/editor/render/table-cell-source.cjs +23 -0
  297. package/dist/pptx/editor/render/table-cell-source.d.ts +31 -0
  298. package/dist/pptx/editor/render/table-cell-source.d.ts.map +1 -0
  299. package/dist/pptx/editor/render/table-cell-source.mjs +6 -0
  300. package/dist/pptx/editor/render/table-cells-text-style.cjs +116 -0
  301. package/dist/pptx/editor/render/table-cells-text-style.d.ts +37 -0
  302. package/dist/pptx/editor/render/table-cells-text-style.d.ts.map +1 -0
  303. package/dist/pptx/editor/render/table-cells-text-style.mjs +113 -0
  304. package/dist/pptx/editor/render/table-data-grid-ops.cjs +40 -94
  305. package/dist/pptx/editor/render/table-data-grid-ops.mjs +3 -88
  306. package/dist/pptx/editor/render/table-grid-fill.cjs +30 -0
  307. package/dist/pptx/editor/render/table-grid-fill.d.ts +34 -0
  308. package/dist/pptx/editor/render/table-grid-fill.d.ts.map +1 -0
  309. package/dist/pptx/editor/render/table-grid-fill.mjs +28 -0
  310. package/dist/pptx/editor/render/table-layout.cjs +6 -6
  311. package/dist/pptx/editor/render/table-layout.d.ts +2 -2
  312. package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
  313. package/dist/pptx/editor/render/table-layout.mjs +1 -1
  314. package/dist/pptx/editor/render/table-merge.cjs +5 -5
  315. package/dist/pptx/editor/render/table-merge.mjs +1 -1
  316. package/dist/pptx/editor/render/text-content-style.d.ts +2 -2
  317. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +2 -2
  318. package/dist/pptx/editor/render/text-style-scope.d.ts +2 -2
  319. package/dist/pptx/editor/render/update-text-segment-style.d.ts +2 -2
  320. package/dist/pptx/index.cjs +519 -201
  321. package/dist/pptx/index.d.ts +7 -7
  322. package/dist/pptx/index.mjs +5 -5
  323. package/dist/pptx/node/index.d.ts +1 -1
  324. package/dist/pptx/smartart-layouts/index.d.ts +2 -2
  325. package/dist/teams/index.cjs +35 -25
  326. package/dist/teams/index.mjs +35 -25
  327. package/dist/text/complex-breaks.d.ts +24 -0
  328. package/dist/text/complex-breaks.d.ts.map +1 -0
  329. package/dist/text/east-asian.d.ts +32 -0
  330. package/dist/text/east-asian.d.ts.map +1 -0
  331. package/dist/text/html-tokens.d.ts +45 -0
  332. package/dist/text/html-tokens.d.ts.map +1 -0
  333. package/dist/text/index.cjs +477 -62
  334. package/dist/text/index.d.ts +5 -0
  335. package/dist/text/index.d.ts.map +1 -1
  336. package/dist/text/index.mjs +456 -63
  337. package/dist/text/kinsoku.d.ts +55 -0
  338. package/dist/text/kinsoku.d.ts.map +1 -0
  339. package/dist/text/truetype/embedding.d.ts +42 -0
  340. package/dist/text/truetype/embedding.d.ts.map +1 -0
  341. package/dist/text/windows-1252.d.ts +10 -0
  342. package/dist/text/windows-1252.d.ts.map +1 -0
  343. package/dist/xlsx/collab/index.cjs +10 -6
  344. package/dist/xlsx/collab/index.mjs +10 -6
  345. package/dist/xlsx/edit/clipboard-html-parse.d.ts +1 -0
  346. package/dist/xlsx/edit/clipboard-html-parse.d.ts.map +1 -1
  347. package/dist/xlsx/formula/functions/text-convert.d.ts.map +1 -1
  348. package/dist/xlsx/index.cjs +96 -51
  349. package/dist/xlsx/index.mjs +96 -51
  350. package/dist/xlsx/load/index.cjs +10 -6
  351. package/dist/xlsx/load/index.mjs +10 -6
  352. package/dist/xlsx/ui/index.cjs +97 -52
  353. package/dist/xlsx/ui/index.mjs +97 -52
  354. package/package.json +1 -1
  355. package/dist/PptxHandler-72NTA5ZY.cjs +0 -14
  356. package/dist/PptxHandler-O4IJ3TKZ.mjs +0 -5
  357. package/dist/PresentationBuilder-ORM22QGC.mjs +0 -5
  358. package/dist/PresentationBuilder-T2ETYT3L.cjs +0 -22
  359. package/dist/chunk-X4RL5AZ7.cjs +0 -120
  360. package/dist/{chunk-PRGXRAAU.mjs → chunk-4Y76EAKK.mjs} +131 -131
  361. package/dist/{chunk-EN3KSEW5.cjs → chunk-MMULWQOM.cjs} +131 -131
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * @module cli
16
16
  */
17
- import { a as MergeOptions, t as FindResult } from "../chunks/text-operations-CYSXno9L.js";
17
+ import { a as MergeOptions, t as FindResult } from "../chunks/text-operations-D7TCPhlv.js";
18
18
  /** Result from the `info` command. */
19
19
  interface InfoResult {
20
20
  slideCount: number;
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { replaceText, findText, mergePresentation } from '../../chunk-VLKUMQGT.mjs';
3
- import { PptxMarkdownConverter } from '../../chunk-7UM5IFPR.mjs';
4
- import { PptxHandler } from '../../chunk-VK2G4BGX.mjs';
5
- import { SvgExporter, isImageLikeElement, blobUrlToDataUrl } from '../../chunk-MX2GFMZS.mjs';
2
+ import { replaceText, findText, mergePresentation } from '../../chunk-63RAF3TS.mjs';
3
+ import { PptxMarkdownConverter } from '../../chunk-6IUYKP77.mjs';
4
+ import { PptxHandler } from '../../chunk-BIMV5FVL.mjs';
5
+ import { SvgExporter, isImageLikeElement, blobUrlToDataUrl } from '../../chunk-GZL4ERW3.mjs';
6
6
  import '../../chunk-U7YXYOA7.mjs';
7
7
  import '../../chunk-2N7RZQLC.mjs';
8
8
  import '../../chunk-VDUNZTJC.mjs';
@@ -1,2 +1,2 @@
1
- import { A as SlideProcessor, B as generateMediaFilename, C as PptxJsonAssetStats, D as SvgExportOptions, E as isPptxJsonText, F as deriveOutputPath, H as ConversionResult, I as getDirectory, L as normalizePath, M as PptxConverterOptions, N as PptxMarkdownConverter, O as SvgExporter, P as DocumentConverter, R as MediaContext, S as PPTX_JSON_VERSION, T as decodePptxJsonText, U as FileSystemAdapter, V as ConversionOptions, _ as decodeJsonValue, a as deserializePptxFromJson, b as PPTX_JSON_FORMAT, c as pptxDataFromJsonDocument, d as serializePptxToJson, f as PRESENTATION_FIELD_KEYS, g as bytesToBase64, h as base64ToBytes, i as PptxJsonFormatError, j as SlideProcessorOptions, k as SlideMetadataRenderer, l as PptxJsonSerializeOptions, m as JsonAssetAccumulator, n as PptxJsonConverterOptions, o as parsePptxJson, p as PRESENTATION_FIELD_NAMES, r as applyImportedPptxData, s as parsePptxJsonDocument, t as PptxJsonConverter, u as buildPptxJsonDocument, v as encodeJsonValue, w as PptxJsonDocument, x as PPTX_JSON_MIME_TYPE, y as PPTX_JSON_FILE_EXTENSION, z as dataUrlToMediaBytes } from "../chunks/index-AZN38e6S.js";
1
+ import { A as SlideProcessor, B as generateMediaFilename, C as PptxJsonAssetStats, D as SvgExportOptions, E as isPptxJsonText, F as deriveOutputPath, H as ConversionResult, I as getDirectory, L as normalizePath, M as PptxConverterOptions, N as PptxMarkdownConverter, O as SvgExporter, P as DocumentConverter, R as MediaContext, S as PPTX_JSON_VERSION, T as decodePptxJsonText, U as FileSystemAdapter, V as ConversionOptions, _ as decodeJsonValue, a as deserializePptxFromJson, b as PPTX_JSON_FORMAT, c as pptxDataFromJsonDocument, d as serializePptxToJson, f as PRESENTATION_FIELD_KEYS, g as bytesToBase64, h as base64ToBytes, i as PptxJsonFormatError, j as SlideProcessorOptions, k as SlideMetadataRenderer, l as PptxJsonSerializeOptions, m as JsonAssetAccumulator, n as PptxJsonConverterOptions, o as parsePptxJson, p as PRESENTATION_FIELD_NAMES, r as applyImportedPptxData, s as parsePptxJsonDocument, t as PptxJsonConverter, u as buildPptxJsonDocument, v as encodeJsonValue, w as PptxJsonDocument, x as PPTX_JSON_MIME_TYPE, y as PPTX_JSON_FILE_EXTENSION, z as dataUrlToMediaBytes } from "../chunks/index-xB7MDLI7.js";
2
2
  export { type ConversionOptions, type ConversionResult, DocumentConverter, type FileSystemAdapter, type JsonAssetAccumulator, MediaContext, PPTX_JSON_FILE_EXTENSION, PPTX_JSON_FORMAT, PPTX_JSON_MIME_TYPE, PPTX_JSON_VERSION, PRESENTATION_FIELD_KEYS, PRESENTATION_FIELD_NAMES, type PptxConverterOptions, type PptxJsonAssetStats, PptxJsonConverter, type PptxJsonConverterOptions, type PptxJsonDocument, PptxJsonFormatError, type PptxJsonSerializeOptions, PptxMarkdownConverter, SlideMetadataRenderer, SlideProcessor, type SlideProcessorOptions, type SvgExportOptions, SvgExporter, applyImportedPptxData, base64ToBytes, buildPptxJsonDocument, bytesToBase64, dataUrlToMediaBytes, decodeJsonValue, decodePptxJsonText, deriveOutputPath, deserializePptxFromJson, encodeJsonValue, generateMediaFilename, getDirectory, isPptxJsonText, normalizePath, parsePptxJson, parsePptxJsonDocument, pptxDataFromJsonDocument, serializePptxToJson };
@@ -1,6 +1,6 @@
1
1
  import '../../chunk-6Q7TP72Y.mjs';
2
- export { DocumentConverter, MediaContext, PptxMarkdownConverter, SlideMetadataRenderer, SlideProcessor, dataUrlToMediaBytes, deriveOutputPath, generateMediaFilename, getDirectory, normalizePath } from '../../chunk-7UM5IFPR.mjs';
3
- export { PPTX_JSON_FILE_EXTENSION, PPTX_JSON_FORMAT, PPTX_JSON_MIME_TYPE, PPTX_JSON_VERSION, PRESENTATION_FIELD_KEYS, PRESENTATION_FIELD_NAMES, PptxJsonConverter, PptxJsonFormatError, SvgExporter, applyImportedPptxData, base64ToBytes, buildPptxJsonDocument, bytesToBase64, decodeJsonValue, decodePptxJsonText, deserializePptxFromJson, encodeJsonValue, isPptxJsonText, parsePptxJson, parsePptxJsonDocument, pptxDataFromJsonDocument, serializePptxToJson } from '../../chunk-MX2GFMZS.mjs';
2
+ export { DocumentConverter, MediaContext, PptxMarkdownConverter, SlideMetadataRenderer, SlideProcessor, dataUrlToMediaBytes, deriveOutputPath, generateMediaFilename, getDirectory, normalizePath } from '../../chunk-6IUYKP77.mjs';
3
+ export { PPTX_JSON_FILE_EXTENSION, PPTX_JSON_FORMAT, PPTX_JSON_MIME_TYPE, PPTX_JSON_VERSION, PRESENTATION_FIELD_KEYS, PRESENTATION_FIELD_NAMES, PptxJsonConverter, PptxJsonFormatError, SvgExporter, applyImportedPptxData, base64ToBytes, buildPptxJsonDocument, bytesToBase64, decodeJsonValue, decodePptxJsonText, deserializePptxFromJson, encodeJsonValue, isPptxJsonText, parsePptxJson, parsePptxJsonDocument, pptxDataFromJsonDocument, serializePptxToJson } from '../../chunk-GZL4ERW3.mjs';
4
4
  import '../../chunk-U7YXYOA7.mjs';
5
5
  import '../../chunk-VDUNZTJC.mjs';
6
6
  import '../../chunk-7DJEJTN7.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkEN3KSEW5_cjs = require('../../../chunk-EN3KSEW5.cjs');
3
+ var chunkMMULWQOM_cjs = require('../../../chunk-MMULWQOM.cjs');
4
4
  require('../../../chunk-XZPZHXV4.cjs');
5
5
  require('../../../chunk-5W2QL4SB.cjs');
6
6
 
@@ -114,7 +114,7 @@ function customShowSlides(show, slides) {
114
114
  });
115
115
  }
116
116
  function clearCustomShowActions(slides, id) {
117
- const result = chunkEN3KSEW5_cjs.mapCustomShowActions(slides, (target) => target === id ? null : target);
117
+ const result = chunkMMULWQOM_cjs.mapCustomShowActions(slides, (target) => target === id ? null : target);
118
118
  return { slides: result.slides, cleared: result.changed };
119
119
  }
120
120
 
@@ -1,4 +1,4 @@
1
- import { mapCustomShowActions } from '../../../chunk-PRGXRAAU.mjs';
1
+ import { mapCustomShowActions } from '../../../chunk-4Y76EAKK.mjs';
2
2
  import '../../../chunk-GXHKNSZX.mjs';
3
3
  import '../../../chunk-CA7KCNL3.mjs';
4
4
 
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkX4RL5AZ7_cjs = require('../../../chunk-X4RL5AZ7.cjs');
4
- var chunkEN3KSEW5_cjs = require('../../../chunk-EN3KSEW5.cjs');
3
+ var chunkWAZ7T2BL_cjs = require('../../../chunk-WAZ7T2BL.cjs');
4
+ var chunk25IJEN7R_cjs = require('../../../chunk-25IJEN7R.cjs');
5
+ var chunkMMULWQOM_cjs = require('../../../chunk-MMULWQOM.cjs');
5
6
  var chunkXZPZHXV4_cjs = require('../../../chunk-XZPZHXV4.cjs');
6
7
  require('../../../chunk-5W2QL4SB.cjs');
7
8
  var chunkAWIDASUW_cjs = require('../../../chunk-AWIDASUW.cjs');
@@ -146,10 +147,10 @@ function* findSlideTextTargets(slide, includeNotes = false, includeChartTitles =
146
147
  function patchTableXml(element, rowIndex, colIndex, original, runs) {
147
148
  if (!element.rawXml) return void 0;
148
149
  const rawXml = structuredClone(element.rawXml);
149
- const table = chunkX4RL5AZ7_cjs.getTblFromRawXml(rawXml);
150
- const row = chunkX4RL5AZ7_cjs.ensureArray(table?.["a:tr"])[rowIndex];
151
- const cell = chunkX4RL5AZ7_cjs.ensureArray(row?.["a:tc"])[colIndex];
152
- const paragraphs = chunkX4RL5AZ7_cjs.ensureArray(
150
+ const table = chunk25IJEN7R_cjs.getTblFromRawXml(rawXml);
151
+ const row = chunk25IJEN7R_cjs.ensureArray(table?.["a:tr"])[rowIndex];
152
+ const cell = chunk25IJEN7R_cjs.ensureArray(row?.["a:tc"])[colIndex];
153
+ const paragraphs = chunk25IJEN7R_cjs.ensureArray(
153
154
  cell?.["a:txBody"]?.["a:p"]
154
155
  );
155
156
  let paragraphIndex = 0, runIndex = 0, fieldIndex = 0;
@@ -164,7 +165,7 @@ function patchTableXml(element, rowIndex, colIndex, original, runs) {
164
165
  if (previous.isLineBreak) continue;
165
166
  const paragraph = paragraphs[paragraphIndex];
166
167
  const key = previous.isField ? "a:fld" : "a:r";
167
- const xmlRun = chunkX4RL5AZ7_cjs.ensureArray(paragraph?.[key])[previous.isField ? fieldIndex++ : runIndex++];
168
+ const xmlRun = chunk25IJEN7R_cjs.ensureArray(paragraph?.[key])[previous.isField ? fieldIndex++ : runIndex++];
168
169
  if (!xmlRun) return void 0;
169
170
  if (previous.text !== runs[index].text) xmlRun["a:t"] = runs[index].text;
170
171
  }
@@ -174,7 +175,7 @@ function updateNode(nodes, nodeId, text) {
174
175
  return nodes.map((node) => {
175
176
  if (node.id === nodeId) {
176
177
  const originalParagraphs = node.paragraphs ?? (node.runs?.length ? [{ items: node.runs.map((run) => ({ kind: "run", run })) }] : void 0);
177
- const paragraphs = originalParagraphs ? chunkEN3KSEW5_cjs.reconcileSmartArtTextParagraphs(originalParagraphs, text) : void 0;
178
+ const paragraphs = originalParagraphs ? chunkMMULWQOM_cjs.reconcileSmartArtTextParagraphs(originalParagraphs, text) : void 0;
178
179
  return { ...node, text, ...paragraphs ? { paragraphs } : {} };
179
180
  }
180
181
  if (!node.children) return node;
@@ -253,14 +254,14 @@ function replaceLeaf(element, match, replacement) {
253
254
  );
254
255
  if (!runs) return element;
255
256
  let text = runs.map((run) => run.isParagraphBreak ? "\n" : run.isLineBreak ? "" : run.text).join("");
256
- let rawXml = cell.textRuns?.length ? patchTableXml(element, rowIndex, colIndex, original2, runs) : chunkX4RL5AZ7_cjs.updateCellTextInRawXml(element, rowIndex, colIndex, text);
257
+ let rawXml = cell.textRuns?.length ? patchTableXml(element, rowIndex, colIndex, original2, runs) : chunkWAZ7T2BL_cjs.updateCellTextInRawXml(element, rowIndex, colIndex, text);
257
258
  if (rawXml) {
258
- const table = chunkX4RL5AZ7_cjs.getTblFromRawXml(rawXml);
259
- const xmlRow = chunkX4RL5AZ7_cjs.ensureArray(table?.["a:tr"])[rowIndex];
260
- const xmlCell = chunkX4RL5AZ7_cjs.ensureArray(xmlRow?.["a:tc"])[colIndex];
261
- text = chunkX4RL5AZ7_cjs.flattenCellTxBodyText(
259
+ const table = chunk25IJEN7R_cjs.getTblFromRawXml(rawXml);
260
+ const xmlRow = chunk25IJEN7R_cjs.ensureArray(table?.["a:tr"])[rowIndex];
261
+ const xmlCell = chunk25IJEN7R_cjs.ensureArray(xmlRow?.["a:tc"])[colIndex];
262
+ text = chunkWAZ7T2BL_cjs.flattenCellTxBodyText(
262
263
  xmlCell?.["a:txBody"],
263
- (value) => chunkX4RL5AZ7_cjs.ensureArray(value)
264
+ (value) => chunk25IJEN7R_cjs.ensureArray(value)
264
265
  );
265
266
  }
266
267
  const rows = [...element.tableData.rows], cells = [...row.cells];
@@ -274,7 +275,7 @@ function replaceLeaf(element, match, replacement) {
274
275
  if (!node || match.startOffset < 0 || match.startOffset + match.length > node.text.length)
275
276
  return element;
276
277
  const text = node.text.slice(0, match.startOffset) + replacement + node.text.slice(match.startOffset + match.length);
277
- const next = chunkEN3KSEW5_cjs.updateSmartArtNodeText({ ...data, nodes }, node.id, text);
278
+ const next = chunkMMULWQOM_cjs.updateSmartArtNodeText({ ...data, nodes }, node.id, text);
278
279
  const drawingShapes = next.drawingShapes?.map((shape, index) => {
279
280
  if (shape === data.drawingShapes?.[index] || !shape.textSegments) return shape;
280
281
  return {
@@ -4,8 +4,8 @@
4
4
  * All functions are immutable; they never mutate their input arrays. No
5
5
  * framework imports, so this is safe to use in web workers or server-side code.
6
6
  */
7
- import { _ as PptxSlide } from "../../chunks/presentation-DOaYIW-l.js";
8
- import "../../chunks/index-OwiX5IVw.js";
7
+ import { _ as PptxSlide } from "../../chunks/presentation-BvnVkFPJ.js";
8
+ import "../../chunks/index-DVhD9Kd5.js";
9
9
  /** Identifies a single match of the find query at segment-level precision. */
10
10
  export interface FindResult {
11
11
  /** Zero-based index of the slide in the slides array. */
@@ -1,5 +1,6 @@
1
- import { updateCellTextInRawXml, getTblFromRawXml, ensureArray, flattenCellTxBodyText } from '../../../chunk-53KMIHYN.mjs';
2
- import { updateSmartArtNodeText, reconcileSmartArtTextParagraphs } from '../../../chunk-PRGXRAAU.mjs';
1
+ import { updateCellTextInRawXml, flattenCellTxBodyText } from '../../../chunk-4LUZHBTT.mjs';
2
+ import { getTblFromRawXml, ensureArray } from '../../../chunk-UV4LMGVZ.mjs';
3
+ import { updateSmartArtNodeText, reconcileSmartArtTextParagraphs } from '../../../chunk-4Y76EAKK.mjs';
3
4
  import { hasTextProperties } from '../../../chunk-GXHKNSZX.mjs';
4
5
  import '../../../chunk-CA7KCNL3.mjs';
5
6
  import { remapTextToSegments } from '../../../chunk-CBNKBVX5.mjs';
@@ -28,8 +28,8 @@
28
28
  * concrete face equals that Latin face or its theme token equals the Latin
29
29
  * theme token (a token-only slot has no concrete face to compare).
30
30
  */
31
- import { Tc as TextStyle } from "../../chunks/presentation-DOaYIW-l.js";
32
- import "../../chunks/index-BCy58n13.js";
31
+ import { Ec as TextStyle } from "../../chunks/presentation-BvnVkFPJ.js";
32
+ import "../../chunks/index-8ZfPndYR.js";
33
33
  /**
34
34
  * Expand a style update for `style`: when it sets a concrete `fontFamily`,
35
35
  * carry the change to the script faces that were the same face as the old
@@ -17,8 +17,8 @@
17
17
  *
18
18
  * @module render/paragraph-geometry-overrides
19
19
  */
20
- import { Tc as TextStyle } from "../../chunks/presentation-DOaYIW-l.js";
21
- import "../../chunks/index-BCy58n13.js";
20
+ import { Ec as TextStyle } from "../../chunks/presentation-BvnVkFPJ.js";
21
+ import "../../chunks/index-8ZfPndYR.js";
22
22
  /** The geometry keys a paragraph may override independently of the body. */
23
23
  export type ParagraphGeometryOverrides = Pick<TextStyle, 'eaLineBreak' | 'latinLineBreak' | 'hangingPunctuation' | 'fontAlignment' | 'defaultTabSize'>;
24
24
  /**
@@ -0,0 +1,159 @@
1
+ 'use strict';
2
+
3
+ // pptx/editor/render/segments-text-edit.ts
4
+ function segmentsPlainText(segments) {
5
+ return segments.map((segment) => segment.isParagraphBreak || segment.isLineBreak ? "\n" : segment.text).join("");
6
+ }
7
+ function explode(segments) {
8
+ const chars = [];
9
+ let para = 0;
10
+ segments.forEach((segment, seg) => {
11
+ if (segment.isParagraphBreak) {
12
+ chars.push({ ch: "\n", seg, para });
13
+ para++;
14
+ return;
15
+ }
16
+ if (segment.isLineBreak) {
17
+ chars.push({ ch: "\n", seg, para });
18
+ return;
19
+ }
20
+ for (const ch of segment.text) {
21
+ chars.push({ ch, seg, para });
22
+ }
23
+ });
24
+ return chars;
25
+ }
26
+ function paragraphLayouts(segments) {
27
+ const layouts = [];
28
+ let atStart = true;
29
+ for (const segment of segments) {
30
+ if (segment.isParagraphBreak) {
31
+ if (atStart) {
32
+ layouts.push(void 0);
33
+ }
34
+ atStart = true;
35
+ continue;
36
+ }
37
+ if (atStart) {
38
+ layouts.push({
39
+ properties: segment.paragraphProperties,
40
+ paragraph: segment.tableParagraph
41
+ });
42
+ atStart = false;
43
+ }
44
+ }
45
+ if (atStart) {
46
+ layouts.push(void 0);
47
+ }
48
+ return layouts;
49
+ }
50
+ function editSegmentsText(segments, text, caret) {
51
+ const old = explode(segments);
52
+ const next = Array.from(text);
53
+ if (old.map((c) => c.ch).join("") === text) {
54
+ return segments.map((segment) => ({ ...segment }));
55
+ }
56
+ const maxPrefix = Math.min(old.length, next.length, caret ?? Number.POSITIVE_INFINITY);
57
+ let prefix = 0;
58
+ while (prefix < maxPrefix && old[prefix].ch === next[prefix]) {
59
+ prefix++;
60
+ }
61
+ const maxSuffix = Math.min(
62
+ old.length - prefix,
63
+ next.length - prefix,
64
+ caret === void 0 ? Number.POSITIVE_INFINITY : Math.max(0, next.length - caret)
65
+ );
66
+ let suffix = 0;
67
+ while (suffix < maxSuffix && old[old.length - 1 - suffix].ch === next[next.length - 1 - suffix]) {
68
+ suffix++;
69
+ }
70
+ const before = old[prefix - 1];
71
+ const after = old[old.length - suffix];
72
+ const host = before && !segments[before.seg]?.isParagraphBreak ? before : after ?? before ?? { seg: 0};
73
+ const insertedPara = before ? segments[before.seg]?.isParagraphBreak ? before.para + 1 : before.para : 0;
74
+ const hostSegment = segments[host.seg];
75
+ const atomic = hostSegment?.fieldType !== void 0 || hostSegment?.equationXml !== void 0;
76
+ const inserted = next.slice(prefix, next.length - suffix).map((ch) => ({
77
+ ch,
78
+ seg: atomic || ch === "\n" ? -1 - host.seg : host.seg,
79
+ para: insertedPara
80
+ }));
81
+ const chars = [...old.slice(0, prefix), ...inserted, ...old.slice(old.length - suffix)];
82
+ return build(segments, chars, paragraphLayouts(segments));
83
+ }
84
+ function withoutLayout(segment) {
85
+ const copy = { ...segment };
86
+ delete copy.paragraphProperties;
87
+ delete copy.tableParagraph;
88
+ return copy;
89
+ }
90
+ function styleOf(segments, seg) {
91
+ const source = segments[seg < 0 ? -1 - seg : seg];
92
+ return { ...source?.style ?? {} };
93
+ }
94
+ function build(segments, chars, layouts) {
95
+ const out = [];
96
+ let paragraphStart = true;
97
+ let paragraphPara = chars[0]?.para ?? 0;
98
+ let lastSeg = chars[0]?.seg ?? 0;
99
+ const open = (segment, para) => {
100
+ if (paragraphStart) {
101
+ const layout = layouts[para];
102
+ if (layout?.properties) {
103
+ segment.paragraphProperties = { ...layout.properties };
104
+ }
105
+ if (layout?.paragraph) {
106
+ segment.tableParagraph = layout.paragraph;
107
+ }
108
+ paragraphStart = false;
109
+ }
110
+ out.push(segment);
111
+ };
112
+ let run;
113
+ for (const char of chars) {
114
+ const source = char.seg >= 0 ? segments[char.seg] : void 0;
115
+ if (char.ch === "\n") {
116
+ run = void 0;
117
+ if (source?.isLineBreak) {
118
+ open({ ...withoutLayout(source), style: { ...source.style } }, char.para);
119
+ continue;
120
+ }
121
+ if (paragraphStart) {
122
+ open({ text: "", style: styleOf(segments, lastSeg) }, paragraphPara);
123
+ }
124
+ out.push({
125
+ ...source?.isParagraphBreak ? withoutLayout(source) : {},
126
+ text: "\n",
127
+ isParagraphBreak: true,
128
+ style: styleOf(segments, char.seg)
129
+ });
130
+ paragraphStart = true;
131
+ paragraphPara = char.seg >= 0 ? char.para + 1 : char.para;
132
+ lastSeg = char.seg;
133
+ continue;
134
+ }
135
+ lastSeg = char.seg;
136
+ if (run && run.seg === char.seg) {
137
+ run.segment.text += char.ch;
138
+ continue;
139
+ }
140
+ const base = source && !source.isParagraphBreak && !source.isLineBreak ? source : void 0;
141
+ const segment = base ? { ...withoutLayout(base), text: char.ch, style: { ...base.style } } : { text: char.ch, style: styleOf(segments, char.seg) };
142
+ if (char.seg < 0) {
143
+ delete segment.fieldType;
144
+ const host = segments[-1 - char.seg]?.tableRun;
145
+ if (host && host.tag !== "a:br") {
146
+ segment.tableRun = host;
147
+ }
148
+ }
149
+ run = { segment, seg: char.seg };
150
+ open(segment, paragraphStart ? paragraphPara : char.para);
151
+ }
152
+ if (paragraphStart) {
153
+ open({ text: "", style: styleOf(segments, lastSeg) }, paragraphPara);
154
+ }
155
+ return out;
156
+ }
157
+
158
+ exports.editSegmentsText = editSegmentsText;
159
+ exports.segmentsPlainText = segmentsPlainText;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * segments-text-edit.ts: carry one contiguous text edit (typing, a deletion,
3
+ * a paste) onto rich segments, so every character that was not edited keeps
4
+ * exactly the run it was in and the inserted characters take the format of
5
+ * the character before them, as PowerPoint does when typing.
6
+ *
7
+ * Unlike a length-proportional remap this finds the edit itself (the common
8
+ * prefix and suffix of the old and new text, bounded by the caret when the
9
+ * caller knows it), so replacing one word never shifts the run boundaries
10
+ * around it.
11
+ *
12
+ * `\n` in the text is a paragraph break; an existing line break segment
13
+ * (`isLineBreak`) also spells `\n` and is kept as one when it survives.
14
+ *
15
+ * @module render/segments-text-edit
16
+ */
17
+ import { TextSegment } from "ooxml-core/pptx";
18
+ /** The text segments spell: paragraph and line breaks are `\n`. */
19
+ export declare function segmentsPlainText(segments: readonly TextSegment[]): string;
20
+ /**
21
+ * Apply the edit that turns `segments`' text into `text`. `caret`, when
22
+ * given, is the caret offset in `text` after the edit: the edited range ends
23
+ * there, which settles where a repeated character was typed.
24
+ */
25
+ export declare function editSegmentsText(segments: readonly TextSegment[], text: string, caret?: number): TextSegment[];
26
+ //# sourceMappingURL=segments-text-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segments-text-edit.d.ts","names":[],"sources":["../../../../pptx/editor/render/segments-text-edit.ts"],"mappings":";;;;;;;;;;;;;;;;;;wBA2BgB,kBAAkB,mBAAmB;;;;;;wBA8DrC,iBACf,mBAAmB,eACnB,cACA,iBACE"}
@@ -0,0 +1,156 @@
1
+ // pptx/editor/render/segments-text-edit.ts
2
+ function segmentsPlainText(segments) {
3
+ return segments.map((segment) => segment.isParagraphBreak || segment.isLineBreak ? "\n" : segment.text).join("");
4
+ }
5
+ function explode(segments) {
6
+ const chars = [];
7
+ let para = 0;
8
+ segments.forEach((segment, seg) => {
9
+ if (segment.isParagraphBreak) {
10
+ chars.push({ ch: "\n", seg, para });
11
+ para++;
12
+ return;
13
+ }
14
+ if (segment.isLineBreak) {
15
+ chars.push({ ch: "\n", seg, para });
16
+ return;
17
+ }
18
+ for (const ch of segment.text) {
19
+ chars.push({ ch, seg, para });
20
+ }
21
+ });
22
+ return chars;
23
+ }
24
+ function paragraphLayouts(segments) {
25
+ const layouts = [];
26
+ let atStart = true;
27
+ for (const segment of segments) {
28
+ if (segment.isParagraphBreak) {
29
+ if (atStart) {
30
+ layouts.push(void 0);
31
+ }
32
+ atStart = true;
33
+ continue;
34
+ }
35
+ if (atStart) {
36
+ layouts.push({
37
+ properties: segment.paragraphProperties,
38
+ paragraph: segment.tableParagraph
39
+ });
40
+ atStart = false;
41
+ }
42
+ }
43
+ if (atStart) {
44
+ layouts.push(void 0);
45
+ }
46
+ return layouts;
47
+ }
48
+ function editSegmentsText(segments, text, caret) {
49
+ const old = explode(segments);
50
+ const next = Array.from(text);
51
+ if (old.map((c) => c.ch).join("") === text) {
52
+ return segments.map((segment) => ({ ...segment }));
53
+ }
54
+ const maxPrefix = Math.min(old.length, next.length, caret ?? Number.POSITIVE_INFINITY);
55
+ let prefix = 0;
56
+ while (prefix < maxPrefix && old[prefix].ch === next[prefix]) {
57
+ prefix++;
58
+ }
59
+ const maxSuffix = Math.min(
60
+ old.length - prefix,
61
+ next.length - prefix,
62
+ caret === void 0 ? Number.POSITIVE_INFINITY : Math.max(0, next.length - caret)
63
+ );
64
+ let suffix = 0;
65
+ while (suffix < maxSuffix && old[old.length - 1 - suffix].ch === next[next.length - 1 - suffix]) {
66
+ suffix++;
67
+ }
68
+ const before = old[prefix - 1];
69
+ const after = old[old.length - suffix];
70
+ const host = before && !segments[before.seg]?.isParagraphBreak ? before : after ?? before ?? { seg: 0};
71
+ const insertedPara = before ? segments[before.seg]?.isParagraphBreak ? before.para + 1 : before.para : 0;
72
+ const hostSegment = segments[host.seg];
73
+ const atomic = hostSegment?.fieldType !== void 0 || hostSegment?.equationXml !== void 0;
74
+ const inserted = next.slice(prefix, next.length - suffix).map((ch) => ({
75
+ ch,
76
+ seg: atomic || ch === "\n" ? -1 - host.seg : host.seg,
77
+ para: insertedPara
78
+ }));
79
+ const chars = [...old.slice(0, prefix), ...inserted, ...old.slice(old.length - suffix)];
80
+ return build(segments, chars, paragraphLayouts(segments));
81
+ }
82
+ function withoutLayout(segment) {
83
+ const copy = { ...segment };
84
+ delete copy.paragraphProperties;
85
+ delete copy.tableParagraph;
86
+ return copy;
87
+ }
88
+ function styleOf(segments, seg) {
89
+ const source = segments[seg < 0 ? -1 - seg : seg];
90
+ return { ...source?.style ?? {} };
91
+ }
92
+ function build(segments, chars, layouts) {
93
+ const out = [];
94
+ let paragraphStart = true;
95
+ let paragraphPara = chars[0]?.para ?? 0;
96
+ let lastSeg = chars[0]?.seg ?? 0;
97
+ const open = (segment, para) => {
98
+ if (paragraphStart) {
99
+ const layout = layouts[para];
100
+ if (layout?.properties) {
101
+ segment.paragraphProperties = { ...layout.properties };
102
+ }
103
+ if (layout?.paragraph) {
104
+ segment.tableParagraph = layout.paragraph;
105
+ }
106
+ paragraphStart = false;
107
+ }
108
+ out.push(segment);
109
+ };
110
+ let run;
111
+ for (const char of chars) {
112
+ const source = char.seg >= 0 ? segments[char.seg] : void 0;
113
+ if (char.ch === "\n") {
114
+ run = void 0;
115
+ if (source?.isLineBreak) {
116
+ open({ ...withoutLayout(source), style: { ...source.style } }, char.para);
117
+ continue;
118
+ }
119
+ if (paragraphStart) {
120
+ open({ text: "", style: styleOf(segments, lastSeg) }, paragraphPara);
121
+ }
122
+ out.push({
123
+ ...source?.isParagraphBreak ? withoutLayout(source) : {},
124
+ text: "\n",
125
+ isParagraphBreak: true,
126
+ style: styleOf(segments, char.seg)
127
+ });
128
+ paragraphStart = true;
129
+ paragraphPara = char.seg >= 0 ? char.para + 1 : char.para;
130
+ lastSeg = char.seg;
131
+ continue;
132
+ }
133
+ lastSeg = char.seg;
134
+ if (run && run.seg === char.seg) {
135
+ run.segment.text += char.ch;
136
+ continue;
137
+ }
138
+ const base = source && !source.isParagraphBreak && !source.isLineBreak ? source : void 0;
139
+ const segment = base ? { ...withoutLayout(base), text: char.ch, style: { ...base.style } } : { text: char.ch, style: styleOf(segments, char.seg) };
140
+ if (char.seg < 0) {
141
+ delete segment.fieldType;
142
+ const host = segments[-1 - char.seg]?.tableRun;
143
+ if (host && host.tag !== "a:br") {
144
+ segment.tableRun = host;
145
+ }
146
+ }
147
+ run = { segment, seg: char.seg };
148
+ open(segment, paragraphStart ? paragraphPara : char.para);
149
+ }
150
+ if (paragraphStart) {
151
+ open({ text: "", style: styleOf(segments, lastSeg) }, paragraphPara);
152
+ }
153
+ return out;
154
+ }
155
+
156
+ export { editSegmentsText, segmentsPlainText };
@@ -1,8 +1,11 @@
1
1
  'use strict';
2
2
 
3
- require('../../../chunk-FFLU4LUQ.cjs');
4
- require('../../../chunk-X4RL5AZ7.cjs');
5
- var chunkEN3KSEW5_cjs = require('../../../chunk-EN3KSEW5.cjs');
3
+ require('../../../chunk-LUBPW5NP.cjs');
4
+ require('../../../chunk-W7LVJC32.cjs');
5
+ require('../../../chunk-LO55N7VL.cjs');
6
+ require('../../../chunk-WAZ7T2BL.cjs');
7
+ require('../../../chunk-25IJEN7R.cjs');
8
+ var chunkMMULWQOM_cjs = require('../../../chunk-MMULWQOM.cjs');
6
9
  require('../../../chunk-XZPZHXV4.cjs');
7
10
  require('../../../chunk-5W2QL4SB.cjs');
8
11
 
@@ -21,7 +24,7 @@ function reassignElementId(element) {
21
24
  return newElement;
22
25
  }
23
26
  function duplicateSlide(slide, newSlideNumber) {
24
- const cloned = chunkEN3KSEW5_cjs.cloneSlide(slide);
27
+ const cloned = chunkMMULWQOM_cjs.cloneSlide(slide);
25
28
  cloned.sourceSlideId = slide.id.startsWith("ppt/slides/") ? slide.id : slide.sourceSlideId ?? slide.id;
26
29
  cloned.id = `slide${newSlideNumber}`;
27
30
  cloned.rId = `rId${newSlideNumber + 1}`;
@@ -51,7 +54,7 @@ function duplicateSlide(slide, newSlideNumber) {
51
54
  function captureSlideClipboard(slides, ids) {
52
55
  return ids.flatMap((id) => {
53
56
  const slide = slides.find((candidate) => candidate.id === id);
54
- return slide ? [chunkEN3KSEW5_cjs.cloneSlide(slide)] : [];
57
+ return slide ? [chunkMMULWQOM_cjs.cloneSlide(slide)] : [];
55
58
  });
56
59
  }
57
60
  function createSlidePaste(clipboard, insertAt, templates = {}) {
@@ -62,14 +65,14 @@ function createSlidePaste(clipboard, insertAt, templates = {}) {
62
65
  })),
63
66
  sourceIds: clipboard.map((slide) => slide.id),
64
67
  insertAt,
65
- templateElements: clipboard.map((slide) => (templates[slide.id] ?? []).map(chunkEN3KSEW5_cjs.cloneElement))
68
+ templateElements: clipboard.map((slide) => (templates[slide.id] ?? []).map(chunkMMULWQOM_cjs.cloneElement))
66
69
  };
67
70
  }
68
71
  function insertSlidePaste(slides, request) {
69
72
  const index = Math.max(0, Math.min(slides.length, request.insertAt));
70
73
  const next = [
71
74
  ...slides.slice(0, index),
72
- ...request.copies.map(chunkEN3KSEW5_cjs.cloneSlide),
75
+ ...request.copies.map(chunkMMULWQOM_cjs.cloneSlide),
73
76
  ...slides.slice(index)
74
77
  ];
75
78
  return next.map(
@@ -79,12 +82,12 @@ function insertSlidePaste(slides, request) {
79
82
  function applySlidePasteTemplates(mapping, request) {
80
83
  const next = { ...mapping };
81
84
  request.copies.forEach((copy, index) => {
82
- next[copy.id] = (request.templateElements[index] ?? []).map(chunkEN3KSEW5_cjs.cloneElement);
85
+ next[copy.id] = (request.templateElements[index] ?? []).map(chunkMMULWQOM_cjs.cloneElement);
83
86
  });
84
87
  return next;
85
88
  }
86
89
  function captureSlideClipboardTemplates(mapping, ids) {
87
- return Object.fromEntries(ids.map((id) => [id, (mapping[id] ?? []).map(chunkEN3KSEW5_cjs.cloneElement)]));
90
+ return Object.fromEntries(ids.map((id) => [id, (mapping[id] ?? []).map(chunkMMULWQOM_cjs.cloneElement)]));
88
91
  }
89
92
  function makeSlideId(idGenerator) {
90
93
  if (idGenerator) {
@@ -1,6 +1,9 @@
1
- import '../../../chunk-3OKY56UM.mjs';
2
- import '../../../chunk-53KMIHYN.mjs';
3
- import { cloneSlide, cloneElement } from '../../../chunk-PRGXRAAU.mjs';
1
+ import '../../../chunk-YX33WEKS.mjs';
2
+ import '../../../chunk-GI4Y6BBX.mjs';
3
+ import '../../../chunk-554UZLPS.mjs';
4
+ import '../../../chunk-4LUZHBTT.mjs';
5
+ import '../../../chunk-UV4LMGVZ.mjs';
6
+ import { cloneSlide, cloneElement } from '../../../chunk-4Y76EAKK.mjs';
4
7
  import '../../../chunk-GXHKNSZX.mjs';
5
8
  import '../../../chunk-CA7KCNL3.mjs';
6
9
 
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
 
3
- var chunk7XYVFUB3_cjs = require('../../../chunk-7XYVFUB3.cjs');
3
+ var chunk2IO523MM_cjs = require('../../../chunk-2IO523MM.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "getCellText", {
8
8
  enumerable: true,
9
- get: function () { return chunk7XYVFUB3_cjs.getCellText; }
9
+ get: function () { return chunk2IO523MM_cjs.getCellText; }
10
10
  });
11
11
  Object.defineProperty(exports, "setCellText", {
12
12
  enumerable: true,
13
- get: function () { return chunk7XYVFUB3_cjs.setCellText; }
13
+ get: function () { return chunk2IO523MM_cjs.setCellText; }
14
14
  });
15
15
  Object.defineProperty(exports, "withCellStyle", {
16
16
  enumerable: true,
17
- get: function () { return chunk7XYVFUB3_cjs.withCellStyle; }
17
+ get: function () { return chunk2IO523MM_cjs.withCellStyle; }
18
18
  });
19
19
  Object.defineProperty(exports, "withCellText", {
20
20
  enumerable: true,
21
- get: function () { return chunk7XYVFUB3_cjs.withCellText; }
21
+ get: function () { return chunk2IO523MM_cjs.withCellText; }
22
22
  });
@@ -1 +1 @@
1
- {"version":3,"file":"table-cell-edit.d.ts","names":[],"sources":["../../../../pptx/editor/render/table-cell-edit.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoCgB,aAAa,MAAM,eAAe,eAAe;;;;;;;;;;;;;wBAqBjD,cACf,MAAM,eACN,OAAO,QAAQ,sBACb;;;;;;;;;;;;;;;;;;;wBA6Ba,YACf,SAAS,kBACT,kBACA,kBACA,eACE;;;;;wBAqBa,YACf,SAAS,kBACT,kBACA"}
1
+ {"version":3,"file":"table-cell-edit.d.ts","names":[],"sources":["../../../../pptx/editor/render/table-cell-edit.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoCgB,aAAa,MAAM,eAAe,eAAe;;;;;;;;;;;;;wBAsBjD,cACf,MAAM,eACN,OAAO,QAAQ,sBACb;;;;;;;;;;;;;;;;;;;wBA6Ba,YACf,SAAS,kBACT,kBACA,kBACA,eACE;;;;;wBAqBa,YACf,SAAS,kBACT,kBACA"}
@@ -1 +1 @@
1
- export { getCellText, setCellText, withCellStyle, withCellText } from '../../../chunk-NBMXEVHL.mjs';
1
+ export { getCellText, setCellText, withCellStyle, withCellText } from '../../../chunk-FX6WL42B.mjs';