@arbidocs/blocks 0.5.121 → 0.5.123
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 → ClippingMediaViewer-IEIBT74X.cjs} +8 -8
- package/dist/{ClippingMediaViewer-B6WG7Q64.cjs.map → ClippingMediaViewer-IEIBT74X.cjs.map} +1 -1
- package/dist/{ClippingPdfViewer-6GCVTV3V.cjs → ClippingPdfViewer-OGYLMVCE.cjs} +5 -5
- package/dist/{ClippingPdfViewer-6GCVTV3V.cjs.map → ClippingPdfViewer-OGYLMVCE.cjs.map} +1 -1
- package/dist/{ConnectedCallDock-DC5V5OUJ.cjs → ConnectedCallDock-XJOYVVAH.cjs} +21 -21
- package/dist/{ConnectedCallDock-DC5V5OUJ.cjs.map → ConnectedCallDock-XJOYVVAH.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-FQLXWTFB.cjs → ConnectedCallRoom-CUDYAPQK.cjs} +14 -14
- package/dist/{ConnectedCallRoom-FQLXWTFB.cjs.map → ConnectedCallRoom-CUDYAPQK.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-4Q5S7VLD.cjs → ConnectedNativeDocxComparison-QKHCYD6W.cjs} +15 -15
- package/dist/{ConnectedNativeDocxComparison-4Q5S7VLD.cjs.map → ConnectedNativeDocxComparison-QKHCYD6W.cjs.map} +1 -1
- package/dist/ConnectedPresentation-5DOJ35XL.cjs +321 -0
- package/dist/ConnectedPresentation-5DOJ35XL.cjs.map +1 -0
- package/dist/{ConnectedProductionSetDialog-4EAY6KAZ.cjs → ConnectedProductionSetDialog-LHB4VQWC.cjs} +3 -3
- package/dist/{ConnectedProductionSetDialog-4EAY6KAZ.cjs.map → ConnectedProductionSetDialog-LHB4VQWC.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-7QDE2CZD.cjs → ConnectedSlidesTab-7YMEDGUU.cjs} +73 -49
- package/dist/ConnectedSlidesTab-7YMEDGUU.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-FFOQJBOI.cjs → ConnectedStreamedWordArtifact-AG62232A.cjs} +15 -15
- package/dist/{ConnectedStreamedWordArtifact-FFOQJBOI.cjs.map → ConnectedStreamedWordArtifact-AG62232A.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-SNWVEZ7S.cjs → DocumentReviewCard-M53XFLI2.cjs} +15 -15
- package/dist/{DocumentReviewCard-SNWVEZ7S.cjs.map → DocumentReviewCard-M53XFLI2.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-IZI63FOV.cjs → FilesViewerDialog-2QCCRWF2.cjs} +50 -49
- package/dist/FilesViewerDialog-2QCCRWF2.cjs.map +1 -0
- package/dist/{WorkspaceTableView-TEIRB6VJ.cjs → WorkspaceTableView-3XYAV4BV.cjs} +8 -8
- package/dist/{WorkspaceTableView-TEIRB6VJ.cjs.map → WorkspaceTableView-3XYAV4BV.cjs.map} +1 -1
- package/dist/agents/index.cjs +296 -296
- package/dist/{ai-KBYNRNZ6.cjs → ai-IEIR7SC2.cjs} +25 -25
- package/dist/ai-IEIR7SC2.cjs.map +1 -0
- package/dist/calls/index.cjs +121 -121
- package/dist/chat/index.cjs +1 -1
- package/dist/{chunk-NLOETJCB.cjs → chunk-2F57IO7S.cjs} +12 -12
- package/dist/{chunk-NLOETJCB.cjs.map → chunk-2F57IO7S.cjs.map} +1 -1
- package/dist/chunk-2RLA6QO2.cjs +174 -0
- package/dist/chunk-2RLA6QO2.cjs.map +1 -0
- package/dist/{chunk-Q6DQGGP4.cjs → chunk-325GVZE6.cjs} +3 -3
- package/dist/{chunk-Q6DQGGP4.cjs.map → chunk-325GVZE6.cjs.map} +1 -1
- package/dist/{chunk-LHWOKOMP.cjs → chunk-46P7IDBX.cjs} +3 -3
- package/dist/chunk-46P7IDBX.cjs.map +1 -0
- package/dist/{chunk-XTR26TNE.cjs → chunk-4TTX6ZNS.cjs} +20 -4
- package/dist/chunk-4TTX6ZNS.cjs.map +1 -0
- package/dist/{chunk-BVAT4EVC.cjs → chunk-5QERK4PK.cjs} +35 -35
- package/dist/{chunk-BVAT4EVC.cjs.map → chunk-5QERK4PK.cjs.map} +1 -1
- package/dist/{chunk-GX2EBMJW.cjs → chunk-6OK7ESTL.cjs} +7 -6
- package/dist/chunk-6OK7ESTL.cjs.map +1 -0
- package/dist/{chunk-C2OICDMI.cjs → chunk-7557LDAN.cjs} +10 -10
- package/dist/{chunk-C2OICDMI.cjs.map → chunk-7557LDAN.cjs.map} +1 -1
- package/dist/{chunk-474GPLCM.cjs → chunk-7L4X6QN2.cjs} +6 -6
- package/dist/{chunk-474GPLCM.cjs.map → chunk-7L4X6QN2.cjs.map} +1 -1
- package/dist/{chunk-52KGMAO5.cjs → chunk-7NLO7ASW.cjs} +15 -15
- package/dist/{chunk-52KGMAO5.cjs.map → chunk-7NLO7ASW.cjs.map} +1 -1
- package/dist/{chunk-H5OLHP2U.cjs → chunk-7OPOPYV6.cjs} +3 -3
- package/dist/{chunk-H5OLHP2U.cjs.map → chunk-7OPOPYV6.cjs.map} +1 -1
- package/dist/{chunk-W6B3RYTX.cjs → chunk-7PN3YENO.cjs} +4 -4
- package/dist/{chunk-W6B3RYTX.cjs.map → chunk-7PN3YENO.cjs.map} +1 -1
- package/dist/{chunk-734NPQNR.cjs → chunk-ADDQKZ5I.cjs} +4 -4
- package/dist/{chunk-734NPQNR.cjs.map → chunk-ADDQKZ5I.cjs.map} +1 -1
- package/dist/{chunk-JQLWKNJO.cjs → chunk-ALK3PUUB.cjs} +4 -4
- package/dist/{chunk-JQLWKNJO.cjs.map → chunk-ALK3PUUB.cjs.map} +1 -1
- package/dist/{chunk-4VZZWYEC.cjs → chunk-BQ5RIWWT.cjs} +3 -3
- package/dist/{chunk-4VZZWYEC.cjs.map → chunk-BQ5RIWWT.cjs.map} +1 -1
- package/dist/{chunk-Q3XJUXID.cjs → chunk-DWMWEALB.cjs} +499 -409
- package/dist/chunk-DWMWEALB.cjs.map +1 -0
- package/dist/{chunk-3SCNXNHI.cjs → chunk-E3L5DB5F.cjs} +5 -5
- package/dist/{chunk-3SCNXNHI.cjs.map → chunk-E3L5DB5F.cjs.map} +1 -1
- package/dist/{chunk-VJ5ZLRBD.cjs → chunk-GFUOCGY6.cjs} +8 -3
- package/dist/chunk-GFUOCGY6.cjs.map +1 -0
- package/dist/{chunk-7VUJGHMY.cjs → chunk-JD2HX2BR.cjs} +272 -156
- package/dist/chunk-JD2HX2BR.cjs.map +1 -0
- package/dist/{chunk-RYVZDFVO.cjs → chunk-JJZOL5MG.cjs} +3 -3
- package/dist/{chunk-RYVZDFVO.cjs.map → chunk-JJZOL5MG.cjs.map} +1 -1
- package/dist/{chunk-QFXILJMJ.cjs → chunk-K4763GD5.cjs} +17 -174
- package/dist/chunk-K4763GD5.cjs.map +1 -0
- package/dist/{chunk-EHP6OH5D.cjs → chunk-KA3F6TIH.cjs} +11 -11
- package/dist/{chunk-EHP6OH5D.cjs.map → chunk-KA3F6TIH.cjs.map} +1 -1
- package/dist/{chunk-UUENH4BJ.cjs → chunk-KXIRVKCJ.cjs} +3 -3
- package/dist/{chunk-UUENH4BJ.cjs.map → chunk-KXIRVKCJ.cjs.map} +1 -1
- package/dist/{chunk-AY6EZSZB.cjs → chunk-L4CIFLCU.cjs} +4 -4
- package/dist/{chunk-AY6EZSZB.cjs.map → chunk-L4CIFLCU.cjs.map} +1 -1
- package/dist/{chunk-4RBQ44RY.cjs → chunk-MLA2BJ2Y.cjs} +28 -28
- package/dist/{chunk-4RBQ44RY.cjs.map → chunk-MLA2BJ2Y.cjs.map} +1 -1
- package/dist/{chunk-DR2AH7JL.cjs → chunk-NG2EE7HR.cjs} +48 -48
- package/dist/{chunk-DR2AH7JL.cjs.map → chunk-NG2EE7HR.cjs.map} +1 -1
- package/dist/{chunk-ENGL7P3I.cjs → chunk-NQML7IUC.cjs} +26 -26
- package/dist/{chunk-ENGL7P3I.cjs.map → chunk-NQML7IUC.cjs.map} +1 -1
- package/dist/{chunk-4NPCDS2X.cjs → chunk-NY3YUCOW.cjs} +3 -3
- package/dist/{chunk-4NPCDS2X.cjs.map → chunk-NY3YUCOW.cjs.map} +1 -1
- package/dist/{chunk-JZEYHDWJ.cjs → chunk-OHHKBURG.cjs} +76 -76
- package/dist/chunk-OHHKBURG.cjs.map +1 -0
- package/dist/{chunk-5534FYXP.cjs → chunk-SDRYSLOX.cjs} +4 -4
- package/dist/{chunk-5534FYXP.cjs.map → chunk-SDRYSLOX.cjs.map} +1 -1
- package/dist/{chunk-2W5E62EY.cjs → chunk-SGYSDABK.cjs} +6 -6
- package/dist/{chunk-2W5E62EY.cjs.map → chunk-SGYSDABK.cjs.map} +1 -1
- package/dist/{chunk-KP5AITQ4.cjs → chunk-SNPK3R3O.cjs} +7 -7
- package/dist/{chunk-KP5AITQ4.cjs.map → chunk-SNPK3R3O.cjs.map} +1 -1
- package/dist/{chunk-EATIFPKP.cjs → chunk-T73BHNQX.cjs} +4 -4
- package/dist/{chunk-EATIFPKP.cjs.map → chunk-T73BHNQX.cjs.map} +1 -1
- package/dist/{chunk-4IOYQLKG.cjs → chunk-TP5PGWIO.cjs} +3 -3
- package/dist/{chunk-4IOYQLKG.cjs.map → chunk-TP5PGWIO.cjs.map} +1 -1
- package/dist/{chunk-GKVE5JGB.cjs → chunk-UFT22LAB.cjs} +3 -3
- package/dist/{chunk-GKVE5JGB.cjs.map → chunk-UFT22LAB.cjs.map} +1 -1
- package/dist/{chunk-FKFQCK3C.cjs → chunk-V6MW7B4B.cjs} +4 -4
- package/dist/{chunk-FKFQCK3C.cjs.map → chunk-V6MW7B4B.cjs.map} +1 -1
- package/dist/{chunk-2PZT3J34.cjs → chunk-VWBYE3XY.cjs} +6 -6
- package/dist/{chunk-2PZT3J34.cjs.map → chunk-VWBYE3XY.cjs.map} +1 -1
- package/dist/{chunk-GQXPNIRE.cjs → chunk-WAV762GP.cjs} +6 -6
- package/dist/{chunk-GQXPNIRE.cjs.map → chunk-WAV762GP.cjs.map} +1 -1
- package/dist/{chunk-5LTIZ44D.cjs → chunk-WFMWKPGY.cjs} +14 -7
- package/dist/chunk-WFMWKPGY.cjs.map +1 -0
- package/dist/{chunk-GPX5VC57.cjs → chunk-WV7BCGCK.cjs} +50 -50
- package/dist/{chunk-GPX5VC57.cjs.map → chunk-WV7BCGCK.cjs.map} +1 -1
- package/dist/{chunk-MZ2KZXNU.cjs → chunk-WXUU3COI.cjs} +3 -3
- package/dist/{chunk-MZ2KZXNU.cjs.map → chunk-WXUU3COI.cjs.map} +1 -1
- package/dist/{chunk-NAJN32MF.cjs → chunk-XF355M7O.cjs} +13 -13
- package/dist/{chunk-NAJN32MF.cjs.map → chunk-XF355M7O.cjs.map} +1 -1
- package/dist/connect/docx.cjs +18 -18
- package/dist/connect/index.cjs +995 -994
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +38 -37
- package/dist/connection/conversation/ConnectedMessage.js +1 -1
- package/dist/connection/conversation/ConnectedMessage.js.map +2 -2
- package/dist/connection/presentation/ConnectedSlidesTab.js +39 -15
- package/dist/connection/presentation/ConnectedSlidesTab.js.map +2 -2
- package/dist/connection/presentation/PresentationPill.js +3 -8
- package/dist/connection/presentation/PresentationPill.js.map +2 -2
- package/dist/connection/presentation/requests.d.ts +5 -0
- package/dist/connection/presentation/requests.js +8 -1
- package/dist/connection/presentation/requests.js.map +2 -2
- package/dist/connection/viewer/ConnectedDocumentViewer.js +51 -60
- package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
- package/dist/connection/viewer/ViewerMoreMenu.d.ts +18 -0
- package/dist/connection/viewer/ViewerMoreMenu.js +45 -0
- package/dist/connection/viewer/ViewerMoreMenu.js.map +7 -0
- package/dist/connection/viewer/ViewerPdfPane.js +4 -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/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/PdfPassageHighlights.js +3 -2
- package/dist/connection/viewer/pdf/PdfPassageHighlights.js.map +2 -2
- 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/dashboards/index.cjs +1 -1
- package/dist/document-tools/DocumentToolButtons.js +2 -2
- package/dist/document-tools/DocumentToolButtons.js.map +2 -2
- package/dist/document-tools/index.cjs +13 -13
- package/dist/embed/index.cjs +38 -38
- package/dist/files/index.cjs +224 -224
- package/dist/index.cjs +1596 -1595
- package/dist/index.cjs.map +1 -1
- package/dist/presentation/BoxActionBar.d.ts +2 -2
- package/dist/presentation/BoxActionBar.js +62 -30
- package/dist/presentation/BoxActionBar.js.map +2 -2
- package/dist/presentation/ClipActionBar.js +60 -7
- package/dist/presentation/ClipActionBar.js.map +2 -2
- package/dist/presentation/ClipViewControls.d.ts +3 -3
- package/dist/presentation/ClipViewControls.js +59 -64
- package/dist/presentation/ClipViewControls.js.map +2 -2
- 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/PresenterView.js +36 -5
- package/dist/presentation/PresenterView.js.map +2 -2
- package/dist/presentation/SlidesEditor.js +73 -43
- package/dist/presentation/SlidesEditor.js.map +2 -2
- package/dist/presentation/StageItem.js +0 -5
- package/dist/presentation/StageItem.js.map +2 -2
- package/dist/presentation/panel-id.d.ts +12 -2
- package/dist/presentation/panel-id.js +6 -1
- package/dist/presentation/panel-id.js.map +2 -2
- package/dist/presentation/slide-layout.d.ts +5 -1
- package/dist/presentation/slide-layout.js +16 -0
- package/dist/presentation/slide-layout.js.map +2 -2
- package/dist/settings/index.cjs +146 -146
- package/dist/shell/PanelPortal.js +13 -4
- package/dist/shell/PanelPortal.js.map +2 -2
- package/dist/shell/index.cjs +92 -91
- package/dist/shell/panel-windows.js +1 -0
- package/dist/shell/panel-windows.js.map +2 -2
- package/dist/studio/index.cjs +28 -28
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +52 -52
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedPresentation-4HLDZDWV.cjs +0 -183
- package/dist/ConnectedPresentation-4HLDZDWV.cjs.map +0 -1
- package/dist/ConnectedSlidesTab-7QDE2CZD.cjs.map +0 -1
- package/dist/FilesViewerDialog-IZI63FOV.cjs.map +0 -1
- package/dist/ai-KBYNRNZ6.cjs.map +0 -1
- package/dist/chunk-5LTIZ44D.cjs.map +0 -1
- package/dist/chunk-7VUJGHMY.cjs.map +0 -1
- package/dist/chunk-GX2EBMJW.cjs.map +0 -1
- package/dist/chunk-JZEYHDWJ.cjs.map +0 -1
- package/dist/chunk-LHWOKOMP.cjs.map +0 -1
- package/dist/chunk-Q3XJUXID.cjs.map +0 -1
- package/dist/chunk-QFXILJMJ.cjs.map +0 -1
- package/dist/chunk-VJ5ZLRBD.cjs.map +0 -1
- package/dist/chunk-XTR26TNE.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/presentation/ConnectedSlidesTab.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * A presentation's slides tab in the document viewer: the slides editor, on the presentation the\n * viewer shows. Opening a saved presentation loads it (unless it is the one being edited); a new\n * one (a presentation draft) takes the clips gathered so far. Clips gathered with no presentation\n * open join the one opened next. Saving a draft makes it a document, and the tab moves to it.\n *\n * The editor can also move to the presentation's own window (Pop out), beside the documents its\n * clips come from; the tab then says so. Present opens that window with the slides alone.\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { ExternalLink, Loader2, PanelLeftClose, Presentation } from 'lucide-react'\nimport {\n isPanelOpen,\n registerDocumentTurnFlush,\n useArbiSessionState,\n useArbiSessionStore,\n} from '@arbidocs/react'\nimport { Button } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport {\n PRESENTATION_PANEL,\n openPresentation,\n presentationWindowOnlyPresents,\n} from '../../presentation/panel-id'\nimport { SlidesEditor } from '../../presentation/SlidesEditor'\nimport { hasUnsavedChanges, usePresentation } from '../../presentation/store'\nimport { EmptyState } from '../../components/EmptyState'\nimport { editPresentation } from './requests'\nimport { usePresentationController } from './usePresentationController'\nimport { usePresentationFiles } from './usePresentationFiles'\n\nexport interface ConnectedSlidesTabProps {\n /** The viewed document's id, or a presentation draft's (`draft-\u2026`). */\n documentId: string\n /** The version on screen, when an older one. */\n version?: number\n /** The document's current version: a newer one than the one being edited is opened. */\n currentVersion?: number\n /** A new presentation, not saved yet: its draft title. */\n draftTitle?: string\n}\n\n/** \"2, 3 and 5\". */\nconst listOf = (numbers: number[]) =>\n numbers.length < 2\n ? String(numbers[0] ?? '')\n : `${numbers.slice(0, -1).join(', ')} and ${numbers[numbers.length - 1]}`\n\nconst STALE = 'This presentation was changed outside the editor: Save to draw its slides again.'\n\n/** The presentation has anything in it worth asking about before it is replaced. */\nconst hasContent = () => hasUnsavedChanges(usePresentation.getState())\n\nexport function ConnectedSlidesTab({\n documentId,\n version,\n currentVersion,\n draftTitle,\n}: ConnectedSlidesTabProps) {\n const session = useArbiSessionStore()\n const { confirm } = useBlocksEnvironment()\n const { open, save } = usePresentationFiles()\n const notify = usePresentation((s) => s.notify)\n const boundTo = usePresentation((s) => s.boundTo)\n const savedId = usePresentation((s) => s.savedId)\n const [loading, setLoading] = useState(false)\n const isDraft = draftTitle !== undefined\n const target = version ? `${documentId}@v${version}` : documentId\n const poppedOut = useArbiSessionState(\n (state) => isPanelOpen(state, PRESENTATION_PANEL) && !presentationWindowOnlyPresents()\n )\n const controller = usePresentationController(!poppedOut)\n const asked = useRef<string | null>(null)\n // Another presentation, with changes, is being edited and the user kept it.\n const [declined, setDeclined] = useState(false)\n const [force, setForce] = useState(0)\n\n // Show the presentation this tab is for (once per presentation: a remount does not ask again).\n useEffect(() => {\n const state = usePresentation.getState()\n if (state.boundTo === target || asked.current === `${target}#${force}`) return\n asked.current = `${target}#${force}`\n setDeclined(false)\n void (async () => {\n // Clips gathered with no presentation open join this one.\n const gathered = state.boundTo === null ? state.clips : []\n if (state.boundTo !== null && hasContent() && !force) {\n const ok = await confirm({\n title: 'Open presentation',\n message: 'Replace the presentation being edited? Save it first to keep its changes.',\n kind: 'confirm',\n })\n if (!ok) return setDeclined(true)\n }\n if (isDraft) {\n if (state.boundTo !== null) state.reset()\n usePresentation.getState().bind(target)\n usePresentation.getState().setTitle(draftTitle || 'Untitled presentation')\n return\n }\n setLoading(true)\n try {\n const { missing, stale, imported, changedOutside } = await open(documentId, version)\n usePresentation.getState().bind(target)\n if (gathered.length) usePresentation.getState().adoptClips(gathered)\n if (stale) notify(STALE, 'error')\n if (imported) {\n notify(\n ['Opened from PowerPoint, ready to edit.', ...imported.notes].join(' \u00B7 '),\n 'success'\n )\n }\n if (changedOutside) {\n notify(\n `${changedOutside.length === 1 ? `Slide ${changedOutside[0]} was` : `Slides ${listOf(changedOutside)} were`} changed in PowerPoint: brought in as changed there.`,\n 'success'\n )\n }\n if (missing) {\n notify(\n `${missing} clip${missing === 1 ? '' : 's'} could not be opened (moved, deleted or not shared with you)`,\n 'error'\n )\n }\n } catch (error) {\n notify(\n error instanceof Error ? error.message : 'The presentation could not be opened',\n 'error'\n )\n } finally {\n setLoading(false)\n }\n })()\n // eslint-disable-next-line react-hooks/exhaustive-deps -- a draft's title changes as it is typed\n }, [target, documentId, version, isDraft, force, open, confirm, notify])\n\n // A draft's title is the presentation's.\n useEffect(() => {\n if (isDraft && boundTo === target && draftTitle) usePresentation.getState().setTitle(draftTitle)\n }, [isDraft, boundTo, target, draftTitle])\n\n // Saved as another document (a draft's first save, Save as, an older file saved as a\n // PowerPoint): the viewer follows it. Only once this tab's presentation was the one edited\n // (another, still bound as the tab opens, is not \"its\" save).\n const wasBound = useRef(false)\n useEffect(() => {\n if (boundTo === target) wasBound.current = true\n if (!wasBound.current || !savedId || boundTo !== savedId || savedId === target) return\n if (isDraft) session.clearDraftDocument(documentId)\n editPresentation(session, { kind: 'open', documentId: savedId })\n }, [isDraft, savedId, boundTo, target, documentId, session])\n\n // A newer version saved meanwhile (by ARBI, asked in the chat beside the deck, or by someone\n // else): shown at once, unless this one has changes of its own, which are never thrown away.\n const heldVersion = usePresentation((s) => (s.boundTo === target ? s.version : null))\n const toldNewer = useRef<number | null>(null)\n useEffect(() => {\n if (isDraft || version || !currentVersion || heldVersion === null) return\n if (currentVersion <= heldVersion || loading) return\n if (hasContent()) {\n if (toldNewer.current === currentVersion) return\n toldNewer.current = currentVersion\n notify(\n `A newer version (${currentVersion}) was saved while you edited. Save as\u2026 keeps yours; reopen the presentation to see it.`,\n 'error'\n )\n return\n }\n setLoading(true)\n void open(documentId)\n .then(() => {\n usePresentation.getState().bind(target)\n notify(`Updated to version ${currentVersion}.`, 'success')\n })\n .catch((error: unknown) =>\n notify(\n error instanceof Error ? error.message : 'The new version could not be opened',\n 'error'\n )\n )\n .finally(() => setLoading(false))\n }, [currentVersion, heldVersion, isDraft, version, loading, open, documentId, target, notify])\n\n // A chat turn about this presentation (the chat beside it) saves its unsaved changes first, so\n // ARBI works on the slides as they are on screen.\n useEffect(() => {\n if (isDraft || version || savedId !== documentId || boundTo !== target) return\n return registerDocumentTurnFlush(documentId, async () => {\n const state = usePresentation.getState()\n if (state.savedId === documentId && hasUnsavedChanges(state)) await save(state.title)\n })\n }, [isDraft, version, savedId, boundTo, documentId, target, save])\n\n const present = useCallback(() => {\n openPresentation(session, { present: true })\n usePresentation.getState().setPresenting(true)\n }, [session])\n\n if (poppedOut) {\n return (\n <div className=\"flex h-full items-center justify-center p-6\" data-testid=\"slides-popped-out\">\n <EmptyState\n icon={ExternalLink}\n title=\"Editing in its own window\"\n description=\"The presentation is open in its own window, beside the documents you clip from.\"\n action={\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => session.closePanel(PRESENTATION_PANEL)}\n >\n <PanelLeftClose className=\"size-4\" />\n Bring it back here\n </Button>\n }\n />\n </div>\n )\n }\n if (declined && boundTo !== target) {\n return (\n <div className=\"flex h-full items-center justify-center p-6\" data-testid=\"slides-declined\">\n <EmptyState\n icon={Presentation}\n title=\"Another presentation is being edited\"\n description=\"It has changes. Save it first, or open this one in its place.\"\n action={\n <Button type=\"button\" variant=\"outline\" onClick={() => setForce((n) => n + 1)}>\n Open this one instead\n </Button>\n }\n />\n </div>\n )\n }\n if (loading || boundTo !== target) {\n return (\n <div className=\"flex h-full items-center justify-center gap-2 text-sm text-muted-foreground\">\n <Loader2 className=\"size-4 animate-spin\" />\n Opening the presentation\u2026\n </div>\n )\n }\n return (\n <>\n {controller.dialogs}\n <SlidesEditor\n {...controller.editor}\n actions={\n <>\n {controller.editor.actions}\n <Button\n type=\"button\"\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-8 text-muted-foreground hover:text-foreground pointer-coarse:size-11\"\n title=\"Edit in its own window, beside the documents you clip from\"\n aria-label=\"Pop out\"\n onClick={() => openPresentation(session)}\n data-testid=\"presentation-pop-out\"\n >\n <ExternalLink className=\"size-4\" />\n </Button>\n </>\n }\n onPresent={present}\n />\n </>\n )\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * A presentation's slides tab in the document viewer: the slides editor, on the presentation the\n * viewer shows. Opening a saved presentation loads it (unless it is the one being edited); a new\n * one (a presentation draft) takes the clips gathered so far. Clips gathered with no presentation\n * open join the one opened next. Saving a draft makes it a document, and the tab moves to it.\n *\n * The editor can also move to the presentation's own window (Pop out), beside the documents its\n * clips come from; the tab then says so. Present opens that window with the slides alone.\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { ExternalLink, Loader2, PanelLeftClose, Presentation } from 'lucide-react'\nimport {\n isPanelOpen,\n registerDocumentTurnFlush,\n useArbiSessionState,\n useArbiSessionStore,\n} from '@arbidocs/react'\nimport { Button, DropdownMenuItem } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { usePanelHostSupport } from '../../shell/panel-host'\nimport {\n PRESENTATION_PANEL,\n openPresentation,\n presentationWindowOnlyPresents,\n} from '../../presentation/panel-id'\nimport { SlidesEditor } from '../../presentation/SlidesEditor'\nimport { hasUnsavedChanges, usePresentation } from '../../presentation/store'\nimport { EmptyState } from '../../components/EmptyState'\nimport { editPresentation } from './requests'\nimport { usePresentationController } from './usePresentationController'\nimport { usePresentationFiles } from './usePresentationFiles'\n\nexport interface ConnectedSlidesTabProps {\n /** The viewed document's id, or a presentation draft's (`draft-\u2026`). */\n documentId: string\n /** The version on screen, when an older one. */\n version?: number\n /** The document's current version: a newer one than the one being edited is opened. */\n currentVersion?: number\n /** A new presentation, not saved yet: its draft title. */\n draftTitle?: string\n}\n\n/** \"2, 3 and 5\". */\nconst listOf = (numbers: number[]) =>\n numbers.length < 2\n ? String(numbers[0] ?? '')\n : `${numbers.slice(0, -1).join(', ')} and ${numbers[numbers.length - 1]}`\n\n/** A new presentation saves itself this long after its first content (typing settles first). */\nconst AUTO_SAVE_AFTER_MS = 2500\n/** The names a new presentation starts with (not chosen by anyone). */\nconst DEFAULT_NAMES = /^(new|untitled) presentation( \\d+)?$/i\n\nconst STALE = 'This presentation was changed outside the editor: Save to draw its slides again.'\n\n/** The presentation has anything in it worth asking about before it is replaced. */\nconst hasContent = () => hasUnsavedChanges(usePresentation.getState())\n\nexport function ConnectedSlidesTab({\n documentId,\n version,\n currentVersion,\n draftTitle,\n}: ConnectedSlidesTabProps) {\n const session = useArbiSessionStore()\n const { windows, popoutTitle } = usePanelHostSupport()\n const { confirm } = useBlocksEnvironment()\n const { open, save } = usePresentationFiles()\n const notify = usePresentation((s) => s.notify)\n const boundTo = usePresentation((s) => s.boundTo)\n const savedId = usePresentation((s) => s.savedId)\n const [loading, setLoading] = useState(false)\n const isDraft = draftTitle !== undefined\n const target = version ? `${documentId}@v${version}` : documentId\n const poppedOut = useArbiSessionState(\n (state) => isPanelOpen(state, PRESENTATION_PANEL) && !presentationWindowOnlyPresents()\n )\n const controller = usePresentationController(!poppedOut)\n const asked = useRef<string | null>(null)\n // Another presentation, with changes, is being edited and the user kept it.\n const [declined, setDeclined] = useState(false)\n const [force, setForce] = useState(0)\n\n // Show the presentation this tab is for (once per presentation: a remount does not ask again).\n useEffect(() => {\n const state = usePresentation.getState()\n if (state.boundTo === target || asked.current === `${target}#${force}`) return\n asked.current = `${target}#${force}`\n setDeclined(false)\n void (async () => {\n // Clips gathered with no presentation open join this one.\n const gathered = state.boundTo === null ? state.clips : []\n if (state.boundTo !== null && hasContent() && !force) {\n const ok = await confirm({\n title: 'Open presentation',\n message: 'Replace the presentation being edited? Save it first to keep its changes.',\n kind: 'confirm',\n })\n if (!ok) return setDeclined(true)\n }\n if (isDraft) {\n if (state.boundTo !== null) state.reset()\n usePresentation.getState().bind(target)\n usePresentation.getState().setTitle(draftTitle || 'Untitled presentation')\n return\n }\n setLoading(true)\n try {\n const { missing, stale, imported, changedOutside } = await open(documentId, version)\n usePresentation.getState().bind(target)\n if (gathered.length) usePresentation.getState().adoptClips(gathered)\n if (stale) notify(STALE, 'error')\n if (imported) {\n notify(\n ['Opened from PowerPoint, ready to edit.', ...imported.notes].join(' \u00B7 '),\n 'success'\n )\n }\n if (changedOutside) {\n notify(\n `${changedOutside.length === 1 ? `Slide ${changedOutside[0]} was` : `Slides ${listOf(changedOutside)} were`} changed in PowerPoint: brought in as changed there.`,\n 'success'\n )\n }\n if (missing) {\n notify(\n `${missing} clip${missing === 1 ? '' : 's'} could not be opened (moved, deleted or not shared with you)`,\n 'error'\n )\n }\n } catch (error) {\n notify(\n error instanceof Error ? error.message : 'The presentation could not be opened',\n 'error'\n )\n } finally {\n setLoading(false)\n }\n })()\n // eslint-disable-next-line react-hooks/exhaustive-deps -- a draft's title changes as it is typed\n }, [target, documentId, version, isDraft, force, open, confirm, notify])\n\n // A draft's title is the presentation's.\n useEffect(() => {\n if (isDraft && boundTo === target && draftTitle) usePresentation.getState().setTitle(draftTitle)\n }, [isDraft, boundTo, target, draftTitle])\n\n // Saved as another document (a draft's first save, Save as, an older file saved as a\n // PowerPoint): the viewer follows it. Only once this tab's presentation was the one edited\n // (another, still bound as the tab opens, is not \"its\" save).\n const wasBound = useRef(false)\n useEffect(() => {\n if (boundTo === target) wasBound.current = true\n if (!wasBound.current || !savedId || boundTo !== savedId || savedId === target) return\n if (isDraft) session.clearDraftDocument(documentId)\n editPresentation(session, { kind: 'open', documentId: savedId })\n }, [isDraft, savedId, boundTo, target, documentId, session])\n\n // A newer version saved meanwhile (by ARBI, asked in the chat beside the deck, or by someone\n // else): shown at once, unless this one has changes of its own, which are never thrown away.\n const heldVersion = usePresentation((s) => (s.boundTo === target ? s.version : null))\n const toldNewer = useRef<number | null>(null)\n useEffect(() => {\n if (isDraft || version || !currentVersion || heldVersion === null) return\n if (currentVersion <= heldVersion || loading) return\n if (hasContent()) {\n if (toldNewer.current === currentVersion) return\n toldNewer.current = currentVersion\n notify(\n `A newer version (${currentVersion}) was saved while you edited. Save as\u2026 keeps yours; reopen the presentation to see it.`,\n 'error'\n )\n return\n }\n setLoading(true)\n void open(documentId)\n .then(() => {\n usePresentation.getState().bind(target)\n notify(`Updated to version ${currentVersion}.`, 'success')\n })\n .catch((error: unknown) =>\n notify(\n error instanceof Error ? error.message : 'The new version could not be opened',\n 'error'\n )\n )\n .finally(() => setLoading(false))\n }, [currentVersion, heldVersion, isDraft, version, loading, open, documentId, target, notify])\n\n // A new presentation saves itself once it has something in it (a clip, a title, a point): from\n // then on it is a document of Presentations, which a chat can work in and look at (its PDF), and\n // which is not lost with the tab. Later saves stay the person's (each a version they chose).\n const draftHasContent = usePresentation(\n (state) =>\n isDraft && state.boundTo === target && state.savedId === null && hasUnsavedChanges(state)\n )\n const autoSaved = useRef<string | null>(null)\n useEffect(() => {\n if (!draftHasContent || autoSaved.current === target) return\n const timer = setTimeout(() => {\n autoSaved.current = target\n const state = usePresentation.getState()\n // Still called what every new one is called: named after its first slide's title instead.\n const firstTitle = state.slides.find((slide) => slide.caption.trim())?.caption.trim()\n const named = state.title && !DEFAULT_NAMES.test(state.title) ? state.title : null\n const title = named ?? firstTitle ?? (state.title || 'Untitled presentation')\n if (title !== state.title) state.setTitle(title)\n void save(title).catch((error: unknown) => {\n autoSaved.current = null\n notify(\n error instanceof Error ? error.message : 'The presentation could not be saved',\n 'error'\n )\n })\n }, AUTO_SAVE_AFTER_MS)\n return () => clearTimeout(timer)\n }, [draftHasContent, target, save, draftTitle, notify])\n\n // A chat turn about this presentation (the chat beside it) saves its unsaved changes first, so\n // ARBI works on the slides as they are on screen.\n useEffect(() => {\n if (isDraft || version || savedId !== documentId || boundTo !== target) return\n return registerDocumentTurnFlush(documentId, async () => {\n const state = usePresentation.getState()\n if (state.savedId === documentId && hasUnsavedChanges(state)) await save(state.title)\n })\n }, [isDraft, version, savedId, boundTo, documentId, target, save])\n\n const present = useCallback(() => {\n openPresentation(session, { present: true, windows, title: popoutTitle('Presentation') })\n usePresentation.getState().setPresenting(true)\n }, [session, windows, popoutTitle])\n\n if (poppedOut) {\n return (\n <div className=\"flex h-full items-center justify-center p-6\" data-testid=\"slides-popped-out\">\n <EmptyState\n icon={ExternalLink}\n title=\"Editing in its own window\"\n description=\"The presentation is open in its own window, beside the documents you clip from.\"\n action={\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => session.closePanel(PRESENTATION_PANEL)}\n >\n <PanelLeftClose className=\"size-4\" />\n Bring it back here\n </Button>\n }\n />\n </div>\n )\n }\n if (declined && boundTo !== target) {\n return (\n <div className=\"flex h-full items-center justify-center p-6\" data-testid=\"slides-declined\">\n <EmptyState\n icon={Presentation}\n title=\"Another presentation is being edited\"\n description=\"It has changes. Save it first, or open this one in its place.\"\n action={\n <Button type=\"button\" variant=\"outline\" onClick={() => setForce((n) => n + 1)}>\n Open this one instead\n </Button>\n }\n />\n </div>\n )\n }\n if (loading || boundTo !== target) {\n return (\n <div className=\"flex h-full items-center justify-center gap-2 text-sm text-muted-foreground\">\n <Loader2 className=\"size-4 animate-spin\" />\n Opening the presentation\u2026\n </div>\n )\n }\n return (\n <>\n {controller.dialogs}\n <SlidesEditor\n {...controller.editor}\n menuItems={\n <>\n {controller.editor.menuItems}\n <DropdownMenuItem\n onSelect={() =>\n openPresentation(session, { windows, title: popoutTitle('Presentation') })\n }\n data-testid=\"presentation-pop-out\"\n >\n <ExternalLink className=\"size-4\" />\n <span className=\"ml-2\">Edit in its own window</span>\n </DropdownMenuItem>\n </>\n }\n onPresent={present}\n />\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAmPY,SA2CF,UAtCI,KALF;AAzOZ,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AACzD,SAAS,cAAc,SAAS,gBAAgB,oBAAoB;AACpE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,QAAQ,wBAAwB;AACzC,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B,SAAS,mBAA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iBAAiB,SAAS,EAAE,SAAS,OAAO,YAAY,cAAc,EAAE,CAAC;AAAA,cAE3E,eAAY;AAAA,cAEZ;AAAA,oCAAC,gBAAa,WAAU,UAAS;AAAA,gBACjC,oBAAC,UAAK,WAAU,QAAO,oCAAsB;AAAA;AAAA;AAAA,UAC/C;AAAA,WACF;AAAA,QAEF,WAAW;AAAA;AAAA,IACb;AAAA,KACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Presentation } from "lucide-react";
|
|
4
|
-
import {
|
|
4
|
+
import { useArbiSessionState, useArbiSessionStore } from "@arbidocs/react";
|
|
5
5
|
import { Button } from "@arbidocs/react/ui";
|
|
6
6
|
import { usePresentation } from "../../presentation/store.js";
|
|
7
|
-
import {
|
|
7
|
+
import { showPresentation } from "./requests.js";
|
|
8
8
|
function PresentationPill({ compact }) {
|
|
9
9
|
const session = useArbiSessionStore();
|
|
10
10
|
const boundTo = usePresentation((s) => s.boundTo);
|
|
@@ -14,12 +14,7 @@ function PresentationPill({ compact }) {
|
|
|
14
14
|
(s) => s.viewingDocument?.id === boundTo && s.documentViewer.tab === "slides"
|
|
15
15
|
);
|
|
16
16
|
if (onIt || boundTo === null && clips === 0) return null;
|
|
17
|
-
const back = () =>
|
|
18
|
-
if (boundTo === null) return editPresentation(session, { kind: "new" });
|
|
19
|
-
session.setViewingDocument({ id: boundTo, page: null });
|
|
20
|
-
session.setDocumentViewer({ tab: "slides" });
|
|
21
|
-
session.openPanel(DOCUMENT_VIEWER_PANEL, "docked");
|
|
22
|
-
};
|
|
17
|
+
const back = () => showPresentation(session, boundTo);
|
|
23
18
|
return /* @__PURE__ */ jsxs(
|
|
24
19
|
Button,
|
|
25
20
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/presentation/PresentationPill.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Presentation } from 'lucide-react'\nimport {
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import { Presentation } from 'lucide-react'\nimport { useArbiSessionState, useArbiSessionStore } from '@arbidocs/react'\nimport { Button } from '@arbidocs/react/ui'\nimport { usePresentation } from '../../presentation/store'\nimport { showPresentation } from './requests'\n\n/**\n * Back to the presentation, from any document the viewer shows (clips are gathered while reading,\n * then arranged): its title and how many clips wait in its tray. Shown while a presentation is\n * being made and the viewer is elsewhere.\n */\nexport function PresentationPill({ compact }: { compact: boolean }) {\n const session = useArbiSessionStore()\n const boundTo = usePresentation((s) => s.boundTo)\n const clips = usePresentation((s) => s.clips.length)\n const title = usePresentation((s) => s.title)\n const onIt = useArbiSessionState(\n (s) => s.viewingDocument?.id === boundTo && s.documentViewer.tab === 'slides'\n )\n if (onIt || (boundTo === null && clips === 0)) return null\n const back = () => showPresentation(session, boundTo)\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"h-7 max-w-56 gap-1.5 rounded-full px-2.5 text-xs\"\n onClick={back}\n title={`Back to the presentation \"${title}\": ${clips} clip${clips === 1 ? '' : 's'} to arrange`}\n data-testid=\"presentation-pill\"\n >\n <Presentation className=\"size-3.5 shrink-0\" />\n {!compact && <span className=\"min-w-0 truncate\">{title}</span>}\n {clips > 0 && (\n <span className=\"rounded-full bg-primary px-1.5 text-[10px] font-semibold leading-4 text-primary-foreground\">\n {clips}\n </span>\n )}\n </Button>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAsBI,SASE,KATF;AAtBJ,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB,2BAA2B;AACzD,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AAO1B,SAAS,iBAAiB,EAAE,QAAQ,GAAyB;AAClE,QAAM,UAAU,oBAAoB;AACpC,QAAM,UAAU,gBAAgB,CAAC,MAAM,EAAE,OAAO;AAChD,QAAM,QAAQ,gBAAgB,CAAC,MAAM,EAAE,MAAM,MAAM;AACnD,QAAM,QAAQ,gBAAgB,CAAC,MAAM,EAAE,KAAK;AAC5C,QAAM,OAAO;AAAA,IACX,CAAC,MAAM,EAAE,iBAAiB,OAAO,WAAW,EAAE,eAAe,QAAQ;AAAA,EACvE;AACA,MAAI,QAAS,YAAY,QAAQ,UAAU,EAAI,QAAO;AACtD,QAAM,OAAO,MAAM,iBAAiB,SAAS,OAAO;AACpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAU;AAAA,MACV,SAAS;AAAA,MACT,OAAO,6BAA6B,KAAK,MAAM,KAAK,QAAQ,UAAU,IAAI,KAAK,GAAG;AAAA,MAClF,eAAY;AAAA,MAEZ;AAAA,4BAAC,gBAAa,WAAU,qBAAoB;AAAA,QAC3C,CAAC,WAAW,oBAAC,UAAK,WAAU,oBAAoB,iBAAM;AAAA,QACtD,QAAQ,KACP,oBAAC,UAAK,WAAU,8FACb,iBACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,6 +8,11 @@ export type PresentationRequest = {
|
|
|
8
8
|
documentId: string;
|
|
9
9
|
version?: number;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Back to the presentation being edited, on its slides tab (a new one when none is open yet): from
|
|
13
|
+
* any document the viewer shows.
|
|
14
|
+
*/
|
|
15
|
+
export declare function showPresentation(session: Session, boundTo: string | null): void;
|
|
11
16
|
/**
|
|
12
17
|
* Edit a presentation in the viewer's slides tab: a saved one (its document, on that tab), or a
|
|
13
18
|
* new one (a presentation draft, saved into Files › Presentations when it is first saved).
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { DOCUMENT_VIEWER_PANEL } from "@arbidocs/react";
|
|
3
3
|
import { versionRef } from "@arbidocs/react/artifacts";
|
|
4
|
+
function showPresentation(session, boundTo) {
|
|
5
|
+
if (boundTo === null) return editPresentation(session, { kind: "new" });
|
|
6
|
+
session.setViewingDocument({ id: boundTo, page: null });
|
|
7
|
+
session.setDocumentViewer({ tab: "slides" });
|
|
8
|
+
session.openPanel(DOCUMENT_VIEWER_PANEL, "docked");
|
|
9
|
+
}
|
|
4
10
|
function editPresentation(session, request) {
|
|
5
11
|
if (request.kind === "new") {
|
|
6
12
|
session.startDraftDocument("presentation");
|
|
@@ -15,6 +21,7 @@ function editPresentation(session, request) {
|
|
|
15
21
|
session.openPanel(DOCUMENT_VIEWER_PANEL, "docked");
|
|
16
22
|
}
|
|
17
23
|
export {
|
|
18
|
-
editPresentation
|
|
24
|
+
editPresentation,
|
|
25
|
+
showPresentation
|
|
19
26
|
};
|
|
20
27
|
//# sourceMappingURL=requests.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/presentation/requests.ts"],
|
|
4
|
-
"sourcesContent": ["import { DOCUMENT_VIEWER_PANEL, type ArbiSessionStore } from '@arbidocs/react'\nimport { versionRef } from '@arbidocs/react/artifacts'\n\ntype Session = Pick<\n ArbiSessionStore,\n 'setViewingDocument' | 'setDocumentViewer' | 'openPanel' | 'startDraftDocument'\n>\n\n/** A presentation to edit: a new one, or a saved one (as of `version`; default its current one). */\nexport type PresentationRequest =\n { kind: 'new' } | { kind: 'open'; documentId: string; version?: number }\n\n/**\n * Edit a presentation in the viewer's slides tab: a saved one (its document, on that tab), or a\n * new one (a presentation draft, saved into Files \u203A Presentations when it is first saved).\n */\nexport function editPresentation(session: Session, request: PresentationRequest): void {\n if (request.kind === 'new') {\n session.startDraftDocument('presentation')\n return\n }\n const { documentId, version } = request\n session.setViewingDocument({\n id: version ? versionRef(documentId, version) : documentId,\n page: null,\n })\n session.setDocumentViewer({ tab: 'slides' })\n session.openPanel(DOCUMENT_VIEWER_PANEL, 'docked')\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,6BAAoD;AAC7D,SAAS,kBAAkB;AAepB,SAAS,iBAAiB,SAAkB,SAAoC;AACrF,MAAI,QAAQ,SAAS,OAAO;AAC1B,YAAQ,mBAAmB,cAAc;AACzC;AAAA,EACF;AACA,QAAM,EAAE,YAAY,QAAQ,IAAI;AAChC,UAAQ,mBAAmB;AAAA,IACzB,IAAI,UAAU,WAAW,YAAY,OAAO,IAAI;AAAA,IAChD,MAAM;AAAA,EACR,CAAC;AACD,UAAQ,kBAAkB,EAAE,KAAK,SAAS,CAAC;AAC3C,UAAQ,UAAU,uBAAuB,QAAQ;AACnD;",
|
|
4
|
+
"sourcesContent": ["import { DOCUMENT_VIEWER_PANEL, type ArbiSessionStore } from '@arbidocs/react'\nimport { versionRef } from '@arbidocs/react/artifacts'\n\ntype Session = Pick<\n ArbiSessionStore,\n 'setViewingDocument' | 'setDocumentViewer' | 'openPanel' | 'startDraftDocument'\n>\n\n/** A presentation to edit: a new one, or a saved one (as of `version`; default its current one). */\nexport type PresentationRequest =\n { kind: 'new' } | { kind: 'open'; documentId: string; version?: number }\n\n/**\n * Back to the presentation being edited, on its slides tab (a new one when none is open yet): from\n * any document the viewer shows.\n */\nexport function showPresentation(session: Session, boundTo: string | null): void {\n if (boundTo === null) return editPresentation(session, { kind: 'new' })\n session.setViewingDocument({ id: boundTo, page: null })\n session.setDocumentViewer({ tab: 'slides' })\n session.openPanel(DOCUMENT_VIEWER_PANEL, 'docked')\n}\n\n/**\n * Edit a presentation in the viewer's slides tab: a saved one (its document, on that tab), or a\n * new one (a presentation draft, saved into Files \u203A Presentations when it is first saved).\n */\nexport function editPresentation(session: Session, request: PresentationRequest): void {\n if (request.kind === 'new') {\n session.startDraftDocument('presentation')\n return\n }\n const { documentId, version } = request\n session.setViewingDocument({\n id: version ? versionRef(documentId, version) : documentId,\n page: null,\n })\n session.setDocumentViewer({ tab: 'slides' })\n session.openPanel(DOCUMENT_VIEWER_PANEL, 'docked')\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,6BAAoD;AAC7D,SAAS,kBAAkB;AAepB,SAAS,iBAAiB,SAAkB,SAA8B;AAC/E,MAAI,YAAY,KAAM,QAAO,iBAAiB,SAAS,EAAE,MAAM,MAAM,CAAC;AACtE,UAAQ,mBAAmB,EAAE,IAAI,SAAS,MAAM,KAAK,CAAC;AACtD,UAAQ,kBAAkB,EAAE,KAAK,SAAS,CAAC;AAC3C,UAAQ,UAAU,uBAAuB,QAAQ;AACnD;AAMO,SAAS,iBAAiB,SAAkB,SAAoC;AACrF,MAAI,QAAQ,SAAS,OAAO;AAC1B,YAAQ,mBAAmB,cAAc;AACzC;AAAA,EACF;AACA,QAAM,EAAE,YAAY,QAAQ,IAAI;AAChC,UAAQ,mBAAmB;AAAA,IACzB,IAAI,UAAU,WAAW,YAAY,OAAO,IAAI;AAAA,IAChD,MAAM;AAAA,EACR,CAAC;AACD,UAAQ,kBAAkB,EAAE,KAAK,SAAS,CAAC;AAC3C,UAAQ,UAAU,uBAAuB,QAAQ;AACnD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,10 +4,12 @@ import { lazy, Suspense, useCallback, useEffect, useRef, useState } from "react"
|
|
|
4
4
|
import {
|
|
5
5
|
ChevronDown,
|
|
6
6
|
Languages,
|
|
7
|
+
Link2,
|
|
7
8
|
Mail,
|
|
8
9
|
MessageSquare,
|
|
9
10
|
MessageSquarePlus,
|
|
10
11
|
PenLine,
|
|
12
|
+
Signature,
|
|
11
13
|
Users
|
|
12
14
|
} from "lucide-react";
|
|
13
15
|
import { useArbi, useArbiSessionState, useArbiSessionStore } from "@arbidocs/react";
|
|
@@ -86,6 +88,7 @@ import { FinaliseTranslationButton } from "./FinaliseTranslationButton.js";
|
|
|
86
88
|
import { useDocumentViewerSupport } from "./support.js";
|
|
87
89
|
import { useImageCrop } from "./useImageCrop.js";
|
|
88
90
|
import { ViewerCropModal } from "./ViewerCropModal.js";
|
|
91
|
+
import { ViewerMoreMenu } from "./ViewerMoreMenu.js";
|
|
89
92
|
import { useViewedDocument } from "./useViewedDocument.js";
|
|
90
93
|
import { useViewerBlobs } from "./useViewerBlobs.js";
|
|
91
94
|
import { useViewerTabs } from "./useViewerTabs.js";
|
|
@@ -512,28 +515,15 @@ function DocumentViewerContent({
|
|
|
512
515
|
]
|
|
513
516
|
}
|
|
514
517
|
),
|
|
515
|
-
documentId && documentData && !isDraft && !isStreaming && /* @__PURE__ */
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
children: "Share file"
|
|
525
|
-
}
|
|
526
|
-
),
|
|
527
|
-
/* @__PURE__ */ jsx(
|
|
528
|
-
FileShareDialog,
|
|
529
|
-
{
|
|
530
|
-
open: sharingFile,
|
|
531
|
-
onOpenChange: setSharingFile,
|
|
532
|
-
documentId,
|
|
533
|
-
version: pdfSnapshotNumber ?? documentData.current_version ?? 1
|
|
534
|
-
}
|
|
535
|
-
)
|
|
536
|
-
] }),
|
|
518
|
+
documentId && documentData && !isDraft && !isStreaming && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
519
|
+
FileShareDialog,
|
|
520
|
+
{
|
|
521
|
+
open: sharingFile,
|
|
522
|
+
onOpenChange: setSharingFile,
|
|
523
|
+
documentId,
|
|
524
|
+
version: pdfSnapshotNumber ?? documentData.current_version ?? 1
|
|
525
|
+
}
|
|
526
|
+
) }),
|
|
537
527
|
doc.savedDocumentId && !snapshotDocumentId && /* @__PURE__ */ jsxs(
|
|
538
528
|
Button,
|
|
539
529
|
{
|
|
@@ -571,43 +561,6 @@ function DocumentViewerContent({
|
|
|
571
561
|
stateTestId: "document-title-shared-indicator"
|
|
572
562
|
}
|
|
573
563
|
),
|
|
574
|
-
tools.emailDocument && !isDraft && !isStreaming && documentData?.file_name && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
575
|
-
/* @__PURE__ */ jsx("span", { className: "mx-1 h-5 w-px bg-border", "aria-hidden": "true" }),
|
|
576
|
-
/* @__PURE__ */ jsxs(
|
|
577
|
-
Button,
|
|
578
|
-
{
|
|
579
|
-
type: "button",
|
|
580
|
-
variant: "outline",
|
|
581
|
-
size: isCompact ? "icon" : "sm",
|
|
582
|
-
title: "Email this document",
|
|
583
|
-
"aria-label": "Email",
|
|
584
|
-
"data-testid": "email-document-button",
|
|
585
|
-
className: "pointer-coarse:min-h-11",
|
|
586
|
-
onClick: () => tools.emailDocument?.(shownRef),
|
|
587
|
-
children: [
|
|
588
|
-
/* @__PURE__ */ jsx(Mail, { className: "size-4" }),
|
|
589
|
-
!isCompact && /* @__PURE__ */ jsx("span", { className: "ml-1", children: "Email" })
|
|
590
|
-
]
|
|
591
|
-
}
|
|
592
|
-
)
|
|
593
|
-
] }),
|
|
594
|
-
support.translate && !isDraft && !isStreaming && !liveKind && !isImage && documentData?.file_name && /* @__PURE__ */ jsxs(
|
|
595
|
-
Button,
|
|
596
|
-
{
|
|
597
|
-
type: "button",
|
|
598
|
-
variant: "outline",
|
|
599
|
-
size: isCompact ? "icon" : "sm",
|
|
600
|
-
title: "Translate into another language: a new editable document, original and translation side by side",
|
|
601
|
-
"aria-label": "Translate",
|
|
602
|
-
"data-testid": "translate-document-button",
|
|
603
|
-
className: "pointer-coarse:min-h-11",
|
|
604
|
-
onClick: () => support.translate(shownRef),
|
|
605
|
-
children: [
|
|
606
|
-
/* @__PURE__ */ jsx(Languages, { className: "size-4" }),
|
|
607
|
-
!isCompact && /* @__PURE__ */ jsx("span", { className: "ml-1", children: "Translate" })
|
|
608
|
-
]
|
|
609
|
-
}
|
|
610
|
-
),
|
|
611
564
|
!isStreaming && !snapshotDocumentId && /* @__PURE__ */ jsx(FinaliseTranslationButton, { document: documentData ?? void 0, isCompact }),
|
|
612
565
|
annotatable && /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
613
566
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
@@ -621,7 +574,7 @@ function DocumentViewerContent({
|
|
|
621
574
|
"data-testid": "signing-menu-trigger",
|
|
622
575
|
className: "pointer-coarse:min-h-11",
|
|
623
576
|
children: [
|
|
624
|
-
/* @__PURE__ */ jsx(
|
|
577
|
+
/* @__PURE__ */ jsx(Signature, { className: "size-4" }),
|
|
625
578
|
!isCompact && /* @__PURE__ */ jsx("span", { className: "ml-1", children: "Sign" }),
|
|
626
579
|
/* @__PURE__ */ jsx(ChevronDown, { className: "ml-1 size-3" })
|
|
627
580
|
]
|
|
@@ -690,6 +643,44 @@ function DocumentViewerContent({
|
|
|
690
643
|
appearance: signAppearance
|
|
691
644
|
}
|
|
692
645
|
),
|
|
646
|
+
/* @__PURE__ */ jsx(
|
|
647
|
+
ViewerMoreMenu,
|
|
648
|
+
{
|
|
649
|
+
compact: isCompact,
|
|
650
|
+
items: [
|
|
651
|
+
...documentId && documentData && !isDraft && !isStreaming ? [
|
|
652
|
+
{
|
|
653
|
+
key: "share-file",
|
|
654
|
+
label: "Share file\u2026",
|
|
655
|
+
icon: /* @__PURE__ */ jsx(Link2, { className: "size-4" }),
|
|
656
|
+
description: "Send a link to this version of the file",
|
|
657
|
+
onSelect: () => setSharingFile(true),
|
|
658
|
+
testId: "share-file-button"
|
|
659
|
+
}
|
|
660
|
+
] : [],
|
|
661
|
+
...tools.emailDocument && !isDraft && !isStreaming && documentData?.file_name ? [
|
|
662
|
+
{
|
|
663
|
+
key: "email",
|
|
664
|
+
label: "Email\u2026",
|
|
665
|
+
icon: /* @__PURE__ */ jsx(Mail, { className: "size-4" }),
|
|
666
|
+
description: "Email this document (attached)",
|
|
667
|
+
onSelect: () => tools.emailDocument?.(shownRef),
|
|
668
|
+
testId: "email-document-button"
|
|
669
|
+
}
|
|
670
|
+
] : [],
|
|
671
|
+
...support.translate && !isDraft && !isStreaming && !liveKind && !isImage && documentData?.file_name ? [
|
|
672
|
+
{
|
|
673
|
+
key: "translate",
|
|
674
|
+
label: "Translate\u2026",
|
|
675
|
+
icon: /* @__PURE__ */ jsx(Languages, { className: "size-4" }),
|
|
676
|
+
description: "A new editable document, original and translation side by side",
|
|
677
|
+
onSelect: () => support.translate(shownRef),
|
|
678
|
+
testId: "translate-document-button"
|
|
679
|
+
}
|
|
680
|
+
] : []
|
|
681
|
+
]
|
|
682
|
+
}
|
|
683
|
+
),
|
|
693
684
|
headerActions
|
|
694
685
|
] });
|
|
695
686
|
const viewerProps = {
|