@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,9 +1,11 @@
1
- import { CommonContainer, CommonNode } from "../../../core/dist/document.js";
2
- import "../../../import/dist/index.js";
3
- import { A_NS, P_NS } from "../../../import/dist/namespaces.js";
4
- import { ooxmlNonNegativeIntSchema, ooxmlPositiveIntSchema } from "../../../import/dist/xml-fragments.js";
5
- import { after, breathe, createMotionScopeHandle, createMotionScopeNode, createMotionStepIdentity, createMotionStepNode, fade, fillColor, floatDown, floatUp, fly, repeat, spin, spinIn, stretch, wipe, zoom } from "./motion-api.js";
6
- // ../capabilities/dist/motion/motion-import.js
1
+ import { after, appear, breathe, collapse, createMotionScopeHandle, createMotionScopeNode, createMotionStepIdentity, createMotionStepNode, disappear, fade, fadeOut, fillColor, floatDown, floatOut, floatUp, fly, flyOut, onStep, relativeLuminance, repeat, spin, spinIn, spinOut, stretch, wipe, wipeOut, zoom, zoomOut } from "../shared/motion-api.js";
2
+ import { maximumTimeNodeValue, spinAngleSchema } from "../shared/motion-schemas.js";
3
+ import { A_NS, P_NS } from "../../kernel/pptx-read/namespaces.js";
4
+ import { ooxmlNonNegativeIntSchema, ooxmlPositiveIntSchema } from "../../kernel/pptx-read/xml-fragments.js";
5
+ import { createParagraphNode } from "../shared/text-declaration.js";
6
+ import { CommonContainer, CommonNode, RichTextContainer } from "../../kernel/document.js";
7
+ import "../../kernel/pptx-read/index.js";
8
+ // ../core/dist/capabilities/motion/motion-import.js
7
9
  const supportedBehaviorNames = /* @__PURE__ */ new Set([
8
10
  "set",
9
11
  "anim",
@@ -11,10 +13,9 @@ const supportedBehaviorNames = /* @__PURE__ */ new Set([
11
13
  "animRot",
12
14
  "animClr"
13
15
  ]);
14
- const presetById = {
16
+ const entrancePresetById = {
17
+ 1: "appear",
15
18
  2: "fly",
16
- 8: "spin",
17
- 9: "fillColor",
18
19
  10: "fade",
19
20
  17: "stretch",
20
21
  22: "wipe",
@@ -23,6 +24,27 @@ const presetById = {
23
24
  49: "spinIn",
24
25
  53: "zoom"
25
26
  };
27
+ const emphasisPresetById = {
28
+ 8: "spin",
29
+ 9: "fillColor"
30
+ };
31
+ const exitPresetById = {
32
+ 1: "disappear",
33
+ 2: "flyOut",
34
+ 10: "fadeOut",
35
+ 17: "collapse",
36
+ 22: "wipeOut",
37
+ 42: "floatOut",
38
+ 47: "floatOut",
39
+ 49: "spinOut",
40
+ 53: "zoomOut"
41
+ };
42
+ function resolvePreset(presetClass, presetId, hasColorAnim, autoRev) {
43
+ if (presetId === void 0) return void 0;
44
+ if (presetClass === "emph") return emphasisPresetById[presetId] ?? (presetId === 0 && hasColorAnim && autoRev ? "breathe" : void 0);
45
+ if (presetClass === "exit") return exitPresetById[presetId];
46
+ if (presetClass === "entr") return entrancePresetById[presetId];
47
+ }
26
48
  const directionBySubtype = {
27
49
  1: "top",
28
50
  2: "right",
@@ -38,21 +60,30 @@ function locationFor(context, xpath, objectId, objectName) {
38
60
  ...objectName === void 0 ? {} : { objectName }
39
61
  };
40
62
  }
41
- function parsePositiveInt(raw) {
63
+ function parsePositiveInt(raw, maxValue) {
42
64
  if (raw === void 0) return void 0;
43
65
  const parsed = ooxmlPositiveIntSchema.safeParse(raw);
44
- return parsed.success ? parsed.data : void 0;
66
+ if (!parsed.success) return void 0;
67
+ if (maxValue !== void 0 && parsed.data > maxValue) return void 0;
68
+ return parsed.data;
45
69
  }
46
- function parseNonNegativeInt(raw) {
70
+ function parseNonNegativeInt(raw, maxValue) {
47
71
  if (raw === void 0) return void 0;
48
72
  const parsed = ooxmlNonNegativeIntSchema.safeParse(raw);
49
- return parsed.success ? parsed.data : void 0;
73
+ if (!parsed.success) return void 0;
74
+ if (maxValue !== void 0 && parsed.data > maxValue) return void 0;
75
+ return parsed.data;
50
76
  }
51
77
  function parseSignedInt(raw) {
52
78
  if (raw === void 0 || !/^-?\d+$/u.test(raw)) return void 0;
53
79
  const n = Number(raw);
54
80
  return Number.isSafeInteger(n) ? n : void 0;
55
81
  }
82
+ function parseRotationUnits(raw) {
83
+ const units = parseSignedInt(raw);
84
+ if (units === void 0) return void 0;
85
+ return spinAngleSchema.safeParse(units / 6e4).success ? units : void 0;
86
+ }
56
87
  function consumeTargetElement(tgtEl) {
57
88
  const refs = [];
58
89
  tgtEl.children(P_NS, "sldTgt");
@@ -100,13 +131,25 @@ function consumeTargetElement(tgtEl) {
100
131
  }
101
132
  return refs;
102
133
  }
103
- function consumeConditionList(condList) {
134
+ function consumeConditionList(condList, context, diagnostics) {
104
135
  if (condList === void 0) return [];
105
136
  const result = [];
106
137
  for (const cond of condList.children(P_NS, "cond")) {
107
138
  const evt = cond.attr("evt");
108
139
  const rawDelay = cond.attr("delay");
109
- const delayMs = rawDelay === void 0 || rawDelay === "indefinite" ? 0 : parseNonNegativeInt(rawDelay) ?? 0;
140
+ let delayMs = 0;
141
+ if (rawDelay !== void 0 && rawDelay !== "indefinite") {
142
+ const parsedDelay = parseNonNegativeInt(rawDelay, maximumTimeNodeValue);
143
+ if (parsedDelay !== void 0) delayMs = parsedDelay;
144
+ else if (context !== void 0 && diagnostics !== void 0) diagnostics.push({
145
+ code: "invalid-xml-value",
146
+ category: "corrupt-input",
147
+ disposition: "recovered",
148
+ location: locationFor(context, `${cond.xpath}/@delay`),
149
+ attributeOrElement: "p:cond/@delay",
150
+ rawValue: rawDelay
151
+ });
152
+ }
110
153
  const sourceId = parsePositiveInt(cond.child(P_NS, "tn")?.attr("val"));
111
154
  const tgtEl = cond.child(P_NS, "tgtEl");
112
155
  if (tgtEl !== void 0) consumeTargetElement(tgtEl);
@@ -187,10 +230,21 @@ function readBehaviorElement(behavior) {
187
230
  } else if (localName === "animClr") behavior.consumeAttr("clrSpc");
188
231
  else if (localName === "animRot") {}
189
232
  const rawRotFrom = localName === "animRot" ? behavior.attr("from") : void 0;
233
+ const rawRotTo = localName === "animRot" ? behavior.attr("to") : void 0;
190
234
  const rawRotBy = localName === "animRot" ? behavior.attr("by") : void 0;
191
- if (localName === "animRot") behavior.consumeAttr("to");
192
- const rotationFrom = parseSignedInt(rawRotFrom);
193
- const rotationBy = parseSignedInt(rawRotBy);
235
+ const rotationFrom = parseRotationUnits(rawRotFrom);
236
+ const rotationTo = parseRotationUnits(rawRotTo);
237
+ const rotationBy = parseRotationUnits(rawRotBy);
238
+ const invalidRotation = rawRotBy !== void 0 && rotationBy === void 0 ? {
239
+ attr: "by",
240
+ raw: rawRotBy
241
+ } : rawRotFrom !== void 0 && rotationFrom === void 0 ? {
242
+ attr: "from",
243
+ raw: rawRotFrom
244
+ } : rawRotTo !== void 0 && rotationTo === void 0 ? {
245
+ attr: "to",
246
+ raw: rawRotTo
247
+ } : void 0;
194
248
  const cBhvr = behavior.child(P_NS, "cBhvr");
195
249
  const additive = cBhvr?.attr("additive");
196
250
  cBhvr?.consumeAttr("accumulate");
@@ -198,7 +252,11 @@ function readBehaviorElement(behavior) {
198
252
  const innerCTn = cBhvr?.child(P_NS, "cTn");
199
253
  const innerAttrs = innerCTn === void 0 ? void 0 : consumeCommonTimeNodeAttrs(innerCTn);
200
254
  if (innerCTn !== void 0) consumeConditionList(innerCTn.child(P_NS, "stCondLst"));
201
- const durationMs = parsePositiveInt(innerAttrs?.dur);
255
+ const durationMs = parsePositiveInt(innerAttrs?.dur, maximumTimeNodeValue);
256
+ const invalidDuration = localName !== "set" && innerCTn !== void 0 && innerAttrs?.dur !== void 0 && innerAttrs.dur !== "indefinite" && durationMs === void 0 ? {
257
+ raw: innerAttrs.dur,
258
+ xpath: `${innerCTn.xpath}/@dur`
259
+ } : void 0;
202
260
  const tgtEl = cBhvr?.child(P_NS, "tgtEl");
203
261
  const targets = tgtEl === void 0 ? [] : consumeTargetElement(tgtEl);
204
262
  const attrNameLst = cBhvr?.child(P_NS, "attrNameLst");
@@ -226,12 +284,15 @@ function readBehaviorElement(behavior) {
226
284
  xpath: behavior.xpath,
227
285
  targets,
228
286
  ...durationMs === void 0 ? {} : { durationMs },
287
+ ...invalidDuration === void 0 ? {} : { invalidDuration },
229
288
  attrNames,
230
289
  ...additive === void 0 ? {} : { additive },
231
290
  ...fromColor === void 0 ? {} : { fromColor },
232
291
  ...toColor === void 0 ? {} : { toColor },
233
292
  ...rotationFrom === void 0 ? {} : { rotationFrom },
234
- ...rotationBy === void 0 ? {} : { rotationBy }
293
+ ...rotationTo === void 0 ? {} : { rotationTo },
294
+ ...rotationBy === void 0 ? {} : { rotationBy },
295
+ ...invalidRotation === void 0 ? {} : { invalidRotation }
235
296
  };
236
297
  }
237
298
  function buildEffectDeclaration(args) {
@@ -245,8 +306,16 @@ function buildEffectDeclaration(args) {
245
306
  ...typeof args.by === "string" ? { by: args.by } : {},
246
307
  ...args.intervalMs === void 0 ? {} : { intervalMs: args.intervalMs }
247
308
  };
309
+ const instantOptions = {
310
+ delay: args.delayMs,
311
+ ...typeof args.by === "string" ? { by: args.by } : {},
312
+ ...args.intervalMs === void 0 ? {} : { intervalMs: args.intervalMs }
313
+ };
248
314
  let effect;
249
315
  switch (args.preset) {
316
+ case "appear":
317
+ effect = appear(instantOptions);
318
+ break;
250
319
  case "fade":
251
320
  effect = fade(granularityOptions);
252
321
  break;
@@ -278,10 +347,13 @@ function buildEffectDeclaration(args) {
278
347
  effect = stretch(granularityOptions);
279
348
  break;
280
349
  case "spin":
281
- effect = spin({
350
+ effect = typeof args.by === "number" ? spin({
282
351
  ...baseOptions,
283
- ...typeof args.by === "number" ? { by: args.by } : {},
284
- ...typeof args.from === "number" ? { from: args.from } : {}
352
+ by: args.by
353
+ }) : spin({
354
+ ...granularityOptions,
355
+ ...typeof args.from === "number" ? { from: args.from } : {},
356
+ ...typeof args.to === "number" ? { to: args.to } : {}
285
357
  });
286
358
  break;
287
359
  case "breathe":
@@ -293,11 +365,41 @@ function buildEffectDeclaration(args) {
293
365
  ...args.easing === void 0 ? {} : { easing: args.easing }
294
366
  });
295
367
  break;
296
- case "fillColor": effect = fillColor({
297
- ...baseOptions,
298
- from: args.fromColor ?? "#000000",
299
- to: args.toColor ?? "#FFFFFF"
300
- });
368
+ case "fillColor":
369
+ effect = fillColor({
370
+ ...baseOptions,
371
+ from: args.fromColor ?? "#000000",
372
+ to: args.toColor ?? "#FFFFFF"
373
+ });
374
+ break;
375
+ case "disappear":
376
+ effect = disappear(instantOptions);
377
+ break;
378
+ case "fadeOut":
379
+ effect = fadeOut(granularityOptions);
380
+ break;
381
+ case "wipeOut":
382
+ effect = wipeOut({
383
+ ...granularityOptions,
384
+ ...typeof args.from === "string" ? { from: args.from } : {}
385
+ });
386
+ break;
387
+ case "flyOut":
388
+ effect = flyOut({
389
+ ...granularityOptions,
390
+ ...typeof args.from === "string" ? { from: args.from } : {}
391
+ });
392
+ break;
393
+ case "zoomOut":
394
+ effect = zoomOut(granularityOptions);
395
+ break;
396
+ case "floatOut":
397
+ effect = floatOut(granularityOptions);
398
+ break;
399
+ case "spinOut":
400
+ effect = spinOut(granularityOptions);
401
+ break;
402
+ case "collapse": effect = collapse(granularityOptions);
301
403
  }
302
404
  const declaration = args.repeatCount === void 0 ? effect : repeat(effect, args.repeatCount);
303
405
  return {
@@ -306,7 +408,42 @@ function buildEffectDeclaration(args) {
306
408
  };
307
409
  }
308
410
  function commonEffectPropsMatch(left, right) {
309
- return left.targetId === right.targetId && left.effect.preset === right.effect.preset && left.effect.kind === right.effect.kind && left.effect.duration === right.effect.duration && left.from === right.from && left.repeatCount === right.repeatCount && JSON.stringify(left.easing ?? null) === JSON.stringify(right.easing ?? null);
411
+ return left.targetId === right.targetId && left.effect.preset === right.effect.preset && left.effect.kind === right.effect.kind && left.effect.duration === right.effect.duration && left.from === right.from && left.to === right.to && left.repeatCount === right.repeatCount && JSON.stringify(left.easing ?? null) === JSON.stringify(right.easing ?? null);
412
+ }
413
+ function targetParagraphCount(node) {
414
+ if (node.kind !== "text" && node.kind !== "shape") return 0;
415
+ const explicitCount = node.children.filter((c) => c instanceof CommonNode && c.type === "paragraph").length;
416
+ if (explicitCount > 0) return explicitCount;
417
+ return node.children.length > 0 || node.kind === "text" ? 1 : 0;
418
+ }
419
+ function shapeFillState(node) {
420
+ if (node.kind !== "shape") return {
421
+ filled: false,
422
+ solidFilled: false
423
+ };
424
+ const style = node.props["style"];
425
+ if (typeof style !== "object" || style === null) return {
426
+ filled: false,
427
+ solidFilled: false
428
+ };
429
+ const background = style["background"];
430
+ if (background === void 0 || background === "none") return {
431
+ filled: false,
432
+ solidFilled: false
433
+ };
434
+ return {
435
+ filled: true,
436
+ solidFilled: typeof background === "string" || typeof background === "object" && background !== null && "color" in background && typeof background["color"] === "string"
437
+ };
438
+ }
439
+ function isValidRepeatModifier(args) {
440
+ const { preset, repeatCount, by, durationMs, delayMs } = args;
441
+ if (preset !== "spin" && preset !== "breathe") return false;
442
+ if (repeatCount === "forever") return preset === "breathe";
443
+ if (by !== void 0 && typeof by !== "number") return false;
444
+ if (!Number.isSafeInteger(repeatCount) || repeatCount < 1 || repeatCount > 4294967 || repeatCount * 1e3 > 4294967295) return false;
445
+ const unitDur = preset === "breathe" ? durationMs / 2 : Math.round(durationMs);
446
+ return Math.round(delayMs) <= 4294967295 && unitDur <= 4294967295 && Number.isSafeInteger(Math.round(delayMs) + Math.round(durationMs) * repeatCount);
310
447
  }
311
448
  /**
312
449
  * Reads slide, layout, or master `<p:timing>` back into live `enter`/`emphasis`,
@@ -379,6 +516,7 @@ function readSlideMotionImport(context) {
379
516
  const rootChildTnLst = rootCTn.child(P_NS, "childTnLst");
380
517
  let mainSeq;
381
518
  if (rootChildTnLst !== void 0) for (const childSeq of rootChildTnLst.children(P_NS, "seq")) {
519
+ if (context.mediaTimingBranches?.has(childSeq.element)) continue;
382
520
  childSeq.consumeAttr("concurrent");
383
521
  childSeq.consumeAttr("nextAc");
384
522
  const seqCTn = childSeq.child(P_NS, "cTn");
@@ -419,7 +557,7 @@ function readSlideMotionImport(context) {
419
557
  return;
420
558
  }
421
559
  const timingId = attrs.id;
422
- const conds = consumeConditionList(cTn.child(P_NS, "stCondLst"));
560
+ const conds = consumeConditionList(cTn.child(P_NS, "stCondLst"), context, diagnostics);
423
561
  let delayMs = 0;
424
562
  const dependsOn = [];
425
563
  for (const cond of conds) if (cond.kind === "delay") delayMs += cond.delayMs;
@@ -442,7 +580,17 @@ function readSlideMotionImport(context) {
442
580
  const rawType = iterateEl.attr("type");
443
581
  if (rawType === "wd") iterateBy = "word";
444
582
  else if (rawType === "lt") iterateBy = "letter";
445
- iterateIntervalMs = parsePositiveInt(iterateEl.child(P_NS, "tmAbs")?.attr("val"));
583
+ const tmAbs = iterateEl.child(P_NS, "tmAbs");
584
+ const rawInterval = tmAbs?.attr("val");
585
+ iterateIntervalMs = parsePositiveInt(rawInterval, maximumTimeNodeValue);
586
+ if (tmAbs !== void 0 && rawInterval !== void 0 && iterateIntervalMs === void 0) diagnostics.push({
587
+ code: "invalid-xml-value",
588
+ category: "corrupt-input",
589
+ disposition: "recovered",
590
+ location: locationFor(context, `${tmAbs.xpath}/@val`),
591
+ attributeOrElement: "p:tmAbs/@val",
592
+ rawValue: rawInterval
593
+ });
446
594
  iterateEl.consumeAttr("backwards");
447
595
  }
448
596
  const childTnLst = cTn.child(P_NS, "childTnLst");
@@ -523,7 +671,7 @@ function readSlideMotionImport(context) {
523
671
  });
524
672
  return timingId;
525
673
  };
526
- const stepPars = mainSeqChildren.children(P_NS, "par");
674
+ const stepPars = mainSeqChildren.children(P_NS, "par").filter((child) => !context.mediaTimingBranches?.has(child.element));
527
675
  for (let stepIndex = 0; stepIndex < stepPars.length; stepIndex += 1) {
528
676
  const stepPar = stepPars[stepIndex];
529
677
  const stepCTn = stepPar.child(P_NS, "cTn");
@@ -553,7 +701,7 @@ function readSlideMotionImport(context) {
553
701
  }
554
702
  const rootDiagnosticByNodeId = /* @__PURE__ */ new Map();
555
703
  const omittedNodeIds = /* @__PURE__ */ new Set();
556
- const isKnownSlideTarget = (spid) => context.placeholderKeyBySpid !== void 0 ? true : context.objectBySpid?.has(spid) === true;
704
+ const isKnownSlideTarget = (spid) => context.placeholderKeyBySpid?.has(spid) === true || context.objectBySpid?.has(spid) === true;
557
705
  for (const [timingId, rawNode] of rawNodesById) {
558
706
  if (rawNode.kind !== "effect") continue;
559
707
  if (rawNode.unsupportedBehavior !== void 0) {
@@ -572,7 +720,8 @@ function readSlideMotionImport(context) {
572
720
  rawNode.cursor.suppressUnconsumed();
573
721
  continue;
574
722
  }
575
- if ((rawNode.presetId === void 0 ? void 0 : presetById[rawNode.presetId] ?? (rawNode.presetId === 0 && rawNode.behaviors.some((b) => b.localName === "animClr") && rawNode.autoRev ? "breathe" : void 0)) === void 0) {
723
+ const preset = resolvePreset(rawNode.presetClass, rawNode.presetId, rawNode.behaviors.some((b) => b.localName === "animClr"), rawNode.autoRev);
724
+ if (preset === void 0) {
576
725
  const targetId = rawNode.targetIds[0];
577
726
  const diag = {
578
727
  code: "unsupported-mechanism",
@@ -588,6 +737,21 @@ function readSlideMotionImport(context) {
588
737
  rawNode.cursor.suppressUnconsumed();
589
738
  continue;
590
739
  }
740
+ const mediaTarget = rawNode.targetIds.find((id) => context.mediaSpids?.has(id));
741
+ if (mediaTarget !== void 0) {
742
+ rootDiagnosticByNodeId.set(timingId, {
743
+ code: "unsupported-mechanism",
744
+ category: "unsupported",
745
+ disposition: "omitted",
746
+ location: locationFor(context, rawNode.xpath, mediaTarget),
747
+ namespaceUri: P_NS,
748
+ localName: "spTgt",
749
+ mechanismHint: "graphic-motion-on-media"
750
+ });
751
+ omittedNodeIds.add(timingId);
752
+ rawNode.cursor.suppressUnconsumed();
753
+ continue;
754
+ }
591
755
  const missingTargetId = rawNode.targetIds.find((id) => !isKnownSlideTarget(id));
592
756
  if (rawNode.targetIds.length !== 1 || missingTargetId !== void 0) {
593
757
  const omittedInfo = missingTargetId === void 0 ? void 0 : context.omittedSpids?.get(missingTargetId);
@@ -605,6 +769,81 @@ function readSlideMotionImport(context) {
605
769
  rawNode.cursor.suppressUnconsumed();
606
770
  continue;
607
771
  }
772
+ const targetId = rawNode.targetIds[0];
773
+ const targetNode = context.objectBySpid?.get(targetId);
774
+ const omitInvalidEffect = (localName, mechanismHint) => {
775
+ rootDiagnosticByNodeId.set(timingId, {
776
+ code: "unsupported-mechanism",
777
+ category: "unsupported",
778
+ disposition: "omitted",
779
+ location: locationFor(context, rawNode.xpath, targetId),
780
+ namespaceUri: P_NS,
781
+ localName,
782
+ mechanismHint
783
+ });
784
+ omittedNodeIds.add(timingId);
785
+ rawNode.cursor.suppressUnconsumed();
786
+ };
787
+ if (rawNode.targetRange?.type === "paragraph" && targetNode !== void 0) {
788
+ const paraCount = targetParagraphCount(targetNode);
789
+ if (paraCount === 0 || rawNode.targetRange.end >= paraCount) {
790
+ omitInvalidEffect("pRg", "invalid-paragraph-range");
791
+ continue;
792
+ }
793
+ }
794
+ if (rawNode.targetRange?.type === "chart" && targetNode !== void 0 && targetNode.kind !== "chart") {
795
+ omitInvalidEffect("graphicEl", "invalid-chart-target");
796
+ continue;
797
+ }
798
+ if (preset === "fillColor") {
799
+ if (rawNode.targetRange !== void 0 || targetNode !== void 0 && !shapeFillState(targetNode).solidFilled) {
800
+ omitInvalidEffect("animClr", "invalid-fill-color-target");
801
+ continue;
802
+ }
803
+ }
804
+ if (preset === "breathe") {
805
+ const clrBehavior = rawNode.behaviors.find((b) => b.localName === "animClr");
806
+ const fromColor = clrBehavior?.fromColor ?? "#000000";
807
+ const toColor = clrBehavior?.toColor ?? "#FFFFFF";
808
+ if (rawNode.presetClass !== "emph" || rawNode.targetRange !== void 0 || targetNode !== void 0 && !shapeFillState(targetNode).filled) {
809
+ omitInvalidEffect("animClr", "invalid-breathe-target");
810
+ continue;
811
+ }
812
+ if (relativeLuminance(toColor) <= relativeLuminance(fromColor)) {
813
+ omitInvalidEffect("animClr", "invalid-breathe-colors");
814
+ continue;
815
+ }
816
+ }
817
+ const invalidDurationBehavior = rawNode.behaviors.find((b) => b.invalidDuration !== void 0);
818
+ if (invalidDurationBehavior?.invalidDuration !== void 0) {
819
+ rootDiagnosticByNodeId.set(timingId, {
820
+ code: "invalid-xml-value",
821
+ category: "corrupt-input",
822
+ disposition: "omitted",
823
+ location: locationFor(context, invalidDurationBehavior.invalidDuration.xpath, targetId),
824
+ attributeOrElement: "p:cTn/@dur",
825
+ rawValue: invalidDurationBehavior.invalidDuration.raw
826
+ });
827
+ omittedNodeIds.add(timingId);
828
+ rawNode.cursor.suppressUnconsumed();
829
+ continue;
830
+ }
831
+ if (preset === "spin") {
832
+ const rotBehavior = rawNode.behaviors.find((b) => b.localName === "animRot");
833
+ if (rotBehavior === void 0 || rotBehavior.invalidRotation !== void 0 || rotBehavior.rotationFrom === void 0 && rotBehavior.rotationBy === void 0 || rotBehavior.rotationFrom !== void 0 && rotBehavior.rotationBy !== void 0) {
834
+ rootDiagnosticByNodeId.set(timingId, {
835
+ code: "invalid-xml-value",
836
+ category: "corrupt-input",
837
+ disposition: "omitted",
838
+ location: locationFor(context, rotBehavior?.xpath ?? rawNode.xpath, targetId),
839
+ attributeOrElement: "p:animRot",
840
+ ...rotBehavior?.invalidRotation === void 0 ? {} : { rawValue: rotBehavior.invalidRotation.raw }
841
+ });
842
+ omittedNodeIds.add(timingId);
843
+ rawNode.cursor.suppressUnconsumed();
844
+ continue;
845
+ }
846
+ }
608
847
  }
609
848
  const directDependentsOf = /* @__PURE__ */ new Map();
610
849
  for (const [timingId, rawNode] of rawNodesById) for (const dep of rawNode.dependsOn) {
@@ -658,11 +897,20 @@ function readSlideMotionImport(context) {
658
897
  }
659
898
  for (const [rootId, diag] of rootDiagnosticByNodeId) {
660
899
  const cascaded = cascadedByRootDiag.get(rootId);
661
- if (cascaded !== void 0 && cascaded.length > 0) diagnostics.push({
900
+ if (cascaded !== void 0 && cascaded.length > 0 && diag.code === "unsupported-mechanism") diagnostics.push({
662
901
  ...diag,
663
902
  cascaded
664
903
  });
665
- else diagnostics.push(diag);
904
+ else {
905
+ diagnostics.push(diag);
906
+ if (cascaded !== void 0) for (const dep of cascaded) diagnostics.push({
907
+ code: "invalid-xml-value",
908
+ category: "corrupt-input",
909
+ disposition: "omitted",
910
+ location: dep.location,
911
+ attributeOrElement: "p:stCondLst/p:cond"
912
+ });
913
+ }
666
914
  }
667
915
  const survivingEffects = [];
668
916
  const collectStepEffects = (nodeId, accumulatedDelayMs, inheritedStartAfter) => {
@@ -670,47 +918,111 @@ function readSlideMotionImport(context) {
670
918
  const node = rawNodesById.get(nodeId);
671
919
  if (node === void 0) return;
672
920
  const dep = node.dependsOn[0];
673
- const effectiveDelayMs = dep !== void 0 ? dep.offsetMs : inheritedStartAfter !== void 0 ? inheritedStartAfter.offsetMs + node.delayMs : accumulatedDelayMs + node.delayMs;
674
- const effectiveStartAfter = dep !== void 0 && !omittedNodeIds.has(dep.timingId) ? dep : inheritedStartAfter;
921
+ let effectiveDelayMs = dep !== void 0 ? dep.offsetMs : inheritedStartAfter !== void 0 ? inheritedStartAfter.offsetMs + node.delayMs : accumulatedDelayMs + node.delayMs;
922
+ let effectiveStartAfter = dep !== void 0 && !omittedNodeIds.has(dep.timingId) ? dep : inheritedStartAfter;
675
923
  if (node.kind === "container") {
676
924
  for (const childId of node.childIds) collectStepEffects(childId, effectiveStartAfter === void 0 ? effectiveDelayMs : 0, effectiveStartAfter);
677
925
  return;
678
926
  }
679
- const preset = node.presetId === void 0 ? void 0 : presetById[node.presetId] ?? (node.presetId === 0 && node.behaviors.some((b) => b.localName === "animClr") && node.autoRev ? "breathe" : void 0);
927
+ const preset = resolvePreset(node.presetClass, node.presetId, node.behaviors.some((b) => b.localName === "animClr"), node.autoRev);
680
928
  if (preset === void 0 || node.targetIds.length !== 1) return;
681
929
  const targetId = node.targetIds[0];
682
- const kind = node.presetClass === "emph" ? "emphasis" : "entrance";
930
+ const kind = node.presetClass === "emph" ? "emphasis" : node.presetClass === "exit" ? "exit" : "entrance";
683
931
  const nonSetDurations = node.behaviors.filter((b) => b.localName !== "set").map((b) => b.durationMs).filter((d) => d !== void 0);
684
- const traversalDurationMs = nonSetDurations.length > 0 ? Math.max(...nonSetDurations) : 500;
932
+ const traversalDurationMs = nonSetDurations.length > 0 ? Math.max(...nonSetDurations) : preset === "appear" || preset === "disappear" ? 1 : 500;
685
933
  const durationMs = preset === "breathe" ? traversalDurationMs * 2 : traversalDurationMs;
686
- const easing = node.accel !== void 0 && node.accel !== 0 || node.decel !== void 0 && node.decel !== 0 ? {
687
- ...node.accel !== void 0 && node.accel !== 0 ? { accelerate: node.accel / 1e5 } : {},
688
- ...node.decel !== void 0 && node.decel !== 0 ? { decelerate: node.decel / 1e5 } : {}
689
- } : void 0;
934
+ if (!Number.isSafeInteger(effectiveDelayMs) || effectiveDelayMs < 0 || effectiveDelayMs > 4294967295 || !Number.isSafeInteger(effectiveDelayMs + durationMs)) {
935
+ diagnostics.push({
936
+ code: "invalid-xml-value",
937
+ category: "corrupt-input",
938
+ disposition: "recovered",
939
+ location: locationFor(context, node.xpath, targetId),
940
+ attributeOrElement: "p:cond/@delay",
941
+ rawValue: String(effectiveDelayMs)
942
+ });
943
+ effectiveDelayMs = 0;
944
+ if (effectiveStartAfter !== void 0) effectiveStartAfter = {
945
+ timingId: effectiveStartAfter.timingId,
946
+ offsetMs: 0
947
+ };
948
+ }
949
+ let easing;
950
+ if (node.accel !== void 0 && node.accel !== 0 || node.decel !== void 0 && node.decel !== 0) {
951
+ const accelRatio = node.accel !== void 0 && node.accel !== 0 ? node.accel / 1e5 : 0;
952
+ const decelRatio = node.decel !== void 0 && node.decel !== 0 ? node.decel / 1e5 : 0;
953
+ if (accelRatio < 0 || decelRatio < 0 || accelRatio + decelRatio > 1) diagnostics.push({
954
+ code: "invalid-xml-value",
955
+ category: "corrupt-input",
956
+ disposition: "recovered",
957
+ location: locationFor(context, node.xpath, targetId),
958
+ attributeOrElement: "p:cTn/@accel"
959
+ });
960
+ else easing = {
961
+ ...accelRatio > 0 ? { accelerate: accelRatio } : {},
962
+ ...decelRatio > 0 ? { decelerate: decelRatio } : {}
963
+ };
964
+ }
690
965
  let from;
691
- if (preset === "wipe" || preset === "fly") from = node.presetSubtype === void 0 ? void 0 : directionBySubtype[node.presetSubtype];
966
+ if (preset === "wipe" || preset === "wipeOut" || preset === "fly" || preset === "flyOut") from = node.presetSubtype === void 0 ? void 0 : directionBySubtype[node.presetSubtype];
967
+ let to;
692
968
  let by = node.iterateBy;
969
+ let iterateIntervalMs = node.iterateIntervalMs;
970
+ const targetNode = context.objectBySpid?.get(targetId);
971
+ if (by !== void 0 && (preset === "fillColor" || preset === "breathe" || preset === "spin" || targetNode !== void 0 && targetParagraphCount(targetNode) === 0)) {
972
+ diagnostics.push({
973
+ code: "invalid-xml-value",
974
+ category: "corrupt-input",
975
+ disposition: "recovered",
976
+ location: locationFor(context, node.xpath, targetId),
977
+ attributeOrElement: "p:cTn/p:iterate",
978
+ rawValue: by
979
+ });
980
+ by = void 0;
981
+ iterateIntervalMs = void 0;
982
+ }
693
983
  if (preset === "spin") {
694
984
  const rotBehavior = node.behaviors.find((b) => b.localName === "animRot");
695
985
  if (rotBehavior?.rotationBy !== void 0) by = rotBehavior.rotationBy / 6e4;
696
- else if (rotBehavior?.rotationFrom !== void 0) from = rotBehavior.rotationFrom / 6e4;
986
+ else {
987
+ if (rotBehavior?.rotationFrom !== void 0) from = rotBehavior.rotationFrom / 6e4;
988
+ if (rotBehavior?.rotationTo !== void 0 && rotBehavior.rotationTo !== 0) to = rotBehavior.rotationTo / 6e4;
989
+ }
697
990
  }
698
991
  const clrBehavior = node.behaviors.find((b) => b.localName === "animClr");
699
992
  const fromColor = clrBehavior?.fromColor;
700
993
  const toColor = clrBehavior?.toColor;
701
994
  if (!node.hasSetBehavior && kind === "entrance" && node.targetRange?.type === "paragraph" && (node.buildGroupId ?? 0) === 0) return;
995
+ let effectiveRepeatCount = node.repeatCount;
996
+ if (effectiveRepeatCount !== void 0 && !isValidRepeatModifier({
997
+ preset,
998
+ repeatCount: effectiveRepeatCount,
999
+ ...by === void 0 ? {} : { by },
1000
+ durationMs,
1001
+ delayMs: effectiveDelayMs
1002
+ })) {
1003
+ diagnostics.push({
1004
+ code: "invalid-xml-value",
1005
+ category: "corrupt-input",
1006
+ disposition: "recovered",
1007
+ location: locationFor(context, node.xpath, targetId),
1008
+ attributeOrElement: "p:cTn/@repeatCount",
1009
+ rawValue: String(effectiveRepeatCount)
1010
+ });
1011
+ effectiveRepeatCount = void 0;
1012
+ }
702
1013
  const built = buildEffectDeclaration({
703
1014
  preset,
704
1015
  kind,
705
1016
  durationMs,
706
1017
  delayMs: effectiveDelayMs,
707
1018
  ...from === void 0 ? {} : { from },
1019
+ ...to === void 0 ? {} : { to },
708
1020
  ...fromColor === void 0 ? {} : { fromColor },
709
1021
  ...toColor === void 0 ? {} : { toColor },
710
1022
  ...easing === void 0 ? {} : { easing },
711
1023
  ...by === void 0 ? {} : { by },
712
- ...node.iterateIntervalMs === void 0 ? {} : { intervalMs: node.iterateIntervalMs },
713
- ...node.repeatCount === void 0 ? {} : { repeatCount: node.repeatCount }
1024
+ ...iterateIntervalMs === void 0 ? {} : { intervalMs: iterateIntervalMs },
1025
+ ...effectiveRepeatCount === void 0 ? {} : { repeatCount: effectiveRepeatCount }
714
1026
  });
715
1027
  survivingEffects.push({
716
1028
  effect: built.effect,
@@ -727,29 +1039,61 @@ function readSlideMotionImport(context) {
727
1039
  startAfterOffsetMs: effectiveStartAfter.offsetMs
728
1040
  },
729
1041
  ...easing === void 0 ? {} : { easing },
730
- ...node.repeatCount === void 0 ? {} : { repeatCount: node.repeatCount },
1042
+ ...effectiveRepeatCount === void 0 ? {} : { repeatCount: effectiveRepeatCount },
731
1043
  ...from === void 0 ? {} : { from },
1044
+ ...to === void 0 ? {} : { to },
732
1045
  ...by === void 0 ? {} : { by },
733
- ...node.iterateIntervalMs === void 0 ? {} : { intervalMs: node.iterateIntervalMs },
1046
+ ...iterateIntervalMs === void 0 ? {} : { intervalMs: iterateIntervalMs },
734
1047
  ...fromColor === void 0 ? {} : { fromColor },
735
1048
  ...toColor === void 0 ? {} : { toColor }
736
1049
  });
737
1050
  };
738
1051
  for (const step of stepInfos) for (const rootId of step.rootChildIds) collectStepEffects(rootId, 0, void 0);
739
1052
  if (context.placeholderKeyBySpid !== void 0) {
1053
+ const placeholdersProp = context.slideNode.props["placeholders"];
1054
+ const placeholderCount = typeof placeholdersProp === "object" && placeholdersProp !== null && !Array.isArray(placeholdersProp) ? Object.keys(placeholdersProp).length : 0;
1055
+ const emittedSpidByNode = /* @__PURE__ */ new Map();
1056
+ let nextOwnerObjectId = 2 + placeholderCount;
1057
+ const assignEmittedOwnerSpids = (children) => {
1058
+ for (const child of children) {
1059
+ if (!(child instanceof CommonNode)) continue;
1060
+ emittedSpidByNode.set(child, nextOwnerObjectId++);
1061
+ if (child.kind === "group") assignEmittedOwnerSpids(child.children);
1062
+ }
1063
+ };
1064
+ assignEmittedOwnerSpids(context.slideNode.children);
740
1065
  const ownerSteps = [];
741
1066
  for (const stepInfo of stepInfos) {
742
1067
  const stepEffects = survivingEffects.filter((eff) => eff.stepIndex === stepInfo.stepIndex);
743
1068
  if (stepEffects.length === 0) continue;
744
- const mappedEffects = stepEffects.map((eff) => {
1069
+ const mappedEffects = [];
1070
+ for (const eff of stepEffects) {
745
1071
  const placeholderKey = context.placeholderKeyBySpid?.get(eff.targetId);
746
- return {
747
- target: placeholderKey !== void 0 ? { placeholder: placeholderKey } : { spid: eff.targetId },
1072
+ let target;
1073
+ if (placeholderKey !== void 0) target = { placeholder: placeholderKey };
1074
+ else {
1075
+ const targetNode = context.objectBySpid?.get(eff.targetId);
1076
+ const emittedSpid = targetNode === void 0 ? void 0 : emittedSpidByNode.get(targetNode);
1077
+ if (emittedSpid !== void 0) target = { spid: emittedSpid };
1078
+ else {
1079
+ diagnostics.push({
1080
+ code: "unsupported-mechanism",
1081
+ category: "unsupported",
1082
+ disposition: "omitted",
1083
+ location: locationFor(context, timingCursor.xpath, eff.targetId),
1084
+ namespaceUri: P_NS,
1085
+ localName: "spTgt"
1086
+ });
1087
+ continue;
1088
+ }
1089
+ }
1090
+ mappedEffects.push({
1091
+ target,
748
1092
  effect: eff.declaration,
749
1093
  ...eff.targetRange === void 0 ? {} : { range: eff.targetRange }
750
- };
751
- });
752
- ownerSteps.push({
1094
+ });
1095
+ }
1096
+ if (mappedEffects.length > 0) ownerSteps.push({
753
1097
  trigger: stepInfo.trigger,
754
1098
  effects: mappedEffects
755
1099
  });
@@ -782,63 +1126,91 @@ function readSlideMotionImport(context) {
782
1126
  const mappedBy = chartBuild?.mode === "series" ? "series" : chartBuild?.mode === "category" ? "category" : chartBuild?.mode === "seriesEl" ? "seriesElements" : chartBuild?.mode === "categoryEl" ? "categoryElements" : head.targetRange.step === "series" ? "series" : head.targetRange.step === "category" ? "category" : head.targetRange.step === "ptInSeries" ? "seriesElements" : head.targetRange.step === "ptInCategory" ? "categoryElements" : void 0;
783
1127
  for (const idx of groupIndices) consumedIndices.add(idx);
784
1128
  const baseDelay = Math.min(...groupIndices.map((idx) => survivingEffects[idx].effectiveDelayMs));
1129
+ const effectiveRepeat = mappedBy !== void 0 && head.repeatCount !== void 0 ? void 0 : head.repeatCount;
1130
+ if (mappedBy !== void 0 && head.repeatCount !== void 0) diagnostics.push({
1131
+ code: "invalid-xml-value",
1132
+ category: "corrupt-input",
1133
+ disposition: "recovered",
1134
+ location: locationFor(context, timingCursor.xpath, head.targetId),
1135
+ attributeOrElement: "p:cTn/@repeatCount",
1136
+ rawValue: String(head.repeatCount)
1137
+ });
785
1138
  const rebuilt = buildEffectDeclaration({
786
1139
  preset: head.effect.preset,
787
1140
  kind: head.effect.kind,
788
1141
  durationMs: head.effect.duration,
789
1142
  delayMs: baseDelay,
790
1143
  ...head.from === void 0 ? {} : { from: head.from },
1144
+ ...head.to === void 0 ? {} : { to: head.to },
791
1145
  ...head.fromColor === void 0 ? {} : { fromColor: head.fromColor },
792
1146
  ...head.toColor === void 0 ? {} : { toColor: head.toColor },
793
1147
  ...head.easing === void 0 ? {} : { easing: head.easing },
794
1148
  ...mappedBy === void 0 ? {} : { by: mappedBy },
795
- ...head.repeatCount === void 0 ? {} : { repeatCount: head.repeatCount }
1149
+ ...effectiveRepeat === void 0 ? {} : { repeatCount: effectiveRepeat }
796
1150
  });
797
- const { targetRange: _omittedRange, ...headRest } = head;
1151
+ const { targetRange: _omittedRange, repeatCount: _droppedRepeat, ...headRest } = head;
798
1152
  collapsedEffects.push({
799
1153
  ...headRest,
800
1154
  effectiveDelayMs: baseDelay,
801
1155
  ...mappedBy === void 0 ? {} : { by: mappedBy },
1156
+ ...effectiveRepeat === void 0 ? {} : { repeatCount: effectiveRepeat },
802
1157
  effect: rebuilt.effect,
803
1158
  declaration: rebuilt.declaration
804
1159
  });
805
1160
  continue;
806
1161
  }
807
- if (head.targetRange?.type === "paragraph" && (head.buildGroupId ?? 0) === 0) {
808
- if (paragraphBuilds.get(`${head.targetId}:0`)?.build === "p") {
1162
+ if (head.targetRange?.type === "paragraph" && head.targetRange.start === 0 && head.targetRange.end === 0 && (head.buildGroupId ?? 0) === 0) {
1163
+ const pBuild = paragraphBuilds.get(`${head.targetId}:0`);
1164
+ const targetObj = context.objectBySpid?.get(head.targetId);
1165
+ const existingParaCount = targetObj === void 0 ? 0 : targetObj.children.filter((c) => c instanceof CommonNode && c.type === "paragraph").length;
1166
+ const targetParaCount = existingParaCount > 0 ? existingParaCount : targetObj?.kind === "shape" && targetObj.children.length > 0 ? 1 : 0;
1167
+ if (pBuild?.build === "p" && targetParaCount > 1) {
809
1168
  const groupIndices = [i];
810
1169
  let expectedNextStart = head.targetRange.end + 1;
811
1170
  for (let j = i + 1; j < survivingEffects.length; j += 1) {
812
1171
  if (consumedIndices.has(j)) continue;
813
1172
  const cand = survivingEffects[j];
814
- if (cand.targetRange?.type === "paragraph" && cand.targetRange.start === expectedNextStart && cand.stepIndex === head.stepIndex && commonEffectPropsMatch(head, cand) && cand.startAfterTimingId === head.startAfterTimingId && cand.startAfterOffsetMs === head.startAfterOffsetMs) {
1173
+ if (cand.targetRange?.type === "paragraph" && cand.targetRange.start === expectedNextStart && cand.targetRange.end === expectedNextStart && cand.stepIndex === head.stepIndex && commonEffectPropsMatch(head, cand) && cand.effectiveDelayMs === head.effectiveDelayMs + expectedNextStart * head.effect.duration && cand.startAfterTimingId === head.startAfterTimingId && cand.startAfterOffsetMs === head.startAfterOffsetMs) {
815
1174
  groupIndices.push(j);
816
1175
  expectedNextStart = cand.targetRange.end + 1;
817
1176
  }
818
1177
  }
819
- for (const idx of groupIndices) consumedIndices.add(idx);
820
- const baseDelay = Math.min(...groupIndices.map((idx) => survivingEffects[idx].effectiveDelayMs));
821
- const rebuilt = buildEffectDeclaration({
822
- preset: head.effect.preset,
823
- kind: head.effect.kind,
824
- durationMs: head.effect.duration,
825
- delayMs: baseDelay,
826
- ...head.from === void 0 ? {} : { from: head.from },
827
- ...head.fromColor === void 0 ? {} : { fromColor: head.fromColor },
828
- ...head.toColor === void 0 ? {} : { toColor: head.toColor },
829
- ...head.easing === void 0 ? {} : { easing: head.easing },
830
- by: "paragraph",
831
- ...head.repeatCount === void 0 ? {} : { repeatCount: head.repeatCount }
832
- });
833
- const { targetRange: _omittedRange, ...headRest } = head;
834
- collapsedEffects.push({
835
- ...headRest,
836
- effectiveDelayMs: baseDelay,
837
- by: "paragraph",
838
- effect: rebuilt.effect,
839
- declaration: rebuilt.declaration
840
- });
841
- continue;
1178
+ if (groupIndices.length === targetParaCount) {
1179
+ for (const idx of groupIndices) consumedIndices.add(idx);
1180
+ const baseDelay = Math.min(...groupIndices.map((idx) => survivingEffects[idx].effectiveDelayMs));
1181
+ const effectiveRepeat = head.repeatCount !== void 0 ? void 0 : head.repeatCount;
1182
+ if (head.repeatCount !== void 0) diagnostics.push({
1183
+ code: "invalid-xml-value",
1184
+ category: "corrupt-input",
1185
+ disposition: "recovered",
1186
+ location: locationFor(context, timingCursor.xpath, head.targetId),
1187
+ attributeOrElement: "p:cTn/@repeatCount",
1188
+ rawValue: String(head.repeatCount)
1189
+ });
1190
+ const rebuilt = buildEffectDeclaration({
1191
+ preset: head.effect.preset,
1192
+ kind: head.effect.kind,
1193
+ durationMs: head.effect.duration,
1194
+ delayMs: baseDelay,
1195
+ ...head.from === void 0 ? {} : { from: head.from },
1196
+ ...head.to === void 0 ? {} : { to: head.to },
1197
+ ...head.fromColor === void 0 ? {} : { fromColor: head.fromColor },
1198
+ ...head.toColor === void 0 ? {} : { toColor: head.toColor },
1199
+ ...head.easing === void 0 ? {} : { easing: head.easing },
1200
+ by: "paragraph",
1201
+ ...effectiveRepeat === void 0 ? {} : { repeatCount: effectiveRepeat }
1202
+ });
1203
+ const { targetRange: _omittedRange, repeatCount: _droppedRepeat, ...headRest } = head;
1204
+ collapsedEffects.push({
1205
+ ...headRest,
1206
+ effectiveDelayMs: baseDelay,
1207
+ by: "paragraph",
1208
+ ...effectiveRepeat === void 0 ? {} : { repeatCount: effectiveRepeat },
1209
+ effect: rebuilt.effect,
1210
+ declaration: rebuilt.declaration
1211
+ });
1212
+ continue;
1213
+ }
842
1214
  }
843
1215
  }
844
1216
  consumedIndices.add(i);
@@ -887,7 +1259,7 @@ function readSlideMotionImport(context) {
887
1259
  if (candidate.effect.preset !== "spin" || candidate.targetId !== leafSpids[0]) continue;
888
1260
  const matchedLeafIndices = [idx];
889
1261
  for (const leafSpid of leafSpids.slice(1)) {
890
- const matchIdx = collapsedEffects.findIndex((other, otherIdx) => !spinConsumed.has(otherIdx) && other.effect.preset === "spin" && other.targetId === leafSpid && other.stepIndex === candidate.stepIndex && other.effectiveDelayMs === candidate.effectiveDelayMs && other.effect.duration === candidate.effect.duration && other.by === candidate.by && other.from === candidate.from && other.startAfterTimingId === candidate.startAfterTimingId && other.startAfterOffsetMs === candidate.startAfterOffsetMs);
1262
+ const matchIdx = collapsedEffects.findIndex((other, otherIdx) => !spinConsumed.has(otherIdx) && other.effect.preset === "spin" && other.targetId === leafSpid && other.stepIndex === candidate.stepIndex && other.effectiveDelayMs === candidate.effectiveDelayMs && other.effect.duration === candidate.effect.duration && other.by === candidate.by && other.from === candidate.from && other.to === candidate.to && other.startAfterTimingId === candidate.startAfterTimingId && other.startAfterOffsetMs === candidate.startAfterOffsetMs);
891
1263
  if (matchIdx >= 0) matchedLeafIndices.push(matchIdx);
892
1264
  }
893
1265
  if (matchedLeafIndices.length === leafSpids.length) {
@@ -900,55 +1272,234 @@ function readSlideMotionImport(context) {
900
1272
  }
901
1273
  }
902
1274
  for (let i = 0; i < collapsedEffects.length; i += 1) if (!spinConsumed.has(i)) liftedCollapsed.push(collapsedEffects[i]);
903
- const effectsByNode = /* @__PURE__ */ new Map();
1275
+ const clickNumberByStepIndex = /* @__PURE__ */ new Map();
1276
+ let nextClickNumber = 1;
1277
+ for (const info of stepInfos) if (info.trigger === "click") {
1278
+ if (liftedCollapsed.some((e) => e.stepIndex === info.stepIndex)) clickNumberByStepIndex.set(info.stepIndex, nextClickNumber++);
1279
+ }
1280
+ const wholeEffectsByNode = /* @__PURE__ */ new Map();
1281
+ const paragraphEffectsByNode = /* @__PURE__ */ new Map();
1282
+ const topLevelStepIndices = /* @__PURE__ */ new Map();
904
1283
  for (const eff of liftedCollapsed) {
905
1284
  const targetNode = objectBySpid.get(eff.targetId);
906
1285
  if (targetNode === void 0) continue;
907
- const list = effectsByNode.get(targetNode) ?? [];
1286
+ if (eff.targetRange?.type === "paragraph") {
1287
+ let byPara = paragraphEffectsByNode.get(targetNode);
1288
+ if (byPara === void 0) {
1289
+ byPara = /* @__PURE__ */ new Map();
1290
+ paragraphEffectsByNode.set(targetNode, byPara);
1291
+ }
1292
+ const pIdx = eff.targetRange.start;
1293
+ const pList = byPara.get(pIdx) ?? [];
1294
+ pList.push(eff);
1295
+ byPara.set(pIdx, pList);
1296
+ continue;
1297
+ }
1298
+ const list = wholeEffectsByNode.get(targetNode) ?? [];
908
1299
  list.push(eff);
909
- effectsByNode.set(targetNode, list);
1300
+ wholeEffectsByNode.set(targetNode, list);
1301
+ const topLevelNode = topLevelOwnerByNode.get(targetNode) ?? targetNode;
1302
+ const indices = topLevelStepIndices.get(topLevelNode) ?? /* @__PURE__ */ new Set();
1303
+ indices.add(eff.stepIndex);
1304
+ topLevelStepIndices.set(topLevelNode, indices);
910
1305
  }
911
- for (const [targetNode, list] of effectsByNode) {
912
- const enters = list.filter((e) => e.effect.kind === "entrance").map((e) => e.declaration);
913
- const emphases = list.filter((e) => e.effect.kind === "emphasis").map((e) => e.declaration);
1306
+ const anchorStepIndexByTopLevel = /* @__PURE__ */ new Map();
1307
+ for (const [topLevelNode, indices] of topLevelStepIndices) anchorStepIndexByTopLevel.set(topLevelNode, Math.min(...indices));
1308
+ const internalChainTimingIds = /* @__PURE__ */ new Set();
1309
+ const finiteDurationOf = (eff) => {
1310
+ if (eff.repeatCount === "forever" || eff.by === "word" || eff.by === "letter" || eff.by === "paragraph") return;
1311
+ const rounds = typeof eff.repeatCount === "number" ? eff.repeatCount : 1;
1312
+ return eff.effect.duration * rounds;
1313
+ };
1314
+ const applySlotAdjustedPatch = (targetNode, list, anchorStep) => {
1315
+ const adjustedByEffect = /* @__PURE__ */ new Map();
1316
+ const byStep = /* @__PURE__ */ new Map();
1317
+ for (const eff of list) {
1318
+ const group = byStep.get(eff.stepIndex) ?? [];
1319
+ group.push(eff);
1320
+ byStep.set(eff.stepIndex, group);
1321
+ }
1322
+ for (const stepList of byStep.values()) {
1323
+ let prevSlotTimingIds = /* @__PURE__ */ new Set();
1324
+ let prevSlotEndMs = 0;
1325
+ let prevSlotEndKnown = true;
1326
+ let hasPrevSlot = false;
1327
+ for (const slotKind of [
1328
+ "entrance",
1329
+ "emphasis",
1330
+ "exit"
1331
+ ]) {
1332
+ const slotItems = stepList.filter((e) => e.effect.kind === slotKind);
1333
+ if (slotItems.length === 0) continue;
1334
+ const slotTimingIds = new Set(slotItems.map((e) => e.timingId));
1335
+ let slotMaxEnd = 0;
1336
+ let slotKnown = prevSlotEndKnown;
1337
+ for (const item of slotItems) {
1338
+ let adjustedDelay = item.effectiveDelayMs;
1339
+ if (hasPrevSlot) {
1340
+ if (item.startAfterTimingId !== void 0 && prevSlotTimingIds.has(item.startAfterTimingId)) {
1341
+ internalChainTimingIds.add(item.timingId);
1342
+ adjustedDelay = item.startAfterOffsetMs ?? 0;
1343
+ } else if (prevSlotEndKnown && prevSlotEndMs !== void 0) adjustedDelay = Math.max(0, item.effectiveDelayMs - prevSlotEndMs);
1344
+ }
1345
+ const rebuiltDecl = adjustedDelay === item.effectiveDelayMs ? item.declaration : buildEffectDeclaration({
1346
+ preset: item.effect.preset,
1347
+ kind: item.effect.kind,
1348
+ durationMs: item.effect.duration,
1349
+ delayMs: adjustedDelay,
1350
+ ...item.from === void 0 ? {} : { from: item.from },
1351
+ ...item.to === void 0 ? {} : { to: item.to },
1352
+ ...item.fromColor === void 0 ? {} : { fromColor: item.fromColor },
1353
+ ...item.toColor === void 0 ? {} : { toColor: item.toColor },
1354
+ ...item.easing === void 0 ? {} : { easing: item.easing },
1355
+ ...item.by === void 0 ? {} : { by: item.by },
1356
+ ...item.intervalMs === void 0 ? {} : { intervalMs: item.intervalMs },
1357
+ ...item.repeatCount === void 0 ? {} : { repeatCount: item.repeatCount }
1358
+ }).declaration;
1359
+ adjustedByEffect.set(item, rebuiltDecl);
1360
+ const finiteDur = finiteDurationOf(item);
1361
+ if (slotKnown && finiteDur !== void 0 && prevSlotEndMs !== void 0) {
1362
+ const itemEnd = prevSlotEndMs + adjustedDelay + finiteDur;
1363
+ slotMaxEnd = slotMaxEnd === void 0 ? itemEnd : Math.max(slotMaxEnd, itemEnd);
1364
+ } else slotKnown = false;
1365
+ }
1366
+ prevSlotTimingIds = slotTimingIds;
1367
+ prevSlotEndMs = slotMaxEnd;
1368
+ prevSlotEndKnown = slotKnown;
1369
+ hasPrevSlot = true;
1370
+ }
1371
+ }
1372
+ const wrapWithStepIfNeeded = (eff, decl) => {
1373
+ if (anchorStep !== void 0 && eff.stepIndex !== anchorStep) {
1374
+ const clickNum = clickNumberByStepIndex.get(eff.stepIndex);
1375
+ if (clickNum !== void 0) return onStep(clickNum, decl);
1376
+ }
1377
+ return decl;
1378
+ };
1379
+ const enters = list.filter((e) => e.effect.kind === "entrance").map((e) => wrapWithStepIfNeeded(e, adjustedByEffect.get(e) ?? e.declaration));
1380
+ const emphases = list.filter((e) => e.effect.kind === "emphasis").map((e) => wrapWithStepIfNeeded(e, adjustedByEffect.get(e) ?? e.declaration));
1381
+ const exits = list.filter((e) => e.effect.kind === "exit").map((e) => wrapWithStepIfNeeded(e, adjustedByEffect.get(e) ?? e.declaration));
914
1382
  const patch = {};
915
1383
  if (enters.length === 1) patch.enter = enters[0];
916
1384
  else if (enters.length > 1) patch.enter = enters;
917
- if (emphases.length >= 1) patch.emphasis = emphases[0];
918
- if (patch.enter !== void 0 || patch.emphasis !== void 0) targetNode.set(patch);
1385
+ if (emphases.length === 1) patch.emphasis = emphases[0];
1386
+ else if (emphases.length > 1) patch.emphasis = emphases;
1387
+ if (exits.length === 1) patch.exit = exits[0];
1388
+ else if (exits.length > 1) patch.exit = exits;
1389
+ if (patch.enter !== void 0 || patch.emphasis !== void 0 || patch.exit !== void 0) targetNode.set(patch);
1390
+ };
1391
+ for (const [targetNode, list] of wholeEffectsByNode) {
1392
+ const topLevelNode = topLevelOwnerByNode.get(targetNode) ?? targetNode;
1393
+ applySlotAdjustedPatch(targetNode, list, anchorStepIndexByTopLevel.get(topLevelNode));
919
1394
  }
920
- const clickNumberByStepIndex = /* @__PURE__ */ new Map();
921
- let nextClickNumber = 1;
922
- for (const info of stepInfos) if (info.trigger === "click") {
923
- if (liftedCollapsed.some((e) => e.stepIndex === info.stepIndex)) clickNumberByStepIndex.set(info.stepIndex, nextClickNumber++);
1395
+ const paragraphNodesByKey = /* @__PURE__ */ new Map();
1396
+ const paragraphPublishTimingIds = /* @__PURE__ */ new Set();
1397
+ for (const [targetNode, byPara] of paragraphEffectsByNode) {
1398
+ if (targetNode instanceof RichTextContainer && !targetNode.children.some((c) => c instanceof CommonNode && c.type === "paragraph") && targetNode.children.length > 0) {
1399
+ const p0 = createParagraphNode({});
1400
+ const rawChildren = [...targetNode.children];
1401
+ p0.content(...rawChildren.map((child) => child instanceof CommonNode ? child : child.text));
1402
+ targetNode.content(p0);
1403
+ }
1404
+ const pNodes = targetNode.children.filter((c) => c instanceof CommonNode && c.type === "paragraph");
1405
+ const stepByParagraph = /* @__PURE__ */ new Map();
1406
+ for (const [pIndex, pList] of byPara) {
1407
+ const pNode = pNodes[pIndex];
1408
+ if (pNode === void 0) continue;
1409
+ const anchorStep = Math.min(...pList.map((e) => e.stepIndex));
1410
+ applySlotAdjustedPatch(pNode, pList, anchorStep);
1411
+ const clickStep = clickNumberByStepIndex.get(anchorStep);
1412
+ if (clickStep !== void 0) stepByParagraph.set(pNode, clickStep);
1413
+ const anchorEff = pList.find((e) => e.stepIndex === anchorStep) ?? pList[0];
1414
+ paragraphNodesByKey.set(`${targetNode.id}:${pIndex}`, {
1415
+ pNode,
1416
+ anchorStep,
1417
+ ...clickStep === void 0 ? {} : { clickStep },
1418
+ ...anchorEff?.startAfterTimingId !== void 0 && !internalChainTimingIds.has(anchorEff.timingId) ? {
1419
+ startAfterTimingId: anchorEff.startAfterTimingId,
1420
+ ...anchorEff.startAfterOffsetMs === void 0 ? {} : { startAfterOffsetMs: anchorEff.startAfterOffsetMs }
1421
+ } : {}
1422
+ });
1423
+ }
1424
+ if (stepByParagraph.size > 0 && targetNode instanceof RichTextContainer) {
1425
+ const originalPChildren = [...targetNode.children];
1426
+ for (const child of originalPChildren) if (child instanceof CommonNode) child.remove();
1427
+ const wrappedPChildren = [];
1428
+ let activeStepHost;
1429
+ let activeClickStep;
1430
+ for (const child of originalPChildren) if (child instanceof CommonNode) {
1431
+ const clickStep = stepByParagraph.get(child);
1432
+ if (clickStep !== void 0) {
1433
+ if (activeStepHost === void 0 || activeClickStep !== clickStep) {
1434
+ activeStepHost = createMotionStepNode({
1435
+ n: clickStep,
1436
+ stepIdentity: createMotionStepIdentity()
1437
+ });
1438
+ activeClickStep = clickStep;
1439
+ wrappedPChildren.push(activeStepHost);
1440
+ }
1441
+ activeStepHost.append(child);
1442
+ } else {
1443
+ activeStepHost = void 0;
1444
+ activeClickStep = void 0;
1445
+ wrappedPChildren.push(child);
1446
+ }
1447
+ } else {
1448
+ activeStepHost = void 0;
1449
+ activeClickStep = void 0;
1450
+ wrappedPChildren.push(child.text);
1451
+ }
1452
+ targetNode.content(...wrappedPChildren);
1453
+ }
924
1454
  }
925
1455
  const referencedTimingIds = /* @__PURE__ */ new Set();
926
- for (const eff of liftedCollapsed) if (eff.startAfterTimingId !== void 0 && !omittedNodeIds.has(eff.startAfterTimingId)) referencedTimingIds.add(eff.startAfterTimingId);
1456
+ for (const eff of liftedCollapsed) if (eff.startAfterTimingId !== void 0 && !internalChainTimingIds.has(eff.timingId) && !omittedNodeIds.has(eff.startAfterTimingId)) {
1457
+ referencedTimingIds.add(eff.startAfterTimingId);
1458
+ if (liftedCollapsed.find((candidate) => candidate.timingId === eff.startAfterTimingId)?.targetRange?.type === "paragraph") paragraphPublishTimingIds.add(eff.startAfterTimingId);
1459
+ }
927
1460
  const handleByTimingId = /* @__PURE__ */ new Map();
928
1461
  for (const tid of referencedTimingIds) handleByTimingId.set(tid, createMotionScopeHandle());
1462
+ for (const pInfo of paragraphNodesByKey.values()) {
1463
+ if (pInfo.startAfterTimingId === void 0) continue;
1464
+ const sourceHandle = handleByTimingId.get(pInfo.startAfterTimingId);
1465
+ if (sourceHandle === void 0) continue;
1466
+ const offset = pInfo.startAfterOffsetMs ?? 0;
1467
+ const moment = paragraphPublishTimingIds.has(pInfo.startAfterTimingId) ? sourceHandle.cue("done") : sourceHandle.end;
1468
+ pInfo.pNode.set({ startAt: offset > 0 ? after(moment, offset) : moment });
1469
+ }
1470
+ for (const tid of paragraphPublishTimingIds) {
1471
+ const sourceEff = liftedCollapsed.find((e) => e.timingId === tid);
1472
+ const sourceNode = sourceEff === void 0 ? void 0 : objectBySpid.get(sourceEff.targetId);
1473
+ const handle = handleByTimingId.get(tid);
1474
+ if (sourceNode !== void 0 && sourceEff?.targetRange?.type === "paragraph" && handle !== void 0) paragraphNodesByKey.get(`${sourceNode.id}:${sourceEff.targetRange.start}`)?.pNode.set({ publishEnd: handle.cue("done") });
1475
+ }
929
1476
  const ancestorsOfTimingId = (timingId) => {
930
1477
  const chain = [];
931
1478
  let current = timingId;
932
1479
  while (current !== void 0) {
933
- if (handleByTimingId.has(current)) chain.unshift(current);
1480
+ if (handleByTimingId.has(current) && !paragraphPublishTimingIds.has(current)) chain.unshift(current);
934
1481
  current = rawNodesById.get(current)?.parentTimingId;
935
1482
  }
936
1483
  return chain;
937
1484
  };
938
1485
  const assignmentByTopLevel = /* @__PURE__ */ new Map();
939
1486
  for (const eff of liftedCollapsed) {
1487
+ if (eff.targetRange?.type === "paragraph") continue;
940
1488
  const targetNode = objectBySpid.get(eff.targetId);
941
1489
  if (targetNode === void 0) continue;
942
1490
  const topLevelNode = topLevelOwnerByNode.get(targetNode) ?? targetNode;
1491
+ const anchorStep = anchorStepIndexByTopLevel.get(topLevelNode);
1492
+ if (eff.stepIndex !== anchorStep) continue;
943
1493
  if (assignmentByTopLevel.has(topLevelNode)) continue;
944
1494
  const clickStep = clickNumberByStepIndex.get(eff.stepIndex);
945
1495
  const sourceScopeIds = ancestorsOfTimingId(eff.timingId);
946
1496
  let startAfter;
947
- if (eff.startAfterTimingId !== void 0) {
1497
+ if (eff.startAfterTimingId !== void 0 && !internalChainTimingIds.has(eff.timingId)) {
948
1498
  const sourceHandle = handleByTimingId.get(eff.startAfterTimingId);
949
1499
  if (sourceHandle !== void 0) {
950
1500
  const offset = eff.startAfterOffsetMs ?? 0;
951
- startAfter = offset > 0 ? after(sourceHandle.end, offset) : sourceHandle.end;
1501
+ const moment = paragraphPublishTimingIds.has(eff.startAfterTimingId) ? sourceHandle.cue("done") : sourceHandle.end;
1502
+ startAfter = offset > 0 ? after(moment, offset) : moment;
952
1503
  }
953
1504
  }
954
1505
  assignmentByTopLevel.set(topLevelNode, {