allyhub 0.20.0 → 0.22.0

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 (323) hide show
  1. package/dist/commands/cloud-tools.js +5 -5
  2. package/dist/commands/export.js +1 -1
  3. package/dist/commands/frames.js +8 -8
  4. package/dist/commands/index.js +1 -1
  5. package/dist/commands/run.js +2 -0
  6. package/dist/commands.json +1 -1
  7. package/dist/help.js +3 -3
  8. package/dist/main.js +4 -4
  9. package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
  10. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  11. package/dist/node_modules/@allyhub/blocks/dist/elements.js +1 -1
  12. package/dist/node_modules/@allyhub/blocks/dist/layout.js +1 -1
  13. package/dist/node_modules/@allyhub/blocks/dist/palette.js +1 -1
  14. package/dist/node_modules/@allyhub/blocks/dist/resolve.js +1 -1
  15. package/dist/node_modules/@allyhub/blocks/package.json +1 -1
  16. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  17. package/dist/node_modules/@allyhub/build/dist/migrate.js +1 -1
  18. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  19. package/dist/node_modules/@allyhub/build/dist/project-root.js +1 -1
  20. package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
  21. package/dist/node_modules/@allyhub/build/package.json +1 -1
  22. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  23. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  24. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  25. package/dist/node_modules/@allyhub/check/package.json +1 -1
  26. package/dist/node_modules/@allyhub/cloud/dist/call.js +2 -2
  27. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  28. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  29. package/dist/node_modules/@allyhub/components/package.json +1 -1
  30. package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
  31. package/dist/node_modules/@allyhub/dev-server/dist/record.js +2 -1
  32. package/dist/node_modules/@allyhub/dev-server/dist/validate.js +2 -2
  33. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  34. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  35. package/dist/node_modules/@allyhub/doc/dist/block-shapes.js +2 -0
  36. package/dist/node_modules/@allyhub/doc/dist/blocks.js +1 -1
  37. package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -5
  38. package/dist/node_modules/@allyhub/doc/dist/shapes.js +2 -2
  39. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  40. package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +1 -1
  41. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  42. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  43. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  44. package/dist/node_modules/@allyhub/export/package.json +1 -1
  45. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  46. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  47. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +3 -3
  48. package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +9 -1
  49. package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +1 -1
  50. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +151 -151
  51. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +173 -173
  52. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +1 -2
  53. package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
  54. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +1 -1
  55. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  56. package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +2 -0
  57. package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
  58. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +106 -101
  59. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  60. package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +26 -1
  61. package/dist/node_modules/@allyhub/formats/dist/tolerant.js +1 -1
  62. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  63. package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
  64. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  65. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  66. package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
  67. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +1 -1
  68. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  69. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  70. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  71. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  72. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  73. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  74. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
  75. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  76. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  77. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -1
  78. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  79. package/dist/node_modules/@allyhub/media/package.json +1 -1
  80. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  81. package/dist/node_modules/@allyhub/model/package.json +1 -1
  82. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  83. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  84. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  85. package/dist/node_modules/@allyhub/project/package.json +1 -1
  86. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  87. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  88. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  89. package/dist/node_modules/@allyhub/render/package.json +1 -1
  90. package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
  91. package/dist/node_modules/@allyhub/report-extension/dist/build.js +3 -0
  92. package/dist/node_modules/@allyhub/report-extension/dist/check.js +37 -0
  93. package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +4 -0
  94. package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
  95. package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
  96. package/dist/node_modules/@allyhub/report-extension/dist/page.js +23 -0
  97. package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +33 -0
  98. package/dist/node_modules/@allyhub/report-extension/dist/styles.js +2 -0
  99. package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
  100. package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
  101. package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
  102. package/dist/node_modules/@allyhub/report-extension/package.json +185 -0
  103. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +180 -0
  104. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +15 -0
  105. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  106. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  107. package/dist/node_modules/@allyhub/scaffold/dist/index.js +8 -8
  108. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  109. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  110. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  111. package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
  112. package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
  113. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  114. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  115. package/dist/node_modules/@allyhub/sheet/dist/theme.js +1 -1
  116. package/dist/node_modules/@allyhub/sheet/dist/tiles.js +1 -1
  117. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  118. package/dist/node_modules/@allyhub/sheet/dist/xlsx/tile-shapes.js +2 -0
  119. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  120. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  121. package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
  122. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
  123. package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
  124. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  125. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  126. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  127. package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -2
  128. package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +1 -1
  129. package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
  130. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  131. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  132. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  133. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  134. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +2 -2
  135. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  136. package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
  137. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  138. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  139. package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
  140. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  141. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  142. package/dist/node_modules/@allyhub/website/package.json +1 -1
  143. package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
  144. package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
  145. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  146. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  147. package/dist/package.json +15 -14
  148. package/dist/run-register.js +2 -0
  149. package/dist/works.js +1 -1
  150. package/editor-web/assets/{abnfDiagram-WEYOIA3C-BkVJMd53.js → abnfDiagram-WEYOIA3C-D6qI3rai.js} +1 -1
  151. package/editor-web/assets/{architecture-WOLXFQ4H-C6rnaynZ.js → architecture-WOLXFQ4H-B3V6ggq8.js} +1 -1
  152. package/editor-web/assets/{architectureDiagram-ZHVYKT53-D3vrh8LK.js → architectureDiagram-ZHVYKT53-IauNyxXn.js} +1 -1
  153. package/editor-web/assets/article-BHjKp5We.js +3 -0
  154. package/editor-web/assets/article-BlNKv1Cn.js +7 -0
  155. package/editor-web/assets/bar-button-CJmpgNg4.js +1 -0
  156. package/editor-web/assets/{blockDiagram-RJAE7QA3-BKngt8H7.js → blockDiagram-RJAE7QA3-yXhlfxbH.js} +1 -1
  157. package/editor-web/assets/{c4Diagram-XDPPPE54-j7sUELqF.js → c4Diagram-XDPPPE54-B-anrhvt.js} +1 -1
  158. package/editor-web/assets/{calc-worker-Cr4a0xmt.js → calc-worker-BpAgQE9E.js} +3 -3
  159. package/editor-web/assets/channel-Bhb-_8v6.js +1 -0
  160. package/editor-web/assets/chip-pNQlYa2W.js +1 -0
  161. package/editor-web/assets/{chunk-2E7WHVMD-BXa-uRSi.js → chunk-2E7WHVMD-QPOni4XB.js} +1 -1
  162. package/editor-web/assets/{chunk-4EMNKR2T-B3ntcsZN.js → chunk-4EMNKR2T-DG1FCRRI.js} +1 -1
  163. package/editor-web/assets/{chunk-55XCU76K-AMvnFwUg.js → chunk-55XCU76K-mKuMXpnC.js} +1 -1
  164. package/editor-web/assets/{chunk-7S6XSTFO-BA6esfFu.js → chunk-7S6XSTFO-CgZAazgt.js} +1 -1
  165. package/editor-web/assets/{chunk-AQDTSKZB-BT_vANXs.js → chunk-AQDTSKZB-BRU84phF.js} +1 -1
  166. package/editor-web/assets/{chunk-DSNLSHJZ-DoUgmzGB.js → chunk-DSNLSHJZ-zku9oeG3.js} +1 -1
  167. package/editor-web/assets/{chunk-HAGFOTED-DtnIrCZb.js → chunk-HAGFOTED-CaUkBv_0.js} +1 -1
  168. package/editor-web/assets/{chunk-HNE4Q36P-BlPwQx3_.js → chunk-HNE4Q36P-BQz4ZCJf.js} +1 -1
  169. package/editor-web/assets/{chunk-NQOKRVIF-D2r7jp2r.js → chunk-NQOKRVIF-CHVBEDkg.js} +1 -1
  170. package/editor-web/assets/{chunk-UHW7PFBP-Cmc0_F5o.js → chunk-UHW7PFBP-DrYeJo1e.js} +1 -1
  171. package/editor-web/assets/{chunk-VQ5W62QI-nJSMqAr0.js → chunk-VQ5W62QI-D8ToVCUe.js} +1 -1
  172. package/editor-web/assets/{chunk-WQQL4CDK-Btq2nbF6.js → chunk-WQQL4CDK-DZ0tyi9F.js} +1 -1
  173. package/editor-web/assets/{chunk-YZO67HFG-DTbcCoGt.js → chunk-YZO67HFG-BLe7PXER.js} +1 -1
  174. package/editor-web/assets/{chunk-ZAUX2LTX-DVwkg-2N.js → chunk-ZAUX2LTX-ByaeSIre.js} +1 -1
  175. package/editor-web/assets/{chunk-ZCHMQSOR-BV39jOOE.js → chunk-ZCHMQSOR-DdMJr_t5.js} +1 -1
  176. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-Cj74-fhM.js → classDiagram-v2-4MYWR3UA-DDpq7fFC.js} +1 -1
  177. package/editor-web/assets/collaborator-CbTacvkB.js +1 -0
  178. package/editor-web/assets/color-picker-CDeICDN5.js +1 -0
  179. package/editor-web/assets/{cynefin-EF2NZ3EQ-C0CkiipV.js → cynefin-EF2NZ3EQ-CMivy2fr.js} +1 -1
  180. package/editor-web/assets/{cynefinDiagram-WF24UDRP-hdsnJ4cI.js → cynefinDiagram-WF24UDRP-GtxT_9wW.js} +1 -1
  181. package/editor-web/assets/{dagre-NK4GIZVX-CC7WSgaK.js → dagre-NK4GIZVX-Bn1O2Hjl.js} +1 -1
  182. package/editor-web/assets/deck-Cohd-G5m.js +1 -0
  183. package/editor-web/assets/{diagram-CBK3MWTC-DmaVm13J.js → diagram-CBK3MWTC-W715PWZw.js} +1 -1
  184. package/editor-web/assets/{diagram-I5XIIV2D-De8jqp7b.js → diagram-I5XIIV2D-BKObZPn2.js} +1 -1
  185. package/editor-web/assets/{diagram-ODIL2UCW-B5pBTulX.js → diagram-ODIL2UCW-UtQxEPoW.js} +1 -1
  186. package/editor-web/assets/{diagram-PFBEJUXE-BYsXg5_w.js → diagram-PFBEJUXE-CpLGEK-k.js} +1 -1
  187. package/editor-web/assets/{diagram-RJA3I4VV-DZ8f6bYe.js → diagram-RJA3I4VV-DGyMXoHb.js} +1 -1
  188. package/editor-web/assets/{diagram-TYUNFSNR-qXHUsauD.js → diagram-TYUNFSNR-Dy_Ewr8V.js} +1 -1
  189. package/editor-web/assets/dist-0I0Obj60.js +19 -0
  190. package/editor-web/assets/dist-6ugUm4dS.js +6 -0
  191. package/editor-web/assets/dist-B0rUvCi2.js +1 -0
  192. package/editor-web/assets/{dist-DAhe-kFC.js → dist-B8_6sJ_V.js} +1 -1
  193. package/editor-web/assets/dist-CKD_paj_.js +1 -0
  194. package/editor-web/assets/dist-CKUW5NzS.js +3 -0
  195. package/editor-web/assets/dist-Ca9Gsuu0.js +24 -0
  196. package/editor-web/assets/dist-Cc8v9lfc.js +1 -0
  197. package/editor-web/assets/dist-CynBNzYv.js +1 -0
  198. package/editor-web/assets/{dist-9kuRjUTN.js → dist-D7M5YTq2.js} +6 -6
  199. package/editor-web/assets/dist-D9tsFc2N.js +16 -0
  200. package/editor-web/assets/dist-DNMKDcLg.js +35 -0
  201. package/editor-web/assets/dist-Doj7_HUI.js +547 -0
  202. package/editor-web/assets/dist-DptBQzJR.js +1 -0
  203. package/editor-web/assets/dist-DzKB210A.js +5 -0
  204. package/editor-web/assets/{dist-B3rd02Cg.js → dist-H9rTuNhb.js} +6 -6
  205. package/editor-web/assets/{dist-DA72-4WB.js → dist-QLXI7XGS.js} +1 -1
  206. package/editor-web/assets/dist-RyGsFHE0.js +4 -0
  207. package/editor-web/assets/dist-oeSWr2LE.js +19 -0
  208. package/editor-web/assets/dist-wD_hHJ8_.js +19 -0
  209. package/editor-web/assets/{docx-draw-L54blreB.js → docx-draw-B5cM77hc.js} +1 -1
  210. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-B7-IfVI-.js → ebnfDiagram-V4P3TTPT-GPYcx6dU.js} +1 -1
  211. package/editor-web/assets/{elk-QONTBCTQ-Gj_WaeBn.js → elk-QONTBCTQ-Bi0r4UFM.js} +1 -1
  212. package/editor-web/assets/{erDiagram-KYQIGQAA-BDF6Qoqx.js → erDiagram-KYQIGQAA-DrOSrnci.js} +1 -1
  213. package/editor-web/assets/esm-jIPnpbBD.js +21 -0
  214. package/editor-web/assets/{eventmodeling-K75KTNOO-elxVXXEe.js → eventmodeling-K75KTNOO-Dw-MjgUb.js} +1 -1
  215. package/editor-web/assets/eye-DwfE1USj.js +1 -0
  216. package/editor-web/assets/flowDiagram-IUGLLWBU-DbZTfPEP.js +1 -0
  217. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CEogW3jW.js → ganttDiagram-R7GPNTJY-Bwe8cQqi.js} +1 -1
  218. package/editor-web/assets/{gitGraph-VSP46ZUC-Bh9cRWFa.js → gitGraph-VSP46ZUC-DsAcAKP0.js} +1 -1
  219. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BQAvdM_V.js → gitGraphDiagram-PDYL7XHY-aObRwdru.js} +1 -1
  220. package/editor-web/assets/hint-F4fIBnVU.js +1 -0
  221. package/editor-web/assets/index-Cah2zchD.css +2 -0
  222. package/editor-web/assets/index-D-MNVykg.js +28 -0
  223. package/editor-web/assets/{info-OHQRW6UA-CdPrqere.js → info-OHQRW6UA-DBPN8JFr.js} +1 -1
  224. package/editor-web/assets/{infoDiagram-MVDRKAX5-uwIMeP44.js → infoDiagram-MVDRKAX5-Bx26Hq7M.js} +1 -1
  225. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-rtfvqK7E.js → ishikawaDiagram-HPEHV2GE-BJ_MCDwA.js} +1 -1
  226. package/editor-web/assets/{journeyDiagram-BOSHW7O7-mmhfIyVG.js → journeyDiagram-BOSHW7O7-B5g4W2Dx.js} +1 -1
  227. package/editor-web/assets/{kanban-definition-FNSA4HC5-Fe7jBsi-.js → kanban-definition-FNSA4HC5-U8YNlxN7.js} +1 -1
  228. package/editor-web/assets/layout-CuWN7_3k.js +1 -0
  229. package/editor-web/assets/{mermaid-parser.core-BxOSjBH9.js → mermaid-parser.core-DYLQlYDo.js} +3 -3
  230. package/editor-web/assets/{mermaid.core-BOln9YdH.js → mermaid.core-qNJmZ0b4.js} +4 -4
  231. package/editor-web/assets/{mindmap-definition-6OY57UG3-M3Q1LOtO.js → mindmap-definition-6OY57UG3-CI5aBWbK.js} +1 -1
  232. package/editor-web/assets/{packet-JDAUHWVQ-Dbb0TUG6.js → packet-JDAUHWVQ-BBclMGlJ.js} +1 -1
  233. package/editor-web/assets/palette-DchDLJj6.js +1 -0
  234. package/editor-web/assets/panes-BShVq38A.js +3 -0
  235. package/editor-web/assets/{pegDiagram-ECIUJNBX-BZMRpSFC.js → pegDiagram-ECIUJNBX-B3pljPTu.js} +1 -1
  236. package/editor-web/assets/{pie-XZMESJXO-Ctm9XdKp.js → pie-XZMESJXO-B7WzimHm.js} +1 -1
  237. package/editor-web/assets/{pieDiagram-GNMPY74T-cGbs5ZTl.js → pieDiagram-GNMPY74T-tM1Da50-.js} +1 -1
  238. package/editor-web/assets/progress-D1Uv3d1b.js +6 -0
  239. package/editor-web/assets/{quadrantDiagram-D57K4MC3-BUe_zsxT.js → quadrantDiagram-D57K4MC3-BEq_Shj9.js} +1 -1
  240. package/editor-web/assets/{radar-ABXABTNO-CCmKtqLs.js → radar-ABXABTNO-v2jJSW5T.js} +1 -1
  241. package/editor-web/assets/{railroad-I3PHUGI6-k-yhjhjA.js → railroad-I3PHUGI6-6W3Z4F8Y.js} +1 -1
  242. package/editor-web/assets/{railroad-abnf-LNEFI6M7-B-PvntB3.js → railroad-abnf-LNEFI6M7-DxIN7Zrt.js} +1 -1
  243. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-Ds2rua1h.js → railroad-ebnf-DWYD2UWJ-Bb5O7tAx.js} +1 -1
  244. package/editor-web/assets/{railroad-peg-JR7BVNR7-jNZ2wEp2.js → railroad-peg-JR7BVNR7-i2LjEP5t.js} +1 -1
  245. package/editor-web/assets/{railroadDiagram-Y72NRBL7-CTqSQ15w.js → railroadDiagram-Y72NRBL7-DhsyVKbG.js} +1 -1
  246. package/editor-web/assets/{requirementDiagram-EQYSW5RA-CUblhR5M.js → requirementDiagram-EQYSW5RA-Du2k7i1E.js} +1 -1
  247. package/editor-web/assets/ribbon-tabs-Bxuj_hct.js +1 -0
  248. package/editor-web/assets/row-DqS4-5b1.js +1 -0
  249. package/editor-web/assets/{sankeyDiagram-SY24JHO5-nSz6zDX3.js → sankeyDiagram-SY24JHO5-CDnRMu7J.js} +1 -1
  250. package/editor-web/assets/schemas-CnlOL0u4.js +1 -0
  251. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DxTpOYuo.js → sequenceDiagram-BLEHNHQU-BUXBhWYW.js} +1 -1
  252. package/editor-web/assets/{session-BhClkDyr.js → session--OJYv_B7.js} +1 -1
  253. package/editor-web/assets/{snapshots-DwGHDN3t.js → snapshots-DYooVfOx.js} +1 -1
  254. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-C3e14iHY.js → stateDiagram-v2-A6IESKWZ-Enb8LZUA.js} +1 -1
  255. package/editor-web/assets/surface-BUoi7cmR.js +1 -0
  256. package/editor-web/assets/swatch-DCmD1gZl.js +1 -0
  257. package/editor-web/assets/{swimlanes-B3ENRKFQ-DPPdzNzu.js → swimlanes-B3ENRKFQ-pnpjgTrl.js} +1 -1
  258. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B-B2Eoc8.js +8 -0
  259. package/editor-web/assets/switch-b6GCy_ix.js +1 -0
  260. package/editor-web/assets/syntax-Bqyhj0dw.js +1 -0
  261. package/editor-web/assets/tablet-C6oePHEW.js +1 -0
  262. package/editor-web/assets/textarea-Bu6uPEqT.js +1 -0
  263. package/editor-web/assets/themes-D_ISkWVz.js +1 -0
  264. package/editor-web/assets/{timeline-definition-JXYKGLGB-DRTJ1_Er.js → timeline-definition-JXYKGLGB-C4pR18kd.js} +1 -1
  265. package/editor-web/assets/trash-2-SFReAxVM.js +1 -0
  266. package/editor-web/assets/{treeView-D4JQ5SDB-BYJ_m-i5.js → treeView-D4JQ5SDB-kzNGeAv6.js} +1 -1
  267. package/editor-web/assets/{treemap-SAJKECNS-BcU6I6Rg.js → treemap-SAJKECNS-Buhb5wzt.js} +1 -1
  268. package/editor-web/assets/updating-Cbxw83_O.js +1 -0
  269. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-YV92pS4o.js → usecaseDiagram-WPOLBNNX-CL-xLQWl.js} +1 -1
  270. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-oAvfHZtf.js → vennDiagram-Q3Y3IDCW-bwsyCcdK.js} +1 -1
  271. package/editor-web/assets/{video-SJvDRCJK.js → video-8MxWX9f5.js} +1 -1
  272. package/editor-web/assets/{wardley-7MLQ67FV-BLNiqxtt.js → wardley-7MLQ67FV-DXsLgedI.js} +1 -1
  273. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-SppgC6xW.js → wardleyDiagram-IVAIDKWA-Cn0ph953.js} +1 -1
  274. package/editor-web/assets/{words-BUlNNuH2.js → words-B2jQwWpp.js} +1 -1
  275. package/editor-web/assets/{words-zMedmPWc.js → words-DgMuEmDO.js} +1 -1
  276. package/editor-web/assets/workbook-BDWkQ149.js +41 -0
  277. package/editor-web/assets/x-BAJilkKD.js +41 -0
  278. package/editor-web/assets/{xychartDiagram-4URNHDU4-BHMn_jwJ.js → xychartDiagram-4URNHDU4-CfXnqGWZ.js} +1 -1
  279. package/editor-web/index.html +6 -6
  280. package/package.json +5 -2
  281. package/editor-web/assets/article-DHf6mOY_.js +0 -7
  282. package/editor-web/assets/article-Dns1-Xh-.js +0 -3
  283. package/editor-web/assets/bar-button-CKPfx2AB.js +0 -1
  284. package/editor-web/assets/channel-CVWSV3su.js +0 -1
  285. package/editor-web/assets/chip-Bn_9JRRG.js +0 -1
  286. package/editor-web/assets/collaborator-XiHOxwGM.js +0 -1
  287. package/editor-web/assets/deck-DQpNIS2p.js +0 -1
  288. package/editor-web/assets/dist--z0ZHp4T.js +0 -16
  289. package/editor-web/assets/dist-B5GOGGEe.js +0 -1
  290. package/editor-web/assets/dist-Bx6q9kCu.js +0 -1
  291. package/editor-web/assets/dist-C4hHtrJr.js +0 -1
  292. package/editor-web/assets/dist-CCXJewsi.js +0 -19
  293. package/editor-web/assets/dist-CfK2BLl8.js +0 -4
  294. package/editor-web/assets/dist-Cmux3oJ_.js +0 -1
  295. package/editor-web/assets/dist-Cspf85KV.js +0 -6
  296. package/editor-web/assets/dist-DOrGo1GD.js +0 -19
  297. package/editor-web/assets/dist-DjiCHlSu.js +0 -35
  298. package/editor-web/assets/dist-Do4a40Wn.js +0 -19
  299. package/editor-web/assets/dist-FKEWS3Co.js +0 -547
  300. package/editor-web/assets/dist-QKd2i6kG.js +0 -5
  301. package/editor-web/assets/dist-SGnOfLhx.js +0 -24
  302. package/editor-web/assets/dist-VmVB7tl4.js +0 -3
  303. package/editor-web/assets/esm-PQD5Pn8a.js +0 -21
  304. package/editor-web/assets/flowDiagram-IUGLLWBU-B-25n8zE.js +0 -1
  305. package/editor-web/assets/hint-CbwoSBMw.js +0 -1
  306. package/editor-web/assets/index-CXisi0Cj.css +0 -2
  307. package/editor-web/assets/index-wMlfx8aT.js +0 -28
  308. package/editor-web/assets/layout-SWqqA0yV.js +0 -1
  309. package/editor-web/assets/progress-DZQTiRLv.js +0 -6
  310. package/editor-web/assets/ribbon-DajdQ_Ya.js +0 -1
  311. package/editor-web/assets/row-Bei9HNEe.js +0 -1
  312. package/editor-web/assets/schemas-C21MyseF.js +0 -1
  313. package/editor-web/assets/split-DBAbwPZ5.js +0 -3
  314. package/editor-web/assets/surface-CIF0Ae0z.js +0 -1
  315. package/editor-web/assets/swatch-BUzr_XmH.js +0 -1
  316. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B8n3zOw_.js +0 -8
  317. package/editor-web/assets/switch-DrZxoPQS.js +0 -1
  318. package/editor-web/assets/syntax-emXV4DnN.js +0 -1
  319. package/editor-web/assets/tabs-BwU2E7bU.js +0 -1
  320. package/editor-web/assets/textarea-BX_ax3X8.js +0 -1
  321. package/editor-web/assets/tolerant-DM9s0Mt1.js +0 -1
  322. package/editor-web/assets/type-CvZ0HZsV.js +0 -41
  323. package/editor-web/assets/workbook-BZKYx4WB.js +0 -41
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/sheet",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as b}from"node:crypto";import{readFile as F}from"node:fs/promises";import{join as N,posix as S}from"node:path";import{problem as J}from"@allyhub/diagnostics";import{sdkEntriesOf as j}from"@allyhub/build";import{cellName as k,chartFormula as C,checkWorkbook as E,readCells as A,readSheetFile as D,seededRandom as L,SharedFormula as M,tableRows as $,textOf as O,CellError as R}from"@allyhub/sheet";import W from"./build-plugins.js";import{readSheetSource as x,sheetCodeOf as H,sheetFilePath as K,workbookFiles as P}from"./code.js";export const LEND={sdk:j(W)};function T(o,t,l,i,h){const n={};for(const e of l.tables){const a=$(i,e),d=$(i,e,{values:"shown"}),c=b("sha256").update(h).update(JSON.stringify(a)).update(JSON.stringify(d)).digest("hex");n[`${o}#${e.name}`]={sha256:c,value:a,shown:d},n[`${t}#${e.name}`]={sha256:c,value:a,shown:d}}const m=(e,a,d)=>{const c=b("sha256").update(h).update(e).update(JSON.stringify(a)).update(JSON.stringify(d)).digest("hex");n[`${o}#${e}`]={sha256:c,value:a,shown:d},n[`${t}#${e}`]={sha256:c,value:a,shown:d}};for(const e of l.names.values()){if(e.hidden===!0||e.sheet!==void 0)continue;const a=new M(C(e.name),0,0,e.source),d=l.sheets[0];if(!a.node||!d)continue;const c=A(i,d,a),g=c.map(r=>v(r.value)),u=c.map(O);c.length===1?m(e.name,g[0],u[0]):c.length>1&&m(e.name,g,u)}for(const e of l.sheets){const a=e.used;if(!a)continue;const d=l.tables.filter(r=>r.sheet===e).map(r=>r.area),c=(r,f)=>d.some(p=>r>=p.top&&r<=p.bottom&&f>=p.left&&f<=p.right),g={},u={};for(let r=a.top;r<=a.bottom;r++)for(let f=a.left;f<=a.right;f++){if(c(r,f))continue;const p=i.value(e,r,f);if(p===null)continue;const s=k({row:r,col:f});g[s]=v(p),u[s]=O({value:p,sheet:e,row:r,col:f})}Object.keys(g).length>0&&m(`${e.name}!`,g,u)}return n}const v=o=>o instanceof R?o.code:o;async function w(o,t,l){const i=[],h=t.entry,n=await x(o,h,l?{meta:l}:{lend:LEND}).catch(()=>{});if(!n)return{};i.push(...n.problems);const{csv:m,generated:e}=n,a=b("sha256").update(n.text);for(const s of m.values())a.update(s);e&&a.update(JSON.stringify(e));const d=a.digest("hex"),c=E(P(o,n),{random:L(d)}),g=K(n);for(const s of c.problems){const y=g(s.file);i.push(J("AK-M009",`${y}${s.line===void 0?"":`:${String(s.line)}`}: ${s.message}.`,{where:{file:y,...s.line===void 0?{}:{line:s.line}}}))}const{workbook:u,calc:r}=c,f=u?.title?.trim();return{sheet:{dir:t.dir,place:t.id,file:h,...f?{title:f}:{},sheets:u?.sheets.map(s=>s.name)??[],tables:u?.tables.map(s=>({name:s.name,rows:s.rows}))??[],files:[h,...[...m.keys()].map(s=>n.at.get(s)??S.join(t.dir,s)),...n.code===void 0?[]:[n.code]],...e?{generated:e}:{},...n.failed?{codeFailed:!0}:{}},problems:i,files:[...[...m.keys()].map(s=>({path:n.at.get(s)??S.join(t.dir,s),role:"table"})),...n.code===void 0?[]:[{path:n.code,role:"code"}]],...u&&r?{data:T(t.id,h,u,r,d)}:{}}}export async function readSheets(o,t,l){const i=[],h=[];let n={};for(const m of t){const e=await w(o,m,l);e.sheet&&i.push(e.sheet),h.push(...e.problems??[]),n={...n,...e.data}}return{sheets:i,problems:h,data:n}}const V={lend:(o,t)=>w(t.root,o,t.meta),code:async(o,t)=>{const l=await F(N(t.root,o.entry),"utf8").catch(()=>"");if(H(o.entry,l)===void 0)return{failed:!1};const i=await x(t.root,o.entry,{lend:t.lend}).catch(()=>{});return{failed:i?.failed??!0,...i?.generated?{value:i.generated}:{}}},unreadable:o=>D(o).problems.filter(t=>t.message.startsWith("not YAML")).map(t=>t.message),render:async(o,t)=>(await import("./export.js")).renderSheet(o,t)};export default V;
2
+ import{createHash as b}from"node:crypto";import{readFile as F}from"node:fs/promises";import{join as N,posix as S}from"node:path";import{problem as J}from"@allyhub/diagnostics";import{sdkEntriesOf as j}from"@allyhub/build";import{cellName as k,chartFormula as C,checkWorkbook as E,readCells as A,readSheetFile as D,seededRandom as L,SharedFormula as M,tableRows as $,textOf as v,CellError as R}from"@allyhub/sheet";import W from"./build-plugins.js";import{readSheetSource as O,sheetCodeOf as H,sheetFilePath as K,workbookFiles as P}from"./code.js";export const LEND={sdk:j(W)};function T(o,t,c,i,h){const s={};for(const e of c.tables){const a=$(i,e),l=$(i,e,{values:"shown"}),d=b("sha256").update(h).update(JSON.stringify(a)).update(JSON.stringify(l)).digest("hex");s[`${o}#${e.name}`]={sha256:d,value:a,shown:l},s[`${t}#${e.name}`]={sha256:d,value:a,shown:l}}const m=(e,a,l)=>{const d=b("sha256").update(h).update(e).update(JSON.stringify(a)).update(JSON.stringify(l)).digest("hex");s[`${o}#${e}`]={sha256:d,value:a,shown:l},s[`${t}#${e}`]={sha256:d,value:a,shown:l}};for(const e of c.names.values()){if(e.hidden===!0||e.sheet!==void 0)continue;const a=new M(C(e.name),0,0,e.source),l=c.sheets[0];if(!a.node||!l)continue;const d=A(i,l,a),g=d.map(r=>x(r.value)),u=d.map(v);d.length===1?m(e.name,g[0],u[0]):d.length>1&&m(e.name,g,u)}for(const e of c.sheets){const a=e.used;if(!a)continue;const l=c.tables.filter(r=>r.sheet===e).map(r=>r.area),d=(r,f)=>l.some(p=>r>=p.top&&r<=p.bottom&&f>=p.left&&f<=p.right),g={},u={};for(let r=a.top;r<=a.bottom;r++)for(let f=a.left;f<=a.right;f++){if(d(r,f))continue;const p=i.value(e,r,f);if(p===null)continue;const n=k({row:r,col:f});g[n]=x(p),u[n]=v({value:p,sheet:e,row:r,col:f})}Object.keys(g).length>0&&m(`${e.name}!`,g,u)}return s}const x=o=>o instanceof R?o.code:o;async function w(o,t,c){const i=[],h=t.entry,s=await O(o,h,c?{meta:c}:{lend:LEND}).catch(()=>{});if(!s)return{};i.push(...s.problems);const{csv:m,generated:e}=s,a=b("sha256").update(s.text);for(const n of m.values())a.update(n);e&&a.update(JSON.stringify(e));const l=a.digest("hex"),d=E(P(o,s),{random:L(l)}),g=K(s);for(const n of d.problems){const y=g(n.file);i.push(J("AK-M009",`${y}${n.line===void 0?"":`:${String(n.line)}`}: ${n.message}.`,{where:{file:y,...n.line===void 0?{}:{line:n.line}},...n.level===void 0?{}:{level:n.level}}))}const{workbook:u,calc:r}=d,f=u?.title?.trim();return{sheet:{dir:t.dir,place:t.id,file:h,...f?{title:f}:{},sheets:u?.sheets.map(n=>n.name)??[],tables:u?.tables.map(n=>({name:n.name,rows:n.rows}))??[],files:[h,...[...m.keys()].map(n=>s.at.get(n)??S.join(t.dir,n)),...s.code===void 0?[]:[s.code]],...e?{generated:e}:{},...s.failed?{codeFailed:!0}:{}},problems:i,files:[...[...m.keys()].map(n=>({path:s.at.get(n)??S.join(t.dir,n),role:"table"})),...s.code===void 0?[]:[{path:s.code,role:"code"}]],...u&&r?{data:T(t.id,h,u,r,l)}:{}}}export async function readSheets(o,t,c){const i=[],h=[];let s={};for(const m of t){const e=await w(o,m,c);e.sheet&&i.push(e.sheet),h.push(...e.problems??[]),s={...s,...e.data}}return{sheets:i,problems:h,data:s}}const V={lend:(o,t)=>w(t.root,o,t.meta),code:async(o,t)=>{const c=await F(N(t.root,o.entry),"utf8").catch(()=>"");if(H(o.entry,c)===void 0)return{failed:!1};const i=await O(t.root,o.entry,{lend:t.lend}).catch(()=>{});return{failed:i?.failed??!0,...i?.generated?{value:i.generated}:{}}},unreadable:o=>D(o).problems.filter(t=>t.message.startsWith("not YAML")).map(t=>t.message),render:async(o,t)=>(await import("./export.js")).renderSheet(o,t)};export default V;
@@ -4,5 +4,5 @@ import{existsSync as ce}from"node:fs";import{mkdir as he,readFile as X,stat as d
4
4
  `)}}});function Ie(e,n){return z(e,n.trim()).flatMap(s=>s.rows.flat().map(t=>({...t,address:t.address===""?n.trim():`${s.sheet}!${t.address}`})))}const Re=40;function Le(e){const n=e.map(r=>z(r,void 0)),s=e[0],t=(r,i)=>{const h=s?.wb.sheet(r),l=Z(i);if(!s||!h||!l||s.readers(h,l.row,l.col).length>0)return;const d=h.at(l.row,l.col);return d instanceof O?s.precedents(d).reduce((p,w)=>p+(w.bottom-w.top+1)*(w.right-w.left+1),0):0},o=[],a=[];for(const[r,i]of(n[0]??[]).entries())for(const[h,l]of i.rows.entries())for(const[d,p]of l.entries()){if(p.formula===void 0||new Set(n.map($=>$[r]?.rows[h]?.[d]?.shown)).size<2)continue;const g=`${i.sheet}!${p.address}`,c=t(i.sheet,p.address);c===void 0?a.push(g):o.push({at:g,reads:c})}return[...o.sort((r,i)=>i.reads-r.reads).map(r=>r.at),...a]}async function Be(e,n,s,t){const o=await T(e,n,s),a=K(o.workbook);if(a.length===0)throw new y("not-found",`${o.file} has no scenarios.`,{exit:x.notFound,hint:`${k(o.file)}'s scenarios: { high: { growth: 0.2 } } names some.`});const r=new Set(a.flatMap(c=>Object.keys(o.workbook.file.scenarios?.[c]??{}).map($=>$.toLowerCase()))),i=["Base case",...a],h=[o,...await Promise.all(a.map(c=>T(e,n,s,c)))],l=t===void 0?Le(h.map(c=>c.calc)):[],d=t?.split(",")??[...[...o.workbook.names.values()].map(c=>c.name).filter(c=>!r.has(c.toLowerCase())),...l].slice(0,Re);if(d.length===0)throw new y("bad-input","Its scenarios change nothing it computes. Say what to compare: names, cells or ranges, apart by commas.",{exit:x.usage});const w=d.map(c=>h.map($=>Ie($.calc,c))).flatMap(c=>(c[0]??[]).map(($,b)=>({output:$.address,values:Object.fromEntries(i.map((v,S)=>[v,c[S]?.[b]?.value??null])),shown:Object.fromEntries(i.map((v,S)=>[v,c[S]?.[b]?.shown??""]))}))),g=t===void 0?w.filter(c=>new Set(Object.values(c.shown)).size>1):w;return{value:{file:o.file,scenarios:i,outputs:g},text:[...U([["",...i],...g.map(c=>[c.output,...i.map($=>c.shown[$]??"")])]),...P(o.problems)].join(`
5
5
  `)}}const Ne=(e,n)=>`${e.sheet===n?"":`${e.sheet.name}!`}${G({top:e.top,left:e.left,bottom:Math.min(e.bottom,Math.max(e.top,e.sheet.lastRow)),right:e.right})}`;export const sheetTrace=j({input:f.strictObject({sheet:f.string().describe("The sheet, by its file or its id in allyhub.yaml"),cell:f.string().describe("The cell: Summary!B5, or B5 on the first sheet"),all:f.boolean().default(!1).describe(`Every cell that reads it, not the first ${String(TRACE_CELLS)}`),dir:C}),positional:["sheet","cell"],output:f.looseObject({}),examples:["allyhub sheet trace finance/budget 'Summary!B1'"],run:async(e,n)=>{const s=await A(n.cwd,e.dir),{file:t,workbook:o,calc:a}=await T(s,n,e.sheet),{sheet:r,address:i}=se(o,e.cell),h=Z(i);if(!h)throw new y("bad-input",`${e.cell} is not a cell.`,{exit:x.usage});const{row:l,col:d}=h,p=a.value(r,l,d),w=r.lookAt(l,d).format,g=r.at(l,d),c=o.sourceOf(r,l,d),$=g instanceof O?a.precedents(g).map(m=>{const ie=m.single?E(a.value(m.sheet,m.top,m.left),m.sheet.lookAt(m.top,m.left).format):`${u(m.cols)} × ${u(Math.max(0,Math.min(m.bottom,m.sheet.lastRow)-m.top+1))}`,J=m.single?m.sheet.at(m.top,m.left):void 0,V=J instanceof O?J.text:void 0;return{address:Ne(m,r),shown:ie,...V===void 0?{}:{formula:V}}}):[],b=a.readers(r,l,d),v=e.all?b:b.slice(0,TRACE_CELLS),S=v.map(m=>({address:`${m.sheet===r?"":`${m.sheet.name}!`}${R(m)}`,shown:E(m.value,m.sheet.lookAt(m.row,m.col).format),formula:m.text})),W=m=>[` ${m.address}`,m.shown,m.formula].filter(Boolean).join(" "),H=c===void 0?void 0:c.file===L||c.file===""?t:I.join(we(t),c.file),M=c?.line===void 0?H:`${H??""}:${String(c.line)}`;return{value:{file:t,cell:`${r.name}!${R(h)}`,value:_(p,w),shown:E(p,w),...p instanceof be?{error:p.code}:{},...g instanceof O?{formula:g.text}:{},...M===void 0?{}:{written:M},reads:$,readBy:S,readers:b.length},text:[`${r.name}!${R(h)} ${E(p,w)}`,...g instanceof O?[` ${g.text}`]:[],...M===void 0?[]:[` written in ${M}`],...$.length>0?["reads:",...$.map(W)]:[],...b.length>0?[`read by ${u(b.length)}:`,...S.map(W),...b.length>v.length?[` … ${u(b.length-v.length)} more (--all)`]:[]]:["read by nothing"]].join(`
6
6
  `)}}}),sheetCapabilities=j({input:f.strictObject({}),output:f.looseObject({}),examples:["allyhub sheet capabilities"],run:()=>Promise.resolve({value:{...Q},text:JSON.stringify(Q,null,2)})});const ne=new Set([".xlsx",".xlsm",".xltx",".xltm"]);export const DIFF_ROWS=50;const oe={value:"Value changed, formula the same",formula:"Formula changed, value the same",both:"Formula and value changed",added:"Added",removed:"Removed"},De=e=>{const n=(e.now??e.was)?.cell??"",s=e.table===void 0?n:`${e.table}[${e.key??n}]`,t=e.column===void 0?"":` ${e.column}`;return`${e.sheet}!${s}${t}`},_e=e=>{const n=e.was?.formula??"",s=e.now?.formula??"";return[De(e),e.was?.shown??"","→",e.now?.shown??"",e.kind==="value"?s:e.kind==="formula"||e.kind==="both"?`${n} → ${s}`:s===""?n:s]};function Pe(e,n){const s=[];for(const t of e.sheets)s.push(`Sheet ${t.name} ${t.added?"added":"removed"}`);for(const t of e.tables){const o=[t.rowsAdded.length>0?`rows added: ${t.rowsAdded.slice(0,20).join(", ")}`:"",t.rowsRemoved.length>0?`rows removed: ${t.rowsRemoved.slice(0,20).join(", ")}`:"",t.columnsAdded.length>0?`columns added: ${t.columnsAdded.join(", ")}`:"",t.columnsRemoved.length>0?`columns removed: ${t.columnsRemoved.join(", ")}`:""].filter(Boolean);s.push(`Table ${t.name}, rows lined up by ${t.by==="key"?t.key??"its key":"their place"}${o.length>0?`: ${o.join("; ")}`:""}`)}for(const t of e.names)s.push(`Name ${t.name}: ${t.was??"(none)"} → ${t.now??"(none)"}`);for(const t of e.parts)s.push(`${t.sheet??"Workbook"} ${t.part}${t.key===void 0?"":` ${t.key}`}: ${t.was??"(none)"} → ${t.now??"(none)"}`);for(const t of e.charts)s.push(`Charts of ${t} changed`);for(const t of Object.keys(oe)){const o=e.cells.filter(r=>r.kind===t);if(o.length===0)continue;const a=n?o:o.slice(0,DIFF_ROWS);s.push("",`${oe[t]}: ${u(o.length)}`,...U(a.map(_e)).map(r=>` ${r}`),...o.length>a.length?[` … ${u(o.length-a.length)} more (--all)`]:[])}return s}async function ae(e,n,s){const t=Y(n.cwd,s);if(ne.has(F(t).toLowerCase())){const r=await X(t).catch(()=>{throw new y("not-found",`There is no file ${t}.`,{exit:x.notFound})}),i=ee(new Uint8Array(r),{name:k(t,F(t))}),{calc:h}=ke({text:i.files.get(L)??"",read:l=>i.files.get(l)});if(!h)throw new y("bad-file",`${s} cannot be read.`,{exit:x.usage});return{calc:h,file:s}}const{calc:o,file:a}=await T(e,n,s);return{calc:o,file:a}}export const sheetDiff=j({input:f.strictObject({was:f.string().describe("The version before: a sheet (its file or its id) or an .xlsx"),now:f.string().describe("The version after: a sheet (its file or its id) or an .xlsx"),tolerance:f.number().min(0).default($e.tolerance).describe("How far apart two numbers may be, as a share of the larger, and be the same"),all:f.boolean().default(!1).describe(`Every cell, not the first ${String(DIFF_ROWS)} of each kind`),dir:C}),positional:["was","now"],output:f.looseObject({}),examples:["allyhub sheet diff finance/budget finance/budget-v2","allyhub sheet diff finance/budget ~/Downloads/budget.xlsx --json"],run:async(e,n)=>{const s=await A(n.cwd,e.dir),t=await ae(s,n,e.was),o=await ae(s,n,e.now),a=Se(t.calc,o.calc,{tolerance:e.tolerance}),{counts:r}=a,i=a.cells.length;return{value:{was:t.file,now:o.file,...a},text:[`${t.file} → ${o.file}: ${u(i)} cell${i===1?"":"s"} differ (${u(r.value)} value, ${u(r.formula)} formula, ${u(r.both)} both, ${u(r.added)} added, ${u(r.removed)} removed); ${u(a.names.length+a.parts.length)} other thing${a.names.length+a.parts.length===1?"":"s"} differ${a.names.length+a.parts.length===1?"s":""}`,...Pe(a,e.all)].join(`
7
- `)}}});const ze=f.string().transform(e=>e.replace(/^\/+/gu,"")).refine(e=>e.endsWith(".yaml")&&!e.split("/").some(n=>n===""||n==="."||n===".."),{message:"a .yaml file from the project's root, such as research/leads.yaml"});export const IMPORT_DIFFERENCES=50;const re=e=>e===null?"empty":typeof e=="string"?JSON.stringify(e):String(e);function Ue(e,n){const{formulas:s,same:t,uncached:o,moving:a,differences:r}=e,i=[`${u(t)} of ${u(s)} formulas compute what the file holds`,...a>0?[`${u(a)} read the clock or a random number, not compared`]:[],...o>0?[`${u(o)} have no value in the file`]:[]],h=n?r:r.slice(0,IMPORT_DIFFERENCES);return[`Computed here against the file: ${i.join("; ")}.`,...r.length>0?[`${u(r.length)} differ${r.length===1?"s":""}:`,...h.map(l=>` ${l.sheet}!${l.cell} ${l.formula} file ${re(l.file)} here ${re(l.engine)}`),...r.length>h.length?[` … ${u(r.length-h.length)} more (--all)`]:[]]:[]]}async function le(e,n,s){const t=I.dirname(n),o=[...s].map(([a,r])=>({path:a===L?n:t==="."?a:`${t}/${a}`,content:r}));for(const{path:a}of o)if(await de(D(e,a)).catch(()=>{}))throw new y("place-taken",`${a} is already there.`,{exit:x.conflict,hint:"Name another file with --to."});for(const{path:a,content:r}of o){const i=D(e,a);await he(me(i),{recursive:!0}),await fe(i,r,{flag:"wx"})}return o.map(a=>a.path)}export const sheetImport=j({input:f.strictObject({file:f.string().describe("The file to make a sheet of: .xlsx, .xlsm, .csv or .tsv"),to:ze.optional().describe("The sheet's file, from the project's root (default <the file's name>.yaml); its tables' CSV files go beside it, under names no file there has"),maxUnzipped:f.number().positive().default(ue.bytes/1024/1024).describe("The most MB the file may unzip to"),tolerance:f.number().min(0).default(Te).describe("How far apart a computed number and the file's may be, as a share of the larger, and count as the same; 0 lists every difference"),all:f.boolean().default(!1).describe(`Every difference, not the first ${String(IMPORT_DIFFERENCES)}`),dir:C}),positional:["file"],output:f.looseObject({}),examples:["allyhub sheet import ~/Downloads/forecast.xlsx --to finance/forecast.yaml","allyhub sheet import ~/Downloads/leads.csv --to research/leads.yaml"],run:async(e,n)=>{const s=await A(n.cwd,e.dir),t=Y(n.cwd,e.file),o=F(t).toLowerCase(),a=ne.has(o);if(o===".xls"||o===".xlsb")throw new y("bad-file",`${k(t)} is Excel's binary format.`,{exit:x.usage,hint:"Save it as .xlsx, then import that."});if(!a&&o!==".csv"&&o!==".tsv")throw new y("bad-file",`${k(t)} is not an .xlsx, .xlsm, .csv or .tsv file.`,{exit:x.usage});const r=await X(t).catch(()=>{throw new y("not-found",`There is no file ${t}.`,{exit:x.notFound})}),i=k(t,F(t)),h=e.to??`${i}.yaml`,l=I.basename(h,".yaml"),d=pe(h),p=c=>ce(D(s,I.dirname(h),c));if(a){let c;try{c=ee(new Uint8Array(r),{name:l,tolerance:e.tolerance,zip:{bytes:e.maxUnzipped*1024*1024},taken:p})}catch(b){throw new y("bad-file",`${k(t)} cannot be read: ${b.message}`,{exit:x.usage})}const $=await le(s,h,new Map([...c.files,...c.assets]));return await q(s,{kind:"sheet",file:h},n.kinds(s)),{value:{id:d,files:$,sheets:c.sheets,tables:c.tables,lost:c.lost,problems:c.problems,compared:c.compared},text:[`Made ${$.join(", ")}; listed in allyhub.yaml as ${d}.`,...c.lost.length>0?["Not carried over:",...c.lost.map(b=>` ${b}`)]:["Nothing was left out."],...Ue(c.compared,e.all),...c.problems.length>0?["Problems:",...c.problems.map(b=>` ${b.file}${b.line===void 0?"":`:${String(b.line)}`}: ${b.message}`)]:[],`allyhub sheet calc ${d}, then allyhub frames ${d}, to see it.`].join(`
7
+ `)}}});const ze=f.string().transform(e=>e.replace(/^\/+/gu,"")).refine(e=>e.endsWith(".yaml")&&!e.split("/").some(n=>n===""||n==="."||n===".."),{message:"a .yaml file from the project's root, such as research/leads.yaml"});export const IMPORT_DIFFERENCES=50;const re=e=>e===null?"empty":typeof e=="string"?JSON.stringify(e):String(e);function Ue(e,n){const{formulas:s,same:t,uncached:o,moving:a,differences:r}=e,i=[`${u(t)} of ${u(s)} formulas compute what the file holds`,...a>0?[`${u(a)} read the clock or a random number, not compared`]:[],...o>0?[`${u(o)} have no value in the file`]:[]],h=n?r:r.slice(0,IMPORT_DIFFERENCES);return[`Computed here against the file: ${i.join("; ")}.`,...r.length>0?[`${u(r.length)} differ${r.length===1?"s":""}:`,...h.map(l=>` ${l.sheet}!${l.cell} ${l.formula} file ${re(l.file)} here ${re(l.engine)}`),...r.length>h.length?[` … ${u(r.length-h.length)} more (--all)`]:[]]:[]]}async function le(e,n,s){const t=I.dirname(n),o=[...s].map(([a,r])=>({path:a===L?n:t==="."?a:`${t}/${a}`,content:r}));for(const{path:a}of o)if(await de(D(e,a)).catch(()=>{}))throw new y("place-taken",`${a} is already there.`,{exit:x.conflict,hint:"Name another file with --to."});for(const{path:a,content:r}of o){const i=D(e,a);await he(me(i),{recursive:!0}),await fe(i,r,{flag:"wx"})}return o.map(a=>a.path)}export const sheetImport=j({input:f.strictObject({file:f.string().describe("The file to make a sheet of: .xlsx, .xlsm, .csv or .tsv"),to:ze.optional().describe("The sheet's file, from the project's root (default <the file's name>.yaml); its tables' CSV files go beside it, under names no file there has"),maxUnzipped:f.number().positive().default(ue.bytes/1024/1024).describe("The most MB the file may unzip to"),tolerance:f.number().min(0).default(Te).describe("How far apart a computed number and the file's may be, as a share of the larger, and count as the same; 0 lists every difference"),all:f.boolean().default(!1).describe(`Every difference, not the first ${String(IMPORT_DIFFERENCES)}`),dir:C}),positional:["file"],output:f.looseObject({}),examples:["allyhub sheet import ~/Downloads/forecast.xlsx --to finance/forecast.yaml","allyhub sheet import ~/Downloads/leads.csv --to research/leads.yaml"],run:async(e,n)=>{const s=await A(n.cwd,e.dir),t=Y(n.cwd,e.file),o=F(t).toLowerCase(),a=ne.has(o);if(o===".xls"||o===".xlsb")throw new y("bad-file",`${k(t)} is Excel's binary format.`,{exit:x.usage,hint:"Save it as .xlsx, then import that."});if(!a&&o!==".csv"&&o!==".tsv")throw new y("bad-file",`${k(t)} is not an .xlsx, .xlsm, .csv or .tsv file.`,{exit:x.usage});const r=await X(t).catch(()=>{throw new y("not-found",`There is no file ${t}.`,{exit:x.notFound})}),i=k(t,F(t)),h=e.to??`${i}.yaml`,l=I.basename(h,".yaml"),d=pe(h),p=c=>ce(D(s,I.dirname(h),c));if(a){let c;try{c=ee(new Uint8Array(r),{name:l,tolerance:e.tolerance,zip:{bytes:e.maxUnzipped*1024*1024},taken:p})}catch(b){throw new y("bad-file",`${k(t)} cannot be read: ${b.message}`,{exit:x.usage})}const $=await le(s,h,new Map([...c.files,...c.assets]));return await q(s,{kind:"sheet",file:h},n.kinds(s)),{value:{id:d,files:$,sheets:c.sheets,tables:c.tables,lost:c.lost,problems:c.problems,compared:c.compared},text:[`Made ${$.join(", ")}; listed in allyhub.yaml as ${d}.`,...c.lost.length>0?["Not carried over:",...c.lost.map(b=>` ${b}`)]:["Nothing was left out."],...Ue(c.compared,e.all),...c.problems.length>0?["Problems:",...c.problems.map(b=>` ${b.file}${b.line===void 0?"":`:${String(b.line)}`}: ${b.message}`)]:[]].join(`
8
8
  `)}}let w;try{w=je(l,r.toString("utf8"),o===".tsv"?" ":",",p)}catch(c){throw new y("bad-file",c.message,{exit:x.usage})}const g=await le(s,h,new Map([[L,w.text],[w.path,w.csv]]));return await q(s,{kind:"sheet",file:h},n.kinds(s)),{value:{id:d,files:g,rows:w.rows,lost:[]},text:`Made ${g.join(" and ")}, listed in allyhub.yaml as ${d}: ${u(w.rows)} row${w.rows===1?"":"s"}`}}});
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/sheet-extension",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./code": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{Animations as l,GlowFormat as h,ReflectionFormat as d,SoftEdgeFormat as p,Background as c,Cell as m,ColorFormat as u,Column as _,FillFormat as y,Font as f,FreeformBuilder as w,GeneratedSlide as g,Generator as b,GroupShape as P,Hyperlink as S,LineFormat as A,ListLevel as O,ShadowFormat as E,GradientStop as x,Paragraph as L,Placeholders as T,Presentation as C,Row as M,Run as I,Shape as v,ShapeCollection as R,SlideLayout as k,SlideLayouts as N,SlideMaster as D,SlideMasters as F,Table as H,TextFrame as G,TextStyles as B}from"./api.js";import{CategoryChartData as W,Chart as z,XyChartData as j,XySeriesData as X,AxisTitle as U,ChartAxis as Y,ChartFormat as Z,ChartLegend as V,MajorGridlines as J,TickLabels as K,ChartPlot as q,ChartPoint as Q,ChartSeries as $,DataLabel as ee,DataLabels as te}from"./chart-api.js";import{MSO_ANCHOR as ae,MSO_ARROWHEAD as se,MSO_ARROWHEAD_SIZE as oe,MSO_AUTO_SIZE as re,MSO_CONNECTOR as ie,MSO_FILL as ne,MSO_LINE as le,MSO_LINE_CAP as he,MSO_LINE_COMPOUND as de,MSO_LINE_JOIN as pe,MSO_PATTERN_TYPE as ce,MSO_SHAPE as me,MSO_SHAPE_TYPE as ue,MSO_TEXT_CAPS as _e,MSO_TEXT_ORIENTATION as ye,MSO_TEXT_STRIKE as fe,MSO_THEME_COLOR as we,MSO_UNDERLINE as ge,PP_ALIGN as be,PP_PLACEHOLDER as Pe,THEME_FONT as Se,XL_CHART_TYPE as Ae,XL_LABEL_POSITION as Oe,XL_LEGEND_POSITION as Ee}from"./enums.js";import{publicNames as o}from"./strict.js";const a={Presentation:{theme:"The theme's colours (dk1…folHlink) and fonts (major, minor), over the project's look.",components:"components.add(name, { props, layers }): a shape drawn by code, by the layer contract.",generators:"generators.add(name, (g) => { g.data(path); g.slides.add_slide(layout, id) … }): slides made from data, placed in the slides file as one block."},SlideMasters:{add:"add(name): a master, with Office's text styles and no placeholders yet."},Table:{style:"Its style, one of PowerPoint's 74 built-in table styles, by its English name as the gallery shows it (Medium Style 2 - Accent 1, Light Style 1, No Style, Table Grid); set by name or id ({5C22544A-…}), null for none (a:tableStyleId)."},_Cell:{borders:"Its edges: { left, right, top, bottom }, each { color, width } (a:lnL…)."},LineFormat:{cap_type:"How its ends and dashes end (MSO_LINE_CAP): PowerPoint's Cap type (a:ln@cap), flat unless set.",join_type:"How its corners meet (MSO_LINE_JOIN): PowerPoint's Join type (a:round, a:bevel, a:miter), a miter unless set.",compound_type:"One line, two or three (MSO_LINE_COMPOUND): PowerPoint's Compound type (a:ln@cmpd), single unless set.",begin_arrow:"What the end of the line where it starts has (MSO_ARROWHEAD): PowerPoint's Begin Arrow type (a:headEnd).",end_arrow:"What the end of the line where it ends has (MSO_ARROWHEAD): PowerPoint's End Arrow type (a:tailEnd).",begin_arrow_width:"How wide the arrowhead where the line starts is (MSO_ARROWHEAD_SIZE): PowerPoint's Begin Arrow size (a:headEnd@w).",begin_arrow_length:"How long the arrowhead where the line starts is (MSO_ARROWHEAD_SIZE): PowerPoint's Begin Arrow size (a:headEnd@len).",end_arrow_width:"How wide the arrowhead where the line ends is (MSO_ARROWHEAD_SIZE): PowerPoint's End Arrow size (a:tailEnd@w).",end_arrow_length:"How long the arrowhead where the line ends is (MSO_ARROWHEAD_SIZE): PowerPoint's End Arrow size (a:tailEnd@len)."},ColorFormat:{transforms:"DrawingML's transforms of the colour in order, [{ name, value }]: tint, shade, lumMod, lumOff, lum, satMod, satOff, sat, hueMod, hueOff, hue, alpha, alphaMod, alphaOff, each value a share (0.75 is 75%), degrees for hue and hueOff; set, they take a brightness's place."},FillFormat:{gradient_path:`A gradient's kind: "linear" along gradient_angle, or out from its focus, "circle", "rect" or "shape" (a:path), PowerPoint's Radial, Rectangular and Path; its first stop is at the focus.`,gradient_focus:"A path gradient's focus (a:fillToRect): { left, top, right, bottom }, the share in from each side, the middle unless set; PowerPoint's Direction (From Center is 0.5 each, From Top Left Corner { left: 0, top: 0, right: 1, bottom: 1 }).",picture:"picture(image_file, { tile, transparency }): a picture filling the shape, PowerPoint's Picture or Texture Fill (a:blipFill), a path from the deck's module's folder, stretched over the shape, or tiled: { scale_x, scale_y } shares of its own size, { offset_x, offset_y } Lengths from where align (TILE_ALIGNMENT, top left unless set) puts its first tile.",transparency:"How much of the fill shows through, a share: PowerPoint's Transparency (a:alpha).",gradient_stops:"Its stops: each read as python-pptx's (color, position), and set whole as [{ at, color, transparency }], `at` and `transparency` shares, a colour as the slides file writes one (accent1, accent1 lighter 40%, #RRGGBB) or a Color; python-pptx's stops can only be read and changed in place."},_GradientStop:{transparency:"How much of its colour shows through, a share (a:alpha)."},ShadowFormat:{blur_radius:"How far the shadow blurs, a Length (a:outerShdw blurRad).",distance:"How far it falls from the shape, a Length (dist).",angle:"The way it falls, degrees clockwise from the right (dir).",transparency:"How much shows through it, a share (a:alpha).",color:"Its colour, a ColorFormat.",visible:"Whether it is drawn, Office's ShadowFormat.Visible: true gives it the defaults' shadow until changed, false none."},Shape:{decorative:"PowerPoint's Mark as Decorative (adec:decorative): it only decorates, so a screen reader passes over it, it has no alternative text, and the check lets its text stand off the slide's edge and over other text.",inner_shadow:"A shadow inside it (a:innerShdw), PowerPoint's Inner shadows: a ShadowFormat with visible, blur_radius, distance, angle, transparency and color; INNER_SHADOW_DEFAULTS until changed.",glow:"Its glow (a:glow), Office's GlowFormat: visible, radius (a Length; 0 takes it away), transparency, color; GLOW_DEFAULTS until changed.",soft_edge:"Its soft edges (a:softEdge), Office's SoftEdgeFormat: radius, how far in its edges fade (0 takes them away).",reflection:"Its reflection (a:reflection), Office's ReflectionFormat: visible, transparency where it starts, size (the share of the shape it shows), offset (how far below, a Length), blur; REFLECTION_DEFAULTS until changed.",flip_h:"Mirrored left to right (a:xfrm flipH), as the slides file's flip_h; its text reads as it is.",flip_v:"Mirrored top to bottom (a:xfrm flipV), as the slides file's flip_v."},FreeformBuilder:{add_curve_segment:"add_curve_segment(x1, y1, x2, y2, x, y): a cubic Bézier segment by its two control points (a:cubicBezTo)."},Font:{strike:"A line through it (@strike): true, or MSO_TEXT_STRIKE.DOUBLE (dblStrike), PowerPoint's Double Strikethrough.",caps:"Its letters as capitals (@cap, MSO_TEXT_CAPS): ALL, SMALL, or NONE over a level that has them; PowerPoint's All Caps and Small Caps.",baseline:"Raised or lowered, a share of its size: superscript 0.3, subscript -0.25 (@baseline).",highlight:"The colour behind it, #RRGGBB as RGBColor gives one (a:highlight).",spacing:"Space added between letters, a Length, negative to tighten (PowerPoint's Character Spacing, a:rPr spc)."},SlideMaster:{color_map:"Its colour map (p:clrMap): what tx1, bg1, tx2, bg2, the accents and the links are of the theme's twelve colours; Office's is { bg1: lt1, tx1: dk1, bg2: lt2, tx2: dk2 }, a dark master's the other way round.",text_styles:"Its text styles (p:txStyles): title_style, body_style, other_style, nine ListLevels each, Office's to start with."},SlideLayouts:{add:"add(name): a layout on this master."},SlideLayout:{color_map:"Its own colour map over its master's (p:clrMapOvr), or undefined for its master's.",display_master_shapes:"Whether its master's shapes are drawn on its slides, true unless set: PowerPoint's Hide Background Graphics (@showMasterSp)."},placeholders:{add:`add(PP_PLACEHOLDER.X, left?, top?, width?, height?, { name, orient }): a placeholder on a master or a layout; a layout's without a frame takes its master's of its base type; orient: "vert" makes it a vertical placeholder (p:ph@orient), its text turned by text_frame.orientation.`},SlideShapes:{add_audio:"add_audio(audio_file, left, top, width?, height?, { playback }): a sound, PowerPoint's Insert Audio, drawn as its icon (half an inch unless given); its shape_type is MSO_SHAPE_TYPE.MEDIA, as python-pptx reads one.",add_component:"add_component(name, left, top, width, height, props): a component of the presentation in a frame.",get:"get(name): a shape by its name."},TextFrame:{orientation:"Which way its text runs (a:bodyPr@vert, MSO_TEXT_ORIENTATION): HORIZONTAL, DOWNWARD (turned 90°), UPWARD (270°), VERTICAL_FAR_EAST (CJK upright, other letters turned), VERTICAL (stacked), VERTICAL_RIGHT_TO_LEFT, MONGOLIAN; PowerPoint's Text Direction.",list_style:"Its list style (a:lstStyle): nine ListLevels, level 0 first, what its paragraphs take where they set nothing.",columns:"Its text in so many columns, 1 to 16 (a:bodyPr@numCol): PowerPoint's Columns.",column_spacing:"The space between its columns (a:bodyPr@spcCol)."},ListLevel:{"*":"A level of a list style: alignment, line_spacing, space_before, space_after, font, bullet (a character, or null for none), bullet_font, bullet_color (a:buClr: a colour, or null for its text's), bullet_size (a:buSzPct: a share of its text's size), numbered (a:buAutoNum: any of ECMA-376's 41 schemes, arabicPeriod, alphaLcParenR, circleNumDbPlain, ea1ChsPeriod…), start_at (the number it starts at), margin_left, indent. A bullet or a number set on a text box's or a shape's level with no margin_left and indent of its own hangs as PowerPoint's Bullets hang it (0.3125 in, a number 0.375 in, past the level's start, half an inch a level)."},text_styles:{"*":"title_style, body_style, other_style: a master's text styles, nine ListLevels each."},Animations:{"*":"A generated slide's Animation Pane: add(shape, effect, { start, direction, amount, duration, delay, paragraph, path, animate_text, text_delay, repeat, rewind }), in order."},Slide:{animations:"Its Animation Pane, which python-pptx has no API for.",transition:"How it comes on from the slide before: { type, direction, through_black, duration }, PowerPoint's fade, push, wipe, split, reveal, cut, cover, uncover, zoom and morph, which python-pptx has no API for."},Axis:{log_base:"A logarithmic scale of this base, 2 to 1000 (c:logBase), PowerPoint's Logarithmic scale; undefined, a straight one.",display_units:"Its numbers in a unit (c:dispUnits): hundreds, thousands, tenThousands, hundredThousands, millions, tenMillions, hundredMillions, billions, trillions; PowerPoint's Display units, said beside the axis.",crosses:"Where the other axis crosses this one, python-pptx's: autoZero, min, max (written on the other axis, as Excel does); crosses_at, a value of it."},Series:{data_labels:"Its own data labels over the chart's (c:ser/c:dLbls): show_value, show_series_name… as the plot's; set them on a series to label it alone, or has_data_labels on the plot for all.",chart_type:"What the series is drawn as (XL_CHART_TYPE): a combination chart's column, line or area type other than the chart's, as Excel's Series.ChartType and PowerPoint's Change Chart Type ▸ Combo; the chart's own unless set.",on_secondary_axis:"On the chart's second value axis, at the right (Excel's Series.AxisGroup xlSecondary, Combo's Secondary Axis): columns, lines and areas only."},Chart:{secondary_value_axis:"Its second value axis, at the right (a c:valAx at axPos r), for its series on_secondary_axis: an Axis, its scale, gridlines, format and title its own."},Generator:{"*":"What a generator's function is given: data(path), and slides.add_slide(layout, id)."}},xe={Presentation:{slides:"A deck's slides are in the slides file it names, their words in its script; slides from data are a generator's.",save:"A deck is not saved by its code: allyhub export writes its files."}},Le={Presentation:C.prototype,SlideMasters:F.prototype,SlideMaster:D.prototype,SlideLayouts:N.prototype,SlideLayout:k.prototype,Slide:g.prototype,placeholders:T.prototype,SlideShapes:R.prototype,Shape:v.prototype,TextFrame:G.prototype,_Paragraph:L.prototype,_Run:I.prototype,_Hyperlink:S.prototype,Font:f.prototype,ColorFormat:u.prototype,FillFormat:y.prototype,LineFormat:A.prototype,ShadowFormat:E.prototype,_GradientStop:x.prototype,FreeformBuilder:w.prototype,GroupShape:P.prototype,Table:H.prototype,CategoryChartData:W.prototype,XyChartData:j.prototype,XySeriesData:X.prototype,Chart:z.prototype,Plot:q.prototype,Series:$.prototype,Point:Q.prototype,DataLabel:ee.prototype,DataLabels:te.prototype,Legend:V.prototype,Axis:Y.prototype,AxisTitle:U.prototype,TickLabels:K.prototype,MajorGridlines:J.prototype,ChartFormat:Z.prototype,_Cell:m.prototype,_Column:_.prototype,_Row:M.prototype,_Background:c.prototype},Te={Animations:l.prototype,GlowFormat:h.prototype,SoftEdgeFormat:p.prototype,ReflectionFormat:d.prototype,ListLevel:O.prototype,text_styles:B.prototype,Generator:b.prototype},Ce=()=>{const e={};for(const[t,r]of Object.entries(Le)){const i=a[t]??{},n=xe[t]??{};e[t]=o(r).filter(s=>!Object.hasOwn(i,s)&&!Object.hasOwn(n,s))}return e};export const CAPABILITIES={reference:{library:"python-pptx",version:"1.0.2",docs:"https://python-pptx.readthedocs.io/"},holds:Ce(),enums:Object.fromEntries(Object.entries({MSO_THEME_COLOR:we,PP_ALIGN:be,MSO_ANCHOR:ae,MSO_AUTO_SIZE:re,PP_PLACEHOLDER:Pe,MSO_SHAPE:me,MSO_CONNECTOR:ie,MSO_SHAPE_TYPE:ue,MSO_FILL:ne,MSO_LINE:le,MSO_LINE_CAP:he,MSO_LINE_JOIN:pe,MSO_LINE_COMPOUND:de,MSO_PATTERN_TYPE:ce,XL_CHART_TYPE:Ae,XL_LABEL_POSITION:Oe,XL_LEGEND_POSITION:Ee,MSO_ARROWHEAD:se,MSO_ARROWHEAD_SIZE:oe,MSO_UNDERLINE:ge,MSO_TEXT_STRIKE:fe,MSO_TEXT_CAPS:_e,MSO_TEXT_ORIENTATION:ye,THEME_FONT:Se}).map(([e,t])=>[e,Object.keys(t)])),units:["Emu","Inches","Pt","Cm","Mm","Centipoints","RGBColor"],differs:["The entry is export default presentation({ slides: ./deck.yaml, script: ./deck.{locale}.yaml, size, theme }, (prs) => { … }), not Presentation(path): a deck is made by its code, never opened from a template. Its masters and layouts are made with the additions below; its slides are in the slides file it names.","A name python-pptx has that is not held throws where it is used, naming what the class holds; python-pptx's x[i] is held where it indexes (slide_masters[0], slide_layouts[0], placeholders[idx], shapes[0]), and len(x) is x.length.","A Length (what Inches(1) and Pt(12) give, and what a length reads, shape.width) is a Number of EMU with python-pptx's emu, inches, cm, mm, pt, centipoints and twips. Arithmetic on Lengths gives a plain number, as python's int does; two Lengths of one value are ===, and one is compared with a plain number by its .emu.",`An enumeration's members are PresentationML's values (MSO_THEME_COLOR.ACCENT_1 is "accent1", PP_ALIGN.CENTER "ctr"), not integers; TEXT_1 and BACKGROUND_1 are tx1 and bg1, which the master's colour map (SlideMaster.color_map) makes dk1 and lt1 (Office's) or, on a dark master, lt1 and dk1. MSO_SHAPE_TYPE.COMPONENT is a component's. PP_PARAGRAPH_ALIGNMENT and MSO_LINE_DASH_STYLE are PP_ALIGN and MSO_LINE by python-pptx's other names; MSO_LINE also holds DrawingML's DOT, SYSTEM_DASH_DOT and SYSTEM_DASH_DOT_DOT, which python-pptx has no name for. A line's transparency is its colour's alpha (line.color.transforms).`,`A colour's rgb is "#RRGGBB": RGBColor(r, g, b), new RGBColor(r, g, b) and RGBColor.from_string("RRGGBB") make one.`,"A colour's brightness is a theme colour's: python-pptx also gives an RGB colour one, which is refused here (set rgb to the colour it makes).","line_spacing is a number of lines, or a Length of Pt(1) and over for a fixed height (python-pptx tells them apart by type). space_before and space_after are a Length too, or a number of lines at the paragraph's size (a:spcPct, PowerPoint's Before and After in lines), which python-pptx does not read.","add_picture() takes both width and height: a picture's own size is not read while a deck's code runs.","add_connector() takes MSO_CONNECTOR's STRAIGHT, ELBOW and CURVE, and also a connector's preset by name where python-pptx has none (straightConnector1, bentConnector2 to 5, curvedConnector2 to 5); a connector's adjustments (an elbow's middle) are its shape.adjustments.","begin_connect() and end_connect() take a site of the shape's own geometry, as PowerPoint numbers them (a rectangle's 0 top, 1 left, 2 bottom, 3 right; an ellipse has 8), where python-pptx places an end on those four of its box whatever its shape; a site the shape has not throws. A glued end follows its shape where the slides file or a person moves it, as PowerPoint's does.",`add_movie(movie_file, left, top, width, height, { poster_frame_time, playback }) takes a video file, its poster a moment of it in seconds, not poster_frame_image, and how it plays, PowerPoint's Playback, which python-pptx has no API for: { start: "auto" | "on-click", trim: { start, end } in seconds, loop, volume (a share, 0 mutes), fullscreen, hide }.`,"A shape's name is its kind and a number (textbox-1, shape-2), and a placeholder's its type's (title, body, subtitle): the slides file and the script name shapes by name.","fit_text() sets the frame to shrink its text when it is drawn (MSO_AUTO_SIZE.TEXT_TO_FIT_SHAPE) from max_size: it reads no font file.","Font.size refuses a size under Pt(1): a bare number is EMU, so size = 12 (python-pptx takes it) draws nothing.","A chart holds column, bar, line, area, pie, doughnut and XY scatter types, and combinations of columns, lines and areas, some on a second value axis (Series.chart_type, on_secondary_axis), which python-pptx reads as several plots and cannot make; it has no 3D, no bubble and no radar. A combination chart's plots share its gap width, overlap and data labels. Setting an axis's has_title gives it the words Axis Title, PowerPoint's new title's. A chart in the slides file can read its numbers from a project file: data, categories and series name it and its columns.","A Point holds format.fill alone. In a chart that varies by categories (a pie, a doughnut) its fill is its category's colour, one for every series (the slides file's category_colors); in any other its own series' (the series' points), as python-pptx's is.","A table starts with python-pptx's Medium Style 2 - Accent 1, first_row and horz_banding on; its style is drawn under its cells' own fill, borders and text, as PowerPoint draws one. add_table returns its shape, whose .table is the table.","A group is its shapes: they are listed with the shapes the group is among, drawn as they are; a group's shapes.add_group_shape() makes a group in it (its shapes' group outer/inner in the slides file); its box is theirs, so left and top move them and width and height only read.","A presentation is 16:9 (12192000 × 6858000) and its theme Office 2013–2022's over the project's look; python-pptx's template is 4:3 with Office 2007's.","prs.slide_layouts and prs.slide_master are the first master's, as python-pptx's; a generator's add_slide also takes a layout of any master by name."],adds:{...a,...Object.fromEntries(Object.entries(Te).map(([e,t])=>[e,{...a[e]??{},names:o(t).join(", ")}]))}};
2
+ import{Animations as l,GlowFormat as h,ReflectionFormat as d,SoftEdgeFormat as p,Background as c,Cell as m,ColorFormat as u,Column as _,FillFormat as f,Font as y,FreeformBuilder as w,GeneratedSlide as g,Generator as b,GroupShape as P,Hyperlink as S,LineFormat as A,ListLevel as O,ShadowFormat as E,GradientStop as x,Paragraph as L,Placeholders as T,Presentation as C,Row as M,Run as I,Shape as v,ShapeCollection as R,SlideLayout as k,SlideLayouts as N,SlideMaster as D,SlideMasters as F,Table as H,TextFrame as G,TextStyles as B}from"./api.js";import{CategoryChartData as W,Chart as z,XyChartData as j,XySeriesData as X,AxisTitle as U,ChartAxis as Y,ChartFormat as Z,ChartLegend as V,MajorGridlines as J,TickLabels as K,ChartPlot as q,ChartPoint as Q,ChartSeries as $,DataLabel as ee,DataLabels as te}from"./chart-api.js";import{MSO_ANCHOR as ae,MSO_ARROWHEAD as se,MSO_ARROWHEAD_SIZE as oe,MSO_AUTO_SIZE as re,MSO_CONNECTOR as ie,MSO_FILL as ne,MSO_LINE as le,MSO_LINE_CAP as he,MSO_LINE_COMPOUND as de,MSO_LINE_JOIN as pe,MSO_PATTERN_TYPE as ce,MSO_SHAPE as me,MSO_SHAPE_TYPE as ue,MSO_TEXT_CAPS as _e,MSO_TEXT_ORIENTATION as fe,MSO_TEXT_STRIKE as ye,MSO_THEME_COLOR as we,MSO_UNDERLINE as ge,PP_ALIGN as be,PP_PLACEHOLDER as Pe,THEME_FONT as Se,XL_CHART_TYPE as Ae,XL_LABEL_POSITION as Oe,XL_LEGEND_POSITION as Ee}from"./enums.js";import{publicNames as o}from"./strict.js";const a={Presentation:{theme:"The theme's colours (dk1…folHlink) and fonts (major, minor), over the project's look.",components:"components.add(name, { props, layers }): a shape drawn by code, by the layer contract.",generators:"generators.add(name, (g) => { g.data(path); g.slides.add_slide(layout, id) … }): slides made from data, placed in the slides file as one block."},SlideMasters:{add:"add(name): a master, with Office's text styles and no placeholders yet."},Table:{style:"Its style, one of PowerPoint's 74 built-in table styles, by its English name as the gallery shows it (Medium Style 2 - Accent 1, Light Style 1, No Style, Table Grid); set by name or id ({5C22544A-…}), null for none (a:tableStyleId)."},_Cell:{borders:"Its edges: { left, right, top, bottom }, each { color, width } (a:lnL…)."},LineFormat:{cap_type:"How its ends and dashes end (MSO_LINE_CAP): PowerPoint's Cap type (a:ln@cap), flat unless set.",join_type:"How its corners meet (MSO_LINE_JOIN): PowerPoint's Join type (a:round, a:bevel, a:miter), a miter unless set.",compound_type:"One line, two or three (MSO_LINE_COMPOUND): PowerPoint's Compound type (a:ln@cmpd), single unless set.",begin_arrow:"What the end of the line where it starts has (MSO_ARROWHEAD): PowerPoint's Begin Arrow type (a:headEnd).",end_arrow:"What the end of the line where it ends has (MSO_ARROWHEAD): PowerPoint's End Arrow type (a:tailEnd).",begin_arrow_width:"How wide the arrowhead where the line starts is (MSO_ARROWHEAD_SIZE): PowerPoint's Begin Arrow size (a:headEnd@w).",begin_arrow_length:"How long the arrowhead where the line starts is (MSO_ARROWHEAD_SIZE): PowerPoint's Begin Arrow size (a:headEnd@len).",end_arrow_width:"How wide the arrowhead where the line ends is (MSO_ARROWHEAD_SIZE): PowerPoint's End Arrow size (a:tailEnd@w).",end_arrow_length:"How long the arrowhead where the line ends is (MSO_ARROWHEAD_SIZE): PowerPoint's End Arrow size (a:tailEnd@len)."},ColorFormat:{transforms:"DrawingML's transforms of the colour in order, [{ name, value }]: tint, shade, lumMod, lumOff, lum, satMod, satOff, sat, hueMod, hueOff, hue, alpha, alphaMod, alphaOff, each value a share (0.75 is 75%), degrees for hue and hueOff; set, they take a brightness's place."},FillFormat:{gradient_path:`A gradient's kind: "linear" along gradient_angle, or out from its focus, "circle", "rect" or "shape" (a:path), PowerPoint's Radial, Rectangular and Path; its first stop is at the focus.`,gradient_focus:"A path gradient's focus (a:fillToRect): { left, top, right, bottom }, the share in from each side, the middle unless set; PowerPoint's Direction (From Center is 0.5 each, From Top Left Corner { left: 0, top: 0, right: 1, bottom: 1 }).",picture:"picture(image_file, { tile, transparency }): a picture filling the shape, PowerPoint's Picture or Texture Fill (a:blipFill), a path from the deck's module's folder, stretched over the shape, or tiled: { scale_x, scale_y } shares of its own size, { offset_x, offset_y } Lengths from where align (TILE_ALIGNMENT, top left unless set) puts its first tile.",transparency:"How much of the fill shows through, a share: PowerPoint's Transparency (a:alpha).",gradient_stops:"Its stops: each read as python-pptx's (color, position), and set whole as [{ at, color, transparency }], `at` and `transparency` shares, a colour as the slides file writes one (accent1, accent1 lighter 40%, #RRGGBB) or a Color; python-pptx's stops can only be read and changed in place."},_GradientStop:{transparency:"How much of its colour shows through, a share (a:alpha)."},ShadowFormat:{blur_radius:"How far the shadow blurs, a Length (a:outerShdw blurRad).",distance:"How far it falls from the shape, a Length (dist).",angle:"The way it falls, degrees clockwise from the right (dir).",transparency:"How much shows through it, a share (a:alpha).",color:"Its colour, a ColorFormat.",visible:"Whether it is drawn, Office's ShadowFormat.Visible: true gives it the defaults' shadow until changed, false none."},Shape:{decorative:"PowerPoint's Mark as Decorative (adec:decorative): it only decorates, so a screen reader passes over it, it has no alternative text, and the check lets its text stand off the slide's edge and over other text.",inner_shadow:"A shadow inside it (a:innerShdw), PowerPoint's Inner shadows: a ShadowFormat with visible, blur_radius, distance, angle, transparency and color; INNER_SHADOW_DEFAULTS until changed.",glow:"Its glow (a:glow), Office's GlowFormat: visible, radius (a Length; 0 takes it away), transparency, color; GLOW_DEFAULTS until changed.",soft_edge:"Its soft edges (a:softEdge), Office's SoftEdgeFormat: radius, how far in its edges fade (0 takes them away).",reflection:"Its reflection (a:reflection), Office's ReflectionFormat: visible, transparency where it starts, size (the share of the shape it shows), offset (how far below, a Length), blur; REFLECTION_DEFAULTS until changed.",flip_h:"Mirrored left to right (a:xfrm flipH), as the slides file's flip_h; its text reads as it is.",flip_v:"Mirrored top to bottom (a:xfrm flipV), as the slides file's flip_v."},FreeformBuilder:{add_curve_segment:"add_curve_segment(x1, y1, x2, y2, x, y): a cubic Bézier segment by its two control points (a:cubicBezTo)."},Font:{strike:"A line through it (@strike): true, or MSO_TEXT_STRIKE.DOUBLE (dblStrike), PowerPoint's Double Strikethrough.",caps:"Its letters as capitals (@cap, MSO_TEXT_CAPS): ALL, SMALL, or NONE over a level that has them; PowerPoint's All Caps and Small Caps.",baseline:"Raised or lowered, a share of its size: superscript 0.3, subscript -0.25 (@baseline).",highlight:"The colour behind it, #RRGGBB as RGBColor gives one (a:highlight).",spacing:"Space added between letters, a Length, negative to tighten (PowerPoint's Character Spacing, a:rPr spc)."},SlideMaster:{color_map:"Its colour map (p:clrMap): what tx1, bg1, tx2, bg2, the accents and the links are of the theme's twelve colours; Office's is { bg1: lt1, tx1: dk1, bg2: lt2, tx2: dk2 }, a dark master's the other way round.",text_styles:"Its text styles (p:txStyles): title_style, body_style, other_style, nine ListLevels each, Office's to start with."},SlideLayouts:{add:"add(name): a layout on this master."},SlideLayout:{color_map:"Its own colour map over its master's (p:clrMapOvr), or undefined for its master's.",display_master_shapes:"Whether its master's shapes are drawn on its slides, true unless set: PowerPoint's Hide Background Graphics (@showMasterSp)."},placeholders:{add:`add(PP_PLACEHOLDER.X, left?, top?, width?, height?, { name, orient }): a placeholder on a master or a layout; a layout's without a frame takes its master's of its base type; orient: "vert" makes it a vertical placeholder (p:ph@orient), its text turned by text_frame.orientation.`},SlideShapes:{add_audio:"add_audio(audio_file, left, top, width?, height?, { playback }): a sound, PowerPoint's Insert Audio, drawn as its icon (half an inch unless given); its shape_type is MSO_SHAPE_TYPE.MEDIA, as python-pptx reads one.",add_component:"add_component(name, left, top, width, height, props): a component of the presentation in a frame.",get:"get(name): a shape by its name."},TextFrame:{orientation:"Which way its text runs (a:bodyPr@vert, MSO_TEXT_ORIENTATION): HORIZONTAL, DOWNWARD (turned 90°), UPWARD (270°), VERTICAL_FAR_EAST (CJK upright, other letters turned), VERTICAL (stacked), VERTICAL_RIGHT_TO_LEFT, MONGOLIAN; PowerPoint's Text Direction.",list_style:"Its list style (a:lstStyle): nine ListLevels, level 0 first, what its paragraphs take where they set nothing.",columns:"Its text in so many columns, 1 to 16 (a:bodyPr@numCol): PowerPoint's Columns.",column_spacing:"The space between its columns (a:bodyPr@spcCol)."},ListLevel:{"*":"A level of a list style: alignment, line_spacing, space_before, space_after, font, bullet (a character, or null for none), bullet_font, bullet_color (a:buClr: a colour, or null for its text's), bullet_size (a:buSzPct: a share of its text's size), numbered (a:buAutoNum: any of ECMA-376's 41 schemes, arabicPeriod, alphaLcParenR, circleNumDbPlain, ea1ChsPeriod…), start_at (the number it starts at), margin_left, indent. A bullet or a number set on a text box's or a shape's level with no margin_left and indent of its own hangs as PowerPoint's Bullets hang it (0.3125 in, a number 0.375 in, past the level's start, half an inch a level)."},text_styles:{"*":"title_style, body_style, other_style: a master's text styles, nine ListLevels each."},Animations:{"*":"A generated slide's Animation Pane: add(shape, effect, { start, direction, amount, duration, delay, paragraph, path, animate_text, text_delay, repeat, rewind }), in order."},Slide:{animations:"Its Animation Pane, which python-pptx has no API for.",transition:"How it comes on from the slide before: { type, direction, through_black, duration }, PowerPoint's fade, push, wipe, split, reveal, cut, cover, uncover, zoom and morph, which python-pptx has no API for."},Axis:{log_base:"A logarithmic scale of this base, 2 to 1000 (c:logBase), PowerPoint's Logarithmic scale; undefined, a straight one.",display_units:"Its numbers in a unit (c:dispUnits): hundreds, thousands, tenThousands, hundredThousands, millions, tenMillions, hundredMillions, billions, trillions; PowerPoint's Display units, said beside the axis.",crosses:"Where the other axis crosses this one, python-pptx's: autoZero, min, max (written on the other axis, as Excel does); crosses_at, a value of it."},Series:{data_labels:"Its own data labels over the chart's (c:ser/c:dLbls): show_value, show_series_name… as the plot's; set them on a series to label it alone, or has_data_labels on the plot for all.",chart_type:"What the series is drawn as (XL_CHART_TYPE): a combination chart's column, line or area type other than the chart's, as Excel's Series.ChartType and PowerPoint's Change Chart Type ▸ Combo; the chart's own unless set.",on_secondary_axis:"On the chart's second value axis, at the right (Excel's Series.AxisGroup xlSecondary, Combo's Secondary Axis): columns, lines and areas only."},Chart:{secondary_value_axis:"Its second value axis, at the right (a c:valAx at axPos r), for its series on_secondary_axis: an Axis, its scale, gridlines, format and title its own."},Generator:{"*":"What a generator's function is given: data(path), and slides.add_slide(layout, id)."}},xe={Presentation:{slides:"A deck's slides are in the slides file it names, their words in its script; slides from data are a generator's.",save:"A deck is not saved by its code: allyhub export writes its files."}},Le={Presentation:C.prototype,SlideMasters:F.prototype,SlideMaster:D.prototype,SlideLayouts:N.prototype,SlideLayout:k.prototype,Slide:g.prototype,placeholders:T.prototype,SlideShapes:R.prototype,Shape:v.prototype,TextFrame:G.prototype,_Paragraph:L.prototype,_Run:I.prototype,_Hyperlink:S.prototype,Font:y.prototype,ColorFormat:u.prototype,FillFormat:f.prototype,LineFormat:A.prototype,ShadowFormat:E.prototype,_GradientStop:x.prototype,FreeformBuilder:w.prototype,GroupShape:P.prototype,Table:H.prototype,CategoryChartData:W.prototype,XyChartData:j.prototype,XySeriesData:X.prototype,Chart:z.prototype,Plot:q.prototype,Series:$.prototype,Point:Q.prototype,DataLabel:ee.prototype,DataLabels:te.prototype,Legend:V.prototype,Axis:Y.prototype,AxisTitle:U.prototype,TickLabels:K.prototype,MajorGridlines:J.prototype,ChartFormat:Z.prototype,_Cell:m.prototype,_Column:_.prototype,_Row:M.prototype,_Background:c.prototype},Te={Animations:l.prototype,GlowFormat:h.prototype,SoftEdgeFormat:p.prototype,ReflectionFormat:d.prototype,ListLevel:O.prototype,text_styles:B.prototype,Generator:b.prototype},Ce=()=>{const e={};for(const[t,r]of Object.entries(Le)){const i=a[t]??{},n=xe[t]??{};e[t]=o(r).filter(s=>!Object.hasOwn(i,s)&&!Object.hasOwn(n,s))}return e};export const CAPABILITIES={reference:{library:"python-pptx",version:"1.0.2",docs:"https://python-pptx.readthedocs.io/"},holds:Ce(),enums:Object.fromEntries(Object.entries({MSO_THEME_COLOR:we,PP_ALIGN:be,MSO_ANCHOR:ae,MSO_AUTO_SIZE:re,PP_PLACEHOLDER:Pe,MSO_SHAPE:me,MSO_CONNECTOR:ie,MSO_SHAPE_TYPE:ue,MSO_FILL:ne,MSO_LINE:le,MSO_LINE_CAP:he,MSO_LINE_JOIN:pe,MSO_LINE_COMPOUND:de,MSO_PATTERN_TYPE:ce,XL_CHART_TYPE:Ae,XL_LABEL_POSITION:Oe,XL_LEGEND_POSITION:Ee,MSO_ARROWHEAD:se,MSO_ARROWHEAD_SIZE:oe,MSO_UNDERLINE:ge,MSO_TEXT_STRIKE:ye,MSO_TEXT_CAPS:_e,MSO_TEXT_ORIENTATION:fe,THEME_FONT:Se}).map(([e,t])=>[e,Object.keys(t)])),units:["Emu","Inches","Pt","Cm","Mm","Centipoints","RGBColor"],differs:["The entry is export default presentation({ slides: ./deck.yaml, script: ./deck.{locale}.yaml, size, theme }, (prs) => { … }), not Presentation(path): a deck is made by its code, never opened from a template. Its masters and layouts are made with the additions below; its slides are in the slides file it names.","A name python-pptx has that is not held throws where it is used, naming what the class holds; python-pptx's x[i] is held where it indexes (slide_masters[0], slide_layouts[0], placeholders[idx], shapes[0]), and len(x) is x.length.","A Length (what Inches(1) and Pt(12) give, and what a length reads, shape.width) is a Number of EMU with python-pptx's emu, inches, cm, mm, pt, centipoints and twips. Arithmetic on Lengths gives a plain number, as python's int does; two Lengths of one value are ===, and one is compared with a plain number by its .emu.",`An enumeration's members are PresentationML's values (MSO_THEME_COLOR.ACCENT_1 is "accent1", PP_ALIGN.CENTER "ctr"), not integers; TEXT_1 and BACKGROUND_1 are tx1 and bg1, which the master's colour map (SlideMaster.color_map) makes dk1 and lt1 (Office's) or, on a dark master, lt1 and dk1. MSO_SHAPE_TYPE.COMPONENT is a component's. PP_PARAGRAPH_ALIGNMENT and MSO_LINE_DASH_STYLE are PP_ALIGN and MSO_LINE by python-pptx's other names; MSO_LINE also holds DrawingML's DOT, SYSTEM_DASH_DOT and SYSTEM_DASH_DOT_DOT, which python-pptx has no name for. A line's transparency is its colour's alpha (line.color.transforms).`,`A colour's rgb is "#RRGGBB": RGBColor(r, g, b), new RGBColor(r, g, b) and RGBColor.from_string("RRGGBB") make one.`,"A colour's brightness is a theme colour's: python-pptx also gives an RGB colour one, which is refused here (set rgb to the colour it makes).","line_spacing is a number of lines, or a Length of Pt(1) and over for a fixed height (python-pptx tells them apart by type). space_before and space_after are a Length too, or a number of lines at the paragraph's size (a:spcPct, PowerPoint's Before and After in lines), which python-pptx does not read.","add_picture() takes both width and height: a picture's own size is not read while a deck's code runs.","add_connector() takes MSO_CONNECTOR's STRAIGHT, ELBOW and CURVE, and also a connector's preset by name where python-pptx has none (straightConnector1, bentConnector2 to 5, curvedConnector2 to 5); a connector's adjustments (an elbow's middle) are its shape.adjustments.","begin_connect() and end_connect() take a site of the shape's own geometry, as PowerPoint numbers them (a rectangle's 0 top, 1 left, 2 bottom, 3 right; an ellipse has 8), where python-pptx places an end on those four of its box whatever its shape; a site the shape has not throws. A glued end follows its shape where the slides file or a person moves it, as PowerPoint's does.",`add_movie(movie_file, left, top, width, height, { poster_frame_time, playback }) takes a video file, its poster a moment of it in seconds, not poster_frame_image, and how it plays, PowerPoint's Playback, which python-pptx has no API for: { start: "auto" | "on-click", trim: { start, end } in seconds, loop, volume (a share, 0 mutes), fullscreen, hide }.`,"A shape's name is its kind and a number (textbox-1, shape-2), and a placeholder's its type's (title, body, subtitle): the slides file and the script name shapes by name.","fit_text() sets the frame to shrink its text when it is drawn (MSO_AUTO_SIZE.TEXT_TO_FIT_SHAPE) from max_size: it reads no font file.","Font.size refuses a size under Pt(1): a bare number is EMU, so size = 12 (python-pptx takes it) draws nothing.","A chart holds column, bar, line, area, pie, doughnut, XY scatter, radar, bubble and stock types, Office 2016's (waterfall, box and whisker, histogram, Pareto, treemap, sunburst, funnel), and combinations of columns, lines and areas, some on a second value axis (Series.chart_type, on_secondary_axis), which python-pptx reads as several plots and cannot make; it has no 3D and no surface. A combination chart's plots share its gap width, overlap and data labels. Setting an axis's has_title gives it the words Axis Title, PowerPoint's new title's. A chart in the slides file can read its numbers from a project file: data, categories and series name it and its columns.","A Point holds format.fill alone. In a chart that varies by categories (a pie, a doughnut) its fill is its category's colour, one for every series (the slides file's category_colors); in any other its own series' (the series' points), as python-pptx's is.","A table starts with python-pptx's Medium Style 2 - Accent 1, first_row and horz_banding on; its style is drawn under its cells' own fill, borders and text, as PowerPoint draws one. add_table returns its shape, whose .table is the table.","A group is its shapes: they are listed with the shapes the group is among, drawn as they are; a group's shapes.add_group_shape() makes a group in it (its shapes' group outer/inner in the slides file); its box is theirs, so left and top move them and width and height only read.","A presentation is 16:9 (12192000 × 6858000) and its theme Office 2013–2022's over the project's look; python-pptx's template is 4:3 with Office 2007's.","prs.slide_layouts and prs.slide_master are the first master's, as python-pptx's; a generator's add_slide also takes a layout of any master by name."],adds:{...a,...Object.fromEntries(Object.entries(Te).map(([e,t])=>[e,{...a[e]??{},names:o(t).join(", ")}]))}};
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readDataFileAsWritten as A}from"@allyhub/formats";import{isCollection as $,isMap as b,isSeq as j,LineCounter as M,parseDocument as x}from"yaml";import{commonPairs as P,sameValue as O}from"./values.js";export function readSlidesFile(t){const e=new M,s=x(t,{lineCounter:e}),o=c=>{const g=c===""?[]:c.split(".");for(let p=g.length;p>=0;p--){const S=s.getIn(g.slice(0,p).map(y=>/^\d+$/u.test(y)?Number(y):y),!0)?.range?.[0];if(S!==void 0)return e.linePos(S).line}};if(s.errors.length>0)return{problems:s.errors.map(c=>({path:"",line:e.linePos(c.pos[0]).line,message:`not YAML: ${c.message.split(`
3
- `)[0]??""}`})),lineOf:o};const l=s.toJS()??{},r=A("slides",l);if(r.ok)return{file:r.value,readable:{file:r.value,lineOf:o},problems:[],lineOf:o};const n=[],h=(c,g)=>{const p=o(c);n.push({path:c,...p===void 0?{}:{line:p},message:g})},a=(c,g)=>{h(c,w(g,T(l,c)))},i=typeof l=="object"&&l!==null&&"slides"in l?l.slides:void 0,d=Array.isArray(i)?i:[],u=A("slides",{...l,...Array.isArray(i)?{slides:[]}:{}});if(!u.ok)for(const c of u.problems)a(c.path,c.message);const f=[],k=[],m=new Set;return d.forEach((c,g)=>{const p=A("slides",{slides:[c]});if(!p.ok)for(const y of p.problems)a(y.path.replace(/^slides\.0(?=\.|$)/u,`slides.${String(g)}`),y.message);const v=typeof c=="object"&&c!==null&&"id"in c?c.id:void 0;if(typeof v=="string"){if(m.has(v)){h(`slides.${String(g)}.id`,`Two slides are "${v}".`);return}m.add(v)}const[S]=p.ok?p.value.slides:[];S&&(f.push(S),k.push(g))}),{readable:{file:{slides:f},lineOf:c=>o(c.replace(/^slides\.(\d+)/u,(g,p)=>`slides.${String(k[Number(p)]??p)}`))},problems:n,lineOf:o}}function T(t,e){let s=t;for(const o of e===""?[]:e.split(".")){if(typeof s!="object"||s===null)return;s=s[o]}return s}const w=(t,e)=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"?`${t.replace(/\.$/u,"")} (it is ${JSON.stringify(e)}).`:t,E=`slides: []
4
- `;function C(t){let e=t.get("slides",!0);if(j(e)||(b(t.contents)?t.set("slides",t.createNode([])):t.contents=t.createNode({slides:[]}),e=t.get("slides",!0)),!j(e))throw new Error("The slides file has no slides list.");return e}const N=(t,e)=>t.findIndex(s=>b(s)&&s.get("id")===e),_=["frame","text","fill","line","z","crop","connect"];export function editSlidesFile(t,e){const s=x(t===void 0||t.trim()===""?E:t);if(s.errors.length>0)throw new Error("The slides file is not YAML: it is mended by hand first.");return editSlidesDocument(s,e)?s.toString():t??E}export function editSlidesDocument(t,e){const s=C(t),o=a=>{if(a===null)return 0;const i=a===void 0?-1:N(s.items,a);return i<0?s.items.length:i+1};if(e.op==="add")return N(s.items,e.slide.id)>=0||(s.items.splice(o(e.after),0,t.createNode(e.slide)),s.flow===!0&&(s.flow=!1)),!0;const l=N(s.items,e.slide),r=s.items[l];if(l<0||!b(r))return!1;const n=a=>{let i=r.get("shapes",!0);return!b(i)&&a&&(r.set("shapes",t.createNode({})),i=r.get("shapes",!0)),b(i)?i:void 0},h=a=>{const i=n(!1);if(i){for(const d of a){const u=i.get(d,!0);b(u)&&u.items.length===0&&i.delete(d)}i.items.length===0&&r.delete("shapes")}};switch(e.op){case"move":{if(e.after===e.slide)break;s.items.splice(l,1),s.items.splice(o(e.after),0,r);break}case"duplicate":{const a=r.clone();a.set("id",e.id),a.delete("section"),s.items.splice(l+1,0,a);break}case"remove":s.items.splice(l,1);break;case"layout":r.set("layout",e.layout);break;case"hidden":e.hidden===!1||Array.isArray(e.hidden)&&e.hidden.length===0?r.delete("hidden"):r.set("hidden",t.createNode(e.hidden));break;case"shape":{const a=n(!0);if(!a)break;let i=a.get(e.shape,!0);if(b(i)||(a.set(e.shape,t.createNode({})),i=a.get(e.shape,!0)),!b(i))break;for(const[d,u]of Object.entries(e.set)){const f=d.split(".");if(u===void 0){i.deleteIn(f);const k=f.length>1?i.getIn(f.slice(0,-1),!0):void 0;b(k)&&k.items.length===0&&i.deleteIn(f.slice(0,-1))}else{const k=i.getIn(f,!0),m=t.createNode(u);$(k)&&$(m)&&k.flow===!0&&(m.flow=!0),i.setIn(f,m)}}h([e.shape]);break}case"unplace":{n(!1)?.delete(e.shape),h([]);break}case"show":{if(!e.shown){n(!1)?.delete(e.shape),h([]);break}const a=n(!0);a&&!a.has(e.shape)&&a.set(e.shape,t.createNode({}));break}case"background":e.background===void 0?r.delete("background"):r.set("background",t.createNode(e.background));break;case"animations":e.animations.length===0?r.delete("animations"):r.set("animations",t.createNode(e.animations));break;case"transition":e.transition===void 0?r.delete("transition"):r.set("transition",t.createNode(e.transition));break;case"advance":e.after===void 0?r.delete("advance_after"):r.set("advance_after",e.after);break;case"section":e.section===void 0?r.delete("section"):r.set("section",e.section);break;case"reset":{const a=n(!1);if(!a)break;const i=[];for(const d of a.items){const u=String(b(d.key)?"":d.key.value??d.key);if(e.shape!==void 0&&u!==e.shape)continue;const f=d.value;if(!(!b(f)||["textbox","picture","movie","audio","geometry","component"].some(m=>f.has(m))||!_.some(m=>f.has(m)))){for(const m of _)f.delete(m);i.push(u)}}h(i);break}}return!0}export function freeName(t,e){const s=new Set(t),o=e.replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^-+|-+$/gu,"")||"slide";if(!s.has(o))return o;for(let l=2;;l++){const r=`${o}-${String(l)}`;if(!s.has(r))return r}}const D=new Set(["text","props","crop"]);function I(t){const e=new Map;for(const[s,o]of Object.entries(t??{}))if(D.has(s)&&typeof o=="object"&&o!==null&&!Array.isArray(o))for(const[l,r]of Object.entries(o))e.set(`${s}.${l}`,r);else e.set(s,o);return e}const F=(t,e)=>new Set(P(t,e).map(([s])=>t[s]??""));function L(t,e){const s=[],o=e.id;e.layout!==void 0&&e.layout!==t.layout&&s.push({op:"layout",slide:o,layout:e.layout}),O(t.hidden,e.hidden)||s.push({op:"hidden",slide:o,hidden:e.hidden??!1}),O(t.animations??[],e.animations??[])||s.push({op:"animations",slide:o,animations:e.animations??[]}),O(t.transition,e.transition)||s.push({op:"transition",slide:o,...e.transition?{transition:e.transition}:{}}),t.advance_after!==e.advance_after&&s.push({op:"advance",slide:o,...e.advance_after===void 0?{}:{after:e.advance_after}}),t.section!==e.section&&s.push({op:"section",slide:o,...e.section===void 0?{}:{section:e.section}}),O(t.background,e.background)||s.push({op:"background",slide:o,...e.background?{background:e.background}:{}});const l=t.shapes??{},r=e.shapes??{};for(const n of Object.keys(l))n in r||s.push({op:"unplace",slide:o,shape:n});for(const[n,h]of Object.entries(r)){const a=I(l[n]),i=I(h),d={};for(const f of new Set([...a.keys(),...i.keys()]))O(a.get(f),i.get(f))||(d[f]=i.get(f));Object.keys(d).length>0&&s.push({op:"shape",slide:o,shape:n,set:d});const u=l[n];Object.keys(h).length===0&&(u===void 0||Object.keys(u).length>0)&&s.push({op:"show",slide:o,shape:n,shown:!0})}return s}export function slidesEdits(t,e){const s=[],o=new Map(t.slides.map(n=>[n.id,n])),l=new Set(e.slides.map(n=>n.id));for(const n of t.slides)l.has(n.id)||s.push({op:"remove",slide:n.id});const r=F(t.slides.map(n=>n.id).filter(n=>l.has(n)),e.slides.map(n=>n.id).filter(n=>o.has(n)));return e.slides.forEach((n,h)=>{const a=h===0?null:e.slides[h-1]?.id??null,i=o.get(n.id);if(!i||i.generate!==n.generate){i&&s.push({op:"remove",slide:n.id}),s.push({op:"add",slide:n,after:a});return}r.has(n.id)||s.push({op:"move",slide:n.id,after:a}),s.push(...L(i,n))}),s}
2
+ import{readDataFileAsWritten as N}from"@allyhub/formats";import{isCollection as x,isMap as b,isSeq as E,LineCounter as P,parseDocument as _}from"yaml";import{commonPairs as T,sameValue as S}from"./values.js";export function readSlidesFile(t){const e=new P,s=_(t,{lineCounter:e}),i=c=>{const m=c===""?[]:c.split(".");for(let u=m.length;u>=0;u--){const k=s.getIn(m.slice(0,u).map(O=>/^\d+$/u.test(O)?Number(O):O),!0)?.range?.[0];if(k!==void 0)return e.linePos(k).line}};if(s.errors.length>0)return{problems:s.errors.map(c=>({path:"",line:e.linePos(c.pos[0]).line,message:`not YAML: ${c.message.split(`
3
+ `)[0]??""}`})),lineOf:i};const l=s.toJS()??{},r=N("slides",l),n=(c,m=u=>u)=>(c.leftOut??[]).map(u=>{const v=m(u.path),k=i(v);return{path:v,...k===void 0?{}:{line:k},message:u.message,level:"warn"}});if(r.ok)return{file:r.value,readable:{file:r.value,lineOf:i},problems:n(r),lineOf:i};const p=[],a=(c,m)=>{const u=i(c);p.push({path:c,...u===void 0?{}:{line:u},message:m})},o=(c,m)=>{a(c,D(m,C(l,c)))},d=typeof l=="object"&&l!==null&&"slides"in l?l.slides:void 0,h=Array.isArray(d)?d:[],f=N("slides",{...l,...Array.isArray(d)?{slides:[]}:{}});if(!f.ok)for(const c of f.problems)o(c.path,c.message);p.push(...n(f));const y=[],g=[],j=new Set;return h.forEach((c,m)=>{const u=N("slides",{slides:[c]}),v=A=>A.replace(/^slides\.0(?=\.|$)/u,`slides.${String(m)}`);if(!u.ok)for(const A of u.problems)o(v(A.path),A.message);p.push(...n(u,v));const k=typeof c=="object"&&c!==null&&"id"in c?c.id:void 0;if(typeof k=="string"){if(j.has(k)){a(`slides.${String(m)}.id`,`Two slides are "${k}".`);return}j.add(k)}const[O]=u.ok?u.value.slides:[];O&&(y.push(O),g.push(m))}),{readable:{file:{slides:y},lineOf:c=>i(c.replace(/^slides\.(\d+)/u,(m,u)=>`slides.${String(g[Number(u)]??u)}`))},problems:p,lineOf:i}}function C(t,e){let s=t;for(const i of e===""?[]:e.split(".")){if(typeof s!="object"||s===null)return;s=s[i]}return s}const D=(t,e)=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"?`${t.replace(/\.$/u,"")} (it is ${JSON.stringify(e)}).`:t,I=`slides: []
4
+ `;function F(t){let e=t.get("slides",!0);if(E(e)||(b(t.contents)?t.set("slides",t.createNode([])):t.contents=t.createNode({slides:[]}),e=t.get("slides",!0)),!E(e))throw new Error("The slides file has no slides list.");return e}const $=(t,e)=>t.findIndex(s=>b(s)&&s.get("id")===e),M=["frame","text","fill","line","z","crop","connect"];export function editSlidesFile(t,e){const s=_(t===void 0||t.trim()===""?I:t);if(s.errors.length>0)throw new Error("The slides file is not YAML: it is mended by hand first.");return editSlidesDocument(s,e)?s.toString():t??I}export function editSlidesDocument(t,e){const s=F(t),i=a=>{if(a===null)return 0;const o=a===void 0?-1:$(s.items,a);return o<0?s.items.length:o+1};if(e.op==="add")return $(s.items,e.slide.id)>=0||(s.items.splice(i(e.after),0,t.createNode(e.slide)),s.flow===!0&&(s.flow=!1)),!0;const l=$(s.items,e.slide),r=s.items[l];if(l<0||!b(r))return!1;const n=a=>{let o=r.get("shapes",!0);return!b(o)&&a&&(r.set("shapes",t.createNode({})),o=r.get("shapes",!0)),b(o)?o:void 0},p=a=>{const o=n(!1);if(o){for(const d of a){const h=o.get(d,!0);b(h)&&h.items.length===0&&o.delete(d)}o.items.length===0&&r.delete("shapes")}};switch(e.op){case"move":{if(e.after===e.slide)break;s.items.splice(l,1),s.items.splice(i(e.after),0,r);break}case"duplicate":{const a=r.clone();a.set("id",e.id),a.delete("section"),s.items.splice(l+1,0,a);break}case"remove":s.items.splice(l,1);break;case"layout":r.set("layout",e.layout);break;case"hidden":e.hidden===!1||Array.isArray(e.hidden)&&e.hidden.length===0?r.delete("hidden"):r.set("hidden",t.createNode(e.hidden));break;case"shape":{const a=n(!0);if(!a)break;let o=a.get(e.shape,!0);if(b(o)||(a.set(e.shape,t.createNode({})),o=a.get(e.shape,!0)),!b(o))break;for(const[d,h]of Object.entries(e.set)){const f=d.split(".");if(h===void 0){o.deleteIn(f);const y=f.length>1?o.getIn(f.slice(0,-1),!0):void 0;b(y)&&y.items.length===0&&o.deleteIn(f.slice(0,-1))}else{const y=o.getIn(f,!0),g=t.createNode(h);x(y)&&x(g)&&y.flow===!0&&(g.flow=!0),o.setIn(f,g)}}p([e.shape]);break}case"unplace":{n(!1)?.delete(e.shape),p([]);break}case"show":{if(!e.shown){n(!1)?.delete(e.shape),p([]);break}const a=n(!0);a&&!a.has(e.shape)&&a.set(e.shape,t.createNode({}));break}case"background":e.background===void 0?r.delete("background"):r.set("background",t.createNode(e.background));break;case"animations":e.animations.length===0?r.delete("animations"):r.set("animations",t.createNode(e.animations));break;case"transition":e.transition===void 0?r.delete("transition"):r.set("transition",t.createNode(e.transition));break;case"advance":e.after===void 0?r.delete("advance_after"):r.set("advance_after",e.after);break;case"section":e.section===void 0?r.delete("section"):r.set("section",e.section);break;case"reset":{const a=n(!1);if(!a)break;const o=[];for(const d of a.items){const h=String(b(d.key)?"":d.key.value??d.key);if(e.shape!==void 0&&h!==e.shape)continue;const f=d.value;if(!(!b(f)||["textbox","picture","movie","audio","geometry","component"].some(g=>f.has(g))||!M.some(g=>f.has(g)))){for(const g of M)f.delete(g);o.push(h)}}p(o);break}}return!0}export function freeName(t,e){const s=new Set(t),i=e.replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^-+|-+$/gu,"")||"slide";if(!s.has(i))return i;for(let l=2;;l++){const r=`${i}-${String(l)}`;if(!s.has(r))return r}}const L=new Set(["text","props","crop"]);function w(t){const e=new Map;for(const[s,i]of Object.entries(t??{}))if(L.has(s)&&typeof i=="object"&&i!==null&&!Array.isArray(i))for(const[l,r]of Object.entries(i))e.set(`${s}.${l}`,r);else e.set(s,i);return e}const Y=(t,e)=>new Set(T(t,e).map(([s])=>t[s]??""));function z(t,e){const s=[],i=e.id;e.layout!==void 0&&e.layout!==t.layout&&s.push({op:"layout",slide:i,layout:e.layout}),S(t.hidden,e.hidden)||s.push({op:"hidden",slide:i,hidden:e.hidden??!1}),S(t.animations??[],e.animations??[])||s.push({op:"animations",slide:i,animations:e.animations??[]}),S(t.transition,e.transition)||s.push({op:"transition",slide:i,...e.transition?{transition:e.transition}:{}}),t.advance_after!==e.advance_after&&s.push({op:"advance",slide:i,...e.advance_after===void 0?{}:{after:e.advance_after}}),t.section!==e.section&&s.push({op:"section",slide:i,...e.section===void 0?{}:{section:e.section}}),S(t.background,e.background)||s.push({op:"background",slide:i,...e.background?{background:e.background}:{}});const l=t.shapes??{},r=e.shapes??{};for(const n of Object.keys(l))n in r||s.push({op:"unplace",slide:i,shape:n});for(const[n,p]of Object.entries(r)){const a=w(l[n]),o=w(p),d={};for(const f of new Set([...a.keys(),...o.keys()]))S(a.get(f),o.get(f))||(d[f]=o.get(f));Object.keys(d).length>0&&s.push({op:"shape",slide:i,shape:n,set:d});const h=l[n];Object.keys(p).length===0&&(h===void 0||Object.keys(h).length>0)&&s.push({op:"show",slide:i,shape:n,shown:!0})}return s}export function slidesEdits(t,e){const s=[],i=new Map(t.slides.map(n=>[n.id,n])),l=new Set(e.slides.map(n=>n.id));for(const n of t.slides)l.has(n.id)||s.push({op:"remove",slide:n.id});const r=Y(t.slides.map(n=>n.id).filter(n=>l.has(n)),e.slides.map(n=>n.id).filter(n=>i.has(n)));return e.slides.forEach((n,p)=>{const a=p===0?null:e.slides[p-1]?.id??null,o=i.get(n.id);if(!o||o.generate!==n.generate){o&&s.push({op:"remove",slide:n.id}),s.push({op:"add",slide:n,after:a});return}r.has(n.id)||s.push({op:"move",slide:n.id,after:a}),s.push(...z(o,n))}),s}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-core",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as I}from"node:fs/promises";import{join as N,posix as f}from"node:path";import{problem as y}from"@allyhub/diagnostics";import{besideModule as K,deckReferences as U,loadFailure as D,mergeScript as B,messagePrefix as H,nodeStackPlace as M,parseComponentRef as L,pieceLocales as W,readScripts as G,referenceModule as J,resolveDims as Q,resolveMatrix as V,stageName as X}from"@allyhub/build";import{USE_FORMS as j,shownOf as Y}from"@allyhub/formats";import{checkDeck as Z,readSlidesFile as ee}from"@allyhub/slides-core";import{deckOf as te}from"./deck-info.js";export const DECK_DPI=144;const A=914400;export const deckFormat=([t,s])=>`${String(Math.round(t/A*DECK_DPI))}x${String(Math.round(s/A*DECK_DPI))}`;export async function readDeck(t,s){const r=[],i=t.id,u=s.claim(i,t.entry);if(u!==void 0)return r.push(y("AK-B001",`${t.entry} and ${u} both have the piece id ${i}.`,{where:{file:t.entry}})),{problems:r};const d=await s.meta.request({type:"run",module:K(import.meta.url,"evaluate"),file:t.entry,input:{files:!0}});if(r.push(...d.problems),!d.ok)return d.error!=="timeout"&&r.push(D(t.entry,d.error??"",M(d.stack,s.root))),{problems:r};const{slides:n,script:k}=d.value;if(n===void 0||k===void 0)return r.push(y("AK-M011",`The deck ${i} names no ${n===void 0?"slides":"script"}: presentation({ slides: "./${f.basename(i)}.yaml", script: "./${f.basename(i)}.{locale}.yaml" }, …) names its slides' file and its script, a file per language, from its module's folder.`,{piece:i,where:{file:t.entry}})),{problems:r};const w=[{path:n,role:"slides"},{path:k,role:"script"}],v=await G(s.root,s.files,k,i);r.push(...v.problems),r.push(...B(s.messages,i,v.scripts));const O=W(s.messages,v.scripts),$=e=>({file:n,...e===void 0?{}:{line:e}});let p,b=()=>{},c;try{c=await I(N(s.root,n),"utf8")}catch{r.push(y("AK-M011",`The deck ${i} names ${n} for its slides, which is not there: write it, its slides listed each on one of ${f.basename(t.entry)}'s layouts (slides: [{ id: cover, layout: Title Slide }]).`,{piece:i,where:{file:n}}))}const m=c===void 0?void 0:ee(c);if(m){b=m.readable?.lineOf??m.lineOf;for(const e of m.problems)r.push(y("AK-M011",`${n}: ${e.message}`,{piece:i,where:$(e.line)}));p=m.readable?.file}const T=r.length,_={slides:p,words:Object.fromEntries(O.map(e=>[e,s.messages.messages[e]??{}])),prefix:H(i),tables:Object.fromEntries(Object.entries(s.lent).map(([e,o])=>[e,o.value])),shown:Object.fromEntries(Object.entries(s.lent).flatMap(([e,o])=>o.shown===void 0?[]:[[e,o.shown]]))},h=await s.meta.request({type:"run",module:K(import.meta.url,"evaluate"),file:t.entry,input:_});if(r.push(...h.problems),!h.ok)return h.error!=="timeout"&&r.push(D(t.entry,h.error??"",M(h.stack,s.root))),{problems:r,files:w};const a=h.value,P=e=>{const o=M(e.stack,s.root);return o?{file:o.file,line:o.line}:$(e.path===void 0?void 0:b(e.path))};for(const e of[...a.problems,...Z(a.resolved,{mediaKind:o=>s.media[o]?.kind})])r.push(y("AK-M011",e.stack===void 0?`${n}: ${e.message}`:e.message,{piece:i,...e.slide===void 0?{}:{part:e.slide},where:P(e)}));if(a.resolved.slides.length===0)return r.length===T&&m?.file&&r.push(y("AK-K003",m.file.slides.length===0?`The deck has no slides: ${n} lists none (slides: [{ id: cover, layout: Title Slide }]).`:`The deck has no slides: ${n} lists only generators, and they made none.`,{piece:i,where:$(b("slides"))})),{problems:r,files:w};const x=Q(void 0,{locales:O}),R=await V({root:s.root,piece:i,file:t.entry,dims:x,matrix:void 0,files:[]}),S=deckFormat(a.size),F={id:i,idFrom:"path",kind:t.kind,dir:t.dir,file:t.entry,place:i,...a.title===void 0?{}:{title:a.title},format:S,formatEntry:S,dims:x,combos:R.combos,options:{},meta:{},script:k,info:{slides:n,...p?{file:p}:{},size:a.size,layouts:a.layouts,components:a.components,generators:a.generators,code:a.code,data:a.data},loads:{kindData:{slides:p??{slides:[]},slidesFile:n,code:a.code}},counts:{value:p??null}},z=f.dirname(n)===f.dirname(t.entry),C=e=>{const o=/[\w#./-]/u;for(let l=z?c?.indexOf(e)??-1:-1;c!==void 0&&l>=0;){const g=c[l-1]??" ",q=c[l+e.length]??" ";if(!o.test(g)&&!o.test(q))return{from:n,line:c.slice(0,l).split(`
3
- `).length};l=c.indexOf(e,l+1)}return{}},E=[...Object.keys(a.data).filter(e=>e.includes("#")&&Y(e)===void 0).map(e=>({of:e,...C(e),types:[j.data],role:"data"})),...a.resolved.slides.flatMap(e=>e.shapes.flatMap(o=>{if(o.kind!=="item"||!o.item)return[];const l=f.relative(f.dirname(n),o.item.path),g=b(o.sources.media?.path??"");return[{of:l.startsWith(".")?l:`./${l}`,from:n,...g===void 0?{}:{line:g},types:[j.live,"wav"],madeFor:["pptx"],role:"item"}]}))];return{problems:r,files:w,...E.length>0?{uses:E}:{},piece:F,stage:se(F,n)}}function se(t,s){const r=f.dirname(t.file),i=U(te(t)?.file).flatMap(u=>{const d=J(r,u),n=L(u);return d!==void 0&&n?[{of:u,module:d,name:n.name}]:[]});return{name:X(t.id),module:t.file,of:s,components:i}}const re={read:readDeck,onStage:!0,checks:[import.meta.resolve("@allyhub/slides-core"),import.meta.resolve("@allyhub/video-measure"),import.meta.resolve("@allyhub/video-core")],still:async(t,s,r)=>new(await import("@allyhub/video-measure")).OpenedFilm(t).still(s,r.format===void 0?{}:{format:r.format}),checkPiece:async t=>(await import("./check.js")).checkDeck(t),ready:async(t,s)=>(await import("./export.js")).deckReady(t,s),render:async(t,s)=>(await import("./export.js")).renderDeck(s)};export default re;
2
+ import{readFile as I}from"node:fs/promises";import{join as N,posix as f}from"node:path";import{problem as y}from"@allyhub/diagnostics";import{besideModule as K,deckReferences as U,loadFailure as D,mergeScript as B,messagePrefix as H,nodeStackPlace as M,parseComponentRef as L,pieceLocales as W,readScripts as G,referenceModule as J,resolveDims as Q,resolveMatrix as V,stageName as X}from"@allyhub/build";import{USE_FORMS as j,shownOf as Y}from"@allyhub/formats";import{checkDeck as Z,readSlidesFile as ee}from"@allyhub/slides-core";import{deckOf as te}from"./deck-info.js";export const DECK_DPI=144;const A=914400;export const deckFormat=([t,s])=>`${String(Math.round(t/A*DECK_DPI))}x${String(Math.round(s/A*DECK_DPI))}`;export async function readDeck(t,s){const n=[],i=t.id,u=s.claim(i,t.entry);if(u!==void 0)return n.push(y("AK-B001",`${t.entry} and ${u} both have the piece id ${i}.`,{where:{file:t.entry}})),{problems:n};const d=await s.meta.request({type:"run",module:K(import.meta.url,"evaluate"),file:t.entry,input:{files:!0}});if(n.push(...d.problems),!d.ok)return d.error!=="timeout"&&n.push(D(t.entry,d.error??"",M(d.stack,s.root))),{problems:n};const{slides:r,script:k}=d.value;if(r===void 0||k===void 0)return n.push(y("AK-M011",`The deck ${i} names no ${r===void 0?"slides":"script"}: presentation({ slides: "./${f.basename(i)}.yaml", script: "./${f.basename(i)}.{locale}.yaml" }, …) names its slides' file and its script, a file per language, from its module's folder.`,{piece:i,where:{file:t.entry}})),{problems:n};const w=[{path:r,role:"slides"},{path:k,role:"script"}],v=await G(s.root,s.files,k,i);n.push(...v.problems),n.push(...B(s.messages,i,v.scripts));const O=W(s.messages,v.scripts),$=e=>({file:r,...e===void 0?{}:{line:e}});let p,b=()=>{},c;try{c=await I(N(s.root,r),"utf8")}catch{n.push(y("AK-M011",`The deck ${i} names ${r} for its slides, which is not there: write it, its slides listed each on one of ${f.basename(t.entry)}'s layouts (slides: [{ id: cover, layout: Title Slide }]).`,{piece:i,where:{file:r}}))}const m=c===void 0?void 0:ee(c);if(m){b=m.readable?.lineOf??m.lineOf;for(const e of m.problems)n.push(y("AK-M011",`${r}: ${e.message}`,{piece:i,where:$(e.line),...e.level===void 0?{}:{level:e.level}}));p=m.readable?.file}const T=n.length,_={slides:p,words:Object.fromEntries(O.map(e=>[e,s.messages.messages[e]??{}])),prefix:H(i),tables:Object.fromEntries(Object.entries(s.lent).map(([e,o])=>[e,o.value])),shown:Object.fromEntries(Object.entries(s.lent).flatMap(([e,o])=>o.shown===void 0?[]:[[e,o.shown]]))},h=await s.meta.request({type:"run",module:K(import.meta.url,"evaluate"),file:t.entry,input:_});if(n.push(...h.problems),!h.ok)return h.error!=="timeout"&&n.push(D(t.entry,h.error??"",M(h.stack,s.root))),{problems:n,files:w};const a=h.value,P=e=>{const o=M(e.stack,s.root);return o?{file:o.file,line:o.line}:$(e.path===void 0?void 0:b(e.path))};for(const e of[...a.problems,...Z(a.resolved,{mediaKind:o=>s.media[o]?.kind})])n.push(y("AK-M011",e.stack===void 0?`${r}: ${e.message}`:e.message,{piece:i,...e.slide===void 0?{}:{part:e.slide},where:P(e)}));if(a.resolved.slides.length===0)return n.length===T&&m?.file&&n.push(y("AK-K003",m.file.slides.length===0?`The deck has no slides: ${r} lists none (slides: [{ id: cover, layout: Title Slide }]).`:`The deck has no slides: ${r} lists only generators, and they made none.`,{piece:i,where:$(b("slides"))})),{problems:n,files:w};const x=Q(void 0,{locales:O}),R=await V({root:s.root,piece:i,file:t.entry,dims:x,matrix:void 0,files:[]}),S=deckFormat(a.size),F={id:i,idFrom:"path",kind:t.kind,dir:t.dir,file:t.entry,place:i,...a.title===void 0?{}:{title:a.title},format:S,formatEntry:S,dims:x,combos:R.combos,options:{},meta:{},script:k,info:{slides:r,...p?{file:p}:{},size:a.size,layouts:a.layouts,components:a.components,generators:a.generators,code:a.code,data:a.data},loads:{kindData:{slides:p??{slides:[]},slidesFile:r,code:a.code}},counts:{value:p??null}},z=f.dirname(r)===f.dirname(t.entry),C=e=>{const o=/[\w#./-]/u;for(let l=z?c?.indexOf(e)??-1:-1;c!==void 0&&l>=0;){const g=c[l-1]??" ",q=c[l+e.length]??" ";if(!o.test(g)&&!o.test(q))return{from:r,line:c.slice(0,l).split(`
3
+ `).length};l=c.indexOf(e,l+1)}return{}},E=[...Object.keys(a.data).filter(e=>e.includes("#")&&Y(e)===void 0).map(e=>({of:e,...C(e),types:[j.data],role:"data"})),...a.resolved.slides.flatMap(e=>e.shapes.flatMap(o=>{if(o.kind!=="item"||!o.item)return[];const l=f.relative(f.dirname(r),o.item.path),g=b(o.sources.media?.path??"");return[{of:l.startsWith(".")?l:`./${l}`,from:r,...g===void 0?{}:{line:g},types:[j.live,"wav"],madeFor:["pptx"],role:"item"}]}))];return{problems:n,files:w,...E.length>0?{uses:E}:{},piece:F,stage:se(F,r)}}function se(t,s){const n=f.dirname(t.file),i=U(te(t)?.file).flatMap(u=>{const d=J(n,u),r=L(u);return d!==void 0&&r?[{of:u,module:d,name:r.name}]:[]});return{name:X(t.id),module:t.file,of:s,components:i}}const ne={read:readDeck,onStage:!0,checks:[import.meta.resolve("@allyhub/slides-core"),import.meta.resolve("@allyhub/video-measure"),import.meta.resolve("@allyhub/video-core")],still:async(t,s,n)=>new(await import("@allyhub/video-measure")).OpenedFilm(t).still(s,n.format===void 0?{}:{format:n.format}),checkPiece:async t=>(await import("./check.js")).checkDeck(t),ready:async(t,s)=>(await import("./export.js")).deckReady(t,s),render:async(t,s)=>(await import("./export.js")).renderDeck(s)};export default ne;
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{existsSync as v}from"node:fs";import{mkdir as I,readFile as T,stat as O,writeFile as S}from"node:fs/promises";import{basename as y,dirname as z,join as c,posix as b,resolve as P}from"node:path";import{z as s}from"zod";import{ZIP_LIMITS as C,itemIdOf as D}from"@allyhub/formats";import{PROJECT_DIR as E,defineCliCommand as g,listFonts as F,listWork as R,projectRoot as L}from"@allyhub/build";import{CommandError as p,EXIT as f}from"@allyhub/protocol";import{CAPABILITIES as $}from"@allyhub/slides-core";import{groupReport as N}from"@allyhub/ooxml";import{importDeck as q,nameOf as A,readPptx as M}from"@allyhub/slides-pptx";export const slidesCapabilities=g({input:s.strictObject({}),output:s.looseObject({}),examples:["allyhub slides capabilities"],run:()=>Promise.resolve({value:{...$},text:JSON.stringify($,null,2)})});const U=s.string().transform(e=>e.replace(/^\/+/gu,"")).refine(e=>e.endsWith(".ts")&&!e.split("/").some(o=>o===""||o==="."||o===".."),{message:"a .ts file from the project's root, such as reviews/q3.ts"});export const slidesImport=g({input:s.strictObject({file:s.string().describe("The .pptx to make a deck of"),to:U.optional().describe("The deck's module, from the project's root (default <the file's name>.ts); its slides are <name>.yaml beside it, its script <name>.<lang>.yaml, its pictures and videos beside them under names no file there has"),maxUnzipped:s.number().positive().default(C.bytes/1024/1024).describe("The most MB the file may unzip to"),lang:s.string().regex(/^[a-z]{2,3}(-[a-z0-9]+)*$/u).default("en").describe("The language of its words: its script is <name>.<lang>.yaml"),dir:E}),positional:["file"],output:s.looseObject({}),examples:["allyhub slides import ~/Downloads/q3-review.pptx --to reviews/q3.ts","allyhub slides import 培训.pptx --to training/onboarding.ts --lang zh-cn"],run:async(e,o)=>{const n=await L(o.cwd,e.dir),a=P(o.cwd,e.file),x=await T(a).catch(()=>{throw new p("not-found",`There is no file ${a}.`,{exit:f.notFound})}),l=e.to??`${A(y(a).replace(/\.pptx$/iu,""),new Set,"deck")}.ts`,h=b.dirname(l),r=i=>h==="."?i:`${h}/${i}`;let t;try{t=q(M(new Uint8Array(x),{bytes:e.maxUnzipped*1024*1024}),{lang:e.lang,source:y(a),name:b.basename(l,".ts"),taken:i=>v(c(n,r(i)))})}catch(i){throw new p("bad-file",`${a} is not a PowerPoint file this can read: ${i.message}`,{exit:f.usage})}const d=[...t.files.keys()].map(r);for(const i of d)if(await O(c(n,i)).catch(()=>{}))throw new p("place-taken",`${i} is already there.`,{exit:f.conflict,hint:"Name another module with --to."});for(const[i,j]of t.files){const w=c(n,r(i));await I(z(w),{recursive:!0}),await S(w,j,{flag:"wx"})}await R(n,{kind:"slides",file:l},o.kinds(n));const k=t.stylesheet===void 0?void 0:await F(n,r(t.stylesheet)),m=D(l),u=N(t.report);return{value:{id:m,files:d,report:t.report,skipped:Object.fromEntries(t.reasons)},text:[`Made ${d.join(", ")}; listed in allyhub.yaml as ${m}.`,...t.stylesheet===void 0?[]:[k===!0?`The fonts the file carried are in ${r(t.stylesheet)}, listed in allyhub.config.ts's fonts.`:`The fonts the file carried are in ${r(t.stylesheet)}: add "./${r(t.stylesheet)}" to allyhub.config's fonts to draw and export them.`],...u.length>0?[`Not carried over as it is (${String(t.report.length)}, grouped; all with --json):`,...u.map(_)]:[],`allyhub check, then allyhub frames ${m}, to see it.`].join(`
2
+ import{existsSync as v}from"node:fs";import{mkdir as I,readFile as T,stat as O,writeFile as S}from"node:fs/promises";import{basename as y,dirname as z,join as m,posix as b,resolve as P}from"node:path";import{z as s}from"zod";import{ZIP_LIMITS as C,itemIdOf as D}from"@allyhub/formats";import{PROJECT_DIR as E,defineCliCommand as g,listFonts as F,listWork as R,projectRoot as L}from"@allyhub/build";import{CommandError as c,EXIT as p}from"@allyhub/protocol";import{CAPABILITIES as $}from"@allyhub/slides-core";import{groupReport as N}from"@allyhub/ooxml";import{importDeck as q,nameOf as A,readPptx as M}from"@allyhub/slides-pptx";export const slidesCapabilities=g({input:s.strictObject({}),output:s.looseObject({}),examples:["allyhub slides capabilities"],run:()=>Promise.resolve({value:{...$},text:JSON.stringify($,null,2)})});const U=s.string().transform(e=>e.replace(/^\/+/gu,"")).refine(e=>e.endsWith(".ts")&&!e.split("/").some(o=>o===""||o==="."||o===".."),{message:"a .ts file from the project's root, such as reviews/q3.ts"});export const slidesImport=g({input:s.strictObject({file:s.string().describe("The .pptx to make a deck of"),to:U.optional().describe("The deck's module, from the project's root (default <the file's name>.ts); its slides are <name>.yaml beside it, its script <name>.<lang>.yaml, its pictures and videos beside them under names no file there has"),maxUnzipped:s.number().positive().default(C.bytes/1024/1024).describe("The most MB the file may unzip to"),lang:s.string().regex(/^[a-z]{2,3}(-[a-z0-9]+)*$/u).default("en").describe("The language of its words: its script is <name>.<lang>.yaml"),dir:E}),positional:["file"],output:s.looseObject({}),examples:["allyhub slides import ~/Downloads/q3-review.pptx --to reviews/q3.ts","allyhub slides import 培训.pptx --to training/onboarding.ts --lang zh-cn"],run:async(e,o)=>{const n=await L(o.cwd,e.dir),a=P(o.cwd,e.file),x=await T(a).catch(()=>{throw new c("not-found",`There is no file ${a}.`,{exit:p.notFound})}),l=e.to??`${A(y(a).replace(/\.pptx$/iu,""),new Set,"deck")}.ts`,f=b.dirname(l),r=i=>f==="."?i:`${f}/${i}`;let t;try{t=q(M(new Uint8Array(x),{bytes:e.maxUnzipped*1024*1024}),{lang:e.lang,source:y(a),name:b.basename(l,".ts"),taken:i=>v(m(n,r(i)))})}catch(i){throw new c("bad-file",`${a} is not a PowerPoint file this can read: ${i.message}`,{exit:p.usage})}const d=[...t.files.keys()].map(r);for(const i of d)if(await O(m(n,i)).catch(()=>{}))throw new c("place-taken",`${i} is already there.`,{exit:p.conflict,hint:"Name another module with --to."});for(const[i,k]of t.files){const w=m(n,r(i));await I(z(w),{recursive:!0}),await S(w,k,{flag:"wx"})}await R(n,{kind:"slides",file:l},o.kinds(n));const j=t.stylesheet===void 0?void 0:await F(n,r(t.stylesheet)),h=D(l),u=N(t.report);return{value:{id:h,files:d,report:t.report,skipped:Object.fromEntries(t.reasons)},text:[`Made ${d.join(", ")}; listed in allyhub.yaml as ${h}.`,...t.stylesheet===void 0?[]:[j===!0?`The fonts the file carried are in ${r(t.stylesheet)}, listed in allyhub.config.ts's fonts.`:`The fonts the file carried are in ${r(t.stylesheet)}: add "./${r(t.stylesheet)}" to allyhub.config's fonts to draw and export them.`],...u.length>0?[`Not carried over as it is (${String(t.report.length)}, grouped; all with --json):`,...u.map(_)]:[]].join(`
3
3
  `)}}});const W={unread:"not read",extension:"an extension not read",part:"a part not read","cannot-hold":"cannot hold",approximated:"approximated",missing:"missing"};function _(e){const o=e.where.length>3?`${e.where.slice(0,3).join("; ")} and ${String(e.where.length-3)} more`:e.where.join("; ");return` ${W[e.kind]}: ${e.what}${e.detail===void 0?"":` (${e.detail})`}${e.count>1?` ×${String(e.count)}`:""} at ${o}`}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-extension",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./tools": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-pptx",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-runtime",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/stage",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/stage-page",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {