@arbidocs/blocks 0.5.123 → 0.5.124
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 → ClippingMediaViewer-ZFEX5A3U.cjs} +11 -10
- package/dist/ClippingMediaViewer-ZFEX5A3U.cjs.map +1 -0
- package/dist/{ClippingPdfViewer-OGYLMVCE.cjs → ClippingPdfViewer-3LRTEPHV.cjs} +45 -11
- package/dist/ClippingPdfViewer-3LRTEPHV.cjs.map +1 -0
- package/dist/ConnectedNativeDocxComparison-QKHCYD6W.cjs +1 -1
- package/dist/{ConnectedPresentation-5DOJ35XL.cjs → ConnectedPresentation-OV2KBOLK.cjs} +27 -153
- package/dist/ConnectedPresentation-OV2KBOLK.cjs.map +1 -0
- package/dist/{ConnectedSlidesTab-7YMEDGUU.cjs → ConnectedSlidesTab-LUAGZ6FD.cjs} +29 -27
- package/dist/ConnectedSlidesTab-LUAGZ6FD.cjs.map +1 -0
- package/dist/ConnectedStreamedWordArtifact-AG62232A.cjs +1 -1
- package/dist/{FilesViewerDialog-2QCCRWF2.cjs → FilesViewerDialog-JWKNJLWG.cjs} +12 -9
- package/dist/FilesViewerDialog-JWKNJLWG.cjs.map +1 -0
- package/dist/SpotlightStrip-ED22UYTM.cjs +398 -0
- package/dist/SpotlightStrip-ED22UYTM.cjs.map +1 -0
- package/dist/agents/index.cjs +176 -176
- package/dist/{chunk-46P7IDBX.cjs → chunk-3IH55CDE.cjs} +3 -3
- package/dist/chunk-3IH55CDE.cjs.map +1 -0
- package/dist/chunk-3ZZZO4F7.cjs +145 -0
- package/dist/chunk-3ZZZO4F7.cjs.map +1 -0
- package/dist/{chunk-WFMWKPGY.cjs → chunk-ADPRIBSH.cjs} +9 -33
- package/dist/chunk-ADPRIBSH.cjs.map +1 -0
- package/dist/{chunk-JD2HX2BR.cjs → chunk-BX6G2ZCI.cjs} +58 -86
- package/dist/chunk-BX6G2ZCI.cjs.map +1 -0
- package/dist/{chunk-NQML7IUC.cjs → chunk-CQQQIZU4.cjs} +3 -3
- package/dist/{chunk-NQML7IUC.cjs.map → chunk-CQQQIZU4.cjs.map} +1 -1
- package/dist/{chunk-SNPK3R3O.cjs → chunk-EMRY62HS.cjs} +5 -5
- package/dist/{chunk-SNPK3R3O.cjs.map → chunk-EMRY62HS.cjs.map} +1 -1
- package/dist/{chunk-DWMWEALB.cjs → chunk-H236SNEV.cjs} +143 -1634
- package/dist/chunk-H236SNEV.cjs.map +1 -0
- package/dist/chunk-JITYC4OS.cjs +66 -0
- package/dist/chunk-JITYC4OS.cjs.map +1 -0
- package/dist/chunk-JY7UUZQG.cjs +1513 -0
- package/dist/chunk-JY7UUZQG.cjs.map +1 -0
- package/dist/chunk-MVXHTAJ4.cjs +111 -0
- package/dist/chunk-MVXHTAJ4.cjs.map +1 -0
- package/dist/{chunk-4TTX6ZNS.cjs → chunk-ORNLCBNE.cjs} +24 -2
- package/dist/chunk-ORNLCBNE.cjs.map +1 -0
- package/dist/{chunk-L4CIFLCU.cjs → chunk-QG2U2JGX.cjs} +4 -4
- package/dist/{chunk-L4CIFLCU.cjs.map → chunk-QG2U2JGX.cjs.map} +1 -1
- package/dist/chunk-WVZLAAIZ.cjs +31 -0
- package/dist/chunk-WVZLAAIZ.cjs.map +1 -0
- package/dist/{chunk-WV7BCGCK.cjs → chunk-XGM4VVNV.cjs} +19 -19
- package/dist/{chunk-WV7BCGCK.cjs.map → chunk-XGM4VVNV.cjs.map} +1 -1
- package/dist/chunk-ZZZITHGK.cjs +119 -0
- package/dist/chunk-ZZZITHGK.cjs.map +1 -0
- package/dist/connect/docx.cjs +1 -1
- package/dist/connect/index.cjs +175 -175
- package/dist/connect/viewer.cjs +10 -7
- package/dist/connection/presentation/ClippingMediaViewer.js +3 -3
- package/dist/connection/presentation/ClippingMediaViewer.js.map +2 -2
- package/dist/connection/presentation/ClippingPdfViewer.d.ts +4 -3
- package/dist/connection/presentation/ClippingPdfViewer.js +48 -9
- package/dist/connection/presentation/ClippingPdfViewer.js.map +2 -2
- package/dist/connection/presentation/SpotlightLayer.d.ts +5 -0
- package/dist/connection/presentation/SpotlightLayer.js +19 -0
- package/dist/connection/presentation/SpotlightLayer.js.map +7 -0
- package/dist/connection/presentation/SpotlightStrip.d.ts +10 -0
- package/dist/connection/presentation/SpotlightStrip.js +237 -0
- package/dist/connection/presentation/SpotlightStrip.js.map +7 -0
- package/dist/connection/presentation/useViewerClipping.d.ts +4 -3
- package/dist/connection/presentation/useViewerClipping.js +8 -4
- package/dist/connection/presentation/useViewerClipping.js.map +2 -2
- package/dist/connection/viewer/ConnectedDocumentViewer.js +1 -1
- package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
- package/dist/connection/viewer/pdf/passageHighlights.d.ts +5 -0
- package/dist/connection/viewer/pdf/passageHighlights.js +14 -1
- package/dist/connection/viewer/pdf/passageHighlights.js.map +2 -2
- package/dist/connection/viewer/useCleanView.d.ts +3 -1
- package/dist/connection/viewer/useCleanView.js +6 -3
- package/dist/connection/viewer/useCleanView.js.map +2 -2
- package/dist/document-tools/DocumentToolButtons.js +1 -1
- package/dist/document-tools/DocumentToolButtons.js.map +1 -1
- package/dist/document-tools/index.cjs +13 -13
- package/dist/embed/index.cjs +2 -2
- package/dist/index.cjs +239 -239
- package/dist/presentation/ClipCaptureOverlay.d.ts +7 -3
- package/dist/presentation/ClipCaptureOverlay.js +43 -14
- package/dist/presentation/ClipCaptureOverlay.js.map +2 -2
- package/dist/presentation/PresentControls.d.ts +8 -0
- package/dist/presentation/PresentControls.js +1 -0
- package/dist/presentation/PresentControls.js.map +2 -2
- package/dist/presentation/PresentationStage.d.ts +10 -2
- package/dist/presentation/PresentationStage.js +6 -3
- package/dist/presentation/PresentationStage.js.map +2 -2
- package/dist/presentation/PresenterView.js +1 -22
- package/dist/presentation/PresenterView.js.map +2 -2
- package/dist/presentation/SpotlightView.d.ts +19 -0
- package/dist/presentation/SpotlightView.js +180 -0
- package/dist/presentation/SpotlightView.js.map +7 -0
- package/dist/presentation/passage-clip.d.ts +17 -0
- package/dist/presentation/passage-clip.js +25 -0
- package/dist/presentation/passage-clip.js.map +7 -0
- package/dist/presentation/spotlight.d.ts +58 -0
- package/dist/presentation/spotlight.js +110 -0
- package/dist/presentation/spotlight.js.map +7 -0
- package/dist/presentation/store.d.ts +5 -0
- package/dist/presentation/store.js +19 -0
- package/dist/presentation/store.js.map +2 -2
- package/dist/presentation/usePointerActive.d.ts +2 -0
- package/dist/presentation/usePointerActive.js +28 -0
- package/dist/presentation/usePointerActive.js.map +7 -0
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +12 -12
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ClippingMediaViewer-IEIBT74X.cjs.map +0 -1
- package/dist/ClippingPdfViewer-OGYLMVCE.cjs.map +0 -1
- package/dist/ConnectedPresentation-5DOJ35XL.cjs.map +0 -1
- package/dist/ConnectedSlidesTab-7YMEDGUU.cjs.map +0 -1
- package/dist/FilesViewerDialog-2QCCRWF2.cjs.map +0 -1
- package/dist/chunk-46P7IDBX.cjs.map +0 -1
- package/dist/chunk-4TTX6ZNS.cjs.map +0 -1
- package/dist/chunk-DWMWEALB.cjs.map +0 -1
- package/dist/chunk-JD2HX2BR.cjs.map +0 -1
- package/dist/chunk-WFMWKPGY.cjs.map +0 -1
- package/dist/chunk-XK4TVJKD.cjs +0 -73
- package/dist/chunk-XK4TVJKD.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkXGM4VVNV_cjs = require('../chunk-XGM4VVNV.cjs');
|
|
5
5
|
require('../chunk-YZ6YOOTF.cjs');
|
|
6
6
|
require('../chunk-KWJW5TMH.cjs');
|
|
7
7
|
require('../chunk-7NLO7ASW.cjs');
|
|
@@ -32,8 +32,8 @@ require('../chunk-TG2GM7WJ.cjs');
|
|
|
32
32
|
require('../chunk-VKH3BEZE.cjs');
|
|
33
33
|
var chunkNSD37OF5_cjs = require('../chunk-NSD37OF5.cjs');
|
|
34
34
|
require('../chunk-OEJQFPWO.cjs');
|
|
35
|
-
var
|
|
36
|
-
var
|
|
35
|
+
var chunkQG2U2JGX_cjs = require('../chunk-QG2U2JGX.cjs');
|
|
36
|
+
var chunkCQQQIZU4_cjs = require('../chunk-CQQQIZU4.cjs');
|
|
37
37
|
require('../chunk-QECKDZ47.cjs');
|
|
38
38
|
var chunkTP5PGWIO_cjs = require('../chunk-TP5PGWIO.cjs');
|
|
39
39
|
var chunkI4IS6ST6_cjs = require('../chunk-I4IS6ST6.cjs');
|
|
@@ -47,9 +47,9 @@ require('../chunk-3YEXZX4H.cjs');
|
|
|
47
47
|
require('../chunk-4PA6VCCR.cjs');
|
|
48
48
|
var chunkWXUU3COI_cjs = require('../chunk-WXUU3COI.cjs');
|
|
49
49
|
require('../chunk-AHDJXIUB.cjs');
|
|
50
|
-
require('../chunk-YVCOQHCE.cjs');
|
|
51
50
|
require('../chunk-RL2HI6NP.cjs');
|
|
52
51
|
require('../chunk-6UZC4XVV.cjs');
|
|
52
|
+
require('../chunk-YVCOQHCE.cjs');
|
|
53
53
|
require('../chunk-JV5TVUOU.cjs');
|
|
54
54
|
require('../chunk-ZVEW3JBT.cjs');
|
|
55
55
|
require('../chunk-M74FWYNL.cjs');
|
|
@@ -1852,7 +1852,7 @@ function TriggerInspector({
|
|
|
1852
1852
|
}
|
|
1853
1853
|
)
|
|
1854
1854
|
] }),
|
|
1855
|
-
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1855
|
+
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkCQQQIZU4_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
|
|
1856
1856
|
trigger.start === "event" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1857
1857
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.event }),
|
|
1858
1858
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2743,13 +2743,13 @@ function WorkflowPreview({
|
|
|
2743
2743
|
renderIcon,
|
|
2744
2744
|
testId
|
|
2745
2745
|
}) {
|
|
2746
|
-
const run =
|
|
2746
|
+
const run = chunkQG2U2JGX_cjs.useWorkflowPreview(workflow, {
|
|
2747
2747
|
resolveWorkflow: (id) => workflows.find((w) => w.id === id),
|
|
2748
2748
|
compose,
|
|
2749
2749
|
answer
|
|
2750
2750
|
});
|
|
2751
2751
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2752
|
-
|
|
2752
|
+
chunkCQQQIZU4_cjs.WorkflowRunner,
|
|
2753
2753
|
{
|
|
2754
2754
|
workflow,
|
|
2755
2755
|
run,
|
|
@@ -3045,7 +3045,7 @@ function ConnectedWorkflowsPage({
|
|
|
3045
3045
|
const config = host.workflows;
|
|
3046
3046
|
const { openConversation, openFiles } = chunkTKHCIHE2_cjs.useBlocksEnvironment();
|
|
3047
3047
|
const openWorkflow = chunkP5AQYC4D_cjs.useOpenWorkflow();
|
|
3048
|
-
const renderPerson =
|
|
3048
|
+
const renderPerson = chunkXGM4VVNV_cjs.useRenderTaskPerson();
|
|
3049
3049
|
const refreshDocuments = react$2.useRefreshDocuments();
|
|
3050
3050
|
const invalidateTags = react$2.useInvalidateTagData();
|
|
3051
3051
|
const { data: tags = [] } = react$2.useTags();
|
|
@@ -3076,7 +3076,7 @@ function ConnectedWorkflowsPage({
|
|
|
3076
3076
|
openHistory,
|
|
3077
3077
|
closeHistoryTab,
|
|
3078
3078
|
selectHistoryTab
|
|
3079
|
-
} =
|
|
3079
|
+
} = chunkXGM4VVNV_cjs.useWorkflowsPageState({
|
|
3080
3080
|
historyWorkflowId: requestedHistoryId ?? historyWorkflowId,
|
|
3081
3081
|
onHistoryWorkflowConsumed: consumeHistory
|
|
3082
3082
|
});
|
|
@@ -3144,7 +3144,7 @@ function ConnectedWorkflowsPage({
|
|
|
3144
3144
|
return (
|
|
3145
3145
|
// The page in the Workflows page's frame: padded, scrolling.
|
|
3146
3146
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full min-h-0 w-full overflow-auto p-4 sm:p-6", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3147
|
-
|
|
3147
|
+
chunkXGM4VVNV_cjs.ConnectedWorkflowRunPage,
|
|
3148
3148
|
{
|
|
3149
3149
|
workflow: running.workflow,
|
|
3150
3150
|
projectFrom: running.projectFrom,
|
|
@@ -3262,7 +3262,7 @@ function ConnectedWorkflowsPage({
|
|
|
3262
3262
|
}
|
|
3263
3263
|
},
|
|
3264
3264
|
content: hostTab ? hostTab.content : runsFor ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3265
|
-
|
|
3265
|
+
chunkXGM4VVNV_cjs.ConnectedWorkflowHistory,
|
|
3266
3266
|
{
|
|
3267
3267
|
inline: true,
|
|
3268
3268
|
hideHeader: true,
|
|
@@ -3326,7 +3326,7 @@ function ConnectedWorkflowsPage({
|
|
|
3326
3326
|
}
|
|
3327
3327
|
),
|
|
3328
3328
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3329
|
-
|
|
3329
|
+
chunkXGM4VVNV_cjs.ConnectedTaskComposer,
|
|
3330
3330
|
{
|
|
3331
3331
|
kind: "workflow",
|
|
3332
3332
|
saveOnly: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbidocs/coedit",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.124",
|
|
4
4
|
"description": "Real-time collaboration for the ARBI native DOCX editor: a Yjs mirror of the canonical OOXML package, session, and server runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbidocs/blocks",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.124",
|
|
4
4
|
"description": "Composable, domain-neutral UI blocks for ARBI apps, organised by capability (retrieval, facts, agents, workspaces, citations, collaboration) plus shell, theme and site primitives, on top of @arbidocs/react.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -344,9 +344,9 @@
|
|
|
344
344
|
"custom-site:test:e2e": "playwright test -c examples/custom-site/playwright.config.ts"
|
|
345
345
|
},
|
|
346
346
|
"dependencies": {
|
|
347
|
-
"@arbidocs/client": "0.5.
|
|
348
|
-
"@arbidocs/coedit": "0.5.
|
|
349
|
-
"@arbidocs/sdk": "0.5.
|
|
347
|
+
"@arbidocs/client": "0.5.124",
|
|
348
|
+
"@arbidocs/coedit": "0.5.124",
|
|
349
|
+
"@arbidocs/sdk": "0.5.124",
|
|
350
350
|
"@auth0/auth0-react": "^2.19.0",
|
|
351
351
|
"@dnd-kit/core": "^6.3.1",
|
|
352
352
|
"@dnd-kit/sortable": "^10.0.0",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"y-protocols": "^1.0.6"
|
|
398
398
|
},
|
|
399
399
|
"peerDependencies": {
|
|
400
|
-
"@arbidocs/react": "0.5.
|
|
400
|
+
"@arbidocs/react": "0.5.124",
|
|
401
401
|
"@lexical/html": "0.35.0",
|
|
402
402
|
"@lexical/link": "0.35.0",
|
|
403
403
|
"@lexical/list": "0.35.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/presentation/ClippingMediaViewer.tsx"],"names":["useObjectUrl","useRef","useState","useEffect","useCallback","usePresentation","mediaCaption","jsxs","jsx","ClipCaptureOverlay","Button","Pause","Play","formatTime","Plus"],"mappings":";;;;;;;;;;;AAqBA,IAAM,KAAA,GAAc,EAAE,CAAA,EAAG,CAAA,EAAG,GAAG,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,C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A,IAAW,OAAA,CAAQ,EAAE,IAAA,EAAM,KAAA,EAAO,MAAA,EAAQ,OAAA,EAAS,CAAA;AAAA,UAClE,aAAA,EAAY,kBAAA;AAAA,UAEZ,QAAA,EAAA;AAAA,4BAAAF,cAAA,CAACM,gBAAA,EAAA,EAAK,WAAU,aAAA,EAAc,CAAA;AAAA,YAAE;AAAA;AAAA;AAAA;AAElC,KAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ","file":"ClippingMediaViewer-IEIBT74X.cjs","sourcesContent":["/**\n * An image or a video while clipping for a presentation: drag over it and that area becomes a clip\n * (of a video: from the moment on screen). A video has its own small bar (play / pause, scrub, and\n * \"Add whole frame\"), since the drag area covers the picture.\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { Pause, Play, Plus } from 'lucide-react'\nimport { Button } from '@arbidocs/react/ui'\nimport { ClipCaptureOverlay } from '../../presentation/ClipCaptureOverlay'\nimport { formatTime, mediaCaption, type Rect } from '../../presentation/model'\nimport { usePresentation } from '../../presentation/store'\nimport { useObjectUrl } from '../../presentation/useObjectUrl'\n\nexport interface ClippingMediaViewerProps {\n file: Blob\n kind: 'image' | 'video'\n documentId: string\n fileName: string\n}\n\nconst WHOLE: Rect = { x: 0, y: 0, w: 1, h: 1 }\n\nexport function ClippingMediaViewer({\n file,\n kind,\n documentId,\n fileName,\n}: ClippingMediaViewerProps) {\n const url = useObjectUrl(file)\n const videoRef = useRef<HTMLVideoElement>(null)\n const imageRef = useRef<HTMLImageElement>(null)\n // The picture's own width / height, once known.\n const [natural, setNatural] = useState<number | null>(null)\n const [time, setTime] = useState(0)\n const [duration, setDuration] = useState(0)\n const [playing, setPlaying] = useState(false)\n\n // Its size, read as soon as it is known: at once if it already loaded (a cached file can load\n // before any handler is attached), else when it does.\n useEffect(() => {\n const media = videoRef.current ?? imageRef.current\n if (!media || !url) return\n const read = () => {\n const width = media instanceof HTMLVideoElement ? media.videoWidth : media.naturalWidth\n const height = media instanceof HTMLVideoElement ? media.videoHeight : media.naturalHeight\n if (width && height) setNatural(width / height)\n if (media instanceof HTMLVideoElement) setDuration(media.duration || 0)\n }\n read()\n const event = media instanceof HTMLVideoElement ? 'loadedmetadata' : 'load'\n media.addEventListener(event, read)\n return () => media.removeEventListener(event, read)\n }, [url])\n\n const capture = useCallback(\n ({ rect, aspect }: { rect: Rect; aspect: number }) => {\n const start = kind === 'video' ? (videoRef.current?.currentTime ?? 0) : undefined\n usePresentation.getState().addClip({\n kind,\n documentId,\n fileName,\n page: 1,\n rect,\n aspect,\n masks: [],\n source: file,\n start,\n caption: mediaCaption(fileName, start),\n })\n },\n [kind, documentId, fileName, file]\n )\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\" data-testid=\"clipping-media-viewer\">\n <div className=\"border-b border-border bg-muted px-3 py-1.5 text-xs text-muted-foreground\">\n {kind === 'video'\n ? 'Drag over the video to clip that area from this moment, or add the whole frame.'\n : 'Drag over the part of the image to show it in the presentation.'}\n </div>\n <div className=\"relative min-h-0 flex-1 bg-black\" style={{ containerType: 'size' }}>\n {/* The picture as large as fits, aspect kept; the drag area covers exactly it. */}\n <div\n className=\"absolute inset-0 m-auto\"\n style={\n natural\n ? {\n width: `min(100cqw, calc(100cqh * ${natural}))`,\n height: `min(100cqh, calc(100cqw / ${natural}))`,\n }\n : { width: '100%', height: '100%' }\n }\n >\n {kind === 'video' ? (\n <video\n ref={videoRef}\n src={url}\n playsInline\n preload=\"auto\"\n className=\"block h-full w-full\"\n onTimeUpdate={(event) => setTime(event.currentTarget.currentTime)}\n onPlay={() => setPlaying(true)}\n onPause={() => setPlaying(false)}\n />\n ) : (\n <img\n ref={imageRef}\n src={url}\n alt={fileName}\n draggable={false}\n className=\"block h-full w-full select-none\"\n />\n )}\n {natural && <ClipCaptureOverlay page={1} onCapture={capture} />}\n </div>\n </div>\n {kind === 'video' && (\n <div className=\"flex items-center gap-2 border-t border-border px-3 py-1.5\">\n <Button\n type=\"button\"\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => {\n const v = videoRef.current\n if (!v) return\n if (v.paused) void v.play()\n else v.pause()\n }}\n aria-label={playing ? 'Pause' : 'Play'}\n >\n {playing ? <Pause className=\"size-4\" /> : <Play className=\"size-4\" />}\n </Button>\n <input\n type=\"range\"\n min={0}\n max={duration || 0}\n step={0.1}\n value={time}\n onChange={(event) => {\n const v = videoRef.current\n if (v) v.currentTime = Number(event.target.value)\n }}\n className=\"min-w-0 flex-1\"\n aria-label=\"Position in the video\"\n />\n <span className=\"text-xs tabular-nums text-muted-foreground\">\n {formatTime(time)} / {formatTime(duration)}\n </span>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={!natural}\n onClick={() => natural && capture({ rect: WHOLE, aspect: natural })}\n data-testid=\"clip-whole-frame\"\n >\n <Plus className=\"mr-1 size-4\" />\n Add whole frame\n </Button>\n </div>\n )}\n </div>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/presentation/ClippingPdfViewer.tsx"],"names":["useDocumentTools","useState","useEffect","createMarkupStore","jsx","useCallback","usePresentation","ClipCaptureOverlay","jsxs"],"mappings":";;;;;;;;;AAsBA,IAAM,WAAsB,EAAE,MAAA,EAAQ,SAAS,KAAA,kBAAO,IAAI,KAAI,EAAE;AAGhE,SAAS,iBAAA,CAAkB,UAAA,EAAoB,OAAA,EAA6B,SAAA,EAAoB;AAC9F,EAAA,MAAM,EAAE,MAAA,EAAO,GAAIA,8BAAA,EAAiB;AACpC,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAIC,cAAA,CAAoB,YAAY,EAAE,MAAA,EAAQ,SAAA,EAAU,GAAI,QAAQ,CAAA;AAC1F,EAAAC,eAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,SAAA,EAAW;AACd,MAAA,QAAA,CAAS,QAAQ,CAAA;AACjB,MAAA;AAAA,IACF;AACA,IAAA,IAAI,SAAA,G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AAAA,oBACAA,cAAA,CAAC,SAAI,SAAA,EAAU,gBAAA,EACb,yCAAC,MAAA,EAAA,EAAQ,GAAG,WAAA,EAAa,iBAAA,EAAsC,CAAA,EACjE;AAAA,GAAA,EACF,CAAA;AAEJ","file":"ClippingPdfViewer-OGYLMVCE.cjs","sourcesContent":["/**\n * The PDF while clipping for a presentation: drag over a page and the area becomes a clip in the\n * presentation (and goes on the current slide while that has fewer than two).\n *\n * Redactions are honoured: when the version has markup, its redaction marks (all but rejected\n * ones) are read first and every clip carries those over its area as black masks, so a redacted\n * passage never reaches a shared screen. Clipping waits for them, and stays off if they cannot be\n * read.\n */\n\nimport { useCallback, useEffect, useState, type ComponentType, type ReactNode } from 'react'\nimport { createMarkupStore, useDocumentTools } from '@arbidocs/react/document-tools'\nimport type { PdfViewerProps } from '@arbidocs/react/viewers'\nimport { ClipCaptureOverlay } from '../../presentation/ClipCaptureOverlay'\nimport type { Rect } from '../../presentation/model'\nimport { usePresentation } from '../../presentation/store'\n\ntype MaskState =\n | { status: 'loading' }\n | { status: 'error' }\n | { status: 'ready'; masks: ReadonlyMap<number, Rect[]> }\n\nconst NO_MASKS: MaskState = { status: 'ready', masks: new Map() }\n\n/** The version's redaction rectangles by page; none to read when it has no markup. */\nfunction useRedactionMasks(documentId: string, version: number | undefined, hasMarkup: boolean) {\n const { client } = useDocumentTools()\n const [state, setState] = useState<MaskState>(hasMarkup ? { status: 'loading' } : NO_MASKS)\n useEffect(() => {\n if (!hasMarkup) {\n setState(NO_MASKS)\n return\n }\n let cancelled = false\n setState({ status: 'loading' })\n createMarkupStore({ version, client })\n .load(documentId)\n .then((layer) => {\n if (cancelled) return\n const masks = new Map<number, Rect[]>()\n for (const mark of layer.annotations) {\n if (mark.kind !== 'redaction' || mark.status === 'rejected') continue\n masks.set(mark.page, [...(masks.get(mark.page) ?? []), ...mark.rects])\n }\n setState({ status: 'ready', masks })\n })\n .catch(() => !cancelled && setState({ status: 'error' }))\n return () => {\n cancelled = true\n }\n }, [client, documentId, version, hasMarkup])\n return state\n}\n\nexport interface ClippingPdfViewerProps extends Omit<PdfViewerProps, 'renderPageOverlay'> {\n file: Blob\n documentId: string\n /** The version on screen when it is an older one. */\n version?: number\n fileName: string\n /** The version has markup, which may hold redactions. */\n hasMarkup: boolean\n viewer: ComponentType<PdfViewerProps>\n}\n\nfunction Notice({ children }: { children: ReactNode }) {\n return (\n <div className=\"border-b border-border bg-muted px-3 py-1.5 text-xs text-muted-foreground\">\n {children}\n </div>\n )\n}\n\nexport function ClippingPdfViewer({\n documentId,\n version,\n fileName,\n hasMarkup,\n viewer: Viewer,\n ...viewerProps\n}: ClippingPdfViewerProps) {\n const masks = useRedactionMasks(documentId, version, hasMarkup)\n const file = viewerProps.file\n\n const capture = useCallback(\n ({ page, rect, aspect }: { page: number; rect: Rect; aspect: number }) => {\n if (masks.status !== 'ready') return\n usePresentation.getState().addClip({\n kind: 'pdf',\n documentId,\n version,\n fileName,\n page,\n rect,\n aspect,\n masks: masks.masks.get(page) ?? [],\n source: file,\n })\n // It joins the presentation's tray (the viewer's Presentation pill counts it).\n },\n [masks, documentId, version, fileName, file]\n )\n\n const renderPageOverlay = useCallback(\n ({ pageNumber }: { pageNumber: number }) =>\n masks.status === 'ready' ? (\n <ClipCaptureOverlay page={pageNumber} onCapture={capture} />\n ) : null,\n [masks.status, capture]\n )\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\" data-testid=\"clipping-pdf-viewer\">\n <Notice>\n {masks.status === 'loading'\n ? 'Reading the redactions before clipping…'\n : masks.status === 'error'\n ? \"Couldn't read this document's redactions, so it can't be clipped.\"\n : 'Drag over the part of a page to show it in the presentation.'}\n </Notice>\n <div className=\"min-h-0 flex-1\">\n <Viewer {...viewerProps} renderPageOverlay={renderPageOverlay} />\n </div>\n </div>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/presentation/PresentControls.tsx","../src/presentation/PresenterView.tsx","../src/connection/presentation/ConnectedPresentation.tsx"],"names":["jsx","usePresentation","jsxs","cn","ChevronLeft","ChevronRight","EyeOff","toggleFullscreen","Maximize","Square","useEffect","STAGE_ASPECT","useState","useCallback","usePresenterKeys","PresentationStage","SlidesEditor","ConnectedDocumentToolsProvider","useArbiSessionStore","useArbiSessionState","isPanelOpen","PRESENTATION_PANEL","useArbiSession","useRef","usePresentationFiles","usePresentationController","presentationWindowOnlyPresents","ConnectedPanelHost","Fragment","Button","PanelLeftClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAM,OAAA,GACJ,mQAAA;AAEF,SAAS,OAAA,CAAQ;AAAA,EACf,KAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA,EAMG;AACD,EAAA,uBACEA,cAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,SAAA,EAAW,OAAA;AAAA,MACX,KAAA,EAAO,KAAA;AAAA,MACP,YAAA,EAAY,KAAA;AAAA,MACZ,QAAA;AAAA,MACA,OAAA,EAAS,CAAC,KAAA,KAAU;AAElB,QAAA,KAAA,CAAM,eAAA,EAAgB;AACtB,QAAA,OAAA,EAAQ;AAAA,MACV,CAAA;AAAA,MACA,aAAA,EAAa,MAAA;AAAA,MAEZ;AAAA;AAAA,GACH;AAEJ;AAQO,SAAS,eAAA,CAAgB,EAAE,IAAA,EAAM,KAAA,EAAM,EAAyB;AACrE,EAAA,MAAM,OAAA,GAAUC,iCAAA,CAAgB,CAAC,CAAA,KAAM,EAAE,OAAO,CAAA;AAChD,EAAA,MAAM,QAAQA,iCAAA,CAAgB,CAAC,CAAA,KAAM,CAAA,CAAE,OAAO,MAAM,CAAA;AACpD,EAAA,MAAM,KAAA,GAAQA,iCAAA,CAAgB,CAAC,CAAA,KAAM,EAAE,KAAK,CAAA;AAC5C,EAAA,MAAM,OAAA,GAAUA,kCA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A,wBAC3B5B,cAAAA;AAAA,UAAC,aAAA;AAAA,UAAA;AAAA,YACE,GAAG,UAAA,CAAW,MAAA;AAAA,YACf,OAAA,kBACEE,eAAAA,CAAA0B,mBAAA,EAAA,EACG,QAAA,EAAA;AAAA,cAAA,UAAA,CAAW,MAAA,CAAO,OAAA;AAAA,8BACnB5B,cAAAA;AAAA,gBAAC6B,SAAA;AAAA,gBAAA;AAAA,kBACC,IAAA,EAAK,QAAA;AAAA,kBACL,IAAA,EAAK,MAAA;AAAA,kBACL,OAAA,EAAQ,OAAA;AAAA,kBACR,SAAA,EAAU,2EAAA;AAAA,kBACV,KAAA,EAAM,4BAAA;AAAA,kBACN,YAAA,EAAW,oBAAA;AAAA,kBACX,OAAA,EAAS,OAAA;AAAA,kBACT,aAAA,EAAY,qBAAA;AAAA,kBAEZ,QAAA,kBAAA7B,cAAAA,CAAC8B,0BAAA,EAAA,EAAe,SAAA,EAAU,QAAA,EAAS;AAAA;AAAA;AACrC,aAAA,EACF;AAAA;AAAA;AAEJ,OAAA,EACF;AAAA;AAAA,GAEJ;AAEJ","file":"ConnectedPresentation-5DOJ35XL.cjs","sourcesContent":["/**\n * The presented slides' controls, bottom left: previous and next slide (with where you are),\n * blank, full screen and stop. Like a slideshow's, they show while the pointer moves (or a key is\n * pressed) and fade after a moment, with the pointer, so a shared screen rarely shows them.\n */\n\nimport type { ReactNode } from 'react'\nimport { ChevronLeft, ChevronRight, EyeOff, Maximize, Square } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { usePresentation } from './store'\nimport { toggleFullscreen } from './usePresenterKeys'\n\nconst CONTROL =\n 'inline-flex size-8 items-center justify-center rounded-full text-white/85 hover:bg-white/15 hover:text-white disabled:opacity-30 disabled:hover:bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/60 pointer-coarse:size-11'\n\nfunction Control({\n label,\n onClick,\n disabled,\n children,\n testId,\n}: {\n label: string\n onClick: () => void\n disabled?: boolean\n children: ReactNode\n testId: string\n}) {\n return (\n <button\n type=\"button\"\n className={CONTROL}\n title={label}\n aria-label={label}\n disabled={disabled}\n onClick={(event) => {\n // A click on the controls is not a click on the slide (which goes to the next one).\n event.stopPropagation()\n onClick()\n }}\n data-testid={testId}\n >\n {children}\n </button>\n )\n}\n\nexport interface PresentControlsProps {\n /** The window presented in (full screen is that window's). */\n view: Window | null\n shown: boolean\n}\n\nexport function PresentControls({ view, shown }: PresentControlsProps) {\n const current = usePresentation((s) => s.current)\n const count = usePresentation((s) => s.slides.length)\n const blank = usePresentation((s) => s.blank)\n const actions = usePresentation.getState()\n return (\n <div\n className={cn(\n 'absolute bottom-4 left-4 z-30 flex items-center gap-0.5 rounded-full bg-black/60 p-1 text-white shadow-lg backdrop-blur transition-opacity duration-300',\n shown ? 'opacity-100' : 'pointer-events-none opacity-0'\n )}\n onPointerDown={(event) => event.stopPropagation()}\n onDoubleClick={(event) => event.stopPropagation()}\n role=\"toolbar\"\n aria-label=\"Slideshow\"\n data-testid=\"present-controls\"\n >\n <Control\n label=\"Previous slide (←)\"\n onClick={() => actions.goTo(current - 1)}\n disabled={current === 0}\n testId=\"present-previous\"\n >\n <ChevronLeft className=\"size-4\" />\n </Control>\n <span\n className=\"min-w-12 text-center text-xs tabular-nums text-white/85\"\n data-testid=\"present-position\"\n >\n {current + 1} / {count}\n </span>\n <Control\n label=\"Next slide (→, or click the slide)\"\n onClick={() => actions.goTo(current + 1)}\n disabled={current >= count - 1}\n testId=\"present-next\"\n >\n <ChevronRight className=\"size-4\" />\n </Control>\n <div className=\"mx-1 h-4 w-px bg-white/25\" />\n <Control\n label={blank ? 'Show the slide (B)' : 'Blank the screen (B)'}\n onClick={() => actions.setBlank(!blank)}\n testId=\"present-blank\"\n >\n <EyeOff className={cn('size-4', blank && 'text-amber-300')} />\n </Control>\n <Control\n label=\"Full screen (F)\"\n onClick={() => view && toggleFullscreen(view)}\n testId=\"present-fullscreen\"\n >\n <Maximize className=\"size-4\" />\n </Control>\n <Control\n label=\"Stop presenting (Esc)\"\n onClick={() => actions.setPresenting(false)}\n testId=\"present-stop\"\n >\n <Square className=\"size-3.5 fill-current\" />\n </Control>\n </div>\n )\n}\n","/**\n * The presentation in a window of its own, in one of two modes.\n *\n * Present: nothing but the stage on black, no controls and no pointer: what is shared in a call or\n * shown on a projector. Keys drive it (arrows / Page Up / Page Down change slide, B blanks, F or\n * double-click toggles full screen, Space plays videos, Escape stops presenting).\n *\n * Edit: the slides editor (`SlidesEditor`), the same as in the viewer's tab, when the presentation\n * is edited in its own window (beside the document its clips come from).\n */\n\nimport { useCallback, useEffect, useState } from 'react'\nimport { PresentationStage } from './PresentationStage'\nimport { SlidesEditor, type SlidesEditorProps } from './SlidesEditor'\nimport { STAGE_ASPECT } from './model'\nimport { usePresentation } from './store'\nimport { toggleFullscreen, usePresenterKeys } from './usePresenterKeys'\nimport { PresentControls } from './PresentControls'\n\n/** The presenting window's page width, at most (smaller on a small screen). */\nconst PRESENT_WIDTH = 1280\n\n/**\n * While presenting in a pop-out, its page is made 16:9 and wide enough to share sharply, so a\n * shared window is all stage with no bars; editing again gives the window back its size. Only a\n * pop-out (a window this app opened) can be resized; the app's own window is left alone.\n */\nfunction useStageShapedWindow(view: Window | null, presenting: boolean) {\n useEffect(() => {\n if (!view || !presenting || !view.opener) return\n const before = { width: view.outerWidth, height: view.outerHeight }\n const chromeWidth = view.outerWidth - view.innerWidth\n const chromeHeight = view.outerHeight - view.innerHeight\n // Wide enough for a sharp share (a call receives about what the window shows), and 16:9.\n const width = Math.max(\n view.innerWidth,\n Math.min(PRESENT_WIDTH, Math.round((view.screen.availWidth - chromeWidth) * 0.6))\n )\n const height = Math.min(\n Math.round(width / STAGE_ASPECT),\n view.screen.availHeight - chromeHeight\n )\n try {\n view.resizeTo(Math.round(height * STAGE_ASPECT) + chromeWidth, height + chromeHeight)\n } catch {\n return // not resizable: the stage letterboxes in black\n }\n return () => {\n try {\n if (!view.closed) view.resizeTo(before.width, before.height)\n } catch {\n // gone or not resizable\n }\n }\n }, [view, presenting])\n}\n\n/** How long the pointer (or a key) has to rest before the controls fade. */\nconst IDLE_MS = 2200\n\n/** The pointer has moved (or a key was pressed) in `view` within the last moment. */\nfunction usePointerActive(view: Window | null): boolean {\n const [active, setActive] = useState(true)\n useEffect(() => {\n if (!view) return\n setActive(true)\n let timer = view.setTimeout(() => setActive(false), IDLE_MS)\n const wake = () => {\n setActive(true)\n view.clearTimeout(timer)\n timer = view.setTimeout(() => setActive(false), IDLE_MS)\n }\n view.addEventListener('pointermove', wake)\n view.addEventListener('keydown', wake)\n return () => {\n view.clearTimeout(timer)\n view.removeEventListener('pointermove', wake)\n view.removeEventListener('keydown', wake)\n }\n }, [view])\n return active\n}\n\nexport type PresenterViewProps = Omit<SlidesEditorProps, 'onPresent'> & {\n /** Present (default: here, in this window). */\n onPresent?: () => void\n}\n\nexport function PresenterView({ onPresent, ...editor }: PresenterViewProps) {\n const presenting = usePresentation((s) => s.presenting)\n const [view, setView] = useState<Window | null>(null)\n // The keys work in whichever window the presenter is in.\n const rootRef = useCallback((node: HTMLDivElement | null) => {\n if (node) setView(node.ownerDocument.defaultView)\n }, [])\n usePresenterKeys(presenting ? view : null, true)\n useStageShapedWindow(view, presenting)\n\n const active = usePointerActive(presenting ? view : null)\n\n if (presenting) {\n return (\n <div\n ref={rootRef}\n className=\"relative h-full w-full select-none bg-black\"\n // The pointer shows while it moves, with the controls; idle, nothing but the slide.\n style={{ cursor: active ? 'default' : 'none' }}\n // A click on the slide goes to the next one, as in a slideshow.\n onClick={() => {\n const state = usePresentation.getState()\n state.goTo(state.current + 1)\n }}\n onDoubleClick={() => view && toggleFullscreen(view)}\n data-testid=\"presentation-present\"\n >\n <PresentationStage />\n <PresentControls view={view} shown={active} />\n </div>\n )\n }\n return (\n <div ref={rootRef} className=\"h-full min-h-0\" data-testid=\"presenter-view\">\n <SlidesEditor\n {...editor}\n onPresent={onPresent ?? (() => usePresentation.getState().setPresenting(true))}\n />\n </div>\n )\n}\n","/**\n * The presentation's own window, mounted once by the app shell (the session's `PRESENTATION_PANEL`,\n * a pop-out). It presents: the slides alone, what is shared in a call or put full screen; or, when\n * the editor is popped out of the viewer's slides tab, it edits there, beside the documents its\n * clips come from. A window opened only to present closes when presenting ends.\n *\n * It also keeps what the presentation needs wherever it is edited: the theme's logo image, read\n * when the logo changes; and a clean slate when the session signs out or another user signs in\n * (the presentation holds decrypted files in memory).\n */\n\nimport { useCallback, useEffect, useRef } from 'react'\nimport { PanelLeftClose } from 'lucide-react'\nimport {\n isPanelOpen,\n useArbiSession,\n useArbiSessionState,\n useArbiSessionStore,\n} from '@arbidocs/react'\nimport { Button } from '@arbidocs/react/ui'\nimport { ConnectedPanelHost } from '../panels/ConnectedPanelHost'\nimport { ConnectedDocumentToolsProvider } from '../viewer/ConnectedDocumentToolsProvider'\nimport { PRESENTATION_PANEL, presentationWindowOnlyPresents } from '../../presentation/panel-id'\nimport { PresenterView } from '../../presentation/PresenterView'\nimport { usePresentation } from '../../presentation/store'\nimport { usePresentationController } from './usePresentationController'\nimport { usePresentationFiles } from './usePresentationFiles'\n\n/** The presentation's window, with the document tools it needs (sources, redactions). */\nexport function ConnectedPresentation() {\n return (\n <ConnectedDocumentToolsProvider>\n <PresentationWindow />\n </ConnectedDocumentToolsProvider>\n )\n}\n\nfunction PresentationWindow() {\n const session = useArbiSessionStore()\n const notify = usePresentation((s) => s.notify)\n const presenting = usePresentation((s) => s.presenting)\n const isOpen = useArbiSessionState((state) => isPanelOpen(state, PRESENTATION_PANEL))\n const { user } = useArbiSession()\n const userId = user?.external_id ?? null\n const shownFor = useRef(userId)\n const { downloadFile } = usePresentationFiles()\n const logoId = usePresentation((s) => s.theme.logo?.documentId ?? null)\n const controller = usePresentationController(isOpen && !presenting)\n\n useEffect(() => {\n if (shownFor.current === userId) return\n shownFor.current = userId\n usePresentation.getState().reset()\n session.closePanel(PRESENTATION_PANEL)\n }, [userId, session])\n\n // The theme's logo image, fetched whenever the logo changes (the theme keeps a reference only).\n useEffect(() => {\n if (!logoId) return\n let current = true\n downloadFile(logoId)\n .then((image) => current && usePresentation.getState().setLogoImage(image))\n .catch(() => current && notify('The logo could not be read', 'error'))\n return () => {\n current = false\n }\n }, [logoId, downloadFile, notify])\n\n // A closed window is not presenting.\n useEffect(() => {\n if (!isOpen) usePresentation.getState().setPresenting(false)\n }, [isOpen])\n\n // Opened only to present: closed when presenting ends (Escape).\n const wasPresenting = useRef(presenting)\n useEffect(() => {\n if (wasPresenting.current && !presenting && isOpen && presentationWindowOnlyPresents()) {\n session.closePanel(PRESENTATION_PANEL)\n }\n wasPresenting.current = presenting\n }, [presenting, isOpen, session])\n\n const onClose = useCallback(() => session.closePanel(PRESENTATION_PANEL), [session])\n\n return (\n <ConnectedPanelHost\n panelId={PRESENTATION_PANEL}\n isOpen={isOpen}\n onClose={onClose}\n title=\"Presentation\"\n defaultMode=\"popout\"\n defaultWidth={960}\n closeTestId=\"presentation-panel-close\"\n >\n {/* Inside the panel, so its dialogs open in its window. */}\n {() => (\n <>\n {!presenting && controller.dialogs}\n <PresenterView\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=\"Back into the app's viewer\"\n aria-label=\"Back to the viewer\"\n onClick={onClose}\n data-testid=\"presentation-pop-in\"\n >\n <PanelLeftClose className=\"size-4\" />\n </Button>\n </>\n }\n />\n </>\n )}\n </ConnectedPanelHost>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/presentation/ConnectedSlidesTab.tsx"],"names":["hasUnsavedChanges","usePresentation","useArbiSessionStore","usePanelHostSupport","useBlocksEnvironment","usePresentationFiles","useState","useArbiSessionState","isPanelOpen","PRESENTATION_PANEL","presentationWindowOnlyPresents","usePresentationController","useRef","useEffect","editPresentation","registerDocumentTurnFlush","useCallback","openPresentation","jsx","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,MAACS,8BAAA;AAAA,MAAA;AAAA,QACE,GAAG,UAAA,CAAW,MAAA;AAAA,QACf,2BACEN,eAAA,CAAAK,mBAAA,EAAA,EACG,QAAA,EAAA;AAAA,UAAA,UAAA,CAAW,MAAA,CAAO,SAAA;AAAA,0BACnBL,eAAA;AAAA,YAACO,mBAAA;AAAA,YAAA;AAAA,cACC,QAAA,EAAU,MACRX,kCAAA,CAAiB,OAAA,EAAS,EAAE,SAAS,KAAA,EAAO,WAAA,CAAY,cAAc,CAAA,EAAG,CAAA;AAAA,cAE3E,aAAA,EAAY,sBAAA;AAAA,cAEZ,QAAA,EAAA;AAAA,gCAAAC,cAAA,CAACE,wBAAA,EAAA,EAAa,WAAU,QAAA,EAAS,CAAA;AAAA,gCACjCF,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,MAAA,EAAO,QAAA,EAAA,wBAAA,EAAsB;AAAA;AAAA;AAAA;AAC/C,SAAA,EACF,CAAA;AAAA,QAEF,SAAA,EAAW;AAAA;AAAA;AACb,GAAA,EACF,CAAA;AAEJ","file":"ConnectedSlidesTab-7YMEDGUU.cjs","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-…`). */\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(' · '),\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… 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…\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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/viewer/DocumentViewerDialog.tsx","../src/connection/files/page/FilesViewerDialog.tsx"],"names":["jsx","Eye","PenLine","MessageSquareText","DEFAULT_DOCUMENT_VIEWER_TABS","DEFAULT_ASK_SUGGESTIONS","DEFAULT_DOCUMENT_VIEWER_LABELS","useConnectedWorkspace","useArbiSessionStore","useBlocksEnvironment","useArbiSessionState","useDocuments","parseVersionRef","tab","useState","question","useRef","useSlashField","Dialog","jsxs","DialogContent","DialogHeader","DialogTitle","FileText","DialogDescription","SegmentedControl","ErrorBoundary","DocumentReview","AskBar","ConnectedDocumentViewer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAM,UAAU,CAAC,GAAA,KACf,KAAK,YAAA,EAAc,KAAA,IAAS,KAAK,SAAA,IAAa,UAAA;AAEhD,IAAM,SAAA,GAAkD;AAAA,EACtD,MAAA,kBAAQA,cAAA,CAACC,eAAA,EAAA,EAAI,SAAA,EAAU,QAAA,EAAS,CAAA;AAAA,EAChC,QAAA,kBAAUD,cAAA,CAACE,mBAAA,EAAA,EAAQ,SAAA,EAAU,QAAA,EAAS,CAAA;AAAA,EACtC,GAAA,kBAAKF,cAAA,CAACG,6BAAA,EAAA,EAAkB,SAAA,EAAU,QAAA,EAAS;AAC7C,CAAA;AAEA,IAAM,YAAA,GAAkD;AAAA,EACtD,MAAA,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,EAAA,uBACE5B,cAAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,cAAA,EAAgB,CAAC,EAAA,qBACfA,eAAC6B,yCAAA,EAAA,EAAwB,UAAA,EAAY,IAAI,kBAAA,EAAwC;AAAA;AAAA,GAErF;AAEJ","file":"FilesViewerDialog-2QCCRWF2.cjs","sourcesContent":["/**\n * The document viewer as a dialog (the files page's own viewer): a title, the tabs\n * the host offers, and under them the review (`DocumentReview`), the whole viewer, or a question\n * (`AskBar`) that starts a thread about the document. Views of existing parts, not a new viewer.\n *\n * A draft started with Create New (the session's `draftDocuments`) has no server record yet: it\n * shows the whole viewer only (its kind, name and recorder), titled from the draft.\n */\n\nimport { useRef, useState, type ReactNode } from 'react'\nimport { Eye, FileText, MessageSquareText, PenLine } from 'lucide-react'\nimport {\n DocumentReview,\n useArbiSessionState,\n useArbiSessionStore,\n useDocuments,\n type WorkspaceDocument,\n} from '@arbidocs/react'\nimport { parseVersionRef } from '@arbidocs/react/artifacts'\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '@arbidocs/react/ui'\nimport { AskBar } from '../../components/AskBar'\nimport { ErrorBoundary } from '../../components/ErrorBoundary'\nimport { SegmentedControl, type SegmentedOption } from '../../settings/SegmentedControl'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useSlashField } from '../ask/useSlashField'\nimport {\n DEFAULT_ASK_SUGGESTIONS,\n DEFAULT_DOCUMENT_VIEWER_LABELS,\n DEFAULT_DOCUMENT_VIEWER_TABS,\n type DocumentViewerDialogLabels,\n type DocumentViewerTab,\n} from './documentViewerTabs'\n\ntype ReviewDocument = Parameters<typeof DocumentReview>[0]['doc']\n\nexport interface DocumentViewerDialogProps {\n /** The document, or a version reference `doc-…@v{n}`. */\n documentId: string\n /** The views offered, in order. Default: review, document, ask. */\n tabs?: readonly DocumentViewerTab[]\n /** The view it opens on. Default: the first offered. */\n initialTab?: DocumentViewerTab\n labels?: DocumentViewerDialogLabels\n /** The ask view's suggested questions. */\n askSuggestions?: readonly string[]\n onClose: () => void\n /** The whole viewer, for the document view. */\n renderDocument: (documentId: string) => ReactNode\n}\n\nconst titleOf = (doc: WorkspaceDocument | undefined) =>\n doc?.doc_metadata?.title || doc?.file_name || 'Document'\n\nconst TAB_ICONS: Record<DocumentViewerTab, ReactNode> = {\n review: <Eye className=\"size-4\" />,\n document: <PenLine className=\"size-4\" />,\n ask: <MessageSquareText className=\"size-4\" />,\n}\n\nconst TAB_TEST_IDS: Record<DocumentViewerTab, string> = {\n review: 'review-tab-review',\n document: 'review-tab-pdf',\n ask: 'review-tab-qa',\n}\n\nexport function DocumentViewerDialog({\n documentId,\n tabs = DEFAULT_DOCUMENT_VIEWER_TABS,\n initialTab,\n labels: labelOverrides,\n askSuggestions = DEFAULT_ASK_SUGGESTIONS,\n onClose,\n renderDocument,\n}: DocumentViewerDialogProps) {\n const labels = { ...DEFAULT_DOCUMENT_VIEWER_LABELS, ...labelOverrides }\n const { workspaceId, live } = useConnectedWorkspace()\n const session = useArbiSessionStore()\n const { openNewConversation } = useBlocksEnvironment()\n const passageId = useArbiSessionState((s) => s.viewingDocument?.passageId ?? null)\n const draft = useArbiSessionState((s) => s.draftDocuments[documentId])\n const { data: documents } = useDocuments()\n const baseId = parseVersionRef(documentId).docId\n const doc = documents?.find((d) => d.external_id === baseId)\n const title = draft?.title || titleOf(doc)\n\n // The whole viewer needs a signed-in session (marking up, signing, versions). A draft is only\n // on the client: there is nothing to review or ask about until it is saved.\n const offered: readonly DocumentViewerTab[] = draft\n ? ['document']\n : tabs.filter((tab) => tab !== 'document' || live)\n const [chosen, setChosen] = useState<DocumentViewerTab | undefined>(initialTab)\n const tab = chosen && offered.includes(chosen) ? chosen : offered[0]\n\n const options: SegmentedOption<DocumentViewerTab>[] = offered.map((value) => ({\n value,\n label: labels[value],\n icon: TAB_ICONS[value],\n testId: TAB_TEST_IDS[value],\n }))\n\n // A question opens a new thread about the document, as the viewer's \"Chat\" does.\n const ask = (question: string) => {\n openNewConversation({ prompt: question })\n session.setNewChatDocumentId(baseId)\n }\n // The `/` menu: a skill's run is asked the same way, so its thread is about this document too.\n const [question, setQuestion] = useState('')\n const askInputRef = useRef<HTMLInputElement>(null)\n const slash = useSlashField({\n text: question,\n setText: setQuestion,\n inputRef: askInputRef,\n landing: 'chat',\n send: ask,\n })\n\n return (\n <Dialog open onOpenChange={(open) => !open && onClose()}>\n <DialogContent\n className=\"flex h-[90vh] max-w-[95vw] flex-col gap-0 p-0 sm:max-w-[95vw]\"\n data-testid=\"documents-dialog\"\n >\n <DialogHeader className=\"border-b px-4 py-3\">\n <DialogTitle className=\"flex min-w-0 items-center gap-2 pr-8 text-base\">\n <FileText className=\"size-4 shrink-0\" />\n <span className=\"truncate\" data-testid=\"documents-dialog-title\">\n {title}\n </span>\n </DialogTitle>\n <DialogDescription className=\"sr-only\">\n {offered.map((value) => labels[value]).join(', ')}: {title}\n </DialogDescription>\n {options.length > 1 && tab && (\n <SegmentedControl\n ariaLabel=\"Document view\"\n // A phone fits the three on one row: no label breaks over two lines.\n className=\"mt-2 w-fit max-w-full overflow-x-auto [&_button]:whitespace-nowrap max-sm:[&_button]:px-2.5\"\n value={tab}\n onChange={setChosen}\n options={options}\n />\n )}\n </DialogHeader>\n <div className=\"min-h-0 flex-1 overflow-hidden p-3\">\n {/* A view that fails to render says so here: the dialog and the page under it stay. */}\n <ErrorBoundary\n resetKey={`${documentId}|${tab}`}\n labels={{ title: \"This document couldn't be displayed\" }}\n testId=\"documents-dialog-error\"\n >\n {tab === 'review' && (\n <DocumentReview\n docId={baseId}\n doc={doc as ReviewDocument}\n workspaceId={workspaceId ?? undefined}\n activeChunkId={passageId}\n />\n )}\n {tab === 'document' && (\n <div className=\"h-full overflow-hidden\" data-testid=\"documents-dialog-viewer\">\n {renderDocument(documentId)}\n </div>\n )}\n {tab === 'ask' && (\n <div className=\"mx-auto max-w-2xl space-y-3 pt-6\" data-testid=\"doc-qa-panel\">\n <p className=\"text-sm text-muted-foreground\">{labels.askIntro}</p>\n {slash.launcher}\n <AskBar\n testId=\"doc-ask\"\n placeholder={labels.askPlaceholder.replace('{title}', title)}\n suggestions={[...askSuggestions]}\n onAsk={(text) => {\n if (!slash.startsSkill(text)) ask(text)\n }}\n value={question}\n onValueChange={setQuestion}\n onInputKeyDown={slash.onKeyDown}\n inputProps={slash.comboboxProps}\n inputRef={askInputRef}\n menu={slash.menu}\n />\n </div>\n )}\n </ErrorBoundary>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n","/**\n * The files page's own viewer (a page without a host viewer): `DocumentViewerDialog`, with the\n * whole `ConnectedDocumentViewer` as its document view. The page lazy-loads this module, so the\n * viewer stays out of the page's chunk.\n */\nimport { ConnectedDocumentViewer } from '../../viewer/ConnectedDocumentViewer'\nimport {\n DocumentViewerDialog,\n type DocumentViewerDialogProps,\n} from '../../viewer/DocumentViewerDialog'\n\nexport interface FilesViewerDialogProps extends Omit<DocumentViewerDialogProps, 'renderDocument'> {\n /** Where html/react artifacts load their sandbox runtime from. */\n artifactRuntimeUrl?: string\n}\n\nexport function FilesViewerDialog({ artifactRuntimeUrl, ...props }: FilesViewerDialogProps) {\n return (\n <DocumentViewerDialog\n {...props}\n renderDocument={(id) => (\n <ConnectedDocumentViewer documentId={id} artifactRuntimeUrl={artifactRuntimeUrl} />\n )}\n />\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/document-tools/DocumentToolButtons.tsx","../src/document-tools/MarkupNotices.tsx","../src/document-tools/MarkupViewNote.tsx","../src/document-tools/VersionSnapshotBar.tsx","../src/document-tools/PlaceMySignatureMenuItems.tsx","../src/document-tools/SignatureRequestBanner.tsx","../src/document-tools/FileShareDialog.tsx"],"names":["jsxs","Button","jsx","PencilLine","Scissors","FileText","Download","Fragment","ViewerStatusNote","LINK","useDocumentTools","useState","fetchSavedSignature","DropdownMenuItem","AdoptSignatureDialog","storeSavedSignature","SIGNER_PROGRESS_LABELS","useDocumentSignatureRequests","useVoidSignatureRequest","useInviteSigners","useSignerCandidates","PenLine","Send","FilePenLine","ModalScaffold","createFileShare","Label","Textarea"],"mappings":";;;;;;;;;;;AAUA,IAAM,KAAA,GAAQ,yBAAA;AAUP,SAAS,cAAA,CAAe,EAAE,MAAA,EAAQ,OAAA,EAAS,SAAQ,EAA8B;AACtF,EAAA,uBACEA,eAAA;AAAA,IAACC,SAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,OAAA,EAAS,SAAS,SAAA,GAAY,SAAA;AAAA,MAC9B,IAAA,EAAM,UAAU,MAAA,GAAS,IAAA;AAAA,MACzB,cAAA,EAAc,MAAA;AAAA,MACd,KAAA,EAAM,6CAAA;AAAA,MACN,YAAA,EAAW,UAAA;AAAA,MACX,aAAA,EAAY,iBAAA;AAAA,MACZ,SAAA,EAAW,KAAA;AAAA,MACX,OAAA;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAAC,cAAA,CAACC,sBAAA,EAAA,EAAW,WAAU,QAAA,EAAS,CAAA;AAAA,QAC9B,CAAC,OAAA,oBAAWD,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,QAAO,QAAA,EAAA,UAAA,EAAQ;AAAA;AAAA;AAAA,GAC9C;AAEJ;AAGO,SAAS,UAAA,CAAW,EAAE,MAAA,EAAQ,OAAA,EAAS,SAAQ,EAA8B;AAClF,EAAA,uBACEF,eAAA;AAAA,IAACC,SAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,OAAA,EAAS,SAAS,SAAA,GAAY,SAAA;AAAA,MAC9B,IAAA,EAAM,UAAU,MAAA,GAAS,IAAA;AAAA,MACzB,cAAA,EAAc,MAAA;AAAA,MACd,KAAA,EAAM,4DAAA;AAAA,MACN,YAAA,EAAW,MAAA;AAAA,MACX,aAAA,EAA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AAA;AACF;AAAA,GACF;AAEJ","file":"chunk-46P7IDBX.cjs","sourcesContent":["/**\n * The viewer-header buttons of the PDF document tools: Annotate, Show original, Download with\n * markup and Sign. Separate parts so a host can place them among its own header actions. On a\n * narrow (`compact`) header each is icon-only; its accessible name stays.\n */\n\nimport type { ReactElement } from 'react'\nimport { Download, FileText, PencilLine, Scissors } from 'lucide-react'\nimport { Button } from '@arbidocs/react/ui'\n\nconst TOUCH = 'pointer-coarse:min-h-11'\n\ninterface ToggleProps {\n /** On (pressed). */\n active: boolean\n onClick: () => void\n compact?: boolean\n}\n\n/** Annotate mode: highlight, comment, stamp, redact. */\nexport function AnnotateButton({ active, onClick, compact }: ToggleProps): ReactElement {\n return (\n <Button\n type=\"button\"\n variant={active ? 'default' : 'outline'}\n size={compact ? 'icon' : 'sm'}\n aria-pressed={active}\n title=\"Annotate: highlight, comment, stamp, redact\"\n aria-label=\"Annotate\"\n data-testid=\"annotate-toggle\"\n className={TOUCH}\n onClick={onClick}\n >\n <PencilLine className=\"size-4\" />\n {!compact && <span className=\"ml-1\">Annotate</span>}\n </Button>\n )\n}\n\n/** Clip mode: drag over a page to show that part of it in the presentation. */\nexport function ClipButton({ active, onClick, compact }: ToggleProps): ReactElement {\n return (\n <Button\n type=\"button\"\n variant={active ? 'default' : 'outline'}\n size={compact ? 'icon' : 'sm'}\n aria-pressed={active}\n title=\"Clip: drag over a page to show that part in a presentation\"\n aria-label=\"Clip\"\n data-testid=\"clip-toggle\"\n className={TOUCH}\n onClick={onClick}\n >\n <Scissors className=\"size-4\" />\n {!compact && <span className=\"ml-1\">Clip</span>}\n </Button>\n )\n}\n\n/** The markup is the default view of a marked-up PDF; this shows the untouched file. */\nexport function ShowOriginalButton({ active, onClick, compact }: ToggleProps): ReactElement {\n return (\n <Button\n type=\"button\"\n variant={active ? 'default' : 'outline'}\n size={compact ? 'icon' : 'sm'}\n aria-pressed={active}\n title={active ? 'Show the markup again' : 'Show the original, without markup'}\n aria-label=\"Show original\"\n data-testid=\"markup-show-original\"\n className={TOUCH}\n onClick={onClick}\n >\n <FileText className=\"size-4\" />\n {!compact && <span className=\"ml-1\">Show original</span>}\n </Button>\n )\n}\n\n/**\n * \"Download with markup\": the PDF with its annotations, which Acrobat and Preview show. With a\n * `disabledReason` (a signed, locked version) it is off and says why.\n */\nexport function DownloadMarkupButton({\n onClick,\n disabledReason,\n}: {\n onClick: () => void\n disabledReason?: string\n}): ReactElement {\n const button = (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n title={\n disabledReason ??\n 'Download with markup: the PDF with its annotations (opens in Acrobat or Preview)'\n }\n aria-label=\"Download with markup\"\n aria-description={disabledReason}\n disabled={!!disabledReason}\n data-testid=\"markup-download\"\n className={TOUCH}\n onClick={onClick}\n >\n <Download className=\"size-4\" />\n </Button>\n )\n // A disabled button gets no pointer events, so the reason sits on a wrapper too.\n return disabledReason ? (\n <span title={disabledReason} className=\"inline-flex\" data-testid=\"markup-download-locked\">\n {button}\n </span>\n ) : (\n button\n )\n}\n\n/** One line where a signed version's content can be edited: an edit is a new, unsigned version. */\nexport function SignedEditNote(): ReactElement {\n return (\n <p\n className=\"border-b px-3 py-1.5 text-xs text-muted-foreground\"\n data-testid=\"signed-edit-note\"\n >\n Editing creates a new unsigned version\n </p>\n )\n}\n","/**\n * The one-line notices above the PDF about its markup: annotations found in this browser from\n * before markup was saved on the server (for a shared document: add them to the shared markup, or\n * discard), and markup that sits on an older version (open it, or copy its open comments here).\n */\n\nimport type { LegacyPrompt, OlderMarkupNote } from '@arbidocs/react/document-tools'\n\nconst BAR = 'flex flex-wrap items-center justify-between gap-2 border-b px-3 py-2 text-xs'\nconst LINK =\n 'font-medium text-primary hover:underline disabled:opacity-50 disabled:no-underline pointer-coarse:min-h-11'\n\nexport interface MarkupNoticesProps {\n legacyPrompt: LegacyPrompt | null\n olderNote: OlderMarkupNote | null\n onOpenVersion: (version: number) => void\n}\n\nexport function MarkupNotices({ legacyPrompt, olderNote, onOpenVersion }: MarkupNoticesProps) {\n return (\n <>\n {legacyPrompt && (\n <div className={BAR} role=\"status\" data-testid=\"markup-migration-prompt\">\n <span>\n {legacyPrompt.count} annotation{legacyPrompt.count === 1 ? '' : 's'} on this document\n {legacyPrompt.count === 1 ? ' is' : ' are'} saved only in this browser. Add{' '}\n {legacyPrompt.count === 1 ? 'it' : 'them'} to the shared markup, where everyone with\n access sees {legacyPrompt.count === 1 ? 'it' : 'them'}?\n </span>\n <span className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n className={LINK}\n disabled={legacyPrompt.busy}\n data-testid=\"markup-migration-add\"\n onClick={legacyPrompt.add}\n >\n {legacyPrompt.busy ? 'Adding…' : 'Add to shared markup'}\n </button>\n <button\n type=\"button\"\n className={LINK}\n disabled={legacyPrompt.busy}\n data-testid=\"markup-migration-discard\"\n onClick={legacyPrompt.discard}\n >\n Discard\n </button>\n </span>\n </div>\n )}\n {olderNote && (\n <div className={BAR} data-testid=\"markup-older-version-note\">\n <span>\n The markup is on version {olderNote.version}. This version started without it.\n {olderNote.signed && (\n <span data-testid=\"markup-older-version-signed\">\n {' '}\n It is signed: comments copied here are kept beside it, and the signed PDF does not\n change.\n </span>\n )}\n </span>\n <span className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n className={LINK}\n data-testid=\"markup-open-older-version\"\n onClick={() => onOpenVersion(olderNote.version)}\n >\n Open version {olderNote.version}\n </button>\n <button\n type=\"button\"\n className={LINK}\n disabled={olderNote.busy}\n data-testid=\"markup-copy-open-threads\"\n title=\"Copy the unresolved comment threads onto this version (redactions never carry over)\"\n onClick={olderNote.copy}\n >\n {olderNote.busy ? 'Copying…' : 'Copy open comments here'}\n </button>\n </span>\n </div>\n )}\n </>\n )\n}\n","/**\n * Which view of a marked-up PDF is on screen, spelled out beside the title, with the switch to the\n * other one. The narrow header's \"Show original\" is an unlabelled page icon, so on its own it read\n * as no control at all, and nothing said whether the page showed the markup or the original.\n */\n\nimport type { ReactElement } from 'react'\nimport { ViewerStatusNote } from '../files/ViewerLayout'\n\nexport interface MarkupViewNoteProps {\n showOriginal: boolean\n onToggle: () => void\n}\n\nexport function MarkupViewNote({ showOriginal, onToggle }: MarkupViewNoteProps): ReactElement {\n return (\n <ViewerStatusNote testId=\"markup-view-note\">\n {showOriginal ? 'Original, without markup' : 'With markup'}\n {' · '}\n <button\n type=\"button\"\n className=\"font-medium text-primary hover:underline pointer-coarse:min-h-11\"\n data-testid=\"markup-view-note-toggle\"\n onClick={onToggle}\n >\n {showOriginal ? 'Show markup' : 'Show original'}\n </button>\n </ViewerStatusNote>\n )\n}\n","/**\n * The bar above an older version opened read-only: which version it is, \"Ask about this version\"\n * (when the host has an assistant) and the way back to the current version. Put it in the viewer's\n * sticky header, not the content area: a PDF view scrolls its first page into view, which would\n * scroll a bar above it out of sight.\n */\n\nimport type { ReactElement } from 'react'\n\nconst LINK = 'font-medium text-primary hover:underline pointer-coarse:min-h-11'\n\nexport interface VersionSnapshotBarLabels {\n /** `Version 2 · read only`; `number` is undefined when the version is not known. */\n title: (number: number | undefined) => string\n ask: string\n returnToCurrent: string\n /** For documents edited live (Word, artifacts), where \"current\" is the live document. */\n returnToLive: string\n}\n\nexport const DEFAULT_VERSION_SNAPSHOT_BAR_LABELS: VersionSnapshotBarLabels = {\n title: (number) => `${number ? `Version ${number}` : 'Saved version'} · read only`,\n ask: 'Ask about this version',\n returnToCurrent: 'Return to current version',\n returnToLive: 'Return to live document',\n}\n\nexport interface VersionSnapshotBarProps {\n /** The version's number, when known. */\n versionNumber?: number\n /** The document is edited live: the way back says \"live document\". */\n live?: boolean\n /** Ask the assistant about this version. Omitted: no ask action. */\n onAsk?: () => void\n onReturn: () => void\n labels?: Partial<VersionSnapshotBarLabels>\n}\n\nexport function VersionSnapshotBar({\n versionNumber,\n live = false,\n onAsk,\n onReturn,\n labels: overrides,\n}: VersionSnapshotBarProps): ReactElement {\n const labels = { ...DEFAULT_VERSION_SNAPSHOT_BAR_LABELS, ...overrides }\n return (\n <div\n className=\"flex items-center justify-between border-b px-3 py-2 text-xs\"\n data-testid=\"version-snapshot-bar\"\n >\n <span>{labels.title(versionNumber)}</span>\n <span className=\"flex items-center gap-3\">\n {onAsk && (\n <button type=\"button\" className={LINK} data-testid=\"version-snapshot-ask\" onClick={onAsk}>\n {labels.ask}\n </button>\n )}\n <button\n type=\"button\"\n className={LINK}\n data-testid=\"version-snapshot-return\"\n onClick={onReturn}\n >\n {live ? labels.returnToLive : labels.returnToCurrent}\n </button>\n </span>\n </div>\n )\n}\n","/**\n * \"Place my signature\" / \"Place my initials\" in the viewer's signing menu: place one's own saved\n * signature or initials on the page as a picture stamp in the markup layer (then drag and resize it\n * like any stamp). Nothing saved yet: the adopt dialog opens first and saves it. Renders menu\n * items, so it goes inside a `DropdownMenuContent`. Needs a `<DocumentToolsProvider>` inside a\n * React Query `QueryClientProvider`.\n */\n\nimport { useState, type ReactElement } from 'react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useDocumentTools,\n type SavedSignature,\n} from '@arbidocs/react/document-tools'\nimport { DropdownMenuItem } from '@arbidocs/react/ui'\nimport { AdoptSignatureDialog } from './AdoptSignatureDialog'\n\nexport type PlacedMark = { image: string; label: string }\n\ntype Mark = 'signature' | 'initials'\n\nconst picked = (saved: SavedSignature, mark: Mark): PlacedMark =>\n mark === 'signature'\n ? { image: saved.signature_png, label: 'Signature' }\n : { image: saved.initials_png, label: 'Initials' }\n\nexport function PlaceMySignatureMenuItems({\n onPlace,\n}: {\n /** Arm the stamp tool with this picture: the next click on a page places it. */\n onPlace: (mark: PlacedMark) => void\n}): ReactElement {\n const { client, user, notify } = useDocumentTools()\n const [adoptFor, setAdoptFor] = useState<Mark | null>(null)\n\n // Read when asked for (sealed with one's own key: opened here, in the browser).\n const place = async (mark: Mark) => {\n try {\n const saved = await fetchSavedSignature(client)\n if (saved) return onPlace(picked(saved, mark))\n setAdoptFor(mark)\n } catch (err) {\n notify(err instanceof Error ? err.message : 'Your saved signature could not be read', 'error')\n }\n }\n\n return (\n <>\n <DropdownMenuItem onSelect={() => void place('signature')} data-testid=\"place-my-signature\">\n Place my signature\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={() => void place('initials')} data-testid=\"place-my-initials\">\n Place my initials\n </DropdownMenuItem>\n <AdoptSignatureDialog\n open={!!adoptFor}\n onOpenChange={(open) => !open && setAdoptFor(null)}\n mode=\"save\"\n defaultName={user?.name ?? ''}\n onSave={async (signature) => {\n await storeSavedSignature(client, signature)\n const mark = adoptFor\n setAdoptFor(null)\n if (mark) onPlace(picked(signature, mark))\n }}\n onAdopt={() => {}}\n />\n </>\n )\n}\n","/**\n * Where a document's signature requests stand, above the document: a request waiting for the\n * viewer's signature (with \"Review and sign\"), one the viewer sent and is waiting on others (who\n * has signed; void it), and the viewer's own draft (go on editing it). Nothing when there is none.\n * Needs a `<DocumentToolsProvider>` whose `user` has an `externalId`.\n */\n\nimport type { ReactElement } from 'react'\nimport { FilePenLine, PenLine, Send } from 'lucide-react'\nimport {\n SIGNER_PROGRESS_LABELS,\n useDocumentSignatureRequests,\n useDocumentTools,\n useInviteSigners,\n useSignerCandidates,\n useVoidSignatureRequest,\n type SignatureRequest,\n} from '@arbidocs/react/document-tools'\nimport { Button } from '@arbidocs/react/ui'\n\nexport interface SignatureRequestBannerProps {\n documentId: string\n /** Open the guided signing of a request waiting for the viewer. */\n onSign: (request: SignatureRequest) => void\n /** Go on editing the viewer's draft. */\n onEditDraft: (request: SignatureRequest) => void\n /** Hide it (e.g. while the editor or the guided signing is open). */\n hidden?: boolean\n}\n\n/** Who is still to sign, and how far each has got (\"Dana Day (invited)\"). */\nfunction waitingFor(request: SignatureRequest): string[] {\n return request.signers\n .filter((s) => s.status === 'pending')\n .map((s) => `${s.name || s.email || ''} (${SIGNER_PROGRESS_LABELS[s.progress].toLowerCase()})`)\n}\n\nexport function SignatureRequestBanner({\n documentId,\n onSign,\n onEditDraft,\n hidden = false,\n}: SignatureRequestBannerProps): ReactElement | null {\n const { user, notify } = useDocumentTools()\n const requests = useDocumentSignatureRequests(documentId, !hidden)\n const voidRequest = useVoidSignatureRequest()\n const invite = useInviteSigners()\n const me = user?.externalId ?? null\n const candidates = useSignerCandidates(!hidden && !!me)\n const isOwner = candidates.data?.some((c) => c.externalId === me && c.role === 'owner') ?? false\n if (hidden || !me || !requests.data) return null\n const open = requests.data.filter((r) => r.status === 'sent' || r.status === 'draft')\n const awaitingMe = open.filter(\n (r) =>\n r.status === 'sent' && r.signers.some((s) => s.user_ext_id === me && s.status === 'pending')\n )\n const sentByMe = open.filter(\n (r) => r.status === 'sent' && r.created_by === me && !awaitingMe.includes(r)\n )\n const drafts = open.filter((r) => r.status === 'draft' && r.created_by === me)\n if (awaitingMe.length + sentByMe.length + drafts.length === 0) return null\n\n const doVoid = async (request: SignatureRequest) => {\n try {\n await voidRequest.mutateAsync(request.external_id)\n notify(request.status === 'draft' ? 'Draft discarded.' : 'Signature request voided.', 'info')\n } catch (err) {\n notify(err instanceof Error ? err.message : 'Could not void it', 'error')\n }\n }\n\n return (\n <div\n className=\"space-y-1.5 border-b border-border px-3 py-2 text-sm\"\n data-testid=\"signature-request-banner\"\n >\n {awaitingMe.map((r) => {\n const count = r.fields.filter((f) => f.signer === me).length\n const author = r.signers.find((s) => s.user_ext_id === r.created_by)?.name\n return (\n <div\n key={r.external_id}\n className=\"flex flex-wrap items-center gap-2 rounded-md bg-blue-50 px-2 py-1.5 text-blue-950 dark:bg-blue-950/40 dark:text-blue-100\"\n data-testid=\"signature-request-awaiting-me\"\n >\n <PenLine className=\"size-4 shrink-0\" aria-hidden />\n <span className=\"mr-auto\">\n {author && r.created_by !== me\n ? `${author} asked you to sign`\n : 'You are asked to sign'}{' '}\n {count} field{count === 1 ? '' : 's'} in this document.\n {r.stale && ' It has changed since it was sent: ask for it again.'}\n </span>\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={() => onSign(r)}\n disabled={r.stale}\n data-testid=\"signature-request-start\"\n >\n Review and sign\n </Button>\n </div>\n )\n })}\n {sentByMe.map((r) => {\n const pending = waitingFor(r)\n const signed = r.signers.length - pending.length\n const invited = r.signers.filter((s) => s.progress === 'invited' && s.email)\n return (\n <div\n key={r.external_id}\n className=\"flex flex-wrap items-center gap-2\"\n data-testid=\"signature-request-sent\"\n >\n <Send className=\"size-4 shrink-0 text-muted-foreground\" aria-hidden />\n <span className=\"mr-auto\">\n Out for signature: {signed} of {r.signers.length} signed\n {pending.length > 0 && (\n <span className=\"text-muted-foreground\"> · waiting for {pending.join(', ')}</span>\n )}\n {r.stale && (\n <span className=\"text-red-text\"> · the document has changed since it was sent</span>\n )}\n </span>\n {isOwner && invited.length > 0 && (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={invite.isPending}\n onClick={async () => {\n try {\n await invite.mutateAsync({\n documentId,\n emails: invited.map((s) => s.email!),\n })\n notify(\n 'Invited again: anyone already registered is added now and asked to sign.',\n 'success'\n )\n } catch (err) {\n notify(err instanceof Error ? err.message : 'Could not invite', 'error')\n }\n }}\n data-testid=\"signature-request-reinvite\"\n >\n Invite again\n </Button>\n )}\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => doVoid(r)}\n disabled={voidRequest.isPending}\n >\n Void\n </Button>\n </div>\n )\n })}\n {drafts.map((r) => (\n <div\n key={r.external_id}\n className=\"flex flex-wrap items-center gap-2\"\n data-testid=\"signature-request-draft\"\n >\n <FilePenLine className=\"size-4 shrink-0 text-muted-foreground\" aria-hidden />\n <span className=\"mr-auto\">\n Draft signature request: {r.fields.length} field{r.fields.length === 1 ? '' : 's'}, not\n sent yet.\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"outline\" onClick={() => onEditDraft(r)}>\n Continue\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => doVoid(r)}\n disabled={voidRequest.isPending}\n >\n Discard\n </Button>\n </div>\n ))}\n </div>\n )\n}\n","import { useState } from 'react'\nimport { createFileShare, useDocumentTools } from '@arbidocs/react/document-tools'\nimport { Button, Label, Textarea } from '@arbidocs/react/ui'\nimport { ModalScaffold } from '../settings/ModalScaffold'\n\nexport function FileShareDialog({\n open,\n onOpenChange,\n documentId,\n version,\n}: {\n open: boolean\n onOpenChange: (open: boolean) => void\n documentId: string\n version: number\n}) {\n const { client, prepareFileShare } = useDocumentTools()\n const [emails, setEmails] = useState('')\n const [message, setMessage] = useState('')\n const [busy, setBusy] = useState(false)\n const [error, setError] = useState('')\n return (\n <ModalScaffold\n open={open}\n onOpenChange={(next) => !busy && onOpenChange(next)}\n title={`Share file · version ${version}`}\n description=\"Recipients can view and download only this version. They get no workspace access or other versions.\"\n showDescription\n testId=\"file-share-dialog\"\n >\n <form\n onSubmit={async (event) => {\n event.preventDefault()\n setBusy(true)\n setError('')\n try {\n const recipients = [\n ...new Set(\n emails\n .split(/[,;\\n]+/)\n .map((e) => e.trim().toLowerCase())\n .filter(Boolean)\n ),\n ]\n if (!recipients.length) throw new Error('Add at least one recipient email')\n await prepareFileShare(documentId)\n const share = await createFileShare(client, documentId, {\n version,\n recipients: recipients.map((email) => ({ email, permission: 'view' })),\n message,\n })\n window.location.assign(`/shared-files/${share.external_id}`)\n } catch (e) {\n setError(e instanceof Error ? e.message : 'Could not share the file')\n } finally {\n setBusy(false)\n }\n }}\n >\n <ModalScaffold.Body>\n <Label htmlFor=\"file-share-emails\">Recipient emails</Label>\n <Textarea\n id=\"file-share-emails\"\n data-testid=\"file-share-emails\"\n value={emails}\n onChange={(e) => setEmails(e.target.value)}\n placeholder=\"One email per line, or separated by commas\"\n required\n />\n <Label htmlFor=\"file-share-message\">Message (optional)</Label>\n <Textarea\n id=\"file-share-message\"\n value={message}\n onChange={(e) => setMessage(e.target.value)}\n maxLength={2000}\n />\n <p className=\"text-sm text-muted-foreground\">\n Each recipient receives an email with an account-specific link. External users on a Box\n receive up to 24 hours of access.\n </p>\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error}\n </p>\n )}\n </ModalScaffold.Body>\n <ModalScaffold.Footer>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={busy}\n onClick={() => onOpenChange(false)}\n >\n Cancel\n </Button>\n <Button type=\"submit\" disabled={busy} data-testid=\"file-share-send\">\n {busy ? 'Sharing…' : 'Share this version'}\n </Button>\n </ModalScaffold.Footer>\n </form>\n </ModalScaffold>\n )\n}\n"]}
|