@arbidocs/blocks 0.5.122 → 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.
Files changed (124) hide show
  1. package/dist/{ClippingMediaViewer-IEIBT74X.cjs → ClippingMediaViewer-ZFEX5A3U.cjs} +11 -10
  2. package/dist/ClippingMediaViewer-ZFEX5A3U.cjs.map +1 -0
  3. package/dist/{ClippingPdfViewer-OGYLMVCE.cjs → ClippingPdfViewer-3LRTEPHV.cjs} +45 -11
  4. package/dist/ClippingPdfViewer-3LRTEPHV.cjs.map +1 -0
  5. package/dist/{ConnectedPresentation-AU25OW25.cjs → ConnectedPresentation-OV2KBOLK.cjs} +27 -153
  6. package/dist/ConnectedPresentation-OV2KBOLK.cjs.map +1 -0
  7. package/dist/{ConnectedSlidesTab-I75LKKN7.cjs → ConnectedSlidesTab-LUAGZ6FD.cjs} +60 -36
  8. package/dist/ConnectedSlidesTab-LUAGZ6FD.cjs.map +1 -0
  9. package/dist/{FilesViewerDialog-4352KIOG.cjs → FilesViewerDialog-JWKNJLWG.cjs} +10 -7
  10. package/dist/FilesViewerDialog-JWKNJLWG.cjs.map +1 -0
  11. package/dist/SpotlightStrip-ED22UYTM.cjs +398 -0
  12. package/dist/SpotlightStrip-ED22UYTM.cjs.map +1 -0
  13. package/dist/{chunk-LHWOKOMP.cjs → chunk-3IH55CDE.cjs} +4 -4
  14. package/dist/chunk-3IH55CDE.cjs.map +1 -0
  15. package/dist/chunk-3ZZZO4F7.cjs +145 -0
  16. package/dist/chunk-3ZZZO4F7.cjs.map +1 -0
  17. package/dist/{chunk-WFMWKPGY.cjs → chunk-ADPRIBSH.cjs} +9 -33
  18. package/dist/chunk-ADPRIBSH.cjs.map +1 -0
  19. package/dist/{chunk-UTJ223TI.cjs → chunk-BX6G2ZCI.cjs} +138 -146
  20. package/dist/chunk-BX6G2ZCI.cjs.map +1 -0
  21. package/dist/{chunk-WRLGLZIA.cjs → chunk-EMRY62HS.cjs} +2 -2
  22. package/dist/{chunk-WRLGLZIA.cjs.map → chunk-EMRY62HS.cjs.map} +1 -1
  23. package/dist/{chunk-USNTRL22.cjs → chunk-H236SNEV.cjs} +199 -1616
  24. package/dist/chunk-H236SNEV.cjs.map +1 -0
  25. package/dist/chunk-JITYC4OS.cjs +66 -0
  26. package/dist/chunk-JITYC4OS.cjs.map +1 -0
  27. package/dist/chunk-JY7UUZQG.cjs +1513 -0
  28. package/dist/chunk-JY7UUZQG.cjs.map +1 -0
  29. package/dist/chunk-MVXHTAJ4.cjs +111 -0
  30. package/dist/chunk-MVXHTAJ4.cjs.map +1 -0
  31. package/dist/{chunk-4TTX6ZNS.cjs → chunk-ORNLCBNE.cjs} +24 -2
  32. package/dist/chunk-ORNLCBNE.cjs.map +1 -0
  33. package/dist/chunk-WVZLAAIZ.cjs +31 -0
  34. package/dist/chunk-WVZLAAIZ.cjs.map +1 -0
  35. package/dist/chunk-ZZZITHGK.cjs +119 -0
  36. package/dist/chunk-ZZZITHGK.cjs.map +1 -0
  37. package/dist/connect/index.cjs +52 -52
  38. package/dist/connect/viewer.cjs +8 -5
  39. package/dist/connection/presentation/ClippingMediaViewer.js +3 -3
  40. package/dist/connection/presentation/ClippingMediaViewer.js.map +2 -2
  41. package/dist/connection/presentation/ClippingPdfViewer.d.ts +4 -3
  42. package/dist/connection/presentation/ClippingPdfViewer.js +48 -9
  43. package/dist/connection/presentation/ClippingPdfViewer.js.map +2 -2
  44. package/dist/connection/presentation/ConnectedSlidesTab.js +35 -13
  45. package/dist/connection/presentation/ConnectedSlidesTab.js.map +2 -2
  46. package/dist/connection/presentation/SpotlightLayer.d.ts +5 -0
  47. package/dist/connection/presentation/SpotlightLayer.js +19 -0
  48. package/dist/connection/presentation/SpotlightLayer.js.map +7 -0
  49. package/dist/connection/presentation/SpotlightStrip.d.ts +10 -0
  50. package/dist/connection/presentation/SpotlightStrip.js +237 -0
  51. package/dist/connection/presentation/SpotlightStrip.js.map +7 -0
  52. package/dist/connection/presentation/useViewerClipping.d.ts +4 -3
  53. package/dist/connection/presentation/useViewerClipping.js +8 -4
  54. package/dist/connection/presentation/useViewerClipping.js.map +2 -2
  55. package/dist/connection/viewer/ConnectedDocumentViewer.js +52 -61
  56. package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
  57. package/dist/connection/viewer/ViewerMoreMenu.d.ts +18 -0
  58. package/dist/connection/viewer/ViewerMoreMenu.js +45 -0
  59. package/dist/connection/viewer/ViewerMoreMenu.js.map +7 -0
  60. package/dist/connection/viewer/pdf/PdfPassageHighlights.js +3 -2
  61. package/dist/connection/viewer/pdf/PdfPassageHighlights.js.map +2 -2
  62. package/dist/connection/viewer/pdf/passageHighlights.d.ts +5 -0
  63. package/dist/connection/viewer/pdf/passageHighlights.js +14 -1
  64. package/dist/connection/viewer/pdf/passageHighlights.js.map +2 -2
  65. package/dist/connection/viewer/useCleanView.d.ts +3 -1
  66. package/dist/connection/viewer/useCleanView.js +6 -3
  67. package/dist/connection/viewer/useCleanView.js.map +2 -2
  68. package/dist/document-tools/DocumentToolButtons.js +3 -3
  69. package/dist/document-tools/DocumentToolButtons.js.map +2 -2
  70. package/dist/document-tools/index.cjs +13 -13
  71. package/dist/index.cjs +53 -53
  72. package/dist/presentation/BoxActionBar.d.ts +2 -2
  73. package/dist/presentation/BoxActionBar.js +62 -30
  74. package/dist/presentation/BoxActionBar.js.map +2 -2
  75. package/dist/presentation/ClipActionBar.js +60 -7
  76. package/dist/presentation/ClipActionBar.js.map +2 -2
  77. package/dist/presentation/ClipCaptureOverlay.d.ts +7 -3
  78. package/dist/presentation/ClipCaptureOverlay.js +43 -14
  79. package/dist/presentation/ClipCaptureOverlay.js.map +2 -2
  80. package/dist/presentation/ClipViewControls.d.ts +3 -3
  81. package/dist/presentation/ClipViewControls.js +59 -64
  82. package/dist/presentation/ClipViewControls.js.map +2 -2
  83. package/dist/presentation/PresentControls.d.ts +8 -0
  84. package/dist/presentation/PresentControls.js +1 -0
  85. package/dist/presentation/PresentControls.js.map +2 -2
  86. package/dist/presentation/PresentationStage.d.ts +10 -2
  87. package/dist/presentation/PresentationStage.js +6 -3
  88. package/dist/presentation/PresentationStage.js.map +2 -2
  89. package/dist/presentation/PresenterView.js +1 -22
  90. package/dist/presentation/PresenterView.js.map +2 -2
  91. package/dist/presentation/SlidesEditor.js +56 -42
  92. package/dist/presentation/SlidesEditor.js.map +2 -2
  93. package/dist/presentation/SpotlightView.d.ts +19 -0
  94. package/dist/presentation/SpotlightView.js +180 -0
  95. package/dist/presentation/SpotlightView.js.map +7 -0
  96. package/dist/presentation/StageItem.js +0 -5
  97. package/dist/presentation/StageItem.js.map +2 -2
  98. package/dist/presentation/passage-clip.d.ts +17 -0
  99. package/dist/presentation/passage-clip.js +25 -0
  100. package/dist/presentation/passage-clip.js.map +7 -0
  101. package/dist/presentation/spotlight.d.ts +58 -0
  102. package/dist/presentation/spotlight.js +110 -0
  103. package/dist/presentation/spotlight.js.map +7 -0
  104. package/dist/presentation/store.d.ts +5 -0
  105. package/dist/presentation/store.js +19 -0
  106. package/dist/presentation/store.js.map +2 -2
  107. package/dist/presentation/usePointerActive.d.ts +2 -0
  108. package/dist/presentation/usePointerActive.js +28 -0
  109. package/dist/presentation/usePointerActive.js.map +7 -0
  110. package/dist/styles.css +1 -1
  111. package/node_modules/@arbidocs/coedit/package.json +1 -1
  112. package/package.json +5 -5
  113. package/dist/ClippingMediaViewer-IEIBT74X.cjs.map +0 -1
  114. package/dist/ClippingPdfViewer-OGYLMVCE.cjs.map +0 -1
  115. package/dist/ConnectedPresentation-AU25OW25.cjs.map +0 -1
  116. package/dist/ConnectedSlidesTab-I75LKKN7.cjs.map +0 -1
  117. package/dist/FilesViewerDialog-4352KIOG.cjs.map +0 -1
  118. package/dist/chunk-4TTX6ZNS.cjs.map +0 -1
  119. package/dist/chunk-LHWOKOMP.cjs.map +0 -1
  120. package/dist/chunk-USNTRL22.cjs.map +0 -1
  121. package/dist/chunk-UTJ223TI.cjs.map +0 -1
  122. package/dist/chunk-WFMWKPGY.cjs.map +0 -1
  123. package/dist/chunk-XK4TVJKD.cjs +0 -73
  124. package/dist/chunk-XK4TVJKD.cjs.map +0 -1
@@ -1,8 +1,11 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkWFMWKPGY_cjs = require('./chunk-WFMWKPGY.cjs');
5
- var chunk4TTX6ZNS_cjs = require('./chunk-4TTX6ZNS.cjs');
4
+ var chunkJITYC4OS_cjs = require('./chunk-JITYC4OS.cjs');
5
+ var chunkWVZLAAIZ_cjs = require('./chunk-WVZLAAIZ.cjs');
6
+ var chunkMVXHTAJ4_cjs = require('./chunk-MVXHTAJ4.cjs');
7
+ var chunkADPRIBSH_cjs = require('./chunk-ADPRIBSH.cjs');
8
+ var chunkORNLCBNE_cjs = require('./chunk-ORNLCBNE.cjs');
6
9
  var chunk4CIVQWAX_cjs = require('./chunk-4CIVQWAX.cjs');
7
10
  var chunkPL7HUTM3_cjs = require('./chunk-PL7HUTM3.cjs');
8
11
  var chunkGFUOCGY6_cjs = require('./chunk-GFUOCGY6.cjs');
@@ -11,7 +14,7 @@ var chunkKXIRVKCJ_cjs = require('./chunk-KXIRVKCJ.cjs');
11
14
  var chunk5QERK4PK_cjs = require('./chunk-5QERK4PK.cjs');
12
15
  var chunkALK3PUUB_cjs = require('./chunk-ALK3PUUB.cjs');
13
16
  var chunk7557LDAN_cjs = require('./chunk-7557LDAN.cjs');
14
- var chunkLHWOKOMP_cjs = require('./chunk-LHWOKOMP.cjs');
17
+ var chunk3IH55CDE_cjs = require('./chunk-3IH55CDE.cjs');
15
18
  var chunkGNZAH6UI_cjs = require('./chunk-GNZAH6UI.cjs');
16
19
  var chunkJH6JTI76_cjs = require('./chunk-JH6JTI76.cjs');
17
20
  var chunkDTMBAFIL_cjs = require('./chunk-DTMBAFIL.cjs');
@@ -213,14 +216,14 @@ function ViewerRelatedDocuments({ document: document2 }) {
213
216
  }
214
217
  function PresentationPill({ compact }) {
215
218
  const session = react.useArbiSessionStore();
216
- const boundTo = chunk4TTX6ZNS_cjs.usePresentation((s) => s.boundTo);
217
- const clips = chunk4TTX6ZNS_cjs.usePresentation((s) => s.clips.length);
218
- const title = chunk4TTX6ZNS_cjs.usePresentation((s) => s.title);
219
+ const boundTo = chunkORNLCBNE_cjs.usePresentation((s) => s.boundTo);
220
+ const clips = chunkORNLCBNE_cjs.usePresentation((s) => s.clips.length);
221
+ const title = chunkORNLCBNE_cjs.usePresentation((s) => s.title);
219
222
  const onIt = react.useArbiSessionState(
220
223
  (s) => s.viewingDocument?.id === boundTo && s.documentViewer.tab === "slides"
221
224
  );
222
225
  if (onIt || boundTo === null && clips === 0) return null;
223
- const back = () => chunkWFMWKPGY_cjs.showPresentation(session, boundTo);
226
+ const back = () => chunkWVZLAAIZ_cjs.showPresentation(session, boundTo);
224
227
  return /* @__PURE__ */ jsxRuntime.jsxs(
225
228
  ui.Button,
226
229
  {
@@ -239,14 +242,26 @@ function PresentationPill({ compact }) {
239
242
  }
240
243
  );
241
244
  }
245
+ var SpotlightStrip = React.lazy(
246
+ () => import('./SpotlightStrip-ED22UYTM.cjs').then((m) => ({ default: m.SpotlightStrip }))
247
+ );
248
+ function SpotlightLayer() {
249
+ const { userId } = chunkJR2YSBD5_cjs.useConnectedWorkspace();
250
+ const gathered = chunkMVXHTAJ4_cjs.useSpotlight((s) => s.clips.length > 0);
251
+ React.useEffect(() => chunkMVXHTAJ4_cjs.useSpotlight.getState().own(userId ?? null), [userId]);
252
+ if (!gathered) return null;
253
+ return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(SpotlightStrip, {}) });
254
+ }
242
255
  function useViewerClipping(clippable, compact) {
243
- const [on, setOn] = React.useState(false);
244
- const stop = React.useCallback(() => setOn(false), []);
256
+ const on = chunkMVXHTAJ4_cjs.useSpotlight((s) => s.clipping);
257
+ const setOn = chunkMVXHTAJ4_cjs.useSpotlight((s) => s.setClipping);
258
+ const stop = React.useCallback(() => setOn(false), [setOn]);
245
259
  const button = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
246
260
  /* @__PURE__ */ jsxRuntime.jsx(PresentationPill, { compact }),
247
- clippable && /* @__PURE__ */ jsxRuntime.jsx(chunkLHWOKOMP_cjs.ClipButton, { active: on, compact, onClick: () => setOn(!on) })
261
+ clippable && /* @__PURE__ */ jsxRuntime.jsx(chunk3IH55CDE_cjs.ClipButton, { active: on, compact, onClick: () => setOn(!on) })
248
262
  ] });
249
- return { clipping: on && clippable, stop, button };
263
+ const layer = /* @__PURE__ */ jsxRuntime.jsx(SpotlightLayer, {});
264
+ return { clipping: on && clippable, stop, button, layer };
250
265
  }
251
266
  var IDLE_MS = 2e3;
252
267
  function CleanViewControl({ onExit }) {
@@ -288,7 +303,7 @@ function CleanViewControl({ onExit }) {
288
303
  size: "sm",
289
304
  variant: "ghost",
290
305
  className: "h-7",
291
- onClick: () => view && chunkWFMWKPGY_cjs.toggleFullscreen(view),
306
+ onClick: () => view && chunkADPRIBSH_cjs.toggleFullscreen(view),
292
307
  children: [
293
308
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize, { className: "size-3.5" }),
294
309
  "Full screen"
@@ -314,7 +329,7 @@ function CleanViewControl({ onExit }) {
314
329
  }
315
330
  );
316
331
  }
317
- function useCleanView() {
332
+ function useCleanView(extra) {
318
333
  const session = react.useArbiSessionStore();
319
334
  const detached = react.useArbiSessionState((s) => s.documentViewer.detached);
320
335
  const presenting = react.useArbiSessionState((s) => s.documentViewer.presenting);
@@ -330,7 +345,10 @@ function useCleanView() {
330
345
  on,
331
346
  frame: {
332
347
  bare: on,
333
- overlay: on ? /* @__PURE__ */ jsxRuntime.jsx(CleanViewControl, { onExit: () => session.setDocumentViewer({ presenting: false }) }) : null
348
+ overlay: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
349
+ on && /* @__PURE__ */ jsxRuntime.jsx(CleanViewControl, { onExit: () => session.setDocumentViewer({ presenting: false }) }),
350
+ extra
351
+ ] })
334
352
  }
335
353
  };
336
354
  }
@@ -443,6 +461,37 @@ function ViewerCropModal({ crop }) {
443
461
  }
444
462
  );
445
463
  }
464
+ function ViewerMoreMenu({ items, compact }) {
465
+ if (!items.length) return null;
466
+ return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
467
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
468
+ ui.Button,
469
+ {
470
+ type: "button",
471
+ variant: "outline",
472
+ size: "icon",
473
+ className: compact ? "pointer-coarse:size-11" : "size-8 pointer-coarse:size-11",
474
+ title: "More: share the file, email, translate",
475
+ "aria-label": "More",
476
+ "data-testid": "viewer-more-menu",
477
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "size-4" })
478
+ }
479
+ ) }),
480
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuContent, { align: "end", children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
481
+ ui.DropdownMenuItem,
482
+ {
483
+ onSelect: item.onSelect,
484
+ title: item.description,
485
+ "data-testid": item.testId,
486
+ children: [
487
+ item.icon,
488
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2", children: item.label })
489
+ ]
490
+ },
491
+ item.key
492
+ )) })
493
+ ] });
494
+ }
446
495
  var DOCX_EXTENSIONS = /* @__PURE__ */ new Set([".docx", ".doc"]);
447
496
  var XLSX_EXTENSIONS = /* @__PURE__ */ new Set([".xlsx", ".xls"]);
448
497
  var EMAIL_EXTENSIONS = /* @__PURE__ */ new Set([".eml", ".msg"]);
@@ -1996,17 +2045,17 @@ function clipOutlinesByPage(viewingId, clips, slides) {
1996
2045
  }
1997
2046
  function usePdfClipOutlines(viewingId) {
1998
2047
  const session = react.useArbiSessionStore();
1999
- const clips = chunk4TTX6ZNS_cjs.usePresentation((s) => s.clips);
2000
- const slides = chunk4TTX6ZNS_cjs.usePresentation((s) => s.slides);
2048
+ const clips = chunkORNLCBNE_cjs.usePresentation((s) => s.clips);
2049
+ const slides = chunkORNLCBNE_cjs.usePresentation((s) => s.slides);
2001
2050
  const byPage = React.useMemo(
2002
2051
  () => clipOutlinesByPage(viewingId, clips, slides),
2003
2052
  [viewingId, clips, slides]
2004
2053
  );
2005
2054
  const show = React.useCallback(
2006
2055
  (outline) => {
2007
- const state = chunk4TTX6ZNS_cjs.usePresentation.getState();
2056
+ const state = chunkORNLCBNE_cjs.usePresentation.getState();
2008
2057
  if (outline.slides.length) state.goTo(outline.slides[0]);
2009
- chunkWFMWKPGY_cjs.showPresentation(session, state.boundTo);
2058
+ chunkWVZLAAIZ_cjs.showPresentation(session, state.boundTo);
2010
2059
  },
2011
2060
  [session]
2012
2061
  );
@@ -2033,9 +2082,10 @@ function PdfPassageHighlights({
2033
2082
  "data-chunk-id": chunkId,
2034
2083
  "data-highlight": highlight,
2035
2084
  className: ui.cn(
2036
- // multiplied, so the page's text stays as dark as it was under the wash
2085
+ // multiplied, so the page's text stays as dark as it was under the wash. The passage
2086
+ // opened (a citation clicked) is marked plainly: a faint wash on a page is easy to miss.
2037
2087
  "absolute rounded-sm mix-blend-multiply",
2038
- highlight === "strong" ? "bg-ai-soft ring-1 ring-ai-accent/50" : "bg-ai-soft/60"
2088
+ highlight === "strong" || chunkId === activeId ? "bg-ai-soft ring-2 ring-ai-accent/70" : "bg-ai-soft/60"
2039
2089
  ),
2040
2090
  style: {
2041
2091
  left: `${x0 * 100}%`,
@@ -2047,52 +2097,6 @@ function PdfPassageHighlights({
2047
2097
  chunkId
2048
2098
  )) });
2049
2099
  }
2050
-
2051
- // src/connection/viewer/pdf/passageHighlights.ts
2052
- function passageHighlight(chunkId, { cited, active }) {
2053
- if (cited.size > 0) {
2054
- if (!cited.has(chunkId)) return null;
2055
- return chunkId === active ? "strong" : "light";
2056
- }
2057
- return chunkId === active ? "light" : null;
2058
- }
2059
- function asBox(bbox) {
2060
- if (!bbox || bbox.length !== 4 || !bbox.every(Number.isFinite)) return null;
2061
- const [x0, y0, x1, y1] = bbox;
2062
- if (x1 <= x0 || y1 <= y0) return null;
2063
- return [x0, y0, x1, y1];
2064
- }
2065
- function isWholePage([x0, y0, x1, y1]) {
2066
- return x0 <= 0 && y0 <= 0 && x1 >= 1 && y1 >= 1;
2067
- }
2068
- function passagePlaced(pages, chunkId) {
2069
- for (const page of pages) {
2070
- const chunk = page.chunks.find((entry) => entry.chunkExtId === chunkId);
2071
- if (chunk) {
2072
- const box = asBox(chunk.pageBbox);
2073
- return !!box && !isWholePage(box);
2074
- }
2075
- }
2076
- return false;
2077
- }
2078
- function passageBoxesByPage(pages, state) {
2079
- const byPage = /* @__PURE__ */ new Map();
2080
- if (state.cited.size === 0 && !state.active) return byPage;
2081
- for (const page of pages) {
2082
- if (page.pageNumber === null) continue;
2083
- for (const chunk of page.chunks) {
2084
- const chunkId = chunk.chunkExtId;
2085
- if (!chunkId) continue;
2086
- const highlight = passageHighlight(chunkId, state);
2087
- const box = highlight && asBox(chunk.pageBbox);
2088
- if (!highlight || !box || isWholePage(box)) continue;
2089
- const boxes = byPage.get(page.pageNumber) ?? [];
2090
- boxes.push({ chunkId, box, highlight });
2091
- byPage.set(page.pageNumber, boxes);
2092
- }
2093
- }
2094
- return byPage;
2095
- }
2096
2100
  var NONE2 = [];
2097
2101
  var NO_FOOTNOTES = {};
2098
2102
  function usePdfPassageHighlights(documentId) {
@@ -2104,7 +2108,7 @@ function usePdfPassageHighlights(documentId) {
2104
2108
  });
2105
2109
  const { processedChunks } = viewers.useProcessedChunks(parsed?.chunks, NO_FOOTNOTES);
2106
2110
  const boxesByPage = React.useMemo(
2107
- () => passageBoxesByPage(processedChunks, { cited, active }),
2111
+ () => chunkJITYC4OS_cjs.passageBoxesByPage(processedChunks, { cited, active }),
2108
2112
  [processedChunks, cited, active]
2109
2113
  );
2110
2114
  const session = react.useArbiSessionStore();
@@ -2112,7 +2116,7 @@ function usePdfPassageHighlights(documentId) {
2112
2116
  React.useEffect(() => {
2113
2117
  if (!active || !parsed || !documentId) return;
2114
2118
  const key = `${documentId}:${active}`;
2115
- if (fellBackFor.current === key || passagePlaced(processedChunks, active)) return;
2119
+ if (fellBackFor.current === key || chunkJITYC4OS_cjs.passagePlaced(processedChunks, active)) return;
2116
2120
  fellBackFor.current = key;
2117
2121
  session.setDocumentViewer({ tab: "html" });
2118
2122
  }, [active, parsed, processedChunks, documentId, session]);
@@ -2143,13 +2147,13 @@ function PresentationFileCard({ documentId, fileName }) {
2143
2147
  chunkZW6FPIFC_cjs.EmptyState,
2144
2148
  {
2145
2149
  icon: lucideReact.Presentation,
2146
- title: chunk4TTX6ZNS_cjs.presentationTitle(fileName),
2150
+ title: chunkORNLCBNE_cjs.presentationTitle(fileName),
2147
2151
  description: "A presentation saved in an earlier format, without its slides. Open it and save it to keep it as a presentation PDF; this file can then be deleted.",
2148
2152
  action: /* @__PURE__ */ jsxRuntime.jsxs(
2149
2153
  ui.Button,
2150
2154
  {
2151
2155
  type: "button",
2152
- onClick: () => chunkWFMWKPGY_cjs.editPresentation(session, { kind: "open", documentId }),
2156
+ onClick: () => chunkWVZLAAIZ_cjs.editPresentation(session, { kind: "open", documentId }),
2153
2157
  "data-testid": "presentation-file-edit",
2154
2158
  children: [
2155
2159
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "size-4" }),
@@ -2170,10 +2174,10 @@ var SignatureRequestEditor = React.lazy(
2170
2174
  () => import('./document-tools/viewer/index.cjs').then((m) => ({ default: m.SignatureRequestEditor }))
2171
2175
  );
2172
2176
  var ClippingPdfViewer = React.lazy(
2173
- () => import('./ClippingPdfViewer-OGYLMVCE.cjs').then((m) => ({ default: m.ClippingPdfViewer }))
2177
+ () => import('./ClippingPdfViewer-3LRTEPHV.cjs').then((m) => ({ default: m.ClippingPdfViewer }))
2174
2178
  );
2175
2179
  var ClippingMediaViewer = React.lazy(
2176
- () => import('./ClippingMediaViewer-IEIBT74X.cjs').then((m) => ({ default: m.ClippingMediaViewer }))
2180
+ () => import('./ClippingMediaViewer-ZFEX5A3U.cjs').then((m) => ({ default: m.ClippingMediaViewer }))
2177
2181
  );
2178
2182
  var GuidedSigningViewer = React.lazy(
2179
2183
  () => import('./document-tools/viewer/index.cjs').then((m) => ({ default: m.GuidedSigningViewer }))
@@ -2367,7 +2371,7 @@ function ViewerPdfPane({
2367
2371
  return /* @__PURE__ */ jsxRuntime.jsx(SessionPdfViewer, { ...viewerProps, file: pdfBlob });
2368
2372
  }
2369
2373
  var SlidesTab = React.lazy(
2370
- () => import('./ConnectedSlidesTab-I75LKKN7.cjs').then((m) => ({ default: m.ConnectedSlidesTab }))
2374
+ () => import('./ConnectedSlidesTab-LUAGZ6FD.cjs').then((m) => ({ default: m.ConnectedSlidesTab }))
2371
2375
  );
2372
2376
  var StreamedWordArtifact = React.lazy(
2373
2377
  () => import('./ConnectedStreamedWordArtifact-AG62232A.cjs').then((m) => ({
@@ -2638,7 +2642,7 @@ function DocumentViewerContent({
2638
2642
  ),
2639
2643
  isCompact && !isDraft && documentData?.shared && /* @__PURE__ */ jsxRuntime.jsx(ui.SharingEntity, { shared: true, variant: "icon", "data-testid": "document-shared-status" }),
2640
2644
  isCompact && activeTab === "pdf" && pdfBlob && markup.hasMarkup && !annotating && !placingSignature && /* @__PURE__ */ jsxRuntime.jsx(
2641
- chunkLHWOKOMP_cjs.MarkupViewNote,
2645
+ chunk3IH55CDE_cjs.MarkupViewNote,
2642
2646
  {
2643
2647
  showOriginal: markup.showOriginal,
2644
2648
  onToggle: () => markup.setShowOriginal((on) => !on)
@@ -2695,9 +2699,9 @@ function DocumentViewerContent({
2695
2699
  isComparing
2696
2700
  });
2697
2701
  const clip = useViewerClipping(annotatable || !!pdfBlob && (isImage || isVideo), isCompact);
2698
- const clean = useCleanView();
2702
+ const clean = useCleanView(clip.layer);
2699
2703
  const signatureBanner = !isDraft && !liveKind && !snapshotDocumentId && /* @__PURE__ */ jsxRuntime.jsx(
2700
- chunkLHWOKOMP_cjs.SignatureRequestBanner,
2704
+ chunk3IH55CDE_cjs.SignatureRequestBanner,
2701
2705
  {
2702
2706
  documentId,
2703
2707
  hidden: !!signatureFlow,
@@ -2728,7 +2732,7 @@ function DocumentViewerContent({
2728
2732
  const shownRef = snapshotDocumentId || documentId;
2729
2733
  const rightContent = /* @__PURE__ */ jsxRuntime.jsxs(chunkDTMBAFIL_cjs.ViewerHeaderEnd, { isCompact, children: [
2730
2734
  annotatable && /* @__PURE__ */ jsxRuntime.jsx(
2731
- chunkLHWOKOMP_cjs.AnnotateButton,
2735
+ chunk3IH55CDE_cjs.AnnotateButton,
2732
2736
  {
2733
2737
  active: annotating,
2734
2738
  compact: isCompact,
@@ -2742,7 +2746,7 @@ function DocumentViewerContent({
2742
2746
  ),
2743
2747
  clip.button,
2744
2748
  activeTab === "pdf" && pdfBlob && !placingSignature && (markup.hasMarkup || annotating) && /* @__PURE__ */ jsxRuntime.jsx(
2745
- chunkLHWOKOMP_cjs.ShowOriginalButton,
2749
+ chunk3IH55CDE_cjs.ShowOriginalButton,
2746
2750
  {
2747
2751
  active: markup.showOriginal,
2748
2752
  compact: isCompact,
@@ -2753,7 +2757,7 @@ function DocumentViewerContent({
2753
2757
  }
2754
2758
  ),
2755
2759
  activeTab === "pdf" && markup.hasMarkup && !annotating && /* @__PURE__ */ jsxRuntime.jsx(
2756
- chunkLHWOKOMP_cjs.DownloadMarkupButton,
2760
+ chunk3IH55CDE_cjs.DownloadMarkupButton,
2757
2761
  {
2758
2762
  onClick: () => void markup.downloadMarkup(),
2759
2763
  disabledReason: isSigned ? documentTools.SIGNED_LOCKED_REASON : void 0
@@ -2785,28 +2789,15 @@ function DocumentViewerContent({
2785
2789
  ]
2786
2790
  }
2787
2791
  ),
2788
- documentId && documentData && !isDraft && !isStreaming && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2789
- /* @__PURE__ */ jsxRuntime.jsx(
2790
- ui.Button,
2791
- {
2792
- type: "button",
2793
- variant: "outline",
2794
- size: "sm",
2795
- onClick: () => setSharingFile(true),
2796
- "data-testid": "share-file-button",
2797
- children: "Share file"
2798
- }
2799
- ),
2800
- /* @__PURE__ */ jsxRuntime.jsx(
2801
- chunkLHWOKOMP_cjs.FileShareDialog,
2802
- {
2803
- open: sharingFile,
2804
- onOpenChange: setSharingFile,
2805
- documentId,
2806
- version: pdfSnapshotNumber ?? documentData.current_version ?? 1
2807
- }
2808
- )
2809
- ] }),
2792
+ documentId && documentData && !isDraft && !isStreaming && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
2793
+ chunk3IH55CDE_cjs.FileShareDialog,
2794
+ {
2795
+ open: sharingFile,
2796
+ onOpenChange: setSharingFile,
2797
+ documentId,
2798
+ version: pdfSnapshotNumber ?? documentData.current_version ?? 1
2799
+ }
2800
+ ) }),
2810
2801
  doc.savedDocumentId && !snapshotDocumentId && /* @__PURE__ */ jsxRuntime.jsxs(
2811
2802
  ui.Button,
2812
2803
  {
@@ -2844,43 +2835,6 @@ function DocumentViewerContent({
2844
2835
  stateTestId: "document-title-shared-indicator"
2845
2836
  }
2846
2837
  ),
2847
- tools.emailDocument && !isDraft && !isStreaming && documentData?.file_name && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2848
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mx-1 h-5 w-px bg-border", "aria-hidden": "true" }),
2849
- /* @__PURE__ */ jsxRuntime.jsxs(
2850
- ui.Button,
2851
- {
2852
- type: "button",
2853
- variant: "outline",
2854
- size: isCompact ? "icon" : "sm",
2855
- title: "Email this document",
2856
- "aria-label": "Email",
2857
- "data-testid": "email-document-button",
2858
- className: "pointer-coarse:min-h-11",
2859
- onClick: () => tools.emailDocument?.(shownRef),
2860
- children: [
2861
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "size-4" }),
2862
- !isCompact && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1", children: "Email" })
2863
- ]
2864
- }
2865
- )
2866
- ] }),
2867
- support.translate && !isDraft && !isStreaming && !liveKind && !isImage && documentData?.file_name && /* @__PURE__ */ jsxRuntime.jsxs(
2868
- ui.Button,
2869
- {
2870
- type: "button",
2871
- variant: "outline",
2872
- size: isCompact ? "icon" : "sm",
2873
- title: "Translate into another language: a new editable document, original and translation side by side",
2874
- "aria-label": "Translate",
2875
- "data-testid": "translate-document-button",
2876
- className: "pointer-coarse:min-h-11",
2877
- onClick: () => support.translate(shownRef),
2878
- children: [
2879
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Languages, { className: "size-4" }),
2880
- !isCompact && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1", children: "Translate" })
2881
- ]
2882
- }
2883
- ),
2884
2838
  !isStreaming && !snapshotDocumentId && /* @__PURE__ */ jsxRuntime.jsx(FinaliseTranslationButton, { document: documentData ?? void 0, isCompact }),
2885
2839
  annotatable && /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
2886
2840
  /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2894,7 +2848,7 @@ function DocumentViewerContent({
2894
2848
  "data-testid": "signing-menu-trigger",
2895
2849
  className: "pointer-coarse:min-h-11",
2896
2850
  children: [
2897
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PenLine, { className: "size-4" }),
2851
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Signature, { className: "size-4" }),
2898
2852
  !isCompact && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1", children: "Sign" }),
2899
2853
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "ml-1 size-3" })
2900
2854
  ]
@@ -2923,7 +2877,7 @@ function DocumentViewerContent({
2923
2877
  ),
2924
2878
  !isSigned && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2925
2879
  /* @__PURE__ */ jsxRuntime.jsx(
2926
- chunkLHWOKOMP_cjs.PlaceMySignatureMenuItems,
2880
+ chunk3IH55CDE_cjs.PlaceMySignatureMenuItems,
2927
2881
  {
2928
2882
  onPlace: (mark) => {
2929
2883
  setPlacingSignature(false);
@@ -2963,6 +2917,44 @@ function DocumentViewerContent({
2963
2917
  appearance: signAppearance
2964
2918
  }
2965
2919
  ),
2920
+ /* @__PURE__ */ jsxRuntime.jsx(
2921
+ ViewerMoreMenu,
2922
+ {
2923
+ compact: isCompact,
2924
+ items: [
2925
+ ...documentId && documentData && !isDraft && !isStreaming ? [
2926
+ {
2927
+ key: "share-file",
2928
+ label: "Share file\u2026",
2929
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link2, { className: "size-4" }),
2930
+ description: "Send a link to this version of the file",
2931
+ onSelect: () => setSharingFile(true),
2932
+ testId: "share-file-button"
2933
+ }
2934
+ ] : [],
2935
+ ...tools.emailDocument && !isDraft && !isStreaming && documentData?.file_name ? [
2936
+ {
2937
+ key: "email",
2938
+ label: "Email\u2026",
2939
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "size-4" }),
2940
+ description: "Email this document (attached)",
2941
+ onSelect: () => tools.emailDocument?.(shownRef),
2942
+ testId: "email-document-button"
2943
+ }
2944
+ ] : [],
2945
+ ...support.translate && !isDraft && !isStreaming && !liveKind && !isImage && documentData?.file_name ? [
2946
+ {
2947
+ key: "translate",
2948
+ label: "Translate\u2026",
2949
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Languages, { className: "size-4" }),
2950
+ description: "A new editable document, original and translation side by side",
2951
+ onSelect: () => support.translate(shownRef),
2952
+ testId: "translate-document-button"
2953
+ }
2954
+ ] : []
2955
+ ]
2956
+ }
2957
+ ),
2966
2958
  headerActions
2967
2959
  ] });
2968
2960
  const viewerProps = {
@@ -2991,7 +2983,7 @@ function DocumentViewerContent({
2991
2983
  ),
2992
2984
  isCompact && !isCoEditing && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "viewer-title-row", className: "flex min-w-0 items-center gap-2 px-3 pb-2", children: titleBlock }),
2993
2985
  snapshotDocumentId && /* @__PURE__ */ jsxRuntime.jsx(
2994
- chunkLHWOKOMP_cjs.VersionSnapshotBar,
2986
+ chunk3IH55CDE_cjs.VersionSnapshotBar,
2995
2987
  {
2996
2988
  versionNumber: snapshotNumber,
2997
2989
  live: isDocx || isArtifact,
@@ -3022,7 +3014,7 @@ function DocumentViewerContent({
3022
3014
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => void blobs.retryPdf(), className: "underline", children: "Retry loading the current PDF" })
3023
3015
  ] }),
3024
3016
  !clean.on && activeTab === "pdf" && !isMedia && !isImage && /* @__PURE__ */ jsxRuntime.jsx(
3025
- chunkLHWOKOMP_cjs.MarkupNotices,
3017
+ chunk3IH55CDE_cjs.MarkupNotices,
3026
3018
  {
3027
3019
  legacyPrompt: markup.legacyPrompt,
3028
3020
  olderNote: markup.olderNote,
@@ -3070,7 +3062,7 @@ function DocumentViewerContent({
3070
3062
  ),
3071
3063
  activeTab === "edit" && isArtifact && liveKind && /* @__PURE__ */ jsxRuntime.jsx(chunkEG7EJFUE_cjs.ArtifactCodeView, { source: liveSource, fileName: documentData?.file_name ?? void 0 }),
3072
3064
  activeTab === "edit" && isArtifact && !liveKind && !isStreaming && !isComparing && /* @__PURE__ */ jsxRuntime.jsxs(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkALK3PUUB_cjs.ViewerMessage, { children: "Loading editor\u2026" }), children: [
3073
- isSigned && !snapshotDocumentId && /* @__PURE__ */ jsxRuntime.jsx(chunkLHWOKOMP_cjs.SignedEditNote, {}),
3065
+ isSigned && !snapshotDocumentId && /* @__PURE__ */ jsxRuntime.jsx(chunk3IH55CDE_cjs.SignedEditNote, {}),
3074
3066
  /* @__PURE__ */ jsxRuntime.jsx(
3075
3067
  chunk7557LDAN_cjs.ConnectedNativeDocxEditor,
3076
3068
  {
@@ -3125,7 +3117,7 @@ function DocumentViewerContent({
3125
3117
  ) }),
3126
3118
  activeTab === "docx" && isDocx && !isComparing && /* @__PURE__ */ jsxRuntime.jsxs(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkALK3PUUB_cjs.ViewerMessage, { children: "Loading editor\u2026" }), children: [
3127
3119
  signatureBanner,
3128
- isSigned && !snapshotDocumentId && /* @__PURE__ */ jsxRuntime.jsx(chunkLHWOKOMP_cjs.SignedEditNote, {}),
3120
+ isSigned && !snapshotDocumentId && /* @__PURE__ */ jsxRuntime.jsx(chunk3IH55CDE_cjs.SignedEditNote, {}),
3129
3121
  /* @__PURE__ */ jsxRuntime.jsx(
3130
3122
  chunk7557LDAN_cjs.ConnectedNativeDocxEditor,
3131
3123
  {
@@ -3163,5 +3155,5 @@ function DocumentViewerContent({
3163
3155
  }
3164
3156
 
3165
3157
  exports.ConnectedDocumentViewer = ConnectedDocumentViewer;
3166
- //# sourceMappingURL=chunk-UTJ223TI.cjs.map
3167
- //# sourceMappingURL=chunk-UTJ223TI.cjs.map
3158
+ //# sourceMappingURL=chunk-BX6G2ZCI.cjs.map
3159
+ //# sourceMappingURL=chunk-BX6G2ZCI.cjs.map