@arbidocs/blocks 0.5.119 → 0.5.121
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.
- package/dist/ClippingMediaViewer-B6WG7Q64.cjs +156 -0
- package/dist/ClippingMediaViewer-B6WG7Q64.cjs.map +1 -0
- package/dist/ClippingPdfViewer-6GCVTV3V.cjs +79 -0
- package/dist/ClippingPdfViewer-6GCVTV3V.cjs.map +1 -0
- package/dist/{ConnectedCallDock-WER7R222.cjs → ConnectedCallDock-DC5V5OUJ.cjs} +25 -23
- package/dist/ConnectedCallDock-DC5V5OUJ.cjs.map +1 -0
- package/dist/{ConnectedCallRoom-T7OBQTYP.cjs → ConnectedCallRoom-FQLXWTFB.cjs} +18 -16
- package/dist/{ConnectedCallRoom-T7OBQTYP.cjs.map → ConnectedCallRoom-FQLXWTFB.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-546ILGLW.cjs → ConnectedNativeDocxComparison-4Q5S7VLD.cjs} +17 -17
- package/dist/{ConnectedNativeDocxComparison-546ILGLW.cjs.map → ConnectedNativeDocxComparison-4Q5S7VLD.cjs.map} +1 -1
- package/dist/ConnectedPresentation-4HLDZDWV.cjs +183 -0
- package/dist/ConnectedPresentation-4HLDZDWV.cjs.map +1 -0
- package/dist/{ConnectedProductionSetDialog-LHB4VQWC.cjs → ConnectedProductionSetDialog-4EAY6KAZ.cjs} +3 -3
- package/dist/{ConnectedProductionSetDialog-LHB4VQWC.cjs.map → ConnectedProductionSetDialog-4EAY6KAZ.cjs.map} +1 -1
- package/dist/ConnectedSlidesTab-7QDE2CZD.cjs +234 -0
- package/dist/ConnectedSlidesTab-7QDE2CZD.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-S2ZFZLZQ.cjs → ConnectedStreamedWordArtifact-FFOQJBOI.cjs} +17 -17
- package/dist/{ConnectedStreamedWordArtifact-S2ZFZLZQ.cjs.map → ConnectedStreamedWordArtifact-FFOQJBOI.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-ZSBZBGFK.cjs → DocumentReviewCard-SNWVEZ7S.cjs} +19 -18
- package/dist/DocumentReviewCard-SNWVEZ7S.cjs.map +1 -0
- package/dist/{FilesViewerDialog-6UKR5WEF.cjs → FilesViewerDialog-IZI63FOV.cjs} +54 -47
- package/dist/FilesViewerDialog-IZI63FOV.cjs.map +1 -0
- package/dist/{GridViewImpl-ZMJJWTOM.cjs → GridViewImpl-LTYET77Q.cjs} +3 -3
- package/dist/GridViewImpl-LTYET77Q.cjs.map +1 -0
- package/dist/{WorkspaceTableView-J3C6VH4T.cjs → WorkspaceTableView-TEIRB6VJ.cjs} +11 -10
- package/dist/WorkspaceTableView-TEIRB6VJ.cjs.map +1 -0
- package/dist/agents/index.cjs +297 -297
- package/dist/agents/tasks/ConversationListView.js +10 -2
- package/dist/agents/tasks/ConversationListView.js.map +2 -2
- package/dist/agents/tasks/TaskTable.js +5 -4
- package/dist/agents/tasks/TaskTable.js.map +2 -2
- package/dist/agents/tasks/WorkflowsTable.js +4 -5
- package/dist/agents/tasks/WorkflowsTable.js.map +2 -2
- package/dist/agents/tasks/taskColumns.js +1 -1
- package/dist/agents/tasks/taskColumns.js.map +1 -1
- package/dist/agents/tasks/taskTableLabels.js +1 -1
- package/dist/agents/tasks/taskTableLabels.js.map +1 -1
- package/dist/agents/tasks/workflowTableLabels.js +1 -1
- package/dist/agents/tasks/workflowTableLabels.js.map +1 -1
- package/dist/{ai-IM4A23YT.cjs → ai-KBYNRNZ6.cjs} +28 -26
- package/dist/ai-KBYNRNZ6.cjs.map +1 -0
- package/dist/calls/connected/CallControls.d.ts +2 -0
- package/dist/calls/connected/CallControls.js +71 -9
- package/dist/calls/connected/CallControls.js.map +2 -2
- package/dist/calls/connected/ShareDocumentDialog.d.ts +14 -0
- package/dist/calls/connected/ShareDocumentDialog.js +77 -0
- package/dist/calls/connected/ShareDocumentDialog.js.map +7 -0
- package/dist/calls/index.cjs +121 -121
- package/dist/chat/index.cjs +9 -8
- package/dist/{chunk-T23UTIRI.cjs → chunk-2PZT3J34.cjs} +6 -6
- package/dist/{chunk-T23UTIRI.cjs.map → chunk-2PZT3J34.cjs.map} +1 -1
- package/dist/{chunk-SGYSDABK.cjs → chunk-2W5E62EY.cjs} +6 -6
- package/dist/{chunk-SGYSDABK.cjs.map → chunk-2W5E62EY.cjs.map} +1 -1
- package/dist/{chunk-TDO5UWXF.cjs → chunk-3SCNXNHI.cjs} +5 -5
- package/dist/{chunk-TDO5UWXF.cjs.map → chunk-3SCNXNHI.cjs.map} +1 -1
- package/dist/{chunk-KTQOGT2L.cjs → chunk-474GPLCM.cjs} +7 -7
- package/dist/{chunk-KTQOGT2L.cjs.map → chunk-474GPLCM.cjs.map} +1 -1
- package/dist/{chunk-TP5PGWIO.cjs → chunk-4IOYQLKG.cjs} +3 -3
- package/dist/{chunk-TP5PGWIO.cjs.map → chunk-4IOYQLKG.cjs.map} +1 -1
- package/dist/{chunk-NY3YUCOW.cjs → chunk-4NPCDS2X.cjs} +3 -3
- package/dist/{chunk-NY3YUCOW.cjs.map → chunk-4NPCDS2X.cjs.map} +1 -1
- package/dist/{chunk-CPG7II4E.cjs → chunk-4RBQ44RY.cjs} +28 -28
- package/dist/chunk-4RBQ44RY.cjs.map +1 -0
- package/dist/{chunk-BQ5RIWWT.cjs → chunk-4VZZWYEC.cjs} +3 -3
- package/dist/{chunk-BQ5RIWWT.cjs.map → chunk-4VZZWYEC.cjs.map} +1 -1
- package/dist/{chunk-Y24V6HPR.cjs → chunk-52KGMAO5.cjs} +15 -15
- package/dist/{chunk-Y24V6HPR.cjs.map → chunk-52KGMAO5.cjs.map} +1 -1
- package/dist/{chunk-HB2O4THB.cjs → chunk-5534FYXP.cjs} +4 -4
- package/dist/{chunk-HB2O4THB.cjs.map → chunk-5534FYXP.cjs.map} +1 -1
- package/dist/chunk-5GCCUXMT.cjs +63 -0
- package/dist/chunk-5GCCUXMT.cjs.map +1 -0
- package/dist/chunk-5LTIZ44D.cjs +95 -0
- package/dist/chunk-5LTIZ44D.cjs.map +1 -0
- package/dist/{chunk-YGXOKB5Z.cjs → chunk-734NPQNR.cjs} +4 -4
- package/dist/{chunk-YGXOKB5Z.cjs.map → chunk-734NPQNR.cjs.map} +1 -1
- package/dist/{chunk-SB4M3ITT.cjs → chunk-7VUJGHMY.cjs} +444 -100
- package/dist/chunk-7VUJGHMY.cjs.map +1 -0
- package/dist/chunk-AFQTQC7A.cjs +35 -0
- package/dist/chunk-AFQTQC7A.cjs.map +1 -0
- package/dist/{chunk-XKVPSOKP.cjs → chunk-AY6EZSZB.cjs} +4 -4
- package/dist/{chunk-XKVPSOKP.cjs.map → chunk-AY6EZSZB.cjs.map} +1 -1
- package/dist/{chunk-TT4IF52H.cjs → chunk-BVAT4EVC.cjs} +40 -41
- package/dist/chunk-BVAT4EVC.cjs.map +1 -0
- package/dist/{chunk-VGCTYTEW.cjs → chunk-C2OICDMI.cjs} +10 -10
- package/dist/{chunk-VGCTYTEW.cjs.map → chunk-C2OICDMI.cjs.map} +1 -1
- package/dist/{chunk-CPR6EHG7.cjs → chunk-DR2AH7JL.cjs} +179 -55
- package/dist/chunk-DR2AH7JL.cjs.map +1 -0
- package/dist/{chunk-NJCK6V6U.cjs → chunk-EATIFPKP.cjs} +4 -60
- package/dist/chunk-EATIFPKP.cjs.map +1 -0
- package/dist/{chunk-B3LZITVF.cjs → chunk-EHP6OH5D.cjs} +11 -451
- package/dist/chunk-EHP6OH5D.cjs.map +1 -0
- package/dist/{chunk-DDIW4HLU.cjs → chunk-ENGL7P3I.cjs} +46 -37
- package/dist/chunk-ENGL7P3I.cjs.map +1 -0
- package/dist/{chunk-QHOHDNBU.cjs → chunk-FKFQCK3C.cjs} +4 -4
- package/dist/{chunk-QHOHDNBU.cjs.map → chunk-FKFQCK3C.cjs.map} +1 -1
- package/dist/{chunk-6UTKM5AB.cjs → chunk-GKVE5JGB.cjs} +76 -76
- package/dist/chunk-GKVE5JGB.cjs.map +1 -0
- package/dist/{chunk-B2HNNG25.cjs → chunk-GPX5VC57.cjs} +50 -50
- package/dist/{chunk-B2HNNG25.cjs.map → chunk-GPX5VC57.cjs.map} +1 -1
- package/dist/{chunk-WAV762GP.cjs → chunk-GQXPNIRE.cjs} +6 -6
- package/dist/{chunk-WAV762GP.cjs.map → chunk-GQXPNIRE.cjs.map} +1 -1
- package/dist/chunk-GX2EBMJW.cjs +133 -0
- package/dist/chunk-GX2EBMJW.cjs.map +1 -0
- package/dist/{chunk-7OPOPYV6.cjs → chunk-H5OLHP2U.cjs} +3 -3
- package/dist/{chunk-7OPOPYV6.cjs.map → chunk-H5OLHP2U.cjs.map} +1 -1
- package/dist/chunk-HYUKPHCT.cjs +66 -0
- package/dist/chunk-HYUKPHCT.cjs.map +1 -0
- package/dist/{chunk-NNUK5ZM7.cjs → chunk-JQLWKNJO.cjs} +29 -27
- package/dist/chunk-JQLWKNJO.cjs.map +1 -0
- package/dist/{chunk-OEREKAAP.cjs → chunk-JZEYHDWJ.cjs} +75 -75
- package/dist/{chunk-OEREKAAP.cjs.map → chunk-JZEYHDWJ.cjs.map} +1 -1
- package/dist/{chunk-PGJYD67F.cjs → chunk-KNGZZC4O.cjs} +7 -6
- package/dist/chunk-KNGZZC4O.cjs.map +1 -0
- package/dist/{chunk-NIE3N6OM.cjs → chunk-KP5AITQ4.cjs} +10 -10
- package/dist/{chunk-NIE3N6OM.cjs.map → chunk-KP5AITQ4.cjs.map} +1 -1
- package/dist/{chunk-YYPZOEED.cjs → chunk-LHWOKOMP.cjs} +23 -2
- package/dist/chunk-LHWOKOMP.cjs.map +1 -0
- package/dist/{chunk-57NHXEU2.cjs → chunk-MXBXZXXQ.cjs} +5 -5
- package/dist/{chunk-57NHXEU2.cjs.map → chunk-MXBXZXXQ.cjs.map} +1 -1
- package/dist/{chunk-WXUU3COI.cjs → chunk-MZ2KZXNU.cjs} +3 -3
- package/dist/{chunk-WXUU3COI.cjs.map → chunk-MZ2KZXNU.cjs.map} +1 -1
- package/dist/chunk-NAJN32MF.cjs +154 -0
- package/dist/chunk-NAJN32MF.cjs.map +1 -0
- package/dist/{chunk-557MJ4IH.cjs → chunk-NLOETJCB.cjs} +17 -154
- package/dist/chunk-NLOETJCB.cjs.map +1 -0
- package/dist/{chunk-4XJEHKVZ.cjs → chunk-PIYYBPHH.cjs} +4 -4
- package/dist/{chunk-4XJEHKVZ.cjs.map → chunk-PIYYBPHH.cjs.map} +1 -1
- package/dist/chunk-Q3XJUXID.cjs +4774 -0
- package/dist/chunk-Q3XJUXID.cjs.map +1 -0
- package/dist/{chunk-325GVZE6.cjs → chunk-Q6DQGGP4.cjs} +3 -3
- package/dist/{chunk-325GVZE6.cjs.map → chunk-Q6DQGGP4.cjs.map} +1 -1
- package/dist/chunk-QFXILJMJ.cjs +458 -0
- package/dist/chunk-QFXILJMJ.cjs.map +1 -0
- package/dist/{chunk-R7CJEIA5.cjs → chunk-RYVZDFVO.cjs} +8 -9
- package/dist/chunk-RYVZDFVO.cjs.map +1 -0
- package/dist/{chunk-VLCY46K6.cjs → chunk-TG2GM7WJ.cjs} +4 -3
- package/dist/chunk-TG2GM7WJ.cjs.map +1 -0
- package/dist/{chunk-EOG6OT5I.cjs → chunk-TXP2N3DC.cjs} +4 -4
- package/dist/{chunk-EOG6OT5I.cjs.map → chunk-TXP2N3DC.cjs.map} +1 -1
- package/dist/{chunk-KXIRVKCJ.cjs → chunk-UUENH4BJ.cjs} +3 -3
- package/dist/{chunk-KXIRVKCJ.cjs.map → chunk-UUENH4BJ.cjs.map} +1 -1
- package/dist/chunk-VJ5ZLRBD.cjs +27 -0
- package/dist/chunk-VJ5ZLRBD.cjs.map +1 -0
- package/dist/{chunk-P77YTTJ3.cjs → chunk-W6B3RYTX.cjs} +4 -4
- package/dist/{chunk-P77YTTJ3.cjs.map → chunk-W6B3RYTX.cjs.map} +1 -1
- package/dist/chunk-WOOOMTTA.cjs +19 -0
- package/dist/chunk-WOOOMTTA.cjs.map +1 -0
- package/dist/{chunk-ZPPMAL5P.cjs → chunk-WQMR3O2D.cjs} +6 -10
- package/dist/chunk-WQMR3O2D.cjs.map +1 -0
- package/dist/{chunk-CJYWHUZR.cjs → chunk-XCKHOXRP.cjs} +4 -4
- package/dist/{chunk-CJYWHUZR.cjs.map → chunk-XCKHOXRP.cjs.map} +1 -1
- package/dist/{chunk-6WMMZLEV.cjs → chunk-XJEXFEWG.cjs} +2 -27
- package/dist/chunk-XJEXFEWG.cjs.map +1 -0
- package/dist/chunk-XK4TVJKD.cjs +73 -0
- package/dist/chunk-XK4TVJKD.cjs.map +1 -0
- package/dist/chunk-XTR26TNE.cjs +1358 -0
- package/dist/chunk-XTR26TNE.cjs.map +1 -0
- package/dist/{chunk-E7TE2WVT.cjs → chunk-ZVEW3JBT.cjs} +3 -3
- package/dist/{chunk-E7TE2WVT.cjs.map → chunk-ZVEW3JBT.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +73 -73
- package/dist/collaboration/sharing/ShareControl.js +10 -2
- package/dist/collaboration/sharing/ShareControl.js.map +2 -2
- package/dist/components/SharedCell.d.ts +2 -4
- package/dist/components/SharedCell.js +4 -8
- package/dist/components/SharedCell.js.map +2 -2
- package/dist/components/ZoomSlider.d.ts +25 -0
- package/dist/components/ZoomSlider.js +59 -0
- package/dist/components/ZoomSlider.js.map +7 -0
- package/dist/connect/docx.cjs +20 -20
- package/dist/connect/index.cjs +1210 -1264
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +42 -36
- package/dist/connection/ai.d.ts +1 -1
- package/dist/connection/facts/factPageColumns.js +3 -9
- package/dist/connection/facts/factPageColumns.js.map +2 -2
- package/dist/connection/files/ConnectedNewFileMenu.d.ts +2 -1
- package/dist/connection/files/ConnectedNewFileMenu.js +9 -3
- package/dist/connection/files/ConnectedNewFileMenu.js.map +2 -2
- package/dist/connection/files/explorer/ConnectedFilesExplorer.js +1 -1
- package/dist/connection/files/explorer/ConnectedFilesExplorer.js.map +2 -2
- package/dist/connection/files/explorer/FileTiles.js +1 -1
- package/dist/connection/files/explorer/FileTiles.js.map +2 -2
- package/dist/connection/files/fields/documentField.js +1 -1
- package/dist/connection/files/fields/documentField.js.map +2 -2
- package/dist/connection/files/grid/cells.js +1 -3
- package/dist/connection/files/grid/cells.js.map +2 -2
- package/dist/connection/files/grid/documentColumns.js +4 -3
- package/dist/connection/files/grid/documentColumns.js.map +2 -2
- package/dist/connection/files/page/DocumentsFilterBarActions.js +17 -28
- package/dist/connection/files/page/DocumentsFilterBarActions.js.map +2 -2
- package/dist/connection/mail/useMailboxDefaults.js +1 -1
- package/dist/connection/mail/useMailboxDefaults.js.map +2 -2
- package/dist/connection/panels/useSessionPanelMode.js +3 -2
- package/dist/connection/panels/useSessionPanelMode.js.map +2 -2
- package/dist/connection/presentation/ClippingMediaViewer.d.ts +12 -0
- package/dist/connection/presentation/ClippingMediaViewer.js +153 -0
- package/dist/connection/presentation/ClippingMediaViewer.js.map +7 -0
- package/dist/connection/presentation/ClippingPdfViewer.d.ts +22 -0
- package/dist/connection/presentation/ClippingPdfViewer.js +75 -0
- package/dist/connection/presentation/ClippingPdfViewer.js.map +7 -0
- package/dist/connection/presentation/ConnectedPresentation.d.ts +12 -0
- package/dist/connection/presentation/ConnectedPresentation.js +100 -0
- package/dist/connection/presentation/ConnectedPresentation.js.map +7 -0
- package/dist/connection/presentation/ConnectedSlidesTab.d.ts +20 -0
- package/dist/connection/presentation/ConnectedSlidesTab.js +220 -0
- package/dist/connection/presentation/ConnectedSlidesTab.js.map +7 -0
- package/dist/connection/presentation/CropClipDialog.d.ts +11 -0
- package/dist/connection/presentation/CropClipDialog.js +86 -0
- package/dist/connection/presentation/CropClipDialog.js.map +7 -0
- package/dist/connection/presentation/GenerateTile.d.ts +4 -0
- package/dist/connection/presentation/GenerateTile.js +24 -0
- package/dist/connection/presentation/GenerateTile.js.map +7 -0
- package/dist/connection/presentation/LabelColumnMenu.d.ts +8 -0
- package/dist/connection/presentation/LabelColumnMenu.js +38 -0
- package/dist/connection/presentation/LabelColumnMenu.js.map +7 -0
- package/dist/connection/presentation/PresentationDialogs.d.ts +39 -0
- package/dist/connection/presentation/PresentationDialogs.js +295 -0
- package/dist/connection/presentation/PresentationDialogs.js.map +7 -0
- package/dist/connection/presentation/PresentationFileCard.d.ts +10 -0
- package/dist/connection/presentation/PresentationFileCard.js +35 -0
- package/dist/connection/presentation/PresentationFileCard.js.map +7 -0
- package/dist/connection/presentation/PresentationPill.d.ts +8 -0
- package/dist/connection/presentation/PresentationPill.js +44 -0
- package/dist/connection/presentation/PresentationPill.js.map +7 -0
- package/dist/connection/presentation/PresentationSlot.d.ts +7 -0
- package/dist/connection/presentation/PresentationSlot.js +35 -0
- package/dist/connection/presentation/PresentationSlot.js.map +7 -0
- package/dist/connection/presentation/requests.d.ts +16 -0
- package/dist/connection/presentation/requests.js +20 -0
- package/dist/connection/presentation/requests.js.map +7 -0
- package/dist/connection/presentation/useImageGeneration.d.ts +11 -0
- package/dist/connection/presentation/useImageGeneration.js +66 -0
- package/dist/connection/presentation/useImageGeneration.js.map +7 -0
- package/dist/connection/presentation/useLabelColumns.d.ts +15 -0
- package/dist/connection/presentation/useLabelColumns.js +33 -0
- package/dist/connection/presentation/useLabelColumns.js.map +7 -0
- package/dist/connection/presentation/usePresentationController.d.ts +15 -0
- package/dist/connection/presentation/usePresentationController.js +118 -0
- package/dist/connection/presentation/usePresentationController.js.map +7 -0
- package/dist/connection/presentation/usePresentationFiles.d.ts +44 -0
- package/dist/connection/presentation/usePresentationFiles.js +307 -0
- package/dist/connection/presentation/usePresentationFiles.js.map +7 -0
- package/dist/connection/presentation/useViewerClipping.d.ts +14 -0
- package/dist/connection/presentation/useViewerClipping.js +18 -0
- package/dist/connection/presentation/useViewerClipping.js.map +7 -0
- package/dist/connection/sharing/WorkspaceMembersList.d.ts +4 -0
- package/dist/connection/sharing/WorkspaceMembersList.js +34 -0
- package/dist/connection/sharing/WorkspaceMembersList.js.map +7 -0
- package/dist/connection/shell/ConnectedAppShell.js +9 -1
- package/dist/connection/shell/ConnectedAppShell.js.map +2 -2
- package/dist/connection/viewer/CleanViewControl.d.ts +8 -0
- package/dist/connection/viewer/CleanViewControl.js +76 -0
- package/dist/connection/viewer/CleanViewControl.js.map +7 -0
- package/dist/connection/viewer/ConnectedDocumentViewer.js +31 -31
- package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
- package/dist/connection/viewer/ViewerCropModal.d.ts +5 -0
- package/dist/connection/viewer/ViewerCropModal.js +22 -0
- package/dist/connection/viewer/ViewerCropModal.js.map +7 -0
- package/dist/connection/viewer/ViewerPdfPane.d.ts +3 -1
- package/dist/connection/viewer/ViewerPdfPane.js +57 -2
- package/dist/connection/viewer/ViewerPdfPane.js.map +2 -2
- package/dist/connection/viewer/drafts.js +6 -4
- package/dist/connection/viewer/drafts.js.map +2 -2
- package/dist/connection/viewer/pdf/PdfPassageHighlights.d.ts +12 -0
- package/dist/connection/viewer/pdf/PdfPassageHighlights.js +36 -0
- package/dist/connection/viewer/pdf/PdfPassageHighlights.js.map +7 -0
- package/dist/connection/viewer/pdf/passageHighlights.d.ts +26 -0
- package/dist/connection/viewer/pdf/passageHighlights.js +40 -0
- package/dist/connection/viewer/pdf/passageHighlights.js.map +7 -0
- package/dist/connection/viewer/pdf/usePdfPassageHighlights.d.ts +9 -0
- package/dist/connection/viewer/pdf/usePdfPassageHighlights.js +47 -0
- package/dist/connection/viewer/pdf/usePdfPassageHighlights.js.map +7 -0
- package/dist/connection/viewer/shareDocument.d.ts +11 -0
- package/dist/connection/viewer/shareDocument.js +11 -0
- package/dist/connection/viewer/shareDocument.js.map +7 -0
- package/dist/connection/viewer/slidesTabChunk.d.ts +2 -0
- package/dist/connection/viewer/slidesTabChunk.js +9 -0
- package/dist/connection/viewer/slidesTabChunk.js.map +7 -0
- package/dist/connection/viewer/useCleanView.d.ts +14 -0
- package/dist/connection/viewer/useCleanView.js +29 -0
- package/dist/connection/viewer/useCleanView.js.map +7 -0
- package/dist/connection/viewer/useViewedDocument.d.ts +1 -0
- package/dist/connection/viewer/useViewedDocument.js +9 -1
- package/dist/connection/viewer/useViewedDocument.js.map +2 -2
- package/dist/connection/viewer/useViewerTabs.js +18 -4
- package/dist/connection/viewer/useViewerTabs.js.map +2 -2
- package/dist/connection/workflows/ConnectedWorkflowStart.d.ts +14 -2
- package/dist/connection/workflows/ConnectedWorkflowStart.js +5 -2
- package/dist/connection/workflows/ConnectedWorkflowStart.js.map +2 -2
- package/dist/connection/workflows/workflowsPageLabels.js +1 -1
- package/dist/connection/workflows/workflowsPageLabels.js.map +1 -1
- package/dist/dashboards/index.cjs +1 -1
- package/dist/databases/index.cjs +49 -49
- package/dist/document-tools/DocumentToolButtons.d.ts +2 -0
- package/dist/document-tools/DocumentToolButtons.js +22 -1
- package/dist/document-tools/DocumentToolButtons.js.map +2 -2
- package/dist/document-tools/index.cjs +16 -12
- package/dist/document-tools/index.d.ts +1 -1
- package/dist/document-tools/index.js +2 -0
- package/dist/document-tools/index.js.map +2 -2
- package/dist/embed/index.cjs +43 -41
- package/dist/facts/factColumns.js +3 -3
- package/dist/facts/factColumns.js.map +1 -1
- package/dist/facts/index.cjs +42 -42
- package/dist/files/GridViewImpl.js +1 -1
- package/dist/files/GridViewImpl.js.map +2 -2
- package/dist/files/HtmlViewerParts.js +7 -15
- package/dist/files/HtmlViewerParts.js.map +2 -2
- package/dist/files/ViewerChrome.d.ts +5 -1
- package/dist/files/ViewerChrome.js +16 -6
- package/dist/files/ViewerChrome.js.map +2 -2
- package/dist/files/index.cjs +226 -226
- package/dist/files/navigator/DocumentSearchList.js +1 -1
- package/dist/files/navigator/DocumentSearchList.js.map +2 -2
- package/dist/index.cjs +1668 -1666
- package/dist/index.cjs.map +1 -1
- package/dist/presentation/BoxActionBar.d.ts +11 -0
- package/dist/presentation/BoxActionBar.js +182 -0
- package/dist/presentation/BoxActionBar.js.map +7 -0
- package/dist/presentation/ClipActionBar.d.ts +26 -0
- package/dist/presentation/ClipActionBar.js +103 -0
- package/dist/presentation/ClipActionBar.js.map +7 -0
- package/dist/presentation/ClipCaptureOverlay.d.ts +14 -0
- package/dist/presentation/ClipCaptureOverlay.js +69 -0
- package/dist/presentation/ClipCaptureOverlay.js.map +7 -0
- package/dist/presentation/ClipImage.d.ts +21 -0
- package/dist/presentation/ClipImage.js +119 -0
- package/dist/presentation/ClipImage.js.map +7 -0
- package/dist/presentation/ClipTray.d.ts +11 -0
- package/dist/presentation/ClipTray.js +152 -0
- package/dist/presentation/ClipTray.js.map +7 -0
- package/dist/presentation/ClipViewControls.d.ts +11 -0
- package/dist/presentation/ClipViewControls.js +142 -0
- package/dist/presentation/ClipViewControls.js.map +7 -0
- package/dist/presentation/DesignMenu.d.ts +8 -0
- package/dist/presentation/DesignMenu.js +199 -0
- package/dist/presentation/DesignMenu.js.map +7 -0
- package/dist/presentation/LayoutMenu.d.ts +17 -0
- package/dist/presentation/LayoutMenu.js +122 -0
- package/dist/presentation/LayoutMenu.js.map +7 -0
- package/dist/presentation/MediaClip.d.ts +15 -0
- package/dist/presentation/MediaClip.js +67 -0
- package/dist/presentation/MediaClip.js.map +7 -0
- package/dist/presentation/Notice.d.ts +6 -0
- package/dist/presentation/Notice.js +43 -0
- package/dist/presentation/Notice.js.map +7 -0
- package/dist/presentation/PresentationStage.d.ts +32 -0
- package/dist/presentation/PresentationStage.js +232 -0
- package/dist/presentation/PresentationStage.js.map +7 -0
- package/dist/presentation/PresenterView.d.ts +16 -0
- package/dist/presentation/PresenterView.js +69 -0
- package/dist/presentation/PresenterView.js.map +7 -0
- package/dist/presentation/SlideDecor.d.ts +25 -0
- package/dist/presentation/SlideDecor.js +189 -0
- package/dist/presentation/SlideDecor.js.map +7 -0
- package/dist/presentation/SlidesEditor.d.ts +25 -0
- package/dist/presentation/SlidesEditor.js +359 -0
- package/dist/presentation/SlidesEditor.js.map +7 -0
- package/dist/presentation/StageBox.d.ts +30 -0
- package/dist/presentation/StageBox.js +281 -0
- package/dist/presentation/StageBox.js.map +7 -0
- package/dist/presentation/StageItem.d.ts +37 -0
- package/dist/presentation/StageItem.js +211 -0
- package/dist/presentation/StageItem.js.map +7 -0
- package/dist/presentation/box-style.d.ts +6 -0
- package/dist/presentation/box-style.js +19 -0
- package/dist/presentation/box-style.js.map +7 -0
- package/dist/presentation/boxes.d.ts +105 -0
- package/dist/presentation/boxes.js +103 -0
- package/dist/presentation/boxes.js.map +7 -0
- package/dist/presentation/draw-boxes.d.ts +8 -0
- package/dist/presentation/draw-boxes.js +130 -0
- package/dist/presentation/draw-boxes.js.map +7 -0
- package/dist/presentation/export-boxes.d.ts +10 -0
- package/dist/presentation/export-boxes.js +74 -0
- package/dist/presentation/export-boxes.js.map +7 -0
- package/dist/presentation/export-pptx.d.ts +16 -0
- package/dist/presentation/export-pptx.js +194 -0
- package/dist/presentation/export-pptx.js.map +7 -0
- package/dist/presentation/import-pptx.d.ts +35 -0
- package/dist/presentation/import-pptx.js +659 -0
- package/dist/presentation/import-pptx.js.map +7 -0
- package/dist/presentation/merge-outside-edits.d.ts +12 -0
- package/dist/presentation/merge-outside-edits.js +35 -0
- package/dist/presentation/merge-outside-edits.js.map +7 -0
- package/dist/presentation/model.d.ts +201 -0
- package/dist/presentation/model.js +271 -0
- package/dist/presentation/model.js.map +7 -0
- package/dist/presentation/panel-id.d.ts +34 -0
- package/dist/presentation/panel-id.js +24 -0
- package/dist/presentation/panel-id.js.map +7 -0
- package/dist/presentation/persistence.d.ts +121 -0
- package/dist/presentation/persistence.js +141 -0
- package/dist/presentation/persistence.js.map +7 -0
- package/dist/presentation/pptx-data.d.ts +22 -0
- package/dist/presentation/pptx-data.js +83 -0
- package/dist/presentation/pptx-data.js.map +7 -0
- package/dist/presentation/pptx-xml.d.ts +90 -0
- package/dist/presentation/pptx-xml.js +333 -0
- package/dist/presentation/pptx-xml.js.map +7 -0
- package/dist/presentation/render-slides.d.ts +58 -0
- package/dist/presentation/render-slides.js +309 -0
- package/dist/presentation/render-slides.js.map +7 -0
- package/dist/presentation/saved-boxes.d.ts +11 -0
- package/dist/presentation/saved-boxes.js +80 -0
- package/dist/presentation/saved-boxes.js.map +7 -0
- package/dist/presentation/slide-layout.d.ts +54 -0
- package/dist/presentation/slide-layout.js +117 -0
- package/dist/presentation/slide-layout.js.map +7 -0
- package/dist/presentation/stage-videos.d.ts +5 -0
- package/dist/presentation/stage-videos.js +19 -0
- package/dist/presentation/stage-videos.js.map +7 -0
- package/dist/presentation/store.d.ts +203 -0
- package/dist/presentation/store.js +429 -0
- package/dist/presentation/store.js.map +7 -0
- package/dist/presentation/theme.d.ts +102 -0
- package/dist/presentation/theme.js +276 -0
- package/dist/presentation/theme.js.map +7 -0
- package/dist/presentation/useClipDrag.d.ts +26 -0
- package/dist/presentation/useClipDrag.js +65 -0
- package/dist/presentation/useClipDrag.js.map +7 -0
- package/dist/presentation/useObjectUrl.d.ts +6 -0
- package/dist/presentation/useObjectUrl.js +15 -0
- package/dist/presentation/useObjectUrl.js.map +7 -0
- package/dist/presentation/usePresenterKeys.d.ts +13 -0
- package/dist/presentation/usePresenterKeys.js +62 -0
- package/dist/presentation/usePresenterKeys.js.map +7 -0
- package/dist/settings/index.cjs +151 -150
- package/dist/shell/PanelPortal.js +1 -0
- package/dist/shell/PanelPortal.js.map +2 -2
- package/dist/shell/index.cjs +112 -110
- package/dist/shell/panel-windows.d.ts +2 -0
- package/dist/shell/panel-windows.js +7 -2
- package/dist/shell/panel-windows.js.map +2 -2
- package/dist/studio/index.cjs +28 -26
- package/dist/studio/index.cjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +58 -57
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +6 -5
- package/dist/ConnectedCallDock-WER7R222.cjs.map +0 -1
- package/dist/DocumentReviewCard-ZSBZBGFK.cjs.map +0 -1
- package/dist/FilesViewerDialog-6UKR5WEF.cjs.map +0 -1
- package/dist/GridViewImpl-ZMJJWTOM.cjs.map +0 -1
- package/dist/WorkspaceTableView-J3C6VH4T.cjs.map +0 -1
- package/dist/ai-IM4A23YT.cjs.map +0 -1
- package/dist/chunk-557MJ4IH.cjs.map +0 -1
- package/dist/chunk-6UTKM5AB.cjs.map +0 -1
- package/dist/chunk-6WMMZLEV.cjs.map +0 -1
- package/dist/chunk-B3LZITVF.cjs.map +0 -1
- package/dist/chunk-CPG7II4E.cjs.map +0 -1
- package/dist/chunk-CPR6EHG7.cjs.map +0 -1
- package/dist/chunk-DDIW4HLU.cjs.map +0 -1
- package/dist/chunk-NJCK6V6U.cjs.map +0 -1
- package/dist/chunk-NNUK5ZM7.cjs.map +0 -1
- package/dist/chunk-PGJYD67F.cjs.map +0 -1
- package/dist/chunk-R7CJEIA5.cjs.map +0 -1
- package/dist/chunk-SB4M3ITT.cjs.map +0 -1
- package/dist/chunk-TT4IF52H.cjs.map +0 -1
- package/dist/chunk-VLCY46K6.cjs.map +0 -1
- package/dist/chunk-YYPZOEED.cjs.map +0 -1
- package/dist/chunk-ZPPMAL5P.cjs.map +0 -1
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { SLIDE_POINTS } from "./boxes.js";
|
|
3
|
+
import { STAGE_ASPECT } from "./model.js";
|
|
4
|
+
import { DEFAULT_THEME } from "./theme.js";
|
|
5
|
+
import {
|
|
6
|
+
EMU_PER_POINT,
|
|
7
|
+
Package,
|
|
8
|
+
boolAttr,
|
|
9
|
+
colorIn,
|
|
10
|
+
kid,
|
|
11
|
+
kids,
|
|
12
|
+
mediaDataUrl,
|
|
13
|
+
numAttr,
|
|
14
|
+
path,
|
|
15
|
+
readFill,
|
|
16
|
+
readLine,
|
|
17
|
+
readTheme,
|
|
18
|
+
relAttr,
|
|
19
|
+
typefaceOf
|
|
20
|
+
} from "./pptx-xml.js";
|
|
21
|
+
const IDENTITY = { sx: 1, sy: 1, ox: 0, oy: 0 };
|
|
22
|
+
const TITLE_TYPES = /* @__PURE__ */ new Set(["title", "ctrTitle"]);
|
|
23
|
+
const FOOTER_TYPES = /* @__PURE__ */ new Set(["dt", "ftr", "sldNum", "hdr"]);
|
|
24
|
+
function placeholderOf(shape) {
|
|
25
|
+
const nv = kids(shape).find((child) => child.localName.startsWith("nv"));
|
|
26
|
+
const ph = path(nv, "nvPr", "ph");
|
|
27
|
+
if (!ph) return null;
|
|
28
|
+
return { type: ph.getAttribute("type") ?? "body", idx: ph.getAttribute("idx") };
|
|
29
|
+
}
|
|
30
|
+
function findPlaceholder(tree, ph, master) {
|
|
31
|
+
const shapes = kids(tree).filter((child) => child.localName === "sp");
|
|
32
|
+
const typeOf = (type) => master ? TITLE_TYPES.has(type) ? "title" : FOOTER_TYPES.has(type) ? type : "body" : type;
|
|
33
|
+
if (!master && ph.idx !== null) {
|
|
34
|
+
const byIdx = shapes.find((shape) => placeholderOf(shape)?.idx === ph.idx);
|
|
35
|
+
if (byIdx) return byIdx;
|
|
36
|
+
}
|
|
37
|
+
const wanted = typeOf(ph.type);
|
|
38
|
+
return shapes.find((shape) => {
|
|
39
|
+
const other = placeholderOf(shape);
|
|
40
|
+
return other !== null && typeOf(other.type) === wanted;
|
|
41
|
+
}) ?? null;
|
|
42
|
+
}
|
|
43
|
+
const ALIGN = { l: "left", ctr: "center", r: "right", just: "justify" };
|
|
44
|
+
function readRunProps(rPr, theme) {
|
|
45
|
+
if (!rPr) return {};
|
|
46
|
+
const style = {};
|
|
47
|
+
if (rPr.hasAttribute("sz")) style.size = numAttr(rPr, "sz") / 100;
|
|
48
|
+
const b = boolAttr(rPr, "b");
|
|
49
|
+
if (b !== void 0) style.bold = b;
|
|
50
|
+
const i = boolAttr(rPr, "i");
|
|
51
|
+
if (i !== void 0) style.italic = i;
|
|
52
|
+
const u = rPr.getAttribute("u");
|
|
53
|
+
if (u) style.underline = u !== "none";
|
|
54
|
+
const fill = readFill(rPr, theme);
|
|
55
|
+
if (fill?.kind === "solid") style.color = fill.color;
|
|
56
|
+
else if (fill?.kind === "gradient") style.color = fill.from;
|
|
57
|
+
const font = typefaceOf(kid(rPr, "latin")?.getAttribute("typeface"), theme);
|
|
58
|
+
if (font) style.font = font;
|
|
59
|
+
return style;
|
|
60
|
+
}
|
|
61
|
+
function readLevel(pPr, theme) {
|
|
62
|
+
if (!pPr) return {};
|
|
63
|
+
const style = { ...readRunProps(kid(pPr, "defRPr"), theme) };
|
|
64
|
+
const algn = pPr.getAttribute("algn");
|
|
65
|
+
if (algn && ALIGN[algn]) style.align = ALIGN[algn];
|
|
66
|
+
if (kid(pPr, "buNone")) style.bullet = false;
|
|
67
|
+
else if (kid(pPr, "buChar") || kid(pPr, "buAutoNum") || kid(pPr, "buBlip")) style.bullet = true;
|
|
68
|
+
return style;
|
|
69
|
+
}
|
|
70
|
+
function merge(styles) {
|
|
71
|
+
const out = {};
|
|
72
|
+
for (const style of styles) {
|
|
73
|
+
for (const key of Object.keys(style)) {
|
|
74
|
+
if (out[key] === void 0 && style[key] !== void 0) {
|
|
75
|
+
;
|
|
76
|
+
out[key] = style[key];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
function levelStyle(chain, level, theme) {
|
|
83
|
+
return merge(chain.map((list) => readLevel(kid(list, `lvl${level + 1}pPr`), theme)));
|
|
84
|
+
}
|
|
85
|
+
const note = (deck, text) => deck.notes.set(text, (deck.notes.get(text) ?? 0) + 1);
|
|
86
|
+
function hash(text) {
|
|
87
|
+
let h = 2166136261;
|
|
88
|
+
for (let i = 0; i < text.length; i++) {
|
|
89
|
+
h ^= text.charCodeAt(i);
|
|
90
|
+
h = Math.imul(h, 16777619);
|
|
91
|
+
}
|
|
92
|
+
return (h >>> 0).toString(36);
|
|
93
|
+
}
|
|
94
|
+
async function mediaKey(deck, part) {
|
|
95
|
+
if (deck.mediaKeys.has(part)) return deck.mediaKeys.get(part) ?? null;
|
|
96
|
+
const url = await mediaDataUrl(deck.pkg, part);
|
|
97
|
+
const key = url ? `m${hash(url)}` : null;
|
|
98
|
+
if (url && key) deck.media[key] = url;
|
|
99
|
+
deck.mediaKeys.set(part, key);
|
|
100
|
+
return key;
|
|
101
|
+
}
|
|
102
|
+
function areaOf(xfrm, transform) {
|
|
103
|
+
const off = kid(xfrm, "off");
|
|
104
|
+
const ext = kid(xfrm, "ext");
|
|
105
|
+
if (!off || !ext) return null;
|
|
106
|
+
return {
|
|
107
|
+
x: transform.ox + numAttr(off, "x") * transform.sx,
|
|
108
|
+
y: transform.oy + numAttr(off, "y") * transform.sy,
|
|
109
|
+
w: numAttr(ext, "cx") * transform.sx,
|
|
110
|
+
h: numAttr(ext, "cy") * transform.sy,
|
|
111
|
+
rotation: numAttr(xfrm, "rot") / 6e4,
|
|
112
|
+
flipH: boolAttr(xfrm, "flipH") === true,
|
|
113
|
+
flipV: boolAttr(xfrm, "flipV") === true
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function stageFrame(deck, area) {
|
|
117
|
+
const { cx, cy } = deck.slideSize;
|
|
118
|
+
const { place } = deck;
|
|
119
|
+
return {
|
|
120
|
+
x: place.x + area.x / cx * place.w,
|
|
121
|
+
y: place.y + area.y / cy * place.h,
|
|
122
|
+
w: area.w / cx * place.w,
|
|
123
|
+
h: area.h / cy * place.h
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const hexOf = (color) => color.hex;
|
|
127
|
+
function renditionClip(deck, part, area, what) {
|
|
128
|
+
const { documentId, version, fileName } = deck.options;
|
|
129
|
+
if (!documentId || part.page === null) {
|
|
130
|
+
note(deck, `${what} could not be shown`);
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const { cx, cy } = deck.slideSize;
|
|
134
|
+
const clamp = (v) => Math.min(1, Math.max(0, v));
|
|
135
|
+
const x = clamp(area.x / cx);
|
|
136
|
+
const y = clamp(area.y / cy);
|
|
137
|
+
const rect = { x, y, w: clamp((area.x + area.w) / cx) - x, h: clamp((area.y + area.h) / cy) - y };
|
|
138
|
+
if (rect.w <= 0 || rect.h <= 0) return null;
|
|
139
|
+
const frame = stageFrame(deck, area);
|
|
140
|
+
note(deck, `${what} shown as a picture`);
|
|
141
|
+
deck.clips.push({
|
|
142
|
+
kind: "pdf",
|
|
143
|
+
documentId,
|
|
144
|
+
...version !== void 0 ? { version } : {},
|
|
145
|
+
fileName: fileName ?? "Presentation.pptx",
|
|
146
|
+
page: part.page,
|
|
147
|
+
rect,
|
|
148
|
+
aspect: frame.w * STAGE_ASPECT / Math.max(frame.h, 1e-6),
|
|
149
|
+
caption: "",
|
|
150
|
+
plain: true
|
|
151
|
+
});
|
|
152
|
+
return deck.clips.length - 1;
|
|
153
|
+
}
|
|
154
|
+
function readParagraphs(body, chain, deck, defaults, fontScale, fallback = []) {
|
|
155
|
+
const { theme } = deck;
|
|
156
|
+
const paragraphs = [];
|
|
157
|
+
for (const p of kids(body, "p")) {
|
|
158
|
+
const pPr = kid(p, "pPr");
|
|
159
|
+
const level = Math.min(8, numAttr(pPr, "lvl"));
|
|
160
|
+
const own = readLevel(pPr, theme);
|
|
161
|
+
const style = merge([
|
|
162
|
+
own,
|
|
163
|
+
levelStyle(chain, level, theme),
|
|
164
|
+
defaults.color ? { color: defaults.color } : {},
|
|
165
|
+
levelStyle(fallback, level, theme)
|
|
166
|
+
]);
|
|
167
|
+
const runStyle = (rPr) => {
|
|
168
|
+
const s = merge([readRunProps(rPr, theme), style]);
|
|
169
|
+
const color = s.color ?? defaults.base;
|
|
170
|
+
return {
|
|
171
|
+
text: "",
|
|
172
|
+
size: Math.round((s.size ?? 18) * fontScale * deck.pointScale * 10) / 10,
|
|
173
|
+
...s.bold ? { bold: true } : {},
|
|
174
|
+
...s.italic ? { italic: true } : {},
|
|
175
|
+
...s.underline ? { underline: true } : {},
|
|
176
|
+
...color ? { color: hexOf(color) } : {},
|
|
177
|
+
font: s.font ?? theme.minorFont
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
const shape = (runs2) => ({
|
|
181
|
+
runs: runs2,
|
|
182
|
+
...style.align && style.align !== "left" ? { align: style.align } : {},
|
|
183
|
+
...level ? { level } : {},
|
|
184
|
+
...style.bullet && runs2.some((run) => run.text.trim()) ? { bullet: true } : {}
|
|
185
|
+
});
|
|
186
|
+
let runs = [];
|
|
187
|
+
for (const child of kids(p)) {
|
|
188
|
+
if (child.localName === "r" || child.localName === "fld") {
|
|
189
|
+
const text = kid(child, "t")?.textContent ?? "";
|
|
190
|
+
runs.push({ ...runStyle(kid(child, "rPr")), text });
|
|
191
|
+
} else if (child.localName === "br") {
|
|
192
|
+
paragraphs.push(shape(runs.length ? runs : [{ ...runStyle(kid(child, "rPr")), text: "" }]));
|
|
193
|
+
runs = [];
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (!runs.length) runs = [{ ...runStyle(kid(p, "endParaRPr")), text: "" }];
|
|
197
|
+
paragraphs.push(shape(runs));
|
|
198
|
+
}
|
|
199
|
+
while (paragraphs.length > 1 && !paragraphs[paragraphs.length - 1].runs.some((run) => run.text.trim())) {
|
|
200
|
+
paragraphs.pop();
|
|
201
|
+
}
|
|
202
|
+
return paragraphs;
|
|
203
|
+
}
|
|
204
|
+
const SHAPES = {
|
|
205
|
+
rect: "rect",
|
|
206
|
+
flowChartProcess: "rect",
|
|
207
|
+
snip1Rect: "rect",
|
|
208
|
+
roundRect: "roundRect",
|
|
209
|
+
round1Rect: "roundRect",
|
|
210
|
+
round2SameRect: "roundRect",
|
|
211
|
+
flowChartAlternateProcess: "roundRect",
|
|
212
|
+
ellipse: "ellipse",
|
|
213
|
+
flowChartConnector: "ellipse",
|
|
214
|
+
line: "line",
|
|
215
|
+
straightConnector1: "line"
|
|
216
|
+
};
|
|
217
|
+
async function readShape(shape, transform, deck, part, inherit, built) {
|
|
218
|
+
const { theme } = deck;
|
|
219
|
+
const name = shape.localName;
|
|
220
|
+
if (name === "AlternateContent") {
|
|
221
|
+
const choice = kid(shape, "Fallback") ?? kid(shape, "Choice");
|
|
222
|
+
for (const child of kids(choice)) await readShape(child, transform, deck, part, inherit, built);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (name === "grpSp") {
|
|
226
|
+
const xfrm2 = path(shape, "grpSpPr", "xfrm");
|
|
227
|
+
const off = kid(xfrm2, "off");
|
|
228
|
+
const ext = kid(xfrm2, "ext");
|
|
229
|
+
const chOff = kid(xfrm2, "chOff");
|
|
230
|
+
const chExt = kid(xfrm2, "chExt");
|
|
231
|
+
let inner = transform;
|
|
232
|
+
if (off && ext && chOff && chExt) {
|
|
233
|
+
const sx = numAttr(chExt, "cx") ? numAttr(ext, "cx") / numAttr(chExt, "cx") : 1;
|
|
234
|
+
const sy = numAttr(chExt, "cy") ? numAttr(ext, "cy") / numAttr(chExt, "cy") : 1;
|
|
235
|
+
inner = {
|
|
236
|
+
sx: transform.sx * sx,
|
|
237
|
+
sy: transform.sy * sy,
|
|
238
|
+
ox: transform.ox + (numAttr(off, "x") - numAttr(chOff, "x") * sx) * transform.sx,
|
|
239
|
+
oy: transform.oy + (numAttr(off, "y") - numAttr(chOff, "y") * sy) * transform.sy
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
for (const child of kids(shape)) await readShape(child, inner, deck, part, inherit, built);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const ph = name === "sp" || name === "pic" ? placeholderOf(shape) : null;
|
|
246
|
+
if (ph && !inherit) return;
|
|
247
|
+
if (ph && FOOTER_TYPES.has(ph.type)) return;
|
|
248
|
+
const layoutPh = ph && inherit ? findPlaceholder(inherit.layoutTree, ph, false) : null;
|
|
249
|
+
const masterPh = ph && inherit ? findPlaceholder(inherit.masterTree, ph, true) : null;
|
|
250
|
+
const spPr = kid(shape, name === "graphicFrame" ? "xfrm" : "spPr");
|
|
251
|
+
const xfrm = name === "graphicFrame" ? kid(shape, "xfrm") : kid(spPr, "xfrm") ?? path(layoutPh, "spPr", "xfrm") ?? path(masterPh, "spPr", "xfrm");
|
|
252
|
+
const area = areaOf(xfrm, transform);
|
|
253
|
+
if (!area) return;
|
|
254
|
+
if (name === "pic") {
|
|
255
|
+
const blipFill = kid(shape, "blipFill");
|
|
256
|
+
const embed = relAttr(kid(blipFill, "blip"), "embed");
|
|
257
|
+
const target = embed ? (await deck.pkg.relationships(part.part)).get(embed) : void 0;
|
|
258
|
+
const key = target && !target.external ? await mediaKey(deck, target.target) : null;
|
|
259
|
+
if (!key || Math.abs(area.rotation) > 0.5 || area.flipH || area.flipV) {
|
|
260
|
+
const clip = renditionClip(deck, part, area, "A picture");
|
|
261
|
+
if (clip !== null) {
|
|
262
|
+
const frame2 = stageFrame(deck, area);
|
|
263
|
+
built.items.push({ clip, frame: frame2, after: built.boxes.length });
|
|
264
|
+
}
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const src = kid(blipFill, "srcRect");
|
|
268
|
+
const l = numAttr(src, "l") / 1e5;
|
|
269
|
+
const t = numAttr(src, "t") / 1e5;
|
|
270
|
+
const r = numAttr(src, "r") / 1e5;
|
|
271
|
+
const b = numAttr(src, "b") / 1e5;
|
|
272
|
+
const rect = {
|
|
273
|
+
x: Math.max(0, l),
|
|
274
|
+
y: Math.max(0, t),
|
|
275
|
+
w: Math.min(1, 1 - r) - Math.max(0, l),
|
|
276
|
+
h: Math.min(1, 1 - b) - Math.max(0, t)
|
|
277
|
+
};
|
|
278
|
+
if (rect.w <= 0 || rect.h <= 0) return;
|
|
279
|
+
if (kid(path(shape, "nvPicPr", "nvPr"), "videoFile")) note(deck, "A video shown as its picture");
|
|
280
|
+
const frame = stageFrame(deck, area);
|
|
281
|
+
deck.clips.push({
|
|
282
|
+
kind: "image",
|
|
283
|
+
documentId: "",
|
|
284
|
+
fileName: target?.target.split("/").pop() ?? "Picture",
|
|
285
|
+
page: 1,
|
|
286
|
+
rect,
|
|
287
|
+
aspect: frame.w * STAGE_ASPECT / Math.max(frame.h, 1e-6),
|
|
288
|
+
caption: "",
|
|
289
|
+
media: key,
|
|
290
|
+
plain: true
|
|
291
|
+
});
|
|
292
|
+
built.items.push({ clip: deck.clips.length - 1, frame, after: built.boxes.length });
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
if (name === "graphicFrame") {
|
|
296
|
+
const data = path(shape, "graphic", "graphicData");
|
|
297
|
+
const table = kid(data, "tbl");
|
|
298
|
+
if (table) {
|
|
299
|
+
readTable(table, area, deck, built);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
const uri = data?.getAttribute("uri") ?? "";
|
|
303
|
+
const what = uri.includes("chart") ? "A chart" : uri.includes("diagram") ? "A SmartArt graphic" : "An embedded object";
|
|
304
|
+
const clip = renditionClip(deck, part, area, what);
|
|
305
|
+
if (clip !== null)
|
|
306
|
+
built.items.push({ clip, frame: stageFrame(deck, area), after: built.boxes.length });
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (name !== "sp" && name !== "cxnSp") return;
|
|
310
|
+
const style = kid(shape, "style");
|
|
311
|
+
const prst = path(spPr, "prstGeom")?.getAttribute("prst") ?? (kid(spPr, "custGeom") ? "custom" : "rect");
|
|
312
|
+
let fill = readFill(spPr, theme);
|
|
313
|
+
const fillRef = kid(style, "fillRef");
|
|
314
|
+
if (!fill && fillRef && numAttr(fillRef, "idx") > 0) {
|
|
315
|
+
const color = colorIn(fillRef, theme);
|
|
316
|
+
if (color) fill = { kind: "solid", color };
|
|
317
|
+
}
|
|
318
|
+
if (!fill && ph)
|
|
319
|
+
fill = readFill(kid(layoutPh, "spPr"), theme) ?? readFill(kid(masterPh, "spPr"), theme);
|
|
320
|
+
let line = readLine(kid(spPr, "ln"), theme);
|
|
321
|
+
const lnRef = kid(style, "lnRef");
|
|
322
|
+
if (line === void 0 && lnRef && numAttr(lnRef, "idx") > 0) {
|
|
323
|
+
const color = colorIn(lnRef, theme);
|
|
324
|
+
if (color)
|
|
325
|
+
line = { color, width: theme.lineWidths[numAttr(lnRef, "idx") - 1] ?? 0.75, dash: false };
|
|
326
|
+
}
|
|
327
|
+
if (line === void 0 && name === "cxnSp") line = null;
|
|
328
|
+
const body = kid(shape, "txBody");
|
|
329
|
+
const bodyPr = kid(body, "bodyPr");
|
|
330
|
+
const inheritedBodyPr = [
|
|
331
|
+
bodyPr,
|
|
332
|
+
path(layoutPh, "txBody", "bodyPr"),
|
|
333
|
+
path(masterPh, "txBody", "bodyPr")
|
|
334
|
+
];
|
|
335
|
+
const category = !ph ? "otherStyle" : TITLE_TYPES.has(ph.type) ? "titleStyle" : "bodyStyle";
|
|
336
|
+
const chain = [
|
|
337
|
+
kid(body, "lstStyle"),
|
|
338
|
+
path(layoutPh, "txBody", "lstStyle"),
|
|
339
|
+
path(masterPh, "txBody", "lstStyle"),
|
|
340
|
+
ph ? kid(inherit?.masterTxStyles, category) : null
|
|
341
|
+
];
|
|
342
|
+
const fontRef = kid(style, "fontRef");
|
|
343
|
+
const tx1 = theme.scheme[theme.map.tx1 ?? "dk1"];
|
|
344
|
+
const fontScale = numAttr(kid(bodyPr, "normAutofit"), "fontScale", 1e5) / 1e5;
|
|
345
|
+
const paragraphs = body ? readParagraphs(
|
|
346
|
+
body,
|
|
347
|
+
chain,
|
|
348
|
+
deck,
|
|
349
|
+
{
|
|
350
|
+
color: colorIn(fontRef, theme) ?? void 0,
|
|
351
|
+
base: tx1 ? { hex: `#${tx1}`, alpha: 1 } : void 0
|
|
352
|
+
},
|
|
353
|
+
fontScale,
|
|
354
|
+
[deck.defaultText]
|
|
355
|
+
) : [];
|
|
356
|
+
const hasText = paragraphs.some((p) => p.runs.some((run) => run.text.trim()));
|
|
357
|
+
const visibleFill = fill && fill.kind !== "none" && fill.kind !== "image";
|
|
358
|
+
if (!hasText && !visibleFill && !line && fill?.kind !== "image") return;
|
|
359
|
+
let shapeKind = SHAPES[prst] ?? (name === "cxnSp" ? "line" : "rect");
|
|
360
|
+
const exotic = !SHAPES[prst] && name !== "cxnSp";
|
|
361
|
+
if (exotic && (visibleFill || line) || fill?.kind === "image") {
|
|
362
|
+
const clip = renditionClip(deck, part, area, exotic ? "A shape" : "A picture fill");
|
|
363
|
+
if (clip !== null) {
|
|
364
|
+
built.items.push({ clip, frame: stageFrame(deck, area), after: built.boxes.length });
|
|
365
|
+
if (!hasText) return;
|
|
366
|
+
fill = null;
|
|
367
|
+
line = null;
|
|
368
|
+
shapeKind = "text";
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (shapeKind === "rect" && !visibleFill && !line) shapeKind = "text";
|
|
372
|
+
const anchorOf = (value) => value === "ctr" ? "middle" : value === "b" ? "bottom" : value === "t" ? "top" : void 0;
|
|
373
|
+
const anchor = inheritedBodyPr.map((pr) => anchorOf(pr?.getAttribute("anchor"))).find(Boolean) ?? (ph && TITLE_TYPES.has(ph.type) ? "middle" : "top");
|
|
374
|
+
const insetPr = inheritedBodyPr.find((pr) => pr?.hasAttribute("lIns"));
|
|
375
|
+
const inset = numAttr(insetPr, "lIns", 91440) / EMU_PER_POINT;
|
|
376
|
+
const shapeName = path(shape, "nvSpPr", "cNvPr")?.getAttribute("name") ?? "";
|
|
377
|
+
const role = ph ? TITLE_TYPES.has(ph.type) ? "title" : "body" : shapeName === "ARBI title" ? "title" : shapeName === "ARBI body" ? "body" : void 0;
|
|
378
|
+
const box = {
|
|
379
|
+
frame: stageFrame(deck, area),
|
|
380
|
+
shape: shapeKind,
|
|
381
|
+
paragraphs: hasText ? paragraphs : [],
|
|
382
|
+
...Math.abs(area.rotation) > 0.01 ? { rotation: area.rotation } : {},
|
|
383
|
+
...area.flipH ? { flipH: true } : {},
|
|
384
|
+
...area.flipV ? { flipV: true } : {},
|
|
385
|
+
...fill?.kind === "solid" ? { fill: fill.color.hex, ...fill.color.alpha < 1 ? { fillAlpha: fill.color.alpha } : {} } : fill?.kind === "gradient" ? { fill: fill.from.hex } : {},
|
|
386
|
+
...line ? { line: { color: line.color.hex, width: line.width, ...line.dash ? { dash: true } : {} } } : {},
|
|
387
|
+
...anchor !== "top" ? { anchor } : {},
|
|
388
|
+
...Math.abs(inset - 7.2) > 0.05 ? { inset: inset * deck.pointScale } : {},
|
|
389
|
+
...role ? { role } : {}
|
|
390
|
+
};
|
|
391
|
+
built.boxes.push(box);
|
|
392
|
+
}
|
|
393
|
+
function readTable(table, area, deck, built) {
|
|
394
|
+
const { theme } = deck;
|
|
395
|
+
const tblPr = kid(table, "tblPr");
|
|
396
|
+
const styled = !!kid(tblPr, "tableStyleId");
|
|
397
|
+
const firstRow = boolAttr(tblPr, "firstRow") === true;
|
|
398
|
+
const banded = boolAttr(tblPr, "bandRow") === true;
|
|
399
|
+
const accent = `#${theme.scheme.accent1 ?? "4472c4"}`;
|
|
400
|
+
const tint = (hex, amount) => `#${[1, 3, 5].map(
|
|
401
|
+
(i) => Math.round(255 - (255 - parseInt(hex.slice(i, i + 2), 16)) * amount).toString(16).padStart(2, "0")
|
|
402
|
+
).join("")}`;
|
|
403
|
+
const columns = kids(kid(table, "tblGrid"), "gridCol").map((col) => numAttr(col, "w"));
|
|
404
|
+
const totalW = columns.reduce((sum, w) => sum + w, 0) || area.w;
|
|
405
|
+
const rows = kids(table, "tr");
|
|
406
|
+
const totalH = rows.reduce((sum, row) => sum + numAttr(row, "h"), 0) || area.h;
|
|
407
|
+
const scaleY = area.h / totalH;
|
|
408
|
+
let y = area.y;
|
|
409
|
+
rows.forEach((row, r) => {
|
|
410
|
+
const h = numAttr(row, "h") * scaleY;
|
|
411
|
+
let x = area.x;
|
|
412
|
+
let c = 0;
|
|
413
|
+
for (const cell of kids(row, "tc")) {
|
|
414
|
+
const span = Math.max(1, numAttr(cell, "gridSpan", 1));
|
|
415
|
+
const w = columns.slice(c, c + span).reduce((sum, cw) => sum + cw, 0) * (area.w / totalW);
|
|
416
|
+
c += span;
|
|
417
|
+
if (boolAttr(cell, "hMerge") || boolAttr(cell, "vMerge")) {
|
|
418
|
+
x += w;
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
const rowSpan = Math.max(1, numAttr(cell, "rowSpan", 1));
|
|
422
|
+
const cellH = rows.slice(r, r + rowSpan).reduce((sum, rr) => sum + numAttr(rr, "h") * scaleY, 0);
|
|
423
|
+
const tcPr = kid(cell, "tcPr");
|
|
424
|
+
const own = readFill(tcPr, theme);
|
|
425
|
+
const header = styled && firstRow && r === 0;
|
|
426
|
+
const fill = own?.kind === "solid" ? own.color.hex : own?.kind === "none" ? void 0 : styled ? header ? accent : banded && (r - (firstRow ? 1 : 0)) % 2 === 0 ? tint(accent, 0.2) : tint(accent, 0.1) : void 0;
|
|
427
|
+
const text = readParagraphs(
|
|
428
|
+
kid(cell, "txBody"),
|
|
429
|
+
// The table's style sets its text colour, over the deck's default text.
|
|
430
|
+
[kid(kid(cell, "txBody"), "lstStyle")],
|
|
431
|
+
deck,
|
|
432
|
+
{
|
|
433
|
+
color: {
|
|
434
|
+
hex: header ? "#ffffff" : `#${theme.scheme[theme.map.tx1 ?? "dk1"] ?? "000000"}`,
|
|
435
|
+
alpha: 1
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
1
|
|
439
|
+
).map((p) => header ? { ...p, runs: p.runs.map((run) => ({ ...run, bold: true })) } : p);
|
|
440
|
+
const border = readLine(kid(tcPr, "lnB"), theme) ?? readLine(kid(tcPr, "lnT"), theme);
|
|
441
|
+
built.boxes.push({
|
|
442
|
+
frame: stageFrame(deck, { x, y, w, h: cellH }),
|
|
443
|
+
shape: fill || border || styled ? "rect" : "text",
|
|
444
|
+
paragraphs: text,
|
|
445
|
+
...fill ? { fill } : {},
|
|
446
|
+
...border ? { line: { color: border.color.hex, width: border.width } } : styled ? { line: { color: "#ffffff", width: 1 } } : {},
|
|
447
|
+
anchor: tcPr?.getAttribute("anchor") === "ctr" ? "middle" : "top",
|
|
448
|
+
inset: 7.2 * deck.pointScale
|
|
449
|
+
});
|
|
450
|
+
x += w;
|
|
451
|
+
}
|
|
452
|
+
y += h;
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
async function readBackground(bg, deck, part) {
|
|
456
|
+
if (!bg) return null;
|
|
457
|
+
const bgPr = kid(bg, "bgPr");
|
|
458
|
+
const bgRef = kid(bg, "bgRef");
|
|
459
|
+
const fill = bgPr ? readFill(bgPr, deck.theme) : null;
|
|
460
|
+
if (fill?.kind === "solid") return { color: fill.color.hex };
|
|
461
|
+
if (fill?.kind === "gradient") {
|
|
462
|
+
return { gradient: { from: fill.from.hex, to: fill.to.hex, angle: fill.angle } };
|
|
463
|
+
}
|
|
464
|
+
if (fill?.kind === "image") {
|
|
465
|
+
const target = (await deck.pkg.relationships(part)).get(fill.embed);
|
|
466
|
+
const key = target && !target.external ? await mediaKey(deck, target.target) : null;
|
|
467
|
+
return key ? { image: key } : null;
|
|
468
|
+
}
|
|
469
|
+
if (bgRef) {
|
|
470
|
+
const color = colorIn(bgRef, deck.theme);
|
|
471
|
+
if (color) return { color: color.hex };
|
|
472
|
+
}
|
|
473
|
+
return null;
|
|
474
|
+
}
|
|
475
|
+
async function slideParts(pkg) {
|
|
476
|
+
const pres = await pkg.xml("ppt/presentation.xml");
|
|
477
|
+
const rels = await pkg.relationships("ppt/presentation.xml");
|
|
478
|
+
const parts = [];
|
|
479
|
+
for (const id of kids(kid(pres?.documentElement, "sldIdLst"), "sldId")) {
|
|
480
|
+
const rel = rels.get(relAttr(id, "id") ?? "");
|
|
481
|
+
if (!rel) continue;
|
|
482
|
+
const slide = await pkg.xml(rel.target);
|
|
483
|
+
parts.push({ part: rel.target, hidden: slide?.documentElement.getAttribute("show") === "0" });
|
|
484
|
+
}
|
|
485
|
+
return parts;
|
|
486
|
+
}
|
|
487
|
+
async function speakerNotes(pkg, part) {
|
|
488
|
+
const notesPart = await pkg.related(part, "/notesSlide");
|
|
489
|
+
const doc = notesPart ? await pkg.xml(notesPart) : null;
|
|
490
|
+
const tree = path(doc?.documentElement, "cSld", "spTree");
|
|
491
|
+
for (const shape of kids(tree, "sp")) {
|
|
492
|
+
const ph = placeholderOf(shape);
|
|
493
|
+
if (ph?.type !== "body") continue;
|
|
494
|
+
return kids(kid(shape, "txBody"), "p").map(
|
|
495
|
+
(p) => kids(p).filter((child) => child.localName === "r" || child.localName === "fld").map((run) => kid(run, "t")?.textContent ?? "").join("")
|
|
496
|
+
).join("\n").trim();
|
|
497
|
+
}
|
|
498
|
+
return "";
|
|
499
|
+
}
|
|
500
|
+
const JSZIP = () => import("jszip").then((module) => module.default);
|
|
501
|
+
async function importPptx(bytes, options = {}) {
|
|
502
|
+
const JSZip = await JSZIP();
|
|
503
|
+
const pkg = new Package(await JSZip.loadAsync(bytes));
|
|
504
|
+
const pres = await pkg.xml("ppt/presentation.xml");
|
|
505
|
+
if (!pres) throw new Error("This file is not a PowerPoint presentation.");
|
|
506
|
+
const size = kid(pres.documentElement, "sldSz");
|
|
507
|
+
const cx = numAttr(size, "cx", 12192e3);
|
|
508
|
+
const cy = numAttr(size, "cy", 6858e3);
|
|
509
|
+
const deckAspect = cx / cy;
|
|
510
|
+
const place = deckAspect < STAGE_ASPECT ? { w: deckAspect / STAGE_ASPECT, h: 1, x: (1 - deckAspect / STAGE_ASPECT) / 2, y: 0 } : { w: 1, h: STAGE_ASPECT / deckAspect, x: 0, y: (1 - STAGE_ASPECT / deckAspect) / 2 };
|
|
511
|
+
const slides = await slideParts(pkg);
|
|
512
|
+
const firstLayout = slides.length ? await pkg.related(slides[0].part, "/slideLayout") : null;
|
|
513
|
+
const firstMaster = firstLayout ? await pkg.related(firstLayout, "/slideMaster") : null;
|
|
514
|
+
const deck = {
|
|
515
|
+
pkg,
|
|
516
|
+
theme: firstMaster ? await readTheme(pkg, firstMaster) : { scheme: {}, map: {}, majorFont: "Calibri", minorFont: "Calibri", lineWidths: [] },
|
|
517
|
+
slideSize: { cx, cy },
|
|
518
|
+
place,
|
|
519
|
+
pointScale: SLIDE_POINTS.h * place.h / (cy / EMU_PER_POINT),
|
|
520
|
+
defaultText: kid(pres.documentElement, "defaultTextStyle"),
|
|
521
|
+
options,
|
|
522
|
+
clips: [],
|
|
523
|
+
media: {},
|
|
524
|
+
mediaKeys: /* @__PURE__ */ new Map(),
|
|
525
|
+
notes: /* @__PURE__ */ new Map()
|
|
526
|
+
};
|
|
527
|
+
const saved = [];
|
|
528
|
+
let page = 0;
|
|
529
|
+
for (const { part, hidden } of slides) {
|
|
530
|
+
if (!hidden) page += 1;
|
|
531
|
+
const layout = await pkg.related(part, "/slideLayout");
|
|
532
|
+
const master = layout ? await pkg.related(layout, "/slideMaster") : null;
|
|
533
|
+
if (master && master !== firstMaster) deck.theme = await readTheme(pkg, master);
|
|
534
|
+
const slideDoc = await pkg.xml(part);
|
|
535
|
+
const layoutDoc = layout ? await pkg.xml(layout) : null;
|
|
536
|
+
const masterDoc = master ? await pkg.xml(master) : null;
|
|
537
|
+
const tree = (doc) => path(doc?.documentElement, "cSld", "spTree");
|
|
538
|
+
const built = { boxes: [], items: [] };
|
|
539
|
+
const partContext = { part, page: hidden ? null : page };
|
|
540
|
+
const showMaster = (doc) => doc?.documentElement.getAttribute("showMasterSp") !== "0";
|
|
541
|
+
if (masterDoc && showMaster(slideDoc) && showMaster(layoutDoc)) {
|
|
542
|
+
for (const shape of kids(tree(masterDoc))) {
|
|
543
|
+
await readShape(
|
|
544
|
+
shape,
|
|
545
|
+
IDENTITY,
|
|
546
|
+
deck,
|
|
547
|
+
{ part: master, page: partContext.page },
|
|
548
|
+
null,
|
|
549
|
+
built
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
if (layoutDoc && showMaster(slideDoc)) {
|
|
554
|
+
for (const shape of kids(tree(layoutDoc))) {
|
|
555
|
+
await readShape(
|
|
556
|
+
shape,
|
|
557
|
+
IDENTITY,
|
|
558
|
+
deck,
|
|
559
|
+
{ part: layout, page: partContext.page },
|
|
560
|
+
null,
|
|
561
|
+
built
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
const inherit = {
|
|
566
|
+
layoutTree: tree(layoutDoc),
|
|
567
|
+
masterTree: tree(masterDoc),
|
|
568
|
+
masterTxStyles: kid(masterDoc?.documentElement, "txStyles")
|
|
569
|
+
};
|
|
570
|
+
for (const shape of kids(tree(slideDoc))) {
|
|
571
|
+
await readShape(shape, IDENTITY, deck, partContext, inherit, built);
|
|
572
|
+
}
|
|
573
|
+
const bg = await readBackground(path(slideDoc?.documentElement, "cSld", "bg"), deck, part) ?? (layout ? await readBackground(path(layoutDoc?.documentElement, "cSld", "bg"), deck, layout) : null) ?? (master ? await readBackground(path(masterDoc?.documentElement, "cSld", "bg"), deck, master) : null) ?? {
|
|
574
|
+
color: "#ffffff"
|
|
575
|
+
};
|
|
576
|
+
if (hidden) note(deck, "A hidden slide");
|
|
577
|
+
const firstClipAt = built.items.length ? Math.min(...built.items.map((item) => item.after)) : Infinity;
|
|
578
|
+
const boxes = built.boxes.map(
|
|
579
|
+
(box, index) => index >= firstClipAt ? { ...box, front: true } : box
|
|
580
|
+
);
|
|
581
|
+
const title = boxes.find((box) => box.role === "title");
|
|
582
|
+
const notes = await speakerNotes(pkg, part);
|
|
583
|
+
saved.push({
|
|
584
|
+
caption: title ? title.paragraphs.map((p) => p.runs.map((run) => run.text).join("")).join(" ").replace(/\s+/g, " ").trim() : "",
|
|
585
|
+
auto: false,
|
|
586
|
+
layout: "free",
|
|
587
|
+
items: built.items.map(({ clip, frame }) => ({
|
|
588
|
+
clip,
|
|
589
|
+
frame: { x: frame.x, y: frame.y, w: frame.w }
|
|
590
|
+
})),
|
|
591
|
+
boxes,
|
|
592
|
+
background: bg,
|
|
593
|
+
...notes ? { notes } : {}
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
for (const part of Object.keys(pkg.zip.files)) {
|
|
597
|
+
if (/^ppt\/slides\/slide\d+\.xml$/.test(part)) {
|
|
598
|
+
const xml = await pkg.zip.file(part).async("string");
|
|
599
|
+
if (/<p:timing\b/.test(xml)) {
|
|
600
|
+
note(deck, "Animations are not kept");
|
|
601
|
+
break;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
const core = await pkg.xml("docProps/core.xml");
|
|
606
|
+
const coreTitle = Array.from(core?.documentElement.childNodes ?? []).find(
|
|
607
|
+
(node) => node instanceof Element && node.localName === "title"
|
|
608
|
+
)?.textContent;
|
|
609
|
+
return {
|
|
610
|
+
saved: {
|
|
611
|
+
format: "arbi-presentation",
|
|
612
|
+
version: 1,
|
|
613
|
+
title: options.title ?? (coreTitle?.trim() || "Presentation"),
|
|
614
|
+
captions: false,
|
|
615
|
+
theme: DEFAULT_THEME,
|
|
616
|
+
clips: deck.clips,
|
|
617
|
+
slides: saved,
|
|
618
|
+
...Object.keys(deck.media).length ? { media: deck.media } : {}
|
|
619
|
+
},
|
|
620
|
+
notes: [...deck.notes.entries()].map(
|
|
621
|
+
([text, count]) => count > 1 && !text.startsWith("Animations") ? `${text} (${count})` : text
|
|
622
|
+
),
|
|
623
|
+
fingerprints: await fingerprintsOf(pkg, slides)
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
async function fingerprintsOf(pkg, slides) {
|
|
627
|
+
const out = [];
|
|
628
|
+
for (const { part } of slides) {
|
|
629
|
+
const doc = await pkg.xml(part);
|
|
630
|
+
const tree = path(doc?.documentElement, "cSld", "spTree");
|
|
631
|
+
const parts = [];
|
|
632
|
+
const visit = (element) => {
|
|
633
|
+
for (const child of kids(element)) {
|
|
634
|
+
const name = child.localName;
|
|
635
|
+
if (name === "t") parts.push(child.textContent ?? "");
|
|
636
|
+
else if (name === "off") {
|
|
637
|
+
parts.push(
|
|
638
|
+
`@${Math.round(numAttr(child, "x") / 12e4)},${Math.round(numAttr(child, "y") / 68e3)}`
|
|
639
|
+
);
|
|
640
|
+
} else if (name === "blip") parts.push("pic");
|
|
641
|
+
else visit(child);
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
if (tree) visit(tree);
|
|
645
|
+
parts.push(`notes:${await speakerNotes(pkg, part)}`);
|
|
646
|
+
out.push(hash(parts.join("|").replace(/\s+/g, " ")));
|
|
647
|
+
}
|
|
648
|
+
return out;
|
|
649
|
+
}
|
|
650
|
+
async function slideFingerprints(bytes) {
|
|
651
|
+
const JSZip = await JSZIP();
|
|
652
|
+
const pkg = new Package(await JSZip.loadAsync(bytes));
|
|
653
|
+
return fingerprintsOf(pkg, await slideParts(pkg));
|
|
654
|
+
}
|
|
655
|
+
export {
|
|
656
|
+
importPptx,
|
|
657
|
+
slideFingerprints
|
|
658
|
+
};
|
|
659
|
+
//# sourceMappingURL=import-pptx.js.map
|