@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,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/presentation/import-pptx.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * A PowerPoint deck made elsewhere, as a presentation: each slide a blank (`free`) slide that looks\n * as it did, with its words editable. Text boxes and placeholders become boxes (their position,\n * size, rotation, fill, outline and text, the styles they inherit from the slide's layout and\n * master resolved), pictures become clips of images embedded in the presentation, tables become a\n * grid of boxes, and the background (the slide's, its layout's or its master's) the slide's own.\n *\n * What cannot be edited here (charts, SmartArt, embedded objects, shapes other than rectangles,\n * rounded rectangles, ellipses and lines) is shown as it was: a clip of that area of the deck's own\n * PDF (the one the backend makes of every PowerPoint file), so the slide still looks right.\n * Speaker notes come along; animations and transitions do not (reported in `notes`).\n *\n * `slideFingerprints` reads what each slide shows (its words, its pictures and where things are):\n * saved with a presentation, it tells, when the file is opened again, which slides were changed in\n * PowerPoint since.\n */\n\nimport type { SavedPresentation, SavedClip, SavedSlide } from './persistence'\nimport type { SavedBox } from './saved-boxes'\nimport type { BoxShape, Paragraph, SlideBackground, TextAlign, TextRun } from './boxes'\nimport { SLIDE_POINTS } from './boxes'\nimport { STAGE_ASPECT } from './model'\nimport { DEFAULT_THEME } from './theme'\nimport {\n EMU_PER_POINT,\n Package,\n boolAttr,\n colorIn,\n kid,\n kids,\n mediaDataUrl,\n numAttr,\n path,\n readFill,\n readLine,\n readTheme,\n relAttr,\n typefaceOf,\n type Color,\n type DeckTheme,\n type Fill,\n} from './pptx-xml'\n\nexport interface ImportOptions {\n /** The presentation's title (default: the deck's own, else \"Presentation\"). */\n title?: string\n /** The deck as a document, and the version imported: what stands in for what cannot be edited. */\n documentId?: string\n version?: number\n fileName?: string\n}\n\nexport interface ImportedDeck {\n saved: SavedPresentation\n /** What did not come across as it was (\"2 charts shown as pictures\"). */\n notes: string[]\n /** Each slide's fingerprint (`slideFingerprints`). */\n fingerprints: string[]\n}\n\n/** EMU rectangle on the slide. */\ninterface Area {\n x: number\n y: number\n w: number\n h: number\n}\n\n/** A group's child coordinates mapped to the slide's. */\ninterface Transform {\n sx: number\n sy: number\n ox: number\n oy: number\n}\nconst IDENTITY: Transform = { sx: 1, sy: 1, ox: 0, oy: 0 }\n\nconst TITLE_TYPES = new Set(['title', 'ctrTitle'])\nconst FOOTER_TYPES = new Set(['dt', 'ftr', 'sldNum', 'hdr'])\n\ninterface Placeholder {\n type: string\n idx: string | null\n}\n\nfunction placeholderOf(shape: Element): Placeholder | null {\n const nv = kids(shape).find((child) => child.localName.startsWith('nv'))\n const ph = path(nv, 'nvPr', 'ph')\n if (!ph) return null\n return { type: ph.getAttribute('type') ?? 'body', idx: ph.getAttribute('idx') }\n}\n\n/** The shape in `tree` that a placeholder inherits from (same index, else same type). */\nfunction findPlaceholder(tree: Element | null, ph: Placeholder, master: boolean): Element | null {\n const shapes = kids(tree).filter((child) => child.localName === 'sp')\n const typeOf = (type: string) =>\n master ? (TITLE_TYPES.has(type) ? 'title' : FOOTER_TYPES.has(type) ? type : 'body') : type\n if (!master && ph.idx !== null) {\n const byIdx = shapes.find((shape) => placeholderOf(shape)?.idx === ph.idx)\n if (byIdx) return byIdx\n }\n const wanted = typeOf(ph.type)\n return (\n shapes.find((shape) => {\n const other = placeholderOf(shape)\n return other !== null && typeOf(other.type) === wanted\n }) ?? null\n )\n}\n\n/** A text level's style (lvlNpPr): what a paragraph and its runs inherit. */\ninterface LevelStyle {\n align?: TextAlign\n bullet?: boolean\n size?: number\n bold?: boolean\n italic?: boolean\n underline?: boolean\n color?: Color\n font?: string\n}\n\nconst ALIGN: Record<string, TextAlign> = { l: 'left', ctr: 'center', r: 'right', just: 'justify' }\n\nfunction readRunProps(rPr: Element | null, theme: DeckTheme): LevelStyle {\n if (!rPr) return {}\n const style: LevelStyle = {}\n if (rPr.hasAttribute('sz')) style.size = numAttr(rPr, 'sz') / 100\n const b = boolAttr(rPr, 'b')\n if (b !== undefined) style.bold = b\n const i = boolAttr(rPr, 'i')\n if (i !== undefined) style.italic = i\n const u = rPr.getAttribute('u')\n if (u) style.underline = u !== 'none'\n const fill = readFill(rPr, theme)\n if (fill?.kind === 'solid') style.color = fill.color\n else if (fill?.kind === 'gradient') style.color = fill.from\n const font = typefaceOf(kid(rPr, 'latin')?.getAttribute('typeface'), theme)\n if (font) style.font = font\n return style\n}\n\nfunction readLevel(pPr: Element | null, theme: DeckTheme): LevelStyle {\n if (!pPr) return {}\n const style: LevelStyle = { ...readRunProps(kid(pPr, 'defRPr'), theme) }\n const algn = pPr.getAttribute('algn')\n if (algn && ALIGN[algn]) style.align = ALIGN[algn]\n if (kid(pPr, 'buNone')) style.bullet = false\n else if (kid(pPr, 'buChar') || kid(pPr, 'buAutoNum') || kid(pPr, 'buBlip')) style.bullet = true\n return style\n}\n\n/** The first value each property has, down a list of styles (most specific first). */\nfunction merge(styles: LevelStyle[]): LevelStyle {\n const out: LevelStyle = {}\n for (const style of styles) {\n for (const key of Object.keys(style) as (keyof LevelStyle)[]) {\n if (out[key] === undefined && style[key] !== undefined) {\n ;(out as Record<string, unknown>)[key] = style[key]\n }\n }\n }\n return out\n}\n\n/** A shape's text as inherited: its lists of level styles, most specific first. */\ntype StyleChain = (Element | null)[]\n\nfunction levelStyle(chain: StyleChain, level: number, theme: DeckTheme): LevelStyle {\n return merge(chain.map((list) => readLevel(kid(list, `lvl${level + 1}pPr`), theme)))\n}\n\ninterface DeckContext {\n pkg: Package\n theme: DeckTheme\n /** EMU \u2192 stage fractions. */\n slideSize: { cx: number; cy: number }\n /** The deck's slide placed on the 16:9 stage (a 4:3 deck is centred). */\n place: { x: number; y: number; w: number; h: number }\n /** Points on the deck's slide \u2192 points on the widescreen slide. */\n pointScale: number\n defaultText: Element | null\n options: ImportOptions\n clips: SavedClip[]\n media: Record<string, string>\n /** Media parts already read, by part name \u2192 key. */\n mediaKeys: Map<string, string | null>\n notes: Map<string, number>\n}\n\ninterface PartContext {\n part: string\n /** The page of the deck's PDF this slide is (null: hidden, not in the PDF). */\n page: number | null\n}\n\nconst note = (deck: DeckContext, text: string) =>\n deck.notes.set(text, (deck.notes.get(text) ?? 0) + 1)\n\nfunction hash(text: string): string {\n let h = 0x811c9dc5\n for (let i = 0; i < text.length; i++) {\n h ^= text.charCodeAt(i)\n h = Math.imul(h, 0x01000193)\n }\n return (h >>> 0).toString(36)\n}\n\nasync function mediaKey(deck: DeckContext, part: string): Promise<string | null> {\n if (deck.mediaKeys.has(part)) return deck.mediaKeys.get(part) ?? null\n const url = await mediaDataUrl(deck.pkg, part)\n const key = url ? `m${hash(url)}` : null\n if (url && key) deck.media[key] = url\n deck.mediaKeys.set(part, key)\n return key\n}\n\n/** A shape's area on the slide (EMU), through its groups' transforms. */\nfunction areaOf(\n xfrm: Element | null,\n transform: Transform\n): (Area & { rotation: number; flipH: boolean; flipV: boolean }) | null {\n const off = kid(xfrm, 'off')\n const ext = kid(xfrm, 'ext')\n if (!off || !ext) return null\n return {\n x: transform.ox + numAttr(off, 'x') * transform.sx,\n y: transform.oy + numAttr(off, 'y') * transform.sy,\n w: numAttr(ext, 'cx') * transform.sx,\n h: numAttr(ext, 'cy') * transform.sy,\n rotation: numAttr(xfrm, 'rot') / 60000,\n flipH: boolAttr(xfrm, 'flipH') === true,\n flipV: boolAttr(xfrm, 'flipV') === true,\n }\n}\n\n/** An area as stage fractions. */\nfunction stageFrame(deck: DeckContext, area: Area) {\n const { cx, cy } = deck.slideSize\n const { place } = deck\n return {\n x: place.x + (area.x / cx) * place.w,\n y: place.y + (area.y / cy) * place.h,\n w: (area.w / cx) * place.w,\n h: (area.h / cy) * place.h,\n }\n}\n\nconst hexOf = (color: Color) => color.hex\n\n/** A picture of an area of the deck's own PDF: what stands in for what cannot be edited. */\nfunction renditionClip(\n deck: DeckContext,\n part: PartContext,\n area: Area,\n what: string\n): number | null {\n const { documentId, version, fileName } = deck.options\n if (!documentId || part.page === null) {\n note(deck, `${what} could not be shown`)\n return null\n }\n const { cx, cy } = deck.slideSize\n const clamp = (v: number) => Math.min(1, Math.max(0, v))\n const x = clamp(area.x / cx)\n const y = clamp(area.y / cy)\n const rect = { x, y, w: clamp((area.x + area.w) / cx) - x, h: clamp((area.y + area.h) / cy) - y }\n if (rect.w <= 0 || rect.h <= 0) return null\n const frame = stageFrame(deck, area)\n note(deck, `${what} shown as a picture`)\n deck.clips.push({\n kind: 'pdf',\n documentId,\n ...(version !== undefined ? { version } : {}),\n fileName: fileName ?? 'Presentation.pptx',\n page: part.page,\n rect,\n aspect: (frame.w * STAGE_ASPECT) / Math.max(frame.h, 1e-6),\n caption: '',\n plain: true,\n })\n return deck.clips.length - 1\n}\n\n/** The paragraphs of a text body, every run's style resolved down its inheritance. */\nfunction readParagraphs(\n body: Element | null,\n chain: StyleChain,\n deck: DeckContext,\n /** The shape's style's text colour (over `fallback`), and the colour when nothing sets one. */\n defaults: { color?: Color; base?: Color },\n fontScale: number,\n /** The deck's default text style: below the shape's own. */\n fallback: StyleChain = []\n): Paragraph[] {\n const { theme } = deck\n const paragraphs: Paragraph[] = []\n for (const p of kids(body, 'p')) {\n const pPr = kid(p, 'pPr')\n const level = Math.min(8, numAttr(pPr, 'lvl'))\n const own = readLevel(pPr, theme)\n const style = merge([\n own,\n levelStyle(chain, level, theme),\n defaults.color ? { color: defaults.color } : {},\n levelStyle(fallback, level, theme),\n ])\n const runStyle = (rPr: Element | null): TextRun => {\n const s = merge([readRunProps(rPr, theme), style])\n const color = s.color ?? defaults.base\n return {\n text: '',\n size: Math.round((s.size ?? 18) * fontScale * deck.pointScale * 10) / 10,\n ...(s.bold ? { bold: true } : {}),\n ...(s.italic ? { italic: true } : {}),\n ...(s.underline ? { underline: true } : {}),\n ...(color ? { color: hexOf(color) } : {}),\n font: s.font ?? theme.minorFont,\n }\n }\n const shape = (runs: TextRun[]): Paragraph => ({\n runs,\n ...(style.align && style.align !== 'left' ? { align: style.align } : {}),\n ...(level ? { level } : {}),\n ...(style.bullet && runs.some((run) => run.text.trim()) ? { bullet: true } : {}),\n })\n let runs: TextRun[] = []\n for (const child of kids(p)) {\n if (child.localName === 'r' || child.localName === 'fld') {\n const text = kid(child, 't')?.textContent ?? ''\n runs.push({ ...runStyle(kid(child, 'rPr')), text })\n } else if (child.localName === 'br') {\n // A line break inside a paragraph: a paragraph of its own here.\n paragraphs.push(shape(runs.length ? runs : [{ ...runStyle(kid(child, 'rPr')), text: '' }]))\n runs = []\n }\n }\n if (!runs.length) runs = [{ ...runStyle(kid(p, 'endParaRPr')), text: '' }]\n paragraphs.push(shape(runs))\n }\n // Trailing empty paragraphs say nothing.\n while (\n paragraphs.length > 1 &&\n !paragraphs[paragraphs.length - 1].runs.some((run) => run.text.trim())\n ) {\n paragraphs.pop()\n }\n return paragraphs\n}\n\nconst SHAPES: Record<string, BoxShape> = {\n rect: 'rect',\n flowChartProcess: 'rect',\n snip1Rect: 'rect',\n roundRect: 'roundRect',\n round1Rect: 'roundRect',\n round2SameRect: 'roundRect',\n flowChartAlternateProcess: 'roundRect',\n ellipse: 'ellipse',\n flowChartConnector: 'ellipse',\n line: 'line',\n straightConnector1: 'line',\n}\n\ninterface Built {\n boxes: SavedBox[]\n /** Clip items placed, with the index in `boxes` they come after (drawing order). */\n items: { clip: number; frame: { x: number; y: number; w: number }; after: number }[]\n}\n\ninterface Inheritance {\n layoutTree: Element | null\n masterTree: Element | null\n masterTxStyles: Element | null\n}\n\n/** One shape of a slide, layout or master, added to `built`. */\nasync function readShape(\n shape: Element,\n transform: Transform,\n deck: DeckContext,\n part: PartContext,\n inherit: Inheritance | null,\n built: Built\n): Promise<void> {\n const { theme } = deck\n const name = shape.localName\n if (name === 'AlternateContent') {\n const choice = kid(shape, 'Fallback') ?? kid(shape, 'Choice')\n for (const child of kids(choice)) await readShape(child, transform, deck, part, inherit, built)\n return\n }\n if (name === 'grpSp') {\n const xfrm = path(shape, 'grpSpPr', 'xfrm')\n const off = kid(xfrm, 'off')\n const ext = kid(xfrm, 'ext')\n const chOff = kid(xfrm, 'chOff')\n const chExt = kid(xfrm, 'chExt')\n let inner = transform\n if (off && ext && chOff && chExt) {\n const sx = numAttr(chExt, 'cx') ? numAttr(ext, 'cx') / numAttr(chExt, 'cx') : 1\n const sy = numAttr(chExt, 'cy') ? numAttr(ext, 'cy') / numAttr(chExt, 'cy') : 1\n inner = {\n sx: transform.sx * sx,\n sy: transform.sy * sy,\n ox: transform.ox + (numAttr(off, 'x') - numAttr(chOff, 'x') * sx) * transform.sx,\n oy: transform.oy + (numAttr(off, 'y') - numAttr(chOff, 'y') * sy) * transform.sy,\n }\n }\n for (const child of kids(shape)) await readShape(child, inner, deck, part, inherit, built)\n return\n }\n\n const ph = name === 'sp' || name === 'pic' ? placeholderOf(shape) : null\n // Placeholders on a layout or master are prompts, not content (\"Click to add title\").\n if (ph && !inherit) return\n if (ph && FOOTER_TYPES.has(ph.type)) return\n const layoutPh = ph && inherit ? findPlaceholder(inherit.layoutTree, ph, false) : null\n const masterPh = ph && inherit ? findPlaceholder(inherit.masterTree, ph, true) : null\n const spPr = kid(shape, name === 'graphicFrame' ? 'xfrm' : 'spPr')\n const xfrm =\n name === 'graphicFrame'\n ? kid(shape, 'xfrm')\n : (kid(spPr, 'xfrm') ?? path(layoutPh, 'spPr', 'xfrm') ?? path(masterPh, 'spPr', 'xfrm'))\n const area = areaOf(xfrm, transform)\n if (!area) return\n\n if (name === 'pic') {\n const blipFill = kid(shape, 'blipFill')\n const embed = relAttr(kid(blipFill, 'blip'), 'embed')\n const target = embed ? (await deck.pkg.relationships(part.part)).get(embed) : undefined\n const key = target && !target.external ? await mediaKey(deck, target.target) : null\n if (!key || Math.abs(area.rotation) > 0.5 || area.flipH || area.flipV) {\n const clip = renditionClip(deck, part, area, 'A picture')\n if (clip !== null) {\n const frame = stageFrame(deck, area)\n built.items.push({ clip, frame, after: built.boxes.length })\n }\n return\n }\n const src = kid(blipFill, 'srcRect')\n const l = numAttr(src, 'l') / 100000\n const t = numAttr(src, 't') / 100000\n const r = numAttr(src, 'r') / 100000\n const b = numAttr(src, 'b') / 100000\n const rect = {\n x: Math.max(0, l),\n y: Math.max(0, t),\n w: Math.min(1, 1 - r) - Math.max(0, l),\n h: Math.min(1, 1 - b) - Math.max(0, t),\n }\n if (rect.w <= 0 || rect.h <= 0) return\n if (kid(path(shape, 'nvPicPr', 'nvPr'), 'videoFile')) note(deck, 'A video shown as its picture')\n const frame = stageFrame(deck, area)\n deck.clips.push({\n kind: 'image',\n documentId: '',\n fileName: target?.target.split('/').pop() ?? 'Picture',\n page: 1,\n rect,\n aspect: (frame.w * STAGE_ASPECT) / Math.max(frame.h, 1e-6),\n caption: '',\n media: key,\n plain: true,\n })\n built.items.push({ clip: deck.clips.length - 1, frame, after: built.boxes.length })\n return\n }\n\n if (name === 'graphicFrame') {\n const data = path(shape, 'graphic', 'graphicData')\n const table = kid(data, 'tbl')\n if (table) {\n readTable(table, area, deck, built)\n return\n }\n const uri = data?.getAttribute('uri') ?? ''\n const what = uri.includes('chart')\n ? 'A chart'\n : uri.includes('diagram')\n ? 'A SmartArt graphic'\n : 'An embedded object'\n const clip = renditionClip(deck, part, area, what)\n if (clip !== null)\n built.items.push({ clip, frame: stageFrame(deck, area), after: built.boxes.length })\n return\n }\n\n if (name !== 'sp' && name !== 'cxnSp') return\n const style = kid(shape, 'style')\n const prst =\n path(spPr, 'prstGeom')?.getAttribute('prst') ?? (kid(spPr, 'custGeom') ? 'custom' : 'rect')\n let fill: Fill | null = readFill(spPr, theme)\n const fillRef = kid(style, 'fillRef')\n if (!fill && fillRef && numAttr(fillRef, 'idx') > 0) {\n const color = colorIn(fillRef, theme)\n if (color) fill = { kind: 'solid', color }\n }\n if (!fill && ph)\n fill = readFill(kid(layoutPh, 'spPr'), theme) ?? readFill(kid(masterPh, 'spPr'), theme)\n let line = readLine(kid(spPr, 'ln'), theme)\n const lnRef = kid(style, 'lnRef')\n if (line === undefined && lnRef && numAttr(lnRef, 'idx') > 0) {\n const color = colorIn(lnRef, theme)\n if (color)\n line = { color, width: theme.lineWidths[numAttr(lnRef, 'idx') - 1] ?? 0.75, dash: false }\n }\n if (line === undefined && name === 'cxnSp') line = null\n\n // Its text, inheriting from its layout and master placeholder, then the master's text styles.\n const body = kid(shape, 'txBody')\n const bodyPr = kid(body, 'bodyPr')\n const inheritedBodyPr = [\n bodyPr,\n path(layoutPh, 'txBody', 'bodyPr'),\n path(masterPh, 'txBody', 'bodyPr'),\n ]\n const category = !ph ? 'otherStyle' : TITLE_TYPES.has(ph.type) ? 'titleStyle' : 'bodyStyle'\n const chain: StyleChain = [\n kid(body, 'lstStyle'),\n path(layoutPh, 'txBody', 'lstStyle'),\n path(masterPh, 'txBody', 'lstStyle'),\n ph ? kid(inherit?.masterTxStyles, category) : null,\n ]\n const fontRef = kid(style, 'fontRef')\n const tx1 = theme.scheme[theme.map.tx1 ?? 'dk1']\n const fontScale = numAttr(kid(bodyPr, 'normAutofit'), 'fontScale', 100000) / 100000\n const paragraphs = body\n ? readParagraphs(\n body,\n chain,\n deck,\n {\n color: colorIn(fontRef, theme) ?? undefined,\n base: tx1 ? { hex: `#${tx1}`, alpha: 1 } : undefined,\n },\n fontScale,\n [deck.defaultText]\n )\n : []\n const hasText = paragraphs.some((p) => p.runs.some((run) => run.text.trim()))\n const visibleFill = fill && fill.kind !== 'none' && fill.kind !== 'image'\n if (!hasText && !visibleFill && !line && fill?.kind !== 'image') return\n\n let shapeKind: BoxShape = SHAPES[prst] ?? (name === 'cxnSp' ? 'line' : 'rect')\n const exotic = !SHAPES[prst] && name !== 'cxnSp'\n if ((exotic && (visibleFill || line)) || fill?.kind === 'image') {\n // A shape drawn here as it was (its outline cannot be edited); its text stays editable on top.\n const clip = renditionClip(deck, part, area, exotic ? 'A shape' : 'A picture fill')\n if (clip !== null) {\n built.items.push({ clip, frame: stageFrame(deck, area), after: built.boxes.length })\n if (!hasText) return\n fill = null\n line = null\n shapeKind = 'text'\n }\n }\n if (shapeKind === 'rect' && !visibleFill && !line) shapeKind = 'text'\n\n const anchorOf = (value: string | null | undefined) =>\n value === 'ctr' ? 'middle' : value === 'b' ? 'bottom' : value === 't' ? 'top' : undefined\n const anchor =\n inheritedBodyPr.map((pr) => anchorOf(pr?.getAttribute('anchor'))).find(Boolean) ??\n (ph && TITLE_TYPES.has(ph.type) ? 'middle' : 'top')\n const insetPr = inheritedBodyPr.find((pr) => pr?.hasAttribute('lIns'))\n const inset = numAttr(insetPr, 'lIns', 91440) / EMU_PER_POINT\n\n // A placeholder's part in the slide; or, exported by ARBI, the part its name keeps.\n const shapeName = path(shape, 'nvSpPr', 'cNvPr')?.getAttribute('name') ?? ''\n const role: SavedBox['role'] = ph\n ? TITLE_TYPES.has(ph.type)\n ? 'title'\n : 'body'\n : shapeName === 'ARBI title'\n ? 'title'\n : shapeName === 'ARBI body'\n ? 'body'\n : undefined\n const box: SavedBox = {\n frame: stageFrame(deck, area),\n shape: shapeKind,\n paragraphs: hasText ? paragraphs : [],\n ...(Math.abs(area.rotation) > 0.01 ? { rotation: area.rotation } : {}),\n ...(area.flipH ? { flipH: true } : {}),\n ...(area.flipV ? { flipV: true } : {}),\n ...(fill?.kind === 'solid'\n ? { fill: fill.color.hex, ...(fill.color.alpha < 1 ? { fillAlpha: fill.color.alpha } : {}) }\n : fill?.kind === 'gradient'\n ? { fill: fill.from.hex }\n : {}),\n ...(line\n ? { line: { color: line.color.hex, width: line.width, ...(line.dash ? { dash: true } : {}) } }\n : {}),\n ...(anchor !== 'top' ? { anchor } : {}),\n ...(Math.abs(inset - 7.2) > 0.05 ? { inset: inset * deck.pointScale } : {}),\n ...(role ? { role } : {}),\n }\n built.boxes.push(box)\n}\n\n/** Medium Style 2 (PowerPoint's default table look): a header row in accent 1, banded rows. */\nfunction readTable(table: Element, area: Area, deck: DeckContext, built: Built) {\n const { theme } = deck\n const tblPr = kid(table, 'tblPr')\n const styled = !!kid(tblPr, 'tableStyleId')\n const firstRow = boolAttr(tblPr, 'firstRow') === true\n const banded = boolAttr(tblPr, 'bandRow') === true\n const accent = `#${theme.scheme.accent1 ?? '4472c4'}`\n const tint = (hex: string, amount: number) =>\n `#${[1, 3, 5]\n .map((i) =>\n Math.round(255 - (255 - parseInt(hex.slice(i, i + 2), 16)) * amount)\n .toString(16)\n .padStart(2, '0')\n )\n .join('')}`\n const columns = kids(kid(table, 'tblGrid'), 'gridCol').map((col) => numAttr(col, 'w'))\n const totalW = columns.reduce((sum, w) => sum + w, 0) || area.w\n const rows = kids(table, 'tr')\n const totalH = rows.reduce((sum, row) => sum + numAttr(row, 'h'), 0) || area.h\n // Rows grow to fit their text in PowerPoint: the frame's height is what it shows.\n const scaleY = area.h / totalH\n let y = area.y\n rows.forEach((row, r) => {\n const h = numAttr(row, 'h') * scaleY\n let x = area.x\n let c = 0\n for (const cell of kids(row, 'tc')) {\n const span = Math.max(1, numAttr(cell, 'gridSpan', 1))\n const w = columns.slice(c, c + span).reduce((sum, cw) => sum + cw, 0) * (area.w / totalW)\n c += span\n if (boolAttr(cell, 'hMerge') || boolAttr(cell, 'vMerge')) {\n x += w\n continue\n }\n const rowSpan = Math.max(1, numAttr(cell, 'rowSpan', 1))\n const cellH = rows\n .slice(r, r + rowSpan)\n .reduce((sum, rr) => sum + numAttr(rr, 'h') * scaleY, 0)\n const tcPr = kid(cell, 'tcPr')\n const own = readFill(tcPr, theme)\n const header = styled && firstRow && r === 0\n const fill =\n own?.kind === 'solid'\n ? own.color.hex\n : own?.kind === 'none'\n ? undefined\n : styled\n ? header\n ? accent\n : banded && (r - (firstRow ? 1 : 0)) % 2 === 0\n ? tint(accent, 0.2)\n : tint(accent, 0.1)\n : undefined\n const text = readParagraphs(\n kid(cell, 'txBody'),\n // The table's style sets its text colour, over the deck's default text.\n [kid(kid(cell, 'txBody'), 'lstStyle')],\n deck,\n {\n color: {\n hex: header ? '#ffffff' : `#${theme.scheme[theme.map.tx1 ?? 'dk1'] ?? '000000'}`,\n alpha: 1,\n },\n },\n 1\n ).map((p) => (header ? { ...p, runs: p.runs.map((run) => ({ ...run, bold: true })) } : p))\n const border = readLine(kid(tcPr, 'lnB'), theme) ?? readLine(kid(tcPr, 'lnT'), theme)\n built.boxes.push({\n frame: stageFrame(deck, { x, y, w, h: cellH }),\n shape: fill || border || styled ? 'rect' : 'text',\n paragraphs: text,\n ...(fill ? { fill } : {}),\n ...(border\n ? { line: { color: border.color.hex, width: border.width } }\n : styled\n ? { line: { color: '#ffffff', width: 1 } }\n : {}),\n anchor: tcPr?.getAttribute('anchor') === 'ctr' ? 'middle' : 'top',\n inset: 7.2 * deck.pointScale,\n })\n x += w\n }\n y += h\n })\n}\n\n/** A background element's fill as a slide background. */\nasync function readBackground(\n bg: Element | null,\n deck: DeckContext,\n part: string\n): Promise<SlideBackground | null> {\n if (!bg) return null\n const bgPr = kid(bg, 'bgPr')\n const bgRef = kid(bg, 'bgRef')\n const fill = bgPr ? readFill(bgPr, deck.theme) : null\n if (fill?.kind === 'solid') return { color: fill.color.hex }\n if (fill?.kind === 'gradient') {\n return { gradient: { from: fill.from.hex, to: fill.to.hex, angle: fill.angle } }\n }\n if (fill?.kind === 'image') {\n const target = (await deck.pkg.relationships(part)).get(fill.embed)\n const key = target && !target.external ? await mediaKey(deck, target.target) : null\n return key ? { image: key } : null\n }\n if (bgRef) {\n const color = colorIn(bgRef, deck.theme)\n if (color) return { color: color.hex }\n }\n return null\n}\n\n/** The deck's slides, in order, with whether each is hidden. */\nasync function slideParts(pkg: Package): Promise<{ part: string; hidden: boolean }[]> {\n const pres = await pkg.xml('ppt/presentation.xml')\n const rels = await pkg.relationships('ppt/presentation.xml')\n const parts: { part: string; hidden: boolean }[] = []\n for (const id of kids(kid(pres?.documentElement, 'sldIdLst'), 'sldId')) {\n const rel = rels.get(relAttr(id, 'id') ?? '')\n if (!rel) continue\n const slide = await pkg.xml(rel.target)\n parts.push({ part: rel.target, hidden: slide?.documentElement.getAttribute('show') === '0' })\n }\n return parts\n}\n\n/** A slide's speaker notes. */\nasync function speakerNotes(pkg: Package, part: string): Promise<string> {\n const notesPart = await pkg.related(part, '/notesSlide')\n const doc = notesPart ? await pkg.xml(notesPart) : null\n const tree = path(doc?.documentElement, 'cSld', 'spTree')\n for (const shape of kids(tree, 'sp')) {\n const ph = placeholderOf(shape)\n if (ph?.type !== 'body') continue\n return kids(kid(shape, 'txBody'), 'p')\n .map((p) =>\n kids(p)\n .filter((child) => child.localName === 'r' || child.localName === 'fld')\n .map((run) => kid(run, 't')?.textContent ?? '')\n .join('')\n )\n .join('\\n')\n .trim()\n }\n return ''\n}\n\nconst JSZIP = () => import('jszip').then((module) => module.default)\n\nexport async function importPptx(\n bytes: Uint8Array,\n options: ImportOptions = {}\n): Promise<ImportedDeck> {\n const JSZip = await JSZIP()\n const pkg = new Package(await JSZip.loadAsync(bytes))\n const pres = await pkg.xml('ppt/presentation.xml')\n if (!pres) throw new Error('This file is not a PowerPoint presentation.')\n const size = kid(pres.documentElement, 'sldSz')\n const cx = numAttr(size, 'cx', 12192000)\n const cy = numAttr(size, 'cy', 6858000)\n const deckAspect = cx / cy\n const place =\n deckAspect < STAGE_ASPECT\n ? { w: deckAspect / STAGE_ASPECT, h: 1, x: (1 - deckAspect / STAGE_ASPECT) / 2, y: 0 }\n : { w: 1, h: STAGE_ASPECT / deckAspect, x: 0, y: (1 - STAGE_ASPECT / deckAspect) / 2 }\n const slides = await slideParts(pkg)\n const firstLayout = slides.length ? await pkg.related(slides[0].part, '/slideLayout') : null\n const firstMaster = firstLayout ? await pkg.related(firstLayout, '/slideMaster') : null\n const deck: DeckContext = {\n pkg,\n theme: firstMaster\n ? await readTheme(pkg, firstMaster)\n : { scheme: {}, map: {}, majorFont: 'Calibri', minorFont: 'Calibri', lineWidths: [] },\n slideSize: { cx, cy },\n place,\n pointScale: (SLIDE_POINTS.h * place.h) / (cy / EMU_PER_POINT),\n defaultText: kid(pres.documentElement, 'defaultTextStyle'),\n options,\n clips: [],\n media: {},\n mediaKeys: new Map(),\n notes: new Map(),\n }\n\n const saved: SavedSlide[] = []\n let page = 0\n for (const { part, hidden } of slides) {\n if (!hidden) page += 1\n const layout = await pkg.related(part, '/slideLayout')\n const master = layout ? await pkg.related(layout, '/slideMaster') : null\n if (master && master !== firstMaster) deck.theme = await readTheme(pkg, master)\n const slideDoc = await pkg.xml(part)\n const layoutDoc = layout ? await pkg.xml(layout) : null\n const masterDoc = master ? await pkg.xml(master) : null\n const tree = (doc: Document | null) => path(doc?.documentElement, 'cSld', 'spTree')\n const built: Built = { boxes: [], items: [] }\n const partContext: PartContext = { part, page: hidden ? null : page }\n // The master's and layout's own shapes (a logo, a band) show on the slide unless it hides them.\n const showMaster = (doc: Document | null) =>\n doc?.documentElement.getAttribute('showMasterSp') !== '0'\n if (masterDoc && showMaster(slideDoc) && showMaster(layoutDoc)) {\n for (const shape of kids(tree(masterDoc))) {\n await readShape(\n shape,\n IDENTITY,\n deck,\n { part: master!, page: partContext.page },\n null,\n built\n )\n }\n }\n if (layoutDoc && showMaster(slideDoc)) {\n for (const shape of kids(tree(layoutDoc))) {\n await readShape(\n shape,\n IDENTITY,\n deck,\n { part: layout!, page: partContext.page },\n null,\n built\n )\n }\n }\n const inherit: Inheritance = {\n layoutTree: tree(layoutDoc),\n masterTree: tree(masterDoc),\n masterTxStyles: kid(masterDoc?.documentElement, 'txStyles'),\n }\n for (const shape of kids(tree(slideDoc))) {\n await readShape(shape, IDENTITY, deck, partContext, inherit, built)\n }\n const bg = (await readBackground(path(slideDoc?.documentElement, 'cSld', 'bg'), deck, part)) ??\n (layout\n ? await readBackground(path(layoutDoc?.documentElement, 'cSld', 'bg'), deck, layout)\n : null) ??\n (master\n ? await readBackground(path(masterDoc?.documentElement, 'cSld', 'bg'), deck, master)\n : null) ?? {\n color: '#ffffff',\n }\n if (hidden) note(deck, 'A hidden slide')\n const firstClipAt = built.items.length\n ? Math.min(...built.items.map((item) => item.after))\n : Infinity\n const boxes = built.boxes.map((box, index) =>\n index >= firstClipAt ? { ...box, front: true } : box\n )\n const title = boxes.find((box) => box.role === 'title')\n const notes = await speakerNotes(pkg, part)\n saved.push({\n caption: title\n ? title.paragraphs\n .map((p) => p.runs.map((run) => run.text).join(''))\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim()\n : '',\n auto: false,\n layout: 'free',\n items: built.items.map(({ clip, frame }) => ({\n clip,\n frame: { x: frame.x, y: frame.y, w: frame.w },\n })),\n boxes,\n background: bg,\n ...(notes ? { notes } : {}),\n })\n }\n\n for (const part of Object.keys(pkg.zip.files)) {\n if (/^ppt\\/slides\\/slide\\d+\\.xml$/.test(part)) {\n const xml = await pkg.zip.file(part)!.async('string')\n if (/<p:timing\\b/.test(xml)) {\n note(deck, 'Animations are not kept')\n break\n }\n }\n }\n\n const core = await pkg.xml('docProps/core.xml')\n const coreTitle = Array.from(core?.documentElement.childNodes ?? []).find(\n (node): node is Element => node instanceof Element && node.localName === 'title'\n )?.textContent\n return {\n saved: {\n format: 'arbi-presentation',\n version: 1,\n title: options.title ?? (coreTitle?.trim() || 'Presentation'),\n captions: false,\n theme: DEFAULT_THEME,\n clips: deck.clips,\n slides: saved,\n ...(Object.keys(deck.media).length ? { media: deck.media } : {}),\n },\n notes: [...deck.notes.entries()].map(([text, count]) =>\n count > 1 && !text.startsWith('Animations') ? `${text} (${count})` : text\n ),\n fingerprints: await fingerprintsOf(pkg, slides),\n }\n}\n\n/** What a slide shows, reduced to a short string: its words, its pictures and their places. */\nasync function fingerprintsOf(pkg: Package, slides: { part: string }[]): Promise<string[]> {\n const out: string[] = []\n for (const { part } of slides) {\n const doc = await pkg.xml(part)\n const tree = path(doc?.documentElement, 'cSld', 'spTree')\n const parts: string[] = []\n const visit = (element: Element) => {\n for (const child of kids(element)) {\n const name = child.localName\n if (name === 't') parts.push(child.textContent ?? '')\n else if (name === 'off') {\n // Places to a hundredth of the slide (a re-save may round them).\n parts.push(\n `@${Math.round(numAttr(child, 'x') / 120000)},${Math.round(numAttr(child, 'y') / 68000)}`\n )\n } else if (name === 'blip') parts.push('pic')\n else visit(child)\n }\n }\n if (tree) visit(tree)\n parts.push(`notes:${await speakerNotes(pkg, part)}`)\n out.push(hash(parts.join('|').replace(/\\s+/g, ' ')))\n }\n return out\n}\n\n/** Each slide's fingerprint, in order (see the module's notes). */\nexport async function slideFingerprints(bytes: Uint8Array | Blob): Promise<string[]> {\n const JSZip = await JSZIP()\n const pkg = new Package(await JSZip.loadAsync(bytes))\n return fingerprintsOf(pkg, await slideParts(pkg))\n}\n"],
|
|
5
|
+
"mappings": ";AAoBA,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAkCP,MAAM,WAAsB,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,EA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ACA,cAAc,MAAM,eAAe,KAAK,MAAM;AAAA,EAChD;AACF;AAGA,eAAe,eAAe,KAAc,QAA+C;AACzF,QAAM,MAAgB,CAAC;AACvB,aAAW,EAAE,KAAK,KAAK,QAAQ;AAC7B,UAAM,MAAM,MAAM,IAAI,IAAI,IAAI;AAC9B,UAAM,OAAO,KAAK,KAAK,iBAAiB,QAAQ,QAAQ;AACxD,UAAM,QAAkB,CAAC;AACzB,UAAM,QAAQ,CAAC,YAAqB;AAClC,iBAAW,SAAS,KAAK,OAAO,GAAG;AACjC,cAAM,OAAO,MAAM;AACnB,YAAI,SAAS,IAAK,OAAM,KAAK,MAAM,eAAe,EAAE;AAAA,iBAC3C,SAAS,OAAO;AAEvB,gBAAM;AAAA,YACJ,IAAI,KAAK,MAAM,QAAQ,OAAO,GAAG,IAAI,IAAM,CAAC,IAAI,KAAK,MAAM,QAAQ,OAAO,GAAG,IAAI,IAAK,CAAC;AAAA,UACzF;AAAA,QACF,WAAW,SAAS,OAAQ,OAAM,KAAK,KAAK;AAAA,YACvC,OAAM,KAAK;AAAA,MAClB;AAAA,IACF;AACA,QAAI,KAAM,OAAM,IAAI;AACpB,UAAM,KAAK,SAAS,MAAM,aAAa,KAAK,IAAI,CAAC,EAAE;AACnD,QAAI,KAAK,KAAK,MAAM,KAAK,GAAG,EAAE,QAAQ,QAAQ,GAAG,CAAC,CAAC;AAAA,EACrD;AACA,SAAO;AACT;AAGA,eAAsB,kBAAkB,OAA6C;AACnF,QAAM,QAAQ,MAAM,MAAM;AAC1B,QAAM,MAAM,IAAI,QAAQ,MAAM,MAAM,UAAU,KAAK,CAAC;AACpD,SAAO,eAAe,KAAK,MAAM,WAAW,GAAG,CAAC;AAClD;",
|
|
6
|
+
"names": ["runs", "xfrm", "frame"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A presentation saved by the editor and then changed in PowerPoint (or another app): its slides,
|
|
3
|
+
* as they now are. A slide PowerPoint left as it was (its fingerprint unchanged) keeps the editor's
|
|
4
|
+
* own version of it (clips that are references to their sources, its layout); a slide changed,
|
|
5
|
+
* added or moved in PowerPoint is taken as imported, so nothing done there is lost. Slides deleted
|
|
6
|
+
* there are gone.
|
|
7
|
+
*/
|
|
8
|
+
import type { SavedPresentation } from './persistence';
|
|
9
|
+
export declare function mergeOutsideEdits(saved: SavedPresentation, imported: SavedPresentation, fingerprints: readonly string[]): {
|
|
10
|
+
saved: SavedPresentation;
|
|
11
|
+
changed: number[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function mergeOutsideEdits(saved, imported, fingerprints) {
|
|
3
|
+
const used = /* @__PURE__ */ new Set();
|
|
4
|
+
const offset = saved.clips.length;
|
|
5
|
+
const changed = [];
|
|
6
|
+
const slides = fingerprints.map((fingerprint, index) => {
|
|
7
|
+
const own = saved.slides.findIndex(
|
|
8
|
+
(slide2, i) => !used.has(i) && slide2.fingerprint === fingerprint
|
|
9
|
+
);
|
|
10
|
+
if (own >= 0) {
|
|
11
|
+
used.add(own);
|
|
12
|
+
return saved.slides[own];
|
|
13
|
+
}
|
|
14
|
+
changed.push(index + 1);
|
|
15
|
+
const slide = imported.slides[index];
|
|
16
|
+
return {
|
|
17
|
+
...slide,
|
|
18
|
+
items: slide.items.map((item) => ({ ...item, clip: item.clip + offset })),
|
|
19
|
+
fingerprint
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
saved: {
|
|
24
|
+
...saved,
|
|
25
|
+
clips: [...saved.clips, ...imported.clips],
|
|
26
|
+
slides,
|
|
27
|
+
...saved.media || imported.media ? { media: { ...saved.media, ...imported.media } } : {}
|
|
28
|
+
},
|
|
29
|
+
changed
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
mergeOutsideEdits
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=merge-outside-edits.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/presentation/merge-outside-edits.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * A presentation saved by the editor and then changed in PowerPoint (or another app): its slides,\n * as they now are. A slide PowerPoint left as it was (its fingerprint unchanged) keeps the editor's\n * own version of it (clips that are references to their sources, its layout); a slide changed,\n * added or moved in PowerPoint is taken as imported, so nothing done there is lost. Slides deleted\n * there are gone.\n */\n\nimport type { SavedPresentation, SavedSlide } from './persistence'\n\nexport function mergeOutsideEdits(\n saved: SavedPresentation,\n imported: SavedPresentation,\n fingerprints: readonly string[]\n): { saved: SavedPresentation; changed: number[] } {\n const used = new Set<number>()\n const offset = saved.clips.length\n const changed: number[] = []\n const slides: SavedSlide[] = fingerprints.map((fingerprint, index) => {\n const own = saved.slides.findIndex(\n (slide, i) => !used.has(i) && slide.fingerprint === fingerprint\n )\n if (own >= 0) {\n used.add(own)\n return saved.slides[own]\n }\n changed.push(index + 1)\n const slide = imported.slides[index]\n return {\n ...slide,\n items: slide.items.map((item) => ({ ...item, clip: item.clip + offset })),\n fingerprint,\n }\n })\n return {\n saved: {\n ...saved,\n clips: [...saved.clips, ...imported.clips],\n slides,\n ...(saved.media || imported.media ? { media: { ...saved.media, ...imported.media } } : {}),\n },\n changed,\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAUO,SAAS,kBACd,OACA,UACA,cACiD;AACjD,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,SAAS,MAAM,MAAM;AAC3B,QAAM,UAAoB,CAAC;AAC3B,QAAM,SAAuB,aAAa,IAAI,CAAC,aAAa,UAAU;AACpE,UAAM,MAAM,MAAM,OAAO;AAAA,MACvB,CAACA,QAAO,MAAM,CAAC,KAAK,IAAI,CAAC,KAAKA,OAAM,gBAAgB;AAAA,IACtD;AACA,QAAI,OAAO,GAAG;AACZ,WAAK,IAAI,GAAG;AACZ,aAAO,MAAM,OAAO,GAAG;AAAA,IACzB;AACA,YAAQ,KAAK,QAAQ,CAAC;AACtB,UAAM,QAAQ,SAAS,OAAO,KAAK;AACnC,WAAO;AAAA,MACL,GAAG;AAAA,MACH,OAAO,MAAM,MAAM,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,MAAM,KAAK,OAAO,OAAO,EAAE;AAAA,MACxE;AAAA,IACF;AAAA,EACF,CAAC;AACD,SAAO;AAAA,IACL,OAAO;AAAA,MACL,GAAG;AAAA,MACH,OAAO,CAAC,GAAG,MAAM,OAAO,GAAG,SAAS,KAAK;AAAA,MACzC;AAAA,MACA,GAAI,MAAM,SAAS,SAAS,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,OAAO,GAAG,SAAS,MAAM,EAAE,IAAI,CAAC;AAAA,IAC1F;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["slide"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A presentation: clips (a rectangle of a PDF page) arranged on 16:9 slides, shown on a stage that
|
|
3
|
+
* can be shared or projected. A clip is a reference to its source (document, version, page,
|
|
4
|
+
* rectangle), never a picture of it: it is drawn again from the PDF at whatever size it is shown,
|
|
5
|
+
* and a later "save as PDF" can embed the same region as vector content.
|
|
6
|
+
*
|
|
7
|
+
* Layout is pure: a frame is the clip's place on the slide as fractions of the stage, and its
|
|
8
|
+
* height always follows from the clip's own aspect, so a clip is never stretched.
|
|
9
|
+
*/
|
|
10
|
+
import type { SlideBackground, SlideBox } from './boxes';
|
|
11
|
+
/** Fractions of a page or of the stage, origin top-left. */
|
|
12
|
+
export interface Rect {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
w: number;
|
|
16
|
+
h: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* What a clip is cut from: a PDF page (drawn again from the PDF at the size shown), an image or a
|
|
20
|
+
* video (the original file shown cropped, so at its own resolution; a video plays on the stage).
|
|
21
|
+
*/
|
|
22
|
+
export type ClipKind = 'pdf' | 'image' | 'video';
|
|
23
|
+
export interface Clip {
|
|
24
|
+
id: string;
|
|
25
|
+
kind: ClipKind;
|
|
26
|
+
documentId: string;
|
|
27
|
+
/** The version clipped; absent = the current version when it was clipped. */
|
|
28
|
+
version?: number;
|
|
29
|
+
fileName: string;
|
|
30
|
+
/** 1-based page number (1 for an image or a video). */
|
|
31
|
+
page: number;
|
|
32
|
+
/** The clipped area, as fractions of the displayed page, image or video frame. */
|
|
33
|
+
rect: Rect;
|
|
34
|
+
/** Width / height of the clipped area as displayed. */
|
|
35
|
+
aspect: number;
|
|
36
|
+
caption: string;
|
|
37
|
+
/** Redactions over the clipped area (page fractions), painted black wherever it shows. */
|
|
38
|
+
masks: Rect[];
|
|
39
|
+
/** The file the clip is cut from (this session only; never stored). */
|
|
40
|
+
source: Blob;
|
|
41
|
+
/**
|
|
42
|
+
* The clip's width (a fraction of its source) when it was cut, so its zoom reads against that
|
|
43
|
+
* (100%); absent = its width now.
|
|
44
|
+
*/
|
|
45
|
+
zoomBase?: number;
|
|
46
|
+
/** A video clip starts playing here (seconds). */
|
|
47
|
+
start?: number;
|
|
48
|
+
/**
|
|
49
|
+
* An image embedded in the presentation itself (a key of its media), not a document: a picture
|
|
50
|
+
* of a deck imported from PowerPoint. Its `documentId` is empty.
|
|
51
|
+
*/
|
|
52
|
+
media?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Drawn as it is: no rounded corners, soft edge, shadow or source label (a picture that is part
|
|
55
|
+
* of a slide's design, or a part of an imported slide shown as it was).
|
|
56
|
+
*/
|
|
57
|
+
plain?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/** A clip's place on a slide: its left, top and width as fractions of the stage. */
|
|
60
|
+
export interface Frame {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
w: number;
|
|
64
|
+
}
|
|
65
|
+
export interface SlideItem {
|
|
66
|
+
clipId: string;
|
|
67
|
+
frame: Frame;
|
|
68
|
+
}
|
|
69
|
+
export interface Slide {
|
|
70
|
+
id: string;
|
|
71
|
+
items: SlideItem[];
|
|
72
|
+
/** Arranged automatically (fit to the stage) until an item is moved by hand. */
|
|
73
|
+
auto: boolean;
|
|
74
|
+
/** Shown across the top of the slide (e.g. "Claims and defences"); empty for none. */
|
|
75
|
+
caption: string;
|
|
76
|
+
/** Where its title, text and clips go (`slide-layout`). */
|
|
77
|
+
layout: SlideLayout;
|
|
78
|
+
/** Its text: one point per line (the subtitle on a title or section slide); empty for none. */
|
|
79
|
+
points: string;
|
|
80
|
+
/** Its text boxes and shapes (`boxes`), in drawing order. */
|
|
81
|
+
boxes: SlideBox[];
|
|
82
|
+
/** Its own background, over the theme's (an imported slide's). */
|
|
83
|
+
background?: SlideBackground;
|
|
84
|
+
/** What the presenter says (speaker notes: not shown on the slide). */
|
|
85
|
+
notes?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A slide's layout: a title slide, a section break, clips under a title, clips beside points, or
|
|
89
|
+
* two clips side by side; or blank (`free`): only what is placed on it, its text in boxes (a slide
|
|
90
|
+
* imported from PowerPoint).
|
|
91
|
+
*/
|
|
92
|
+
export type SlideLayout = 'title' | 'section' | 'clips' | 'points' | 'compare' | 'free';
|
|
93
|
+
export declare const SLIDE_LAYOUTS: readonly SlideLayout[];
|
|
94
|
+
/** The stage is 16:9, the shape of a shared screen or a projector. */
|
|
95
|
+
export declare const STAGE_ASPECT: number;
|
|
96
|
+
/** Space kept clear around the edge of the stage, and between auto-arranged clips. */
|
|
97
|
+
export declare const STAGE_MARGIN = 0.03;
|
|
98
|
+
export declare const STAGE_GAP = 0.02;
|
|
99
|
+
/** The smallest a clip can be resized to (fraction of the stage width). */
|
|
100
|
+
export declare const MIN_FRAME_WIDTH = 0.05;
|
|
101
|
+
/** How close (fraction of the stage) an edge or centre must come to snap. */
|
|
102
|
+
export declare const SNAP_DISTANCE = 0.012;
|
|
103
|
+
/**
|
|
104
|
+
* Room kept under a clip for its source label (document · page), as a fraction of the stage
|
|
105
|
+
* height, while labels show: it sits below the clip, never over it, so it hides nothing.
|
|
106
|
+
*/
|
|
107
|
+
export declare const CAPTION_SPACE = 0.06;
|
|
108
|
+
/** Room kept across the top of a slide for its caption, when it has one (stage height). */
|
|
109
|
+
export declare const SLIDE_CAPTION_SPACE = 0.1;
|
|
110
|
+
/**
|
|
111
|
+
* Room an arrangement keeps free: above the clips and under each clip (stage height), at the right
|
|
112
|
+
* (stage width, e.g. a slide's points) and at the bottom (the footer); `columns` fixes the grid's
|
|
113
|
+
* columns (two clips side by side).
|
|
114
|
+
*/
|
|
115
|
+
export interface Reserve {
|
|
116
|
+
top: number;
|
|
117
|
+
below: number;
|
|
118
|
+
right?: number;
|
|
119
|
+
bottom?: number;
|
|
120
|
+
columns?: number;
|
|
121
|
+
/** More room on both sides, beyond the stage margin (clips line up with a slide's text). */
|
|
122
|
+
inset?: number;
|
|
123
|
+
}
|
|
124
|
+
export declare const NO_RESERVE: Reserve;
|
|
125
|
+
/** The frame's height as a fraction of the stage height. */
|
|
126
|
+
export declare function frameHeight(frame: Pick<Frame, 'w'>, aspect: number): number;
|
|
127
|
+
/**
|
|
128
|
+
* Clips arranged to fill the stage: every grid of columns × rows is tried and the one where the
|
|
129
|
+
* clips are largest wins (two wide clips stack, two tall ones go side by side). Each clip is
|
|
130
|
+
* centred in its cell; a last, shorter row is centred too. `reserve` keeps a band free above the
|
|
131
|
+
* clips (the slide's caption) and room under each clip (its source label).
|
|
132
|
+
*/
|
|
133
|
+
export declare function autoLayout(aspects: readonly number[], reserve?: Reserve): Frame[];
|
|
134
|
+
/** As large as the stage allows, centred (keeping `reserve` free). */
|
|
135
|
+
export declare function fitFrame(aspect: number, reserve?: Reserve): Frame;
|
|
136
|
+
/** The full width of the stage (inside the margin), centred on the frame's own height. */
|
|
137
|
+
export declare function fullWidthFrame(frame: Frame, aspect: number, reserve?: Reserve): Frame;
|
|
138
|
+
/** The full height of the stage (inside the margin), centred on the frame's own centre. */
|
|
139
|
+
export declare function fullHeightFrame(frame: Frame, aspect: number, reserve?: Reserve): Frame;
|
|
140
|
+
/** A clip on the slide (the others a moving clip snaps to). */
|
|
141
|
+
export interface Placed {
|
|
142
|
+
frame: Frame;
|
|
143
|
+
aspect: number;
|
|
144
|
+
}
|
|
145
|
+
/** A line a clip snapped to, drawn while it is dragged: `at` is a stage fraction on `axis`. */
|
|
146
|
+
export interface Guide {
|
|
147
|
+
axis: 'x' | 'y';
|
|
148
|
+
at: number;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The frame moved by `dx, dy` (stage fractions) and kept on the stage. Unless `free`, its edges
|
|
152
|
+
* and centre snap to the stage's lines and to the other clips', and the lines snapped to are
|
|
153
|
+
* returned as guides.
|
|
154
|
+
*/
|
|
155
|
+
export declare function moveFrame(frame: Frame, aspect: number, dx: number, dy: number, others?: readonly Placed[], free?: boolean): {
|
|
156
|
+
frame: Frame;
|
|
157
|
+
guides: Guide[];
|
|
158
|
+
};
|
|
159
|
+
/** A corner a clip is resized from. */
|
|
160
|
+
export type Corner = 'nw' | 'ne' | 'sw' | 'se';
|
|
161
|
+
/**
|
|
162
|
+
* The frame resized by dragging `corner` by `dx, dy`: the opposite corner stays put, the aspect is
|
|
163
|
+
* kept and the clip stays on the stage. Unless `free`, the moving edges snap like a move does.
|
|
164
|
+
*/
|
|
165
|
+
export declare function resizeFrame(frame: Frame, aspect: number, corner: Corner, dx: number, dy: number, others?: readonly Placed[], free?: boolean): {
|
|
166
|
+
frame: Frame;
|
|
167
|
+
guides: Guide[];
|
|
168
|
+
};
|
|
169
|
+
/** An edge a clip is reshaped from. */
|
|
170
|
+
export type Edge = 'n' | 'e' | 's' | 'w';
|
|
171
|
+
/**
|
|
172
|
+
* The clip reshaped by dragging `edge` by `dx, dy`, at the same scale: the edge moves on the slide
|
|
173
|
+
* and over the source together, so the clip shows more (or less) of the page beside it, never past
|
|
174
|
+
* the source's edge or the stage's. Unless `free`, the edge snaps like a move does.
|
|
175
|
+
*/
|
|
176
|
+
export declare function reshapeFrame(frame: Frame, clip: Pick<Clip, 'rect' | 'aspect'>, edge: Edge, dx: number, dy: number, others?: readonly Placed[], free?: boolean): {
|
|
177
|
+
frame: Frame;
|
|
178
|
+
rect: Rect;
|
|
179
|
+
aspect: number;
|
|
180
|
+
guides: Guide[];
|
|
181
|
+
};
|
|
182
|
+
/** Where a clip can be aligned on the stage. */
|
|
183
|
+
export type Alignment = 'left' | 'centre' | 'right' | 'top' | 'middle' | 'bottom';
|
|
184
|
+
/** The frame aligned on the stage, inside its margins and the slide's reserved room. */
|
|
185
|
+
export declare function alignFrame(frame: Frame, aspect: number, alignment: Alignment, reserve?: Reserve): Frame;
|
|
186
|
+
/** A clip dropped at a point (stage fractions): centred there, at most 45% of the stage wide. */
|
|
187
|
+
export declare function dropFrame(aspect: number, at: {
|
|
188
|
+
x: number;
|
|
189
|
+
y: number;
|
|
190
|
+
}): Frame;
|
|
191
|
+
/** "Exhibit 12.pdf", page 4 → "Exhibit 12 · p. 4". */
|
|
192
|
+
export declare function defaultCaption(fileName: string, page: number): string;
|
|
193
|
+
/** "1:05" (or "1:02:05"): a point in a video. */
|
|
194
|
+
export declare function formatTime(seconds: number): string;
|
|
195
|
+
/**
|
|
196
|
+
* A clip's label as shown: its document's value in the presentation's label column (an exhibit
|
|
197
|
+
* number, "R-100"), then its own label. `columnValues` maps a document id to that value.
|
|
198
|
+
*/
|
|
199
|
+
export declare function clipLabel(clip: Pick<Clip, 'caption' | 'documentId'>, columnValues: Readonly<Record<string, string>>): string;
|
|
200
|
+
/** The source label of a clip of an image ("Photo 3") or a video, from where it starts ("Interview · 1:05"). */
|
|
201
|
+
export declare function mediaCaption(fileName: string, start?: number): string;
|