@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,55 +1,49 @@
1
- import { CapabilityError } from "../../../core/dist/diagnostics.js";
2
- import { assertValidLang } from "../../../core/dist/theme.js";
3
- import { parseLinkTarget } from "../../../core/dist/author-schemas.js";
4
- import { layoutStyleKeys, parseCapabilityLayoutContract } from "../../../core/dist/layout.js";
5
- import "../../../core/dist/capability.js";
6
- import { assertXml10Characters, xmlEscape } from "../../../emit/dist/ooxml.js";
7
- import "../../../emit/dist/index.js";
8
- import "../../../import/dist/index.js";
9
- import { defineCanvasMechanism } from "../../../import/dist/mechanism.js";
10
- import { fontPresentationContributions } from "../font/font-embedding.js";
11
- import { motionAnnotations } from "../motion/motion-api.js";
1
+ import { CapabilityError } from "../../kernel/diagnostics.js";
2
+ import { assertValidLang } from "../../kernel/theme.js";
3
+ import { parseLinkTarget } from "../../kernel/author-schemas.js";
4
+ import { fontPresentationContributions } from "../shared/font/font-embedding.js";
5
+ import { parseCapabilityLayoutContract } from "../../kernel/layout.js";
12
6
  import { nativeLinkXml, parseMorphKey, parseOptionalName } from "../shared/identity.js";
7
+ import { motionAnnotations, pickMotionProps } from "../shared/motion-api.js";
8
+ import { defineCanvasMechanism } from "../../kernel/pptx-read/mechanism.js";
9
+ import { compatiblePlaceholderRoles } from "../shared/placeholder-roles.js";
13
10
  import { resolvePlaceholderGeometry } from "../shared/style-inheritance.js";
14
11
  import { emitTextBody, parseTextParagraphs, renderTextOutlinesSvg, resolveTextBody } from "../shared/text-service.js";
12
+ import { gradientDefSvg, paintImageFillSvg, resolveBackgroundValue } from "../shared/visual.js";
13
+ import "../../kernel/capability.js";
14
+ import "../../kernel/pptx-read/index.js";
15
+ import { assertXml10Characters, xmlEscape } from "../../kernel/pptx-write/xml.js";
16
+ import { finishResolveWork } from "../../kernel/resolve-work.js";
15
17
  import { tableCodegen } from "./table-codegen.js";
16
18
  import { tableImportHandler, tablePlaceholderImportHandler } from "./table-import.js";
17
- import { assertAllowedTableKeys, assertTableEmuExtent, cellAllowedParameters, cellStyleKeys, parseOptionalTableId, parseTableCellBorder, parseTableCellPadding, parseTableColumns, parseTableCoordinate, parseTableMergeSpan, parseTablePositiveSize, parseTableVerticalAlign, rowAllowedParameters, rowStyleKeys, tableAllowedParameters, tableStyleKeys, tableTextStyleKeys } from "./table-schemas.js";
19
+ import { assertAllowedTableKeys, assertTableEmuExtent, assertTableTextAlignment, cellAllowedParameters, cellStyleKeys, parseOptionalTableId, parseTableCellPadding, parseTableColumns, parseTableCoordinate, parseTableMergeSpan, parseTablePositiveSize, parseTableVerticalAlign, resolveTableCellBorders, resolveTableLayerBorders, rowAllowedParameters, rowStyleKeys, tableAllowedParameters, tableStyleKeys, tableTextStyleKeys } from "./table-schemas.js";
18
20
  import { emptyTableCellXml, tableCellPropertiesXml, tableFrameXml } from "./table-xml.js";
19
21
  import "./table-declaration.js";
20
- // ../capabilities/dist/table/table.js
22
+ // ../core/dist/capabilities/table/table.js
21
23
  const maximumExtentEmu = 2147483647;
22
- function fail(code, message, path) {
23
- throw new CapabilityError(code, message, path);
24
+ function fail(code, message, path, details) {
25
+ throw new CapabilityError(code, message, path, details);
24
26
  }
25
27
  function isRecord(value) {
26
28
  return typeof value === "object" && value !== null && !Array.isArray(value);
27
29
  }
28
30
  function record(value, label, path) {
29
- if (!isRecord(value)) fail("invalid-parameter", `${label} must be an object`, path);
31
+ if (!isRecord(value)) fail("invalid-parameter", `${label} must be an object`, path, { field: "style" });
30
32
  return value;
31
33
  }
32
34
  function pathLabel(value, fallback) {
33
35
  return typeof value === "string" && value.trim() !== "" ? value : fallback;
34
36
  }
35
- function color(value, label, theme, path) {
36
- if (value === void 0) return void 0;
37
- try {
38
- return theme.resolveColor(value);
39
- } catch (error) {
40
- if (error instanceof CapabilityError) fail(error.code, `${label}: ${error.message}`, path);
41
- throw error;
42
- }
43
- }
44
37
  function textStyle(styleValue, label, path, additional = []) {
45
38
  const style = record(styleValue ?? {}, `${label}.style`, path);
46
39
  assertAllowedTableKeys(style, [...tableTextStyleKeys, ...additional], `${label}.style`, path);
47
40
  if (style["lang"] !== void 0) try {
48
41
  assertValidLang(style["lang"]);
49
42
  } catch (error) {
50
- if (error instanceof CapabilityError) fail(error.code, error.message, path);
43
+ if (error instanceof CapabilityError) fail(error.code, error.message, path, error.details);
51
44
  throw error;
52
45
  }
46
+ assertTableTextAlignment(style["align"], path);
53
47
  const textStyle = {};
54
48
  for (const key of tableTextStyleKeys) {
55
49
  const value = style[key];
@@ -67,9 +61,35 @@ function mergeTextStyle(parent, child) {
67
61
  ...child
68
62
  };
69
63
  }
64
+ function* parseLayerBackground(style, label, theme, path) {
65
+ if (!Object.hasOwn(style, "background") || style["background"] === void 0) return { declared: false };
66
+ let raw = style["background"];
67
+ try {
68
+ const fill = yield* resolveBackgroundValue(theme, raw, void 0);
69
+ if (fill.kind === "image" && fill.source.kind === "embedded") raw = {
70
+ ...raw,
71
+ image: fill.source.bytes
72
+ };
73
+ } catch (error) {
74
+ if (error instanceof CapabilityError) fail(error.code, `${label}.style.background: ${error.message}`, path);
75
+ throw error;
76
+ }
77
+ return {
78
+ declared: true,
79
+ value: raw
80
+ };
81
+ }
70
82
  function trackStyle(input, type, path) {
71
- const additional = type === "table" ? layoutStyleKeys : type === "row" ? rowStyleKeys : cellStyleKeys;
72
- return textStyle(input.props["style"], type === "table" ? "Table" : type === "row" ? "Row" : "Cell", path, additional);
83
+ const additionalByType = {
84
+ table: tableStyleKeys,
85
+ row: rowStyleKeys,
86
+ cell: cellStyleKeys
87
+ };
88
+ return textStyle(input.props["style"], {
89
+ table: "Table",
90
+ row: "Row",
91
+ cell: "Cell"
92
+ }[type], path, additionalByType[type]);
73
93
  }
74
94
  function resolveCellBody(cell, theme, width, height, contentSized = false) {
75
95
  try {
@@ -79,14 +99,14 @@ function resolveCellBody(cell, theme, width, height, contentSized = false) {
79
99
  ...contentSized ? { contentSized: true } : {}
80
100
  }, "table-cell");
81
101
  } catch (error) {
82
- if (error instanceof CapabilityError) fail(error.code, error.message, cell.path);
102
+ if (error instanceof CapabilityError) fail(error.code, error.message, cell.path, error.details);
83
103
  throw error;
84
104
  }
85
105
  }
86
106
  function identityPath(type, props, index) {
87
107
  return `${type}[${pathLabel(props["id"], String(index + 1))}]`;
88
108
  }
89
- function prepareRows(input, columns, tableTextStyle, tableVerticalAlign, theme, slideNumber) {
109
+ function* prepareRows(input, columns, tableTextStyle, tableVerticalAlign, tableBackgroundRaw, tableBorders, theme, slideNumber, referenceDate) {
90
110
  const rows = [];
91
111
  const cells = [];
92
112
  const owners = /* @__PURE__ */ new Map();
@@ -102,8 +122,10 @@ function prepareRows(input, columns, tableTextStyle, tableVerticalAlign, theme,
102
122
  const rowAuthorId = parseOptionalTableId(child.props["id"], rowPath);
103
123
  const rowStyle = trackStyle(child, "row", rowPath);
104
124
  const heightValue = rowStyle.style["height"];
105
- const height = heightValue === void 0 ? void 0 : parseTablePositiveSize(heightValue, "Row.style.height", rowPath);
106
- const rowFill = color(rowStyle.style["backgroundColor"], "Row.style.backgroundColor", theme, rowPath);
125
+ const height = heightValue === void 0 ? void 0 : parseTablePositiveSize(heightValue, "style.height", rowPath);
126
+ const rowBgParsed = yield* parseLayerBackground(rowStyle.style, "Row", theme, rowPath);
127
+ const rowBackgroundRaw = rowBgParsed.declared ? rowBgParsed.value : tableBackgroundRaw;
128
+ const rowBorders = resolveTableLayerBorders(rowStyle.style, tableBorders, theme, rowPath);
107
129
  const rowVerticalAlign = parseTableVerticalAlign(rowStyle.style["verticalAlign"], rowPath) ?? tableVerticalAlign;
108
130
  const row = {
109
131
  path: rowPath,
@@ -111,7 +133,8 @@ function prepareRows(input, columns, tableTextStyle, tableVerticalAlign, theme,
111
133
  ...height === void 0 ? {} : { height },
112
134
  textStyle: mergeTextStyle(tableTextStyle, rowStyle.textStyle),
113
135
  verticalAlign: rowVerticalAlign,
114
- ...rowFill === void 0 ? {} : { fill: rowFill }
136
+ ...rowBackgroundRaw === void 0 ? {} : { backgroundRaw: rowBackgroundRaw },
137
+ borders: rowBorders
115
138
  };
116
139
  rows.push(row);
117
140
  let column = 0;
@@ -129,13 +152,14 @@ function prepareRows(input, columns, tableTextStyle, tableVerticalAlign, theme,
129
152
  while (owners.has(`${rowIndex}:${column}`)) column += 1;
130
153
  const colSpan = parseTableMergeSpan(cellChild.props["colSpan"], "colSpan", cellPath);
131
154
  const rowSpan = parseTableMergeSpan(cellChild.props["rowSpan"], "rowSpan", cellPath);
132
- if (column + colSpan > columns.length) fail("invalid-table-merge", `Cells in row ${rowIndex + 1} exceed ${columns.length} column count`, cellPath);
133
- if (rowIndex + rowSpan > input.children.filter((item) => "props" in item && item.type === "row").length) fail("invalid-table-merge", `rowSpan ${rowSpan} extends past the last row of the table`, cellPath);
155
+ if (column + colSpan > columns.length) fail("invalid-table-merge", `Cells in row ${rowIndex + 1} exceed ${columns.length} column count`, cellPath, cellChild.props["colSpan"] === void 0 ? void 0 : { field: "colSpan" });
156
+ if (rowIndex + rowSpan > input.children.filter((item) => "props" in item && item.type === "row").length) fail("invalid-table-merge", `rowSpan ${rowSpan} extends past the last row of the table`, cellPath, { field: "rowSpan" });
134
157
  for (let row = rowIndex; row < rowIndex + rowSpan; row += 1) for (let col = column; col < column + colSpan; col += 1) if (owners.has(`${row}:${col}`)) fail("conflicting-table-merge", "Cell merge region overlaps with an existing cell", cellPath);
135
158
  const cellStyle = trackStyle(cellChild, "cell", cellPath);
136
- const fill = color(cellStyle.style["backgroundColor"], "Cell.style.backgroundColor", theme, cellPath) ?? row.fill;
159
+ const cellBgParsed = yield* parseLayerBackground(cellStyle.style, "Cell", theme, cellPath);
160
+ const cellBackgroundRaw = cellBgParsed.declared ? cellBgParsed.value : row.backgroundRaw;
137
161
  const cellVerticalAlign = parseTableVerticalAlign(cellStyle.style["verticalAlign"], cellPath) ?? rowVerticalAlign;
138
- const border = parseTableCellBorder(cellStyle.style, (value, label, itemPath) => color(value, label, theme, itemPath), theme, cellPath);
162
+ const borders = resolveTableCellBorders(cellStyle.style, row.borders, theme, cellPath);
139
163
  const cellTextStyle = {
140
164
  ...mergeTextStyle(row.textStyle, cellStyle.textStyle),
141
165
  textWrap: "normal"
@@ -143,11 +167,14 @@ function prepareRows(input, columns, tableTextStyle, tableVerticalAlign, theme,
143
167
  let parsedParagraphs;
144
168
  let parsedTextStyle;
145
169
  try {
146
- const textResult = parseTextParagraphs(cellChild.children, cellTextStyle, theme, { slideNumber }, cellPath);
170
+ const textResult = parseTextParagraphs(cellChild.children, cellTextStyle, theme, {
171
+ slideNumber,
172
+ referenceDate
173
+ }, cellPath);
147
174
  parsedParagraphs = textResult.paragraphs;
148
175
  parsedTextStyle = textResult.style;
149
176
  } catch (error) {
150
- if (error instanceof CapabilityError) fail(error.code, error.message, cellPath);
177
+ if (error instanceof CapabilityError) fail(error.code, error.message, error.path === void 0 ? cellPath : `${cellPath}/${error.path}`, error.details);
151
178
  throw error;
152
179
  }
153
180
  const cell = {
@@ -161,8 +188,8 @@ function prepareRows(input, columns, tableTextStyle, tableVerticalAlign, theme,
161
188
  textStyle: parsedTextStyle,
162
189
  verticalAlign: cellVerticalAlign,
163
190
  padding: parseTableCellPadding(cellStyle.style, cellPath),
164
- ...fill === void 0 ? {} : { fill },
165
- ...border === void 0 ? {} : { border }
191
+ ...cellBackgroundRaw === void 0 ? {} : { backgroundRaw: cellBackgroundRaw },
192
+ borders
166
193
  };
167
194
  cells.push(cell);
168
195
  for (let row = rowIndex; row < rowIndex + rowSpan; row += 1) for (let col = column; col < column + colSpan; col += 1) owners.set(`${row}:${col}`, cell);
@@ -216,17 +243,23 @@ function emitTableModel(model, emitContext) {
216
243
  continue;
217
244
  }
218
245
  const { cell, body, fill } = entry;
219
- if ((embedFonts === "full" || embedFonts === "subset") && body.missingGlyphErrors.length > 0) fail("font-missing-glyph", body.missingGlyphErrors[0], cell.path);
246
+ if ((embedFonts === "full" || embedFonts === "subset") && body.missingGlyphErrors.length > 0) {
247
+ const issue = body.missingGlyphErrors[0];
248
+ fail("font-missing-glyph", issue.message, cell.path, {
249
+ font: issue.font,
250
+ characters: issue.characters
251
+ });
252
+ }
220
253
  let emittedXml;
221
254
  try {
222
255
  emittedXml = emitTextBody(body, emitContext.theme, { createFieldId: emitContext.createTextFieldId }).xml;
223
256
  } catch (error) {
224
- if (error instanceof CapabilityError) fail(error.code, error.message, error.path ?? cell.path);
257
+ if (error instanceof CapabilityError) fail(error.code, error.message, error.path ?? cell.path, error.details);
225
258
  throw error;
226
259
  }
227
260
  const spanAttributes = [...cell.colSpan > 1 ? [`gridSpan="${cell.colSpan}"`] : [], ...cell.rowSpan > 1 ? [`rowSpan="${cell.rowSpan}"`] : []];
228
261
  const attributes = spanAttributes.length === 0 ? "" : ` ${spanAttributes.join(" ")}`;
229
- const properties = tableCellPropertiesXml(cell.padding, cell.verticalAlign, cell.border, fill);
262
+ const properties = tableCellPropertiesXml(cell.padding, cell.verticalAlign, cell.borders, fill, (resource) => emitContext.registerResource(resource), entry.box);
230
263
  rowCells.push(`<a:tc${attributes}>${emittedXml}${properties}</a:tc>`);
231
264
  }
232
265
  return rowCells.join("");
@@ -242,53 +275,85 @@ function paintTableModel(model, paintContext) {
242
275
  const fills = [];
243
276
  const texts = [];
244
277
  const borders = [];
278
+ const placeholders = [];
245
279
  for (const entry of model.resolvedCells) {
246
280
  const { cell, box: cellBox, fill, body, hasText, hasOverflow } = entry;
247
- if (fill !== void 0) fills.push(`<rect x="${roundSvgNumber(cellBox.x)}" y="${roundSvgNumber(cellBox.y)}" width="${roundSvgNumber(cellBox.width)}" height="${roundSvgNumber(cellBox.height)}" fill="#${fill.hex}" fill-opacity="${roundSvgNumber(fill.alpha ?? 1)}" stroke="none"/>`);
248
- if (hasText) {
249
- const idPrefix = `tbl-s${paintContext.slideNumber}-o${paintContext.objectId}-r${cell.row}-c${cell.column}`;
250
- try {
251
- const glyphs = renderTextOutlinesSvg({
252
- paragraphs: body.paragraphs,
253
- box: cellBox,
254
- insets: cell.padding,
255
- verticalAlign: cell.verticalAlign,
256
- theme: paintContext.theme,
257
- measuredLayout: body.measuredLayout,
258
- idPrefix
259
- });
260
- if (glyphs !== "") {
261
- if (hasOverflow) {
262
- const clipId = `${idPrefix}-clip`;
263
- defs.push(`<clipPath id="${clipId}" clipPathUnits="userSpaceOnUse"><rect x="${roundSvgNumber(cellBox.x)}" y="${roundSvgNumber(cellBox.y)}" width="${roundSvgNumber(cellBox.width)}" height="${roundSvgNumber(cellBox.height)}"/></clipPath>`);
264
- texts.push(`<g clip-path="url(#${clipId})">${glyphs}</g>`);
265
- } else texts.push(glyphs);
266
- }
267
- } catch (error) {
268
- if (error instanceof CapabilityError) throw new CapabilityError(error.code, error.message, error.path ?? cell.path);
269
- throw error;
281
+ if (!Number.isFinite(cellBox.x) || !Number.isFinite(cellBox.y) || !Number.isFinite(cellBox.width) || !Number.isFinite(cellBox.height) || cellBox.width <= 1e-6 || cellBox.height <= 1e-6) continue;
282
+ const idPrefix = `tbl-s${paintContext.slideNumber}-o${paintContext.objectId}-r${cell.row}-c${cell.column}`;
283
+ if (fill.kind === "solid") fills.push(`<rect x="${roundSvgNumber(cellBox.x)}" y="${roundSvgNumber(cellBox.y)}" width="${roundSvgNumber(cellBox.width)}" height="${roundSvgNumber(cellBox.height)}" fill="#${fill.color.hex}" fill-opacity="${roundSvgNumber(fill.color.alpha ?? 1)}" stroke="none"/>`);
284
+ else if (fill.kind === "linear-gradient" || fill.kind === "radial-gradient") {
285
+ const fillDefId = `${idPrefix}-fill`;
286
+ defs.push(gradientDefSvg(fillDefId, fill));
287
+ fills.push(`<rect x="${roundSvgNumber(cellBox.x)}" y="${roundSvgNumber(cellBox.y)}" width="${roundSvgNumber(cellBox.width)}" height="${roundSvgNumber(cellBox.height)}" fill="url(#${fillDefId})" stroke="none"/>`);
288
+ } else if (fill.kind === "image") {
289
+ const fillDefId = `${idPrefix}-fill`;
290
+ const patternSvg = paintImageFillSvg(fill, fillDefId, cellBox, paintContext.registerRasterResource);
291
+ if (fill.source.kind === "external") placeholders.push({
292
+ ...cell.authorId === void 0 ? {} : { id: cell.authorId },
293
+ path: `${paintContext.path}/${cell.path}`,
294
+ url: fill.source.externalUrl
295
+ });
296
+ if (patternSvg !== "") {
297
+ defs.push(patternSvg);
298
+ fills.push(`<rect x="${roundSvgNumber(cellBox.x)}" y="${roundSvgNumber(cellBox.y)}" width="${roundSvgNumber(cellBox.width)}" height="${roundSvgNumber(cellBox.height)}" fill="url(#${fillDefId})" stroke="none"/>`);
299
+ }
300
+ }
301
+ if (hasText) try {
302
+ const glyphs = renderTextOutlinesSvg({
303
+ paragraphs: body.paragraphs,
304
+ box: cellBox,
305
+ insets: cell.padding,
306
+ verticalAlign: cell.verticalAlign,
307
+ theme: paintContext.theme,
308
+ measuredLayout: body.measuredLayout,
309
+ idPrefix
310
+ });
311
+ if (glyphs !== "") {
312
+ if (hasOverflow) {
313
+ const clipId = `${idPrefix}-clip`;
314
+ defs.push(`<clipPath id="${clipId}" clipPathUnits="userSpaceOnUse"><rect x="${roundSvgNumber(cellBox.x)}" y="${roundSvgNumber(cellBox.y)}" width="${roundSvgNumber(cellBox.width)}" height="${roundSvgNumber(cellBox.height)}"/></clipPath>`);
315
+ texts.push(`<g clip-path="url(#${clipId})">${glyphs}</g>`);
316
+ } else texts.push(glyphs);
270
317
  }
318
+ } catch (error) {
319
+ if (error instanceof CapabilityError) throw new CapabilityError(error.code, error.message, error.path ?? cell.path, error.details);
320
+ throw error;
321
+ }
322
+ const { top, right, bottom, left } = cell.borders;
323
+ const sameSide = (a, b) => a === b || a !== void 0 && b !== void 0 && a.width === b.width && a.dash === b.dash && a.color.hex === b.color.hex && a.color.alpha === b.color.alpha;
324
+ if (sameSide(top, right) && sameSide(top, bottom) && sameSide(top, left)) {
325
+ if (top !== void 0) borders.push(`<rect x="${roundSvgNumber(cellBox.x)}" y="${roundSvgNumber(cellBox.y)}" width="${roundSvgNumber(cellBox.width)}" height="${roundSvgNumber(cellBox.height)}" ${tableBorderAttributes(top)}/>`);
326
+ } else {
327
+ const x1 = roundSvgNumber(cellBox.x);
328
+ const y1 = roundSvgNumber(cellBox.y);
329
+ const x2 = roundSvgNumber(cellBox.x + cellBox.width);
330
+ const y2 = roundSvgNumber(cellBox.y + cellBox.height);
331
+ if (top !== void 0) borders.push(`<line x1="${x1}" y1="${y1}" x2="${x2}" y2="${y1}" ${tableBorderAttributes(top)}/>`);
332
+ if (right !== void 0) borders.push(`<line x1="${x2}" y1="${y1}" x2="${x2}" y2="${y2}" ${tableBorderAttributes(right)}/>`);
333
+ if (bottom !== void 0) borders.push(`<line x1="${x1}" y1="${y2}" x2="${x2}" y2="${y2}" ${tableBorderAttributes(bottom)}/>`);
334
+ if (left !== void 0) borders.push(`<line x1="${x1}" y1="${y1}" x2="${x1}" y2="${y2}" ${tableBorderAttributes(left)}/>`);
271
335
  }
272
- if (cell.border !== void 0) borders.push(`<rect x="${roundSvgNumber(cellBox.x)}" y="${roundSvgNumber(cellBox.y)}" width="${roundSvgNumber(cellBox.width)}" height="${roundSvgNumber(cellBox.height)}" ${tableBorderAttributes(cell.border)}/>`);
273
336
  }
274
- return { svg: `${defs.length > 0 ? `<defs>${defs.join("")}</defs>` : ""}<g>${fills.join("")}${texts.join("")}${borders.join("")}</g>` };
337
+ return {
338
+ svg: `${defs.length > 0 ? `<defs>${defs.join("")}</defs>` : ""}<g>${fills.join("")}${texts.join("")}${borders.join("")}</g>`,
339
+ ...placeholders.length === 0 ? {} : { placeholders }
340
+ };
341
+ }
342
+ function failTableMeasurementUnavailable(result, defaultMessage, cellPath) {
343
+ if (result.measurementError !== void 0 && result.measurementError.code !== "font-measurement-unavailable") fail(result.measurementError.code, result.measurementError.message, cellPath, result.measurementError.details);
344
+ const errorFont = typeof result.measurementError?.details?.["font"] === "object" && result.measurementError.details["font"] !== null ? result.measurementError.details["font"] : void 0;
345
+ const fallbackFont = result.unmeasuredIssues.missingResourceFonts[0] ?? result.unmeasuredIssues.referencedFonts[0];
346
+ const font = errorFont ?? fallbackFont;
347
+ fail("font-measurement-unavailable", defaultMessage, cellPath, {
348
+ ...font === void 0 ? {} : { font },
349
+ reason: "missing-resource"
350
+ });
275
351
  }
276
352
  /** Shared calculation of table tracks and text dimensions used by layout measurement and table resolution. */
277
353
  function tableLayoutModel(parsed, requestedWidth, theme) {
278
354
  const { columns, tableStyle, rows, cells } = parsed;
279
- const warnings = [];
280
355
  const claims = [];
281
- const warningKeys = /* @__PURE__ */ new Set();
282
- const addTextResult = (result, path) => {
283
- for (const warning of result.warnings) {
284
- const key = `${path}\u0000${warning.code}\u0000${warning.message}`;
285
- if (warningKeys.has(key)) continue;
286
- warningKeys.add(key);
287
- warnings.push({
288
- ...warning,
289
- path
290
- });
291
- }
356
+ const addTextResult = (result) => {
292
357
  claims.push(...result.resourceClaims);
293
358
  };
294
359
  const naturalWidths = /* @__PURE__ */ new Map();
@@ -297,8 +362,23 @@ function tableLayoutModel(parsed, requestedWidth, theme) {
297
362
  const track = columns[cell.column];
298
363
  if (!(track?.kind === "auto" || track?.kind === "fr" && requestedWidth === void 0)) continue;
299
364
  const measured = resolveCellBody(cell, theme, "max-content", void 0, false);
300
- addTextResult(measured, cell.path);
301
- if (measured.measurement === void 0 && measured.text.trim() !== "") fail("font-measurement-unavailable", "auto columns require available font metrics; provide measurement fonts or use explicit column widths", cell.path);
365
+ addTextResult(measured);
366
+ if (measured.textMetrics?.status === "unmeasured" && measured.textMetrics.reason === "missing-glyphs") {
367
+ const issue = measured.missingGlyphErrors[0];
368
+ const glyphFont = measured.unmeasuredIssues.missingGlyphFonts[0];
369
+ fail("font-missing-glyph", issue?.message ?? "auto columns require glyphs for all visible characters", cell.path, issue !== void 0 ? {
370
+ font: issue.font,
371
+ characters: issue.characters
372
+ } : glyphFont !== void 0 ? {
373
+ font: {
374
+ family: glyphFont.family,
375
+ weight: glyphFont.weight,
376
+ style: glyphFont.style
377
+ },
378
+ characters: glyphFont.missingGlyphs ?? []
379
+ } : void 0);
380
+ }
381
+ if (measured.measurement === void 0 && measured.text.trim() !== "") failTableMeasurementUnavailable(measured, "auto columns require available font metrics; provide measurement fonts or use explicit column widths", cell.path);
302
382
  naturalWidths.set(cell, measured.measurement?.width ?? 0);
303
383
  }
304
384
  const widths = columns.map((track, index) => {
@@ -323,19 +403,29 @@ function tableLayoutModel(parsed, requestedWidth, theme) {
323
403
  widths[index] = value * requestedWidth / baseWidth;
324
404
  });
325
405
  }
326
- const actualWidth = widths.reduce((sum, value) => sum + value, 0);
327
- if (actualWidth > requestedWidth + .01) warnings.push({
328
- code: "table-width-overflow",
329
- message: `Sum of column minimum widths ${actualWidth}px exceeds declared width ${requestedWidth}px; build preserves column widths`
330
- });
331
406
  }
332
- if (widths.map((width, index) => assertTableEmuExtent(width, `column ${index + 1} width`)).reduce((sum, value) => sum + value, 0) > maximumExtentEmu) fail("invalid-table-geometry", "Total table column width exceeds writable range");
407
+ if (widths.map((width, index) => assertTableEmuExtent(width, `columns.${index}`)).reduce((sum, value) => sum + value, 0) > maximumExtentEmu) fail("invalid-table-geometry", "Total table column width exceeds writable range", void 0, { field: "columns" });
333
408
  const heights = rows.map((row) => row.height ?? 0);
334
409
  const widthOf = (cell) => widths.slice(cell.column, cell.column + cell.colSpan).reduce((sum, width) => sum + width, 0);
335
410
  const requiredHeight = (cell) => {
336
411
  const result = resolveCellBody(cell, theme, Math.max(0, widthOf(cell) - cell.padding.left - cell.padding.right), void 0, false);
337
- addTextResult(result, cell.path);
338
- if (result.measurement === void 0 && result.text.trim() !== "") fail("font-measurement-unavailable", "Automatic row height requires available font metrics; provide measurement fonts or specify height on Row", cell.path);
412
+ addTextResult(result);
413
+ if (result.textMetrics?.status === "unmeasured" && result.textMetrics.reason === "missing-glyphs") {
414
+ const issue = result.missingGlyphErrors[0];
415
+ const glyphFont = result.unmeasuredIssues.missingGlyphFonts[0];
416
+ fail("font-missing-glyph", issue?.message ?? "Automatic row height requires glyphs for all visible characters", cell.path, issue !== void 0 ? {
417
+ font: issue.font,
418
+ characters: issue.characters
419
+ } : glyphFont !== void 0 ? {
420
+ font: {
421
+ family: glyphFont.family,
422
+ weight: glyphFont.weight,
423
+ style: glyphFont.style
424
+ },
425
+ characters: glyphFont.missingGlyphs ?? []
426
+ } : void 0);
427
+ }
428
+ if (result.measurement === void 0 && result.text.trim() !== "") failTableMeasurementUnavailable(result, "Automatic row height requires available font metrics; provide measurement fonts or specify height on Row", cell.path);
339
429
  return (result.measurement?.height ?? 0) + cell.padding.top + cell.padding.bottom;
340
430
  };
341
431
  for (const cell of cells) {
@@ -356,7 +446,7 @@ function tableLayoutModel(parsed, requestedWidth, theme) {
356
446
  heights.forEach((height, index) => {
357
447
  if (height <= 0) heights[index] = 1;
358
448
  });
359
- if (heights.map((height, index) => assertTableEmuExtent(height, `row ${index + 1} height`, rows[index]?.path)).reduce((sum, value) => sum + value, 0) > maximumExtentEmu) fail("invalid-table-geometry", "Total table row height exceeds writable range");
449
+ if (heights.map((height, index) => assertTableEmuExtent(height, "style.height", rows[index]?.path)).reduce((sum, value) => sum + value, 0) > maximumExtentEmu) fail("invalid-table-geometry", "Total table row height exceeds writable range");
360
450
  return {
361
451
  columns,
362
452
  tableStyle,
@@ -364,12 +454,9 @@ function tableLayoutModel(parsed, requestedWidth, theme) {
364
454
  cells,
365
455
  widths,
366
456
  heights,
367
- warnings,
368
- warningKeys,
369
457
  claims
370
458
  };
371
459
  }
372
- const tableCompatiblePlaceholderRoles = /* @__PURE__ */ new Set(["tbl", "obj"]);
373
460
  /** Typed native canvas mechanism connecting emit, paint, and import for `table`. */
374
461
  const tableMechanism = defineCanvasMechanism({
375
462
  key: "table",
@@ -391,28 +478,33 @@ const tableCapability = {
391
478
  declaration: "table",
392
479
  mechanisms: [tableMechanism, tablePlaceholderMechanism],
393
480
  codegen: tableCodegen,
394
- bind(input, context) {
481
+ *bind(input, context) {
395
482
  const placeholder = context.placeholder;
396
483
  if (placeholder !== void 0) {
397
- const role = placeholder.layoutPlaceholder?.type ?? placeholder.nativeRef.type;
398
- if (!tableCompatiblePlaceholderRoles.has(role)) fail("incompatible-placeholder-content", `Table cannot be bound to ${role} placeholder`);
484
+ const role = placeholder.nativeRef.type;
485
+ if (!compatiblePlaceholderRoles.table.has(role)) fail("incompatible-placeholder-content", `Table cannot be bound to ${role} placeholder`);
399
486
  }
400
487
  assertAllowedTableKeys(input.props, tableAllowedParameters, "Table");
401
488
  const requestedName = parseOptionalName(input.props["name"]);
402
489
  const morphKey = parseMorphKey(input.props["morphKey"]);
403
490
  const link = parseLinkTarget(input.props["link"]);
404
491
  const allowedStyleKeys = new Set(tableStyleKeys);
405
- const contract = parseCapabilityLayoutContract({
406
- nativeKind: "graphicFrame",
407
- props: input.props,
408
- allowedStyleKeys,
409
- allowPadding: false,
410
- path: context.path
411
- });
492
+ const contract = {
493
+ ...parseCapabilityLayoutContract({
494
+ nativeKind: "graphicFrame",
495
+ props: input.props,
496
+ allowedStyleKeys,
497
+ allowPadding: false,
498
+ path: context.path
499
+ }),
500
+ contentMinimumsEnforced: true
501
+ };
412
502
  const columns = parseTableColumns(input.props["columns"]);
413
503
  const tableStyle = trackStyle(input, "table");
504
+ const tableBgParsed = yield* parseLayerBackground(tableStyle.style, "Table", context.theme, context.path);
505
+ const tableBorders = resolveTableLayerBorders(tableStyle.style, {}, context.theme, context.path);
414
506
  const tableVerticalAlign = parseTableVerticalAlign(tableStyle.style["verticalAlign"]) ?? "middle";
415
- const { rows, cells } = prepareRows(input, columns, tableStyle.textStyle, tableVerticalAlign, context.theme, context.slideNumber);
507
+ const { rows, cells } = yield* prepareRows(input, columns, tableStyle.textStyle, tableVerticalAlign, tableBgParsed.value, tableBorders, context.theme, context.slideNumber, context.options.referenceDate);
416
508
  const placeholderGeometry = placeholder === void 0 ? void 0 : resolvePlaceholderGeometry(placeholder, input.props);
417
509
  const parsed = {
418
510
  columns,
@@ -421,16 +513,13 @@ const tableCapability = {
421
513
  rows,
422
514
  cells,
423
515
  contract,
424
- declaredX: placeholderGeometry?.x ?? input.props["x"],
425
- declaredY: placeholderGeometry?.y ?? input.props["y"],
426
- declaredWidth: contract.layoutStyle.width ?? input.props["width"] ?? placeholderGeometry?.width
516
+ declaredX: placeholderGeometry?.x,
517
+ declaredY: placeholderGeometry?.y,
518
+ declaredWidth: placeholderGeometry?.width ?? contract.explicitPixelSize?.width,
519
+ declaredHeight: placeholderGeometry?.height ?? contract.explicitPixelSize?.height
427
520
  };
428
521
  const authorId = typeof input.props["id"] === "string" ? input.props["id"] : void 0;
429
- const motionProps = {
430
- ...input.props["enter"] !== void 0 ? { enter: input.props["enter"] } : {},
431
- ...input.props["emphasis"] !== void 0 ? { emphasis: input.props["emphasis"] } : {},
432
- ...input.props["motion"] !== void 0 ? { motion: input.props["motion"] } : {}
433
- };
522
+ const motionProps = pickMotionProps(input.props);
434
523
  const native = {
435
524
  ...morphKey === void 0 ? {} : { morphKey },
436
525
  ...requestedName === void 0 ? {} : { hasExplicitName: true },
@@ -440,45 +529,39 @@ const tableCapability = {
440
529
  contract,
441
530
  ...morphKey !== void 0 || requestedName !== void 0 || link !== void 0 ? { native } : {},
442
531
  measureLayout(request) {
443
- const declaredSize = typeof parsed.declaredWidth === "number" ? parseTablePositiveSize(parsed.declaredWidth, "Table.width") : void 0;
444
- const natural = tableLayoutModel(parsed, void 0, request.theme);
445
- const naturalWidth = natural.widths.reduce((sum, width) => sum + width, 0);
532
+ const declaredSize = typeof parsed.declaredWidth === "number" ? parseTablePositiveSize(parsed.declaredWidth, "style.width") : void 0;
533
+ const declaredHeight = typeof parsed.declaredHeight === "number" ? parseTablePositiveSize(parsed.declaredHeight, "style.height") : void 0;
446
534
  const availableWidth = request.availableWidth !== void 0 && request.availableWidth > 0 ? request.availableWidth : void 0;
535
+ const natural = (declaredSize !== void 0 || request.widthMode === "exactly") && !columns.some((track) => track.kind === "auto") ? void 0 : tableLayoutModel(parsed, void 0, request.theme);
536
+ const naturalWidth = natural?.widths.reduce((sum, width) => sum + width, 0) ?? 0;
447
537
  const requestedWidth = declaredSize ?? (availableWidth !== void 0 && (request.widthMode === "exactly" || request.widthMode === void 0 || naturalWidth > availableWidth) ? availableWidth : void 0);
448
- const model = requestedWidth === void 0 ? natural : tableLayoutModel(parsed, requestedWidth, request.theme);
538
+ const model = requestedWidth === void 0 ? natural ?? tableLayoutModel(parsed, void 0, request.theme) : tableLayoutModel(parsed, requestedWidth, request.theme);
539
+ const width = model.widths.reduce((sum, value) => sum + value, 0);
540
+ const baseHeight = model.heights.reduce((sum, value) => sum + value, 0);
541
+ const targetHeight = declaredHeight ?? (request.heightMode === "exactly" ? request.availableHeight : void 0);
542
+ const hasAutoRow = rows.some((row) => row.height === void 0);
449
543
  return {
450
- width: model.widths.reduce((sum, value) => sum + value, 0),
451
- height: model.heights.reduce((sum, value) => sum + value, 0),
452
- minContentWidth: natural.widths.reduce((sum, value) => sum + value, 0),
453
- minContentHeight: natural.heights.reduce((sum, value) => sum + value, 0)
544
+ width,
545
+ height: targetHeight !== void 0 && targetHeight > baseHeight + .01 && hasAutoRow ? targetHeight : baseHeight,
546
+ minContentWidth: natural === void 0 ? width : naturalWidth,
547
+ minContentHeight: baseHeight
454
548
  };
455
549
  },
456
550
  resolve(resolveContext) {
457
- const requestedWidth = resolveContext.layoutBox?.width ?? (typeof parsed.declaredWidth === "number" ? parseTablePositiveSize(parsed.declaredWidth, "Table.width") : void 0);
551
+ const requestedWidth = (typeof parsed.declaredWidth === "number" ? parseTablePositiveSize(parsed.declaredWidth, "style.width") : void 0) ?? resolveContext.layoutBox?.width;
458
552
  const model = tableLayoutModel(parsed, requestedWidth, resolveContext.theme);
459
553
  const { widths } = model;
460
554
  const heights = [...model.heights];
461
- const warnings = [...model.warnings];
462
555
  const claims = [...model.claims];
463
556
  const fontUses = [];
464
- const warningKeys = new Set(model.warningKeys);
465
557
  const addTextResult = (result, path) => {
466
- for (const warning of result.warnings) {
467
- const key = `${path}\u0000${warning.code}\u0000${warning.message}`;
468
- if (warningKeys.has(key)) continue;
469
- warningKeys.add(key);
470
- warnings.push({
471
- ...warning,
472
- path
473
- });
474
- }
475
558
  claims.push(...result.resourceClaims);
476
559
  fontUses.push(...result.fontUses.map((use) => ({
477
560
  ...use,
478
561
  path
479
562
  })));
480
563
  };
481
- const targetHeight = resolveContext.layoutBox?.height;
564
+ const targetHeight = (typeof parsed.declaredHeight === "number" ? parseTablePositiveSize(parsed.declaredHeight, "style.height") : void 0) ?? resolveContext.layoutBox?.height;
482
565
  if (targetHeight !== void 0) {
483
566
  const naturalHeight = heights.reduce((sum, value) => sum + value, 0);
484
567
  if (targetHeight > naturalHeight + .01) {
@@ -486,23 +569,17 @@ const tableCapability = {
486
569
  if (growable.length > 0) {
487
570
  const extra = (targetHeight - naturalHeight) / growable.length;
488
571
  for (const row of growable) heights[row] = (heights[row] ?? 0) + extra;
489
- } else warnings.push({
490
- code: "table-height-underflow",
491
- message: `Sum of fixed row heights ${naturalHeight}px is less than layout height ${targetHeight}px; build preserves row heights`
492
- });
493
- } else if (targetHeight < naturalHeight - .01) warnings.push({
494
- code: "table-height-overflow",
495
- message: `Sum of row heights ${naturalHeight}px exceeds layout height ${targetHeight}px; build preserves row heights`
496
- });
572
+ }
573
+ }
497
574
  }
498
575
  const x = parseTableCoordinate(resolveContext.layoutBox?.x ?? parsed.declaredX, "x");
499
576
  const y = parseTableCoordinate(resolveContext.layoutBox?.y ?? parsed.declaredY, "y");
500
- const width = widths.reduce((sum, value) => sum + value, 0);
577
+ const width = parseTablePositiveSize(widths.reduce((sum, value) => sum + value, 0), "style.width");
501
578
  const box = {
502
579
  x,
503
580
  y,
504
581
  width,
505
- height: heights.reduce((sum, value) => sum + value, 0)
582
+ height: parseTablePositiveSize(heights.reduce((sum, value) => sum + value, 0), "style.height")
506
583
  };
507
584
  const columnOffsets = [];
508
585
  let offsetX = x;
@@ -531,6 +608,7 @@ const tableCapability = {
531
608
  const matrix = rows.map(() => Array.from({ length: columns.length }, () => ""));
532
609
  const resolvedCells = [];
533
610
  const resolvedAnchors = /* @__PURE__ */ new Map();
611
+ const fontUsages = [];
534
612
  for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) for (let column = 0; column < columns.length; column += 1) {
535
613
  const cell = anchors.get(`${rowIndex}:${column}`);
536
614
  if (cell === void 0) {
@@ -541,84 +619,98 @@ const tableCapability = {
541
619
  const contentSized = rows.slice(cell.row, cell.row + cell.rowSpan).some((row) => row.height === void 0);
542
620
  const body = resolveCellBody(cell, resolveContext.theme, innerWidthOf(cell), innerHeight, contentSized);
543
621
  addTextResult(body, cell.path);
622
+ for (const usage of body.fontUsages) fontUsages.push({
623
+ ...usage,
624
+ path: cell.path
625
+ });
544
626
  matrix[rowIndex][column] = body.text;
545
- const rowFill = rows[cell.row]?.fill;
546
- const fill = cell.fill ?? rowFill;
627
+ const fill = finishResolveWork(resolveBackgroundValue(resolveContext.theme, cell.backgroundRaw, void 0));
547
628
  const entry = {
548
629
  cell,
549
630
  box: cellBoxes.get(cell),
550
- ...fill === void 0 ? {} : { fill },
631
+ fill,
551
632
  body,
552
633
  hasText: cell.paragraphs.some((paragraph) => paragraph.style.list !== void 0 || paragraph.runs.some((run) => run.text.length > 0)),
553
- hasOverflow: body.warnings.some((warning) => warning.code === "overset")
634
+ hasOverflow: body.textMetrics?.status === "measured" && !body.textMetrics.fits
554
635
  };
555
636
  resolvedCells.push(entry);
556
637
  resolvedAnchors.set(`${rowIndex}:${column}`, entry);
557
638
  }
558
- for (const warning of warnings) if (warning.code === "overset") warning.message = `${warning.message} (table cell preserves original content and declared dimensions)`;
559
639
  const name = resolveContext.morphName ?? requestedName ?? placeholder?.layoutPlaceholder?.name ?? `Table ${resolveContext.id - 1}`;
560
640
  try {
561
641
  assertXml10Characters(name);
562
642
  } catch {
563
- fail("invalid-xml-character", "Table.name contains characters not allowed in XML 1.0");
643
+ fail("invalid-xml-character", "Table.name contains characters not allowed in XML 1.0", void 0, { field: "name" });
564
644
  }
565
- const tableParts = [...rows.map((row, rowIndex) => ({
566
- kind: "row",
567
- ...row.authorId === void 0 ? {} : { authorId: row.authorId },
568
- row: rowIndex,
569
- box: {
570
- x,
571
- y: rowOffsets[rowIndex] ?? y,
572
- width,
573
- height: heights[rowIndex] ?? 0
574
- },
575
- text: matrix[rowIndex]?.join(" ") ?? ""
576
- })), ...cells.map((cell) => ({
577
- kind: "cell",
578
- ...cell.authorId === void 0 ? {} : { authorId: cell.authorId },
579
- row: cell.row,
580
- column: cell.column,
581
- rowSpan: cell.rowSpan,
582
- colSpan: cell.colSpan,
583
- box: cellBoxes.get(cell),
584
- text: matrix[cell.row]?.[cell.column] ?? ""
585
- }))];
586
- const subParts = rows.map((row, rowIndex) => ({
587
- ...row.authorId === void 0 ? {} : { authorId: row.authorId },
588
- box: {
589
- x,
590
- y: rowOffsets[rowIndex] ?? y,
591
- width,
592
- height: heights[rowIndex] ?? 0
593
- },
594
- text: matrix[rowIndex]?.join(" ") ?? "",
595
- parts: cells.filter((cell) => cell.row === rowIndex).map((cell) => ({
596
- ...cell.authorId === void 0 ? {} : { authorId: cell.authorId },
645
+ const resolvedRowObservations = rows.map((row, rowIndex) => {
646
+ const rowY = rowOffsets[rowIndex] ?? y;
647
+ const rowHeight = heights[rowIndex] ?? 0;
648
+ const rowPath = `${resolveContext.path}/row[${row.authorId ?? rowIndex}]`;
649
+ return {
650
+ index: rowIndex,
651
+ ...row.authorId === void 0 ? {} : { id: row.authorId },
652
+ path: rowPath,
653
+ y: rowY,
654
+ height: rowHeight,
655
+ box: {
656
+ x,
657
+ y: rowY,
658
+ width,
659
+ height: rowHeight
660
+ }
661
+ };
662
+ });
663
+ const resolvedCellObservations = cells.map((cell) => {
664
+ const textMetrics = resolvedAnchors.get(`${cell.row}:${cell.column}`)?.body.textMetrics;
665
+ if (textMetrics === void 0) throw new Error(`Missing textMetrics for table cell (${cell.row}, ${cell.column})`);
666
+ const cellPath = `${resolvedRowObservations[cell.row]?.path ?? `${resolveContext.path}/row[${cell.row}]`}/cell[${cell.authorId ?? cell.column}]`;
667
+ return {
668
+ row: cell.row,
669
+ column: cell.column,
670
+ rowSpan: cell.rowSpan,
671
+ colSpan: cell.colSpan,
672
+ ...cell.authorId === void 0 ? {} : { id: cell.authorId },
673
+ path: cellPath,
597
674
  box: cellBoxes.get(cell),
598
- text: matrix[cell.row]?.[cell.column] ?? ""
675
+ text: matrix[cell.row]?.[cell.column] ?? "",
676
+ textMetrics
677
+ };
678
+ });
679
+ const subParts = resolvedRowObservations.map((rowObs) => ({
680
+ kind: "row",
681
+ ...rowObs.id === void 0 ? {} : { authorId: rowObs.id },
682
+ path: rowObs.path,
683
+ box: rowObs.box,
684
+ text: matrix[rowObs.index]?.join(" ") ?? "",
685
+ parts: resolvedCellObservations.filter((cellObs) => cellObs.row === rowObs.index).map((cellObs) => ({
686
+ kind: "cell",
687
+ ...cellObs.id === void 0 ? {} : { authorId: cellObs.id },
688
+ path: cellObs.path,
689
+ box: cellObs.box,
690
+ text: cellObs.text,
691
+ textMetrics: cellObs.textMetrics
599
692
  }))
600
693
  }));
601
694
  const observation = {
602
- columnWidths: [...widths],
603
- rowHeights: [...heights],
604
- cells: matrix,
695
+ columns: [...widths],
696
+ rows: resolvedRowObservations,
697
+ cells: resolvedCellObservations,
605
698
  merges: cells.filter((cell) => cell.colSpan > 1 || cell.rowSpan > 1).map(({ row, column, rowSpan, colSpan }) => ({
606
699
  row,
607
700
  column,
608
701
  rowSpan,
609
702
  colSpan
610
- })),
611
- ...tableParts.some(({ authorId }) => authorId !== void 0) ? { parts: tableParts } : {}
703
+ }))
612
704
  };
613
705
  const annotations = motionAnnotations(motionProps, {
614
706
  kind: "table",
615
707
  name,
616
708
  ...authorId === void 0 ? {} : { authorId },
617
709
  textBody: true,
618
- filled: cells.some((cell) => cell.fill !== void 0 || rows[cell.row]?.fill !== void 0),
710
+ filled: resolvedCells.some((entry) => entry.fill.kind !== "none"),
619
711
  box,
620
712
  rotationDegrees: 0,
621
- hasBackground: cells.some((cell) => cell.fill !== void 0 || rows[cell.row]?.fill !== void 0)
713
+ hasBackground: resolvedCells.some((entry) => entry.fill.kind !== "none")
622
714
  });
623
715
  const resolvedModel = {
624
716
  x,
@@ -647,7 +739,7 @@ const tableCapability = {
647
739
  extensions: [],
648
740
  ...annotations.length === 0 ? {} : { annotations },
649
741
  resourceClaims: claims,
650
- ...warnings.length === 0 ? {} : { warnings },
742
+ ...fontUsages.length === 0 ? {} : { fontUsages },
651
743
  emit(emitContext) {
652
744
  return mechanism.emit(resolvedModel, emitContext);
653
745
  },