@arbidocs/blocks 0.5.121 → 0.5.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ClippingMediaViewer-B6WG7Q64.cjs → ClippingMediaViewer-IEIBT74X.cjs} +8 -8
- package/dist/{ClippingMediaViewer-B6WG7Q64.cjs.map → ClippingMediaViewer-IEIBT74X.cjs.map} +1 -1
- package/dist/{ClippingPdfViewer-6GCVTV3V.cjs → ClippingPdfViewer-OGYLMVCE.cjs} +5 -5
- package/dist/{ClippingPdfViewer-6GCVTV3V.cjs.map → ClippingPdfViewer-OGYLMVCE.cjs.map} +1 -1
- package/dist/{ConnectedCallDock-DC5V5OUJ.cjs → ConnectedCallDock-XJOYVVAH.cjs} +21 -21
- package/dist/{ConnectedCallDock-DC5V5OUJ.cjs.map → ConnectedCallDock-XJOYVVAH.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-FQLXWTFB.cjs → ConnectedCallRoom-CUDYAPQK.cjs} +14 -14
- package/dist/{ConnectedCallRoom-FQLXWTFB.cjs.map → ConnectedCallRoom-CUDYAPQK.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-4Q5S7VLD.cjs → ConnectedNativeDocxComparison-QKHCYD6W.cjs} +15 -15
- package/dist/{ConnectedNativeDocxComparison-4Q5S7VLD.cjs.map → ConnectedNativeDocxComparison-QKHCYD6W.cjs.map} +1 -1
- package/dist/ConnectedPresentation-5DOJ35XL.cjs +321 -0
- package/dist/ConnectedPresentation-5DOJ35XL.cjs.map +1 -0
- package/dist/{ConnectedProductionSetDialog-4EAY6KAZ.cjs → ConnectedProductionSetDialog-LHB4VQWC.cjs} +3 -3
- package/dist/{ConnectedProductionSetDialog-4EAY6KAZ.cjs.map → ConnectedProductionSetDialog-LHB4VQWC.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-7QDE2CZD.cjs → ConnectedSlidesTab-7YMEDGUU.cjs} +73 -49
- package/dist/ConnectedSlidesTab-7YMEDGUU.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-FFOQJBOI.cjs → ConnectedStreamedWordArtifact-AG62232A.cjs} +15 -15
- package/dist/{ConnectedStreamedWordArtifact-FFOQJBOI.cjs.map → ConnectedStreamedWordArtifact-AG62232A.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-SNWVEZ7S.cjs → DocumentReviewCard-M53XFLI2.cjs} +15 -15
- package/dist/{DocumentReviewCard-SNWVEZ7S.cjs.map → DocumentReviewCard-M53XFLI2.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-IZI63FOV.cjs → FilesViewerDialog-2QCCRWF2.cjs} +50 -49
- package/dist/FilesViewerDialog-2QCCRWF2.cjs.map +1 -0
- package/dist/{WorkspaceTableView-TEIRB6VJ.cjs → WorkspaceTableView-3XYAV4BV.cjs} +8 -8
- package/dist/{WorkspaceTableView-TEIRB6VJ.cjs.map → WorkspaceTableView-3XYAV4BV.cjs.map} +1 -1
- package/dist/agents/index.cjs +296 -296
- package/dist/{ai-KBYNRNZ6.cjs → ai-IEIR7SC2.cjs} +25 -25
- package/dist/ai-IEIR7SC2.cjs.map +1 -0
- package/dist/calls/index.cjs +121 -121
- package/dist/chat/index.cjs +1 -1
- package/dist/{chunk-NLOETJCB.cjs → chunk-2F57IO7S.cjs} +12 -12
- package/dist/{chunk-NLOETJCB.cjs.map → chunk-2F57IO7S.cjs.map} +1 -1
- package/dist/chunk-2RLA6QO2.cjs +174 -0
- package/dist/chunk-2RLA6QO2.cjs.map +1 -0
- package/dist/{chunk-Q6DQGGP4.cjs → chunk-325GVZE6.cjs} +3 -3
- package/dist/{chunk-Q6DQGGP4.cjs.map → chunk-325GVZE6.cjs.map} +1 -1
- package/dist/{chunk-LHWOKOMP.cjs → chunk-46P7IDBX.cjs} +3 -3
- package/dist/chunk-46P7IDBX.cjs.map +1 -0
- package/dist/{chunk-XTR26TNE.cjs → chunk-4TTX6ZNS.cjs} +20 -4
- package/dist/chunk-4TTX6ZNS.cjs.map +1 -0
- package/dist/{chunk-BVAT4EVC.cjs → chunk-5QERK4PK.cjs} +35 -35
- package/dist/{chunk-BVAT4EVC.cjs.map → chunk-5QERK4PK.cjs.map} +1 -1
- package/dist/{chunk-GX2EBMJW.cjs → chunk-6OK7ESTL.cjs} +7 -6
- package/dist/chunk-6OK7ESTL.cjs.map +1 -0
- package/dist/{chunk-C2OICDMI.cjs → chunk-7557LDAN.cjs} +10 -10
- package/dist/{chunk-C2OICDMI.cjs.map → chunk-7557LDAN.cjs.map} +1 -1
- package/dist/{chunk-474GPLCM.cjs → chunk-7L4X6QN2.cjs} +6 -6
- package/dist/{chunk-474GPLCM.cjs.map → chunk-7L4X6QN2.cjs.map} +1 -1
- package/dist/{chunk-52KGMAO5.cjs → chunk-7NLO7ASW.cjs} +15 -15
- package/dist/{chunk-52KGMAO5.cjs.map → chunk-7NLO7ASW.cjs.map} +1 -1
- package/dist/{chunk-H5OLHP2U.cjs → chunk-7OPOPYV6.cjs} +3 -3
- package/dist/{chunk-H5OLHP2U.cjs.map → chunk-7OPOPYV6.cjs.map} +1 -1
- package/dist/{chunk-W6B3RYTX.cjs → chunk-7PN3YENO.cjs} +4 -4
- package/dist/{chunk-W6B3RYTX.cjs.map → chunk-7PN3YENO.cjs.map} +1 -1
- package/dist/{chunk-734NPQNR.cjs → chunk-ADDQKZ5I.cjs} +4 -4
- package/dist/{chunk-734NPQNR.cjs.map → chunk-ADDQKZ5I.cjs.map} +1 -1
- package/dist/{chunk-JQLWKNJO.cjs → chunk-ALK3PUUB.cjs} +4 -4
- package/dist/{chunk-JQLWKNJO.cjs.map → chunk-ALK3PUUB.cjs.map} +1 -1
- package/dist/{chunk-4VZZWYEC.cjs → chunk-BQ5RIWWT.cjs} +3 -3
- package/dist/{chunk-4VZZWYEC.cjs.map → chunk-BQ5RIWWT.cjs.map} +1 -1
- package/dist/{chunk-Q3XJUXID.cjs → chunk-DWMWEALB.cjs} +499 -409
- package/dist/chunk-DWMWEALB.cjs.map +1 -0
- package/dist/{chunk-3SCNXNHI.cjs → chunk-E3L5DB5F.cjs} +5 -5
- package/dist/{chunk-3SCNXNHI.cjs.map → chunk-E3L5DB5F.cjs.map} +1 -1
- package/dist/{chunk-VJ5ZLRBD.cjs → chunk-GFUOCGY6.cjs} +8 -3
- package/dist/chunk-GFUOCGY6.cjs.map +1 -0
- package/dist/{chunk-7VUJGHMY.cjs → chunk-JD2HX2BR.cjs} +272 -156
- package/dist/chunk-JD2HX2BR.cjs.map +1 -0
- package/dist/{chunk-RYVZDFVO.cjs → chunk-JJZOL5MG.cjs} +3 -3
- package/dist/{chunk-RYVZDFVO.cjs.map → chunk-JJZOL5MG.cjs.map} +1 -1
- package/dist/{chunk-QFXILJMJ.cjs → chunk-K4763GD5.cjs} +17 -174
- package/dist/chunk-K4763GD5.cjs.map +1 -0
- package/dist/{chunk-EHP6OH5D.cjs → chunk-KA3F6TIH.cjs} +11 -11
- package/dist/{chunk-EHP6OH5D.cjs.map → chunk-KA3F6TIH.cjs.map} +1 -1
- package/dist/{chunk-UUENH4BJ.cjs → chunk-KXIRVKCJ.cjs} +3 -3
- package/dist/{chunk-UUENH4BJ.cjs.map → chunk-KXIRVKCJ.cjs.map} +1 -1
- package/dist/{chunk-AY6EZSZB.cjs → chunk-L4CIFLCU.cjs} +4 -4
- package/dist/{chunk-AY6EZSZB.cjs.map → chunk-L4CIFLCU.cjs.map} +1 -1
- package/dist/{chunk-4RBQ44RY.cjs → chunk-MLA2BJ2Y.cjs} +28 -28
- package/dist/{chunk-4RBQ44RY.cjs.map → chunk-MLA2BJ2Y.cjs.map} +1 -1
- package/dist/{chunk-DR2AH7JL.cjs → chunk-NG2EE7HR.cjs} +48 -48
- package/dist/{chunk-DR2AH7JL.cjs.map → chunk-NG2EE7HR.cjs.map} +1 -1
- package/dist/{chunk-ENGL7P3I.cjs → chunk-NQML7IUC.cjs} +26 -26
- package/dist/{chunk-ENGL7P3I.cjs.map → chunk-NQML7IUC.cjs.map} +1 -1
- package/dist/{chunk-4NPCDS2X.cjs → chunk-NY3YUCOW.cjs} +3 -3
- package/dist/{chunk-4NPCDS2X.cjs.map → chunk-NY3YUCOW.cjs.map} +1 -1
- package/dist/{chunk-JZEYHDWJ.cjs → chunk-OHHKBURG.cjs} +76 -76
- package/dist/chunk-OHHKBURG.cjs.map +1 -0
- package/dist/{chunk-5534FYXP.cjs → chunk-SDRYSLOX.cjs} +4 -4
- package/dist/{chunk-5534FYXP.cjs.map → chunk-SDRYSLOX.cjs.map} +1 -1
- package/dist/{chunk-2W5E62EY.cjs → chunk-SGYSDABK.cjs} +6 -6
- package/dist/{chunk-2W5E62EY.cjs.map → chunk-SGYSDABK.cjs.map} +1 -1
- package/dist/{chunk-KP5AITQ4.cjs → chunk-SNPK3R3O.cjs} +7 -7
- package/dist/{chunk-KP5AITQ4.cjs.map → chunk-SNPK3R3O.cjs.map} +1 -1
- package/dist/{chunk-EATIFPKP.cjs → chunk-T73BHNQX.cjs} +4 -4
- package/dist/{chunk-EATIFPKP.cjs.map → chunk-T73BHNQX.cjs.map} +1 -1
- package/dist/{chunk-4IOYQLKG.cjs → chunk-TP5PGWIO.cjs} +3 -3
- package/dist/{chunk-4IOYQLKG.cjs.map → chunk-TP5PGWIO.cjs.map} +1 -1
- package/dist/{chunk-GKVE5JGB.cjs → chunk-UFT22LAB.cjs} +3 -3
- package/dist/{chunk-GKVE5JGB.cjs.map → chunk-UFT22LAB.cjs.map} +1 -1
- package/dist/{chunk-FKFQCK3C.cjs → chunk-V6MW7B4B.cjs} +4 -4
- package/dist/{chunk-FKFQCK3C.cjs.map → chunk-V6MW7B4B.cjs.map} +1 -1
- package/dist/{chunk-2PZT3J34.cjs → chunk-VWBYE3XY.cjs} +6 -6
- package/dist/{chunk-2PZT3J34.cjs.map → chunk-VWBYE3XY.cjs.map} +1 -1
- package/dist/{chunk-GQXPNIRE.cjs → chunk-WAV762GP.cjs} +6 -6
- package/dist/{chunk-GQXPNIRE.cjs.map → chunk-WAV762GP.cjs.map} +1 -1
- package/dist/{chunk-5LTIZ44D.cjs → chunk-WFMWKPGY.cjs} +14 -7
- package/dist/chunk-WFMWKPGY.cjs.map +1 -0
- package/dist/{chunk-GPX5VC57.cjs → chunk-WV7BCGCK.cjs} +50 -50
- package/dist/{chunk-GPX5VC57.cjs.map → chunk-WV7BCGCK.cjs.map} +1 -1
- package/dist/{chunk-MZ2KZXNU.cjs → chunk-WXUU3COI.cjs} +3 -3
- package/dist/{chunk-MZ2KZXNU.cjs.map → chunk-WXUU3COI.cjs.map} +1 -1
- package/dist/{chunk-NAJN32MF.cjs → chunk-XF355M7O.cjs} +13 -13
- package/dist/{chunk-NAJN32MF.cjs.map → chunk-XF355M7O.cjs.map} +1 -1
- package/dist/connect/docx.cjs +18 -18
- package/dist/connect/index.cjs +995 -994
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +38 -37
- package/dist/connection/conversation/ConnectedMessage.js +1 -1
- package/dist/connection/conversation/ConnectedMessage.js.map +2 -2
- package/dist/connection/presentation/ConnectedSlidesTab.js +39 -15
- package/dist/connection/presentation/ConnectedSlidesTab.js.map +2 -2
- package/dist/connection/presentation/PresentationPill.js +3 -8
- package/dist/connection/presentation/PresentationPill.js.map +2 -2
- package/dist/connection/presentation/requests.d.ts +5 -0
- package/dist/connection/presentation/requests.js +8 -1
- package/dist/connection/presentation/requests.js.map +2 -2
- package/dist/connection/viewer/ConnectedDocumentViewer.js +51 -60
- package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
- package/dist/connection/viewer/ViewerMoreMenu.d.ts +18 -0
- package/dist/connection/viewer/ViewerMoreMenu.js +45 -0
- package/dist/connection/viewer/ViewerMoreMenu.js.map +7 -0
- package/dist/connection/viewer/ViewerPdfPane.js +4 -1
- package/dist/connection/viewer/ViewerPdfPane.js.map +2 -2
- package/dist/connection/viewer/documentPlace.d.ts +5 -4
- package/dist/connection/viewer/documentPlace.js +2 -2
- package/dist/connection/viewer/documentPlace.js.map +2 -2
- package/dist/connection/viewer/pdf/PdfClipOutlines.d.ts +11 -0
- package/dist/connection/viewer/pdf/PdfClipOutlines.js +42 -0
- package/dist/connection/viewer/pdf/PdfClipOutlines.js.map +7 -0
- package/dist/connection/viewer/pdf/PdfPassageHighlights.js +3 -2
- package/dist/connection/viewer/pdf/PdfPassageHighlights.js.map +2 -2
- package/dist/connection/viewer/pdf/clipOutlines.d.ts +17 -0
- package/dist/connection/viewer/pdf/clipOutlines.js +24 -0
- package/dist/connection/viewer/pdf/clipOutlines.js.map +7 -0
- package/dist/connection/viewer/pdf/passageHighlights.d.ts +2 -0
- package/dist/connection/viewer/pdf/passageHighlights.js +12 -1
- package/dist/connection/viewer/pdf/passageHighlights.js.map +2 -2
- package/dist/connection/viewer/pdf/usePdfClipOutlines.d.ts +7 -0
- package/dist/connection/viewer/pdf/usePdfClipOutlines.js +36 -0
- package/dist/connection/viewer/pdf/usePdfClipOutlines.js.map +7 -0
- package/dist/connection/viewer/pdf/usePdfPassageHighlights.js +11 -2
- package/dist/connection/viewer/pdf/usePdfPassageHighlights.js.map +2 -2
- package/dist/dashboards/index.cjs +1 -1
- package/dist/document-tools/DocumentToolButtons.js +2 -2
- package/dist/document-tools/DocumentToolButtons.js.map +2 -2
- package/dist/document-tools/index.cjs +13 -13
- package/dist/embed/index.cjs +38 -38
- package/dist/files/index.cjs +224 -224
- package/dist/index.cjs +1596 -1595
- package/dist/index.cjs.map +1 -1
- package/dist/presentation/BoxActionBar.d.ts +2 -2
- package/dist/presentation/BoxActionBar.js +62 -30
- package/dist/presentation/BoxActionBar.js.map +2 -2
- package/dist/presentation/ClipActionBar.js +60 -7
- package/dist/presentation/ClipActionBar.js.map +2 -2
- package/dist/presentation/ClipViewControls.d.ts +3 -3
- package/dist/presentation/ClipViewControls.js +59 -64
- package/dist/presentation/ClipViewControls.js.map +2 -2
- package/dist/presentation/PresentControls.d.ts +11 -0
- package/dist/presentation/PresentControls.js +117 -0
- package/dist/presentation/PresentControls.js.map +7 -0
- package/dist/presentation/PresenterView.js +36 -5
- package/dist/presentation/PresenterView.js.map +2 -2
- package/dist/presentation/SlidesEditor.js +73 -43
- package/dist/presentation/SlidesEditor.js.map +2 -2
- package/dist/presentation/StageItem.js +0 -5
- package/dist/presentation/StageItem.js.map +2 -2
- package/dist/presentation/panel-id.d.ts +12 -2
- package/dist/presentation/panel-id.js +6 -1
- package/dist/presentation/panel-id.js.map +2 -2
- package/dist/presentation/slide-layout.d.ts +5 -1
- package/dist/presentation/slide-layout.js +16 -0
- package/dist/presentation/slide-layout.js.map +2 -2
- package/dist/settings/index.cjs +146 -146
- package/dist/shell/PanelPortal.js +13 -4
- package/dist/shell/PanelPortal.js.map +2 -2
- package/dist/shell/index.cjs +92 -91
- package/dist/shell/panel-windows.js +1 -0
- package/dist/shell/panel-windows.js.map +2 -2
- package/dist/studio/index.cjs +28 -28
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +52 -52
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedPresentation-4HLDZDWV.cjs +0 -183
- package/dist/ConnectedPresentation-4HLDZDWV.cjs.map +0 -1
- package/dist/ConnectedSlidesTab-7QDE2CZD.cjs.map +0 -1
- package/dist/FilesViewerDialog-IZI63FOV.cjs.map +0 -1
- package/dist/ai-KBYNRNZ6.cjs.map +0 -1
- package/dist/chunk-5LTIZ44D.cjs.map +0 -1
- package/dist/chunk-7VUJGHMY.cjs.map +0 -1
- package/dist/chunk-GX2EBMJW.cjs.map +0 -1
- package/dist/chunk-JZEYHDWJ.cjs.map +0 -1
- package/dist/chunk-LHWOKOMP.cjs.map +0 -1
- package/dist/chunk-Q3XJUXID.cjs.map +0 -1
- package/dist/chunk-QFXILJMJ.cjs.map +0 -1
- package/dist/chunk-VJ5ZLRBD.cjs.map +0 -1
- package/dist/chunk-XTR26TNE.cjs.map +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Presentation } from "lucide-react";
|
|
4
|
+
function PdfClipOutlines({ outlines, onShow }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0", "data-testid": "pdf-clip-outlines", children: outlines.map((outline) => {
|
|
6
|
+
const { rect } = outline;
|
|
7
|
+
const label = outline.slides.length ? `Slide ${outline.slides.map((index) => index + 1).join(", ")}` : "In the tray";
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: "absolute rounded-sm border-2 border-dashed border-primary/70",
|
|
12
|
+
style: {
|
|
13
|
+
left: `${rect.x * 100}%`,
|
|
14
|
+
top: `${rect.y * 100}%`,
|
|
15
|
+
width: `${rect.w * 100}%`,
|
|
16
|
+
height: `${rect.h * 100}%`
|
|
17
|
+
},
|
|
18
|
+
"data-testid": "pdf-clip-outline",
|
|
19
|
+
"data-clip-id": outline.clipId,
|
|
20
|
+
children: /* @__PURE__ */ jsxs(
|
|
21
|
+
"button",
|
|
22
|
+
{
|
|
23
|
+
type: "button",
|
|
24
|
+
className: "pointer-events-auto absolute -top-2.5 left-1 inline-flex items-center gap-1 rounded-full bg-primary px-1.5 text-[10px] font-medium leading-4 text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
25
|
+
title: outline.slides.length ? `Clipped for the presentation: go to ${label.toLowerCase()}` : "Clipped for the presentation: not on a slide yet",
|
|
26
|
+
onClick: () => onShow(outline),
|
|
27
|
+
"data-testid": "pdf-clip-outline-label",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Presentation, { className: "size-2.5" }),
|
|
30
|
+
label
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
},
|
|
35
|
+
outline.clipId
|
|
36
|
+
);
|
|
37
|
+
}) });
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
PdfClipOutlines
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=PdfClipOutlines.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/connection/viewer/pdf/PdfClipOutlines.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * The open presentation's clips of this document, outlined on its PDF pages: where each clip was\n * cut, and the slide it is on. The outline takes no pointer events (the page stays selectable);\n * its label goes to that slide in the presentation.\n */\n\nimport { Presentation } from 'lucide-react'\nimport type { PdfClipOutline } from './clipOutlines'\n\nexport interface PdfClipOutlinesProps {\n outlines: readonly PdfClipOutline[]\n onShow: (outline: PdfClipOutline) => void\n}\n\nexport function PdfClipOutlines({ outlines, onShow }: PdfClipOutlinesProps) {\n return (\n <div className=\"pointer-events-none absolute inset-0\" data-testid=\"pdf-clip-outlines\">\n {outlines.map((outline) => {\n const { rect } = outline\n const label = outline.slides.length\n ? `Slide ${outline.slides.map((index) => index + 1).join(', ')}`\n : 'In the tray'\n return (\n <div\n key={outline.clipId}\n className=\"absolute rounded-sm border-2 border-dashed border-primary/70\"\n style={{\n left: `${rect.x * 100}%`,\n top: `${rect.y * 100}%`,\n width: `${rect.w * 100}%`,\n height: `${rect.h * 100}%`,\n }}\n data-testid=\"pdf-clip-outline\"\n data-clip-id={outline.clipId}\n >\n <button\n type=\"button\"\n className=\"pointer-events-auto absolute -top-2.5 left-1 inline-flex items-center gap-1 rounded-full bg-primary px-1.5 text-[10px] font-medium leading-4 text-primary-foreground shadow-sm hover:bg-primary/90\"\n title={\n outline.slides.length\n ? `Clipped for the presentation: go to ${label.toLowerCase()}`\n : 'Clipped for the presentation: not on a slide yet'\n }\n onClick={() => onShow(outline)}\n data-testid=\"pdf-clip-outline-label\"\n >\n <Presentation className=\"size-2.5\" />\n {label}\n </button>\n </div>\n )\n })}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAmCY,SAWE,KAXF;AA7BZ,SAAS,oBAAoB;AAQtB,SAAS,gBAAgB,EAAE,UAAU,OAAO,GAAyB;AAC1E,SACE,oBAAC,SAAI,WAAU,wCAAuC,eAAY,qBAC/D,mBAAS,IAAI,CAAC,YAAY;AACzB,UAAM,EAAE,KAAK,IAAI;AACjB,UAAM,QAAQ,QAAQ,OAAO,SACzB,SAAS,QAAQ,OAAO,IAAI,CAAC,UAAU,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC,KAC5D;AACJ,WACE;AAAA,MAAC;AAAA;AAAA,QAEC,WAAU;AAAA,QACV,OAAO;AAAA,UACL,MAAM,GAAG,KAAK,IAAI,GAAG;AAAA,UACrB,KAAK,GAAG,KAAK,IAAI,GAAG;AAAA,UACpB,OAAO,GAAG,KAAK,IAAI,GAAG;AAAA,UACtB,QAAQ,GAAG,KAAK,IAAI,GAAG;AAAA,QACzB;AAAA,QACA,eAAY;AAAA,QACZ,gBAAc,QAAQ;AAAA,QAEtB;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAU;AAAA,YACV,OACE,QAAQ,OAAO,SACX,uCAAuC,MAAM,YAAY,CAAC,KAC1D;AAAA,YAEN,SAAS,MAAM,OAAO,OAAO;AAAA,YAC7B,eAAY;AAAA,YAEZ;AAAA,kCAAC,gBAAa,WAAU,YAAW;AAAA,cAClC;AAAA;AAAA;AAAA,QACH;AAAA;AAAA,MAxBK,QAAQ;AAAA,IAyBf;AAAA,EAEJ,CAAC,GACH;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -16,9 +16,10 @@ function PdfPassageHighlights({
|
|
|
16
16
|
"data-chunk-id": chunkId,
|
|
17
17
|
"data-highlight": highlight,
|
|
18
18
|
className: cn(
|
|
19
|
-
// multiplied, so the page's text stays as dark as it was under the wash
|
|
19
|
+
// multiplied, so the page's text stays as dark as it was under the wash. The passage
|
|
20
|
+
// opened (a citation clicked) is marked plainly: a faint wash on a page is easy to miss.
|
|
20
21
|
"absolute rounded-sm mix-blend-multiply",
|
|
21
|
-
highlight === "strong" ? "bg-ai-soft ring-
|
|
22
|
+
highlight === "strong" || chunkId === activeId ? "bg-ai-soft ring-2 ring-ai-accent/70" : "bg-ai-soft/60"
|
|
22
23
|
),
|
|
23
24
|
style: {
|
|
24
25
|
left: `${x0 * 100}%`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/connection/viewer/pdf/PdfPassageHighlights.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * The lit passages of one PDF page, drawn over it. The boxes are fractions of the page, so the layer\n * fills the page area and scales with it; it takes no pointer events, so the PDF stays selectable.\n */\n\nimport { cn } from '@arbidocs/react/ui'\nimport type { PdfPassageBox } from './passageHighlights'\n\nexport interface PdfPassageHighlightsProps {\n boxes: readonly PdfPassageBox[]\n /** The passage being read: its box is told to the host once it is drawn, to bring it into view. */\n activeId: string | null\n onActiveDrawn: (element: HTMLElement) => void\n}\n\nexport function PdfPassageHighlights({\n boxes,\n activeId,\n onActiveDrawn,\n}: PdfPassageHighlightsProps) {\n return (\n <div className=\"pointer-events-none absolute inset-0\" data-testid=\"pdf-passage-highlights\">\n {boxes.map(({ chunkId, box: [x0, y0, x1, y1], highlight }) => (\n <div\n key={chunkId}\n ref={\n chunkId === activeId\n ? (element) => {\n if (element) onActiveDrawn(element)\n }\n : undefined\n }\n data-testid=\"pdf-passage-highlight\"\n data-chunk-id={chunkId}\n data-highlight={highlight}\n className={cn(\n // multiplied, so the page's text stays as dark as it was under the wash\n 'absolute rounded-sm mix-blend-multiply',\n highlight === 'strong' ? 'bg-ai-soft ring-
|
|
5
|
-
"mappings": ";AAuBQ;AAlBR,SAAS,UAAU;AAUZ,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AACF,GAA8B;AAC5B,SACE,oBAAC,SAAI,WAAU,wCAAuC,eAAY,0BAC/D,gBAAM,IAAI,CAAC,EAAE,SAAS,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE,GAAG,UAAU,MACtD;AAAA,IAAC;AAAA;AAAA,MAEC,KACE,YAAY,WACR,CAAC,YAAY;AACX,YAAI,QAAS,eAAc,OAAO;AAAA,MACpC,IACA;AAAA,MAEN,eAAY;AAAA,MACZ,iBAAe;AAAA,MACf,kBAAgB;AAAA,MAChB,WAAW;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["/**\n * The lit passages of one PDF page, drawn over it. The boxes are fractions of the page, so the layer\n * fills the page area and scales with it; it takes no pointer events, so the PDF stays selectable.\n */\n\nimport { cn } from '@arbidocs/react/ui'\nimport type { PdfPassageBox } from './passageHighlights'\n\nexport interface PdfPassageHighlightsProps {\n boxes: readonly PdfPassageBox[]\n /** The passage being read: its box is told to the host once it is drawn, to bring it into view. */\n activeId: string | null\n onActiveDrawn: (element: HTMLElement) => void\n}\n\nexport function PdfPassageHighlights({\n boxes,\n activeId,\n onActiveDrawn,\n}: PdfPassageHighlightsProps) {\n return (\n <div className=\"pointer-events-none absolute inset-0\" data-testid=\"pdf-passage-highlights\">\n {boxes.map(({ chunkId, box: [x0, y0, x1, y1], highlight }) => (\n <div\n key={chunkId}\n ref={\n chunkId === activeId\n ? (element) => {\n if (element) onActiveDrawn(element)\n }\n : undefined\n }\n data-testid=\"pdf-passage-highlight\"\n data-chunk-id={chunkId}\n data-highlight={highlight}\n className={cn(\n // multiplied, so the page's text stays as dark as it was under the wash. The passage\n // opened (a citation clicked) is marked plainly: a faint wash on a page is easy to miss.\n 'absolute rounded-sm mix-blend-multiply',\n highlight === 'strong' || chunkId === activeId\n ? 'bg-ai-soft ring-2 ring-ai-accent/70'\n : 'bg-ai-soft/60'\n )}\n style={{\n left: `${x0 * 100}%`,\n top: `${y0 * 100}%`,\n width: `${(x1 - x0) * 100}%`,\n height: `${(y1 - y0) * 100}%`,\n }}\n />\n ))}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAuBQ;AAlBR,SAAS,UAAU;AAUZ,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AACF,GAA8B;AAC5B,SACE,oBAAC,SAAI,WAAU,wCAAuC,eAAY,0BAC/D,gBAAM,IAAI,CAAC,EAAE,SAAS,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE,GAAG,UAAU,MACtD;AAAA,IAAC;AAAA;AAAA,MAEC,KACE,YAAY,WACR,CAAC,YAAY;AACX,YAAI,QAAS,eAAc,OAAO;AAAA,MACpC,IACA;AAAA,MAEN,eAAY;AAAA,MACZ,iBAAe;AAAA,MACf,kBAAgB;AAAA,MAChB,WAAW;AAAA;AAAA;AAAA,QAGT;AAAA,QACA,cAAc,YAAY,YAAY,WAClC,wCACA;AAAA,MACN;AAAA,MACA,OAAO;AAAA,QACL,MAAM,GAAG,KAAK,GAAG;AAAA,QACjB,KAAK,GAAG,KAAK,GAAG;AAAA,QAChB,OAAO,IAAI,KAAK,MAAM,GAAG;AAAA,QACzB,QAAQ,IAAI,KAAK,MAAM,GAAG;AAAA,MAC5B;AAAA;AAAA,IAxBK;AAAA,EAyBP,CACD,GACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which of the open presentation's clips were cut from a document's pages, and the slides each is
|
|
3
|
+
* on: what the PDF outlines (`PdfClipOutlines`).
|
|
4
|
+
*/
|
|
5
|
+
import type { Clip, Rect, Slide } from '../../../presentation/model';
|
|
6
|
+
export interface PdfClipOutline {
|
|
7
|
+
clipId: string;
|
|
8
|
+
/** The clipped area, as fractions of the page. */
|
|
9
|
+
rect: Rect;
|
|
10
|
+
/** The slides (indexes) it is on; none while it waits in the tray. */
|
|
11
|
+
slides: number[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The page clips of the document `viewingId` names, by page number. A clip of another version of
|
|
15
|
+
* it is left out when a version is viewed; the parts of a slide's design (`plain`) are left out.
|
|
16
|
+
*/
|
|
17
|
+
export declare function clipOutlinesByPage(viewingId: string | null | undefined, clips: readonly Clip[], slides: readonly Pick<Slide, 'items'>[]): Map<number, PdfClipOutline[]>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function parseRef(id) {
|
|
3
|
+
const match = /^(.*)@v(\d+)$/.exec(id);
|
|
4
|
+
return match ? { documentId: match[1], version: Number(match[2]) } : { documentId: id, version: null };
|
|
5
|
+
}
|
|
6
|
+
function clipOutlinesByPage(viewingId, clips, slides) {
|
|
7
|
+
const byPage = /* @__PURE__ */ new Map();
|
|
8
|
+
if (!viewingId) return byPage;
|
|
9
|
+
const { documentId, version } = parseRef(viewingId);
|
|
10
|
+
for (const clip of clips) {
|
|
11
|
+
if (clip.kind !== "pdf" || clip.plain || clip.documentId !== documentId) continue;
|
|
12
|
+
if (version !== null && clip.version !== void 0 && clip.version !== version) continue;
|
|
13
|
+
const on = slides.flatMap(
|
|
14
|
+
(slide, index) => slide.items.some((item) => item.clipId === clip.id) ? [index] : []
|
|
15
|
+
);
|
|
16
|
+
const outline = { clipId: clip.id, rect: clip.rect, slides: on };
|
|
17
|
+
byPage.set(clip.page, [...byPage.get(clip.page) ?? [], outline]);
|
|
18
|
+
}
|
|
19
|
+
return byPage;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
clipOutlinesByPage
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=clipOutlines.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/connection/viewer/pdf/clipOutlines.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Which of the open presentation's clips were cut from a document's pages, and the slides each is\n * on: what the PDF outlines (`PdfClipOutlines`).\n */\n\nimport type { Clip, Rect, Slide } from '../../../presentation/model'\n\nexport interface PdfClipOutline {\n clipId: string\n /** The clipped area, as fractions of the page. */\n rect: Rect\n /** The slides (indexes) it is on; none while it waits in the tray. */\n slides: number[]\n}\n\n/** The document a viewer id names, and its version (`doc-\u2026@v{n}`), if one. */\nfunction parseRef(id: string): { documentId: string; version: number | null } {\n const match = /^(.*)@v(\\d+)$/.exec(id)\n return match\n ? { documentId: match[1], version: Number(match[2]) }\n : { documentId: id, version: null }\n}\n\n/**\n * The page clips of the document `viewingId` names, by page number. A clip of another version of\n * it is left out when a version is viewed; the parts of a slide's design (`plain`) are left out.\n */\nexport function clipOutlinesByPage(\n viewingId: string | null | undefined,\n clips: readonly Clip[],\n slides: readonly Pick<Slide, 'items'>[]\n): Map<number, PdfClipOutline[]> {\n const byPage = new Map<number, PdfClipOutline[]>()\n if (!viewingId) return byPage\n const { documentId, version } = parseRef(viewingId)\n for (const clip of clips) {\n if (clip.kind !== 'pdf' || clip.plain || clip.documentId !== documentId) continue\n if (version !== null && clip.version !== undefined && clip.version !== version) continue\n const on = slides.flatMap((slide, index) =>\n slide.items.some((item) => item.clipId === clip.id) ? [index] : []\n )\n const outline = { clipId: clip.id, rect: clip.rect, slides: on }\n byPage.set(clip.page, [...(byPage.get(clip.page) ?? []), outline])\n }\n return byPage\n}\n"],
|
|
5
|
+
"mappings": ";AAgBA,SAAS,SAAS,IAA4D;AAC5E,QAAM,QAAQ,gBAAgB,KAAK,EAAE;AACrC,SAAO,QACH,EAAE,YAAY,MAAM,CAAC,GAAG,SAAS,OAAO,MAAM,CAAC,CAAC,EAAE,IAClD,EAAE,YAAY,IAAI,SAAS,KAAK;AACtC;AAMO,SAAS,mBACd,WACA,OACA,QAC+B;AAC/B,QAAM,SAAS,oBAAI,IAA8B;AACjD,MAAI,CAAC,UAAW,QAAO;AACvB,QAAM,EAAE,YAAY,QAAQ,IAAI,SAAS,SAAS;AAClD,aAAW,QAAQ,OAAO;AACxB,QAAI,KAAK,SAAS,SAAS,KAAK,SAAS,KAAK,eAAe,WAAY;AACzE,QAAI,YAAY,QAAQ,KAAK,YAAY,UAAa,KAAK,YAAY,QAAS;AAChF,UAAM,KAAK,OAAO;AAAA,MAAQ,CAAC,OAAO,UAChC,MAAM,MAAM,KAAK,CAAC,SAAS,KAAK,WAAW,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;AAAA,IACnE;AACA,UAAM,UAAU,EAAE,QAAQ,KAAK,IAAI,MAAM,KAAK,MAAM,QAAQ,GAAG;AAC/D,WAAO,IAAI,KAAK,MAAM,CAAC,GAAI,OAAO,IAAI,KAAK,IAAI,KAAK,CAAC,GAAI,OAAO,CAAC;AAAA,EACnE;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -22,5 +22,7 @@ export interface PassageHighlightState {
|
|
|
22
22
|
}
|
|
23
23
|
/** How a passage is lit, or null when it is not. */
|
|
24
24
|
export declare function passageHighlight(chunkId: string, { cited, active }: PassageHighlightState): PassageHighlight | null;
|
|
25
|
+
/** The passage has a box on its page to light (not none, nor the whole page). */
|
|
26
|
+
export declare function passagePlaced(pages: readonly ProcessedPage[], chunkId: string): boolean;
|
|
25
27
|
/** The lit passages' boxes, by page number. Passages without a usable box are left out. */
|
|
26
28
|
export declare function passageBoxesByPage(pages: readonly ProcessedPage[], state: PassageHighlightState): Map<number, PdfPassageBox[]>;
|
|
@@ -15,6 +15,16 @@ function asBox(bbox) {
|
|
|
15
15
|
function isWholePage([x0, y0, x1, y1]) {
|
|
16
16
|
return x0 <= 0 && y0 <= 0 && x1 >= 1 && y1 >= 1;
|
|
17
17
|
}
|
|
18
|
+
function passagePlaced(pages, chunkId) {
|
|
19
|
+
for (const page of pages) {
|
|
20
|
+
const chunk = page.chunks.find((entry) => entry.chunkExtId === chunkId);
|
|
21
|
+
if (chunk) {
|
|
22
|
+
const box = asBox(chunk.pageBbox);
|
|
23
|
+
return !!box && !isWholePage(box);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
18
28
|
function passageBoxesByPage(pages, state) {
|
|
19
29
|
const byPage = /* @__PURE__ */ new Map();
|
|
20
30
|
if (state.cited.size === 0 && !state.active) return byPage;
|
|
@@ -35,6 +45,7 @@ function passageBoxesByPage(pages, state) {
|
|
|
35
45
|
}
|
|
36
46
|
export {
|
|
37
47
|
passageBoxesByPage,
|
|
38
|
-
passageHighlight
|
|
48
|
+
passageHighlight,
|
|
49
|
+
passagePlaced
|
|
39
50
|
};
|
|
40
51
|
//# sourceMappingURL=passageHighlights.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/connection/viewer/pdf/passageHighlights.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Which passages light up on the PDF, and where. The rules are the parsed view's (`ParsedPassage`):\n * while a fact's Citation popover is open its cited passages are light and the one being read is\n * strong; otherwise the passage a citation opened the document at is the one lit. A passage's box\n * is the parser's (`page_bbox`: fractions of its page, top-left origin), so it lands on the page\n * at any zoom.\n */\n\nimport type { ProcessedPage } from '@arbidocs/react/viewers'\nimport type { PassageHighlight } from '../../../files'\n\n/** [x0, y0, x1, y1] as fractions of the page. */\nexport type PageBox = readonly [number, number, number, number]\n\nexport interface PdfPassageBox {\n chunkId: string\n box: PageBox\n highlight: PassageHighlight\n}\n\nexport interface PassageHighlightState {\n /** A fact's cited passages (its Citation popover is open); empty when none is. */\n cited: ReadonlySet<string>\n /** The passage being read: the one a citation opened the document at. */\n active: string | null\n}\n\n/** How a passage is lit, or null when it is not. */\nexport function passageHighlight(\n chunkId: string,\n { cited, active }: PassageHighlightState\n): PassageHighlight | null {\n if (cited.size > 0) {\n if (!cited.has(chunkId)) return null\n return chunkId === active ? 'strong' : 'light'\n }\n return chunkId === active ? 'light' : null\n}\n\n/** A drawable box: four finite fractions with area. */\nfunction asBox(bbox: readonly number[] | undefined): PageBox | null {\n if (!bbox || bbox.length !== 4 || !bbox.every(Number.isFinite)) return null\n const [x0, y0, x1, y1] = bbox\n if (x1 <= x0 || y1 <= y0) return null\n return [x0, y0, x1, y1]\n}\n\n/**\n * The page's whole area: what the parser gives a chunk on a page where it recognized no block to\n * place it by. It says \"this page\", and a rectangle over the whole page would say nothing more.\n */\nfunction isWholePage([x0, y0, x1, y1]: PageBox): boolean {\n return x0 <= 0 && y0 <= 0 && x1 >= 1 && y1 >= 1\n}\n\n/** The lit passages' boxes, by page number. Passages without a usable box are left out. */\nexport function passageBoxesByPage(\n pages: readonly ProcessedPage[],\n state: PassageHighlightState\n): Map<number, PdfPassageBox[]> {\n const byPage = new Map<number, PdfPassageBox[]>()\n if (state.cited.size === 0 && !state.active) return byPage\n for (const page of pages) {\n if (page.pageNumber === null) continue\n for (const chunk of page.chunks) {\n const chunkId = chunk.chunkExtId\n if (!chunkId) continue\n const highlight = passageHighlight(chunkId, state)\n const box = highlight && asBox(chunk.pageBbox)\n if (!highlight || !box || isWholePage(box)) continue\n const boxes = byPage.get(page.pageNumber) ?? []\n boxes.push({ chunkId, box, highlight })\n byPage.set(page.pageNumber, boxes)\n }\n }\n return byPage\n}\n"],
|
|
5
|
-
"mappings": ";AA4BO,SAAS,iBACd,SACA,EAAE,OAAO,OAAO,GACS;AACzB,MAAI,MAAM,OAAO,GAAG;AAClB,QAAI,CAAC,MAAM,IAAI,OAAO,EAAG,QAAO;AAChC,WAAO,YAAY,SAAS,WAAW;AAAA,EACzC;AACA,SAAO,YAAY,SAAS,UAAU;AACxC;AAGA,SAAS,MAAM,MAAqD;AAClE,MAAI,CAAC,QAAQ,KAAK,WAAW,KAAK,CAAC,KAAK,MAAM,OAAO,QAAQ,EAAG,QAAO;AACvE,QAAM,CAAC,IAAI,IAAI,IAAI,EAAE,IAAI;AACzB,MAAI,MAAM,MAAM,MAAM,GAAI,QAAO;AACjC,SAAO,CAAC,IAAI,IAAI,IAAI,EAAE;AACxB;AAMA,SAAS,YAAY,CAAC,IAAI,IAAI,IAAI,EAAE,GAAqB;AACvD,SAAO,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM;AAChD;AAGO,SAAS,mBACd,OACA,OAC8B;AAC9B,QAAM,SAAS,oBAAI,IAA6B;AAChD,MAAI,MAAM,MAAM,SAAS,KAAK,CAAC,MAAM,OAAQ,QAAO;AACpD,aAAW,QAAQ,OAAO;AACxB,QAAI,KAAK,eAAe,KAAM;AAC9B,eAAW,SAAS,KAAK,QAAQ;AAC/B,YAAM,UAAU,MAAM;AACtB,UAAI,CAAC,QAAS;AACd,YAAM,YAAY,iBAAiB,SAAS,KAAK;AACjD,YAAM,MAAM,aAAa,MAAM,MAAM,QAAQ;AAC7C,UAAI,CAAC,aAAa,CAAC,OAAO,YAAY,GAAG,EAAG;AAC5C,YAAM,QAAQ,OAAO,IAAI,KAAK,UAAU,KAAK,CAAC;AAC9C,YAAM,KAAK,EAAE,SAAS,KAAK,UAAU,CAAC;AACtC,aAAO,IAAI,KAAK,YAAY,KAAK;AAAA,IACnC;AAAA,EACF;AACA,SAAO;AACT;",
|
|
4
|
+
"sourcesContent": ["/**\n * Which passages light up on the PDF, and where. The rules are the parsed view's (`ParsedPassage`):\n * while a fact's Citation popover is open its cited passages are light and the one being read is\n * strong; otherwise the passage a citation opened the document at is the one lit. A passage's box\n * is the parser's (`page_bbox`: fractions of its page, top-left origin), so it lands on the page\n * at any zoom.\n */\n\nimport type { ProcessedPage } from '@arbidocs/react/viewers'\nimport type { PassageHighlight } from '../../../files'\n\n/** [x0, y0, x1, y1] as fractions of the page. */\nexport type PageBox = readonly [number, number, number, number]\n\nexport interface PdfPassageBox {\n chunkId: string\n box: PageBox\n highlight: PassageHighlight\n}\n\nexport interface PassageHighlightState {\n /** A fact's cited passages (its Citation popover is open); empty when none is. */\n cited: ReadonlySet<string>\n /** The passage being read: the one a citation opened the document at. */\n active: string | null\n}\n\n/** How a passage is lit, or null when it is not. */\nexport function passageHighlight(\n chunkId: string,\n { cited, active }: PassageHighlightState\n): PassageHighlight | null {\n if (cited.size > 0) {\n if (!cited.has(chunkId)) return null\n return chunkId === active ? 'strong' : 'light'\n }\n return chunkId === active ? 'light' : null\n}\n\n/** A drawable box: four finite fractions with area. */\nfunction asBox(bbox: readonly number[] | undefined): PageBox | null {\n if (!bbox || bbox.length !== 4 || !bbox.every(Number.isFinite)) return null\n const [x0, y0, x1, y1] = bbox\n if (x1 <= x0 || y1 <= y0) return null\n return [x0, y0, x1, y1]\n}\n\n/**\n * The page's whole area: what the parser gives a chunk on a page where it recognized no block to\n * place it by. It says \"this page\", and a rectangle over the whole page would say nothing more.\n */\nfunction isWholePage([x0, y0, x1, y1]: PageBox): boolean {\n return x0 <= 0 && y0 <= 0 && x1 >= 1 && y1 >= 1\n}\n\n/** The passage has a box on its page to light (not none, nor the whole page). */\nexport function passagePlaced(pages: readonly ProcessedPage[], chunkId: string): boolean {\n for (const page of pages) {\n const chunk = page.chunks.find((entry) => entry.chunkExtId === chunkId)\n if (chunk) {\n const box = asBox(chunk.pageBbox)\n return !!box && !isWholePage(box)\n }\n }\n return false\n}\n\n/** The lit passages' boxes, by page number. Passages without a usable box are left out. */\nexport function passageBoxesByPage(\n pages: readonly ProcessedPage[],\n state: PassageHighlightState\n): Map<number, PdfPassageBox[]> {\n const byPage = new Map<number, PdfPassageBox[]>()\n if (state.cited.size === 0 && !state.active) return byPage\n for (const page of pages) {\n if (page.pageNumber === null) continue\n for (const chunk of page.chunks) {\n const chunkId = chunk.chunkExtId\n if (!chunkId) continue\n const highlight = passageHighlight(chunkId, state)\n const box = highlight && asBox(chunk.pageBbox)\n if (!highlight || !box || isWholePage(box)) continue\n const boxes = byPage.get(page.pageNumber) ?? []\n boxes.push({ chunkId, box, highlight })\n byPage.set(page.pageNumber, boxes)\n }\n }\n return byPage\n}\n"],
|
|
5
|
+
"mappings": ";AA4BO,SAAS,iBACd,SACA,EAAE,OAAO,OAAO,GACS;AACzB,MAAI,MAAM,OAAO,GAAG;AAClB,QAAI,CAAC,MAAM,IAAI,OAAO,EAAG,QAAO;AAChC,WAAO,YAAY,SAAS,WAAW;AAAA,EACzC;AACA,SAAO,YAAY,SAAS,UAAU;AACxC;AAGA,SAAS,MAAM,MAAqD;AAClE,MAAI,CAAC,QAAQ,KAAK,WAAW,KAAK,CAAC,KAAK,MAAM,OAAO,QAAQ,EAAG,QAAO;AACvE,QAAM,CAAC,IAAI,IAAI,IAAI,EAAE,IAAI;AACzB,MAAI,MAAM,MAAM,MAAM,GAAI,QAAO;AACjC,SAAO,CAAC,IAAI,IAAI,IAAI,EAAE;AACxB;AAMA,SAAS,YAAY,CAAC,IAAI,IAAI,IAAI,EAAE,GAAqB;AACvD,SAAO,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM;AAChD;AAGO,SAAS,cAAc,OAAiC,SAA0B;AACvF,aAAW,QAAQ,OAAO;AACxB,UAAM,QAAQ,KAAK,OAAO,KAAK,CAAC,UAAU,MAAM,eAAe,OAAO;AACtE,QAAI,OAAO;AACT,YAAM,MAAM,MAAM,MAAM,QAAQ;AAChC,aAAO,CAAC,CAAC,OAAO,CAAC,YAAY,GAAG;AAAA,IAClC;AAAA,EACF;AACA,SAAO;AACT;AAGO,SAAS,mBACd,OACA,OAC8B;AAC9B,QAAM,SAAS,oBAAI,IAA6B;AAChD,MAAI,MAAM,MAAM,SAAS,KAAK,CAAC,MAAM,OAAQ,QAAO;AACpD,aAAW,QAAQ,OAAO;AACxB,QAAI,KAAK,eAAe,KAAM;AAC9B,eAAW,SAAS,KAAK,QAAQ;AAC/B,YAAM,UAAU,MAAM;AACtB,UAAI,CAAC,QAAS;AACd,YAAM,YAAY,iBAAiB,SAAS,KAAK;AACjD,YAAM,MAAM,aAAa,MAAM,MAAM,QAAQ;AAC7C,UAAI,CAAC,aAAa,CAAC,OAAO,YAAY,GAAG,EAAG;AAC5C,YAAM,QAAQ,OAAO,IAAI,KAAK,UAAU,KAAK,CAAC;AAC9C,YAAM,KAAK,EAAE,SAAS,KAAK,UAAU,CAAC;AACtC,aAAO,IAAI,KAAK,YAAY,KAAK;AAAA,IACnC;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The open presentation's clips of the viewed document, outlined over its PDF pages
|
|
3
|
+
* (`clipOutlinesByPage`); a label goes to the clip's slide in the presentation.
|
|
4
|
+
*/
|
|
5
|
+
import { type ReactNode } from 'react';
|
|
6
|
+
/** A PDF viewer's page overlay: `(page) => outlines | null`. */
|
|
7
|
+
export declare function usePdfClipOutlines(viewingId: string | null | undefined): (pageNumber: number) => ReactNode;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
|
+
import { useArbiSessionStore } from "@arbidocs/react";
|
|
5
|
+
import { usePresentation } from "../../../presentation/store.js";
|
|
6
|
+
import { showPresentation } from "../../presentation/requests.js";
|
|
7
|
+
import { PdfClipOutlines } from "./PdfClipOutlines.js";
|
|
8
|
+
import { clipOutlinesByPage } from "./clipOutlines.js";
|
|
9
|
+
function usePdfClipOutlines(viewingId) {
|
|
10
|
+
const session = useArbiSessionStore();
|
|
11
|
+
const clips = usePresentation((s) => s.clips);
|
|
12
|
+
const slides = usePresentation((s) => s.slides);
|
|
13
|
+
const byPage = useMemo(
|
|
14
|
+
() => clipOutlinesByPage(viewingId, clips, slides),
|
|
15
|
+
[viewingId, clips, slides]
|
|
16
|
+
);
|
|
17
|
+
const show = useCallback(
|
|
18
|
+
(outline) => {
|
|
19
|
+
const state = usePresentation.getState();
|
|
20
|
+
if (outline.slides.length) state.goTo(outline.slides[0]);
|
|
21
|
+
showPresentation(session, state.boundTo);
|
|
22
|
+
},
|
|
23
|
+
[session]
|
|
24
|
+
);
|
|
25
|
+
return useCallback(
|
|
26
|
+
(pageNumber) => {
|
|
27
|
+
const outlines = byPage.get(pageNumber);
|
|
28
|
+
return outlines ? /* @__PURE__ */ jsx(PdfClipOutlines, { outlines, onShow: show }) : null;
|
|
29
|
+
},
|
|
30
|
+
[byPage, show]
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
usePdfClipOutlines
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=usePdfClipOutlines.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/connection/viewer/pdf/usePdfClipOutlines.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * The open presentation's clips of the viewed document, outlined over its PDF pages\n * (`clipOutlinesByPage`); a label goes to the clip's slide in the presentation.\n */\n\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { useArbiSessionStore } from '@arbidocs/react'\nimport { usePresentation } from '../../../presentation/store'\nimport { showPresentation } from '../../presentation/requests'\nimport { PdfClipOutlines } from './PdfClipOutlines'\nimport { clipOutlinesByPage, type PdfClipOutline } from './clipOutlines'\n\n/** A PDF viewer's page overlay: `(page) => outlines | null`. */\nexport function usePdfClipOutlines(\n viewingId: string | null | undefined\n): (pageNumber: number) => ReactNode {\n const session = useArbiSessionStore()\n const clips = usePresentation((s) => s.clips)\n const slides = usePresentation((s) => s.slides)\n const byPage = useMemo(\n () => clipOutlinesByPage(viewingId, clips, slides),\n [viewingId, clips, slides]\n )\n const show = useCallback(\n (outline: PdfClipOutline) => {\n const state = usePresentation.getState()\n if (outline.slides.length) state.goTo(outline.slides[0])\n showPresentation(session, state.boundTo)\n },\n [session]\n )\n return useCallback(\n (pageNumber: number) => {\n const outlines = byPage.get(pageNumber)\n return outlines ? <PdfClipOutlines outlines={outlines} onShow={show} /> : null\n },\n [byPage, show]\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAkCwB;AA7BxB,SAAS,aAAa,eAA+B;AACrD,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,0BAA+C;AAGjD,SAAS,mBACd,WACmC;AACnC,QAAM,UAAU,oBAAoB;AACpC,QAAM,QAAQ,gBAAgB,CAAC,MAAM,EAAE,KAAK;AAC5C,QAAM,SAAS,gBAAgB,CAAC,MAAM,EAAE,MAAM;AAC9C,QAAM,SAAS;AAAA,IACb,MAAM,mBAAmB,WAAW,OAAO,MAAM;AAAA,IACjD,CAAC,WAAW,OAAO,MAAM;AAAA,EAC3B;AACA,QAAM,OAAO;AAAA,IACX,CAAC,YAA4B;AAC3B,YAAM,QAAQ,gBAAgB,SAAS;AACvC,UAAI,QAAQ,OAAO,OAAQ,OAAM,KAAK,QAAQ,OAAO,CAAC,CAAC;AACvD,uBAAiB,SAAS,MAAM,OAAO;AAAA,IACzC;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AACA,SAAO;AAAA,IACL,CAAC,eAAuB;AACtB,YAAM,WAAW,OAAO,IAAI,UAAU;AACtC,aAAO,WAAW,oBAAC,mBAAgB,UAAoB,QAAQ,MAAM,IAAK;AAAA,IAC5E;AAAA,IACA,CAAC,QAAQ,IAAI;AAAA,EACf;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
4
|
-
import { useArbiSessionState, useParsedDocument } from "@arbidocs/react";
|
|
4
|
+
import { useArbiSessionState, useArbiSessionStore, useParsedDocument } from "@arbidocs/react";
|
|
5
5
|
import { useProcessedChunks } from "@arbidocs/react/viewers";
|
|
6
6
|
import { useViewerPassageCitation } from "../support.js";
|
|
7
7
|
import { PdfPassageHighlights } from "./PdfPassageHighlights.js";
|
|
8
|
-
import { passageBoxesByPage } from "./passageHighlights.js";
|
|
8
|
+
import { passageBoxesByPage, passagePlaced } from "./passageHighlights.js";
|
|
9
9
|
const NONE = [];
|
|
10
10
|
const NO_FOOTNOTES = {};
|
|
11
11
|
function usePdfPassageHighlights(documentId) {
|
|
@@ -20,6 +20,15 @@ function usePdfPassageHighlights(documentId) {
|
|
|
20
20
|
() => passageBoxesByPage(processedChunks, { cited, active }),
|
|
21
21
|
[processedChunks, cited, active]
|
|
22
22
|
);
|
|
23
|
+
const session = useArbiSessionStore();
|
|
24
|
+
const fellBackFor = useRef(null);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!active || !parsed || !documentId) return;
|
|
27
|
+
const key = `${documentId}:${active}`;
|
|
28
|
+
if (fellBackFor.current === key || passagePlaced(processedChunks, active)) return;
|
|
29
|
+
fellBackFor.current = key;
|
|
30
|
+
session.setDocumentViewer({ tab: "html" });
|
|
31
|
+
}, [active, parsed, processedChunks, documentId, session]);
|
|
23
32
|
const centredFor = useRef(null);
|
|
24
33
|
const activeKey = active ? `${documentId}:${active}` : null;
|
|
25
34
|
useEffect(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/connection/viewer/pdf/usePdfPassageHighlights.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * The passages a citation lights, drawn over the PDF page by page: a fact's cited passages (its\n * Citation popover is open) and the passage a citation opened the document at, as the parsed view\n * lights them. Nothing is fetched until one is lit; the parsed chunks are the parsed view's own\n * query, so opening that tab afterwards costs nothing more.\n */\n\nimport { useCallback, useEffect, useMemo, useRef, type ReactNode } from 'react'\nimport { useArbiSessionState, useParsedDocument } from '@arbidocs/react'\nimport { useProcessedChunks } from '@arbidocs/react/viewers'\nimport { useViewerPassageCitation } from '../support'\nimport { PdfPassageHighlights } from './PdfPassageHighlights'\nimport { passageBoxesByPage } from './passageHighlights'\n\nconst NONE: readonly string[] = []\nconst NO_FOOTNOTES: Record<string, string> = {}\n\n/** A PDF viewer's page overlay for the document being viewed: `(page) => highlights | null`. */\nexport function usePdfPassageHighlights(\n documentId: string | undefined\n): (pageNumber: number) => ReactNode {\n const citedIds = useViewerPassageCitation()?.highlighted ?? NONE\n const cited = useMemo(() => new Set(citedIds), [citedIds])\n const active = useArbiSessionState((s) => s.viewingDocument?.passageId ?? null)\n\n const { data: parsed } = useParsedDocument(documentId, 'final', {\n enabled: cited.size > 0 || !!active,\n })\n const { processedChunks } = useProcessedChunks(parsed?.chunks, NO_FOOTNOTES)\n const boxesByPage = useMemo(\n () => passageBoxesByPage(processedChunks, { cited, active }),\n [processedChunks, cited, active]\n )\n\n // The passage being read is brought into view once, when its page first draws it: the viewer\n // opens the page, this centres the passage on it, and scrolling away is then left alone.\n const centredFor = useRef<string | null>(null)\n const activeKey = active ? `${documentId}:${active}` : null\n useEffect(() => {\n if (!activeKey) centredFor.current = null\n }, [activeKey])\n const centre = useCallback(\n (element: HTMLElement) => {\n if (!activeKey || centredFor.current === activeKey) return\n centredFor.current = activeKey\n element.scrollIntoView?.({ block: 'center', behavior: 'smooth' })\n },\n [activeKey]\n )\n\n return useCallback(\n (pageNumber: number) => {\n const boxes = boxesByPage.get(pageNumber)\n return boxes ? (\n <PdfPassageHighlights boxes={boxes} activeId={active} onActiveDrawn={centre} />\n ) : null\n },\n [boxesByPage, active, centre]\n )\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * The passages a citation lights, drawn over the PDF page by page: a fact's cited passages (its\n * Citation popover is open) and the passage a citation opened the document at, as the parsed view\n * lights them. Nothing is fetched until one is lit; the parsed chunks are the parsed view's own\n * query, so opening that tab afterwards costs nothing more.\n */\n\nimport { useCallback, useEffect, useMemo, useRef, type ReactNode } from 'react'\nimport { useArbiSessionState, useArbiSessionStore, useParsedDocument } from '@arbidocs/react'\nimport { useProcessedChunks } from '@arbidocs/react/viewers'\nimport { useViewerPassageCitation } from '../support'\nimport { PdfPassageHighlights } from './PdfPassageHighlights'\nimport { passageBoxesByPage, passagePlaced } from './passageHighlights'\n\nconst NONE: readonly string[] = []\nconst NO_FOOTNOTES: Record<string, string> = {}\n\n/** A PDF viewer's page overlay for the document being viewed: `(page) => highlights | null`. */\nexport function usePdfPassageHighlights(\n documentId: string | undefined\n): (pageNumber: number) => ReactNode {\n const citedIds = useViewerPassageCitation()?.highlighted ?? NONE\n const cited = useMemo(() => new Set(citedIds), [citedIds])\n const active = useArbiSessionState((s) => s.viewingDocument?.passageId ?? null)\n\n const { data: parsed } = useParsedDocument(documentId, 'final', {\n enabled: cited.size > 0 || !!active,\n })\n const { processedChunks } = useProcessedChunks(parsed?.chunks, NO_FOOTNOTES)\n const boxesByPage = useMemo(\n () => passageBoxesByPage(processedChunks, { cited, active }),\n [processedChunks, cited, active]\n )\n\n // The passage being read could not be placed on its page (a document parsed before passages had\n // boxes): the text view marks it instead.\n const session = useArbiSessionStore()\n const fellBackFor = useRef<string | null>(null)\n useEffect(() => {\n if (!active || !parsed || !documentId) return\n const key = `${documentId}:${active}`\n if (fellBackFor.current === key || passagePlaced(processedChunks, active)) return\n fellBackFor.current = key\n session.setDocumentViewer({ tab: 'html' })\n }, [active, parsed, processedChunks, documentId, session])\n\n // The passage being read is brought into view once, when its page first draws it: the viewer\n // opens the page, this centres the passage on it, and scrolling away is then left alone.\n const centredFor = useRef<string | null>(null)\n const activeKey = active ? `${documentId}:${active}` : null\n useEffect(() => {\n if (!activeKey) centredFor.current = null\n }, [activeKey])\n const centre = useCallback(\n (element: HTMLElement) => {\n if (!activeKey || centredFor.current === activeKey) return\n centredFor.current = activeKey\n element.scrollIntoView?.({ block: 'center', behavior: 'smooth' })\n },\n [activeKey]\n )\n\n return useCallback(\n (pageNumber: number) => {\n const boxes = boxesByPage.get(pageNumber)\n return boxes ? (\n <PdfPassageHighlights boxes={boxes} activeId={active} onActiveDrawn={centre} />\n ) : null\n },\n [boxesByPage, active, centre]\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAkEQ;AA3DR,SAAS,aAAa,WAAW,SAAS,cAA8B;AACxE,SAAS,qBAAqB,qBAAqB,yBAAyB;AAC5E,SAAS,0BAA0B;AACnC,SAAS,gCAAgC;AACzC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB,qBAAqB;AAElD,MAAM,OAA0B,CAAC;AACjC,MAAM,eAAuC,CAAC;AAGvC,SAAS,wBACd,YACmC;AACnC,QAAM,WAAW,yBAAyB,GAAG,eAAe;AAC5D,QAAM,QAAQ,QAAQ,MAAM,IAAI,IAAI,QAAQ,GAAG,CAAC,QAAQ,CAAC;AACzD,QAAM,SAAS,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,aAAa,IAAI;AAE9E,QAAM,EAAE,MAAM,OAAO,IAAI,kBAAkB,YAAY,SAAS;AAAA,IAC9D,SAAS,MAAM,OAAO,KAAK,CAAC,CAAC;AAAA,EAC/B,CAAC;AACD,QAAM,EAAE,gBAAgB,IAAI,mBAAmB,QAAQ,QAAQ,YAAY;AAC3E,QAAM,cAAc;AAAA,IAClB,MAAM,mBAAmB,iBAAiB,EAAE,OAAO,OAAO,CAAC;AAAA,IAC3D,CAAC,iBAAiB,OAAO,MAAM;AAAA,EACjC;AAIA,QAAM,UAAU,oBAAoB;AACpC,QAAM,cAAc,OAAsB,IAAI;AAC9C,YAAU,MAAM;AACd,QAAI,CAAC,UAAU,CAAC,UAAU,CAAC,WAAY;AACvC,UAAM,MAAM,GAAG,UAAU,IAAI,MAAM;AACnC,QAAI,YAAY,YAAY,OAAO,cAAc,iBAAiB,MAAM,EAAG;AAC3E,gBAAY,UAAU;AACtB,YAAQ,kBAAkB,EAAE,KAAK,OAAO,CAAC;AAAA,EAC3C,GAAG,CAAC,QAAQ,QAAQ,iBAAiB,YAAY,OAAO,CAAC;AAIzD,QAAM,aAAa,OAAsB,IAAI;AAC7C,QAAM,YAAY,SAAS,GAAG,UAAU,IAAI,MAAM,KAAK;AACvD,YAAU,MAAM;AACd,QAAI,CAAC,UAAW,YAAW,UAAU;AAAA,EACvC,GAAG,CAAC,SAAS,CAAC;AACd,QAAM,SAAS;AAAA,IACb,CAAC,YAAyB;AACxB,UAAI,CAAC,aAAa,WAAW,YAAY,UAAW;AACpD,iBAAW,UAAU;AACrB,cAAQ,iBAAiB,EAAE,OAAO,UAAU,UAAU,SAAS,CAAC;AAAA,IAClE;AAAA,IACA,CAAC,SAAS;AAAA,EACZ;AAEA,SAAO;AAAA,IACL,CAAC,eAAuB;AACtB,YAAM,QAAQ,YAAY,IAAI,UAAU;AACxC,aAAO,QACL,oBAAC,wBAAqB,OAAc,UAAU,QAAQ,eAAe,QAAQ,IAC3E;AAAA,IACN;AAAA,IACA,CAAC,aAAa,QAAQ,MAAM;AAAA,EAC9B;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,8 +10,8 @@ require('../chunk-ZU2B2RZK.cjs');
|
|
|
10
10
|
var chunkNSD37OF5_cjs = require('../chunk-NSD37OF5.cjs');
|
|
11
11
|
var chunkOEJQFPWO_cjs = require('../chunk-OEJQFPWO.cjs');
|
|
12
12
|
require('../chunk-JV5TVUOU.cjs');
|
|
13
|
-
require('../chunk-IPSHAMO2.cjs');
|
|
14
13
|
var chunkZW6FPIFC_cjs = require('../chunk-ZW6FPIFC.cjs');
|
|
14
|
+
require('../chunk-IPSHAMO2.cjs');
|
|
15
15
|
var chunkTKHCIHE2_cjs = require('../chunk-TKHCIHE2.cjs');
|
|
16
16
|
require('../chunk-JDFBEGQO.cjs');
|
|
17
17
|
require('../chunk-ULWRNGGE.cjs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Download, FileText, PencilLine,
|
|
3
|
+
import { Download, FileText, PencilLine, Scissors } from "lucide-react";
|
|
4
4
|
import { Button } from "@arbidocs/react/ui";
|
|
5
5
|
const TOUCH = "pointer-coarse:min-h-11";
|
|
6
6
|
function AnnotateButton({ active, onClick, compact }) {
|
|
@@ -37,7 +37,7 @@ function ClipButton({ active, onClick, compact }) {
|
|
|
37
37
|
className: TOUCH,
|
|
38
38
|
onClick,
|
|
39
39
|
children: [
|
|
40
|
-
/* @__PURE__ */ jsx(
|
|
40
|
+
/* @__PURE__ */ jsx(Scissors, { className: "size-4" }),
|
|
41
41
|
!compact && /* @__PURE__ */ jsx("span", { className: "ml-1", children: "Clip" })
|
|
42
42
|
]
|
|
43
43
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/document-tools/DocumentToolButtons.tsx"],
|
|
4
|
-
"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,
|
|
5
|
-
"mappings": ";AAsBI,SAWE,KAXF;AAfJ,SAAS,UAAU,UAAU,YAAY,
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": ";AAsBI,SAWE,KAXF;AAfJ,SAAS,UAAU,UAAU,YAAY,gBAAgB;AACzD,SAAS,cAAc;AAEvB,MAAM,QAAQ;AAUP,SAAS,eAAe,EAAE,QAAQ,SAAS,QAAQ,GAA8B;AACtF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS,SAAS,YAAY;AAAA,MAC9B,MAAM,UAAU,SAAS;AAAA,MACzB,gBAAc;AAAA,MACd,OAAM;AAAA,MACN,cAAW;AAAA,MACX,eAAY;AAAA,MACZ,WAAW;AAAA,MACX;AAAA,MAEA;AAAA,4BAAC,cAAW,WAAU,UAAS;AAAA,QAC9B,CAAC,WAAW,oBAAC,UAAK,WAAU,QAAO,sBAAQ;AAAA;AAAA;AAAA,EAC9C;AAEJ;AAGO,SAAS,WAAW,EAAE,QAAQ,SAAS,QAAQ,GAA8B;AAClF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS,SAAS,YAAY;AAAA,MAC9B,MAAM,UAAU,SAAS;AAAA,MACzB,gBAAc;AAAA,MACd,OAAM;AAAA,MACN,cAAW;AAAA,MACX,eAAY;AAAA,MACZ,WAAW;AAAA,MACX;AAAA,MAEA;AAAA,4BAAC,YAAS,WAAU,UAAS;AAAA,QAC5B,CAAC,WAAW,oBAAC,UAAK,WAAU,QAAO,kBAAI;AAAA;AAAA;AAAA,EAC1C;AAEJ;AAGO,SAAS,mBAAmB,EAAE,QAAQ,SAAS,QAAQ,GAA8B;AAC1F,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS,SAAS,YAAY;AAAA,MAC9B,MAAM,UAAU,SAAS;AAAA,MACzB,gBAAc;AAAA,MACd,OAAO,SAAS,0BAA0B;AAAA,MAC1C,cAAW;AAAA,MACX,eAAY;AAAA,MACZ,WAAW;AAAA,MACX;AAAA,MAEA;AAAA,4BAAC,YAAS,WAAU,UAAS;AAAA,QAC5B,CAAC,WAAW,oBAAC,UAAK,WAAU,QAAO,2BAAa;AAAA;AAAA;AAAA,EACnD;AAEJ;AAMO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AACF,GAGiB;AACf,QAAM,SACJ;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OACE,kBACA;AAAA,MAEF,cAAW;AAAA,MACX,oBAAkB;AAAA,MAClB,UAAU,CAAC,CAAC;AAAA,MACZ,eAAY;AAAA,MACZ,WAAW;AAAA,MACX;AAAA,MAEA,8BAAC,YAAS,WAAU,UAAS;AAAA;AAAA,EAC/B;AAGF,SAAO,iBACL,oBAAC,UAAK,OAAO,gBAAgB,WAAU,eAAc,eAAY,0BAC9D,kBACH,IAEA;AAEJ;AAGO,SAAS,iBAA+B;AAC7C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAY;AAAA,MACb;AAAA;AAAA,EAED;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunk46P7IDBX_cjs = require('../chunk-46P7IDBX.cjs');
|
|
5
5
|
var chunkGNZAH6UI_cjs = require('../chunk-GNZAH6UI.cjs');
|
|
6
6
|
var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
|
|
7
7
|
require('../chunk-QQMMCXBP.cjs');
|
|
@@ -15,51 +15,51 @@ require('../chunk-PLIF5CUV.cjs');
|
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "AnnotateButton", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunk46P7IDBX_cjs.AnnotateButton; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "ClipButton", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunk46P7IDBX_cjs.ClipButton; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "DEFAULT_VERSION_SNAPSHOT_BAR_LABELS", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunk46P7IDBX_cjs.DEFAULT_VERSION_SNAPSHOT_BAR_LABELS; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "DownloadMarkupButton", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunk46P7IDBX_cjs.DownloadMarkupButton; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "FileShareDialog", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunk46P7IDBX_cjs.FileShareDialog; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "MarkupNotices", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunk46P7IDBX_cjs.MarkupNotices; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "MarkupViewNote", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunk46P7IDBX_cjs.MarkupViewNote; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "PlaceMySignatureMenuItems", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunk46P7IDBX_cjs.PlaceMySignatureMenuItems; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "ShowOriginalButton", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunk46P7IDBX_cjs.ShowOriginalButton; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "SignatureRequestBanner", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunk46P7IDBX_cjs.SignatureRequestBanner; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "SignedEditNote", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunk46P7IDBX_cjs.SignedEditNote; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "VersionSnapshotBar", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunk46P7IDBX_cjs.VersionSnapshotBar; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "DELETE_SAVED_SIGNATURE_TEXT", {
|
|
65
65
|
enumerable: true,
|
package/dist/embed/index.cjs
CHANGED
|
@@ -1,63 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
4
|
+
var chunkOHHKBURG_cjs = require('../chunk-OHHKBURG.cjs');
|
|
5
|
+
require('../chunk-XF355M7O.cjs');
|
|
6
|
+
require('../chunk-2F57IO7S.cjs');
|
|
7
|
+
require('../chunk-7NLO7ASW.cjs');
|
|
8
|
+
require('../chunk-7PN3YENO.cjs');
|
|
9
|
+
require('../chunk-UFT22LAB.cjs');
|
|
10
10
|
require('../chunk-TJY7XPDE.cjs');
|
|
11
11
|
require('../chunk-XNW62J54.cjs');
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-
|
|
14
|
-
require('../chunk-
|
|
12
|
+
require('../chunk-KXIRVKCJ.cjs');
|
|
13
|
+
require('../chunk-5QERK4PK.cjs');
|
|
14
|
+
require('../chunk-T73BHNQX.cjs');
|
|
15
15
|
require('../chunk-HYUKPHCT.cjs');
|
|
16
|
-
require('../chunk-
|
|
16
|
+
require('../chunk-ALK3PUUB.cjs');
|
|
17
17
|
require('../chunk-223D4727.cjs');
|
|
18
18
|
require('../chunk-SNUBQMIS.cjs');
|
|
19
19
|
require('../chunk-P5AQYC4D.cjs');
|
|
20
|
-
require('../chunk-
|
|
20
|
+
require('../chunk-WAV762GP.cjs');
|
|
21
21
|
require('../chunk-QQMMCXBP.cjs');
|
|
22
22
|
require('../chunk-DTMBAFIL.cjs');
|
|
23
23
|
require('../chunk-4B6HYQTW.cjs');
|
|
24
|
-
require('../chunk-JHDCDEXY.cjs');
|
|
25
|
-
require('../chunk-M2FOXGJU.cjs');
|
|
26
|
-
require('../chunk-5F4DCIHS.cjs');
|
|
27
24
|
require('../chunk-MZZ3SBQL.cjs');
|
|
28
|
-
require('../chunk-
|
|
29
|
-
require('../chunk-
|
|
25
|
+
require('../chunk-NY3YUCOW.cjs');
|
|
26
|
+
require('../chunk-325GVZE6.cjs');
|
|
30
27
|
require('../chunk-WQMR3O2D.cjs');
|
|
31
28
|
require('../chunk-ORELHENJ.cjs');
|
|
32
29
|
require('../chunk-NWNVWO6L.cjs');
|
|
33
30
|
require('../chunk-SK6HQ46Q.cjs');
|
|
34
31
|
require('../chunk-TG2GM7WJ.cjs');
|
|
35
|
-
require('../chunk-
|
|
36
|
-
require('../chunk-YZSQ7F5K.cjs');
|
|
37
|
-
require('../chunk-MCXS6X37.cjs');
|
|
38
|
-
require('../chunk-KQF7POTG.cjs');
|
|
39
|
-
require('../chunk-75BNMCUX.cjs');
|
|
32
|
+
require('../chunk-E3Y7RI3J.cjs');
|
|
40
33
|
require('../chunk-OEJQFPWO.cjs');
|
|
41
|
-
require('../chunk-
|
|
34
|
+
require('../chunk-TP5PGWIO.cjs');
|
|
42
35
|
require('../chunk-I4IS6ST6.cjs');
|
|
43
36
|
require('../chunk-7JLJH5CW.cjs');
|
|
44
37
|
require('../chunk-EVZH6Z5O.cjs');
|
|
45
|
-
require('../chunk-HSLPFBK2.cjs');
|
|
46
38
|
require('../chunk-OYXWQTHF.cjs');
|
|
47
39
|
require('../chunk-S237ORM3.cjs');
|
|
48
40
|
require('../chunk-II2OEXHW.cjs');
|
|
49
41
|
require('../chunk-3YEXZX4H.cjs');
|
|
50
42
|
require('../chunk-4PA6VCCR.cjs');
|
|
51
|
-
require('../chunk-
|
|
43
|
+
require('../chunk-WXUU3COI.cjs');
|
|
52
44
|
require('../chunk-AHDJXIUB.cjs');
|
|
53
45
|
require('../chunk-YVCOQHCE.cjs');
|
|
54
46
|
require('../chunk-RL2HI6NP.cjs');
|
|
55
47
|
require('../chunk-6UZC4XVV.cjs');
|
|
56
|
-
require('../chunk-QGVOT7E4.cjs');
|
|
57
|
-
require('../chunk-QRAQZTJE.cjs');
|
|
58
|
-
require('../chunk-UDSHVNU3.cjs');
|
|
59
48
|
require('../chunk-JV5TVUOU.cjs');
|
|
60
|
-
require('../chunk-IPSHAMO2.cjs');
|
|
61
49
|
require('../chunk-ZVEW3JBT.cjs');
|
|
62
50
|
require('../chunk-V6C2MBFY.cjs');
|
|
63
51
|
require('../chunk-M74FWYNL.cjs');
|
|
@@ -69,44 +57,56 @@ require('../chunk-QMIHLJMH.cjs');
|
|
|
69
57
|
require('../chunk-HQDR43JC.cjs');
|
|
70
58
|
var chunkJR2YSBD5_cjs = require('../chunk-JR2YSBD5.cjs');
|
|
71
59
|
require('../chunk-TMX7YFVM.cjs');
|
|
72
|
-
require('../chunk-ZBP4ZSAJ.cjs');
|
|
73
60
|
require('../chunk-3YZKDCWY.cjs');
|
|
74
61
|
require('../chunk-SJSGSHIT.cjs');
|
|
75
|
-
require('../chunk-PPCATBOY.cjs');
|
|
76
62
|
require('../chunk-ZW6FPIFC.cjs');
|
|
77
63
|
require('../chunk-ZT5MIFLC.cjs');
|
|
78
|
-
require('../chunk-
|
|
79
|
-
require('../chunk-
|
|
64
|
+
require('../chunk-JHDCDEXY.cjs');
|
|
65
|
+
require('../chunk-M2FOXGJU.cjs');
|
|
66
|
+
require('../chunk-5F4DCIHS.cjs');
|
|
67
|
+
require('../chunk-Z2XZ2D4N.cjs');
|
|
68
|
+
require('../chunk-YZSQ7F5K.cjs');
|
|
69
|
+
require('../chunk-MCXS6X37.cjs');
|
|
70
|
+
require('../chunk-KQF7POTG.cjs');
|
|
71
|
+
require('../chunk-75BNMCUX.cjs');
|
|
72
|
+
require('../chunk-HSLPFBK2.cjs');
|
|
73
|
+
require('../chunk-QGVOT7E4.cjs');
|
|
74
|
+
require('../chunk-QRAQZTJE.cjs');
|
|
75
|
+
require('../chunk-UDSHVNU3.cjs');
|
|
76
|
+
require('../chunk-IPSHAMO2.cjs');
|
|
77
|
+
require('../chunk-ZBP4ZSAJ.cjs');
|
|
78
|
+
require('../chunk-PPCATBOY.cjs');
|
|
80
79
|
require('../chunk-TKHCIHE2.cjs');
|
|
81
80
|
require('../chunk-JDFBEGQO.cjs');
|
|
82
81
|
require('../chunk-ULWRNGGE.cjs');
|
|
82
|
+
require('../chunk-LJJJ6CYH.cjs');
|
|
83
83
|
require('../chunk-PLIF5CUV.cjs');
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
Object.defineProperty(exports, "ArbiChat", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkOHHKBURG_cjs.ArbiChat; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "ConnectedCompactLogin", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkOHHKBURG_cjs.ConnectedCompactLogin; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "ConnectedEmbeddedChat", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkOHHKBURG_cjs.ConnectedEmbeddedChat; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "ConnectedLoginPage", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkOHHKBURG_cjs.ConnectedLoginPage; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "EmbeddedChatPanel", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkOHHKBURG_cjs.EmbeddedChatPanel; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "defaultHost", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkOHHKBURG_cjs.defaultHost; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "useConnection", {
|
|
112
112
|
enumerable: true,
|