@arbidocs/blocks 0.5.120 → 0.5.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ClippingMediaViewer-IEIBT74X.cjs +156 -0
- package/dist/ClippingMediaViewer-IEIBT74X.cjs.map +1 -0
- package/dist/ClippingPdfViewer-OGYLMVCE.cjs +79 -0
- package/dist/ClippingPdfViewer-OGYLMVCE.cjs.map +1 -0
- package/dist/{ConnectedCallDock-WER7R222.cjs → ConnectedCallDock-XJOYVVAH.cjs} +9 -7
- package/dist/ConnectedCallDock-XJOYVVAH.cjs.map +1 -0
- package/dist/{ConnectedCallRoom-T7OBQTYP.cjs → ConnectedCallRoom-CUDYAPQK.cjs} +9 -7
- package/dist/{ConnectedCallRoom-T7OBQTYP.cjs.map → ConnectedCallRoom-CUDYAPQK.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-SGE4R3M4.cjs → ConnectedNativeDocxComparison-QKHCYD6W.cjs} +7 -7
- package/dist/{ConnectedNativeDocxComparison-SGE4R3M4.cjs.map → ConnectedNativeDocxComparison-QKHCYD6W.cjs.map} +1 -1
- package/dist/ConnectedPresentation-AU25OW25.cjs +321 -0
- package/dist/ConnectedPresentation-AU25OW25.cjs.map +1 -0
- package/dist/ConnectedSlidesTab-I75LKKN7.cjs +236 -0
- package/dist/ConnectedSlidesTab-I75LKKN7.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-6MCLJRIT.cjs → ConnectedStreamedWordArtifact-AG62232A.cjs} +7 -7
- package/dist/{ConnectedStreamedWordArtifact-6MCLJRIT.cjs.map → ConnectedStreamedWordArtifact-AG62232A.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-BPIAJJED.cjs → DocumentReviewCard-M53XFLI2.cjs} +15 -14
- package/dist/DocumentReviewCard-M53XFLI2.cjs.map +1 -0
- package/dist/{FilesViewerDialog-67WK3TZC.cjs → FilesViewerDialog-4352KIOG.cjs} +30 -22
- package/dist/FilesViewerDialog-4352KIOG.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-3XYAV4BV.cjs} +9 -8
- package/dist/WorkspaceTableView-3XYAV4BV.cjs.map +1 -0
- package/dist/agents/index.cjs +186 -186
- package/dist/{ai-IM4A23YT.cjs → ai-IEIR7SC2.cjs} +17 -15
- package/dist/ai-IEIR7SC2.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 +2 -2
- package/dist/chat/index.cjs +8 -7
- package/dist/{chunk-557MJ4IH.cjs → chunk-2F57IO7S.cjs} +9 -146
- package/dist/chunk-2F57IO7S.cjs.map +1 -0
- package/dist/chunk-2RLA6QO2.cjs +174 -0
- package/dist/chunk-2RLA6QO2.cjs.map +1 -0
- package/dist/chunk-4TTX6ZNS.cjs +1374 -0
- package/dist/chunk-4TTX6ZNS.cjs.map +1 -0
- package/dist/chunk-5GCCUXMT.cjs +63 -0
- package/dist/chunk-5GCCUXMT.cjs.map +1 -0
- package/dist/{chunk-BUVIBHFU.cjs → chunk-5QERK4PK.cjs} +38 -38
- package/dist/chunk-5QERK4PK.cjs.map +1 -0
- package/dist/chunk-6OK7ESTL.cjs +134 -0
- package/dist/chunk-6OK7ESTL.cjs.map +1 -0
- package/dist/{chunk-ECLUFKYR.cjs → chunk-7557LDAN.cjs} +4 -4
- package/dist/{chunk-ECLUFKYR.cjs.map → chunk-7557LDAN.cjs.map} +1 -1
- package/dist/{chunk-KTQOGT2L.cjs → chunk-7L4X6QN2.cjs} +7 -7
- package/dist/{chunk-KTQOGT2L.cjs.map → chunk-7L4X6QN2.cjs.map} +1 -1
- package/dist/{chunk-BP3IJ34D.cjs → chunk-7NLO7ASW.cjs} +4 -4
- package/dist/{chunk-BP3IJ34D.cjs.map → chunk-7NLO7ASW.cjs.map} +1 -1
- package/dist/{chunk-3GWWOYGS.cjs → chunk-7PN3YENO.cjs} +4 -4
- package/dist/{chunk-3GWWOYGS.cjs.map → chunk-7PN3YENO.cjs.map} +1 -1
- package/dist/{chunk-DFBDQKGE.cjs → chunk-ADDQKZ5I.cjs} +4 -4
- package/dist/{chunk-DFBDQKGE.cjs.map → chunk-ADDQKZ5I.cjs.map} +1 -1
- package/dist/chunk-AFQTQC7A.cjs +35 -0
- package/dist/chunk-AFQTQC7A.cjs.map +1 -0
- package/dist/{chunk-NLSWDP42.cjs → chunk-ALK3PUUB.cjs} +21 -11
- package/dist/chunk-ALK3PUUB.cjs.map +1 -0
- package/dist/{chunk-775S43W7.cjs → chunk-CQQQIZU4.cjs} +8 -8
- package/dist/{chunk-775S43W7.cjs.map → chunk-CQQQIZU4.cjs.map} +1 -1
- package/dist/{chunk-TDO5UWXF.cjs → chunk-E3L5DB5F.cjs} +5 -5
- package/dist/{chunk-TDO5UWXF.cjs.map → chunk-E3L5DB5F.cjs.map} +1 -1
- package/dist/chunk-GFUOCGY6.cjs +32 -0
- package/dist/chunk-GFUOCGY6.cjs.map +1 -0
- package/dist/chunk-HYUKPHCT.cjs +66 -0
- package/dist/chunk-HYUKPHCT.cjs.map +1 -0
- package/dist/{chunk-QQWHG3KF.cjs → chunk-JJZOL5MG.cjs} +4 -4
- package/dist/{chunk-QQWHG3KF.cjs.map → chunk-JJZOL5MG.cjs.map} +1 -1
- package/dist/chunk-K4763GD5.cjs +301 -0
- package/dist/chunk-K4763GD5.cjs.map +1 -0
- package/dist/{chunk-B3LZITVF.cjs → chunk-KA3F6TIH.cjs} +2 -442
- package/dist/chunk-KA3F6TIH.cjs.map +1 -0
- package/dist/{chunk-PGJYD67F.cjs → chunk-KNGZZC4O.cjs} +7 -6
- package/dist/chunk-KNGZZC4O.cjs.map +1 -0
- package/dist/{chunk-YYPZOEED.cjs → chunk-LHWOKOMP.cjs} +23 -2
- package/dist/chunk-LHWOKOMP.cjs.map +1 -0
- package/dist/{chunk-HA66DHW6.cjs → chunk-MLA2BJ2Y.cjs} +28 -28
- package/dist/chunk-MLA2BJ2Y.cjs.map +1 -0
- package/dist/{chunk-CPR6EHG7.cjs → chunk-NG2EE7HR.cjs} +134 -10
- package/dist/chunk-NG2EE7HR.cjs.map +1 -0
- package/dist/{chunk-CKCG4NDB.cjs → chunk-OHHKBURG.cjs} +29 -29
- package/dist/chunk-OHHKBURG.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-YYSBWMDJ.cjs → chunk-QG2U2JGX.cjs} +4 -4
- package/dist/{chunk-YYSBWMDJ.cjs.map → chunk-QG2U2JGX.cjs.map} +1 -1
- package/dist/{chunk-5IZFSAEZ.cjs → chunk-SDRYSLOX.cjs} +4 -4
- package/dist/{chunk-5IZFSAEZ.cjs.map → chunk-SDRYSLOX.cjs.map} +1 -1
- package/dist/{chunk-NJCK6V6U.cjs → chunk-T73BHNQX.cjs} +2 -58
- package/dist/chunk-T73BHNQX.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-6UTKM5AB.cjs → chunk-UFT22LAB.cjs} +75 -75
- package/dist/chunk-UFT22LAB.cjs.map +1 -0
- package/dist/chunk-USNTRL22.cjs +4790 -0
- package/dist/chunk-USNTRL22.cjs.map +1 -0
- package/dist/{chunk-X36UR4A7.cjs → chunk-UTJ223TI.cjs} +413 -90
- package/dist/chunk-UTJ223TI.cjs.map +1 -0
- package/dist/{chunk-VZCPMXWC.cjs → chunk-V6MW7B4B.cjs} +4 -4
- package/dist/{chunk-VZCPMXWC.cjs.map → chunk-V6MW7B4B.cjs.map} +1 -1
- package/dist/{chunk-T23UTIRI.cjs → chunk-VWBYE3XY.cjs} +5 -5
- package/dist/{chunk-T23UTIRI.cjs.map → chunk-VWBYE3XY.cjs.map} +1 -1
- package/dist/chunk-WFMWKPGY.cjs +102 -0
- package/dist/chunk-WFMWKPGY.cjs.map +1 -0
- package/dist/chunk-WOOOMTTA.cjs +19 -0
- package/dist/chunk-WOOOMTTA.cjs.map +1 -0
- package/dist/{chunk-W6INT5GS.cjs → chunk-WRLGLZIA.cjs} +8 -8
- package/dist/{chunk-W6INT5GS.cjs.map → chunk-WRLGLZIA.cjs.map} +1 -1
- 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-XF355M7O.cjs +154 -0
- package/dist/chunk-XF355M7O.cjs.map +1 -0
- package/dist/{chunk-Q6CLWOP2.cjs → chunk-XGM4VVNV.cjs} +34 -34
- package/dist/{chunk-Q6CLWOP2.cjs.map → chunk-XGM4VVNV.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-E7TE2WVT.cjs → chunk-ZVEW3JBT.cjs} +3 -3
- package/dist/{chunk-E7TE2WVT.cjs.map → chunk-ZVEW3JBT.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +70 -70
- 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 +10 -10
- package/dist/connect/index.cjs +1066 -1147
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +19 -12
- package/dist/connection/ai.d.ts +1 -1
- package/dist/connection/conversation/ConnectedMessage.js +1 -1
- package/dist/connection/conversation/ConnectedMessage.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/documentColumns.js +1 -1
- 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 +222 -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 +39 -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 +21 -0
- package/dist/connection/presentation/requests.js +27 -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/shell/ConnectedAppShell.js +5 -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 +28 -29
- 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 +41 -1
- package/dist/connection/viewer/ViewerPdfPane.js.map +2 -2
- package/dist/connection/viewer/documentPlace.d.ts +5 -4
- package/dist/connection/viewer/documentPlace.js +2 -2
- package/dist/connection/viewer/documentPlace.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/PdfClipOutlines.d.ts +11 -0
- package/dist/connection/viewer/pdf/PdfClipOutlines.js +42 -0
- package/dist/connection/viewer/pdf/PdfClipOutlines.js.map +7 -0
- package/dist/connection/viewer/pdf/clipOutlines.d.ts +17 -0
- package/dist/connection/viewer/pdf/clipOutlines.js +24 -0
- package/dist/connection/viewer/pdf/clipOutlines.js.map +7 -0
- package/dist/connection/viewer/pdf/passageHighlights.d.ts +2 -0
- package/dist/connection/viewer/pdf/passageHighlights.js +12 -1
- package/dist/connection/viewer/pdf/passageHighlights.js.map +2 -2
- package/dist/connection/viewer/pdf/usePdfClipOutlines.d.ts +7 -0
- package/dist/connection/viewer/pdf/usePdfClipOutlines.js +36 -0
- package/dist/connection/viewer/pdf/usePdfClipOutlines.js.map +7 -0
- package/dist/connection/viewer/pdf/usePdfPassageHighlights.js +11 -2
- package/dist/connection/viewer/pdf/usePdfPassageHighlights.js.map +2 -2
- 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/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 +17 -15
- package/dist/files/GridViewImpl.js +1 -1
- package/dist/files/GridViewImpl.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 +224 -224
- package/dist/files/navigator/DocumentSearchList.js +1 -1
- package/dist/files/navigator/DocumentSearchList.js.map +2 -2
- package/dist/index.cjs +359 -356
- 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/PresentControls.d.ts +11 -0
- package/dist/presentation/PresentControls.js +117 -0
- package/dist/presentation/PresentControls.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 +100 -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 +375 -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 +44 -0
- package/dist/presentation/panel-id.js +29 -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 +58 -0
- package/dist/presentation/slide-layout.js +133 -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 +149 -148
- package/dist/shell/PanelPortal.js +13 -3
- package/dist/shell/PanelPortal.js.map +2 -2
- package/dist/shell/index.cjs +49 -46
- package/dist/shell/panel-windows.d.ts +2 -0
- package/dist/shell/panel-windows.js +8 -2
- package/dist/shell/panel-windows.js.map +2 -2
- package/dist/studio/index.cjs +8 -6
- package/dist/studio/index.cjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +26 -25
- 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-BPIAJJED.cjs.map +0 -1
- package/dist/FilesViewerDialog-67WK3TZC.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-BUVIBHFU.cjs.map +0 -1
- package/dist/chunk-CKCG4NDB.cjs.map +0 -1
- package/dist/chunk-CPR6EHG7.cjs.map +0 -1
- package/dist/chunk-HA66DHW6.cjs.map +0 -1
- package/dist/chunk-NJCK6V6U.cjs.map +0 -1
- package/dist/chunk-NLSWDP42.cjs.map +0 -1
- package/dist/chunk-PGJYD67F.cjs.map +0 -1
- package/dist/chunk-X36UR4A7.cjs.map +0 -1
- package/dist/chunk-YYPZOEED.cjs.map +0 -1
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { memo, useState } from "react";
|
|
4
|
+
import { cn } from "@arbidocs/react/ui";
|
|
5
|
+
import { LAYOUT_INFO, slideGeometry, textLines } from "./slide-layout.js";
|
|
6
|
+
import { TEXT_COLORS, accentColor } from "./theme.js";
|
|
7
|
+
import { useObjectUrl } from "./useObjectUrl.js";
|
|
8
|
+
const boxStyle = (box) => ({
|
|
9
|
+
left: `${box.x * 100}%`,
|
|
10
|
+
top: `${box.y * 100}%`,
|
|
11
|
+
width: `${box.w * 100}%`,
|
|
12
|
+
height: `${box.h * 100}%`
|
|
13
|
+
});
|
|
14
|
+
const textStyle = (box, color) => ({
|
|
15
|
+
...boxStyle(box),
|
|
16
|
+
fontSize: `${box.size * 100}cqw`,
|
|
17
|
+
fontWeight: box.weight,
|
|
18
|
+
lineHeight: box.leading,
|
|
19
|
+
color,
|
|
20
|
+
letterSpacing: box.tone === "title" ? "-0.01em" : void 0
|
|
21
|
+
});
|
|
22
|
+
const PLACEHOLDER_COLOR = "rgba(255,255,255,0.32)";
|
|
23
|
+
function Text({
|
|
24
|
+
box,
|
|
25
|
+
lines,
|
|
26
|
+
accent,
|
|
27
|
+
placeholder,
|
|
28
|
+
onEdit,
|
|
29
|
+
testId
|
|
30
|
+
}) {
|
|
31
|
+
const empty = lines.length === 0;
|
|
32
|
+
if (empty && !placeholder) return null;
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: cn(
|
|
37
|
+
"absolute flex flex-col overflow-hidden",
|
|
38
|
+
onEdit ? "pointer-events-auto cursor-text rounded-[0.3cqw] hover:outline hover:outline-1 hover:outline-white/25" : "pointer-events-none",
|
|
39
|
+
box.align === "center" && "text-center",
|
|
40
|
+
box.bullets && "gap-[0.6cqw]",
|
|
41
|
+
box.anchor === "middle" && "justify-center",
|
|
42
|
+
box.anchor === "bottom" && "justify-end"
|
|
43
|
+
),
|
|
44
|
+
style: textStyle(box, empty ? PLACEHOLDER_COLOR : TEXT_COLORS[box.tone]),
|
|
45
|
+
onPointerDown: onEdit ? (event) => event.stopPropagation() : void 0,
|
|
46
|
+
onClick: onEdit,
|
|
47
|
+
"data-testid": testId,
|
|
48
|
+
children: (empty ? [placeholder] : lines).map(
|
|
49
|
+
(line, index) => box.bullets ? /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-[0.8em]", children: [
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
"aria-hidden": true,
|
|
54
|
+
className: "inline-block size-[0.42em] shrink-0 -translate-y-[0.12em]",
|
|
55
|
+
style: { background: empty ? "currentColor" : accent }
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ jsx("span", { children: line })
|
|
59
|
+
] }, index) : /* @__PURE__ */ jsx("div", { children: line }, index)
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
function TextField({
|
|
65
|
+
box,
|
|
66
|
+
value,
|
|
67
|
+
placeholder,
|
|
68
|
+
multiline,
|
|
69
|
+
onChange,
|
|
70
|
+
onDone,
|
|
71
|
+
testId
|
|
72
|
+
}) {
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
74
|
+
"textarea",
|
|
75
|
+
{
|
|
76
|
+
autoFocus: true,
|
|
77
|
+
value,
|
|
78
|
+
placeholder,
|
|
79
|
+
onChange: (event) => onChange(multiline ? event.target.value : event.target.value.replace(/\n/g, " ")),
|
|
80
|
+
onBlur: onDone,
|
|
81
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
82
|
+
onKeyDown: (event) => {
|
|
83
|
+
if (event.key === "Escape" || !multiline && event.key === "Enter") {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
event.currentTarget.blur();
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
className: cn(
|
|
89
|
+
"pointer-events-auto absolute resize-none overflow-hidden rounded-[0.3cqw] bg-white/5 p-0 outline outline-1 outline-white/40 placeholder:text-white/30 focus:outline-white/60",
|
|
90
|
+
box.align === "center" && "text-center"
|
|
91
|
+
),
|
|
92
|
+
style: {
|
|
93
|
+
...textStyle(box, TEXT_COLORS[box.tone]),
|
|
94
|
+
fontFamily: "inherit",
|
|
95
|
+
// Bulleted lines keep their indent while typed.
|
|
96
|
+
paddingLeft: box.bullets ? "1.22em" : void 0
|
|
97
|
+
},
|
|
98
|
+
"aria-label": placeholder,
|
|
99
|
+
"data-testid": testId
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
function Logo({ image, box }) {
|
|
104
|
+
const url = useObjectUrl(image);
|
|
105
|
+
if (!url) return null;
|
|
106
|
+
return /* @__PURE__ */ jsx(
|
|
107
|
+
"img",
|
|
108
|
+
{
|
|
109
|
+
src: url,
|
|
110
|
+
alt: "",
|
|
111
|
+
className: "pointer-events-none absolute object-contain opacity-90",
|
|
112
|
+
style: { ...boxStyle(box), objectPosition: box.x < 0.5 ? "left bottom" : "right bottom" },
|
|
113
|
+
"data-testid": "stage-logo"
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
const SlideDecor = memo(function SlideDecor2({
|
|
118
|
+
slide,
|
|
119
|
+
theme,
|
|
120
|
+
labels,
|
|
121
|
+
logoImage,
|
|
122
|
+
editable,
|
|
123
|
+
editing,
|
|
124
|
+
dim
|
|
125
|
+
}) {
|
|
126
|
+
const [typing, setTyping] = useState(null);
|
|
127
|
+
const geometry = slideGeometry(slide, { labels, logo: theme.logo?.corner ?? null });
|
|
128
|
+
const title = slide.caption.trim();
|
|
129
|
+
const titled = slide.layout === "title" || slide.layout === "section";
|
|
130
|
+
const info = LAYOUT_INFO[slide.layout];
|
|
131
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("pointer-events-none absolute inset-0", dim && "opacity-30"), children: [
|
|
132
|
+
!geometry.title ? null : editing && typing === "title" ? /* @__PURE__ */ jsx(
|
|
133
|
+
TextField,
|
|
134
|
+
{
|
|
135
|
+
box: geometry.title,
|
|
136
|
+
value: slide.caption,
|
|
137
|
+
placeholder: "Title",
|
|
138
|
+
multiline: false,
|
|
139
|
+
onChange: editing.onTitle,
|
|
140
|
+
onDone: () => setTyping(null),
|
|
141
|
+
testId: "stage-slide-caption-input"
|
|
142
|
+
}
|
|
143
|
+
) : /* @__PURE__ */ jsx(
|
|
144
|
+
Text,
|
|
145
|
+
{
|
|
146
|
+
box: geometry.title,
|
|
147
|
+
lines: title ? [title] : [],
|
|
148
|
+
accent: accentColor(theme.accent),
|
|
149
|
+
placeholder: editable && (titled || editing) ? "Click to add a title" : void 0,
|
|
150
|
+
onEdit: editing ? () => setTyping("title") : void 0,
|
|
151
|
+
testId: "stage-slide-caption"
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
geometry.rule && (title || editable && titled) && /* @__PURE__ */ jsx(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
className: "absolute",
|
|
158
|
+
style: { ...boxStyle(geometry.rule), background: accentColor(theme.accent) }
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
geometry.text && (editing && typing === "text" ? /* @__PURE__ */ jsx(
|
|
162
|
+
TextField,
|
|
163
|
+
{
|
|
164
|
+
box: geometry.text,
|
|
165
|
+
value: slide.points,
|
|
166
|
+
placeholder: info.text ?? "",
|
|
167
|
+
multiline: true,
|
|
168
|
+
onChange: editing.onPoints,
|
|
169
|
+
onDone: () => setTyping(null),
|
|
170
|
+
testId: "stage-slide-points-input"
|
|
171
|
+
}
|
|
172
|
+
) : /* @__PURE__ */ jsx(
|
|
173
|
+
Text,
|
|
174
|
+
{
|
|
175
|
+
box: geometry.text,
|
|
176
|
+
lines: textLines(slide.points),
|
|
177
|
+
accent: accentColor(theme.accent),
|
|
178
|
+
placeholder: editable ? info.text : void 0,
|
|
179
|
+
onEdit: editing ? () => setTyping("text") : void 0,
|
|
180
|
+
testId: "stage-slide-points"
|
|
181
|
+
}
|
|
182
|
+
)),
|
|
183
|
+
geometry.logo && logoImage && /* @__PURE__ */ jsx(Logo, { image: logoImage, box: geometry.logo })
|
|
184
|
+
] });
|
|
185
|
+
});
|
|
186
|
+
export {
|
|
187
|
+
SlideDecor
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=SlideDecor.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/presentation/SlideDecor.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * What a slide shows besides its clips, by its layout and the theme: its title with the accent\n * rule, its points (accent bullets) or subtitle, and the logo in the footer. Positioned on the\n * stage from `slideGeometry`, sized in container units (`cqw`) so it scales with the stage. The\n * saved PDF and the PowerPoint export draw the same geometry.\n *\n * In the editor (`editing`), the title and text are typed on the slide itself: a click swaps the\n * text for a field with the same type, size and place, so nothing moves while it is edited.\n */\n\nimport { memo, useState, type CSSProperties } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport type { Slide } from './model'\nimport { LAYOUT_INFO, slideGeometry, textLines, type Box, type TextBox } from './slide-layout'\nimport { TEXT_COLORS, accentColor, type Theme } from './theme'\nimport { useObjectUrl } from './useObjectUrl'\n\n/** Typing a slide's title and text on the slide. */\nexport interface SlideTextEditing {\n onTitle(title: string): void\n onPoints(points: string): void\n}\n\nconst boxStyle = (box: Box) => ({\n left: `${box.x * 100}%`,\n top: `${box.y * 100}%`,\n width: `${box.w * 100}%`,\n height: `${box.h * 100}%`,\n})\n\nconst textStyle = (box: TextBox, color: string): CSSProperties => ({\n ...boxStyle(box),\n fontSize: `${box.size * 100}cqw`,\n fontWeight: box.weight,\n lineHeight: box.leading,\n color,\n letterSpacing: box.tone === 'title' ? '-0.01em' : undefined,\n})\n\nconst PLACEHOLDER_COLOR = 'rgba(255,255,255,0.32)'\n\nfunction Text({\n box,\n lines,\n accent,\n placeholder,\n onEdit,\n testId,\n}: {\n box: TextBox\n lines: string[]\n accent: string\n /** Shown faintly in the editor while the text is empty. */\n placeholder?: string\n /** A click starts typing (the editor). */\n onEdit?: () => void\n testId: string\n}) {\n const empty = lines.length === 0\n if (empty && !placeholder) return null\n return (\n <div\n className={cn(\n 'absolute flex flex-col overflow-hidden',\n onEdit\n ? 'pointer-events-auto cursor-text rounded-[0.3cqw] hover:outline hover:outline-1 hover:outline-white/25'\n : 'pointer-events-none',\n box.align === 'center' && 'text-center',\n box.bullets && 'gap-[0.6cqw]',\n box.anchor === 'middle' && 'justify-center',\n box.anchor === 'bottom' && 'justify-end'\n )}\n style={textStyle(box, empty ? PLACEHOLDER_COLOR : TEXT_COLORS[box.tone])}\n onPointerDown={onEdit ? (event) => event.stopPropagation() : undefined}\n onClick={onEdit}\n data-testid={testId}\n >\n {(empty ? [placeholder!] : lines).map((line, index) =>\n box.bullets ? (\n <div key={index} className=\"flex items-baseline gap-[0.8em]\">\n <span\n aria-hidden\n className=\"inline-block size-[0.42em] shrink-0 -translate-y-[0.12em]\"\n style={{ background: empty ? 'currentColor' : accent }}\n />\n <span>{line}</span>\n </div>\n ) : (\n <div key={index}>{line}</div>\n )\n )}\n </div>\n )\n}\n\n/** The field a title or text is typed in: the text's own type, size and place. */\nfunction TextField({\n box,\n value,\n placeholder,\n multiline,\n onChange,\n onDone,\n testId,\n}: {\n box: TextBox\n value: string\n placeholder: string\n multiline: boolean\n onChange: (value: string) => void\n onDone: () => void\n testId: string\n}) {\n return (\n <textarea\n autoFocus\n value={value}\n placeholder={placeholder}\n onChange={(event) =>\n onChange(multiline ? event.target.value : event.target.value.replace(/\\n/g, ' '))\n }\n onBlur={onDone}\n onPointerDown={(event) => event.stopPropagation()}\n onKeyDown={(event) => {\n if (event.key === 'Escape' || (!multiline && event.key === 'Enter')) {\n event.preventDefault()\n event.currentTarget.blur()\n }\n }}\n className={cn(\n 'pointer-events-auto absolute resize-none overflow-hidden rounded-[0.3cqw] bg-white/5 p-0 outline outline-1 outline-white/40 placeholder:text-white/30 focus:outline-white/60',\n box.align === 'center' && 'text-center'\n )}\n style={{\n ...textStyle(box, TEXT_COLORS[box.tone]),\n fontFamily: 'inherit',\n // Bulleted lines keep their indent while typed.\n paddingLeft: box.bullets ? '1.22em' : undefined,\n }}\n aria-label={placeholder}\n data-testid={testId}\n />\n )\n}\n\nfunction Logo({ image, box }: { image: Blob; box: Box }) {\n const url = useObjectUrl(image)\n if (!url) return null\n return (\n <img\n src={url}\n alt=\"\"\n className=\"pointer-events-none absolute object-contain opacity-90\"\n style={{ ...boxStyle(box), objectPosition: box.x < 0.5 ? 'left bottom' : 'right bottom' }}\n data-testid=\"stage-logo\"\n />\n )\n}\n\nexport const SlideDecor = memo(function SlideDecor({\n slide,\n theme,\n labels,\n logoImage,\n editable,\n editing,\n dim,\n}: {\n slide: Pick<Slide, 'layout' | 'caption' | 'points'>\n theme: Theme\n labels: boolean\n logoImage: Blob | null\n editable: boolean\n editing?: SlideTextEditing\n dim?: boolean\n}) {\n const [typing, setTyping] = useState<'title' | 'text' | null>(null)\n const geometry = slideGeometry(slide, { labels, logo: theme.logo?.corner ?? null })\n const title = slide.caption.trim()\n const titled = slide.layout === 'title' || slide.layout === 'section'\n const info = LAYOUT_INFO[slide.layout]\n return (\n <div className={cn('pointer-events-none absolute inset-0', dim && 'opacity-30')}>\n {!geometry.title ? null : editing && typing === 'title' ? (\n <TextField\n box={geometry.title}\n value={slide.caption}\n placeholder=\"Title\"\n multiline={false}\n onChange={editing.onTitle}\n onDone={() => setTyping(null)}\n testId=\"stage-slide-caption-input\"\n />\n ) : (\n <Text\n box={geometry.title}\n lines={title ? [title] : []}\n accent={accentColor(theme.accent)}\n placeholder={editable && (titled || editing) ? 'Click to add a title' : undefined}\n onEdit={editing ? () => setTyping('title') : undefined}\n testId=\"stage-slide-caption\"\n />\n )}\n {geometry.rule && (title || (editable && titled)) && (\n <div\n className=\"absolute\"\n style={{ ...boxStyle(geometry.rule), background: accentColor(theme.accent) }}\n />\n )}\n {geometry.text &&\n (editing && typing === 'text' ? (\n <TextField\n box={geometry.text}\n value={slide.points}\n placeholder={info.text ?? ''}\n multiline\n onChange={editing.onPoints}\n onDone={() => setTyping(null)}\n testId=\"stage-slide-points-input\"\n />\n ) : (\n <Text\n box={geometry.text}\n lines={textLines(slide.points)}\n accent={accentColor(theme.accent)}\n placeholder={editable ? info.text : undefined}\n onEdit={editing ? () => setTyping('text') : undefined}\n testId=\"stage-slide-points\"\n />\n ))}\n {geometry.logo && logoImage && <Logo image={logoImage} box={geometry.logo} />}\n </div>\n )\n})\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["SlideDecor"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The presentation editor: its slides one under the other, scrolled like a PDF's pages, each one
|
|
3
|
+
* edited where it is — clips dragged, resized and reshaped on it, its title and points typed on
|
|
4
|
+
* it. Hovering a slide shows its actions (layout, move up or down, duplicate, delete); between two
|
|
5
|
+
* slides, + inserts one. One small floating bar holds the rest (Design, the host's Save and other
|
|
6
|
+
* actions, Present, "…"), so no header takes room from the slides. The clips collected for the
|
|
7
|
+
* presentation wait in the tray along the bottom, to be dragged onto any slide.
|
|
8
|
+
*
|
|
9
|
+
* The same editor shows wherever the host mounts it (the viewer's tab, or its own window).
|
|
10
|
+
*/
|
|
11
|
+
import { type ReactNode } from 'react';
|
|
12
|
+
export interface SlidesEditorProps {
|
|
13
|
+
/** Present: the host opens the shareable window. */
|
|
14
|
+
onPresent: () => void;
|
|
15
|
+
/** In the floating bar, before Present (e.g. Save, pop out). */
|
|
16
|
+
actions?: ReactNode;
|
|
17
|
+
/** At the top of the "…" menu (e.g. New from template, Save as, Export). */
|
|
18
|
+
menuItems?: ReactNode;
|
|
19
|
+
/** First in the clip tray (e.g. Generate image). */
|
|
20
|
+
trayStart?: ReactNode;
|
|
21
|
+
onChooseLogo?: () => void;
|
|
22
|
+
onEditImage?: (clipId: string) => void;
|
|
23
|
+
onCropImage?: (clipId: string) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function SlidesEditor({ onPresent, actions, menuItems, trayStart, onChooseLogo, onEditImage, onCropImage, }: SlidesEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import {
|
|
5
|
+
ArrowDown,
|
|
6
|
+
ArrowUp,
|
|
7
|
+
Circle,
|
|
8
|
+
Copy,
|
|
9
|
+
Minus,
|
|
10
|
+
MoreHorizontal,
|
|
11
|
+
Play,
|
|
12
|
+
Plus,
|
|
13
|
+
RectangleHorizontal,
|
|
14
|
+
Shapes,
|
|
15
|
+
Square,
|
|
16
|
+
Trash2,
|
|
17
|
+
Type
|
|
18
|
+
} from "lucide-react";
|
|
19
|
+
import {
|
|
20
|
+
Button,
|
|
21
|
+
DropdownMenu,
|
|
22
|
+
DropdownMenuCheckboxItem,
|
|
23
|
+
DropdownMenuContent,
|
|
24
|
+
DropdownMenuItem,
|
|
25
|
+
DropdownMenuSeparator,
|
|
26
|
+
DropdownMenuTrigger,
|
|
27
|
+
cn
|
|
28
|
+
} from "@arbidocs/react/ui";
|
|
29
|
+
import { ClipTray } from "./ClipTray.js";
|
|
30
|
+
import { DesignMenu } from "./DesignMenu.js";
|
|
31
|
+
import { LayoutMenu } from "./LayoutMenu.js";
|
|
32
|
+
import { Notice } from "./Notice.js";
|
|
33
|
+
import { PresentationStage } from "./PresentationStage.js";
|
|
34
|
+
import { usePresentation } from "./store.js";
|
|
35
|
+
import { newBox } from "./boxes.js";
|
|
36
|
+
import { accentColor, isLightBackground } from "./theme.js";
|
|
37
|
+
import { usePresenterKeys } from "./usePresenterKeys.js";
|
|
38
|
+
function SlideAction({
|
|
39
|
+
label,
|
|
40
|
+
onClick,
|
|
41
|
+
disabled,
|
|
42
|
+
children
|
|
43
|
+
}) {
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
Button,
|
|
46
|
+
{
|
|
47
|
+
type: "button",
|
|
48
|
+
size: "icon",
|
|
49
|
+
variant: "ghost",
|
|
50
|
+
className: "size-7 text-muted-foreground hover:text-foreground pointer-coarse:size-10",
|
|
51
|
+
title: label,
|
|
52
|
+
"aria-label": label,
|
|
53
|
+
disabled,
|
|
54
|
+
onClick,
|
|
55
|
+
children
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
const SlideCard = memo(function SlideCard2({
|
|
60
|
+
index,
|
|
61
|
+
count,
|
|
62
|
+
current,
|
|
63
|
+
selected,
|
|
64
|
+
onSelect,
|
|
65
|
+
onEditImage,
|
|
66
|
+
onCropImage
|
|
67
|
+
}) {
|
|
68
|
+
const empty = usePresentation((s) => {
|
|
69
|
+
const slide = s.slides[index];
|
|
70
|
+
return !!slide && !slide.items.length && !slide.boxes.length && slide.layout !== "title" && slide.layout !== "section";
|
|
71
|
+
});
|
|
72
|
+
const notes = usePresentation((s) => s.slides[index]?.notes ?? "");
|
|
73
|
+
const textEditing = useMemo(
|
|
74
|
+
() => ({
|
|
75
|
+
onTitle: (title) => usePresentation.getState().setSlideCaption(title, index),
|
|
76
|
+
onPoints: (points) => usePresentation.getState().setSlidePoints(points, index)
|
|
77
|
+
}),
|
|
78
|
+
[index]
|
|
79
|
+
);
|
|
80
|
+
const select = useCallback((clipId) => onSelect(index, clipId), [onSelect, index]);
|
|
81
|
+
const actions = usePresentation.getState();
|
|
82
|
+
return /* @__PURE__ */ jsxs("div", { className: "group relative flex gap-2", "data-testid": `slide-${index}`, children: [
|
|
83
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-9 shrink-0 flex-col items-center gap-0.5", children: [
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
"span",
|
|
86
|
+
{
|
|
87
|
+
className: cn(
|
|
88
|
+
"py-1 text-xs tabular-nums",
|
|
89
|
+
current ? "font-semibold text-foreground" : "text-muted-foreground"
|
|
90
|
+
),
|
|
91
|
+
children: index + 1
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ jsxs(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: cn(
|
|
98
|
+
"flex flex-col items-center gap-0.5 transition-opacity",
|
|
99
|
+
"opacity-0 focus-within:opacity-100 group-hover:opacity-100",
|
|
100
|
+
current && "pointer-coarse:opacity-100"
|
|
101
|
+
),
|
|
102
|
+
"data-testid": `slide-actions-${index}`,
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsx(LayoutMenu, { index, compact: true }),
|
|
105
|
+
/* @__PURE__ */ jsx(
|
|
106
|
+
SlideAction,
|
|
107
|
+
{
|
|
108
|
+
label: "Move up",
|
|
109
|
+
disabled: index === 0,
|
|
110
|
+
onClick: () => actions.moveSlide(index, index - 1),
|
|
111
|
+
children: /* @__PURE__ */ jsx(ArrowUp, { className: "size-3.5" })
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
115
|
+
SlideAction,
|
|
116
|
+
{
|
|
117
|
+
label: "Move down",
|
|
118
|
+
disabled: index === count - 1,
|
|
119
|
+
onClick: () => actions.moveSlide(index, index + 1),
|
|
120
|
+
children: /* @__PURE__ */ jsx(ArrowDown, { className: "size-3.5" })
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
/* @__PURE__ */ jsx(SlideAction, { label: "Duplicate", onClick: () => actions.duplicateSlide(index), children: /* @__PURE__ */ jsx(Copy, { className: "size-3.5" }) }),
|
|
124
|
+
/* @__PURE__ */ jsx(SlideAction, { label: "Delete slide", onClick: () => actions.removeSlide(index), children: /* @__PURE__ */ jsx(Trash2, { className: "size-3.5" }) })
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ jsxs(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
className: cn(
|
|
133
|
+
"relative aspect-video min-w-0 flex-1 rounded-sm",
|
|
134
|
+
current && "ring-1 ring-primary/40 ring-offset-4 ring-offset-transparent"
|
|
135
|
+
),
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ jsx(
|
|
138
|
+
PresentationStage,
|
|
139
|
+
{
|
|
140
|
+
editable: true,
|
|
141
|
+
slideIndex: index,
|
|
142
|
+
selected,
|
|
143
|
+
onSelect: select,
|
|
144
|
+
onEditImage,
|
|
145
|
+
onCropImage,
|
|
146
|
+
textEditing,
|
|
147
|
+
overlay: empty && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-[8%] flex justify-center", children: /* @__PURE__ */ jsx("span", { className: "rounded-full bg-black/40 px-3 py-1 text-[1.4cqw] text-white/70", children: "Drag a clip here from the tray" }) })
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
(notes || current) && /* @__PURE__ */ jsx(
|
|
151
|
+
"textarea",
|
|
152
|
+
{
|
|
153
|
+
value: notes,
|
|
154
|
+
rows: notes.split("\n").length,
|
|
155
|
+
placeholder: "Speaker notes",
|
|
156
|
+
onChange: (event) => usePresentation.getState().setSlideNotes(event.target.value, index),
|
|
157
|
+
className: "mt-2 block w-full resize-none rounded-sm border-0 bg-transparent px-1 py-0.5 text-xs text-muted-foreground placeholder:text-muted-foreground/50 focus:bg-background focus:text-foreground focus:outline-none focus:ring-1 focus:ring-ring",
|
|
158
|
+
"aria-label": `Speaker notes for slide ${index + 1}`,
|
|
159
|
+
"data-testid": `slide-notes-${index}`
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
] });
|
|
166
|
+
});
|
|
167
|
+
const INSERTS = [
|
|
168
|
+
{ shape: "text", label: "Text box", icon: /* @__PURE__ */ jsx(Type, { className: "size-4" }) },
|
|
169
|
+
{ shape: "rect", label: "Rectangle", icon: /* @__PURE__ */ jsx(Square, { className: "size-4" }) },
|
|
170
|
+
{
|
|
171
|
+
shape: "roundRect",
|
|
172
|
+
label: "Rounded rectangle",
|
|
173
|
+
icon: /* @__PURE__ */ jsx(RectangleHorizontal, { className: "size-4" })
|
|
174
|
+
},
|
|
175
|
+
{ shape: "ellipse", label: "Ellipse", icon: /* @__PURE__ */ jsx(Circle, { className: "size-4" }) },
|
|
176
|
+
{ shape: "line", label: "Line", icon: /* @__PURE__ */ jsx(Minus, { className: "size-4" }) }
|
|
177
|
+
];
|
|
178
|
+
function InsertMenu({ onInserted }) {
|
|
179
|
+
const insert = (shape) => {
|
|
180
|
+
const state = usePresentation.getState();
|
|
181
|
+
const slide = state.slides[state.current];
|
|
182
|
+
const box = newBox(shape, accentColor(state.theme.accent));
|
|
183
|
+
const dark = isLightBackground(slide?.background);
|
|
184
|
+
const { id, ...rest } = dark ? {
|
|
185
|
+
...box,
|
|
186
|
+
paragraphs: box.paragraphs.map((p) => ({
|
|
187
|
+
...p,
|
|
188
|
+
runs: p.runs.map((r) => ({ color: "#1f2328", ...r }))
|
|
189
|
+
}))
|
|
190
|
+
} : box;
|
|
191
|
+
void id;
|
|
192
|
+
onInserted(state.current, state.addBox(rest));
|
|
193
|
+
};
|
|
194
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
195
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
196
|
+
Button,
|
|
197
|
+
{
|
|
198
|
+
type: "button",
|
|
199
|
+
size: "icon",
|
|
200
|
+
variant: "ghost",
|
|
201
|
+
className: "size-8 text-muted-foreground hover:text-foreground pointer-coarse:size-11",
|
|
202
|
+
title: "Insert a text box or shape",
|
|
203
|
+
"aria-label": "Insert",
|
|
204
|
+
"data-testid": "slides-insert",
|
|
205
|
+
children: /* @__PURE__ */ jsx(Shapes, { className: "size-4" })
|
|
206
|
+
}
|
|
207
|
+
) }),
|
|
208
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", children: INSERTS.map(({ shape, label, icon }) => /* @__PURE__ */ jsxs(
|
|
209
|
+
DropdownMenuItem,
|
|
210
|
+
{
|
|
211
|
+
onSelect: () => insert(shape),
|
|
212
|
+
"data-testid": `slides-insert-${shape}`,
|
|
213
|
+
children: [
|
|
214
|
+
icon,
|
|
215
|
+
/* @__PURE__ */ jsx("span", { className: "ml-2", children: label })
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
shape
|
|
219
|
+
)) })
|
|
220
|
+
] });
|
|
221
|
+
}
|
|
222
|
+
function InsertSlide({ after, always }) {
|
|
223
|
+
return /* @__PURE__ */ jsx("div", { className: "group/insert relative flex h-8 items-center justify-center pl-11", children: /* @__PURE__ */ jsxs(
|
|
224
|
+
"button",
|
|
225
|
+
{
|
|
226
|
+
type: "button",
|
|
227
|
+
onClick: () => usePresentation.getState().addSlide(void 0, after),
|
|
228
|
+
className: cn(
|
|
229
|
+
"flex items-center gap-1 rounded-full border border-dashed border-border bg-background px-2.5 py-0.5 text-xs text-muted-foreground transition-opacity hover:border-solid hover:text-foreground focus-visible:opacity-100",
|
|
230
|
+
!always && "opacity-0 group-hover/insert:opacity-100 pointer-coarse:opacity-100"
|
|
231
|
+
),
|
|
232
|
+
"aria-label": `New slide after slide ${after + 1}`,
|
|
233
|
+
"data-testid": `slide-insert-${after}`,
|
|
234
|
+
children: [
|
|
235
|
+
/* @__PURE__ */ jsx(Plus, { className: "size-3" }),
|
|
236
|
+
"Slide"
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
) });
|
|
240
|
+
}
|
|
241
|
+
function SlidesEditor({
|
|
242
|
+
onPresent,
|
|
243
|
+
actions,
|
|
244
|
+
menuItems,
|
|
245
|
+
trayStart,
|
|
246
|
+
onChooseLogo,
|
|
247
|
+
onEditImage,
|
|
248
|
+
onCropImage
|
|
249
|
+
}) {
|
|
250
|
+
const ids = usePresentation((s) => s.slides.map((slide) => slide.id).join(" "));
|
|
251
|
+
const slideIds = useMemo(() => ids.split(" "), [ids]);
|
|
252
|
+
const current = usePresentation((s) => s.current);
|
|
253
|
+
const captions = usePresentation((s) => s.captions);
|
|
254
|
+
const presenting = usePresentation((s) => s.presenting);
|
|
255
|
+
const [selection, setSelection] = useState(null);
|
|
256
|
+
const [view, setView] = useState(null);
|
|
257
|
+
const list = useRef(null);
|
|
258
|
+
const rootRef = useCallback((node) => {
|
|
259
|
+
if (node) setView(node.ownerDocument.defaultView);
|
|
260
|
+
}, []);
|
|
261
|
+
const onSelect = useCallback((index, clipId) => {
|
|
262
|
+
setSelection(clipId ? { index, clipId } : null);
|
|
263
|
+
}, []);
|
|
264
|
+
const keySelection = useMemo(
|
|
265
|
+
() => ({ clipId: selection?.clipId ?? null, clear: () => setSelection(null) }),
|
|
266
|
+
[selection]
|
|
267
|
+
);
|
|
268
|
+
usePresenterKeys(view, false, keySelection);
|
|
269
|
+
useEffect(() => {
|
|
270
|
+
const card = list.current?.querySelector(`[data-testid="slide-${current}"]`);
|
|
271
|
+
card?.scrollIntoView?.({ block: "nearest", behavior: "smooth" });
|
|
272
|
+
}, [current, slideIds.length]);
|
|
273
|
+
return /* @__PURE__ */ jsxs(
|
|
274
|
+
"div",
|
|
275
|
+
{
|
|
276
|
+
ref: rootRef,
|
|
277
|
+
className: "relative flex h-full min-h-0 flex-col bg-muted/30",
|
|
278
|
+
"data-testid": "slides-editor",
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ jsx("div", { ref: list, className: "min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "mx-auto flex max-w-[1100px] flex-col pb-6 pl-2 pr-6 pt-14", children: slideIds.map((id, index) => /* @__PURE__ */ jsxs("div", { children: [
|
|
281
|
+
/* @__PURE__ */ jsx(
|
|
282
|
+
SlideCard,
|
|
283
|
+
{
|
|
284
|
+
index,
|
|
285
|
+
count: slideIds.length,
|
|
286
|
+
current: index === current,
|
|
287
|
+
selected: selection?.index === index ? selection.clipId : null,
|
|
288
|
+
onSelect,
|
|
289
|
+
onEditImage,
|
|
290
|
+
onCropImage
|
|
291
|
+
}
|
|
292
|
+
),
|
|
293
|
+
/* @__PURE__ */ jsx(InsertSlide, { after: index, always: index === slideIds.length - 1 })
|
|
294
|
+
] }, id)) }) }),
|
|
295
|
+
/* @__PURE__ */ jsxs(
|
|
296
|
+
"div",
|
|
297
|
+
{
|
|
298
|
+
className: "absolute right-4 top-2.5 z-40 flex items-center gap-0.5 rounded-full border border-border bg-background p-1 shadow-md",
|
|
299
|
+
"data-testid": "slides-toolbar",
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ jsx(DesignMenu, { onChooseLogo }),
|
|
302
|
+
/* @__PURE__ */ jsx(InsertMenu, { onInserted: (index, boxId) => setSelection({ index, clipId: boxId }) }),
|
|
303
|
+
actions,
|
|
304
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
305
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
306
|
+
Button,
|
|
307
|
+
{
|
|
308
|
+
type: "button",
|
|
309
|
+
size: "icon",
|
|
310
|
+
variant: "ghost",
|
|
311
|
+
className: "size-8 text-muted-foreground hover:text-foreground pointer-coarse:size-11",
|
|
312
|
+
title: "More",
|
|
313
|
+
"aria-label": "More",
|
|
314
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" })
|
|
315
|
+
}
|
|
316
|
+
) }),
|
|
317
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", children: [
|
|
318
|
+
menuItems,
|
|
319
|
+
menuItems && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
320
|
+
/* @__PURE__ */ jsx(
|
|
321
|
+
DropdownMenuCheckboxItem,
|
|
322
|
+
{
|
|
323
|
+
checked: captions,
|
|
324
|
+
onCheckedChange: (on) => usePresentation.getState().setCaptions(!!on),
|
|
325
|
+
children: "Show source labels"
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
] })
|
|
329
|
+
] }),
|
|
330
|
+
presenting ? /* @__PURE__ */ jsxs(
|
|
331
|
+
Button,
|
|
332
|
+
{
|
|
333
|
+
type: "button",
|
|
334
|
+
size: "sm",
|
|
335
|
+
variant: "destructive",
|
|
336
|
+
className: "ml-0.5 h-8 rounded-full",
|
|
337
|
+
onClick: () => usePresentation.getState().setPresenting(false),
|
|
338
|
+
title: "Stop presenting (the presentation window closes)",
|
|
339
|
+
"data-testid": "presentation-stop-button",
|
|
340
|
+
children: [
|
|
341
|
+
/* @__PURE__ */ jsx(Square, { className: "size-3 fill-current" }),
|
|
342
|
+
"Stop presenting"
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
) : /* @__PURE__ */ jsxs(
|
|
346
|
+
Button,
|
|
347
|
+
{
|
|
348
|
+
type: "button",
|
|
349
|
+
size: "sm",
|
|
350
|
+
className: "ml-0.5 h-8 rounded-full",
|
|
351
|
+
onClick: () => {
|
|
352
|
+
setSelection(null);
|
|
353
|
+
onPresent();
|
|
354
|
+
},
|
|
355
|
+
title: "Present: the slides alone, in a window to share or put full screen",
|
|
356
|
+
"data-testid": "presentation-present-button",
|
|
357
|
+
children: [
|
|
358
|
+
/* @__PURE__ */ jsx(Play, { className: "size-3.5" }),
|
|
359
|
+
"Present"
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
)
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
),
|
|
366
|
+
/* @__PURE__ */ jsx(ClipTray, { start: trayStart }),
|
|
367
|
+
/* @__PURE__ */ jsx(Notice, {})
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
export {
|
|
373
|
+
SlidesEditor
|
|
374
|
+
};
|
|
375
|
+
//# sourceMappingURL=SlidesEditor.js.map
|