@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,527 +0,0 @@
1
- import { CapabilityError } from "../../../core/dist/diagnostics.js";
2
- import "../../../core/dist/capability.js";
3
- import { CommonContainer } from "../../../core/dist/document.js";
4
- import { breatheOptionsSchema, easingSchema, effectDelaySchema, effectDurationSchema, effectPresetSchema, entranceEffectSchema, intervalMsSchema, maxRepeatCount, maximumTimeNodeValue, motionDirectionSchema, motionGranularitySchema, motionHexColorSchema, motionMomentOffsetSchema, motionMomentSchema, motionScopeAuthorPropsSchema, motionScopeHandleSchema, motionScopeModeSchema, motionStepAuthorPropsSchema, ownerMotionSchema, repeatCountSchema, spinAngleSchema } from "./motion-schemas.js";
5
- // ../capabilities/dist/motion/motion-api.js
6
- /** Creates the editable orchestration scope shared by the command factory and the JSX entry. */
7
- function createMotionScopeNode(props) {
8
- return new CommonContainer("motion-scope", "motion-scope", props);
9
- }
10
- /** Creates the editable click-step container shared by the command factory and the JSX entry. */
11
- function createMotionStepNode(props) {
12
- return new CommonContainer("motion-step", "motion-step", props);
13
- }
14
- let nextMotionIdentity = 1;
15
- function createMotionIdentity(kind) {
16
- return `pptxdk-${kind}-${nextMotionIdentity++}`;
17
- }
18
- /**
19
- * Creates a React-independent scope identity and its start/end/named moments.
20
- *
21
- * The returned handle keeps its identity when nodes are moved or rebuilt. React authoring keeps one
22
- * handle per component instance and passes it to `MotionScope`, while plain authoring can create it
23
- * directly. Cues are values derived from the same identity, not React keys or author ids.
24
- */
25
- function createMotionScopeHandle() {
26
- const identity = createMotionIdentity("scope");
27
- const moment = (point, name) => Object.freeze({
28
- type: "motion-moment",
29
- scope: identity,
30
- point,
31
- ...name === void 0 ? {} : { name }
32
- });
33
- return Object.freeze({
34
- type: "motion-scope-handle",
35
- identity,
36
- start: moment("start"),
37
- end: moment("end"),
38
- cue(name) {
39
- if (typeof name !== "string" || name.trim() === "") throw new TypeError("MotionScopeHandle.cue(name) requires a non-empty name");
40
- return moment("named", name);
41
- }
42
- });
43
- }
44
- /** Creates the stable identity used by an automatic Step host without React. */
45
- function createMotionStepIdentity() {
46
- return createMotionIdentity("step");
47
- }
48
- /** Schedules an explicit non-negative offset after any moment handle. */
49
- function after(timing, offsetMs) {
50
- const offset = timing.type === "motion-offset" ? timing.offsetMs + offsetMs : offsetMs;
51
- return Object.freeze({
52
- type: "motion-offset",
53
- moment: timing.type === "motion-offset" ? timing.moment : timing,
54
- offsetMs: offset
55
- });
56
- }
57
- function declaration(kind, preset, options, defaults, extra = {}) {
58
- const easing = options.easing;
59
- const normalizedEasing = typeof easing === "object" && easing !== null && !Array.isArray(easing) ? Object.freeze({ ...easing }) : easing;
60
- return Object.freeze({
61
- ...options,
62
- type: "effect",
63
- kind,
64
- preset,
65
- duration: options.duration === void 0 ? defaults.duration : options.duration,
66
- delay: options.delay === void 0 ? 0 : options.delay,
67
- ...extra,
68
- ...easing === void 0 ? {} : { easing: normalizedEasing }
69
- });
70
- }
71
- /** Creates pure fade-in declaration; default duration is 500 ms. */
72
- function fade(options = {}) {
73
- return declaration("entrance", "fade", options, { duration: 500 });
74
- }
75
- /** Wipes in from specified edge; default direction is bottom. */
76
- function wipe(options = {}) {
77
- return declaration("entrance", "wipe", options, { duration: 500 }, { from: options.from === void 0 ? "bottom" : options.from });
78
- }
79
- /** Zooms in from origin and fades in. */
80
- function zoom(options = {}) {
81
- return declaration("entrance", "zoom", options, { duration: 500 });
82
- }
83
- /** Flies in from specified slide edge; default direction is bottom. */
84
- function fly(options = {}) {
85
- return declaration("entrance", "fly", options, { duration: 500 }, { from: options.from === void 0 ? "bottom" : options.from });
86
- }
87
- /** Fades in and floats up. */
88
- function floatUp(options = {}) {
89
- return declaration("entrance", "floatUp", options, { duration: 500 });
90
- }
91
- /** Fades in and floats down from above; default duration is 500 ms. */
92
- function floatDown(options = {}) {
93
- return declaration("entrance", "floatDown", options, { duration: 500 });
94
- }
95
- /** Zooms, rotates, and fades in. */
96
- function spinIn(options = {}) {
97
- return declaration("entrance", "spinIn", options, { duration: 500 });
98
- }
99
- /** Stretches from center line. */
100
- function stretch(options = {}) {
101
- return declaration("entrance", "stretch", options, { duration: 500 });
102
- }
103
- /** Rotates back to initial orientation from specified angle, or rotates relative to initial angle using signed by; default from is 360 degrees. */
104
- function spin(options = {}) {
105
- return declaration("emphasis", "spin", options, { duration: 1e3 }, typeof options.by === "number" ? options.from === void 0 ? {} : { from: options.from } : { from: options.from === void 0 ? 360 : options.from });
106
- }
107
- /** Changes from from to to and maintains terminal state; non-repeating, non-reversing, default duration is 500 ms. */
108
- function fillColor(options) {
109
- const { from, to, ...timing } = options;
110
- return Object.freeze({
111
- ...declaration("emphasis", "fillColor", timing, { duration: 500 }),
112
- kind: "emphasis",
113
- preset: "fillColor",
114
- fromColor: from,
115
- toColor: to
116
- });
117
- }
118
- const breatheUnknownParameters = Symbol("breathe unknown parameters");
119
- const breatheOptionNames = /* @__PURE__ */ new Set([
120
- ...Object.keys(breatheOptionsSchema.unwrap().shape),
121
- "by",
122
- "intervalMs"
123
- ]);
124
- /** Declares dark->light half-cycle of Shape fill color; native autoRev reverses it to form a full cycle. */
125
- function breathe(options) {
126
- const { period, delay = 0, from, to } = options;
127
- const optionRecord = options;
128
- const by = optionRecord["by"];
129
- const intervalMs = optionRecord["intervalMs"];
130
- const unknownParameters = Object.keys(optionRecord).filter((key) => !breatheOptionNames.has(key));
131
- const rawEasing = options.easing;
132
- const easing = isRecord(rawEasing) ? Object.freeze({ ...rawEasing }) : rawEasing;
133
- return Object.freeze({
134
- type: "effect",
135
- kind: "emphasis",
136
- preset: "breathe",
137
- duration: period,
138
- delay,
139
- fromColor: from,
140
- toColor: to,
141
- ...easing === void 0 ? {} : { easing },
142
- ...by === void 0 ? {} : { by },
143
- ...intervalMs === void 0 ? {} : { intervalMs },
144
- ...unknownParameters.length === 0 ? {} : { [breatheUnknownParameters]: unknownParameters }
145
- });
146
- }
147
- /** Wraps supported effect with specified total rounds; forever applies only to breathe. */
148
- function repeat(effect, count) {
149
- return Object.freeze({
150
- type: "repeated-effect",
151
- effect,
152
- count
153
- });
154
- }
155
- function fail(code, message) {
156
- throw new CapabilityError(code, message);
157
- }
158
- /** Validates the local motion enable flag during capability parsing. */
159
- function validateMotionFlag(value) {
160
- if (value !== void 0 && typeof value !== "boolean") fail("invalid-motion", "motion must be a boolean");
161
- }
162
- function isRecord(value) {
163
- return typeof value === "object" && value !== null && !Array.isArray(value);
164
- }
165
- const presetKinds = {
166
- fade: "entrance",
167
- wipe: "entrance",
168
- zoom: "entrance",
169
- fly: "entrance",
170
- floatUp: "entrance",
171
- floatDown: "entrance",
172
- spinIn: "entrance",
173
- stretch: "entrance",
174
- spin: "emphasis",
175
- breathe: "emphasis",
176
- fillColor: "emphasis"
177
- };
178
- const effectKeys = Object.keys(entranceEffectSchema.unwrap().shape);
179
- function normalizeColor(value, name, code = "invalid-breathe-color") {
180
- const parsed = motionHexColorSchema.safeParse(value);
181
- if (!parsed.success) return fail(code, `${name} must be a #RRGGBB color`);
182
- return parsed.data;
183
- }
184
- function relativeLuminance(color) {
185
- const linear = [
186
- 1,
187
- 3,
188
- 5
189
- ].map((offset) => Number.parseInt(color.slice(offset, offset + 2), 16) / 255).map((channel) => channel <= .04045 ? channel / 12.92 : ((channel + .055) / 1.055) ** 2.4);
190
- return .2126 * (linear[0] ?? 0) + .7152 * (linear[1] ?? 0) + .0722 * (linear[2] ?? 0);
191
- }
192
- function validatedEffect(value, expected) {
193
- let repeatCount;
194
- let repeatDeclared = false;
195
- let effectValue = value;
196
- if (isRecord(value) && value["type"] === "repeated-effect") {
197
- repeatDeclared = true;
198
- const unknownRepeatField = Object.keys(value).find((key) => key !== "type" && key !== "effect" && key !== "count");
199
- if (unknownRepeatField !== void 0) return fail("unknown-parameter", `repeat declaration contains unimplemented parameter ${unknownRepeatField}`);
200
- if (!isRecord(value["effect"]) || value["effect"]["type"] !== "effect") return fail("invalid-repeat", "repeat must directly wrap a single effect declaration");
201
- repeatCount = value["count"];
202
- effectValue = value["effect"];
203
- }
204
- if (!isRecord(effectValue) || effectValue["type"] !== "effect") return fail("invalid-motion", expected === "entrance" ? "enter must be an entrance effect declaration such as fade() or wipe()" : "emphasis must be an emphasis effect declaration such as spin()");
205
- const unsupportedBreatheParameters = effectValue[breatheUnknownParameters];
206
- if (unsupportedBreatheParameters?.length) return fail("unknown-parameter", `breathe declaration contains unimplemented parameter ${unsupportedBreatheParameters[0]}`);
207
- const unknown = Object.keys(effectValue).find((key) => !effectKeys.includes(key));
208
- if (unknown !== void 0) return fail("unknown-parameter", `Animation effect contains unimplemented parameter ${unknown}`);
209
- if (effectValue["kind"] !== expected) return fail("invalid-motion", expected === "entrance" ? `${String(effectValue["preset"])}() is an emphasis effect and should be passed to emphasis` : `${String(effectValue["preset"])}() is an entrance effect and should be passed to enter`);
210
- const parsedPreset = effectPresetSchema.safeParse(effectValue["preset"]);
211
- if (!parsedPreset.success) return fail("unsupported-effect", `Unsupported animation effect ${String(effectValue["preset"])}`);
212
- const preset = parsedPreset.data;
213
- if (preset !== "breathe" && presetKinds[preset] !== expected) return fail("invalid-motion", expected === "entrance" ? `${preset}() is an emphasis effect and should be passed to emphasis` : `${preset}() is an entrance effect and should be passed to enter`);
214
- const parsedDuration = effectDurationSchema.safeParse(effectValue["duration"]);
215
- if (!parsedDuration.success) return fail("invalid-duration", "Animation duration must be writable as a finite positive integer in milliseconds");
216
- const duration = parsedDuration.data;
217
- const parsedDelay = effectDelaySchema.safeParse(effectValue["delay"]);
218
- if (!parsedDelay.success || !Number.isFinite(Math.round(parsedDelay.data) + Math.round(duration))) return fail("invalid-delay", "Animation delay must be writable as a finite non-negative integer in milliseconds");
219
- const delay = parsedDelay.data;
220
- if (preset === "breathe" && Math.round(delay) > 4294967295) return fail("invalid-delay", "breathe delay exceeds native timing value range");
221
- const by = effectValue["by"];
222
- const interval = effectValue["intervalMs"];
223
- if (preset === "spin" && typeof by === "number") {
224
- if (!spinAngleSchema.safeParse(by).success) return fail("invalid-rotation", "spin by converted value must fall within signed 32-bit angle range");
225
- if (effectValue["from"] !== void 0) return fail("invalid-motion", "spin from and by cannot be declared simultaneously");
226
- } else if (by !== void 0 && !motionGranularitySchema.safeParse(by).success) return fail("invalid-motion", "by must be a supported text or chart granularity");
227
- if (interval !== void 0 && (by !== "word" && by !== "letter" || !intervalMsSchema.safeParse(interval).success)) return fail("invalid-motion-interval", "intervalMs applies only to per-word or per-letter effects, and must be a positive integer in milliseconds");
228
- if ((preset === "wipe" || preset === "fly") && !motionDirectionSchema.safeParse(effectValue["from"]).success) return fail("invalid-direction", `${preset} from must be a valid direction`);
229
- if (preset === "spin") {
230
- const from = effectValue["from"];
231
- if (typeof by !== "number" && !spinAngleSchema.safeParse(from).success) return fail("invalid-rotation", "spin from converted value must fall within signed 32-bit angle range");
232
- }
233
- if (preset !== "wipe" && preset !== "fly" && preset !== "spin" && effectValue["from"] !== void 0) return fail("invalid-motion", `${preset} does not accept from parameter`);
234
- const easing = effectValue["easing"];
235
- if (easing !== void 0) {
236
- if (!isRecord(easing)) return fail("invalid-easing", "easing must be an object");
237
- const parsedEasing = easingSchema.safeParse(easing);
238
- if (!parsedEasing.success) {
239
- const issue = parsedEasing.error.issues[0];
240
- if (issue?.code === "unrecognized_keys" && issue.keys[0] !== void 0) return fail("unknown-parameter", `easing contains unimplemented parameter ${issue.keys[0]}`);
241
- return fail("invalid-easing", "easing accelerate and decelerate proportions must be non-negative and sum to at most 1");
242
- }
243
- }
244
- let fromColor;
245
- let toColor;
246
- if (preset === "breathe") {
247
- if (expected !== "emphasis") return fail("invalid-motion", "breathe() must be passed to emphasis");
248
- if (typeof duration !== "number" || !Number.isSafeInteger(duration) || duration < 2 || duration % 2 !== 0 || duration / 2 > 4294967295) return fail("invalid-breathe-period", "breathe period must be an even integer in milliseconds greater than 1, and half-period must be writable to native duration");
249
- fromColor = normalizeColor(effectValue["fromColor"], "breathe.from");
250
- toColor = normalizeColor(effectValue["toColor"], "breathe.to");
251
- if (relativeLuminance(toColor) <= relativeLuminance(fromColor)) return fail("invalid-breathe-colors", "breathe.to must be brighter than breathe.from");
252
- } else if (preset === "fillColor") {
253
- fromColor = normalizeColor(effectValue["fromColor"], "fillColor.from", "invalid-fill-color");
254
- toColor = normalizeColor(effectValue["toColor"], "fillColor.to", "invalid-fill-color");
255
- if (by !== void 0 || interval !== void 0) return fail("invalid-motion", "fillColor does not support text or chart granularity");
256
- } else if (effectValue["fromColor"] !== void 0 || effectValue["toColor"] !== void 0) return fail("invalid-motion", `${String(preset)} does not accept breathe color parameters`);
257
- if (repeatDeclared) {
258
- if (preset !== "spin" && preset !== "breathe") return fail("unsupported-repeat", `${String(preset)} does not support repetition yet; currently only spin and breathe are supported`);
259
- if (repeatCount === "forever") {
260
- if (preset !== "breathe") return fail("unsupported-repeat", "forever currently only supports complete breathe cycles");
261
- } else if (!repeatCountSchema.safeParse(repeatCount).success) return fail("invalid-repeat-count", `repeat count must be total rounds between 1 and ${maxRepeatCount}`);
262
- if (typeof repeatCount === "number" && (!Number.isSafeInteger(Math.round(delay) + Math.round(duration) * repeatCount) || Math.round(delay) > 4294967295 || (preset === "breathe" ? duration / 2 : Math.round(duration)) > 4294967295 || repeatCount * 1e3 > 4294967295)) return fail("invalid-repeat-duration", "Repeated total duration must remain an exact integer in milliseconds and single round must not exceed native timing range");
263
- if (by !== void 0 && typeof by !== "number") return fail("unsupported-repeat-combination", "Repeated effects cannot currently be combined with per-paragraph, per-word, per-letter, or chart granularity");
264
- if (!repeatCountSchema.safeParse(repeatCount).success) return fail("invalid-repeat-count", `repeat count must be total rounds between 1 and ${maxRepeatCount}`);
265
- }
266
- return {
267
- ...effectValue,
268
- ...repeatCount === void 0 ? {} : { repeatCount },
269
- ...fromColor === void 0 ? {} : { fromColor },
270
- ...toColor === void 0 ? {} : { toColor }
271
- };
272
- }
273
- function stepDeclarationFromProps(props) {
274
- const number = props["n"];
275
- if (number === void 0) {
276
- const identity = props["stepIdentity"];
277
- if (typeof identity !== "string" || identity === "") return fail("invalid-step", "Automatic click step lacks instance identity");
278
- return Object.freeze({
279
- mode: "automatic",
280
- identity
281
- });
282
- }
283
- const parsed = motionStepAuthorPropsSchema.safeParse({ n: number });
284
- if (!parsed.success || parsed.data.n === void 0) return fail("invalid-step", "Explicit click step number must be a positive integer");
285
- return Object.freeze({
286
- mode: "explicit",
287
- number: parsed.data.n
288
- });
289
- }
290
- function listed(value, many) {
291
- if (value === void 0) return [];
292
- return many && Array.isArray(value) ? value : [value];
293
- }
294
- function validatedMoment(value) {
295
- const parsed = motionMomentSchema.safeParse(value);
296
- if (!parsed.success) {
297
- if (!isRecord(value) || value["type"] !== "motion-moment") return fail("invalid-moment", "Moment handle must come from a motion scope handle.");
298
- return fail("invalid-moment", "Moment handle scope, type, or name is invalid");
299
- }
300
- return parsed.data;
301
- }
302
- function validatedTiming(value) {
303
- if (isRecord(value) && value["type"] === "motion-offset") {
304
- const moment = validatedMoment(value["moment"]);
305
- const parsed = motionMomentOffsetSchema.safeParse({
306
- type: "motion-offset",
307
- moment,
308
- offsetMs: value["offsetMs"]
309
- });
310
- if (!parsed.success) return fail("invalid-delay", "Moment offset must be a finite non-negative integer in milliseconds");
311
- return Object.freeze(parsed.data);
312
- }
313
- return validatedMoment(value);
314
- }
315
- function validatedPublisher(value) {
316
- if (value === void 0) return void 0;
317
- const momentValue = validatedMoment(value);
318
- if (momentValue.point !== "named") return fail("invalid-moment", "publishStart and publishEnd require named moment handles");
319
- return momentValue;
320
- }
321
- const motionScopeAllowedParameters = new Set(Object.keys(motionScopeAuthorPropsSchema.unwrap().shape));
322
- const motionStepAllowedParameters = /* @__PURE__ */ new Set([...Object.keys(motionStepAuthorPropsSchema.unwrap().shape), "stepIdentity"]);
323
- function localScopeDeclaration(props) {
324
- const unknown = Object.keys(props).find((key) => !motionScopeAllowedParameters.has(key));
325
- if (unknown !== void 0) return fail("unknown-parameter", `MotionScope contains unimplemented parameter ${unknown}`);
326
- validateMotionFlag(props["motion"]);
327
- const parsedHandle = motionScopeHandleSchema.safeParse(props["scope"]);
328
- if (!parsedHandle.success) return fail("invalid-scope", "MotionScope requires a handle created by createMotionScopeHandle() or useMotionScope()");
329
- const handle = parsedHandle.data;
330
- const parsedMode = motionScopeModeSchema.safeParse(props["mode"] ?? "parallel");
331
- if (!parsedMode.success) return fail("invalid-scope", "MotionScope mode must be parallel, sequence, or stagger");
332
- const mode = parsedMode.data;
333
- const parsedDelay = effectDelaySchema.safeParse(props["delay"] ?? 0);
334
- if (!parsedDelay.success) return fail("invalid-delay", "MotionScope delay must be a finite non-negative integer in milliseconds");
335
- const delay = parsedDelay.data;
336
- const each = props["each"];
337
- if (mode === "stagger" && (typeof each !== "number" || !Number.isFinite(each) || each < 0 || !Number.isSafeInteger(Math.round(each))) || mode !== "stagger" && each !== void 0) return fail("invalid-scope", "stagger requires non-negative integer each; other modes do not accept each");
338
- const startAt = props["startAt"] === void 0 ? void 0 : validatedTiming(props["startAt"]);
339
- const publishStart = validatedPublisher(props["publishStart"]);
340
- const publishEnd = validatedPublisher(props["publishEnd"]);
341
- return Object.freeze({
342
- identity: handle.identity,
343
- mode,
344
- delay: Math.round(delay),
345
- ...typeof each === "number" ? { each: Math.round(each) } : {},
346
- ...startAt === void 0 ? {} : { startAt },
347
- ...publishStart === void 0 ? {} : { publishStart },
348
- ...publishEnd === void 0 ? {} : { publishEnd }
349
- });
350
- }
351
- /** Compiles explicit scope host into a local declaration resolved against the current document tree. */
352
- function motionScopeAnnotation(input) {
353
- const scope = localScopeDeclaration(input);
354
- return {
355
- capability: "motion",
356
- value: Object.freeze({
357
- type: "scope",
358
- scope,
359
- enabled: input["motion"] !== false
360
- }),
361
- resolveContributions: resolveMotionContributions
362
- };
363
- }
364
- /** Validates Step wrapper parameters and emits a transparent step annotation resolved by tree order. */
365
- function motionStepAnnotation(input) {
366
- const unknown = Object.keys(input).find((key) => !motionStepAllowedParameters.has(key));
367
- if (unknown !== void 0) return fail("unknown-parameter", `Step contains unimplemented parameter ${unknown}`);
368
- const step = stepDeclarationFromProps(input);
369
- return [{
370
- capability: "motion",
371
- optional: true,
372
- value: Object.freeze({
373
- type: "step",
374
- step
375
- }),
376
- resolveContributions: resolveMotionContributions
377
- }];
378
- }
379
- function localMotionValue(props, target) {
380
- const enter = props["enter"];
381
- const effects = [...listed(enter, true).map((value) => validatedEffect(value, "entrance")), ...listed(props["emphasis"], false).map((value) => validatedEffect(value, "emphasis"))];
382
- if (effects.some(({ preset }) => preset === "breathe" && (target.kind !== "shape" || !target.filled))) return fail("invalid-breathe-target", "breathe() requires native Shape with solid fill; Group requires effects declared on real members separately");
383
- if (effects.some(({ preset }) => preset === "fillColor" && (target.kind !== "shape" || !target.solidFilled))) return fail("invalid-fill-color-target", "fillColor() requires native Shape with solid fill");
384
- return Object.freeze({
385
- target: Object.freeze({ ...target }),
386
- enterDeclared: enter !== void 0,
387
- effects: Object.freeze(effects)
388
- });
389
- }
390
- /** Converts object animation declarations into local annotations consumed by motion slide capability. */
391
- function motionAnnotations(props, target) {
392
- validateMotionFlag(props["motion"]);
393
- if (props["motion"] === false) return [];
394
- const value = localMotionValue(props, target);
395
- return [{
396
- capability: "motion",
397
- optional: value.effects.length === 0,
398
- value,
399
- resolveContributions: resolveMotionContributions
400
- }];
401
- }
402
- /**
403
- * Converts container motion scope overrides and optional native target animation declarations into
404
- * local annotations consumed by motion slide capability without inspecting raw container props later.
405
- */
406
- function motionContainerAnnotations(props, target, options = {}) {
407
- validateMotionFlag(props["motion"]);
408
- const enabled = props["motion"] !== false;
409
- const propagatesDefaultEnter = options.propagatesDefaultEnter === true;
410
- let defaultEnter;
411
- if (enabled && propagatesDefaultEnter && props["enter"] !== void 0) defaultEnter = Object.freeze(listed(props["enter"], true).map((effect) => validatedEffect(effect, "entrance")));
412
- const annotations = [];
413
- if (!enabled || defaultEnter !== void 0) annotations.push({
414
- capability: "motion",
415
- optional: true,
416
- value: Object.freeze({
417
- type: "container",
418
- enabled,
419
- ...defaultEnter === void 0 ? {} : { defaultEnter }
420
- }),
421
- resolveContributions: resolveMotionContributions
422
- });
423
- if (enabled && target !== void 0) annotations.push(...motionAnnotations(props, target));
424
- return annotations;
425
- }
426
- function isLocalMotionValue(value) {
427
- return isRecord(value) && isRecord(value["target"]) && typeof value["enterDeclared"] === "boolean" && Array.isArray(value["effects"]);
428
- }
429
- function isLocalScopeValue(value) {
430
- return isRecord(value) && value["type"] === "scope" && isRecord(value["scope"]) && typeof value["scope"]["identity"] === "string" && typeof value["enabled"] === "boolean";
431
- }
432
- function isLocalStepValue(value) {
433
- return isRecord(value) && value["type"] === "step" && isRecord(value["step"]);
434
- }
435
- function isLocalContainerValue(value) {
436
- return isRecord(value) && value["type"] === "container" && typeof value["enabled"] === "boolean";
437
- }
438
- /**
439
- * Resolves local motion declarations against the current declaration tree.
440
- *
441
- * Scope parent chains, nearest click step, inherited container default entrance, and disabled
442
- * ancestor chains are derived from submitted capability annotations along the build's structure.
443
- * Nothing here is stored on the editable nodes or read from raw container props, so moving or
444
- * appending content changes the next build's choreography without stale React context.
445
- *
446
- * The build passes only this capability's contributions, then uses the effective result for both
447
- * timing output and missing-capability checks.
448
- */
449
- function resolveMotionContributions(children, contributions) {
450
- const byDeclaration = /* @__PURE__ */ new WeakMap();
451
- for (const contribution of contributions) {
452
- const declaration = contribution.declaration;
453
- if (declaration === void 0) continue;
454
- const existing = byDeclaration.get(declaration);
455
- byDeclaration.set(declaration, existing === void 0 ? [contribution] : [...existing, contribution]);
456
- }
457
- const resolved = [];
458
- const visit = (node, frame) => {
459
- if (!("children" in node)) return;
460
- const localContributions = byDeclaration.get(node) ?? [];
461
- let childFrame = frame;
462
- const stepContribution = localContributions.find((contribution) => isLocalStepValue(contribution.value));
463
- const scopeContribution = localContributions.find((contribution) => isLocalScopeValue(contribution.value));
464
- const containerContribution = localContributions.find((contribution) => isLocalContainerValue(contribution.value));
465
- const localContribution = localContributions.find((contribution) => isLocalMotionValue(contribution.value));
466
- if (stepContribution !== void 0) {
467
- const localStep = stepContribution.value;
468
- childFrame = {
469
- ...childFrame,
470
- step: localStep.step
471
- };
472
- }
473
- if (scopeContribution !== void 0) {
474
- const local = scopeContribution.value;
475
- const enabled = childFrame.enabled && local.enabled;
476
- const parent = childFrame.scopes.at(-1);
477
- const scope = Object.freeze({
478
- ...local.scope,
479
- ...parent === void 0 ? {} : { parent: parent.identity },
480
- ...childFrame.step === void 0 ? {} : { step: childFrame.step }
481
- });
482
- resolved.push(Object.freeze({
483
- ...scopeContribution,
484
- value: Object.freeze({
485
- type: "scope",
486
- scope
487
- })
488
- }));
489
- childFrame = {
490
- ...childFrame,
491
- enabled,
492
- scopes: Object.freeze([...childFrame.scopes, scope])
493
- };
494
- }
495
- if (containerContribution !== void 0 || localContribution !== void 0) {
496
- const container = containerContribution?.value;
497
- const enabled = childFrame.enabled && (container === void 0 || container.enabled);
498
- if (localContribution !== void 0 && enabled) {
499
- const local = localContribution.value;
500
- const inherited = local.enterDeclared ? [] : childFrame.defaultEnter ?? [];
501
- const effects = Object.freeze([...inherited, ...local.effects]);
502
- if (effects.length > 0) resolved.push(Object.freeze({
503
- ...localContribution,
504
- optional: false,
505
- value: Object.freeze({
506
- target: local.target,
507
- ...childFrame.step === void 0 ? {} : { step: childFrame.step },
508
- scopes: childFrame.scopes,
509
- effects
510
- })
511
- }));
512
- }
513
- if (container !== void 0) childFrame = {
514
- ...childFrame,
515
- enabled,
516
- ...container.defaultEnter === void 0 ? {} : { defaultEnter: container.defaultEnter }
517
- };
518
- }
519
- for (const child of node.children) visit(child, childFrame);
520
- };
521
- for (const node of children) visit(node, {
522
- enabled: true,
523
- scopes: []
524
- });
525
- return resolved;
526
- }
527
- export { after, breathe, createMotionScopeHandle, createMotionScopeNode, createMotionStepIdentity, createMotionStepNode, fade, fillColor, floatDown, floatUp, fly, maximumTimeNodeValue, motionAnnotations, motionContainerAnnotations, motionScopeAnnotation, motionStepAnnotation, ownerMotionSchema, repeat, resolveMotionContributions, spin, spinIn, stretch, validateMotionFlag, wipe, zoom };