@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,251 @@
1
+ import { emuToPx } from "../drawing-units.js";
2
+ import { maximumParagraphIndentEmu, placeholderLevelStyleSchema } from "../placeholders.js";
3
+ import { A_NS } from "./namespaces.js";
4
+ import { cascadeOoxmlTextDecoration, normalizeBulletCharacter, ooxmlAutoNumStartAtSchema, ooxmlBoolSchema, ooxmlIntSchema, ooxmlLineSpacingPercentSchema, ooxmlLineSpacingPointsSchema, ooxmlListLevelSchema, ooxmlNonNegativeIntSchema, ooxmlParagraphSpacingPointsSchema, ooxmlWritableExtentEmuSchema, ooxmlWritableInt32CoordEmuSchema } from "./xml-fragments.js";
5
+ import { XmlElementCursor } from "./xml-reader.js";
6
+ import { z } from "zod";
7
+ // ../core/dist/kernel/pptx-read/drawing-list-import.js
8
+ const alignments = {
9
+ l: "left",
10
+ ctr: "center",
11
+ r: "right",
12
+ just: "justify"
13
+ };
14
+ function readAttribute(cursor, name, schema, location, diagnostics, required = false) {
15
+ const raw = cursor.attr(name);
16
+ if (raw === void 0 && !required) return void 0;
17
+ const parsed = schema.safeParse(raw);
18
+ if (parsed.success) return parsed.data;
19
+ diagnostics.push({
20
+ code: "invalid-xml-value",
21
+ category: "corrupt-input",
22
+ disposition: "omitted",
23
+ location: {
24
+ ...location,
25
+ xpath: `${cursor.xpath}/@${name}`
26
+ },
27
+ attributeOrElement: `@${name}`,
28
+ rawValue: raw ?? ""
29
+ });
30
+ }
31
+ /** Reads the paragraph geometry shared by chart text and regular DrawingML text. */
32
+ function readDrawingParagraphLayout(pPr, location, diagnostics) {
33
+ const alignValue = readAttribute(pPr, "algn", z.enum([
34
+ "l",
35
+ "ctr",
36
+ "r",
37
+ "just"
38
+ ]), location, diagnostics);
39
+ const align = alignValue === void 0 ? void 0 : alignments[alignValue];
40
+ const line = pPr.child(A_NS, "lnSpc");
41
+ const linePoints = line?.child(A_NS, "spcPts");
42
+ const linePercent = line?.child(A_NS, "spcPct");
43
+ let lineHeight;
44
+ if (linePoints !== void 0) {
45
+ const points = readAttribute(linePoints, "val", ooxmlLineSpacingPointsSchema, location, diagnostics, true);
46
+ if (points !== void 0) lineHeight = `${points / 100}pt`;
47
+ } else if (linePercent !== void 0) {
48
+ const percent = readAttribute(linePercent, "val", ooxmlLineSpacingPercentSchema, location, diagnostics, true);
49
+ if (percent !== void 0) lineHeight = `${percent / 1e3}%`;
50
+ }
51
+ const afterPoints = pPr.child(A_NS, "spcAft")?.child(A_NS, "spcPts");
52
+ const pointsAfter = afterPoints === void 0 ? void 0 : readAttribute(afterPoints, "val", ooxmlParagraphSpacingPointsSchema, location, diagnostics, true);
53
+ return {
54
+ ...align === void 0 ? {} : { align },
55
+ ...lineHeight === void 0 ? {} : { lineHeight },
56
+ ...pointsAfter === void 0 ? {} : { spacingAfter: pointsAfter / 75 }
57
+ };
58
+ }
59
+ function readDrawingParagraphProperties(pPr, location, diagnostics, readRun, options) {
60
+ const attr = (name, schema) => readAttribute(pPr, name, schema, location, diagnostics);
61
+ const layout = readDrawingParagraphLayout(pPr, location, diagnostics);
62
+ const level = attr("lvl", ooxmlListLevelSchema);
63
+ const marginEmu = attr("marL", ooxmlWritableExtentEmuSchema.refine((value) => value <= maximumParagraphIndentEmu));
64
+ const indentEmu = attr("indent", ooxmlWritableInt32CoordEmuSchema.refine((value) => Math.abs(value) <= maximumParagraphIndentEmu));
65
+ if (options?.listStyle && !options.placeholder) {
66
+ const reportUnsupported = (name) => {
67
+ diagnostics.push({
68
+ code: "unsupported-mechanism",
69
+ category: "unsupported",
70
+ disposition: "omitted",
71
+ location: {
72
+ ...location,
73
+ xpath: `${pPr.xpath}/@${name}`
74
+ },
75
+ namespaceUri: A_NS,
76
+ localName: name,
77
+ mechanismHint: "list-style"
78
+ });
79
+ };
80
+ for (const [name, defaultValue] of [
81
+ ["rtl", false],
82
+ ["eaLnBrk", true],
83
+ ["latinLnBrk", true],
84
+ ["hangingPunct", false]
85
+ ]) {
86
+ const value = attr(name, ooxmlBoolSchema);
87
+ if (value !== void 0 && value !== defaultValue) reportUnsupported(name);
88
+ }
89
+ const fontAlignment = attr("fontAlgn", z.enum([
90
+ "auto",
91
+ "t",
92
+ "ctr",
93
+ "base",
94
+ "b"
95
+ ]));
96
+ if (fontAlignment !== void 0 && fontAlignment !== "base") reportUnsupported("fontAlgn");
97
+ if (attr("defTabSz", z.union([ooxmlIntSchema.refine((value) => value >= -2147483648 && value <= 2147483647), z.string().regex(/^-?[0-9]+(?:\.[0-9]+)?(?:mm|cm|in|pt|pc|pi)$/u)])) !== void 0) reportUnsupported("defTabSz");
98
+ } else {
99
+ attr("rtl", ooxmlBoolSchema);
100
+ pPr.attrsObject([
101
+ "fontAlgn",
102
+ "eaLnBrk",
103
+ "latinLnBrk",
104
+ "hangingPunct",
105
+ "defTabSz"
106
+ ]);
107
+ }
108
+ const spacingBeforeNode = pPr.child(A_NS, "spcBef");
109
+ const beforePoints = spacingBeforeNode?.child(A_NS, "spcPts");
110
+ if (!options?.listStyle || options.placeholder) spacingBeforeNode?.child(A_NS, "spcPct")?.consumeAttr("val");
111
+ const before = beforePoints === void 0 ? void 0 : readAttribute(beforePoints, "val", ooxmlParagraphSpacingPointsSchema, location, diagnostics, true);
112
+ if (beforePoints !== void 0 && options?.listStyle && !options.placeholder) diagnostics.push({
113
+ code: "unsupported-mechanism",
114
+ category: "unsupported",
115
+ disposition: "omitted",
116
+ location: {
117
+ ...location,
118
+ xpath: spacingBeforeNode.xpath
119
+ },
120
+ namespaceUri: A_NS,
121
+ localName: "spcBef",
122
+ mechanismHint: "paragraph-spacing-before"
123
+ });
124
+ const afterPercent = pPr.child(A_NS, "spcAft")?.child(A_NS, "spcPct");
125
+ const percentAfter = afterPercent === void 0 ? void 0 : readAttribute(afterPercent, "val", ooxmlNonNegativeIntSchema, location, diagnostics, true);
126
+ const buNone = pPr.child(A_NS, "buNone") !== void 0;
127
+ pPr.child(A_NS, "buFont")?.attrsObject([
128
+ "typeface",
129
+ "pitchFamily",
130
+ "charset",
131
+ "panose"
132
+ ]);
133
+ const buChar = pPr.child(A_NS, "buChar");
134
+ const buAutoNum = pPr.child(A_NS, "buAutoNum");
135
+ let list;
136
+ if (buChar !== void 0) {
137
+ const raw = buChar.attr("char");
138
+ const normalized = normalizeBulletCharacter(raw);
139
+ if (normalized.recovered) diagnostics.push({
140
+ code: "invalid-xml-value",
141
+ category: "corrupt-input",
142
+ disposition: "recovered",
143
+ location: {
144
+ ...location,
145
+ xpath: buChar.xpath
146
+ },
147
+ attributeOrElement: "a:buChar/@char",
148
+ rawValue: raw ?? ""
149
+ });
150
+ list = {
151
+ type: "bullet",
152
+ character: normalized.character
153
+ };
154
+ } else if (buAutoNum !== void 0) {
155
+ const type = readAttribute(buAutoNum, "type", z.string().min(1), location, diagnostics, !options?.placeholder);
156
+ const startAt = readAttribute(buAutoNum, "startAt", ooxmlAutoNumStartAtSchema, location, diagnostics);
157
+ if (type !== void 0 || options?.placeholder) {
158
+ if (type !== void 0 && type !== "arabicPeriod" && !options?.placeholder) diagnostics.push({
159
+ code: "unsupported-mechanism",
160
+ category: "unsupported",
161
+ disposition: "omitted",
162
+ location: {
163
+ ...location,
164
+ xpath: buAutoNum.xpath
165
+ },
166
+ namespaceUri: A_NS,
167
+ localName: "buAutoNum",
168
+ mechanismHint: type
169
+ });
170
+ list = {
171
+ type: "number",
172
+ style: "arabicPeriod",
173
+ ...startAt === void 0 ? {} : { startAt }
174
+ };
175
+ }
176
+ }
177
+ const defRPr = pPr.child(A_NS, "defRPr");
178
+ const run = defRPr === void 0 ? void 0 : readRun(defRPr);
179
+ const style = {
180
+ ...run?.style,
181
+ ...layout,
182
+ ...before === void 0 || !options?.placeholder ? {} : { spacingBefore: before / 75 },
183
+ ...marginEmu === void 0 ? {} : { marginLeft: emuToPx(marginEmu) },
184
+ ...indentEmu === void 0 ? {} : { indent: emuToPx(indentEmu) },
185
+ ...list === void 0 ? {} : { list }
186
+ };
187
+ const valid = placeholderLevelStyleSchema.safeParse(style);
188
+ return {
189
+ style: valid.success ? valid.data : Object.fromEntries(Object.entries(style).filter(([key, value]) => placeholderLevelStyleSchema.safeParse({ [key]: value }).success)),
190
+ ...run?.decoration === void 0 ? {} : { decoration: run.decoration },
191
+ ...level === void 0 ? {} : { level },
192
+ ...buNone ? { buNone } : {},
193
+ ...layout.spacingAfter === void 0 && afterPercent !== void 0 && percentAfter !== void 0 ? { spacingAfterPercent: {
194
+ val: percentAfter,
195
+ xpath: afterPercent.xpath
196
+ } } : {}
197
+ };
198
+ }
199
+ /** Reads defaults and level-specific properties with scoped diagnostics for unsupported list XML. */
200
+ function readDrawingListStyles(container, location, diagnostics, readRun, placeholder = false) {
201
+ if (container === void 0) return void 0;
202
+ const list = XmlElementCursor.createRoot(container.element, container.part, container.xpath);
203
+ const read = (name) => {
204
+ const properties = list.child(A_NS, name);
205
+ return properties === void 0 ? void 0 : readDrawingParagraphProperties(properties, location, diagnostics, readRun, {
206
+ placeholder,
207
+ listStyle: true
208
+ });
209
+ };
210
+ const defaults = read("defPPr");
211
+ const levels = Array.from({ length: 9 }, (_, level) => cascadeDrawingParagraphProperties(defaults, read(`lvl${level + 1}pPr`), level));
212
+ container.suppressUnconsumed();
213
+ for (const item of list.collectUnconsumed()) diagnostics.push({
214
+ code: "unsupported-mechanism",
215
+ category: "unsupported",
216
+ disposition: "omitted",
217
+ location: {
218
+ ...location,
219
+ ...item.location
220
+ },
221
+ namespaceUri: item.namespaceUri,
222
+ localName: item.localName,
223
+ mechanismHint: "list-style"
224
+ });
225
+ return levels.some((level) => level.decoration !== void 0 || Object.keys(level.style).length > 0 || level.buNone || level.spacingAfterPercent !== void 0) ? levels : void 0;
226
+ }
227
+ /** Applies a paragraph property layer, including explicit clearing of an inherited list. */
228
+ function cascadeDrawingParagraphProperties(base, local, level) {
229
+ const { list: _baseList, spacingAfter: _baseSpacing, ...baseStyle } = base?.style ?? {};
230
+ const { list: _localList, spacingAfter: _localSpacing, ...localStyle } = local?.style ?? {};
231
+ const list = local?.buNone ? void 0 : local?.style.list ?? base?.style.list;
232
+ const buNone = local?.buNone ?? (local?.style.list === void 0 ? base?.buNone : void 0);
233
+ const spacing = local?.style.spacingAfter !== void 0 || local?.spacingAfterPercent !== void 0 ? local : base;
234
+ const spacingAfter = spacing?.style.spacingAfter;
235
+ const spacingAfterPercent = spacing?.spacingAfterPercent;
236
+ return {
237
+ style: {
238
+ ...baseStyle,
239
+ ...localStyle,
240
+ ...list === void 0 ? {} : { list: {
241
+ ...list,
242
+ ...level === 0 ? {} : { level }
243
+ } },
244
+ ...spacingAfter === void 0 ? {} : { spacingAfter }
245
+ },
246
+ ...base?.decoration === void 0 && local?.decoration === void 0 ? {} : { decoration: cascadeOoxmlTextDecoration(base?.decoration, local?.decoration) },
247
+ ...buNone ? { buNone } : {},
248
+ ...spacingAfterPercent === void 0 ? {} : { spacingAfterPercent }
249
+ };
250
+ }
251
+ export { cascadeDrawingParagraphProperties, readDrawingListStyles, readDrawingParagraphLayout, readDrawingParagraphProperties };
@@ -3,7 +3,7 @@ import { resolvePartPath } from "./opc.js";
3
3
  import { ooxmlBoolSchema, ooxmlIntSchema } from "./xml-fragments.js";
4
4
  import { XmlElementCursor, parseXmlPart } from "./xml-reader.js";
5
5
  import { z } from "zod";
6
- // ../import/dist/fonts.js
6
+ // ../core/dist/kernel/pptx-read/fonts.js
7
7
  const fontSlotNames = [
8
8
  "regular",
9
9
  "bold",
@@ -14,14 +14,19 @@ const presentationFontAttrSchema = z.object({
14
14
  embedTrueTypeFonts: ooxmlBoolSchema.optional(),
15
15
  saveSubsetFonts: ooxmlBoolSchema.optional()
16
16
  });
17
+ const reservedThemeFontPattern = /^(?:major|minor|\+(?:mj|mn)-)/iu;
18
+ function isAllowedThemeFontTypeface(value) {
19
+ const trimmed = value.trim();
20
+ return trimmed !== "" && !reservedThemeFontPattern.test(trimmed);
21
+ }
17
22
  const embeddedFontTypefaceXmlSchema = z.object({
18
- typeface: z.string().min(1),
23
+ typeface: z.string().min(1).refine(isAllowedThemeFontTypeface),
19
24
  pitchFamily: ooxmlIntSchema.optional(),
20
25
  charset: ooxmlIntSchema.optional(),
21
26
  panose: z.string().optional()
22
27
  });
23
28
  const embeddedFontSlotRefXmlSchema = z.object({ id: z.string().min(1) });
24
- const themeTypefaceXmlSchema = z.object({ typeface: z.string().min(1) });
29
+ const themeTypefaceXmlSchema = z.object({ typeface: z.string().min(1).refine(isAllowedThemeFontTypeface) });
25
30
  function isTrueTypeSfntHeader(bytes) {
26
31
  if (bytes.byteLength < 12) return false;
27
32
  const sig = String.fromCharCode(bytes[0], bytes[1], bytes[2], bytes[3]);
@@ -215,7 +220,7 @@ function readEmbeddedFontList(presentationCursor, presentationRels, pkg, diagnos
215
220
  * presentation -> slideMaster -> theme relationships so `+mj-lt` / `+mn-lt` tokens can link
216
221
  * to embedded font resources.
217
222
  */
218
- function readPresentationThemeFontScheme(pkg) {
223
+ function readPresentationThemeFontScheme(pkg, diagnostics) {
219
224
  const masterRel = pkg.presentationRels.find((rel) => rel.Type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" && rel.TargetMode !== "External");
220
225
  if (masterRel === void 0) return void 0;
221
226
  const masterPath = resolvePartPath(pkg.presentationPath, masterRel.Target);
@@ -233,18 +238,72 @@ function readPresentationThemeFontScheme(pkg) {
233
238
  return;
234
239
  }
235
240
  if ((themeEl.namespaceURI ?? "") !== "http://schemas.openxmlformats.org/drawingml/2006/main" || (themeEl.localName ?? themeEl.tagName) !== "theme") return;
236
- const themeCursor = XmlElementCursor.createRoot(themeEl, themePath);
241
+ const themeCursor = XmlElementCursor.createRoot(themeEl, themePath, "/a:theme");
237
242
  const themeName = themeCursor.attr("name");
238
243
  const fontScheme = themeCursor.child(A_NS, "themeElements")?.child(A_NS, "fontScheme");
239
244
  if (fontScheme === void 0) return void 0;
240
- const majorLatin = fontScheme.child(A_NS, "majorFont")?.child(A_NS, "latin")?.attrsObject(["typeface"]);
241
- const minorLatin = fontScheme.child(A_NS, "minorFont")?.child(A_NS, "latin")?.attrsObject(["typeface"]);
242
- const parsedMajor = themeTypefaceXmlSchema.safeParse(majorLatin);
243
- const parsedMinor = themeTypefaceXmlSchema.safeParse(minorLatin);
245
+ const readFontSlotTypeface = (slotCursor, elementTag) => {
246
+ const attrs = slotCursor?.attrsObject(["typeface"]);
247
+ const parsed = themeTypefaceXmlSchema.safeParse(attrs);
248
+ if (parsed.success) return parsed.data.typeface;
249
+ const rawTypeface = attrs?.["typeface"];
250
+ if (diagnostics !== void 0 && slotCursor !== void 0 && rawTypeface !== void 0 && rawTypeface.trim() !== "" && reservedThemeFontPattern.test(rawTypeface.trim())) {
251
+ const xpath = `${slotCursor.xpath}/@typeface`;
252
+ if (!diagnostics.some((existing) => existing.code === "invalid-xml-value" && existing.location.part === themePath && existing.attributeOrElement === `${elementTag}/@typeface` && existing.rawValue === rawTypeface && (existing.location.xpath === void 0 || existing.location.xpath === xpath))) diagnostics.push({
253
+ code: "invalid-xml-value",
254
+ category: "corrupt-input",
255
+ disposition: "omitted",
256
+ location: {
257
+ part: themePath,
258
+ xpath
259
+ },
260
+ attributeOrElement: `${elementTag}/@typeface`,
261
+ rawValue: rawTypeface
262
+ });
263
+ }
264
+ };
265
+ const majorFont = fontScheme.child(A_NS, "majorFont");
266
+ const minorFont = fontScheme.child(A_NS, "minorFont");
267
+ const majorTypeface = readFontSlotTypeface(majorFont?.child(A_NS, "latin"), "a:latin");
268
+ const minorTypeface = readFontSlotTypeface(minorFont?.child(A_NS, "latin"), "a:latin");
269
+ const majorEastAsianTypeface = readFontSlotTypeface(majorFont?.child(A_NS, "ea"), "a:ea");
270
+ const minorEastAsianTypeface = readFontSlotTypeface(minorFont?.child(A_NS, "ea"), "a:ea");
244
271
  return {
245
272
  ...themeName !== void 0 && themeName.trim() !== "" ? { themeName } : {},
246
- ...parsedMajor.success ? { majorTypeface: parsedMajor.data.typeface } : {},
247
- ...parsedMinor.success ? { minorTypeface: parsedMinor.data.typeface } : {}
273
+ ...majorTypeface === void 0 ? {} : { majorTypeface },
274
+ ...minorTypeface === void 0 ? {} : { minorTypeface },
275
+ ...majorEastAsianTypeface === void 0 ? {} : { majorEastAsianTypeface },
276
+ ...minorEastAsianTypeface === void 0 ? {} : { minorEastAsianTypeface }
277
+ };
278
+ }
279
+ function normalizeRunFontSlotTypeface(typeface) {
280
+ if (typeface === "+mj-lt" || typeface === "+mj-ea" || typeface === "+mj-cs") return "major";
281
+ if (typeface === "+mn-lt" || typeface === "+mn-ea" || typeface === "+mn-cs") return "minor";
282
+ return typeface;
283
+ }
284
+ /**
285
+ * Reads `<a:latin>`, `<a:ea>`, and `<a:cs>` font slots under `<a:rPr>` or `<a:defRPr>`,
286
+ * preserving orthogonal `eastAsianFontFamily` when `<a:ea>` differs from `<a:latin>` or appears alone.
287
+ */
288
+ function readRunFontSlots(rPrCursor) {
289
+ const readSlot = (cursor) => {
290
+ if (cursor === void 0) return void 0;
291
+ const typeface = cursor.attrsObject([
292
+ "typeface",
293
+ "pitchFamily",
294
+ "charset",
295
+ "panose"
296
+ ])["typeface"];
297
+ return typeface !== void 0 && typeface.trim() !== "" ? normalizeRunFontSlotTypeface(typeface) : void 0;
298
+ };
299
+ const latinToken = readSlot(rPrCursor.child(A_NS, "latin"));
300
+ const eaToken = readSlot(rPrCursor.child(A_NS, "ea"));
301
+ const csToken = readSlot(rPrCursor.child(A_NS, "cs"));
302
+ const fontFamily = latinToken ?? (eaToken === void 0 ? csToken : void 0);
303
+ const eastAsianFontFamily = eaToken !== void 0 && eaToken !== fontFamily ? eaToken : void 0;
304
+ return {
305
+ ...fontFamily === void 0 ? {} : { fontFamily },
306
+ ...eastAsianFontFamily === void 0 ? {} : { eastAsianFontFamily }
248
307
  };
249
308
  }
250
- export { readEmbeddedFontList, readPresentationThemeFontScheme, unpackEotFontData };
309
+ export { readEmbeddedFontList, readPresentationThemeFontScheme, readRunFontSlots, unpackEotFontData };
@@ -0,0 +1,15 @@
1
+ import { EMU_PER_PX, emuToPx } from "../drawing-units.js";
2
+ import { A_NS, C_NS, DIAGRAM_NS, DSP_NS, MC_NS, P14_CREATION_ID_EXT_URI, P14_NS, P159_NS, P_NS, REL_CHART, REL_DIAGRAM_DATA, REL_DIAGRAM_DRAWING, REL_HYPERLINK, REL_IMAGE, REL_NOTES_SLIDE, REL_SLIDE, R_NS, TABLE_NS_URI, XMLNS_NS, XML_NS, canonicalQName } from "./namespaces.js";
3
+ import "./alternate-content.js";
4
+ import { arrowTypeSchema, readBlipFill, readDrawingColor, readEffectList, readGradientFill, readLineBorder, readPlaceholderSpPrVisuals, readPlaceholderTransform, readRunFillAndStroke, readTransformXml } from "./visual.js";
5
+ import { ImportError, cascadedOmissionSchema, editabilityLossSchema, fatalImportIssueSchema, importDiagnosticSchema, importLocationSchema, importOptionsSchema, importReportSchema } from "./diagnostics.js";
6
+ import { readPartThemeOverride } from "./themes.js";
7
+ import { readEmbeddedFontList, readPresentationThemeFontScheme, readRunFontSlots, unpackEotFontData } from "./fonts.js";
8
+ import { resolvePartPath } from "./opc.js";
9
+ import { allocateScopedAuthorId, appendUnconsumedDiagnostics, consumeIdentityShapeTreeBoilerplate } from "./shape-tree.js";
10
+ import { buildRelationshipIndex, inspectUnsupportedGraphicFrame, peekShapeTreeObjectIdentity, resolveExternalRelationshipTarget, resolveInternalRelationshipTarget } from "./resources.js";
11
+ import { MAXIMUM_COORDINATE_PX, MAXIMUM_WRITABLE_EMU, cascadeOoxmlTextDecoration, extentEmuFragmentSchema, hexRgb6Schema, offsetEmuFragmentSchema, ooxmlBoolSchema, ooxmlIntSchema, ooxmlListLevelSchema, ooxmlNonNegativeIntSchema, ooxmlPlaceholderRoleSchema, ooxmlPositiveFixedAngleSchema, ooxmlPositiveIntSchema, ooxmlPositiveLineWidthEmuSchema, ooxmlWritableExtentEmuSchema, ooxmlWritablePositiveExtentEmuSchema, projectOoxmlTextDecoration, readOoxmlBoxInsets, readOoxmlRunAttrStyles, readOoxmlTextDecoration, reportOoxmlTextDecorationLoss, transformAttributesFragmentSchema } from "./xml-fragments.js";
12
+ import { defineCanvasMechanism, defineShowMechanism } from "./mechanism.js";
13
+ import { XmlElementCursor, parseXmlPart } from "./xml-reader.js";
14
+ import "./media.js";
15
+ export { A_NS, C_NS, DIAGRAM_NS, DSP_NS, EMU_PER_PX, ImportError, MAXIMUM_COORDINATE_PX, MAXIMUM_WRITABLE_EMU, MC_NS, P14_CREATION_ID_EXT_URI, P14_NS, P159_NS, P_NS, REL_CHART, REL_DIAGRAM_DATA, REL_DIAGRAM_DRAWING, REL_HYPERLINK, REL_IMAGE, REL_NOTES_SLIDE, REL_SLIDE, R_NS, TABLE_NS_URI, XMLNS_NS, XML_NS, XmlElementCursor, allocateScopedAuthorId, appendUnconsumedDiagnostics, arrowTypeSchema, buildRelationshipIndex, canonicalQName, cascadeOoxmlTextDecoration, cascadedOmissionSchema, consumeIdentityShapeTreeBoilerplate, defineCanvasMechanism, defineShowMechanism, editabilityLossSchema, emuToPx, extentEmuFragmentSchema, fatalImportIssueSchema, hexRgb6Schema, importDiagnosticSchema, importLocationSchema, importOptionsSchema, importReportSchema, inspectUnsupportedGraphicFrame, offsetEmuFragmentSchema, ooxmlBoolSchema, ooxmlIntSchema, ooxmlListLevelSchema, ooxmlNonNegativeIntSchema, ooxmlPlaceholderRoleSchema, ooxmlPositiveFixedAngleSchema, ooxmlPositiveIntSchema, ooxmlPositiveLineWidthEmuSchema, ooxmlWritableExtentEmuSchema, ooxmlWritablePositiveExtentEmuSchema, parseXmlPart, peekShapeTreeObjectIdentity, projectOoxmlTextDecoration, readBlipFill, readDrawingColor, readEffectList, readEmbeddedFontList, readGradientFill, readLineBorder, readOoxmlBoxInsets, readOoxmlRunAttrStyles, readOoxmlTextDecoration, readPartThemeOverride, readPlaceholderSpPrVisuals, readPlaceholderTransform, readPresentationThemeFontScheme, readRunFillAndStroke, readRunFontSlots, readTransformXml, reportOoxmlTextDecorationLoss, resolveExternalRelationshipTarget, resolveInternalRelationshipTarget, resolvePartPath, transformAttributesFragmentSchema, unpackEotFontData };
@@ -1,4 +1,4 @@
1
- // ../import/dist/mechanism.js
1
+ // ../core/dist/kernel/pptx-read/mechanism.js
2
2
  /** Defines a native canvas mechanism requiring production `emit`, `paint`, and `import` directions. */
3
3
  function defineCanvasMechanism(definition) {
4
4
  return Object.freeze(definition);
@@ -0,0 +1,26 @@
1
+ import { P14_NS } from "./namespaces.js";
2
+ import { resolvePartPath } from "./opc.js";
3
+ // ../core/dist/kernel/pptx-read/media.js
4
+ /** Identifies a native media picture without claiming any XML on the import cursor. */
5
+ function mediaPictureKind(element) {
6
+ if (element.namespaceURI !== "http://schemas.openxmlformats.org/presentationml/2006/main" || element.localName !== "pic") return void 0;
7
+ if (element.getElementsByTagNameNS("http://schemas.openxmlformats.org/drawingml/2006/main", "videoFile").length > 0) return "video";
8
+ if (element.getElementsByTagNameNS("http://schemas.openxmlformats.org/drawingml/2006/main", "audioFile").length > 0) return "audio";
9
+ if (element.getElementsByTagNameNS("http://schemas.microsoft.com/office/powerpoint/2010/main", "media").length > 0) return "media";
10
+ }
11
+ /** Determines the media kind when PowerPoint's legacy audioFile or videoFile marker is absent. */
12
+ function inferModernMediaKind(element, pkg, part, relationships, timingKind) {
13
+ const media = element.getElementsByTagNameNS(P14_NS, "media")[0];
14
+ const id = media?.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "embed") || media?.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "link");
15
+ const relationship = id ? relationships.get(id) : void 0;
16
+ if (relationship?.Type !== "http://schemas.microsoft.com/office/2007/relationships/media") return timingKind;
17
+ const internalPart = relationship.TargetMode === "Internal" ? resolvePartPath(part, relationship.Target) : void 0;
18
+ const contentType = internalPart === void 0 ? void 0 : pkg.readContentType(internalPart);
19
+ if (contentType?.startsWith("audio/")) return "audio";
20
+ if (contentType?.startsWith("video/")) return "video";
21
+ if (timingKind !== void 0) return timingKind;
22
+ const path = relationship.Target.split(/[?#]/u, 1)[0] ?? "";
23
+ if (/\.(wav|mp3|m4a)$/iu.test(path)) return "audio";
24
+ if (/\.mp4$/iu.test(path)) return "video";
25
+ }
26
+ export { inferModernMediaKind, mediaPictureKind };
@@ -1,7 +1,9 @@
1
- // ../import/dist/namespaces.js
1
+ import { EMU_PER_PX, emuToPx } from "../drawing-units.js";
2
+ // ../core/dist/kernel/pptx-read/namespaces.js
2
3
  const XMLNS_NS = "http://www.w3.org/2000/xmlns/";
3
4
  const XML_NS = "http://www.w3.org/XML/1998/namespace";
4
5
  const OPC_REL_NS = "http://schemas.openxmlformats.org/package/2006/relationships";
6
+ const CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types";
5
7
  const MC_NS = "http://schemas.openxmlformats.org/markup-compatibility/2006";
6
8
  const P_NS = "http://schemas.openxmlformats.org/presentationml/2006/main";
7
9
  const P14_NS = "http://schemas.microsoft.com/office/powerpoint/2010/main";
@@ -10,6 +12,7 @@ const A_NS = "http://schemas.openxmlformats.org/drawingml/2006/main";
10
12
  const C_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
11
13
  const R_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
12
14
  const REL_OFFICE_DOCUMENT = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
15
+ const REL_MEDIA = "http://schemas.microsoft.com/office/2007/relationships/media";
13
16
  const REL_CHART = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart";
14
17
  const REL_SLIDE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide";
15
18
  const REL_SLIDE_LAYOUT = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout";
@@ -28,16 +31,12 @@ const REL_DIAGRAM_QUICK_STYLE = "http://schemas.openxmlformats.org/officeDocumen
28
31
  const REL_DIAGRAM_COLORS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors";
29
32
  const REL_DIAGRAM_DRAWING = "http://schemas.microsoft.com/office/2007/relationships/diagramDrawing";
30
33
  const DIAGRAM_NS = "http://schemas.openxmlformats.org/drawingml/2006/diagram";
34
+ const DSP_NS = "http://schemas.microsoft.com/office/drawing/2008/diagram";
31
35
  const CHART_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
32
36
  const TABLE_NS_URI = "http://schemas.openxmlformats.org/drawingml/2006/table";
33
37
  const P14_SECTION_LIST_EXT_URI = "{521415D9-36F7-43E2-AB2F-B90AF26B5E84}";
34
38
  const P14_CREATION_ID_EXT_URI = "{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}";
35
39
  const STRICT_NS_PREFIX = "http://purl.oclc.org/ooxml/";
36
- const EMU_PER_PX = 9525;
37
- /** Converts DrawingML English Metric Units (EMU) to logical pixels (96 DPI). */
38
- function emuToPx(emu) {
39
- return emu / EMU_PER_PX;
40
- }
41
40
  const canonicalPrefixes = /* @__PURE__ */ new Map([
42
41
  [P_NS, "p"],
43
42
  [P14_NS, "p14"],
@@ -57,4 +56,4 @@ function canonicalQName(namespaceUri, localName) {
57
56
  if (prefix !== void 0) return `${prefix}:${localName}`;
58
57
  return `{${namespaceUri}}${localName}`;
59
58
  }
60
- export { A_NS, CHART_NS, C_NS, DIAGRAM_NS, EMU_PER_PX, MC_NS, OPC_REL_NS, P14_CREATION_ID_EXT_URI, P14_NS, P14_SECTION_LIST_EXT_URI, P159_NS, P_NS, REL_CHART, REL_DIAGRAM_COLORS, REL_DIAGRAM_DATA, REL_DIAGRAM_DRAWING, REL_DIAGRAM_LAYOUT, REL_DIAGRAM_QUICK_STYLE, REL_FONT, REL_HANDOUT_MASTER, REL_HYPERLINK, REL_IMAGE, REL_NOTES_MASTER, REL_NOTES_SLIDE, REL_OFFICE_DOCUMENT, REL_SLIDE, REL_SLIDE_LAYOUT, REL_SLIDE_MASTER, REL_THEME, REL_THEME_OVERRIDE, R_NS, STRICT_NS_PREFIX, TABLE_NS_URI, XMLNS_NS, XML_NS, canonicalQName, emuToPx };
59
+ export { A_NS, CHART_NS, CONTENT_TYPES_NS, C_NS, DIAGRAM_NS, DSP_NS, EMU_PER_PX, MC_NS, OPC_REL_NS, P14_CREATION_ID_EXT_URI, P14_NS, P14_SECTION_LIST_EXT_URI, P159_NS, P_NS, REL_CHART, REL_DIAGRAM_COLORS, REL_DIAGRAM_DATA, REL_DIAGRAM_DRAWING, REL_DIAGRAM_LAYOUT, REL_DIAGRAM_QUICK_STYLE, REL_FONT, REL_HANDOUT_MASTER, REL_HYPERLINK, REL_IMAGE, REL_MEDIA, REL_NOTES_MASTER, REL_NOTES_SLIDE, REL_OFFICE_DOCUMENT, REL_SLIDE, REL_SLIDE_LAYOUT, REL_SLIDE_MASTER, REL_THEME, REL_THEME_OVERRIDE, R_NS, STRICT_NS_PREFIX, TABLE_NS_URI, XMLNS_NS, XML_NS, canonicalQName, emuToPx };
@@ -1,10 +1,10 @@
1
1
  import { ImportError } from "./diagnostics.js";
2
- import { OPC_REL_NS, REL_OFFICE_DOCUMENT } from "./namespaces.js";
2
+ import { CONTENT_TYPES_NS, OPC_REL_NS, REL_OFFICE_DOCUMENT } from "./namespaces.js";
3
3
  import { MalformedXmlPartError, XmlElementCursor, parseXmlPart } from "./xml-reader.js";
4
4
  import { z } from "zod";
5
- import { strFromU8, unzipSync } from "fflate";
6
5
  import { posix } from "node:path";
7
- // ../import/dist/opc.js
6
+ import { strFromU8, unzip } from "fflate";
7
+ // ../core/dist/kernel/pptx-read/opc.js
8
8
  /** Zod schema for an OPC `<Relationship>` element attributes. */
9
9
  const opcRelationshipSchema = z.object({
10
10
  Id: z.string().min(1),
@@ -80,21 +80,64 @@ function detectStrictBaselineIssue(part, entries) {
80
80
  }
81
81
  }, `Unsupported ISO/IEC 29500 Strict OOXML relationship (${entry.Type}) in ${part}`);
82
82
  }
83
+ function archiveError(error) {
84
+ return new ImportError({
85
+ code: "corrupt-archive",
86
+ category: "corrupt-input",
87
+ disposition: "aborted"
88
+ }, `Failed to unzip PPTX archive: ${error instanceof Error ? error.message : String(error)}`);
89
+ }
83
90
  /**
84
- * Unzips a PPTX archive into detached entries, validates OPC package entry points,
91
+ * Copies the caller's bytes before asynchronous decompression, validates OPC entry points,
85
92
  * rejects ISO/IEC 29500 Strict OOXML with structured diagnostics, and loads `presentation.xml`.
86
93
  */
87
- function openPptxPackage(input) {
88
- let rawEntries;
89
- try {
90
- rawEntries = unzipSync(input);
94
+ async function openPptxPackage(input, signal) {
95
+ if (signal?.aborted) throw signal.reason;
96
+ if (!(input instanceof Uint8Array)) throw archiveError(/* @__PURE__ */ new TypeError("PPTX input must be a Uint8Array"));
97
+ const snapshot = new Uint8Array(input);
98
+ const entries = await new Promise((resolve, reject) => {
99
+ const onAbort = () => {
100
+ signal?.removeEventListener?.("abort", onAbort);
101
+ terminate();
102
+ reject(signal?.reason);
103
+ };
104
+ const terminate = unzip(snapshot, (error, files) => {
105
+ signal?.removeEventListener?.("abort", onAbort);
106
+ if (error) reject(error);
107
+ else resolve(files);
108
+ });
109
+ signal?.addEventListener?.("abort", onAbort, { once: true });
110
+ }).catch((error) => {
111
+ if (signal?.aborted) throw signal.reason;
112
+ throw archiveError(error);
113
+ });
114
+ if (signal?.aborted) throw signal.reason;
115
+ return openPackageEntries(entries);
116
+ }
117
+ function readContentTypes(bytes) {
118
+ const overrides = /* @__PURE__ */ new Map();
119
+ const defaults = /* @__PURE__ */ new Map();
120
+ if (bytes !== void 0) try {
121
+ const root = parseXmlPart("[Content_Types].xml", strFromU8(bytes));
122
+ for (const item of Array.from(root.getElementsByTagNameNS(CONTENT_TYPES_NS, "Override"))) {
123
+ const part = item.getAttribute("PartName");
124
+ const contentType = item.getAttribute("ContentType");
125
+ if (part?.startsWith("/") && contentType) overrides.set(part.slice(1), contentType);
126
+ }
127
+ for (const item of Array.from(root.getElementsByTagNameNS(CONTENT_TYPES_NS, "Default"))) {
128
+ const extension = item.getAttribute("Extension");
129
+ const contentType = item.getAttribute("ContentType");
130
+ if (extension && contentType) defaults.set(extension.toLowerCase(), contentType);
131
+ }
91
132
  } catch (error) {
92
- throw new ImportError({
93
- code: "corrupt-archive",
94
- category: "corrupt-input",
95
- disposition: "aborted"
96
- }, `Failed to unzip PPTX archive: ${error instanceof Error ? error.message : String(error)}`);
133
+ if (!(error instanceof MalformedXmlPartError)) throw error;
97
134
  }
135
+ return {
136
+ overrides,
137
+ defaults
138
+ };
139
+ }
140
+ function openPackageEntries(rawEntries) {
98
141
  const entries = /* @__PURE__ */ new Map();
99
142
  for (const [name, bytes] of Object.entries(rawEntries)) entries.set(name.replace(/^\/+/u, ""), new Uint8Array(bytes));
100
143
  const rootRelsPath = "_rels/.rels";
@@ -211,6 +254,7 @@ function openPptxPackage(input) {
211
254
  }
212
255
  };
213
256
  const presRels = readRelationships(presentationPath);
257
+ let contentTypes;
214
258
  return {
215
259
  presentationPath,
216
260
  presentationRoot,
@@ -219,6 +263,11 @@ function openPptxPackage(input) {
219
263
  hasPart(partPath) {
220
264
  return entries.has(partPath);
221
265
  },
266
+ readContentType(partPath) {
267
+ contentTypes ??= readContentTypes(entries.get("[Content_Types].xml"));
268
+ const extension = posix.extname(partPath).slice(1).toLowerCase();
269
+ return contentTypes.overrides.get(partPath) ?? contentTypes.defaults.get(extension);
270
+ },
222
271
  readTextPart(partPath) {
223
272
  const bytes = entries.get(partPath);
224
273
  return bytes === void 0 ? void 0 : strFromU8(bytes);
@@ -1,6 +1,6 @@
1
1
  import { A_NS, DIAGRAM_NS, P_NS, REL_DIAGRAM_COLORS, REL_DIAGRAM_DATA, REL_DIAGRAM_LAYOUT, REL_DIAGRAM_QUICK_STYLE, R_NS } from "./namespaces.js";
2
2
  import { resolvePartPath } from "./opc.js";
3
- // ../import/dist/resources.js
3
+ // ../core/dist/kernel/pptx-read/resources.js
4
4
  /** Reads and indexes all OPC relationships owned by `sourcePartPath`. */
5
5
  function buildRelationshipIndex(pkg, sourcePartPath) {
6
6
  const { entries, diagnostics } = pkg.readRelationships(sourcePartPath);
@@ -0,0 +1,57 @@
1
+ import { A_NS, P_NS } from "./namespaces.js";
2
+ // ../core/dist/kernel/pptx-read/shape-tree.js
3
+ function allocateScopedAuthorId(requested, used, fallbackBase) {
4
+ const base = requested !== void 0 && requested.trim().length > 0 ? requested.trim() : fallbackBase;
5
+ if (!used.has(base)) {
6
+ used.add(base);
7
+ return base;
8
+ }
9
+ let suffix = 2;
10
+ while (used.has(`${base}-${suffix}`)) suffix += 1;
11
+ const unique = `${base}-${suffix}`;
12
+ used.add(unique);
13
+ return unique;
14
+ }
15
+ /** Consumes standard identity `<p:nvGrpSpPr>` and `<p:grpSpPr>` transform boilerplate on an `spTree`. */
16
+ function consumeIdentityShapeTreeBoilerplate(spTree) {
17
+ const nvGrpSpPr = spTree.child(P_NS, "nvGrpSpPr");
18
+ if (nvGrpSpPr !== void 0) {
19
+ const cNvPr = nvGrpSpPr.child(P_NS, "cNvPr");
20
+ if (cNvPr !== void 0) {
21
+ cNvPr.consumeAttr("id");
22
+ cNvPr.consumeAttr("name");
23
+ }
24
+ nvGrpSpPr.ignoreEmptyChild(P_NS, "cNvGrpSpPr");
25
+ nvGrpSpPr.ignoreEmptyChild(P_NS, "nvPr");
26
+ }
27
+ const grpSpPr = spTree.child(P_NS, "grpSpPr");
28
+ if (grpSpPr !== void 0) {
29
+ const xfrm = grpSpPr.child(A_NS, "xfrm");
30
+ if (xfrm !== void 0) {
31
+ const off = xfrm.child(A_NS, "off");
32
+ if (off !== void 0 && off.attr("x") === "0" && off.attr("y") === "0") {}
33
+ const ext = xfrm.child(A_NS, "ext");
34
+ if (ext !== void 0 && ext.attr("cx") === "0" && ext.attr("cy") === "0") {}
35
+ const chOff = xfrm.child(A_NS, "chOff");
36
+ if (chOff !== void 0 && chOff.attr("x") === "0" && chOff.attr("y") === "0") {}
37
+ const chExt = xfrm.child(A_NS, "chExt");
38
+ if (chExt !== void 0 && chExt.attr("cx") === "0" && chExt.attr("cy") === "0") {}
39
+ }
40
+ }
41
+ }
42
+ /** Records `unconsumed-xml` diagnostics for all unconsumed attributes/elements under a root cursor. */
43
+ function appendUnconsumedDiagnostics(cursor, slideIndex, diagnostics) {
44
+ for (const item of cursor.collectUnconsumed()) diagnostics.push({
45
+ code: "unconsumed-xml",
46
+ category: "unsupported",
47
+ disposition: "omitted",
48
+ kind: item.kind,
49
+ location: {
50
+ ...item.location,
51
+ ...slideIndex === void 0 ? {} : { slideIndex }
52
+ },
53
+ namespaceUri: item.namespaceUri,
54
+ localName: item.localName
55
+ });
56
+ }
57
+ export { allocateScopedAuthorId, appendUnconsumedDiagnostics, consumeIdentityShapeTreeBoilerplate };