@arbidocs/blocks 0.5.120 → 0.5.122

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 (417) hide show
  1. package/dist/ClippingMediaViewer-IEIBT74X.cjs +156 -0
  2. package/dist/ClippingMediaViewer-IEIBT74X.cjs.map +1 -0
  3. package/dist/ClippingPdfViewer-OGYLMVCE.cjs +79 -0
  4. package/dist/ClippingPdfViewer-OGYLMVCE.cjs.map +1 -0
  5. package/dist/{ConnectedCallDock-WER7R222.cjs → ConnectedCallDock-XJOYVVAH.cjs} +9 -7
  6. package/dist/ConnectedCallDock-XJOYVVAH.cjs.map +1 -0
  7. package/dist/{ConnectedCallRoom-T7OBQTYP.cjs → ConnectedCallRoom-CUDYAPQK.cjs} +9 -7
  8. package/dist/{ConnectedCallRoom-T7OBQTYP.cjs.map → ConnectedCallRoom-CUDYAPQK.cjs.map} +1 -1
  9. package/dist/{ConnectedNativeDocxComparison-SGE4R3M4.cjs → ConnectedNativeDocxComparison-QKHCYD6W.cjs} +7 -7
  10. package/dist/{ConnectedNativeDocxComparison-SGE4R3M4.cjs.map → ConnectedNativeDocxComparison-QKHCYD6W.cjs.map} +1 -1
  11. package/dist/ConnectedPresentation-AU25OW25.cjs +321 -0
  12. package/dist/ConnectedPresentation-AU25OW25.cjs.map +1 -0
  13. package/dist/ConnectedSlidesTab-I75LKKN7.cjs +236 -0
  14. package/dist/ConnectedSlidesTab-I75LKKN7.cjs.map +1 -0
  15. package/dist/{ConnectedStreamedWordArtifact-6MCLJRIT.cjs → ConnectedStreamedWordArtifact-AG62232A.cjs} +7 -7
  16. package/dist/{ConnectedStreamedWordArtifact-6MCLJRIT.cjs.map → ConnectedStreamedWordArtifact-AG62232A.cjs.map} +1 -1
  17. package/dist/{DocumentReviewCard-BPIAJJED.cjs → DocumentReviewCard-M53XFLI2.cjs} +15 -14
  18. package/dist/DocumentReviewCard-M53XFLI2.cjs.map +1 -0
  19. package/dist/{FilesViewerDialog-67WK3TZC.cjs → FilesViewerDialog-4352KIOG.cjs} +30 -22
  20. package/dist/FilesViewerDialog-4352KIOG.cjs.map +1 -0
  21. package/dist/{GridViewImpl-ZMJJWTOM.cjs → GridViewImpl-LTYET77Q.cjs} +3 -3
  22. package/dist/GridViewImpl-LTYET77Q.cjs.map +1 -0
  23. package/dist/{WorkspaceTableView-J3C6VH4T.cjs → WorkspaceTableView-3XYAV4BV.cjs} +9 -8
  24. package/dist/WorkspaceTableView-3XYAV4BV.cjs.map +1 -0
  25. package/dist/agents/index.cjs +186 -186
  26. package/dist/{ai-IM4A23YT.cjs → ai-IEIR7SC2.cjs} +17 -15
  27. package/dist/ai-IEIR7SC2.cjs.map +1 -0
  28. package/dist/calls/connected/CallControls.d.ts +2 -0
  29. package/dist/calls/connected/CallControls.js +71 -9
  30. package/dist/calls/connected/CallControls.js.map +2 -2
  31. package/dist/calls/connected/ShareDocumentDialog.d.ts +14 -0
  32. package/dist/calls/connected/ShareDocumentDialog.js +77 -0
  33. package/dist/calls/connected/ShareDocumentDialog.js.map +7 -0
  34. package/dist/calls/index.cjs +2 -2
  35. package/dist/chat/index.cjs +8 -7
  36. package/dist/{chunk-557MJ4IH.cjs → chunk-2F57IO7S.cjs} +9 -146
  37. package/dist/chunk-2F57IO7S.cjs.map +1 -0
  38. package/dist/chunk-2RLA6QO2.cjs +174 -0
  39. package/dist/chunk-2RLA6QO2.cjs.map +1 -0
  40. package/dist/chunk-4TTX6ZNS.cjs +1374 -0
  41. package/dist/chunk-4TTX6ZNS.cjs.map +1 -0
  42. package/dist/chunk-5GCCUXMT.cjs +63 -0
  43. package/dist/chunk-5GCCUXMT.cjs.map +1 -0
  44. package/dist/{chunk-BUVIBHFU.cjs → chunk-5QERK4PK.cjs} +38 -38
  45. package/dist/chunk-5QERK4PK.cjs.map +1 -0
  46. package/dist/chunk-6OK7ESTL.cjs +134 -0
  47. package/dist/chunk-6OK7ESTL.cjs.map +1 -0
  48. package/dist/{chunk-ECLUFKYR.cjs → chunk-7557LDAN.cjs} +4 -4
  49. package/dist/{chunk-ECLUFKYR.cjs.map → chunk-7557LDAN.cjs.map} +1 -1
  50. package/dist/{chunk-KTQOGT2L.cjs → chunk-7L4X6QN2.cjs} +7 -7
  51. package/dist/{chunk-KTQOGT2L.cjs.map → chunk-7L4X6QN2.cjs.map} +1 -1
  52. package/dist/{chunk-BP3IJ34D.cjs → chunk-7NLO7ASW.cjs} +4 -4
  53. package/dist/{chunk-BP3IJ34D.cjs.map → chunk-7NLO7ASW.cjs.map} +1 -1
  54. package/dist/{chunk-3GWWOYGS.cjs → chunk-7PN3YENO.cjs} +4 -4
  55. package/dist/{chunk-3GWWOYGS.cjs.map → chunk-7PN3YENO.cjs.map} +1 -1
  56. package/dist/{chunk-DFBDQKGE.cjs → chunk-ADDQKZ5I.cjs} +4 -4
  57. package/dist/{chunk-DFBDQKGE.cjs.map → chunk-ADDQKZ5I.cjs.map} +1 -1
  58. package/dist/chunk-AFQTQC7A.cjs +35 -0
  59. package/dist/chunk-AFQTQC7A.cjs.map +1 -0
  60. package/dist/{chunk-NLSWDP42.cjs → chunk-ALK3PUUB.cjs} +21 -11
  61. package/dist/chunk-ALK3PUUB.cjs.map +1 -0
  62. package/dist/{chunk-775S43W7.cjs → chunk-CQQQIZU4.cjs} +8 -8
  63. package/dist/{chunk-775S43W7.cjs.map → chunk-CQQQIZU4.cjs.map} +1 -1
  64. package/dist/{chunk-TDO5UWXF.cjs → chunk-E3L5DB5F.cjs} +5 -5
  65. package/dist/{chunk-TDO5UWXF.cjs.map → chunk-E3L5DB5F.cjs.map} +1 -1
  66. package/dist/chunk-GFUOCGY6.cjs +32 -0
  67. package/dist/chunk-GFUOCGY6.cjs.map +1 -0
  68. package/dist/chunk-HYUKPHCT.cjs +66 -0
  69. package/dist/chunk-HYUKPHCT.cjs.map +1 -0
  70. package/dist/{chunk-QQWHG3KF.cjs → chunk-JJZOL5MG.cjs} +4 -4
  71. package/dist/{chunk-QQWHG3KF.cjs.map → chunk-JJZOL5MG.cjs.map} +1 -1
  72. package/dist/chunk-K4763GD5.cjs +301 -0
  73. package/dist/chunk-K4763GD5.cjs.map +1 -0
  74. package/dist/{chunk-B3LZITVF.cjs → chunk-KA3F6TIH.cjs} +2 -442
  75. package/dist/chunk-KA3F6TIH.cjs.map +1 -0
  76. package/dist/{chunk-PGJYD67F.cjs → chunk-KNGZZC4O.cjs} +7 -6
  77. package/dist/chunk-KNGZZC4O.cjs.map +1 -0
  78. package/dist/{chunk-YYPZOEED.cjs → chunk-LHWOKOMP.cjs} +23 -2
  79. package/dist/chunk-LHWOKOMP.cjs.map +1 -0
  80. package/dist/{chunk-HA66DHW6.cjs → chunk-MLA2BJ2Y.cjs} +28 -28
  81. package/dist/chunk-MLA2BJ2Y.cjs.map +1 -0
  82. package/dist/{chunk-CPR6EHG7.cjs → chunk-NG2EE7HR.cjs} +134 -10
  83. package/dist/chunk-NG2EE7HR.cjs.map +1 -0
  84. package/dist/{chunk-CKCG4NDB.cjs → chunk-OHHKBURG.cjs} +29 -29
  85. package/dist/chunk-OHHKBURG.cjs.map +1 -0
  86. package/dist/{chunk-4XJEHKVZ.cjs → chunk-PIYYBPHH.cjs} +4 -4
  87. package/dist/{chunk-4XJEHKVZ.cjs.map → chunk-PIYYBPHH.cjs.map} +1 -1
  88. package/dist/{chunk-YYSBWMDJ.cjs → chunk-QG2U2JGX.cjs} +4 -4
  89. package/dist/{chunk-YYSBWMDJ.cjs.map → chunk-QG2U2JGX.cjs.map} +1 -1
  90. package/dist/{chunk-5IZFSAEZ.cjs → chunk-SDRYSLOX.cjs} +4 -4
  91. package/dist/{chunk-5IZFSAEZ.cjs.map → chunk-SDRYSLOX.cjs.map} +1 -1
  92. package/dist/{chunk-NJCK6V6U.cjs → chunk-T73BHNQX.cjs} +2 -58
  93. package/dist/chunk-T73BHNQX.cjs.map +1 -0
  94. package/dist/{chunk-EOG6OT5I.cjs → chunk-TXP2N3DC.cjs} +4 -4
  95. package/dist/{chunk-EOG6OT5I.cjs.map → chunk-TXP2N3DC.cjs.map} +1 -1
  96. package/dist/{chunk-6UTKM5AB.cjs → chunk-UFT22LAB.cjs} +75 -75
  97. package/dist/chunk-UFT22LAB.cjs.map +1 -0
  98. package/dist/chunk-USNTRL22.cjs +4790 -0
  99. package/dist/chunk-USNTRL22.cjs.map +1 -0
  100. package/dist/{chunk-X36UR4A7.cjs → chunk-UTJ223TI.cjs} +413 -90
  101. package/dist/chunk-UTJ223TI.cjs.map +1 -0
  102. package/dist/{chunk-VZCPMXWC.cjs → chunk-V6MW7B4B.cjs} +4 -4
  103. package/dist/{chunk-VZCPMXWC.cjs.map → chunk-V6MW7B4B.cjs.map} +1 -1
  104. package/dist/{chunk-T23UTIRI.cjs → chunk-VWBYE3XY.cjs} +5 -5
  105. package/dist/{chunk-T23UTIRI.cjs.map → chunk-VWBYE3XY.cjs.map} +1 -1
  106. package/dist/chunk-WFMWKPGY.cjs +102 -0
  107. package/dist/chunk-WFMWKPGY.cjs.map +1 -0
  108. package/dist/chunk-WOOOMTTA.cjs +19 -0
  109. package/dist/chunk-WOOOMTTA.cjs.map +1 -0
  110. package/dist/{chunk-W6INT5GS.cjs → chunk-WRLGLZIA.cjs} +8 -8
  111. package/dist/{chunk-W6INT5GS.cjs.map → chunk-WRLGLZIA.cjs.map} +1 -1
  112. package/dist/{chunk-CJYWHUZR.cjs → chunk-XCKHOXRP.cjs} +4 -4
  113. package/dist/{chunk-CJYWHUZR.cjs.map → chunk-XCKHOXRP.cjs.map} +1 -1
  114. package/dist/chunk-XF355M7O.cjs +154 -0
  115. package/dist/chunk-XF355M7O.cjs.map +1 -0
  116. package/dist/{chunk-Q6CLWOP2.cjs → chunk-XGM4VVNV.cjs} +34 -34
  117. package/dist/{chunk-Q6CLWOP2.cjs.map → chunk-XGM4VVNV.cjs.map} +1 -1
  118. package/dist/{chunk-6WMMZLEV.cjs → chunk-XJEXFEWG.cjs} +2 -27
  119. package/dist/chunk-XJEXFEWG.cjs.map +1 -0
  120. package/dist/chunk-XK4TVJKD.cjs +73 -0
  121. package/dist/chunk-XK4TVJKD.cjs.map +1 -0
  122. package/dist/{chunk-E7TE2WVT.cjs → chunk-ZVEW3JBT.cjs} +3 -3
  123. package/dist/{chunk-E7TE2WVT.cjs.map → chunk-ZVEW3JBT.cjs.map} +1 -1
  124. package/dist/collaboration/index.cjs +70 -70
  125. package/dist/components/ZoomSlider.d.ts +25 -0
  126. package/dist/components/ZoomSlider.js +59 -0
  127. package/dist/components/ZoomSlider.js.map +7 -0
  128. package/dist/connect/docx.cjs +10 -10
  129. package/dist/connect/index.cjs +1066 -1147
  130. package/dist/connect/index.cjs.map +1 -1
  131. package/dist/connect/viewer.cjs +19 -12
  132. package/dist/connection/ai.d.ts +1 -1
  133. package/dist/connection/conversation/ConnectedMessage.js +1 -1
  134. package/dist/connection/conversation/ConnectedMessage.js.map +2 -2
  135. package/dist/connection/files/ConnectedNewFileMenu.d.ts +2 -1
  136. package/dist/connection/files/ConnectedNewFileMenu.js +9 -3
  137. package/dist/connection/files/ConnectedNewFileMenu.js.map +2 -2
  138. package/dist/connection/files/explorer/ConnectedFilesExplorer.js +1 -1
  139. package/dist/connection/files/explorer/ConnectedFilesExplorer.js.map +2 -2
  140. package/dist/connection/files/explorer/FileTiles.js +1 -1
  141. package/dist/connection/files/explorer/FileTiles.js.map +2 -2
  142. package/dist/connection/files/fields/documentField.js +1 -1
  143. package/dist/connection/files/fields/documentField.js.map +2 -2
  144. package/dist/connection/files/grid/documentColumns.js +1 -1
  145. package/dist/connection/files/grid/documentColumns.js.map +2 -2
  146. package/dist/connection/files/page/DocumentsFilterBarActions.js +17 -28
  147. package/dist/connection/files/page/DocumentsFilterBarActions.js.map +2 -2
  148. package/dist/connection/mail/useMailboxDefaults.js +1 -1
  149. package/dist/connection/mail/useMailboxDefaults.js.map +2 -2
  150. package/dist/connection/panels/useSessionPanelMode.js +3 -2
  151. package/dist/connection/panels/useSessionPanelMode.js.map +2 -2
  152. package/dist/connection/presentation/ClippingMediaViewer.d.ts +12 -0
  153. package/dist/connection/presentation/ClippingMediaViewer.js +153 -0
  154. package/dist/connection/presentation/ClippingMediaViewer.js.map +7 -0
  155. package/dist/connection/presentation/ClippingPdfViewer.d.ts +22 -0
  156. package/dist/connection/presentation/ClippingPdfViewer.js +75 -0
  157. package/dist/connection/presentation/ClippingPdfViewer.js.map +7 -0
  158. package/dist/connection/presentation/ConnectedPresentation.d.ts +12 -0
  159. package/dist/connection/presentation/ConnectedPresentation.js +100 -0
  160. package/dist/connection/presentation/ConnectedPresentation.js.map +7 -0
  161. package/dist/connection/presentation/ConnectedSlidesTab.d.ts +20 -0
  162. package/dist/connection/presentation/ConnectedSlidesTab.js +222 -0
  163. package/dist/connection/presentation/ConnectedSlidesTab.js.map +7 -0
  164. package/dist/connection/presentation/CropClipDialog.d.ts +11 -0
  165. package/dist/connection/presentation/CropClipDialog.js +86 -0
  166. package/dist/connection/presentation/CropClipDialog.js.map +7 -0
  167. package/dist/connection/presentation/GenerateTile.d.ts +4 -0
  168. package/dist/connection/presentation/GenerateTile.js +24 -0
  169. package/dist/connection/presentation/GenerateTile.js.map +7 -0
  170. package/dist/connection/presentation/LabelColumnMenu.d.ts +8 -0
  171. package/dist/connection/presentation/LabelColumnMenu.js +38 -0
  172. package/dist/connection/presentation/LabelColumnMenu.js.map +7 -0
  173. package/dist/connection/presentation/PresentationDialogs.d.ts +39 -0
  174. package/dist/connection/presentation/PresentationDialogs.js +295 -0
  175. package/dist/connection/presentation/PresentationDialogs.js.map +7 -0
  176. package/dist/connection/presentation/PresentationFileCard.d.ts +10 -0
  177. package/dist/connection/presentation/PresentationFileCard.js +35 -0
  178. package/dist/connection/presentation/PresentationFileCard.js.map +7 -0
  179. package/dist/connection/presentation/PresentationPill.d.ts +8 -0
  180. package/dist/connection/presentation/PresentationPill.js +39 -0
  181. package/dist/connection/presentation/PresentationPill.js.map +7 -0
  182. package/dist/connection/presentation/PresentationSlot.d.ts +7 -0
  183. package/dist/connection/presentation/PresentationSlot.js +35 -0
  184. package/dist/connection/presentation/PresentationSlot.js.map +7 -0
  185. package/dist/connection/presentation/requests.d.ts +21 -0
  186. package/dist/connection/presentation/requests.js +27 -0
  187. package/dist/connection/presentation/requests.js.map +7 -0
  188. package/dist/connection/presentation/useImageGeneration.d.ts +11 -0
  189. package/dist/connection/presentation/useImageGeneration.js +66 -0
  190. package/dist/connection/presentation/useImageGeneration.js.map +7 -0
  191. package/dist/connection/presentation/useLabelColumns.d.ts +15 -0
  192. package/dist/connection/presentation/useLabelColumns.js +33 -0
  193. package/dist/connection/presentation/useLabelColumns.js.map +7 -0
  194. package/dist/connection/presentation/usePresentationController.d.ts +15 -0
  195. package/dist/connection/presentation/usePresentationController.js +118 -0
  196. package/dist/connection/presentation/usePresentationController.js.map +7 -0
  197. package/dist/connection/presentation/usePresentationFiles.d.ts +44 -0
  198. package/dist/connection/presentation/usePresentationFiles.js +307 -0
  199. package/dist/connection/presentation/usePresentationFiles.js.map +7 -0
  200. package/dist/connection/presentation/useViewerClipping.d.ts +14 -0
  201. package/dist/connection/presentation/useViewerClipping.js +18 -0
  202. package/dist/connection/presentation/useViewerClipping.js.map +7 -0
  203. package/dist/connection/shell/ConnectedAppShell.js +5 -1
  204. package/dist/connection/shell/ConnectedAppShell.js.map +2 -2
  205. package/dist/connection/viewer/CleanViewControl.d.ts +8 -0
  206. package/dist/connection/viewer/CleanViewControl.js +76 -0
  207. package/dist/connection/viewer/CleanViewControl.js.map +7 -0
  208. package/dist/connection/viewer/ConnectedDocumentViewer.js +28 -29
  209. package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
  210. package/dist/connection/viewer/ViewerCropModal.d.ts +5 -0
  211. package/dist/connection/viewer/ViewerCropModal.js +22 -0
  212. package/dist/connection/viewer/ViewerCropModal.js.map +7 -0
  213. package/dist/connection/viewer/ViewerPdfPane.d.ts +3 -1
  214. package/dist/connection/viewer/ViewerPdfPane.js +41 -1
  215. package/dist/connection/viewer/ViewerPdfPane.js.map +2 -2
  216. package/dist/connection/viewer/documentPlace.d.ts +5 -4
  217. package/dist/connection/viewer/documentPlace.js +2 -2
  218. package/dist/connection/viewer/documentPlace.js.map +2 -2
  219. package/dist/connection/viewer/drafts.js +6 -4
  220. package/dist/connection/viewer/drafts.js.map +2 -2
  221. package/dist/connection/viewer/pdf/PdfClipOutlines.d.ts +11 -0
  222. package/dist/connection/viewer/pdf/PdfClipOutlines.js +42 -0
  223. package/dist/connection/viewer/pdf/PdfClipOutlines.js.map +7 -0
  224. package/dist/connection/viewer/pdf/clipOutlines.d.ts +17 -0
  225. package/dist/connection/viewer/pdf/clipOutlines.js +24 -0
  226. package/dist/connection/viewer/pdf/clipOutlines.js.map +7 -0
  227. package/dist/connection/viewer/pdf/passageHighlights.d.ts +2 -0
  228. package/dist/connection/viewer/pdf/passageHighlights.js +12 -1
  229. package/dist/connection/viewer/pdf/passageHighlights.js.map +2 -2
  230. package/dist/connection/viewer/pdf/usePdfClipOutlines.d.ts +7 -0
  231. package/dist/connection/viewer/pdf/usePdfClipOutlines.js +36 -0
  232. package/dist/connection/viewer/pdf/usePdfClipOutlines.js.map +7 -0
  233. package/dist/connection/viewer/pdf/usePdfPassageHighlights.js +11 -2
  234. package/dist/connection/viewer/pdf/usePdfPassageHighlights.js.map +2 -2
  235. package/dist/connection/viewer/shareDocument.d.ts +11 -0
  236. package/dist/connection/viewer/shareDocument.js +11 -0
  237. package/dist/connection/viewer/shareDocument.js.map +7 -0
  238. package/dist/connection/viewer/slidesTabChunk.d.ts +2 -0
  239. package/dist/connection/viewer/slidesTabChunk.js +9 -0
  240. package/dist/connection/viewer/slidesTabChunk.js.map +7 -0
  241. package/dist/connection/viewer/useCleanView.d.ts +14 -0
  242. package/dist/connection/viewer/useCleanView.js +29 -0
  243. package/dist/connection/viewer/useCleanView.js.map +7 -0
  244. package/dist/connection/viewer/useViewedDocument.d.ts +1 -0
  245. package/dist/connection/viewer/useViewedDocument.js +9 -1
  246. package/dist/connection/viewer/useViewedDocument.js.map +2 -2
  247. package/dist/connection/viewer/useViewerTabs.js +18 -4
  248. package/dist/connection/viewer/useViewerTabs.js.map +2 -2
  249. package/dist/connection/workflows/ConnectedWorkflowStart.d.ts +14 -2
  250. package/dist/connection/workflows/ConnectedWorkflowStart.js +5 -2
  251. package/dist/connection/workflows/ConnectedWorkflowStart.js.map +2 -2
  252. package/dist/databases/index.cjs +49 -49
  253. package/dist/document-tools/DocumentToolButtons.d.ts +2 -0
  254. package/dist/document-tools/DocumentToolButtons.js +22 -1
  255. package/dist/document-tools/DocumentToolButtons.js.map +2 -2
  256. package/dist/document-tools/index.cjs +16 -12
  257. package/dist/document-tools/index.d.ts +1 -1
  258. package/dist/document-tools/index.js +2 -0
  259. package/dist/document-tools/index.js.map +2 -2
  260. package/dist/embed/index.cjs +17 -15
  261. package/dist/files/GridViewImpl.js +1 -1
  262. package/dist/files/GridViewImpl.js.map +2 -2
  263. package/dist/files/ViewerChrome.d.ts +5 -1
  264. package/dist/files/ViewerChrome.js +16 -6
  265. package/dist/files/ViewerChrome.js.map +2 -2
  266. package/dist/files/index.cjs +224 -224
  267. package/dist/files/navigator/DocumentSearchList.js +1 -1
  268. package/dist/files/navigator/DocumentSearchList.js.map +2 -2
  269. package/dist/index.cjs +359 -356
  270. package/dist/index.cjs.map +1 -1
  271. package/dist/presentation/BoxActionBar.d.ts +11 -0
  272. package/dist/presentation/BoxActionBar.js +182 -0
  273. package/dist/presentation/BoxActionBar.js.map +7 -0
  274. package/dist/presentation/ClipActionBar.d.ts +26 -0
  275. package/dist/presentation/ClipActionBar.js +103 -0
  276. package/dist/presentation/ClipActionBar.js.map +7 -0
  277. package/dist/presentation/ClipCaptureOverlay.d.ts +14 -0
  278. package/dist/presentation/ClipCaptureOverlay.js +69 -0
  279. package/dist/presentation/ClipCaptureOverlay.js.map +7 -0
  280. package/dist/presentation/ClipImage.d.ts +21 -0
  281. package/dist/presentation/ClipImage.js +119 -0
  282. package/dist/presentation/ClipImage.js.map +7 -0
  283. package/dist/presentation/ClipTray.d.ts +11 -0
  284. package/dist/presentation/ClipTray.js +152 -0
  285. package/dist/presentation/ClipTray.js.map +7 -0
  286. package/dist/presentation/ClipViewControls.d.ts +11 -0
  287. package/dist/presentation/ClipViewControls.js +142 -0
  288. package/dist/presentation/ClipViewControls.js.map +7 -0
  289. package/dist/presentation/DesignMenu.d.ts +8 -0
  290. package/dist/presentation/DesignMenu.js +199 -0
  291. package/dist/presentation/DesignMenu.js.map +7 -0
  292. package/dist/presentation/LayoutMenu.d.ts +17 -0
  293. package/dist/presentation/LayoutMenu.js +122 -0
  294. package/dist/presentation/LayoutMenu.js.map +7 -0
  295. package/dist/presentation/MediaClip.d.ts +15 -0
  296. package/dist/presentation/MediaClip.js +67 -0
  297. package/dist/presentation/MediaClip.js.map +7 -0
  298. package/dist/presentation/Notice.d.ts +6 -0
  299. package/dist/presentation/Notice.js +43 -0
  300. package/dist/presentation/Notice.js.map +7 -0
  301. package/dist/presentation/PresentControls.d.ts +11 -0
  302. package/dist/presentation/PresentControls.js +117 -0
  303. package/dist/presentation/PresentControls.js.map +7 -0
  304. package/dist/presentation/PresentationStage.d.ts +32 -0
  305. package/dist/presentation/PresentationStage.js +232 -0
  306. package/dist/presentation/PresentationStage.js.map +7 -0
  307. package/dist/presentation/PresenterView.d.ts +16 -0
  308. package/dist/presentation/PresenterView.js +100 -0
  309. package/dist/presentation/PresenterView.js.map +7 -0
  310. package/dist/presentation/SlideDecor.d.ts +25 -0
  311. package/dist/presentation/SlideDecor.js +189 -0
  312. package/dist/presentation/SlideDecor.js.map +7 -0
  313. package/dist/presentation/SlidesEditor.d.ts +25 -0
  314. package/dist/presentation/SlidesEditor.js +375 -0
  315. package/dist/presentation/SlidesEditor.js.map +7 -0
  316. package/dist/presentation/StageBox.d.ts +30 -0
  317. package/dist/presentation/StageBox.js +281 -0
  318. package/dist/presentation/StageBox.js.map +7 -0
  319. package/dist/presentation/StageItem.d.ts +37 -0
  320. package/dist/presentation/StageItem.js +211 -0
  321. package/dist/presentation/StageItem.js.map +7 -0
  322. package/dist/presentation/box-style.d.ts +6 -0
  323. package/dist/presentation/box-style.js +19 -0
  324. package/dist/presentation/box-style.js.map +7 -0
  325. package/dist/presentation/boxes.d.ts +105 -0
  326. package/dist/presentation/boxes.js +103 -0
  327. package/dist/presentation/boxes.js.map +7 -0
  328. package/dist/presentation/draw-boxes.d.ts +8 -0
  329. package/dist/presentation/draw-boxes.js +130 -0
  330. package/dist/presentation/draw-boxes.js.map +7 -0
  331. package/dist/presentation/export-boxes.d.ts +10 -0
  332. package/dist/presentation/export-boxes.js +74 -0
  333. package/dist/presentation/export-boxes.js.map +7 -0
  334. package/dist/presentation/export-pptx.d.ts +16 -0
  335. package/dist/presentation/export-pptx.js +194 -0
  336. package/dist/presentation/export-pptx.js.map +7 -0
  337. package/dist/presentation/import-pptx.d.ts +35 -0
  338. package/dist/presentation/import-pptx.js +659 -0
  339. package/dist/presentation/import-pptx.js.map +7 -0
  340. package/dist/presentation/merge-outside-edits.d.ts +12 -0
  341. package/dist/presentation/merge-outside-edits.js +35 -0
  342. package/dist/presentation/merge-outside-edits.js.map +7 -0
  343. package/dist/presentation/model.d.ts +201 -0
  344. package/dist/presentation/model.js +271 -0
  345. package/dist/presentation/model.js.map +7 -0
  346. package/dist/presentation/panel-id.d.ts +44 -0
  347. package/dist/presentation/panel-id.js +29 -0
  348. package/dist/presentation/panel-id.js.map +7 -0
  349. package/dist/presentation/persistence.d.ts +121 -0
  350. package/dist/presentation/persistence.js +141 -0
  351. package/dist/presentation/persistence.js.map +7 -0
  352. package/dist/presentation/pptx-data.d.ts +22 -0
  353. package/dist/presentation/pptx-data.js +83 -0
  354. package/dist/presentation/pptx-data.js.map +7 -0
  355. package/dist/presentation/pptx-xml.d.ts +90 -0
  356. package/dist/presentation/pptx-xml.js +333 -0
  357. package/dist/presentation/pptx-xml.js.map +7 -0
  358. package/dist/presentation/render-slides.d.ts +58 -0
  359. package/dist/presentation/render-slides.js +309 -0
  360. package/dist/presentation/render-slides.js.map +7 -0
  361. package/dist/presentation/saved-boxes.d.ts +11 -0
  362. package/dist/presentation/saved-boxes.js +80 -0
  363. package/dist/presentation/saved-boxes.js.map +7 -0
  364. package/dist/presentation/slide-layout.d.ts +58 -0
  365. package/dist/presentation/slide-layout.js +133 -0
  366. package/dist/presentation/slide-layout.js.map +7 -0
  367. package/dist/presentation/stage-videos.d.ts +5 -0
  368. package/dist/presentation/stage-videos.js +19 -0
  369. package/dist/presentation/stage-videos.js.map +7 -0
  370. package/dist/presentation/store.d.ts +203 -0
  371. package/dist/presentation/store.js +429 -0
  372. package/dist/presentation/store.js.map +7 -0
  373. package/dist/presentation/theme.d.ts +102 -0
  374. package/dist/presentation/theme.js +276 -0
  375. package/dist/presentation/theme.js.map +7 -0
  376. package/dist/presentation/useClipDrag.d.ts +26 -0
  377. package/dist/presentation/useClipDrag.js +65 -0
  378. package/dist/presentation/useClipDrag.js.map +7 -0
  379. package/dist/presentation/useObjectUrl.d.ts +6 -0
  380. package/dist/presentation/useObjectUrl.js +15 -0
  381. package/dist/presentation/useObjectUrl.js.map +7 -0
  382. package/dist/presentation/usePresenterKeys.d.ts +13 -0
  383. package/dist/presentation/usePresenterKeys.js +62 -0
  384. package/dist/presentation/usePresenterKeys.js.map +7 -0
  385. package/dist/settings/index.cjs +149 -148
  386. package/dist/shell/PanelPortal.js +13 -3
  387. package/dist/shell/PanelPortal.js.map +2 -2
  388. package/dist/shell/index.cjs +49 -46
  389. package/dist/shell/panel-windows.d.ts +2 -0
  390. package/dist/shell/panel-windows.js +8 -2
  391. package/dist/shell/panel-windows.js.map +2 -2
  392. package/dist/studio/index.cjs +8 -6
  393. package/dist/studio/index.cjs.map +1 -1
  394. package/dist/styles.css +1 -1
  395. package/dist/workflow-canvas/index.cjs +26 -25
  396. package/dist/workflow-canvas/index.cjs.map +1 -1
  397. package/node_modules/@arbidocs/coedit/package.json +1 -1
  398. package/package.json +6 -5
  399. package/dist/ConnectedCallDock-WER7R222.cjs.map +0 -1
  400. package/dist/DocumentReviewCard-BPIAJJED.cjs.map +0 -1
  401. package/dist/FilesViewerDialog-67WK3TZC.cjs.map +0 -1
  402. package/dist/GridViewImpl-ZMJJWTOM.cjs.map +0 -1
  403. package/dist/WorkspaceTableView-J3C6VH4T.cjs.map +0 -1
  404. package/dist/ai-IM4A23YT.cjs.map +0 -1
  405. package/dist/chunk-557MJ4IH.cjs.map +0 -1
  406. package/dist/chunk-6UTKM5AB.cjs.map +0 -1
  407. package/dist/chunk-6WMMZLEV.cjs.map +0 -1
  408. package/dist/chunk-B3LZITVF.cjs.map +0 -1
  409. package/dist/chunk-BUVIBHFU.cjs.map +0 -1
  410. package/dist/chunk-CKCG4NDB.cjs.map +0 -1
  411. package/dist/chunk-CPR6EHG7.cjs.map +0 -1
  412. package/dist/chunk-HA66DHW6.cjs.map +0 -1
  413. package/dist/chunk-NJCK6V6U.cjs.map +0 -1
  414. package/dist/chunk-NLSWDP42.cjs.map +0 -1
  415. package/dist/chunk-PGJYD67F.cjs.map +0 -1
  416. package/dist/chunk-X36UR4A7.cjs.map +0 -1
  417. package/dist/chunk-YYPZOEED.cjs.map +0 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/presentation/draw-boxes.ts"],
4
+ "sourcesContent": ["/**\n * A slide's text boxes and shapes drawn on a canvas, as the stage draws them (`StageBox`): for the\n * saved PDF's pages. Text wraps by words across runs of different type.\n */\n\nimport {\n DEFAULT_INSET,\n DEFAULT_TEXT_SIZE,\n pointsToStage,\n type SlideBox,\n type TextRun,\n} from './boxes'\nimport { TEXT_COLORS } from './theme'\n\nconst LINE_HEIGHT = 1.2\n\nfunction fontOf(run: TextRun, themeFont: string, width: number): string {\n const size = pointsToStage(run.size ?? DEFAULT_TEXT_SIZE) * width\n const family = run.font ? `\"${run.font}\", ${themeFont}` : themeFont\n return `${run.italic ? 'italic ' : ''}${run.bold ? 700 : 400} ${size}px ${family}`\n}\n\ninterface Piece {\n text: string\n run: TextRun\n width: number\n}\n\n/** The box's outline path (its shape) at `x, y, w, h`. */\nfunction outline(context: CanvasRenderingContext2D, box: SlideBox, w: number, h: number) {\n context.beginPath()\n if (box.shape === 'ellipse') context.ellipse(w / 2, h / 2, w / 2, h / 2, 0, 0, Math.PI * 2)\n else if (box.shape === 'roundRect') context.roundRect(0, 0, w, h, Math.min(w, h) / 6)\n else context.rect(0, 0, w, h)\n}\n\nexport function drawBox(\n context: CanvasRenderingContext2D,\n box: SlideBox,\n width: number,\n height: number,\n themeFont: string\n): void {\n const { frame } = box\n const w = frame.w * width\n const h = frame.h * height\n context.save()\n context.translate(frame.x * width + w / 2, frame.y * height + h / 2)\n if (box.rotation) context.rotate((box.rotation * Math.PI) / 180)\n context.translate(-w / 2, -h / 2)\n\n const lineWidth = box.line ? Math.max(1, pointsToStage(box.line.width) * width) : 0\n if (box.shape === 'line') {\n context.strokeStyle = box.line?.color ?? TEXT_COLORS.body\n context.lineWidth = lineWidth || 1\n if (box.line?.dash) context.setLineDash([lineWidth * 3, lineWidth * 2])\n context.beginPath()\n context.moveTo(0, box.flipV ? h : 0)\n context.lineTo(w, box.flipV ? 0 : h)\n context.stroke()\n context.restore()\n return\n }\n if (box.fill) {\n context.globalAlpha = box.fillAlpha ?? 1\n context.fillStyle = box.fill\n outline(context, box, w, h)\n context.fill()\n context.globalAlpha = 1\n }\n if (box.line && lineWidth) {\n context.strokeStyle = box.line.color\n context.lineWidth = lineWidth\n if (box.line.dash) context.setLineDash([lineWidth * 3, lineWidth * 2])\n outline(context, box, w, h)\n context.stroke()\n context.setLineDash([])\n }\n\n // The text: each paragraph wrapped to the box (inside its inset), placed by its anchor.\n const inset = pointsToStage(box.inset ?? DEFAULT_INSET) * width\n const room = w - 2 * inset\n context.textBaseline = 'alphabetic'\n const lines: {\n pieces: Piece[]\n size: number\n align: string\n indent: number\n bullet?: TextRun\n }[] = []\n for (const paragraph of box.paragraphs) {\n const size = pointsToStage(paragraph.runs[0]?.size ?? DEFAULT_TEXT_SIZE) * width\n const indent = (paragraph.level ?? 0) * 0.5 * size + (paragraph.bullet ? size * 0.9 : 0)\n const words: Piece[] = []\n for (const run of paragraph.runs) {\n context.font = fontOf(run, themeFont, width)\n for (const part of run.text.split(/(\\s+)/).filter(Boolean)) {\n words.push({ text: part, run, width: context.measureText(part).width })\n }\n }\n let line: Piece[] = []\n let used = 0\n let first = true\n const flush = () => {\n lines.push({\n pieces: line,\n size,\n align: paragraph.align ?? 'left',\n indent,\n ...(first && paragraph.bullet ? { bullet: paragraph.runs[0] } : {}),\n })\n first = false\n line = []\n used = 0\n }\n for (const word of words) {\n if (used + word.width > room - indent && line.length && word.text.trim()) flush()\n if (!line.length && !word.text.trim()) continue\n line.push(word)\n used += word.width\n }\n flush()\n }\n const total = lines.reduce((sum, line) => sum + line.size * LINE_HEIGHT, 0)\n const free = h - 2 * inset - total\n let y = inset + (box.anchor === 'middle' ? free / 2 : box.anchor === 'bottom' ? free : 0)\n context.save()\n context.beginPath()\n context.rect(0, 0, w, h)\n context.clip()\n for (const line of lines) {\n const lineWidth = line.pieces.reduce((sum, piece) => sum + piece.width, 0)\n const space = room - line.indent\n let x =\n inset +\n line.indent +\n (line.align === 'center'\n ? (space - lineWidth) / 2\n : line.align === 'right'\n ? space - lineWidth\n : 0)\n const baseline = y + line.size * (LINE_HEIGHT - 0.2)\n if (line.bullet) {\n context.font = fontOf(line.bullet, themeFont, width)\n context.fillStyle = line.bullet.color ?? TEXT_COLORS.body\n context.fillText('\u2022', inset + line.indent - line.size * 0.9, baseline)\n }\n for (const piece of line.pieces) {\n context.font = fontOf(piece.run, themeFont, width)\n context.fillStyle = piece.run.color ?? TEXT_COLORS.body\n context.fillText(piece.text, x, baseline)\n if (piece.run.underline) {\n context.fillRect(x, baseline + line.size * 0.08, piece.width, Math.max(1, line.size * 0.05))\n }\n x += piece.width\n }\n y += line.size * LINE_HEIGHT\n }\n context.restore()\n context.restore()\n}\n\n/** The words a box shows, for a searchable PDF. */\nexport const boxWords = (box: SlideBox): string[] =>\n box.paragraphs\n .map((paragraph) =>\n paragraph.runs\n .map((run) => run.text)\n .join('')\n .trim()\n )\n .filter(Boolean)\n"],
5
+ "mappings": ";AAKA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,mBAAmB;AAE5B,MAAM,cAAc;AAEpB,SAAS,OAAO,KAAc,WAAmB,OAAuB;AACtE,QAAM,OAAO,cAAc,IAAI,QAAQ,iBAAiB,IAAI;AAC5D,QAAM,SAAS,IAAI,OAAO,IAAI,IAAI,IAAI,MAAM,SAAS,KAAK;AAC1D,SAAO,GAAG,IAAI,SAAS,YAAY,EAAE,GAAG,IAAI,OAAO,MAAM,GAAG,IAAI,IAAI,MAAM,MAAM;AAClF;AASA,SAAS,QAAQ,SAAmC,KAAe,GAAW,GAAW;AACvF,UAAQ,UAAU;AAClB,MAAI,IAAI,UAAU,UAAW,SAAQ,QAAQ,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,KAAK,KAAK,CAAC;AAAA,WACjF,IAAI,UAAU,YAAa,SAAQ,UAAU,GAAG,GAAG,GAAG,GAAG,KAAK,IAAI,GAAG,CAAC,IAAI,CAAC;AAAA,MAC/E,SAAQ,KAAK,GAAG,GAAG,GAAG,CAAC;AAC9B;AAEO,SAAS,QACd,SACA,KACA,OACA,QACA,WACM;AACN,QAAM,EAAE,MAAM,IAAI;AAClB,QAAM,IAAI,MAAM,IAAI;AACpB,QAAM,IAAI,MAAM,IAAI;AACpB,UAAQ,KAAK;AACb,UAAQ,UAAU,MAAM,IAAI,QAAQ,IAAI,GAAG,MAAM,IAAI,SAAS,IAAI,CAAC;AACnE,MAAI,IAAI,SAAU,SAAQ,OAAQ,IAAI,WAAW,KAAK,KAAM,GAAG;AAC/D,UAAQ,UAAU,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC;AAEhC,QAAM,YAAY,IAAI,OAAO,KA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,YACX,QAAQA,cAAa,IACtB,KAAK,UAAU,UACb,QAAQA,aACR;AACR,UAAM,WAAW,IAAI,KAAK,QAAQ,cAAc;AAChD,QAAI,KAAK,QAAQ;AACf,cAAQ,OAAO,OAAO,KAAK,QAAQ,WAAW,KAAK;AACnD,cAAQ,YAAY,KAAK,OAAO,SAAS,YAAY;AACrD,cAAQ,SAAS,UAAK,QAAQ,KAAK,SAAS,KAAK,OAAO,KAAK,QAAQ;AAAA,IACvE;AACA,eAAW,SAAS,KAAK,QAAQ;AAC/B,cAAQ,OAAO,OAAO,MAAM,KAAK,WAAW,KAAK;AACjD,cAAQ,YAAY,MAAM,IAAI,SAAS,YAAY;AACnD,cAAQ,SAAS,MAAM,MAAM,GAAG,QAAQ;AACxC,UAAI,MAAM,IAAI,WAAW;AACvB,gBAAQ,SAAS,GAAG,WAAW,KAAK,OAAO,MAAM,MAAM,OAAO,KAAK,IAAI,GAAG,KAAK,OAAO,IAAI,CAAC;AAAA,MAC7F;AACA,WAAK,MAAM;AAAA,IACb;AACA,SAAK,KAAK,OAAO;AAAA,EACnB;AACA,UAAQ,QAAQ;AAChB,UAAQ,QAAQ;AAClB;AAGO,MAAM,WAAW,CAAC,QACvB,IAAI,WACD;AAAA,EAAI,CAAC,cACJ,UAAU,KACP,IAAI,CAAC,QAAQ,IAAI,IAAI,EACrB,KAAK,EAAE,EACP,KAAK;AACV,EACC,OAAO,OAAO;",
6
+ "names": ["lineWidth"]
7
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A slide's text boxes and shapes as PowerPoint's own: editable text (each run's type, colour and
3
+ * weight, each paragraph's alignment, level and bullet) in a shape with its fill and outline, so a
4
+ * deck imported from PowerPoint goes back to PowerPoint as it came.
5
+ */
6
+ import type PptxGenJS from 'pptxgenjs';
7
+ import { type SlideBox } from './boxes';
8
+ type Slide = ReturnType<PptxGenJS['addSlide']>;
9
+ export declare function addBox(pptx: PptxGenJS, page: Slide, box: SlideBox, themeFont: string): void;
10
+ export {};
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { DEFAULT_INSET, DEFAULT_TEXT_SIZE } from "./boxes.js";
3
+ import { TEXT_COLORS } from "./theme.js";
4
+ const SLIDE_INCHES = { w: 13.333, h: 7.5 };
5
+ const hex = (color) => color.replace("#", "").toUpperCase();
6
+ function addBox(pptx, page, box, themeFont) {
7
+ const { frame } = box;
8
+ const place = {
9
+ x: frame.x * SLIDE_INCHES.w,
10
+ y: frame.y * SLIDE_INCHES.h,
11
+ w: Math.max(0.01, frame.w * SLIDE_INCHES.w),
12
+ h: frame.h * SLIDE_INCHES.h,
13
+ ...box.rotation ? { rotate: box.rotation } : {},
14
+ ...box.flipH ? { flipH: true } : {},
15
+ ...box.flipV ? { flipV: true } : {}
16
+ };
17
+ const line = box.line ? {
18
+ color: hex(box.line.color),
19
+ width: box.line.width,
20
+ ...box.line.dash ? { dashType: "dash" } : {}
21
+ } : void 0;
22
+ if (box.shape === "line") {
23
+ page.addShape(pptx.ShapeType.line, {
24
+ ...place,
25
+ line: line ?? { color: hex(TEXT_COLORS.body), width: 1 }
26
+ });
27
+ return;
28
+ }
29
+ const shape = box.shape === "ellipse" ? pptx.ShapeType.ellipse : box.shape === "roundRect" ? pptx.ShapeType.roundRect : pptx.ShapeType.rect;
30
+ const fill = box.fill ? {
31
+ color: hex(box.fill),
32
+ ...box.fillAlpha !== void 0 ? { transparency: Math.round((1 - box.fillAlpha) * 100) } : {}
33
+ } : void 0;
34
+ const runs = [];
35
+ box.paragraphs.forEach((paragraph, p) => {
36
+ const last = p === box.paragraphs.length - 1;
37
+ const paragraphRuns = paragraph.runs.length ? paragraph.runs : [{ text: "" }];
38
+ paragraphRuns.forEach((run, r) => {
39
+ runs.push({
40
+ text: run.text,
41
+ options: {
42
+ fontSize: run.size ?? DEFAULT_TEXT_SIZE,
43
+ fontFace: run.font ?? themeFont,
44
+ color: hex(run.color ?? TEXT_COLORS.body),
45
+ ...run.bold ? { bold: true } : {},
46
+ ...run.italic ? { italic: true } : {},
47
+ ...run.underline ? { underline: { style: "sng" } } : {},
48
+ align: paragraph.align ?? "left",
49
+ ...paragraph.level ? { indentLevel: paragraph.level } : {},
50
+ ...paragraph.bullet && r === 0 ? { bullet: true } : {},
51
+ ...r === paragraphRuns.length - 1 && !last ? { breakLine: true } : {}
52
+ }
53
+ });
54
+ });
55
+ });
56
+ const text = runs.some((run) => run.text);
57
+ if (!text && box.shape === "text") return;
58
+ page.addText(text ? runs : "", {
59
+ ...place,
60
+ shape,
61
+ ...fill ? { fill } : {},
62
+ ...line ? { line } : {},
63
+ // Its part in the slide (its title, its body), kept by name: read back when imported.
64
+ ...box.role ? { objectName: `ARBI ${box.role}` } : {},
65
+ valign: box.anchor ?? "top",
66
+ margin: box.inset ?? DEFAULT_INSET,
67
+ lineSpacingMultiple: 1,
68
+ fit: "none"
69
+ });
70
+ }
71
+ export {
72
+ addBox
73
+ };
74
+ //# sourceMappingURL=export-boxes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/presentation/export-boxes.ts"],
4
+ "sourcesContent": ["/**\n * A slide's text boxes and shapes as PowerPoint's own: editable text (each run's type, colour and\n * weight, each paragraph's alignment, level and bullet) in a shape with its fill and outline, so a\n * deck imported from PowerPoint goes back to PowerPoint as it came.\n */\n\nimport type PptxGenJS from 'pptxgenjs'\nimport { DEFAULT_INSET, DEFAULT_TEXT_SIZE, type SlideBox } from './boxes'\nimport { TEXT_COLORS } from './theme'\n\n/** PowerPoint's widescreen slide, in inches. */\nconst SLIDE_INCHES = { w: 13.333, h: 7.5 }\nconst hex = (color: string) => color.replace('#', '').toUpperCase()\n\ntype Slide = ReturnType<PptxGenJS['addSlide']>\n\nexport function addBox(pptx: PptxGenJS, page: Slide, box: SlideBox, themeFont: string): void {\n const { frame } = box\n const place = {\n x: frame.x * SLIDE_INCHES.w,\n y: frame.y * SLIDE_INCHES.h,\n w: Math.max(0.01, frame.w * SLIDE_INCHES.w),\n h: frame.h * SLIDE_INCHES.h,\n ...(box.rotation ? { rotate: box.rotation } : {}),\n ...(box.flipH ? { flipH: true } : {}),\n ...(box.flipV ? { flipV: true } : {}),\n }\n const line = box.line\n ? {\n color: hex(box.line.color),\n width: box.line.width,\n ...(box.line.dash ? { dashType: 'dash' as const } : {}),\n }\n : undefined\n if (box.shape === 'line') {\n page.addShape(pptx.ShapeType.line, {\n ...place,\n line: line ?? { color: hex(TEXT_COLORS.body), width: 1 },\n })\n return\n }\n const shape =\n box.shape === 'ellipse'\n ? pptx.ShapeType.ellipse\n : box.shape === 'roundRect'\n ? pptx.ShapeType.roundRect\n : pptx.ShapeType.rect\n const fill = box.fill\n ? {\n color: hex(box.fill),\n ...(box.fillAlpha !== undefined\n ? { transparency: Math.round((1 - box.fillAlpha) * 100) }\n : {}),\n }\n : undefined\n const runs: PptxGenJS.TextProps[] = []\n box.paragraphs.forEach((paragraph, p) => {\n const last = p === box.paragraphs.length - 1\n const paragraphRuns = paragraph.runs.length ? paragraph.runs : [{ text: '' }]\n paragraphRuns.forEach((run, r) => {\n runs.push({\n text: run.text,\n options: {\n fontSize: run.size ?? DEFAULT_TEXT_SIZE,\n fontFace: run.font ?? themeFont,\n color: hex(run.color ?? TEXT_COLORS.body),\n ...(run.bold ? { bold: true } : {}),\n ...(run.italic ? { italic: true } : {}),\n ...(run.underline ? { underline: { style: 'sng' as const } } : {}),\n align: paragraph.align ?? 'left',\n ...(paragraph.level ? { indentLevel: paragraph.level } : {}),\n ...(paragraph.bullet && r === 0 ? { bullet: true } : {}),\n ...(r === paragraphRuns.length - 1 && !last ? { breakLine: true } : {}),\n },\n })\n })\n })\n const text = runs.some((run) => run.text)\n if (!text && box.shape === 'text') return\n page.addText(text ? runs : '', {\n ...place,\n shape,\n ...(fill ? { fill } : {}),\n ...(line ? { line } : {}),\n // Its part in the slide (its title, its body), kept by name: read back when imported.\n ...(box.role ? { objectName: `ARBI ${box.role}` } : {}),\n valign: box.anchor ?? 'top',\n margin: box.inset ?? D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AAO,EAAE,KAAK,IAAI,CAAC;AAAA,IACvB,GAAI,OAAO,EAAE,KAAK,IAAI,CAAC;AAAA;AAAA,IAEvB,GAAI,IAAI,OAAO,EAAE,YAAY,QAAQ,IAAI,IAAI,GAAG,IAAI,CAAC;AAAA,IACrD,QAAQ,IAAI,UAAU;AAAA,IACtB,QAAQ,IAAI,SAAS;AAAA,IACrB,qBAAqB;AAAA,IACrB,KAAK;AAAA,EACP,CAAC;AACH;",
6
+ "names": []
7
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The presentation as a PowerPoint deck (.pptx), drawn from the same geometry as the stage and the
3
+ * saved PDF: each slide's themed background (an image, painted as the PDF's is), its title, rule
4
+ * and points as real, editable PowerPoint text in the theme's typeface, each clip as an image
5
+ * (redactions burnt in, at 1.5× the size it is shown, so it stays sharp on a projector) with its
6
+ * label, and the logo. PptxGenJS is loaded only when a deck is exported.
7
+ */
8
+ import { type Clip, type Slide } from './model';
9
+ import { type SlideLook } from './render-slides';
10
+ export interface DeckContent {
11
+ title: string;
12
+ slides: readonly Slide[];
13
+ clips: readonly Clip[];
14
+ }
15
+ /** The deck as a .pptx file. */
16
+ export declare function buildPptx(deck: DeckContent, look: SlideLook): Promise<Blob>;
@@ -0,0 +1,194 @@
1
+ "use client";
2
+ import { clipLabel, frameHeight } from "./model.js";
3
+ import { SLIDE_PIXELS, drawClip, drawRoundedClip, loadImage } from "./render-slides.js";
4
+ import { addBox } from "./export-boxes.js";
5
+ import { slideGeometry, textLines } from "./slide-layout.js";
6
+ import { FONTS, TEXT_COLORS, accentColor, paintBackground, paintSlideBackground } from "./theme.js";
7
+ const SLIDE_INCHES = { w: 13.333, h: 7.5 };
8
+ const toPoints = (size) => Math.round(size * SLIDE_INCHES.w * 72 * 10) / 10;
9
+ const hex = (color) => color.replace("#", "").toUpperCase();
10
+ async function canvasImage(width, height, draw) {
11
+ const canvas = document.createElement("canvas");
12
+ canvas.width = Math.max(1, Math.round(width));
13
+ canvas.height = Math.max(1, Math.round(height));
14
+ const context = canvas.getContext("2d");
15
+ if (!context) throw new Error("Could not draw the slides");
16
+ await draw(context);
17
+ const url = canvas.toDataURL("image/png");
18
+ canvas.width = canvas.height = 0;
19
+ return url.replace(/^data:/, "");
20
+ }
21
+ const box = (b) => ({
22
+ x: b.x * SLIDE_INCHES.w,
23
+ y: b.y * SLIDE_INCHES.h,
24
+ w: b.w * SLIDE_INCHES.w,
25
+ h: b.h * SLIDE_INCHES.h
26
+ });
27
+ function textOptions(text, look) {
28
+ return {
29
+ ...box(text),
30
+ fontFace: FONTS[look.theme.font].pptx,
31
+ fontSize: toPoints(text.size),
32
+ bold: text.weight >= 600,
33
+ color: hex(TEXT_COLORS[text.tone]),
34
+ align: text.align,
35
+ valign: text.anchor ?? "top",
36
+ lineSpacingMultiple: text.leading,
37
+ margin: 0
38
+ };
39
+ }
40
+ async function buildPptx(deck, look) {
41
+ const { default: PptxGenJS } = await import("pptxgenjs");
42
+ const pptx = new PptxGenJS();
43
+ pptx.layout = "LAYOUT_WIDE";
44
+ pptx.title = deck.title;
45
+ pptx.theme = {
46
+ headFontFace: FONTS[look.theme.font].pptx,
47
+ bodyFontFace: FONTS[look.theme.font].pptx
48
+ };
49
+ const { width, height } = SLIDE_PIXELS;
50
+ const background = await canvasImage(
51
+ width,
52
+ height,
53
+ (context) => paintBackground(context, width, height, look.theme.background)
54
+ );
55
+ const logo = look.logo ? await loadImage(look.logo) : null;
56
+ const logoData = logo ? await canvasImage(logo.width, logo.height, (context) => context.drawImage(logo, 0, 0)) : null;
57
+ const themeFont = FONTS[look.theme.font].pptx;
58
+ for (const slide of deck.slides) {
59
+ const page = pptx.addSlide();
60
+ if (slide.background?.color && !slide.background.gradient && !slide.background.image) {
61
+ page.background = { color: hex(slide.background.color) };
62
+ } else if (slide.background) {
63
+ const own = slide.background;
64
+ page.background = {
65
+ data: await canvasImage(
66
+ width,
67
+ height,
68
+ (context) => paintSlideBackground(context, width, height, own, look.media)
69
+ )
70
+ };
71
+ } else {
72
+ page.background = { data: background };
73
+ }
74
+ if (slide.notes?.trim()) page.addNotes(slide.notes);
75
+ const geometry = slideGeometry(slide, {
76
+ labels: look.labels,
77
+ logo: look.theme.logo?.corner ?? null
78
+ });
79
+ for (const shape of slide.boxes) if (!shape.front) addBox(pptx, page, shape, themeFont);
80
+ for (const item of slide.items) {
81
+ const clip = deck.clips.find((entry) => entry.id === item.clipId);
82
+ if (!clip) continue;
83
+ const frame = { ...item.frame, h: frameHeight(item.frame, clip.aspect) };
84
+ if (clip.plain) {
85
+ const source = clip.kind === "image" ? await createImageBitmap(clip.source) : null;
86
+ const scale = source ? Math.min(1, 2400 / Math.max(1, clip.rect.w * source.width)) : 1.5;
87
+ const pixels2 = source ? { w: clip.rect.w * source.width * scale, h: clip.rect.h * source.height * scale } : { w: frame.w * width * 1.5, h: frame.h * height * 1.5 };
88
+ source?.close();
89
+ const data2 = await canvasImage(
90
+ pixels2.w,
91
+ pixels2.h,
92
+ (context) => drawClip(context, clip, { x: 0, y: 0, width: pixels2.w, height: pixels2.h })
93
+ );
94
+ page.addImage({ data: data2, ...box(frame), altText: clip.caption || clip.fileName });
95
+ continue;
96
+ }
97
+ const pixels = { w: frame.w * width * 1.5, h: frame.h * height * 1.5 };
98
+ const data = await canvasImage(
99
+ pixels.w,
100
+ pixels.h,
101
+ (context) => drawRoundedClip(
102
+ context,
103
+ clip,
104
+ { x: 0, y: 0, width: pixels.w, height: pixels.h },
105
+ width * 1.5,
106
+ false
107
+ )
108
+ );
109
+ page.addImage({
110
+ data,
111
+ ...box(frame),
112
+ altText: clip.caption,
113
+ shadow: { type: "outer", blur: 10, offset: 3, angle: 90, color: "000000", opacity: 0.45 }
114
+ });
115
+ const label = clipLabel(clip, look.columnValues);
116
+ if (look.labels && label) {
117
+ page.addText(label, {
118
+ ...box({ x: frame.x, y: frame.y + frame.h + 8e-3, w: frame.w, h: 0.045 }),
119
+ fontFace: FONTS[look.theme.font].pptx,
120
+ fontSize: toPoints(0.017),
121
+ color: hex(TEXT_COLORS.muted),
122
+ margin: 0,
123
+ valign: "top",
124
+ fit: "shrink"
125
+ });
126
+ }
127
+ }
128
+ const title = slide.caption.trim();
129
+ if (title && geometry.title) {
130
+ page.addText(title, textOptions(geometry.title, look));
131
+ if (geometry.rule) {
132
+ page.addShape(pptx.ShapeType.rect, {
133
+ ...box(geometry.rule),
134
+ fill: { color: hex(accentColor(look.theme.accent)) },
135
+ line: { color: hex(accentColor(look.theme.accent)), width: 0 }
136
+ });
137
+ }
138
+ }
139
+ const lines = textLines(slide.points);
140
+ if (geometry.text && lines.length) {
141
+ const text = geometry.text;
142
+ page.addText(
143
+ lines.map((line) => ({
144
+ text: line,
145
+ options: {
146
+ breakLine: true,
147
+ ...text.bullets ? { bullet: { characterCode: "25A0", indent: toPoints(text.size) * 1.2 } } : {}
148
+ }
149
+ })),
150
+ {
151
+ ...textOptions(text, look),
152
+ ...text.bullets ? { paraSpaceAfter: toPoints(text.size) * 0.45 } : {}
153
+ }
154
+ );
155
+ }
156
+ for (const shape of slide.boxes) if (shape.front) addBox(pptx, page, shape, themeFont);
157
+ if (geometry.logo && logo && logoData) {
158
+ const area = box(geometry.logo);
159
+ const scale = Math.min(area.w / logo.width, area.h / logo.height);
160
+ const w = logo.width * scale;
161
+ const h = logo.height * scale;
162
+ page.addImage({
163
+ data: logoData,
164
+ x: geometry.logo.x < 0.5 ? area.x : area.x + area.w - w,
165
+ y: area.y + area.h - h,
166
+ w,
167
+ h,
168
+ transparency: 10
169
+ });
170
+ }
171
+ }
172
+ const deckFile = await pptx.write({ outputType: "blob" });
173
+ return accentBullets(deckFile, accentColor(look.theme.accent));
174
+ }
175
+ async function accentBullets(deck, accent) {
176
+ const { default: JSZip } = await import("jszip");
177
+ const zip = await JSZip.loadAsync(deck);
178
+ const slides = Object.keys(zip.files).filter((name) => /^ppt\/slides\/slide\d+\.xml$/.test(name));
179
+ for (const name of slides) {
180
+ const xml = await zip.file(name).async("string");
181
+ zip.file(
182
+ name,
183
+ xml.replaceAll(
184
+ '<a:buSzPct val="100000"/><a:buChar',
185
+ `<a:buClr><a:srgbClr val="${hex(accent)}"/></a:buClr><a:buSzPct val="70000"/><a:buChar`
186
+ )
187
+ );
188
+ }
189
+ return zip.generateAsync({ type: "blob", mimeType: deck.type || void 0 });
190
+ }
191
+ export {
192
+ buildPptx
193
+ };
194
+ //# sourceMappingURL=export-pptx.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/presentation/export-pptx.ts"],
4
+ "sourcesContent": ["/**\n * The presentation as a PowerPoint deck (.pptx), drawn from the same geometry as the stage and the\n * saved PDF: each slide's themed background (an image, painted as the PDF's is), its title, rule\n * and points as real, editable PowerPoint text in the theme's typeface, each clip as an image\n * (redactions burnt in, at 1.5\u00D7 the size it is shown, so it stays sharp on a projector) with its\n * label, and the logo. PptxGenJS is loaded only when a deck is exported.\n */\n\nimport { clipLabel, frameHeight, type Clip, type Slide } from './model'\nimport { SLIDE_PIXELS, drawClip, drawRoundedClip, loadImage, type SlideLook } from './render-slides'\nimport { addBox } from './export-boxes'\nimport { slideGeometry, textLines, type TextBox } from './slide-layout'\nimport { FONTS, TEXT_COLORS, accentColor, paintBackground, paintSlideBackground } from './theme'\n\n/** PowerPoint's widescreen slide, in inches. */\nconst SLIDE_INCHES = { w: 13.333, h: 7.5 }\n/** A stage-width fraction as a type size in points. */\nconst toPoints = (size: number) => Math.round(size * SLIDE_INCHES.w * 72 * 10) / 10\nconst hex = (color: string) => color.replace('#', '').toUpperCase()\n\n/** A canvas drawn by `draw`, as the data PptxGenJS takes (\"image/png;base64,\u2026\"). */\nasync function canvasImage(\n width: number,\n height: number,\n draw: (context: CanvasRenderingContext2D) => void | Promise<void>\n): Promise<string> {\n const canvas = document.createElement('canvas')\n canvas.width = Math.max(1, Math.round(width))\n canvas.height = Math.max(1, Math.round(height))\n const context = canvas.getContext('2d')\n if (!context) throw new Error('Could not draw the slides')\n await draw(context)\n const url = canvas.toDataURL('image/png')\n canvas.width = canvas.height = 0\n return url.replace(/^data:/, '')\n}\n\nconst box = (b: { x: number; y: number; w: number; h: number }) => ({\n x: b.x * SLIDE_INCHES.w,\n y: b.y * SLIDE_INCHES.h,\n w: b.w * SLIDE_INCHES.w,\n h: b.h * SLIDE_INCHES.h,\n})\n\nfunction textOptions(text: TextBox, look: SlideLook) {\n return {\n ...box(text),\n fontFace: FONTS[look.theme.font].pptx,\n fontSize: toPoints(text.size),\n bold: text.weight >= 600,\n color: hex(TEXT_COLORS[text.tone]),\n align: text.align,\n valign: text.anchor ?? 'top',\n lineSpacingMultiple: text.leading,\n margin: 0,\n } as const\n}\n\nexport interface DeckContent {\n title: string\n slides: readonly Slide[]\n clips: readonly Clip[]\n}\n\n/** The deck as a .pptx file. */\nexport async function buildPptx(deck: DeckContent, look: SlideLook): Promise<Blob> {\n const { default: PptxGenJS } = await import('pptxgenjs')\n const pptx = new PptxGenJS()\n pptx.layout = 'LAYOUT_WIDE'\n pptx.title = deck.title\n pptx.theme = {\n headFontFace: FONTS[look.theme.font].pptx,\n bodyFontFace: FONTS[look.theme.font].pptx,\n }\n\n const { width, height } = SLIDE_PIXELS\n const background = await canvasImage(width, height, (context) =>\n paintBackground(context, width, height, look.theme.background)\n )\n const logo = look.logo ? await loadImage(look.logo) : null\n const logoData = logo\n ? await canvasImage(logo.width, logo.height, (context) => context.drawImage(logo, 0, 0))\n : null\n\n const themeFont = FONTS[look.theme.font].pptx\n for (const slide of deck.slides) {\n const page = pptx.addSlide()\n // A slide's own background (an imported deck's): a plain colour stays a colour.\n if (slide.background?.color && !slide.background.gradient && !slide.background.image) {\n page.background = { color: hex(slide.background.color) }\n } else if (slide.background) {\n const own = slide.background\n page.background = {\n data: await canvasImage(width, height, (context) =>\n paintSlideBackground(context, width, height, own, look.media)\n ),\n }\n } else {\n page.background = { data: background }\n }\n if (slide.notes?.trim()) page.addNotes(slide.notes)\n const geometry = slideGeometry(slide, {\n labels: look.labels,\n logo: look.theme.logo?.corner ?? null,\n })\n for (const shape of slide.boxes) if (!shape.front) addBox(pptx, page, shape, themeFont)\n\n for (const item of slide.items) {\n const clip = deck.clips.find((entry) => entry.id === item.clipId)\n if (!clip) continue\n const frame = { ...item.frame, h: frameHeight(item.frame, clip.aspect) }\n if (clip.plain) {\n // Part of the slide's design: as it is, at its own resolution where it has one.\n const source = clip.kind === 'image' ? await createImageBitmap(clip.source) : null\n const scale = source ? Math.min(1, 2400 / Math.max(1, clip.rect.w * source.width)) : 1.5\n const pixels = source\n ? { w: clip.rect.w * source.width * scale, h: clip.rect.h * source.height * scale }\n : { w: frame.w * width * 1.5, h: frame.h * height * 1.5 }\n source?.close()\n const data = await canvasImage(pixels.w, pixels.h, (context) =>\n drawClip(context, clip, { x: 0, y: 0, width: pixels.w, height: pixels.h })\n )\n page.addImage({ data, ...box(frame), altText: clip.caption || clip.fileName })\n continue\n }\n const pixels = { w: frame.w * width * 1.5, h: frame.h * height * 1.5 }\n // Rounded as on the stage: the corners are transparent, so PowerPoint's shadow follows them.\n const data = await canvasImage(pixels.w, pixels.h, (context) =>\n drawRoundedClip(\n context,\n clip,\n { x: 0, y: 0, width: pixels.w, height: pixels.h },\n width * 1.5,\n false\n )\n )\n page.addImage({\n data,\n ...box(frame),\n altText: clip.caption,\n shadow: { type: 'outer', blur: 10, offset: 3, angle: 90, color: '000000', opacity: 0.45 },\n })\n const label = clipLabel(clip, look.columnValues)\n if (look.labels && label) {\n page.addText(label, {\n ...box({ x: frame.x, y: frame.y + frame.h + 0.008, w: frame.w, h: 0.045 }),\n fontFace: FONTS[look.theme.font].pptx,\n fontSize: toPoints(0.017),\n color: hex(TEXT_COLORS.muted),\n margin: 0,\n valign: 'top',\n fit: 'shrink',\n })\n }\n }\n\n const title = slide.caption.trim()\n if (title && geometry.title) {\n page.addText(title, textOptions(geometry.title, look))\n if (geometry.rule) {\n page.addShape(pptx.ShapeType.rect, {\n ...box(geometry.rule),\n fill: { color: hex(accentColor(look.theme.accent)) },\n line: { color: hex(accentColor(look.theme.accent)), width: 0 },\n })\n }\n }\n const lines = textLines(slide.points)\n if (geometry.text && lines.length) {\n const text = geometry.text\n page.addText(\n lines.map((line) => ({\n text: line,\n options: {\n breakLine: true,\n ...(text.bullets\n ? { bullet: { characterCode: '25A0', indent: toPoints(text.size) * 1.2 } }\n : {}),\n },\n })),\n {\n ...textOptions(text, look),\n ...(text.bullets ? { paraSpaceAfter: toPoints(text.size) * 0.45 } : {}),\n }\n )\n }\n\n for (const shape of slide.boxes) if (shape.front) addBox(pptx, page, shape, themeFont)\n\n if (geometry.logo && logo && logoData) {\n const area = box(geometry.logo)\n const scale = Math.min(area.w / logo.width, area.h / logo.height)\n const w = logo.width * scale\n const h = logo.height * scale\n page.addImage({\n data: logoData,\n x: geometry.logo.x < 0.5 ? area.x : area.x + area.w - w,\n y: area.y + area.h - h,\n w,\n h,\n transparency: 10,\n })\n }\n }\n\n const deckFile = (await pptx.write({ outputType: 'blob' })) as Blob\n return accentBullets(deckFile, accentColor(look.theme.accent))\n}\n\n/**\n * The bullets in the accent colour, as on the stage, and their squares the stage's size: PptxGenJS\n * has no option for either, so the slides' XML gets PowerPoint's own bullet colour and size.\n */\nasync function accentBullets(deck: Blob, accent: string): Promise<Blob> {\n const { default: JSZip } = await import('jszip')\n const zip = await JSZip.loadAsync(deck)\n const slides = Object.keys(zip.files).filter((name) => /^ppt\\/slides\\/slide\\d+\\.xml$/.test(name))\n for (const name of slides) {\n const xml = await zip.file(name)!.async('string')\n zip.file(\n name,\n xml.replaceAll(\n '<a:buSzPct val=\"100000\"/><a:buChar',\n `<a:buClr><a:srgbClr val=\"${hex(accent)}\"/></a:buClr><a:buSzPct val=\"70000\"/><a:buChar`\n )\n )\n }\n return zip.generateAsync({ type: 'blob', mimeType: deck.type || undefined })\n}\n"],
5
+ "mappings": ";AAQA,SAAS,WAAW,mBAA0C;AAC9D,SAAS,cAAc,UAAU,iBAAiB,iBAAiC;AACnF,SAAS,cAAc;AACvB,SAAS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AM,OAAO,OAAO;AAC/C,QAAM,MAAM,MAAM,MAAM,UAAU,IAAI;AACtC,QAAM,SAAS,OAAO,KAAK,IAAI,KAAK,EAAE,OAAO,CAAC,SAAS,+BAA+B,KAAK,IAAI,CAAC;AAChG,aAAW,QAAQ,QAAQ;AACzB,UAAM,MAAM,MAAM,IAAI,KAAK,IAAI,EAAG,MAAM,QAAQ;AAChD,QAAI;AAAA,MACF;AAAA,MACA,IAAI;AAAA,QACF;AAAA,QACA,4BAA4B,IAAI,MAAM,CAAC;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AACA,SAAO,IAAI,cAAc,EAAE,MAAM,QAAQ,UAAU,KAAK,QAAQ,OAAU,CAAC;AAC7E;",
6
+ "names": ["pixels", "data"]
7
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * A PowerPoint deck made elsewhere, as a presentation: each slide a blank (`free`) slide that looks
3
+ * as it did, with its words editable. Text boxes and placeholders become boxes (their position,
4
+ * size, rotation, fill, outline and text, the styles they inherit from the slide's layout and
5
+ * master resolved), pictures become clips of images embedded in the presentation, tables become a
6
+ * grid of boxes, and the background (the slide's, its layout's or its master's) the slide's own.
7
+ *
8
+ * What cannot be edited here (charts, SmartArt, embedded objects, shapes other than rectangles,
9
+ * rounded rectangles, ellipses and lines) is shown as it was: a clip of that area of the deck's own
10
+ * PDF (the one the backend makes of every PowerPoint file), so the slide still looks right.
11
+ * Speaker notes come along; animations and transitions do not (reported in `notes`).
12
+ *
13
+ * `slideFingerprints` reads what each slide shows (its words, its pictures and where things are):
14
+ * saved with a presentation, it tells, when the file is opened again, which slides were changed in
15
+ * PowerPoint since.
16
+ */
17
+ import type { SavedPresentation } from './persistence';
18
+ export interface ImportOptions {
19
+ /** The presentation's title (default: the deck's own, else "Presentation"). */
20
+ title?: string;
21
+ /** The deck as a document, and the version imported: what stands in for what cannot be edited. */
22
+ documentId?: string;
23
+ version?: number;
24
+ fileName?: string;
25
+ }
26
+ export interface ImportedDeck {
27
+ saved: SavedPresentation;
28
+ /** What did not come across as it was ("2 charts shown as pictures"). */
29
+ notes: string[];
30
+ /** Each slide's fingerprint (`slideFingerprints`). */
31
+ fingerprints: string[];
32
+ }
33
+ export declare function importPptx(bytes: Uint8Array, options?: ImportOptions): Promise<ImportedDeck>;
34
+ /** Each slide's fingerprint, in order (see the module's notes). */
35
+ export declare function slideFingerprints(bytes: Uint8Array | Blob): Promise<string[]>;