@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
@@ -1,6 +1,6 @@
1
- import { BuildError } from "./diagnostics.js";
1
+ import { BuildError, toBuildDiagnostic } from "./diagnostics.js";
2
2
  import { expandedSpacing, resolvePercent } from "./layout-protocol.js";
3
- // ../core/dist/grid-layout.js
3
+ // ../core/dist/kernel/grid-layout.js
4
4
  const gridContainerProperties = [
5
5
  "gridTemplateColumns",
6
6
  "gridTemplateRows",
@@ -12,37 +12,32 @@ const gridItemProperties = [
12
12
  "gridRow",
13
13
  "justifySelf"
14
14
  ];
15
- function fail(path, code, message) {
16
- throw new BuildError([{
17
- severity: "error",
18
- path,
19
- code,
20
- message
21
- }]);
15
+ function fail(path, code, message, details) {
16
+ throw new BuildError([toBuildDiagnostic(path, code, message, details)]);
22
17
  }
23
- function gridTokens(input, path) {
18
+ function gridTokens(input, path, field) {
24
19
  const tokens = [];
25
20
  let depth = 0;
26
21
  let current = "";
27
22
  for (const character of input.trim()) {
28
23
  if (character === "(") depth += 1;
29
24
  if (character === ")") depth -= 1;
30
- if (depth < 0) fail(path, "invalid-grid-tracks", "Mismatched parentheses in grid tracks");
25
+ if (depth < 0) fail(path, "invalid-grid-tracks", "Mismatched parentheses in grid tracks", { field });
31
26
  if (/\s/u.test(character) && depth === 0) {
32
27
  if (current !== "") tokens.push(current);
33
28
  current = "";
34
29
  } else current += character;
35
30
  }
36
- if (depth !== 0) fail(path, "invalid-grid-tracks", "Mismatched parentheses in grid tracks");
31
+ if (depth !== 0) fail(path, "invalid-grid-tracks", "Mismatched parentheses in grid tracks", { field });
37
32
  if (current !== "") tokens.push(current);
38
33
  return tokens;
39
34
  }
40
- function parseGridPixels(token, path) {
35
+ function parseGridPixels(token, path, field) {
41
36
  const match = /^(\d+(?:\.\d+)?)(?:px)?$/u.exec(token);
42
- if (match === null) fail(path, "invalid-grid-tracks", `Unsupported grid track ${token}`);
37
+ if (match === null) fail(path, "invalid-grid-tracks", `Unsupported grid track ${token}`, { field });
43
38
  return Number(match[1]);
44
39
  }
45
- function parseGridBasicTrack(token, path) {
40
+ function parseGridBasicTrack(token, path, field) {
46
41
  if (token === "auto") return {
47
42
  kind: "auto",
48
43
  min: 0
@@ -50,7 +45,7 @@ function parseGridBasicTrack(token, path) {
50
45
  const fraction = /^(\d+(?:\.\d+)?)fr$/u.exec(token);
51
46
  if (fraction !== null) {
52
47
  const value = Number(fraction[1]);
53
- if (value <= 0) fail(path, "invalid-grid-tracks", "fr track fraction must be greater than 0");
48
+ if (value <= 0) fail(path, "invalid-grid-tracks", "fr track fraction must be greater than 0", { field });
54
49
  return {
55
50
  kind: "fr",
56
51
  value,
@@ -59,10 +54,10 @@ function parseGridBasicTrack(token, path) {
59
54
  }
60
55
  return {
61
56
  kind: "px",
62
- value: parseGridPixels(token, path)
57
+ value: parseGridPixels(token, path, field)
63
58
  };
64
59
  }
65
- function gridTracks(input, path, defaultFr) {
60
+ function gridTracks(input, path, defaultFr, field) {
66
61
  if (input === void 0 || input.trim() === "") return defaultFr ? [{
67
62
  kind: "fr",
68
63
  value: 1,
@@ -72,34 +67,37 @@ function gridTracks(input, path, defaultFr) {
72
67
  const repeat = /^repeat\(\s*(\d+)\s*,\s*(.+)\)$/u.exec(token);
73
68
  if (repeat !== null) {
74
69
  const count = Number(repeat[1]);
75
- if (!Number.isInteger(count) || count < 1 || count > 128) fail(path, "invalid-grid-tracks", "repeat count must be an integer between 1 and 128");
76
- const repeated = gridTokens(repeat[2], path).flatMap(parseOne);
77
- if (repeated.length * count > 128) fail(path, "invalid-grid-tracks", "Expanded grid tracks cannot exceed 128 tracks");
70
+ if (!Number.isInteger(count) || count < 1 || count > 128) fail(path, "invalid-grid-tracks", "repeat count must be an integer between 1 and 128", { field });
71
+ const repeated = gridTokens(repeat[2], path, field).flatMap(parseOne);
72
+ if (repeated.length * count > 128) fail(path, "invalid-grid-tracks", "Expanded grid tracks cannot exceed 128 tracks", { field });
78
73
  return Array.from({ length: count }, () => repeated).flat();
79
74
  }
80
75
  const minmax = /^minmax\(\s*([^,]+?)\s*,\s*([^)]+?)\s*\)$/u.exec(token);
81
76
  if (minmax !== null) {
82
77
  const lower = minmax[1].trim();
83
- const minValue = lower === "auto" ? 0 : parseGridPixels(lower, path);
84
- const maximum = parseGridBasicTrack(minmax[2].trim(), path);
85
- if (maximum.kind === "fr") return [{
86
- ...maximum,
87
- min: Math.max(minValue, maximum.min),
88
- contentMinimum: lower === "auto"
89
- }];
90
- if (maximum.kind === "auto") return [{
91
- kind: "auto",
92
- min: minValue
93
- }];
94
- return [{
95
- kind: "px",
96
- value: Math.max(minValue, maximum.value)
97
- }];
78
+ const minValue = lower === "auto" ? 0 : parseGridPixels(lower, path, field);
79
+ const maximum = parseGridBasicTrack(minmax[2].trim(), path, field);
80
+ switch (maximum.kind) {
81
+ case "fr": return [{
82
+ ...maximum,
83
+ min: Math.max(minValue, maximum.min),
84
+ contentMinimum: lower === "auto"
85
+ }];
86
+ case "auto": return [{
87
+ kind: "auto",
88
+ min: minValue
89
+ }];
90
+ case "px": return [{
91
+ kind: "px",
92
+ value: Math.max(minValue, maximum.value)
93
+ }];
94
+ default: return maximum;
95
+ }
98
96
  }
99
- return [parseGridBasicTrack(token, path)];
97
+ return [parseGridBasicTrack(token, path, field)];
100
98
  };
101
- const tracks = gridTokens(input, path).flatMap(parseOne);
102
- if (tracks.length === 0 || tracks.length > 128) fail(path, "invalid-grid-tracks", "Grid tracks must contain between 1 and 128 tracks");
99
+ const tracks = gridTokens(input, path, field).flatMap(parseOne);
100
+ if (tracks.length === 0 || tracks.length > 128) fail(path, "invalid-grid-tracks", "Grid tracks must contain between 1 and 128 tracks", { field });
103
101
  return tracks;
104
102
  }
105
103
  function gridAutoRowTracks(input, path) {
@@ -107,8 +105,8 @@ function gridAutoRowTracks(input, path) {
107
105
  kind: "auto",
108
106
  min: 0
109
107
  }];
110
- const tracks = gridTracks(input, path, false);
111
- if (tracks.length === 0) fail(path, "invalid-grid-tracks", "gridAutoRows must contain at least 1 track");
108
+ const tracks = gridTracks(input, path, false, "style.gridAutoRows");
109
+ if (tracks.length === 0) fail(path, "invalid-grid-tracks", "gridAutoRows must contain at least 1 track", { field: "style.gridAutoRows" });
112
110
  return tracks;
113
111
  }
114
112
  function rowTrackGrowsWithContent(track) {
@@ -191,11 +189,18 @@ function gridPlacement(value, path) {
191
189
  };
192
190
  return fail(path, "invalid-grid-placement", `Unsupported grid placement ${value}`);
193
191
  }
192
+ const gridAlignments = {
193
+ auto: "start",
194
+ baseline: "start",
195
+ start: "start",
196
+ "flex-start": "start",
197
+ end: "end",
198
+ "flex-end": "end",
199
+ center: "center",
200
+ stretch: "stretch"
201
+ };
194
202
  function gridAlignment(value) {
195
- if (value === "center") return "center";
196
- if (value === "end" || value === "flex-end") return "end";
197
- if (value === "stretch") return "stretch";
198
- return "start";
203
+ return gridAlignments[value ?? "start"];
199
204
  }
200
205
  function validateGridContainerStyle(value, resolvedDisplay, path) {
201
206
  if (resolvedDisplay === "grid" && value["alignItems"] === "baseline") fail(path, "unsupported-grid-alignment", "Grid containers do not support baseline alignment");
@@ -263,9 +268,9 @@ function computeGridPlacements(node, explicitColumns) {
263
268
  columns
264
269
  };
265
270
  }
266
- function buildGridModel(node, innerWidth, innerHeight, port) {
267
- const columnTracks = gridTracks(node.style.gridTemplateColumns, node.path, true);
268
- const rowTracks = gridTracks(node.style.gridTemplateRows, node.path, false);
271
+ function buildGridModel(node, innerWidth, innerHeight, port, naturalHeightMap) {
272
+ const columnTracks = gridTracks(node.style.gridTemplateColumns, node.path, true, "style.gridTemplateColumns");
273
+ const rowTracks = gridTracks(node.style.gridTemplateRows, node.path, false, "style.gridTemplateRows");
269
274
  const autoRowTracks = gridAutoRowTracks(node.style.gridAutoRows, node.path);
270
275
  const { placements, columns } = computeGridPlacements(node, columnTracks);
271
276
  const columnGap = node.style.columnGap ?? node.style.gap ?? 0;
@@ -291,6 +296,20 @@ function buildGridModel(node, innerWidth, innerHeight, port) {
291
296
  }
292
297
  if (innerWidth !== void 0) distributeFrTracks(columnWidths, columns, innerWidth, columnGap);
293
298
  const spanWidth = (start, span) => columnWidths.slice(start, start + span).reduce((sum, width) => sum + width, 0) + columnGap * Math.max(0, span - 1);
299
+ const measureChildNaturalSize = (item, availableWidth) => {
300
+ const declaredHeight = item.style.height;
301
+ const isAutoHeight = declaredHeight === void 0 || declaredHeight === "auto";
302
+ if (isAutoHeight && item.style.display !== "grid") port.setChildConstraints(item, { height: "auto" });
303
+ const size = port.measureNaturalSize(item, availableWidth);
304
+ if (isAutoHeight && item.style.display === "grid") {
305
+ const naturalGridHeight = naturalHeightMap?.get(item);
306
+ if (naturalGridHeight !== void 0) return {
307
+ width: size.width,
308
+ height: naturalGridHeight
309
+ };
310
+ }
311
+ return size;
312
+ };
294
313
  const rowHeights = Array.from({ length: rowCount }, (_, index) => {
295
314
  const track = rowTrackAt(index);
296
315
  return track.kind === "px" ? track.value : track.min;
@@ -300,13 +319,13 @@ function buildGridModel(node, innerWidth, innerHeight, port) {
300
319
  const track = rowTrackAt(placement.row);
301
320
  if (!rowTrackGrowsWithContent(track)) continue;
302
321
  const margin = expandedSpacing(placement.node.style, "margin");
303
- const size = port.measureNaturalSize(placement.node, spanWidth(placement.column, placement.columnSpan));
322
+ const size = measureChildNaturalSize(placement.node, spanWidth(placement.column, placement.columnSpan));
304
323
  rowHeights[placement.row] = Math.max(rowHeights[placement.row] ?? 0, track.min, size.height + margin.top + margin.bottom);
305
324
  }
306
325
  const spanHeight = (start, span) => rowHeights.slice(start, start + span).reduce((sum, height) => sum + height, 0) + rowGap * Math.max(0, span - 1);
307
326
  for (const placement of placements) {
308
327
  if (placement.rowSpan === 1) continue;
309
- const natural = port.measureNaturalSize(placement.node, spanWidth(placement.column, placement.columnSpan));
328
+ const natural = measureChildNaturalSize(placement.node, spanWidth(placement.column, placement.columnSpan));
310
329
  const margin = expandedSpacing(placement.node.style, "margin");
311
330
  const missing = natural.height + margin.top + margin.bottom - spanHeight(placement.row, placement.rowSpan);
312
331
  if (missing <= 0) continue;
@@ -314,24 +333,69 @@ function buildGridModel(node, innerWidth, innerHeight, port) {
314
333
  if (growable.length === 0) continue;
315
334
  for (const index of growable) rowHeights[index] = (rowHeights[index] ?? 0) + missing / growable.length;
316
335
  }
317
- if (innerHeight !== void 0) distributeFrTracks(rowHeights, Array.from({ length: rowCount }, (_, index) => rowTrackAt(index)), innerHeight, rowGap);
318
- const spanHeightFinal = (start, span) => rowHeights.slice(start, start + span).reduce((sum, height) => sum + height, 0) + rowGap * Math.max(0, span - 1);
336
+ const naturalHeight = rowCount === 0 ? 0 : rowHeights.reduce((sum, height) => sum + height, 0) + rowGap * Math.max(0, rowCount - 1);
337
+ const resolvedRowTracks = Array.from({ length: rowCount }, (_, index) => rowTrackAt(index));
338
+ if (innerHeight !== void 0) distributeFrTracks(rowHeights, resolvedRowTracks, innerHeight, rowGap);
339
+ const hasFrRow = resolvedRowTracks.some((track) => track.kind === "fr");
340
+ const alignContent = node.style.alignContent;
341
+ let remainingHeight = innerHeight !== void 0 && rowCount > 0 ? innerHeight - rowHeights.reduce((sum, height) => sum + height, 0) - rowGap * Math.max(0, rowCount - 1) : 0;
342
+ if (remainingHeight > 0 && !hasFrRow && (alignContent === void 0 || alignContent === "stretch")) {
343
+ const autoRowIndices = resolvedRowTracks.flatMap((track, index) => track.kind === "auto" ? [index] : []);
344
+ if (autoRowIndices.length > 0) {
345
+ const extraPerRow = remainingHeight / autoRowIndices.length;
346
+ for (const index of autoRowIndices) rowHeights[index] = (rowHeights[index] ?? 0) + extraPerRow;
347
+ remainingHeight = 0;
348
+ }
349
+ }
350
+ let rowOffsetY = 0;
351
+ let extraRowGap = 0;
352
+ if (remainingHeight > 0) switch (alignContent) {
353
+ case "center":
354
+ rowOffsetY = remainingHeight / 2;
355
+ break;
356
+ case "end":
357
+ case "flex-end":
358
+ rowOffsetY = remainingHeight;
359
+ break;
360
+ case "space-between":
361
+ if (rowCount > 1) extraRowGap = remainingHeight / (rowCount - 1);
362
+ break;
363
+ case "space-around":
364
+ rowOffsetY = remainingHeight / (2 * rowCount);
365
+ extraRowGap = remainingHeight / rowCount;
366
+ break;
367
+ case "space-evenly":
368
+ rowOffsetY = remainingHeight / (rowCount + 1);
369
+ extraRowGap = remainingHeight / (rowCount + 1);
370
+ break;
371
+ case void 0:
372
+ case "stretch":
373
+ case "start":
374
+ case "flex-start": break;
375
+ default: throw new Error(`Unsupported grid alignContent: ${String(alignContent)}`);
376
+ }
377
+ const effectiveRowGap = rowGap + extraRowGap;
378
+ const spanHeightFinal = (start, span) => rowHeights.slice(start, start + span).reduce((sum, height) => sum + height, 0) + effectiveRowGap * Math.max(0, span - 1);
319
379
  return {
320
380
  placements,
321
381
  widths: columnWidths,
322
382
  heights: rowHeights,
323
383
  columnGap,
324
- rowGap,
384
+ rowGap: effectiveRowGap,
385
+ rowOffsetY,
325
386
  spanWidth,
326
387
  spanHeight: spanHeightFinal,
327
388
  width: spanWidth(0, columnWidths.length),
328
- height: rowCount === 0 ? 0 : spanHeightFinal(0, rowCount)
389
+ height: rowCount === 0 ? 0 : spanHeightFinal(0, rowCount),
390
+ naturalHeight
329
391
  };
330
392
  }
331
393
  /**
332
394
  * Creates the Grid container solver collaborating strictly through `LayoutSolverPort`.
333
395
  */
334
- function createGridContainerSolver(warnOnce) {
396
+ function createGridContainerSolver() {
397
+ const contentSizedHeightNodes = /* @__PURE__ */ new WeakSet();
398
+ const naturalHeightMap = /* @__PURE__ */ new WeakMap();
335
399
  return {
336
400
  handlesDisplay(display) {
337
401
  return display === "grid";
@@ -344,19 +408,47 @@ function createGridContainerSolver(warnOnce) {
344
408
  placeContainer(node, port) {
345
409
  if (node.style.display !== "grid") return;
346
410
  const padding = expandedSpacing(node.style, "padding");
411
+ const paddingY = padding.top + padding.bottom;
347
412
  const computed = port.getComputedSize(node);
348
413
  const outerWidth = computed.width;
349
- const outerHeight = computed.height || port.getAllocatedHeight(node) || 0;
414
+ const allocatedHeight = port.getAllocatedHeight(node);
415
+ const outerHeight = computed.height || allocatedHeight || 0;
350
416
  const hasWidth = node.isRoot || node.style.width !== void 0 && node.style.width !== "auto";
351
- const hasResolvedHeight = node.isRoot || node.style.height !== void 0 && node.style.height !== "auto" || outerHeight > 0;
352
- const innerWidth = outerWidth > 0 ? Math.max(0, outerWidth - padding.left - padding.right) : void 0;
353
- const innerHeight = hasResolvedHeight ? Math.max(0, outerHeight - padding.top - padding.bottom) : void 0;
354
- const model = buildGridModel(node, innerWidth, innerHeight, port);
355
- if (innerWidth !== void 0 && model.width > innerWidth + .01) warnOnce(node.path, "grid-overflow", `Grid columns minimum size total ${model.width}px exceeds available width ${innerWidth}px; build retains track dimensions`);
356
- if (innerHeight !== void 0 && model.height > innerHeight + .01) warnOnce(node.path, "grid-overflow", `Grid rows minimum size total ${model.height}px exceeds available height ${innerHeight}px; build retains track dimensions`);
357
- port.setContainerSize(node, {
358
- ...!hasWidth && outerWidth <= 0 ? { width: model.width + padding.left + padding.right } : {},
359
- ...!hasResolvedHeight ? { height: model.height + padding.top + padding.bottom } : {}
417
+ const topOffset = node.style.top ?? node.style.inset;
418
+ const bottomOffset = node.style.bottom ?? node.style.inset;
419
+ const hasOppositeVerticalOffsets = node.style.position === "absolute" && topOffset !== void 0 && topOffset !== "auto" && bottomOffset !== void 0 && bottomOffset !== "auto";
420
+ const isPercentHeight = typeof node.style.height === "string" && node.style.height.endsWith("%");
421
+ const hasExplicitDefiniteHeight = node.isRoot || node.style.height !== void 0 && node.style.height !== "auto" && (!isPercentHeight || !contentSizedHeightNodes.has(node) && computed.height > paddingY) || hasOppositeVerticalOffsets && outerHeight > 0;
422
+ const hasAllocatedDefiniteHeight = allocatedHeight !== void 0;
423
+ const flexHeightRole = port.participatesInParentFlexHeight(node);
424
+ const hasFlexDefiniteHeight = !hasExplicitDefiniteHeight && !hasAllocatedDefiniteHeight && !contentSizedHeightNodes.has(node) && computed.height > paddingY;
425
+ const hasDefiniteHeight = hasExplicitDefiniteHeight || hasAllocatedDefiniteHeight || hasFlexDefiniteHeight;
426
+ if (!hasDefiniteHeight && flexHeightRole === false) contentSizedHeightNodes.add(node);
427
+ const model = buildGridModel(node, outerWidth > 0 ? Math.max(0, outerWidth - padding.left - padding.right) : void 0, hasDefiniteHeight ? Math.max(0, outerHeight - paddingY) : void 0, port, naturalHeightMap);
428
+ let naturalOuterHeight = model.naturalHeight + paddingY;
429
+ if (typeof node.style.maxHeight === "number") naturalOuterHeight = Math.min(naturalOuterHeight, node.style.maxHeight);
430
+ if (typeof node.style.minHeight === "number") naturalOuterHeight = Math.max(naturalOuterHeight, node.style.minHeight);
431
+ naturalHeightMap.set(node, naturalOuterHeight);
432
+ if (!hasWidth && outerWidth <= 0) port.setContainerSize(node, { width: model.width + padding.left + padding.right });
433
+ if (!hasDefiniteHeight) {
434
+ if (flexHeightRole === false) port.setContainerSize(node, { height: model.height + paddingY });
435
+ else {
436
+ const minHeight = flexHeightRole === "cross-stretch" && !port.hasDefiniteParentHeight(node) ? typeof node.style.minHeight === "number" ? Math.max(node.style.minHeight, naturalOuterHeight) : naturalOuterHeight : void 0;
437
+ port.setChildConstraints(node, {
438
+ height: "auto",
439
+ ...minHeight === void 0 ? {} : { minHeight }
440
+ });
441
+ }
442
+ } else if (flexHeightRole === "cross-stretch" && !hasExplicitDefiniteHeight && !hasAllocatedDefiniteHeight && !port.hasDefiniteParentHeight(node)) {
443
+ const minHeight = typeof node.style.minHeight === "number" ? Math.max(node.style.minHeight, naturalOuterHeight) : naturalOuterHeight;
444
+ port.setChildConstraints(node, {
445
+ height: "auto",
446
+ minHeight
447
+ });
448
+ }
449
+ port.setGridTracks?.(node, {
450
+ columnWidths: [...model.widths],
451
+ rowHeights: [...model.heights]
360
452
  });
361
453
  for (const placement of model.placements) {
362
454
  const child = placement.node;
@@ -364,7 +456,13 @@ function createGridContainerSolver(warnOnce) {
364
456
  const cellWidth = model.spanWidth(placement.column, placement.columnSpan);
365
457
  const cellHeight = model.spanHeight(placement.row, placement.rowSpan);
366
458
  const cellX = padding.left + model.spanWidth(0, placement.column) + (placement.column > 0 ? model.columnGap : 0);
367
- const cellY = padding.top + model.spanHeight(0, placement.row) + (placement.row > 0 ? model.rowGap : 0);
459
+ const cellY = padding.top + model.rowOffsetY + model.spanHeight(0, placement.row) + (placement.row > 0 ? model.rowGap : 0);
460
+ port.setGridCellArea?.(child, {
461
+ x: cellX,
462
+ y: cellY,
463
+ width: cellWidth,
464
+ height: cellHeight
465
+ });
368
466
  const margin = expandedSpacing(childStyle, "margin");
369
467
  const availableWidth = Math.max(0, cellWidth - margin.left - margin.right);
370
468
  const availableHeight = Math.max(0, cellHeight - margin.top - margin.bottom);
@@ -372,8 +470,8 @@ function createGridContainerSolver(warnOnce) {
372
470
  const alignValue = childStyle.alignSelf === void 0 || childStyle.alignSelf === "auto" ? node.style.alignItems ?? "stretch" : childStyle.alignSelf;
373
471
  if (alignValue === "baseline") fail(child.path, "unsupported-grid-alignment", "Text baseline alignment in grid does not yet have a reliable row baseline");
374
472
  const align = gridAlignment(alignValue);
375
- const declaredWidth = childStyle.width ?? child.contractWidth;
376
- const declaredHeight = childStyle.height ?? child.contractHeight;
473
+ const declaredWidth = childStyle.width;
474
+ const declaredHeight = childStyle.height;
377
475
  const widthPercent = resolvePercent(declaredWidth, cellWidth);
378
476
  const heightPercent = resolvePercent(declaredHeight, cellHeight);
379
477
  const widthSpecified = declaredWidth !== void 0 && declaredWidth !== "auto";
@@ -399,15 +497,21 @@ function createGridContainerSolver(warnOnce) {
399
497
  const intrinsic = port.measureNaturalSize(child, typeof declaredWidth === "string" && declaredWidth.endsWith("%") ? cellWidth : void 0);
400
498
  let width = widthSpecified ? intrinsic.width : justify === "stretch" ? availableWidth : intrinsic.width;
401
499
  if (childStyle.aspectRatio !== void 0 && heightSpecified && !widthSpecified) width = intrinsic.height * childStyle.aspectRatio;
402
- if (!widthSpecified || widthPercent !== void 0) port.setChildConstraints(child, { width: Math.max(0, width) });
500
+ if (!widthSpecified || widthPercent !== void 0 || child.contentMinimumsEnforced) port.setChildConstraints(child, { width: Math.max(0, width) });
403
501
  const naturalAtWidth = port.measureNaturalSize(child, width);
404
502
  let height = heightSpecified ? naturalAtWidth.height : align === "stretch" && childStyle.aspectRatio === void 0 ? availableHeight : naturalAtWidth.height;
405
- if (!heightSpecified && childStyle.aspectRatio === void 0) port.setChildConstraints(child, { height: Math.max(0, height) });
503
+ if (!heightSpecified && childStyle.aspectRatio === void 0 || child.contentMinimumsEnforced) port.setChildConstraints(child, { height: Math.max(0, height) });
406
504
  const finalSize = port.measureNaturalSize(child, width);
407
505
  const usedWidth = finalSize.width || width;
408
506
  const usedHeight = finalSize.height || height;
409
- if (child.isContainer && !heightSpecified) port.setAllocatedHeight(child, height);
410
- if (usedWidth > availableWidth + .01 || usedHeight > availableHeight + .01) warnOnce(child.path, "grid-item-overflow", "Grid item overflows its track area; build retains declared dimensions");
507
+ if (child.contentMinimumsEnforced) port.setChildConstraints(child, {
508
+ width: Math.max(0, usedWidth),
509
+ height: Math.max(0, usedHeight)
510
+ });
511
+ const childPadding = expandedSpacing(childStyle, "padding");
512
+ const childPaddingY = childPadding.top + childPadding.bottom;
513
+ const canAllocateGridHeight = childStyle.display !== "grid" || naturalHeightMap.has(child) || height > childPaddingY;
514
+ if (child.isContainer && !heightSpecified && align === "stretch" && childStyle.aspectRatio === void 0 && canAllocateGridHeight) port.setAllocatedHeight(child, height);
411
515
  const xAlign = justify === "center" ? Math.max(0, (availableWidth - usedWidth) / 2) : justify === "end" ? Math.max(0, availableWidth - usedWidth) : 0;
412
516
  const yAlign = align === "center" ? Math.max(0, (availableHeight - usedHeight) / 2) : align === "end" ? Math.max(0, availableHeight - usedHeight) : 0;
413
517
  const relative = (start, end, basis) => {
@@ -433,6 +537,7 @@ const gridLayoutMode = {
433
537
  itemStyleKeys: gridItemProperties,
434
538
  sharedContainerProperties: [
435
539
  "alignItems",
540
+ "alignContent",
436
541
  "gap",
437
542
  "rowGap",
438
543
  "columnGap"
@@ -1,6 +1,6 @@
1
1
  import { validateAuthorIdScopes } from "./author-ids.js";
2
2
  import { insertDeclarationChild as insertDeclarationChild$1, removeDeclarationChild as removeDeclarationChild$1, replaceDeclarationProps as replaceDeclarationProps$1, setDeclarationText as setDeclarationText$1 } from "./document-internals.js";
3
- // ../core/dist/host.js
3
+ // ../core/dist/kernel/host.js
4
4
  /**
5
5
  * Internal React host prop carrying the editable-node creator for one declaration type.
6
6
  *
@@ -0,0 +1,24 @@
1
+ import "./document-internals.js";
2
+ import "./date-time-format.js";
3
+ import { externalResourceSourceSchema, resourceSourceSchema } from "./resource-source.js";
4
+ import { authorIdSchema, validateAuthorIdScopes } from "./author-ids.js";
5
+ import { isSlideLayoutDefinition } from "./layout-definition.js";
6
+ import { backgroundRefSchema, linkTargetSchema, sectionPropsSchema, slideBackgroundSchema, slideDateTimeValueSchema, slideFooterValueSchema, slideNumberValueSchema } from "./author-schemas.js";
7
+ import { BuildError, CapabilityError, toBuildDiagnostic } from "./diagnostics.js";
8
+ import { bytesSha256, isImmutableBytes, markImmutableBytes } from "./font-seal.js";
9
+ import { createMorphScope, isMorphKey } from "./morph.js";
10
+ import { geometrySchema } from "./geometry-schemas.js";
11
+ import { layoutLengthSchema, layoutSpacingSchema, layoutStyleSchema, paddingStyleSchema } from "./layout-schemas.js";
12
+ import { AuthorQuery, AuthorQueryError, CommonContainer, CommonNode, DeckContainer, RichTextContainer, SlideContainer, SlideLayoutContainer, SlideMasterContainer, createDeckNode, createSectionNode, createSlideLayoutNode, createSlideMasterNode, createSlideNode } from "./document.js";
13
+ import { dateTimeFooterPlaceholderSpecSchema, footerPlaceholderSpecSchema, footerPlaceholdersSchema, headerFooterSchema, resolvedMasterSchema, resolvedPlaceholderSchema, resolvedSlideLayoutSchema, slideLayoutTypeSchema, slideLayoutTypeValues } from "./masters.js";
14
+ import { allocatePlaceholderAuthorKeys, contentPlaceholderRoles, layoutPlaceholderSpecSchema, masterPlaceholderSpecSchema, masterTextStyleCategoryForRole, masterTextStylesSchema, matchLayoutPlaceholderKey, matchMasterPlaceholderSpec, placeholderLevelStyleSchema, placeholderOrientSchema, placeholderRoleSchema, placeholderSizeSchema, placeholderStyleSchema } from "./placeholders.js";
15
+ import { assertValidLang, backgroundValueSchema, borderObjectSchema, borderStyleSchema, borderValueSchema, boxShadowValueSchema, colorMapOverrideSchema, colorMapSchema, darker, defaultColorMap, defaultTheme, defineTheme, formatSchemeSchema, imageBackgroundFitSchema, imageBackgroundPositionKeywordSchema, imageBackgroundPositionSchema, imageBackgroundSchema, isNativeColorSlot, isSchemeColorName, isSchemeColorSlot, isTheme, isThemeFontSlot, lighter, linearGradientSchema, nativeColorSlots, radialGradientSchema, schemeColorNameSchema, schemeColorNames, schemeColorSlots, textStyleSchema, themeDataSchema, themeFontSlotSchema, themeFontSlots, themeInputSchema, themeOverrideSchema, themeSchema } from "./theme.js";
16
+ import "./layout.js";
17
+ import "./block-flex-layout.js";
18
+ import { PreviewPageRangeError, buildDiagnosticFontUnavailableReasonSchema, buildDiagnosticSchema, buildOptionsSchema, buildOptionsShape, emitOptionsSchema, extensionSchema, fontEmbeddingModeSchema, formatBaseline, formatBaselineSchema, previewErrorOptionSchemas, previewErrorSchema, previewPlaceholderSchema, resolveOptionsSchema, resolveOptionsShape, targetNameSchema, targetSchema, targets } from "./stage-options.js";
19
+ import { BuildQueryError } from "./query.js";
20
+ import { validateResolveOptions } from "./resolve.js";
21
+ import { captureDeclaration, isCapturedDeclaration } from "./declaration-snapshot.js";
22
+ import { HostTextNode, hostNodeCreator, insertDeclarationChild, removeDeclarationChild, replaceDeclarationProps, setDeclarationText } from "./host.js";
23
+ import { getInternalResolution } from "./resolution.js";
24
+ export { AuthorQuery, AuthorQueryError, BuildError, BuildQueryError, CapabilityError, CommonContainer, CommonNode, DeckContainer, HostTextNode, PreviewPageRangeError, RichTextContainer, SlideContainer, SlideLayoutContainer, SlideMasterContainer, allocatePlaceholderAuthorKeys, assertValidLang, authorIdSchema, backgroundRefSchema, backgroundValueSchema, borderObjectSchema, borderStyleSchema, borderValueSchema, boxShadowValueSchema, buildDiagnosticFontUnavailableReasonSchema, buildDiagnosticSchema, buildOptionsSchema, buildOptionsShape, bytesSha256, captureDeclaration, colorMapOverrideSchema, colorMapSchema, contentPlaceholderRoles, createDeckNode, createMorphScope, createSectionNode, createSlideLayoutNode, createSlideMasterNode, createSlideNode, darker, dateTimeFooterPlaceholderSpecSchema, defaultColorMap, defaultTheme, defineTheme, emitOptionsSchema, extensionSchema, externalResourceSourceSchema, fontEmbeddingModeSchema, footerPlaceholderSpecSchema, footerPlaceholdersSchema, formatBaseline, formatBaselineSchema, formatSchemeSchema, geometrySchema, getInternalResolution, headerFooterSchema, hostNodeCreator, imageBackgroundFitSchema, imageBackgroundPositionKeywordSchema, imageBackgroundPositionSchema, imageBackgroundSchema, insertDeclarationChild, isCapturedDeclaration, isImmutableBytes, isMorphKey, isNativeColorSlot, isSchemeColorName, isSchemeColorSlot, isSlideLayoutDefinition, isTheme, isThemeFontSlot, layoutLengthSchema, layoutPlaceholderSpecSchema, layoutSpacingSchema, layoutStyleSchema, lighter, linearGradientSchema, linkTargetSchema, markImmutableBytes, masterPlaceholderSpecSchema, masterTextStyleCategoryForRole, masterTextStylesSchema, matchLayoutPlaceholderKey, matchMasterPlaceholderSpec, nativeColorSlots, paddingStyleSchema, placeholderLevelStyleSchema, placeholderOrientSchema, placeholderRoleSchema, placeholderSizeSchema, placeholderStyleSchema, previewErrorOptionSchemas, previewErrorSchema, previewPlaceholderSchema, radialGradientSchema, removeDeclarationChild, replaceDeclarationProps, resolveOptionsSchema, resolveOptionsShape, resolvedMasterSchema, resolvedPlaceholderSchema, resolvedSlideLayoutSchema, resourceSourceSchema, schemeColorNameSchema, schemeColorNames, schemeColorSlots, sectionPropsSchema, setDeclarationText, slideBackgroundSchema, slideDateTimeValueSchema, slideFooterValueSchema, slideLayoutTypeSchema, slideLayoutTypeValues, slideNumberValueSchema, targetNameSchema, targetSchema, targets, textStyleSchema, themeDataSchema, themeFontSlotSchema, themeFontSlots, themeInputSchema, themeOverrideSchema, themeSchema, toBuildDiagnostic, validateAuthorIdScopes, validateResolveOptions };
@@ -0,0 +1,62 @@
1
+ import { replaceDeclarationProps } from "./document-internals.js";
2
+ import { isImmutableBytes, isSealedFont, markImmutableBytes } from "./font-seal.js";
3
+ import { isMorphKey } from "./morph.js";
4
+ // ../core/dist/kernel/input-values.js
5
+ const slideLayoutDefinitionSymbol = Symbol.for("@pptxdk/core/slide-layout-definition");
6
+ const themeBrandSymbol = Symbol.for("#/kernel/theme.ts");
7
+ function isRecord(value) {
8
+ return typeof value === "object" && value !== null && !Array.isArray(value);
9
+ }
10
+ function preservesIdentity(value) {
11
+ if (isSealedFont(value) || isMorphKey(value) || slideLayoutDefinitionSymbol in value || themeBrandSymbol in value) return true;
12
+ if (replaceDeclarationProps in value) return true;
13
+ return isRecord(value) && Object.getOwnPropertyDescriptor(value, "type")?.value === "motion-scope-handle";
14
+ }
15
+ function isRecordValue(value) {
16
+ return Object.prototype.toString.call(value) === "[object Object]";
17
+ }
18
+ function copyValue(value, cloneImmutableBytes) {
19
+ if (value === null || typeof value !== "object") return value;
20
+ if (value instanceof Uint8Array) {
21
+ if (!cloneImmutableBytes && isImmutableBytes(value)) return value;
22
+ const copy = new Uint8Array(value);
23
+ return cloneImmutableBytes ? copy : markImmutableBytes(copy);
24
+ }
25
+ if (value instanceof ArrayBuffer) return value.slice(0);
26
+ if (value instanceof Date) return new Date(value.getTime());
27
+ if (value instanceof URL) return new URL(value.href);
28
+ if (Array.isArray(value)) return Object.freeze(value.map((item) => copyValue(item, cloneImmutableBytes)));
29
+ if (preservesIdentity(value)) return value;
30
+ if (!isRecordValue(value)) return value;
31
+ const copy = Object.create(null);
32
+ for (const key of Reflect.ownKeys(value)) {
33
+ if (Object.getOwnPropertyDescriptor(value, key)?.enumerable !== true) continue;
34
+ const observedValue = Reflect.get(value, key);
35
+ Object.defineProperty(copy, key, {
36
+ configurable: false,
37
+ enumerable: true,
38
+ value: copyValue(observedValue, cloneImmutableBytes),
39
+ writable: false
40
+ });
41
+ }
42
+ return Object.freeze(copy);
43
+ }
44
+ /**
45
+ * Copies author-owned values received by a declaration entry.
46
+ *
47
+ * Record values, arrays, dates, URLs, and byte views are isolated recursively. Enumerable getters are read
48
+ * at receipt, while behavior handles, sealed fonts, already-immutable bytes, and opaque objects
49
+ * keep their identity. This is a field-level authoring rule, not a general document clone.
50
+ */
51
+ function snapshotValue(value) {
52
+ return copyValue(value, false);
53
+ }
54
+ /**
55
+ * Clones internal declaration values for public inspection (`CommonNode.prototype.props`),
56
+ * always returning fresh unmarked `Uint8Array` copies so external reads cannot mutate internal
57
+ * `immutableBytes` buffers.
58
+ */
59
+ function cloneExternalValue(value) {
60
+ return copyValue(value, true);
61
+ }
62
+ export { cloneExternalValue, snapshotValue };
@@ -0,0 +1,7 @@
1
+ // ../core/dist/kernel/layout-definition.js
2
+ const slideLayoutDefinitionSymbol = Symbol.for("@pptxdk/core/slide-layout-definition");
3
+ /** Checks whether a runtime value was produced by `defineSlideLayout`. */
4
+ function isSlideLayoutDefinition(value) {
5
+ return typeof value === "object" && value !== null && slideLayoutDefinitionSymbol in value;
6
+ }
7
+ export { isSlideLayoutDefinition, slideLayoutDefinitionSymbol };
@@ -1,15 +1,10 @@
1
- import { BuildError } from "./diagnostics.js";
2
- // ../core/dist/layout-protocol.js
3
- function failLayoutProtocol(path, code, message) {
4
- throw new BuildError([{
5
- severity: "error",
6
- path,
7
- code,
8
- message
9
- }]);
1
+ import { BuildError, toBuildDiagnostic } from "./diagnostics.js";
2
+ // ../core/dist/kernel/layout-protocol.js
3
+ function failLayoutProtocol(path, code, message, field) {
4
+ throw new BuildError([toBuildDiagnostic(path, code, message, field === void 0 ? void 0 : { field })]);
10
5
  }
11
6
  function parseLayoutNumber(value, name, path) {
12
- if (typeof value !== "number" || !Number.isFinite(value)) failLayoutProtocol(path, "invalid-layout-style", `${name} must be a finite pixel number`);
7
+ if (typeof value !== "number" || !Number.isFinite(value)) failLayoutProtocol(path, "invalid-layout-style", `${name} must be a finite pixel number`, `style.${name}`);
13
8
  return value;
14
9
  }
15
10
  function parseLayoutSpacing(value, name, path) {