@officedk/pptxdk 0.1.0 → 0.2.1

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 (338) hide show
  1. package/dist/build.d.ts +14 -76
  2. package/dist/build.js +69 -97
  3. package/dist/cli.js +1 -1
  4. package/dist/core/dist/capabilities/audio/audio-declaration.js +7 -0
  5. package/dist/core/dist/capabilities/audio/audio-source.js +172 -0
  6. package/dist/core/dist/capabilities/audio/entry.js +122 -0
  7. package/dist/core/dist/capabilities/box/box-codegen.js +83 -0
  8. package/dist/core/dist/capabilities/box/box-declaration.js +32 -0
  9. package/dist/{capabilities/dist → core/dist/capabilities}/box/box.js +32 -29
  10. package/dist/core/dist/capabilities/box/entry.js +2 -0
  11. package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-codegen.js +17 -22
  12. package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-declaration.js +2 -2
  13. package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-import.js +1025 -471
  14. package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-labels.js +30 -3
  15. package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-model.js +3 -3
  16. package/dist/{capabilities/dist/chart/preview/number-format.js → core/dist/capabilities/chart/chart-number-format.js} +1 -1
  17. package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-schemas.js +216 -212
  18. package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-xml.js +41 -36
  19. package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart.js +228 -171
  20. package/dist/core/dist/capabilities/chart/entry.js +2 -0
  21. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/axes-and-grid.js +23 -10
  22. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/bar-column.js +1 -1
  23. package/dist/core/dist/capabilities/chart/preview/data-labels.js +474 -0
  24. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/error-bars.js +3 -1
  25. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/index.js +30 -9
  26. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/layout.js +160 -89
  27. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/legend.js +4 -4
  28. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/line-area.js +4 -4
  29. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/markers.js +1 -1
  30. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/pie-doughnut.js +39 -60
  31. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/scales.js +1 -1
  32. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/scatter.js +3 -3
  33. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/style.js +15 -3
  34. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/text-render.js +34 -24
  35. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/trendlines.js +5 -5
  36. package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/types.js +1 -1
  37. package/dist/core/dist/capabilities/comment/comment-codegen.js +25 -0
  38. package/dist/core/dist/capabilities/comment/comment-declaration.js +37 -0
  39. package/dist/core/dist/capabilities/comment/comment-import.js +176 -0
  40. package/dist/core/dist/capabilities/comment/comment.js +141 -0
  41. package/dist/core/dist/capabilities/comment/entry.js +1 -0
  42. package/dist/core/dist/capabilities/footer-placeholder/entry.js +2 -0
  43. package/dist/core/dist/capabilities/footer-placeholder/footer-placeholder-codegen.js +16 -0
  44. package/dist/{capabilities/dist/masters → core/dist/capabilities/footer-placeholder}/footer-placeholder.js +194 -133
  45. package/dist/core/dist/capabilities/footer-placeholder/print-header-footer-import.js +121 -0
  46. package/dist/core/dist/capabilities/footer-placeholder/print-header-footer.js +123 -0
  47. package/dist/core/dist/capabilities/group/entry.js +2 -0
  48. package/dist/core/dist/capabilities/group/group-codegen.js +73 -0
  49. package/dist/core/dist/capabilities/group/group-declaration.js +41 -0
  50. package/dist/core/dist/capabilities/group/group-import.js +608 -0
  51. package/dist/{capabilities/dist → core/dist/capabilities}/group/group-xml.js +4 -3
  52. package/dist/core/dist/capabilities/group/group.js +260 -0
  53. package/dist/core/dist/capabilities/image/entry.js +4 -0
  54. package/dist/core/dist/capabilities/image/image-codegen.js +59 -0
  55. package/dist/core/dist/capabilities/image/image-declaration.js +8 -0
  56. package/dist/core/dist/capabilities/image/image-import.js +26 -0
  57. package/dist/core/dist/capabilities/image/image.js +57 -0
  58. package/dist/core/dist/capabilities/line/entry.js +3 -0
  59. package/dist/core/dist/capabilities/line/line-codegen.js +88 -0
  60. package/dist/core/dist/capabilities/line/line-declaration.js +78 -0
  61. package/dist/core/dist/capabilities/line/line-import.js +424 -0
  62. package/dist/core/dist/capabilities/line/line-xml.js +9 -0
  63. package/dist/core/dist/capabilities/line/line.js +329 -0
  64. package/dist/core/dist/capabilities/masters/entry.js +1 -0
  65. package/dist/core/dist/capabilities/masters/masters-codegen.js +50 -0
  66. package/dist/{capabilities/dist → core/dist/capabilities}/masters/masters.js +35 -47
  67. package/dist/core/dist/capabilities/motion/entry.js +5 -0
  68. package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-codegen.js +97 -51
  69. package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-import.js +653 -102
  70. package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-plan.js +317 -163
  71. package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-query.js +9 -6
  72. package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion.js +357 -108
  73. package/dist/core/dist/capabilities/notes/entry.js +2 -0
  74. package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-codegen.js +5 -7
  75. package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-declaration.js +2 -2
  76. package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-import.js +16 -13
  77. package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-schemas.js +12 -9
  78. package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes.js +20 -42
  79. package/dist/{import/dist/sections.js → core/dist/capabilities/notes/sections-import.js} +5 -5
  80. package/dist/core/dist/capabilities/placeholder/entry.js +3 -0
  81. package/dist/core/dist/capabilities/placeholder/placeholder-codegen.js +44 -0
  82. package/dist/core/dist/capabilities/placeholder/placeholder-schemas.js +31 -0
  83. package/dist/core/dist/capabilities/placeholder/placeholder.js +394 -0
  84. package/dist/core/dist/capabilities/shape/entry.js +6 -0
  85. package/dist/core/dist/capabilities/shape/shape-codegen.js +112 -0
  86. package/dist/core/dist/capabilities/shape/shape-import.js +152 -0
  87. package/dist/{capabilities/dist → core/dist/capabilities}/shape/shape-xml.js +1 -1
  88. package/dist/{capabilities/dist → core/dist/capabilities}/shape/shape.js +100 -103
  89. package/dist/core/dist/capabilities/shared/container-slots.js +59 -0
  90. package/dist/core/dist/capabilities/shared/date-time.js +98 -0
  91. package/dist/core/dist/capabilities/shared/font/font-embedding.js +118 -0
  92. package/dist/core/dist/capabilities/shared/font/font-engine.js +855 -0
  93. package/dist/core/dist/capabilities/shared/font/font-import.js +805 -0
  94. package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-subset.js +24 -9
  95. package/dist/core/dist/capabilities/shared/font/font.js +72 -0
  96. package/dist/{capabilities/dist/shape/shape-codegen.js → core/dist/capabilities/shared/geometry-codegen.js} +4 -69
  97. package/dist/{capabilities/dist → core/dist/capabilities}/shared/geometry.js +384 -123
  98. package/dist/{capabilities/dist → core/dist/capabilities}/shared/identity.js +56 -38
  99. package/dist/core/dist/capabilities/shared/image-codegen.js +94 -0
  100. package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-decode.js +17 -56
  101. package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-schemas.js +49 -61
  102. package/dist/core/dist/capabilities/shared/line-match.js +78 -0
  103. package/dist/core/dist/capabilities/shared/media-codegen.js +86 -0
  104. package/dist/core/dist/capabilities/shared/media-import.js +156 -0
  105. package/dist/core/dist/capabilities/shared/media-placement.js +20 -0
  106. package/dist/core/dist/capabilities/shared/media-poster.js +50 -0
  107. package/dist/core/dist/capabilities/shared/media-schemas.js +60 -0
  108. package/dist/core/dist/capabilities/shared/media-source.js +107 -0
  109. package/dist/core/dist/capabilities/shared/media-trim.js +102 -0
  110. package/dist/core/dist/capabilities/shared/media.js +134 -0
  111. package/dist/{capabilities/dist → core/dist/capabilities}/shared/morph-api.js +5 -5
  112. package/dist/core/dist/capabilities/shared/motion-api.js +770 -0
  113. package/dist/core/dist/capabilities/shared/motion-schemas.js +353 -0
  114. package/dist/{capabilities/dist/image/image-import.js → core/dist/capabilities/shared/picture-import.js} +313 -168
  115. package/dist/core/dist/capabilities/shared/picture-xml.js +13 -0
  116. package/dist/core/dist/capabilities/shared/picture.js +510 -0
  117. package/dist/core/dist/capabilities/shared/placeholder-import.js +268 -0
  118. package/dist/core/dist/capabilities/shared/placeholder-roles.js +42 -0
  119. package/dist/{capabilities/dist → core/dist/capabilities}/shared/preset-definitions.js +1221 -188
  120. package/dist/core/dist/capabilities/shared/print-xml.js +77 -0
  121. package/dist/core/dist/capabilities/shared/rich-text-codegen.js +119 -0
  122. package/dist/core/dist/capabilities/shared/rich-text-import.js +472 -0
  123. package/dist/core/dist/capabilities/shared/shape-declaration.js +45 -0
  124. package/dist/{capabilities/dist → core/dist/capabilities}/shared/style-inheritance.js +26 -24
  125. package/dist/core/dist/capabilities/shared/text-declaration.js +31 -0
  126. package/dist/core/dist/capabilities/shared/text-schemas.js +241 -0
  127. package/dist/core/dist/capabilities/shared/text-service.js +2563 -0
  128. package/dist/{capabilities/dist → core/dist/capabilities}/shared/visual.js +441 -137
  129. package/dist/core/dist/capabilities/slide-background/entry.js +1 -0
  130. package/dist/core/dist/capabilities/slide-background/slide-background-codegen.js +15 -0
  131. package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background-import.js +12 -7
  132. package/dist/core/dist/capabilities/slide-background/slide-background-xml.js +33 -0
  133. package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background.js +61 -50
  134. package/dist/core/dist/capabilities/table/entry.js +2 -0
  135. package/dist/core/dist/capabilities/table/table-codegen.js +118 -0
  136. package/dist/{capabilities/dist → core/dist/capabilities}/table/table-declaration.js +2 -2
  137. package/dist/{capabilities/dist → core/dist/capabilities}/table/table-import.js +116 -84
  138. package/dist/core/dist/capabilities/table/table-schemas.js +337 -0
  139. package/dist/{capabilities/dist → core/dist/capabilities}/table/table-xml.js +13 -15
  140. package/dist/{capabilities/dist → core/dist/capabilities}/table/table.js +284 -192
  141. package/dist/core/dist/capabilities/text/entry.js +3 -0
  142. package/dist/core/dist/capabilities/text/text-codegen.js +66 -0
  143. package/dist/core/dist/capabilities/text/text-import.js +468 -0
  144. package/dist/{capabilities/dist → core/dist/capabilities}/text/text-xml.js +3 -4
  145. package/dist/{capabilities/dist → core/dist/capabilities}/text/text.js +103 -111
  146. package/dist/core/dist/capabilities/transition/entry.js +3 -0
  147. package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-api.js +13 -16
  148. package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-codegen.js +2 -3
  149. package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-import.js +25 -27
  150. package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition.js +23 -23
  151. package/dist/core/dist/capabilities/video/entry.js +77 -0
  152. package/dist/core/dist/capabilities/video/video-declaration.js +7 -0
  153. package/dist/core/dist/capabilities/video/video-source.js +42 -0
  154. package/dist/{codegen/dist → core/dist/codegen}/assets.js +16 -10
  155. package/dist/{codegen/dist → core/dist/codegen}/codegen.js +152 -140
  156. package/dist/{codegen/dist → core/dist/codegen}/identifiers.js +27 -1
  157. package/dist/{codegen/dist → core/dist/codegen}/index.js +2 -2
  158. package/dist/{codegen/dist → core/dist/codegen}/printer.js +23 -4
  159. package/dist/core/dist/document/all.js +41 -0
  160. package/dist/core/dist/document/default.js +10 -0
  161. package/dist/core/dist/document/document.js +218 -0
  162. package/dist/core/dist/document/index.js +62 -0
  163. package/dist/core/dist/document/stages.js +54 -0
  164. package/dist/{emit/dist → core/dist/emit}/emit.js +173 -90
  165. package/dist/core/dist/emit/index.js +6 -0
  166. package/dist/core/dist/emit/ooxml.js +241 -0
  167. package/dist/core/dist/import/import.js +547 -0
  168. package/dist/core/dist/import/index.js +19 -0
  169. package/dist/{import/dist → core/dist/import}/masters.js +404 -328
  170. package/dist/core/dist/import/media-timing.js +233 -0
  171. package/dist/{import/dist → core/dist/import}/notes-masters.js +48 -45
  172. package/dist/core/dist/index.js +47 -15
  173. package/dist/core/dist/{author-ids.js → kernel/author-ids.js} +9 -6
  174. package/dist/core/dist/{author-schemas.js → kernel/author-schemas.js} +105 -127
  175. package/dist/core/dist/{block-flex-layout.js → kernel/block-flex-layout.js} +225 -142
  176. package/dist/core/dist/kernel/build.js +4 -0
  177. package/dist/core/dist/kernel/capability.js +17 -0
  178. package/dist/core/dist/kernel/codegen.js +97 -0
  179. package/dist/core/dist/kernel/container-slots.js +104 -0
  180. package/dist/core/dist/kernel/date-time-format.js +18 -0
  181. package/dist/core/dist/kernel/declaration-snapshot.js +68 -0
  182. package/dist/core/dist/{declaration.js → kernel/declaration.js} +3 -2
  183. package/dist/core/dist/kernel/diagnostics.js +370 -0
  184. package/dist/core/dist/kernel/document-internals.js +26 -0
  185. package/dist/core/dist/{document.js → kernel/document.js} +23 -13
  186. package/dist/core/dist/kernel/drawing-units.js +14 -0
  187. package/dist/core/dist/kernel/font-seal.js +204 -0
  188. package/dist/core/dist/{geometry-schemas.js → kernel/geometry-schemas.js} +21 -18
  189. package/dist/core/dist/{grid-layout.js → kernel/grid-layout.js} +177 -72
  190. package/dist/core/dist/{host.js → kernel/host.js} +1 -1
  191. package/dist/core/dist/kernel/index.js +24 -0
  192. package/dist/core/dist/kernel/input-values.js +62 -0
  193. package/dist/core/dist/kernel/layout-definition.js +7 -0
  194. package/dist/core/dist/{layout-protocol.js → kernel/layout-protocol.js} +5 -10
  195. package/dist/core/dist/{layout-schemas.js → kernel/layout-schemas.js} +33 -44
  196. package/dist/core/dist/kernel/layout.js +339 -0
  197. package/dist/core/dist/kernel/masters.js +171 -0
  198. package/dist/core/dist/{morph.js → kernel/morph.js} +1 -1
  199. package/dist/core/dist/kernel/placeholders.js +289 -0
  200. package/dist/{import/dist → core/dist/kernel/pptx-read}/alternate-content.js +1 -1
  201. package/dist/{import/dist → core/dist/kernel/pptx-read}/diagnostics.js +33 -29
  202. package/dist/core/dist/kernel/pptx-read/drawing-list-import.js +251 -0
  203. package/dist/{import/dist → core/dist/kernel/pptx-read}/fonts.js +71 -12
  204. package/dist/core/dist/kernel/pptx-read/index.js +15 -0
  205. package/dist/{import/dist → core/dist/kernel/pptx-read}/mechanism.js +1 -1
  206. package/dist/core/dist/kernel/pptx-read/media.js +26 -0
  207. package/dist/{import/dist → core/dist/kernel/pptx-read}/namespaces.js +6 -7
  208. package/dist/{import/dist → core/dist/kernel/pptx-read}/opc.js +62 -13
  209. package/dist/{import/dist → core/dist/kernel/pptx-read}/resources.js +1 -1
  210. package/dist/core/dist/kernel/pptx-read/shape-tree.js +57 -0
  211. package/dist/{import/dist → core/dist/kernel/pptx-read}/themes.js +182 -41
  212. package/dist/{import/dist → core/dist/kernel/pptx-read}/visual.js +175 -88
  213. package/dist/core/dist/kernel/pptx-read/xml-fragments.js +320 -0
  214. package/dist/{import/dist → core/dist/kernel/pptx-read}/xml-reader.js +8 -1
  215. package/dist/{emit/dist → core/dist/kernel/pptx-write}/shape-tree.js +1 -1
  216. package/dist/core/dist/kernel/pptx-write/timing.js +52 -0
  217. package/dist/{emit/dist/ooxml.js → core/dist/kernel/pptx-write/xml.js} +133 -290
  218. package/dist/core/dist/{query.js → kernel/query.js} +76 -37
  219. package/dist/core/dist/{resolution.js → kernel/resolution.js} +2 -1
  220. package/dist/core/dist/kernel/resolve-work.js +58 -0
  221. package/dist/core/dist/{resolve.js → kernel/resolve.js} +797 -409
  222. package/dist/core/dist/kernel/resource-source.js +11 -0
  223. package/dist/core/dist/kernel/stage-options.js +312 -0
  224. package/dist/core/dist/{theme.js → kernel/theme.js} +399 -289
  225. package/dist/core/dist/kernel/transform-geometry.js +72 -0
  226. package/dist/core/dist/kernel/xml-values.js +13 -0
  227. package/dist/document-C0lPlH-L.d.ts +1442 -0
  228. package/dist/index-B9_OUeA-.d.ts +2238 -0
  229. package/dist/index-BJEzQxWV.d.ts +75 -0
  230. package/dist/index-DA9flrlR.d.ts +146 -0
  231. package/dist/index-GSt0t9VO.d.ts +54 -0
  232. package/dist/index.d.ts +7 -7
  233. package/dist/index.js +75 -61
  234. package/dist/node.d.ts +37 -35
  235. package/dist/node.js +125 -51
  236. package/dist/pptxdk/src/cli-commands.js +79 -81
  237. package/dist/pptxdk/src/compose.js +32 -24
  238. package/dist/pptxdk/src/preview-result.js +24 -0
  239. package/dist/{capabilities/dist/image → preview/dist}/gif-decoder.js +5 -5
  240. package/dist/preview/dist/index.js +229 -77
  241. package/dist/preview/dist/options.js +17 -26
  242. package/dist/preview/dist/raster.js +66 -0
  243. package/dist/preview/dist/svg-guard.js +1090 -0
  244. package/dist/preview.d.ts +6 -3
  245. package/dist/preview.js +8 -24
  246. package/dist/react/dist/append.js +3 -3
  247. package/dist/react/dist/author/audio-elements.js +14 -0
  248. package/dist/{capabilities/dist/box → react/dist/author}/box-elements.js +5 -3
  249. package/dist/react/dist/author/chart-elements.js +14 -0
  250. package/dist/react/dist/author/comment-elements.js +15 -0
  251. package/dist/react/dist/author/group-elements.js +14 -0
  252. package/dist/react/dist/author/image-elements.js +14 -0
  253. package/dist/react/dist/author/line-elements.js +14 -0
  254. package/dist/{capabilities/dist/motion → react/dist/author}/motion-elements.js +6 -4
  255. package/dist/react/dist/author/notes-elements.js +14 -0
  256. package/dist/react/dist/author/placeholder-elements.js +14 -0
  257. package/dist/react/dist/author/shape-elements.js +14 -0
  258. package/dist/{capabilities/dist/table → react/dist/author}/table-elements.js +6 -4
  259. package/dist/react/dist/author/text-elements.js +64 -0
  260. package/dist/react/dist/author/video-elements.js +14 -0
  261. package/dist/react/dist/document-adapter.js +376 -37
  262. package/dist/react/dist/elements.js +30 -4
  263. package/dist/react/dist/from-vanilla.js +57 -0
  264. package/dist/react/dist/index.js +47 -12
  265. package/dist/react/dist/mount.js +34 -0
  266. package/dist/react/dist/reconciler.js +26 -26
  267. package/dist/react.d.ts +174 -50
  268. package/dist/react.js +31 -27
  269. package/dist/stages-DYHSHKt4.d.ts +80 -0
  270. package/dist/vanilla.d.ts +4 -4
  271. package/dist/vanilla.js +14 -14
  272. package/package.json +6 -8
  273. package/README.md +0 -49
  274. package/dist/capabilities/dist/all.js +0 -32
  275. package/dist/capabilities/dist/box/box-codegen.js +0 -51
  276. package/dist/capabilities/dist/box/box-declaration.js +0 -31
  277. package/dist/capabilities/dist/chart/chart-elements.js +0 -12
  278. package/dist/capabilities/dist/chart/preview/data-labels.js +0 -334
  279. package/dist/capabilities/dist/document.js +0 -148
  280. package/dist/capabilities/dist/font/font-embedding.js +0 -289
  281. package/dist/capabilities/dist/font/font-family.js +0 -10
  282. package/dist/capabilities/dist/font/font-import.js +0 -302
  283. package/dist/capabilities/dist/font/font.js +0 -25
  284. package/dist/capabilities/dist/group/group-codegen.js +0 -51
  285. package/dist/capabilities/dist/group/group-declaration.js +0 -42
  286. package/dist/capabilities/dist/group/group-elements.js +0 -12
  287. package/dist/capabilities/dist/group/group-import.js +0 -319
  288. package/dist/capabilities/dist/group/group.js +0 -211
  289. package/dist/capabilities/dist/image/image-codegen.js +0 -94
  290. package/dist/capabilities/dist/image/image-declaration.js +0 -8
  291. package/dist/capabilities/dist/image/image-elements.js +0 -12
  292. package/dist/capabilities/dist/image/image-xml.js +0 -12
  293. package/dist/capabilities/dist/image/image.js +0 -472
  294. package/dist/capabilities/dist/masters/masters-codegen.js +0 -21
  295. package/dist/capabilities/dist/motion/motion-api.js +0 -527
  296. package/dist/capabilities/dist/motion/motion-schemas.js +0 -216
  297. package/dist/capabilities/dist/notes/notes-elements.js +0 -12
  298. package/dist/capabilities/dist/notes/notes-xml.js +0 -38
  299. package/dist/capabilities/dist/placeholder/placeholder-codegen.js +0 -23
  300. package/dist/capabilities/dist/placeholder/placeholder-elements.js +0 -12
  301. package/dist/capabilities/dist/placeholder/placeholder.js +0 -292
  302. package/dist/capabilities/dist/shape/shape-declaration.js +0 -57
  303. package/dist/capabilities/dist/shape/shape-elements.js +0 -12
  304. package/dist/capabilities/dist/shape/shape-import.js +0 -579
  305. package/dist/capabilities/dist/shared/placeholder-import.js +0 -113
  306. package/dist/capabilities/dist/shared/style-parse.js +0 -11
  307. package/dist/capabilities/dist/shared/text-schemas.js +0 -216
  308. package/dist/capabilities/dist/shared/text-service.js +0 -1883
  309. package/dist/capabilities/dist/slide-background/slide-background-codegen.js +0 -44
  310. package/dist/capabilities/dist/slide-background/slide-background-xml.js +0 -21
  311. package/dist/capabilities/dist/table/table-codegen.js +0 -81
  312. package/dist/capabilities/dist/table/table-schemas.js +0 -279
  313. package/dist/capabilities/dist/text/text-codegen.js +0 -129
  314. package/dist/capabilities/dist/text/text-declaration.js +0 -19
  315. package/dist/capabilities/dist/text/text-elements.js +0 -38
  316. package/dist/capabilities/dist/text/text-import.js +0 -1077
  317. package/dist/capability-D_xeNVIw.d.ts +0 -29496
  318. package/dist/codegen/dist/types.js +0 -49
  319. package/dist/core/dist/build.js +0 -4
  320. package/dist/core/dist/capability.js +0 -13
  321. package/dist/core/dist/diagnostics.js +0 -21
  322. package/dist/core/dist/document-internals.js +0 -13
  323. package/dist/core/dist/input-values.js +0 -45
  324. package/dist/core/dist/layout.js +0 -299
  325. package/dist/core/dist/masters.js +0 -169
  326. package/dist/core/dist/placeholders.js +0 -213
  327. package/dist/core/dist/stage-options.js +0 -67
  328. package/dist/document-BHPUODPP.d.ts +0 -27759
  329. package/dist/emit/dist/index.js +0 -5
  330. package/dist/import/dist/import.js +0 -504
  331. package/dist/import/dist/index.js +0 -16
  332. package/dist/import/dist/xml-fragments.js +0 -36
  333. package/dist/index-B5m3hqjC.d.ts +0 -7
  334. package/dist/index-CCy-Yo8G.d.ts +0 -1208
  335. package/dist/index-DpxcZ4Gs.d.ts +0 -725
  336. package/dist/pptxdk/src/slide.js +0 -9
  337. package/dist/preview-Cfw0QdMM.d.ts +0 -86
  338. package/dist/transition-Cips9wma.d.ts +0 -82
@@ -0,0 +1,608 @@
1
+ import { emuToPx, pxToEmu } from "../../kernel/drawing-units.js";
2
+ import { attachDeferredSlideLink, consumeNonPlaceholderNvPr, readClickLink, readNonVisualCommonProperties } from "../shared/identity.js";
3
+ import { directElementChild } from "../shared/placeholder-import.js";
4
+ import { A_NS, DIAGRAM_NS, DSP_NS, P_NS } from "../../kernel/pptx-read/namespaces.js";
5
+ import { XmlElementCursor, parseXmlPart } from "../../kernel/pptx-read/xml-reader.js";
6
+ import { resolvePartPath } from "../../kernel/pptx-read/opc.js";
7
+ import { extentEmuFragmentSchema, offsetEmuFragmentSchema, transformAttributesFragmentSchema } from "../../kernel/pptx-read/xml-fragments.js";
8
+ import { readTransformXml } from "../../kernel/pptx-read/visual.js";
9
+ import { buildRelationshipIndex, inspectUnsupportedGraphicFrame, peekShapeTreeObjectIdentity } from "../../kernel/pptx-read/resources.js";
10
+ import { CommonNode } from "../../kernel/document.js";
11
+ import "../../kernel/pptx-read/index.js";
12
+ import "../../kernel/pptx-write/xml.js";
13
+ import { createGroupNode } from "./group-declaration.js";
14
+ // ../core/dist/capabilities/group/group-import.js
15
+ function readNodeStyleBox(node) {
16
+ const style = node.props.style;
17
+ if (style !== void 0 && typeof style["left"] === "number" && typeof style["top"] === "number" && typeof style["width"] === "number" && typeof style["height"] === "number") return {
18
+ x: style["left"],
19
+ y: style["top"],
20
+ width: style["width"],
21
+ height: style["height"]
22
+ };
23
+ }
24
+ function nodeBoundsPx(node) {
25
+ const styleBox = readNodeStyleBox(node);
26
+ if (styleBox !== void 0) return styleBox;
27
+ if (node.type === "group") return memberUnionPx(node.children.filter((child) => child instanceof CommonNode));
28
+ }
29
+ function memberUnionPx(members) {
30
+ if (members.length === 0) return void 0;
31
+ let minX = Number.POSITIVE_INFINITY;
32
+ let minY = Number.POSITIVE_INFINITY;
33
+ let maxRight = Number.NEGATIVE_INFINITY;
34
+ let maxBottom = Number.NEGATIVE_INFINITY;
35
+ for (const member of members) {
36
+ const box = nodeBoundsPx(member);
37
+ if (box === void 0) return void 0;
38
+ minX = Math.min(minX, box.x);
39
+ minY = Math.min(minY, box.y);
40
+ maxRight = Math.max(maxRight, box.x + box.width);
41
+ maxBottom = Math.max(maxBottom, box.y + box.height);
42
+ }
43
+ return {
44
+ x: minX,
45
+ y: minY,
46
+ width: maxRight - minX,
47
+ height: maxBottom - minY
48
+ };
49
+ }
50
+ const isValidMappedBox = (box, allowZeroExtent = false) => {
51
+ if (!Number.isFinite(box.x) || !Number.isFinite(box.y) || Math.abs(box.x) > 1e6 || Math.abs(box.y) > 1e6 || !Number.isFinite(box.width) || !Number.isFinite(box.height)) return false;
52
+ const cx = pxToEmu(box.width);
53
+ const cy = pxToEmu(box.height);
54
+ if (!Number.isSafeInteger(cx) || !Number.isSafeInteger(cy)) return false;
55
+ if (cx > 2147483647 || cy > 2147483647) return false;
56
+ if (allowZeroExtent) return cx >= 0 && cy >= 0 && (cx > 0 || cy > 0);
57
+ return cx >= 1 && cy >= 1;
58
+ };
59
+ const identityMapper = (box) => box;
60
+ function applyMemberMapper(node, memberMapper) {
61
+ const box = readNodeStyleBox(node);
62
+ if (box !== void 0) {
63
+ const mapped = memberMapper(box);
64
+ node.style({
65
+ position: "absolute",
66
+ left: mapped.x,
67
+ top: mapped.y,
68
+ width: mapped.width,
69
+ height: mapped.height
70
+ });
71
+ }
72
+ }
73
+ /**
74
+ * Converts slide-space coordinates computed in phase 1 into CSS containing-block-relative
75
+ * coordinates. Only positioned groups establish a containing block for their descendants;
76
+ * unpositioned groups inherit the nearest positioned ancestor's origin.
77
+ */
78
+ function relativizeToContainingBlock(nodes, originX, originY) {
79
+ for (const node of nodes) {
80
+ const style = node.props.style;
81
+ const isPositioned = style !== void 0 && (style["position"] === "absolute" || style["position"] === "relative") && typeof style["left"] === "number" && typeof style["top"] === "number";
82
+ if (node.type === "group") {
83
+ const childNodes = node.children.filter((child) => child instanceof CommonNode);
84
+ if (isPositioned) {
85
+ const groupOriginX = style["left"];
86
+ const groupOriginY = style["top"];
87
+ if (originX !== 0 || originY !== 0) node.style({
88
+ left: groupOriginX - originX,
89
+ top: groupOriginY - originY
90
+ });
91
+ relativizeToContainingBlock(childNodes, groupOriginX, groupOriginY);
92
+ } else relativizeToContainingBlock(childNodes, originX, originY);
93
+ continue;
94
+ }
95
+ if (isPositioned && (originX !== 0 || originY !== 0)) node.style({
96
+ left: style["left"] - originX,
97
+ top: style["top"] - originY
98
+ });
99
+ }
100
+ }
101
+ function readGroupSpSlideSpace(context, parentMapper) {
102
+ const { cursor, part, slideIndex } = context;
103
+ const diagnostics = [];
104
+ const nvGrpSpPr = cursor.child(P_NS, "nvGrpSpPr");
105
+ if (nvGrpSpPr === void 0) {
106
+ diagnostics.push({
107
+ code: "corrupt-part",
108
+ category: "corrupt-input",
109
+ disposition: "omitted",
110
+ location: {
111
+ part,
112
+ xpath: cursor.xpath,
113
+ slideIndex
114
+ }
115
+ });
116
+ return { diagnostics };
117
+ }
118
+ const cNvPr = nvGrpSpPr.child(P_NS, "cNvPr");
119
+ const { objectId, objectName, link, deferredSlideLink } = readNonVisualCommonProperties(cNvPr, context, diagnostics);
120
+ nvGrpSpPr.ignoreEmptyChild(P_NS, "cNvGrpSpPr");
121
+ consumeNonPlaceholderNvPr(nvGrpSpPr);
122
+ const location = {
123
+ part,
124
+ slideIndex,
125
+ ...objectId === void 0 ? {} : { objectId },
126
+ ...objectName === void 0 ? {} : { objectName }
127
+ };
128
+ const grpSpPr = cursor.child(P_NS, "grpSpPr");
129
+ if (grpSpPr === void 0) {
130
+ diagnostics.push({
131
+ code: "corrupt-part",
132
+ category: "corrupt-input",
133
+ disposition: "omitted",
134
+ location: {
135
+ ...location,
136
+ xpath: cursor.xpath
137
+ }
138
+ });
139
+ return { diagnostics };
140
+ }
141
+ const xfrm = grpSpPr.child(A_NS, "xfrm");
142
+ const off = xfrm?.child(A_NS, "off");
143
+ const ext = xfrm?.child(A_NS, "ext");
144
+ const chOff = xfrm?.child(A_NS, "chOff");
145
+ const chExt = xfrm?.child(A_NS, "chExt");
146
+ if (xfrm === void 0 || off === void 0 || ext === void 0 || chOff === void 0 || chExt === void 0) {
147
+ diagnostics.push({
148
+ code: "corrupt-part",
149
+ category: "corrupt-input",
150
+ disposition: "omitted",
151
+ location: {
152
+ ...location,
153
+ xpath: grpSpPr.xpath
154
+ }
155
+ });
156
+ return { diagnostics };
157
+ }
158
+ const parsedXfrm = transformAttributesFragmentSchema.safeParse(xfrm.attrsObject([
159
+ "rot",
160
+ "flipH",
161
+ "flipV"
162
+ ]));
163
+ const parsedOff = offsetEmuFragmentSchema.safeParse(off.attrsObject(["x", "y"]));
164
+ const parsedExt = extentEmuFragmentSchema.safeParse(ext.attrsObject(["cx", "cy"]));
165
+ const parsedChOff = offsetEmuFragmentSchema.safeParse(chOff.attrsObject(["x", "y"]));
166
+ const parsedChExt = extentEmuFragmentSchema.safeParse(chExt.attrsObject(["cx", "cy"]));
167
+ if (!parsedOff.success || !parsedExt.success || !parsedChOff.success || !parsedChExt.success) {
168
+ diagnostics.push({
169
+ code: "invalid-xml-value",
170
+ category: "corrupt-input",
171
+ disposition: "omitted",
172
+ location: {
173
+ ...location,
174
+ xpath: xfrm.xpath
175
+ },
176
+ attributeOrElement: "a:xfrm"
177
+ });
178
+ return { diagnostics };
179
+ }
180
+ const flipH = parsedXfrm.success && parsedXfrm.data.flipH === true;
181
+ const flipV = parsedXfrm.success && parsedXfrm.data.flipV === true;
182
+ const rotate = parsedXfrm.success && parsedXfrm.data.rot !== void 0 && parsedXfrm.data.rot !== 0 ? parsedXfrm.data.rot / 6e4 : void 0;
183
+ const offX = emuToPx(parsedOff.data.x);
184
+ const offY = emuToPx(parsedOff.data.y);
185
+ const extW = emuToPx(parsedExt.data.cx);
186
+ const extH = emuToPx(parsedExt.data.cy);
187
+ const chX = emuToPx(parsedChOff.data.x);
188
+ const chY = emuToPx(parsedChOff.data.y);
189
+ const chW = emuToPx(parsedChExt.data.cx);
190
+ const chH = emuToPx(parsedChExt.data.cy);
191
+ const scaleX = chW > 0 ? extW / chW : 1;
192
+ const scaleY = chH > 0 ? extH / chH : 1;
193
+ grpSpPr.ignoreEmptyChild(A_NS, "noFill");
194
+ grpSpPr.ignoreEmptyChild(A_NS, "effectLst");
195
+ for (const extraChild of grpSpPr.remainingElementChildren()) diagnostics.push({
196
+ code: "unsupported-mechanism",
197
+ category: "unsupported",
198
+ disposition: "omitted",
199
+ location: {
200
+ ...location,
201
+ xpath: extraChild.xpath
202
+ },
203
+ namespaceUri: extraChild.namespaceUri,
204
+ localName: extraChild.localName,
205
+ mechanismHint: `group:${extraChild.localName}`
206
+ });
207
+ const memberMapper = (box) => parentMapper({
208
+ x: offX + (box.x - chX) * scaleX,
209
+ y: offY + (box.y - chY) * scaleY,
210
+ width: box.width * scaleX,
211
+ height: box.height * scaleY
212
+ });
213
+ const members = [];
214
+ const groupObjectsBySpid = /* @__PURE__ */ new Map();
215
+ const groupOmittedSpids = /* @__PURE__ */ new Map();
216
+ const groupUsedAuthorIds = /* @__PURE__ */ new Set();
217
+ const groupDeferredConnectors = [];
218
+ const recordGroupOmission = (spid, name, reason = "corrupt") => {
219
+ if (spid !== void 0) groupOmittedSpids.set(spid, {
220
+ ...name === void 0 ? {} : { objectName: name },
221
+ reason
222
+ });
223
+ };
224
+ const recordGroupMember = (spid, memberName, memberNode, memberXpath) => {
225
+ const memberBox = nodeBoundsPx(memberNode);
226
+ if (memberBox !== void 0 && !isValidMappedBox(memberBox, memberNode.type === "line")) {
227
+ diagnostics.push({
228
+ code: "invalid-xml-value",
229
+ category: "corrupt-input",
230
+ disposition: "omitted",
231
+ location: {
232
+ ...location,
233
+ xpath: memberXpath
234
+ },
235
+ attributeOrElement: "a:xfrm"
236
+ });
237
+ recordGroupOmission(spid, memberName);
238
+ return;
239
+ }
240
+ if (spid !== void 0) {
241
+ context.registerImportedObject?.(spid, memberNode);
242
+ groupObjectsBySpid.set(spid, memberNode);
243
+ }
244
+ const authorId = memberNode.props["id"];
245
+ if (typeof authorId === "string" && authorId.length > 0) groupUsedAuthorIds.add(authorId);
246
+ members.push(memberNode);
247
+ };
248
+ for (const childCursor of cursor.remainingElementChildren()) {
249
+ if (childCursor.namespaceUri !== "http://schemas.openxmlformats.org/presentationml/2006/main") {
250
+ diagnostics.push({
251
+ code: "unsupported-mechanism",
252
+ category: "unsupported",
253
+ disposition: "omitted",
254
+ location: {
255
+ ...location,
256
+ xpath: childCursor.xpath
257
+ },
258
+ namespaceUri: childCursor.namespaceUri,
259
+ localName: childCursor.localName
260
+ });
261
+ continue;
262
+ }
263
+ const childContext = {
264
+ ...context,
265
+ cursor: childCursor,
266
+ mapBox: memberMapper,
267
+ registerDeferredConnector: (resolve) => {
268
+ groupDeferredConnectors.push(resolve);
269
+ }
270
+ };
271
+ const outcome = childCursor.localName === "grpSp" ? readGroupSpSlideSpace(childContext, memberMapper) : context.readGroupMember?.(childContext);
272
+ const identity = peekShapeTreeObjectIdentity(childCursor.element);
273
+ if (outcome === void 0) {
274
+ diagnostics.push({
275
+ code: "unsupported-mechanism",
276
+ category: "unsupported",
277
+ disposition: "omitted",
278
+ location: {
279
+ ...location,
280
+ xpath: childCursor.xpath
281
+ },
282
+ namespaceUri: childCursor.namespaceUri,
283
+ localName: childCursor.localName
284
+ });
285
+ recordGroupOmission(identity.objectId, identity.objectName, "unsupported");
286
+ childCursor.suppressUnconsumed();
287
+ continue;
288
+ }
289
+ if (outcome.diagnostics !== void 0) diagnostics.push(...outcome.diagnostics);
290
+ if (outcome.node === void 0) {
291
+ recordGroupOmission(identity.objectId, identity.objectName);
292
+ continue;
293
+ }
294
+ if (outcome.node.type === "image" || outcome.node.type === "text") applyMemberMapper(outcome.node, memberMapper);
295
+ recordGroupMember(identity.objectId, identity.objectName, outcome.node, childCursor.xpath);
296
+ }
297
+ if (members.length === 0) {
298
+ if (diagnostics.length === 0) diagnostics.push({
299
+ code: "corrupt-part",
300
+ category: "corrupt-input",
301
+ disposition: "omitted",
302
+ location: {
303
+ ...location,
304
+ xpath: cursor.xpath
305
+ }
306
+ });
307
+ return { diagnostics };
308
+ }
309
+ const mappedGroupBox = parentMapper({
310
+ x: offX,
311
+ y: offY,
312
+ width: extW,
313
+ height: extH
314
+ });
315
+ const unionPx = memberUnionPx(members);
316
+ if (unionPx !== void 0 && !isValidMappedBox(unionPx, false) || !isValidMappedBox(mappedGroupBox, true)) {
317
+ if (!diagnostics.some((d) => d.disposition === "omitted")) diagnostics.push({
318
+ code: "invalid-xml-value",
319
+ category: "corrupt-input",
320
+ disposition: "omitted",
321
+ location: {
322
+ ...location,
323
+ xpath: cursor.xpath
324
+ },
325
+ attributeOrElement: cursor.localName,
326
+ rawValue: unionPx !== void 0 && pxToEmu(unionPx.width) < 1 ? "width=0" : unionPx !== void 0 && pxToEmu(unionPx.height) < 1 ? "height=0" : "bounds-overflow"
327
+ });
328
+ return { diagnostics };
329
+ }
330
+ const matchesMemberUnion = unionPx !== void 0 && Math.abs(mappedGroupBox.x - unionPx.x) <= .001 && Math.abs(mappedGroupBox.y - unionPx.y) <= .001 && Math.abs(mappedGroupBox.width - unionPx.width) <= .001 && Math.abs(mappedGroupBox.height - unionPx.height) <= .001;
331
+ const isPositionedGroup = pxToEmu(mappedGroupBox.width) > 0 && pxToEmu(mappedGroupBox.height) > 0 && !matchesMemberUnion;
332
+ if (groupDeferredConnectors.length > 0) {
333
+ const scopeContext = {
334
+ scopeObjectsBySpid: groupObjectsBySpid,
335
+ omittedSpids: groupOmittedSpids,
336
+ usedAuthorIds: groupUsedAuthorIds,
337
+ diagnostics
338
+ };
339
+ for (const resolveConnector of groupDeferredConnectors) resolveConnector(scopeContext);
340
+ }
341
+ const groupStyle = {
342
+ ...isPositionedGroup ? {
343
+ position: "absolute",
344
+ left: mappedGroupBox.x,
345
+ top: mappedGroupBox.y,
346
+ width: mappedGroupBox.width,
347
+ height: mappedGroupBox.height
348
+ } : {},
349
+ ...rotate === void 0 ? {} : { rotate },
350
+ ...flipH ? { flipH: true } : {},
351
+ ...flipV ? { flipV: true } : {}
352
+ };
353
+ const props = {
354
+ ...objectName === void 0 ? {} : { name: objectName },
355
+ ...link === void 0 ? {} : { link },
356
+ ...Object.keys(groupStyle).length === 0 ? {} : { style: groupStyle }
357
+ };
358
+ const node = createGroupNode(props);
359
+ node.append(...members);
360
+ attachDeferredSlideLink(node, deferredSlideLink, context);
361
+ return {
362
+ node,
363
+ diagnostics
364
+ };
365
+ }
366
+ /**
367
+ * Reads a Transitional `<p:grpSp>` recursively into an editable `GroupNode`,
368
+ * applying affine `(chOff, chExt) -> (off, ext)` coordinate mapping and
369
+ * converting positioned group descendants to containing-block-relative coordinates.
370
+ */
371
+ function readGroupSp(context, parentMapper = identityMapper) {
372
+ const outcome = readGroupSpSlideSpace(context, parentMapper);
373
+ if (outcome.node !== void 0 && parentMapper === identityMapper) relativizeToContainingBlock([outcome.node], 0, 0);
374
+ return outcome;
375
+ }
376
+ function isDiagramGraphicFrame(cursor) {
377
+ if (cursor.namespaceUri !== "http://schemas.openxmlformats.org/presentationml/2006/main" || cursor.localName !== "graphicFrame") return false;
378
+ const graphic = directElementChild(cursor.element, A_NS, "graphic");
379
+ if (graphic === void 0) return false;
380
+ return directElementChild(graphic, A_NS, "graphicData")?.getAttribute("uri") === DIAGRAM_NS;
381
+ }
382
+ function findDescendantByLocalName(root, namespaceUri, localName) {
383
+ for (let child = root.firstChild; child !== null; child = child.nextSibling) {
384
+ if (child.nodeType !== 1) continue;
385
+ const el = child;
386
+ if ((el.namespaceURI ?? "") === namespaceUri && (el.localName ?? el.tagName) === localName) return el;
387
+ const nested = findDescendantByLocalName(el, namespaceUri, localName);
388
+ if (nested !== void 0) return nested;
389
+ }
390
+ }
391
+ function resolveDiagramDrawingPartPath(cursor, context) {
392
+ const { package: pkg, part, relationships, relationshipEntries } = context;
393
+ if (relationships === void 0) return void 0;
394
+ const graphic = directElementChild(cursor.element, A_NS, "graphic");
395
+ const graphicData = graphic === void 0 ? void 0 : directElementChild(graphic, A_NS, "graphicData");
396
+ const dmRelId = (graphicData === void 0 ? void 0 : directElementChild(graphicData, "http://schemas.openxmlformats.org/drawingml/2006/diagram", "relIds"))?.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "dm") || void 0;
397
+ if (dmRelId !== void 0) {
398
+ const dataRel = relationships.get(dmRelId);
399
+ if (dataRel !== void 0 && dataRel.Type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData" && dataRel.TargetMode !== "External") {
400
+ const dataPartPath = resolvePartPath(part, dataRel.Target);
401
+ const dataXml = dataPartPath === void 0 ? void 0 : pkg.readTextPart(dataPartPath);
402
+ if (dataPartPath !== void 0 && dataXml !== void 0) try {
403
+ const drawingRelId = findDescendantByLocalName(parseXmlPart(dataPartPath, dataXml), "http://schemas.microsoft.com/office/drawing/2008/diagram", "dataModelExt")?.getAttribute("relId") ?? void 0;
404
+ if (drawingRelId !== void 0 && drawingRelId !== "") {
405
+ const drawingRel = relationships.get(drawingRelId);
406
+ if (drawingRel !== void 0 && drawingRel.Type === "http://schemas.microsoft.com/office/2007/relationships/diagramDrawing" && drawingRel.TargetMode !== "External") return resolvePartPath(part, drawingRel.Target);
407
+ }
408
+ return;
409
+ } catch {}
410
+ }
411
+ }
412
+ const dataRels = (relationshipEntries ?? []).filter((entry) => entry.Type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData" && entry.TargetMode !== "External");
413
+ const singleDrawingRels = (relationshipEntries ?? []).filter((entry) => entry.Type === "http://schemas.microsoft.com/office/2007/relationships/diagramDrawing" && entry.TargetMode !== "External");
414
+ if (dataRels.length <= 1 && singleDrawingRels.length === 1) return resolvePartPath(part, singleDrawingRels[0].Target);
415
+ }
416
+ function cloneDiagramNodeAsPresentation(source, isRootSpTree) {
417
+ const doc = source.ownerDocument;
418
+ const ns = source.namespaceURI ?? "";
419
+ const local = source.localName ?? source.tagName;
420
+ const isDsp = ns === DSP_NS;
421
+ const targetNs = isDsp ? P_NS : ns;
422
+ const targetQualified = isDsp ? `p:${isDsp && isRootSpTree && local === "spTree" ? "grpSp" : local}` : source.tagName;
423
+ const cloned = targetNs === "" ? doc.createElement(targetQualified) : doc.createElementNS(targetNs, targetQualified);
424
+ for (let i = 0; i < source.attributes.length; i += 1) {
425
+ const attr = source.attributes.item(i);
426
+ if (attr === null) continue;
427
+ const attrNs = attr.namespaceURI ?? "";
428
+ if (attrNs === "http://www.w3.org/2000/xmlns/" || attr.name === "xmlns" || attr.prefix === "xmlns") continue;
429
+ const attrLocal = attr.localName ?? attr.name;
430
+ if (isDsp && attrLocal === "modelId" && attrNs === "") continue;
431
+ if (attrNs === "") cloned.setAttribute(attrLocal, attr.value);
432
+ else cloned.setAttributeNS(attrNs, attr.name, attr.value);
433
+ }
434
+ for (let child = source.firstChild; child !== null; child = child.nextSibling) {
435
+ if (child.nodeType === 3 || child.nodeType === 4) {
436
+ cloned.appendChild(doc.createTextNode(child.nodeValue ?? ""));
437
+ continue;
438
+ }
439
+ if (child.nodeType !== 1) continue;
440
+ const childEl = child;
441
+ const childNs = childEl.namespaceURI ?? "";
442
+ const childLocal = childEl.localName ?? childEl.tagName;
443
+ if (childNs === "http://schemas.microsoft.com/office/drawing/2008/diagram" && (childLocal === "style" || childLocal === "txXfrm")) continue;
444
+ cloned.appendChild(cloneDiagramNodeAsPresentation(childEl, false));
445
+ }
446
+ return cloned;
447
+ }
448
+ function appendOrPopulateGroupXfrm(grpSp, frameTransform, objectName) {
449
+ const doc = grpSp.ownerDocument;
450
+ let nvGrpSpPr = directElementChild(grpSp, P_NS, "nvGrpSpPr");
451
+ if (nvGrpSpPr === void 0) {
452
+ nvGrpSpPr = doc.createElementNS(P_NS, "p:nvGrpSpPr");
453
+ grpSp.insertBefore(nvGrpSpPr, grpSp.firstChild);
454
+ }
455
+ let cNvPr = directElementChild(nvGrpSpPr, P_NS, "cNvPr");
456
+ if (cNvPr === void 0) {
457
+ cNvPr = doc.createElementNS(P_NS, "p:cNvPr");
458
+ cNvPr.setAttribute("id", "0");
459
+ cNvPr.setAttribute("name", objectName ?? "");
460
+ nvGrpSpPr.insertBefore(cNvPr, nvGrpSpPr.firstChild);
461
+ } else if (objectName !== void 0 && (cNvPr.getAttribute("name") ?? "").trim() === "") cNvPr.setAttribute("name", objectName);
462
+ if (directElementChild(nvGrpSpPr, "http://schemas.openxmlformats.org/presentationml/2006/main", "cNvGrpSpPr") === void 0) nvGrpSpPr.appendChild(doc.createElementNS(P_NS, "p:cNvGrpSpPr"));
463
+ if (directElementChild(nvGrpSpPr, "http://schemas.openxmlformats.org/presentationml/2006/main", "nvPr") === void 0) nvGrpSpPr.appendChild(doc.createElementNS(P_NS, "p:nvPr"));
464
+ let grpSpPr = directElementChild(grpSp, P_NS, "grpSpPr");
465
+ if (grpSpPr === void 0) {
466
+ grpSpPr = doc.createElementNS(P_NS, "p:grpSpPr");
467
+ grpSp.appendChild(grpSpPr);
468
+ }
469
+ const existingXfrm = directElementChild(grpSpPr, A_NS, "xfrm");
470
+ if (existingXfrm !== void 0 && directElementChild(existingXfrm, "http://schemas.openxmlformats.org/drawingml/2006/main", "off") !== void 0 && directElementChild(existingXfrm, "http://schemas.openxmlformats.org/drawingml/2006/main", "ext") !== void 0 && directElementChild(existingXfrm, "http://schemas.openxmlformats.org/drawingml/2006/main", "chOff") !== void 0 && directElementChild(existingXfrm, "http://schemas.openxmlformats.org/drawingml/2006/main", "chExt") !== void 0) return true;
471
+ if (existingXfrm !== void 0) grpSpPr.removeChild(existingXfrm);
472
+ const xfrm = doc.createElementNS(A_NS, "a:xfrm");
473
+ if (frameTransform.rotate !== void 0 && frameTransform.rotate !== 0) xfrm.setAttribute("rot", String(Math.round(frameTransform.rotate * 6e4)));
474
+ if (frameTransform.flipH) xfrm.setAttribute("flipH", "1");
475
+ if (frameTransform.flipV) xfrm.setAttribute("flipV", "1");
476
+ const off = doc.createElementNS(A_NS, "a:off");
477
+ off.setAttribute("x", String(frameTransform.xEmu));
478
+ off.setAttribute("y", String(frameTransform.yEmu));
479
+ const ext = doc.createElementNS(A_NS, "a:ext");
480
+ ext.setAttribute("cx", String(frameTransform.cxEmu));
481
+ ext.setAttribute("cy", String(frameTransform.cyEmu));
482
+ const chOff = doc.createElementNS(A_NS, "a:chOff");
483
+ chOff.setAttribute("x", "0");
484
+ chOff.setAttribute("y", "0");
485
+ const chExt = doc.createElementNS(A_NS, "a:chExt");
486
+ chExt.setAttribute("cx", String(frameTransform.cxEmu));
487
+ chExt.setAttribute("cy", String(frameTransform.cyEmu));
488
+ xfrm.appendChild(off);
489
+ xfrm.appendChild(ext);
490
+ xfrm.appendChild(chOff);
491
+ xfrm.appendChild(chExt);
492
+ grpSpPr.insertBefore(xfrm, grpSpPr.firstChild);
493
+ return false;
494
+ }
495
+ /**
496
+ * Recovers an external SmartArt `<p:graphicFrame>` (`DIAGRAM_NS`) as a native editable `Group`
497
+ * when its pre-computed `ppt/diagrams/drawing*.xml` cache is readable and non-empty.
498
+ */
499
+ function readDiagramGraphicFrame(context) {
500
+ const { cursor, part, slideIndex, package: pkg } = context;
501
+ const identity = peekShapeTreeObjectIdentity(cursor.element);
502
+ const omitUnsupported = () => {
503
+ const frameInfo = inspectUnsupportedGraphicFrame(cursor, part, context.relationships ?? /* @__PURE__ */ new Map(), context.relationshipEntries ?? []);
504
+ cursor.suppressUnconsumed();
505
+ return { diagnostics: [{
506
+ code: "unsupported-mechanism",
507
+ category: "unsupported",
508
+ disposition: "omitted",
509
+ location: {
510
+ part,
511
+ xpath: cursor.xpath,
512
+ slideIndex,
513
+ ...identity
514
+ },
515
+ namespaceUri: cursor.namespaceUri,
516
+ localName: cursor.localName,
517
+ ...frameInfo.mechanismHint === void 0 ? {} : { mechanismHint: frameInfo.mechanismHint },
518
+ ...frameInfo.cascaded.length === 0 ? {} : { cascaded: frameInfo.cascaded }
519
+ }] };
520
+ };
521
+ const drawingPartPath = resolveDiagramDrawingPartPath(cursor, context);
522
+ const drawingXml = drawingPartPath === void 0 ? void 0 : pkg.readTextPart(drawingPartPath);
523
+ if (drawingPartPath === void 0 || drawingXml === void 0) return omitUnsupported();
524
+ let drawingRootEl;
525
+ try {
526
+ drawingRootEl = parseXmlPart(drawingPartPath, drawingXml);
527
+ } catch {
528
+ return omitUnsupported();
529
+ }
530
+ if ((drawingRootEl.namespaceURI ?? "") !== "http://schemas.microsoft.com/office/drawing/2008/diagram" || (drawingRootEl.localName ?? drawingRootEl.tagName) !== "drawing") return omitUnsupported();
531
+ const dspSpTree = directElementChild(drawingRootEl, DSP_NS, "spTree");
532
+ if (dspSpTree === void 0) return omitUnsupported();
533
+ const diagnostics = [];
534
+ const nvGraphicFramePr = cursor.child(P_NS, "nvGraphicFramePr");
535
+ let clickResult;
536
+ const cNvPr = nvGraphicFramePr?.child(P_NS, "cNvPr");
537
+ if (cNvPr !== void 0) {
538
+ cNvPr.attrsObject(["id", "name"]);
539
+ const hlinkClick = cNvPr.child(A_NS, "hlinkClick");
540
+ if (hlinkClick !== void 0) {
541
+ clickResult = readClickLink(hlinkClick, context, identity);
542
+ diagnostics.push(...clickResult.diagnostics);
543
+ }
544
+ }
545
+ const xfrmCursor = cursor.child(P_NS, "xfrm");
546
+ if (xfrmCursor === void 0) return omitUnsupported();
547
+ const frameTransform = readTransformXml(xfrmCursor, {
548
+ part,
549
+ xpath: xfrmCursor.xpath,
550
+ slideIndex,
551
+ ...identity
552
+ }, diagnostics);
553
+ if (frameTransform === void 0) return omitUnsupported();
554
+ const clonedGrpSp = cloneDiagramNodeAsPresentation(dspSpTree, true);
555
+ const hadOwnXfrm = appendOrPopulateGroupXfrm(clonedGrpSp, frameTransform, identity.objectName);
556
+ const drawingRelIndex = buildRelationshipIndex(pkg, drawingPartPath);
557
+ diagnostics.push(...drawingRelIndex.diagnostics);
558
+ const grpCursor = XmlElementCursor.createRoot(clonedGrpSp, drawingPartPath, "/dsp:drawing/dsp:spTree");
559
+ const parentMapper = hadOwnXfrm ? (box) => ({
560
+ x: frameTransform.x + box.x,
561
+ y: frameTransform.y + box.y,
562
+ width: box.width,
563
+ height: box.height
564
+ }) : identityMapper;
565
+ const { registerImportedObject: _ignoredReg, claimedPlaceholderKeys: _ignoredClaimed, ...restContext } = context;
566
+ const outcome = readGroupSpSlideSpace({
567
+ ...restContext,
568
+ cursor: grpCursor,
569
+ part: drawingPartPath,
570
+ relationships: drawingRelIndex.byId,
571
+ relationshipEntries: drawingRelIndex.entries
572
+ }, parentMapper);
573
+ if (outcome.diagnostics !== void 0) diagnostics.push(...outcome.diagnostics);
574
+ if (outcome.node === void 0) return omitUnsupported();
575
+ relativizeToContainingBlock([outcome.node], 0, 0);
576
+ if (clickResult?.link !== void 0) outcome.node.set({ link: clickResult.link });
577
+ attachDeferredSlideLink(outcome.node, clickResult?.deferredSlideLink, context);
578
+ cursor.suppressUnconsumed();
579
+ diagnostics.push({
580
+ code: "compatibility-fallback",
581
+ category: "unsupported",
582
+ disposition: "fallback",
583
+ location: {
584
+ part,
585
+ xpath: cursor.xpath,
586
+ slideIndex,
587
+ ...identity
588
+ },
589
+ preferredMechanism: DIAGRAM_NS,
590
+ selectedFallback: "group",
591
+ loss: {
592
+ lost: "native-mechanism",
593
+ retainedAs: "group"
594
+ }
595
+ });
596
+ return {
597
+ node: outcome.node,
598
+ diagnostics
599
+ };
600
+ }
601
+ const groupImportHandler = {
602
+ target: "shape-tree",
603
+ localName: "grpSp",
604
+ alternateLocalNames: ["graphicFrame"],
605
+ matches: (cursor) => cursor.localName === "grpSp" || isDiagramGraphicFrame(cursor),
606
+ read: (context) => context.cursor.localName === "graphicFrame" ? readDiagramGraphicFrame(context) : readGroupSp(context)
607
+ };
608
+ export { groupImportHandler, readGroupSp };
@@ -1,7 +1,8 @@
1
- // ../capabilities/dist/group/group-xml.js
1
+ // ../core/dist/capabilities/group/group-xml.js
2
2
  /** Internal PresentationML wrapper for native groups; member baselines stay in slide coordinates. */
3
- function groupXml(id, escapedName, box, members, rotation, linkXml) {
3
+ function groupXml(id, escapedName, box, members, rotation, linkXml, flipH = false, flipV = false) {
4
4
  const angle = rotation === void 0 ? void 0 : Math.round((rotation % 360 + 360) % 360 * 6e4);
5
- return `<p:grpSp><p:nvGrpSpPr><p:cNvPr id="${id}" name="${escapedName}">${linkXml}</p:cNvPr><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm${angle === void 0 || angle === 0 ? "" : ` rot="${angle}"`}><a:off x="${box.x}" y="${box.y}"/><a:ext cx="${box.width}" cy="${box.height}"/><a:chOff x="${box.x}" y="${box.y}"/><a:chExt cx="${box.width}" cy="${box.height}"/></a:xfrm></p:grpSpPr>${members}</p:grpSp>`;
5
+ const flipAttrs = `${flipH ? " flipH=\"1\"" : ""}${flipV ? " flipV=\"1\"" : ""}`;
6
+ return `<p:grpSp><p:nvGrpSpPr><p:cNvPr id="${id}" name="${escapedName}">${linkXml}</p:cNvPr><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm${angle === void 0 || angle === 0 ? "" : ` rot="${angle}"`}${flipAttrs}><a:off x="${box.x}" y="${box.y}"/><a:ext cx="${box.width}" cy="${box.height}"/><a:chOff x="${box.x}" y="${box.y}"/><a:chExt cx="${box.width}" cy="${box.height}"/></a:xfrm></p:grpSpPr>${members}</p:grpSp>`;
6
7
  }
7
8
  export { groupXml };