@arbidocs/blocks 0.5.145 → 0.5.146
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/README.md +5 -0
- package/dist/{ConnectedNativeDocxComparison-KKX27IGJ.cjs → ConnectedNativeDocxComparison-MG54YLSO.cjs} +10 -10
- package/dist/{ConnectedNativeDocxComparison-KKX27IGJ.cjs.map → ConnectedNativeDocxComparison-MG54YLSO.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-HAHRU4DQ.cjs → ConnectedStreamedWordArtifact-7KZGQECL.cjs} +10 -10
- package/dist/{ConnectedStreamedWordArtifact-HAHRU4DQ.cjs.map → ConnectedStreamedWordArtifact-7KZGQECL.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-VJYQ7XZA.cjs → FilesViewerDialog-FFPW7TIK.cjs} +8 -8
- package/dist/{FilesViewerDialog-VJYQ7XZA.cjs.map → FilesViewerDialog-FFPW7TIK.cjs.map} +1 -1
- package/dist/{NativeDocxEditor-7A3SYDAJ.cjs → NativeDocxEditor-R2OKJLRY.cjs} +6 -6
- package/dist/{NativeDocxEditor-7A3SYDAJ.cjs.map → NativeDocxEditor-R2OKJLRY.cjs.map} +1 -1
- package/dist/{chunk-6JLRF7N6.cjs → chunk-BD7P4KYQ.cjs} +5 -6
- package/dist/chunk-BD7P4KYQ.cjs.map +1 -0
- package/dist/{chunk-INNHU46B.cjs → chunk-BLJET4KG.cjs} +4 -4
- package/dist/{chunk-INNHU46B.cjs.map → chunk-BLJET4KG.cjs.map} +1 -1
- package/dist/{chunk-WQEWVZGO.cjs → chunk-BTAT3MJP.cjs} +5 -5
- package/dist/{chunk-WQEWVZGO.cjs.map → chunk-BTAT3MJP.cjs.map} +1 -1
- package/dist/chunk-G5YLJ2YT.cjs +18 -0
- package/dist/{chunk-S2NQS4RC.cjs.map → chunk-G5YLJ2YT.cjs.map} +1 -1
- package/dist/{chunk-I5L24HOC.cjs → chunk-HWZT24TD.cjs} +6 -6
- package/dist/{chunk-I5L24HOC.cjs.map → chunk-HWZT24TD.cjs.map} +1 -1
- package/dist/{chunk-A53YMUOX.cjs → chunk-LH3PDPJP.cjs} +3 -3
- package/dist/{chunk-A53YMUOX.cjs.map → chunk-LH3PDPJP.cjs.map} +1 -1
- package/dist/{chunk-TMZS7IKQ.cjs → chunk-N2OVF6SJ.cjs} +7 -7
- package/dist/{chunk-TMZS7IKQ.cjs.map → chunk-N2OVF6SJ.cjs.map} +1 -1
- package/dist/{chunk-UNBORYTW.cjs → chunk-N7AUJTU4.cjs} +4 -4
- package/dist/{chunk-UNBORYTW.cjs.map → chunk-N7AUJTU4.cjs.map} +1 -1
- package/dist/{chunk-464TFVQ7.cjs → chunk-UNWDR6GG.cjs} +6 -6
- package/dist/{chunk-464TFVQ7.cjs.map → chunk-UNWDR6GG.cjs.map} +1 -1
- package/dist/{chunk-O6OLY43S.cjs → chunk-WN6BLSAZ.cjs} +5 -5
- package/dist/{chunk-O6OLY43S.cjs.map → chunk-WN6BLSAZ.cjs.map} +1 -1
- package/dist/connect/docx.cjs +14 -14
- package/dist/connect/index.cjs +81 -81
- package/dist/connect/viewer.cjs +6 -6
- package/dist/docx/NativeDocxEditor.js +3 -4
- package/dist/docx/NativeDocxEditor.js.map +2 -2
- package/dist/docx/index.cjs +38 -38
- package/dist/index.cjs +55 -55
- package/dist/workflow-canvas/index.cjs +11 -11
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/chunk-6JLRF7N6.cjs.map +0 -1
- package/dist/chunk-S2NQS4RC.cjs +0 -18
package/README.md
CHANGED
|
@@ -629,6 +629,11 @@ version control (`public/pdf.worker*.mjs`, `public/cmaps/`, `public/standard_fon
|
|
|
629
629
|
`public/wasm/`). `--images` also copies the pdf.js annotation icons to `/images/`. To serve them
|
|
630
630
|
elsewhere, pass `assets` (`workerSrc`, `cMapUrl`, `standardFontDataUrl`, `wasmUrl`) to the viewer.
|
|
631
631
|
|
|
632
|
+
The viewer requests the worker as `/pdf.worker.min.mjs?v=<pdf.js version>`, so a browser that cached
|
|
633
|
+
the worker of an earlier pdf.js is never served it (that is the "API version does not match Worker
|
|
634
|
+
version" failure); the query is ignored when serving the file, so `immutable` caching is safe. If you
|
|
635
|
+
set your own `workerSrc`, version it the same way, or serve it with `Cache-Control: no-cache`.
|
|
636
|
+
|
|
632
637
|
## Editorial site parts
|
|
633
638
|
|
|
634
639
|
`@arbidocs/blocks/site` (and the root) carry the layout parts for static marketing pages:
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var chunkUNWDR6GG_cjs = require('./chunk-UNWDR6GG.cjs');
|
|
5
|
+
require('./chunk-BLJET4KG.cjs');
|
|
6
|
+
require('./chunk-BD7P4KYQ.cjs');
|
|
7
7
|
require('./chunk-GA5ZO4YA.cjs');
|
|
8
8
|
require('./chunk-VG5XNE4H.cjs');
|
|
9
9
|
require('./chunk-DDWLMYRO.cjs');
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-OA3AN6WW.cjs');
|
|
12
|
-
require('./chunk-FK7MBD5H.cjs');
|
|
10
|
+
require('./chunk-HWZT24TD.cjs');
|
|
13
11
|
require('./chunk-4ONPEVTP.cjs');
|
|
14
12
|
require('./chunk-V3KLUWQQ.cjs');
|
|
13
|
+
require('./chunk-OA3AN6WW.cjs');
|
|
14
|
+
require('./chunk-FK7MBD5H.cjs');
|
|
15
15
|
require('./chunk-7NJKDJVO.cjs');
|
|
16
16
|
require('./chunk-UKOYN2WD.cjs');
|
|
17
17
|
require('./chunk-RC25WMVB.cjs');
|
|
18
|
-
require('./chunk-
|
|
18
|
+
require('./chunk-LH3PDPJP.cjs');
|
|
19
19
|
require('./chunk-JJZOL5MG.cjs');
|
|
20
20
|
require('./chunk-3YEXZX4H.cjs');
|
|
21
21
|
require('./chunk-4PA6VCCR.cjs');
|
|
@@ -48,7 +48,7 @@ require('./chunk-PLIF5CUV.cjs');
|
|
|
48
48
|
|
|
49
49
|
Object.defineProperty(exports, "ConnectedNativeDocxComparison", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkUNWDR6GG_cjs.ConnectedNativeDocxComparison; }
|
|
52
52
|
});
|
|
53
|
-
//# sourceMappingURL=ConnectedNativeDocxComparison-
|
|
54
|
-
//# sourceMappingURL=ConnectedNativeDocxComparison-
|
|
53
|
+
//# sourceMappingURL=ConnectedNativeDocxComparison-MG54YLSO.cjs.map
|
|
54
|
+
//# sourceMappingURL=ConnectedNativeDocxComparison-MG54YLSO.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"ConnectedNativeDocxComparison-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"ConnectedNativeDocxComparison-MG54YLSO.cjs"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var chunkG5YLJ2YT_cjs = require('./chunk-G5YLJ2YT.cjs');
|
|
5
|
+
require('./chunk-WN6BLSAZ.cjs');
|
|
6
|
+
require('./chunk-BD7P4KYQ.cjs');
|
|
7
7
|
require('./chunk-GA5ZO4YA.cjs');
|
|
8
8
|
require('./chunk-VG5XNE4H.cjs');
|
|
9
9
|
require('./chunk-DDWLMYRO.cjs');
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-OA3AN6WW.cjs');
|
|
12
|
-
require('./chunk-FK7MBD5H.cjs');
|
|
10
|
+
require('./chunk-HWZT24TD.cjs');
|
|
13
11
|
require('./chunk-4ONPEVTP.cjs');
|
|
14
12
|
require('./chunk-V3KLUWQQ.cjs');
|
|
13
|
+
require('./chunk-OA3AN6WW.cjs');
|
|
14
|
+
require('./chunk-FK7MBD5H.cjs');
|
|
15
15
|
require('./chunk-7NJKDJVO.cjs');
|
|
16
16
|
require('./chunk-UKOYN2WD.cjs');
|
|
17
17
|
require('./chunk-RC25WMVB.cjs');
|
|
18
|
-
require('./chunk-
|
|
18
|
+
require('./chunk-LH3PDPJP.cjs');
|
|
19
19
|
require('./chunk-JJZOL5MG.cjs');
|
|
20
20
|
require('./chunk-3YEXZX4H.cjs');
|
|
21
21
|
require('./chunk-4PA6VCCR.cjs');
|
|
@@ -48,7 +48,7 @@ require('./chunk-PLIF5CUV.cjs');
|
|
|
48
48
|
|
|
49
49
|
Object.defineProperty(exports, "ConnectedStreamedWordArtifact", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkG5YLJ2YT_cjs.ConnectedStreamedWordArtifact; }
|
|
52
52
|
});
|
|
53
|
-
//# sourceMappingURL=ConnectedStreamedWordArtifact-
|
|
54
|
-
//# sourceMappingURL=ConnectedStreamedWordArtifact-
|
|
53
|
+
//# sourceMappingURL=ConnectedStreamedWordArtifact-7KZGQECL.cjs.map
|
|
54
|
+
//# sourceMappingURL=ConnectedStreamedWordArtifact-7KZGQECL.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"ConnectedStreamedWordArtifact-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"ConnectedStreamedWordArtifact-7KZGQECL.cjs"}
|
|
@@ -5,7 +5,7 @@ var chunk2VEQKLNN_cjs = require('./chunk-2VEQKLNN.cjs');
|
|
|
5
5
|
require('./chunk-MC34TXSS.cjs');
|
|
6
6
|
require('./chunk-2XZ3HBAA.cjs');
|
|
7
7
|
require('./chunk-YST6GVN5.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunkN2OVF6SJ_cjs = require('./chunk-N2OVF6SJ.cjs');
|
|
9
9
|
require('./chunk-JITYC4OS.cjs');
|
|
10
10
|
require('./chunk-WVZLAAIZ.cjs');
|
|
11
11
|
require('./chunk-X7ALF4MP.cjs');
|
|
@@ -21,11 +21,11 @@ require('./chunk-HYUKPHCT.cjs');
|
|
|
21
21
|
require('./chunk-ZPIZINH2.cjs');
|
|
22
22
|
require('./chunk-223D4727.cjs');
|
|
23
23
|
require('./chunk-SNUBQMIS.cjs');
|
|
24
|
-
require('./chunk-
|
|
25
|
-
require('./chunk-OA3AN6WW.cjs');
|
|
26
|
-
require('./chunk-FK7MBD5H.cjs');
|
|
24
|
+
require('./chunk-HWZT24TD.cjs');
|
|
27
25
|
require('./chunk-4ONPEVTP.cjs');
|
|
28
26
|
require('./chunk-V3KLUWQQ.cjs');
|
|
27
|
+
require('./chunk-OA3AN6WW.cjs');
|
|
28
|
+
require('./chunk-FK7MBD5H.cjs');
|
|
29
29
|
require('./chunk-3RAW2ZH5.cjs');
|
|
30
30
|
require('./chunk-ETMSINQS.cjs');
|
|
31
31
|
require('./chunk-OUYBYZ7Y.cjs');
|
|
@@ -48,7 +48,7 @@ require('./chunk-SK6HQ46Q.cjs');
|
|
|
48
48
|
require('./chunk-MNIQDXM6.cjs');
|
|
49
49
|
require('./chunk-T6WA6S5T.cjs');
|
|
50
50
|
require('./chunk-TG2GM7WJ.cjs');
|
|
51
|
-
require('./chunk-
|
|
51
|
+
require('./chunk-LH3PDPJP.cjs');
|
|
52
52
|
require('./chunk-OEJQFPWO.cjs');
|
|
53
53
|
require('./chunk-7D4WXUBS.cjs');
|
|
54
54
|
require('./chunk-EVZH6Z5O.cjs');
|
|
@@ -233,11 +233,11 @@ function FilesViewerDialog({ artifactRuntimeUrl, ...props }) {
|
|
|
233
233
|
DocumentViewerDialog,
|
|
234
234
|
{
|
|
235
235
|
...props,
|
|
236
|
-
renderDocument: (id) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
236
|
+
renderDocument: (id) => /* @__PURE__ */ jsxRuntime.jsx(chunkN2OVF6SJ_cjs.ConnectedDocumentViewer, { documentId: id, artifactRuntimeUrl })
|
|
237
237
|
}
|
|
238
238
|
);
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
exports.FilesViewerDialog = FilesViewerDialog;
|
|
242
|
-
//# sourceMappingURL=FilesViewerDialog-
|
|
243
|
-
//# sourceMappingURL=FilesViewerDialog-
|
|
242
|
+
//# sourceMappingURL=FilesViewerDialog-FFPW7TIK.cjs.map
|
|
243
|
+
//# sourceMappingURL=FilesViewerDialog-FFPW7TIK.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/viewer/DocumentViewerDialog.tsx","../src/connection/files/page/FilesViewerDialog.tsx"],"names":["jsx","Eye","PenLine","MessageSquareText","DEFAULT_DOCUMENT_VIEWER_TABS","DEFAULT_ASK_SUGGESTIONS","DEFAULT_DOCUMENT_VIEWER_LABELS","useConnectedWorkspace","useArbiSessionStore","useBlocksEnvironment","useArbiSessionState","useDocuments","parseVersionRef","tab","useState","question","useRef","useSlashField","Dialog","jsxs","DialogContent","DialogHeader","DialogTitle","FileText","DialogDescription","SegmentedControl","ErrorBoundary","DocumentReview","AskBar","ConnectedDocumentViewer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAM,UAAU,CAAC,GAAA,KACf,KAAK,YAAA,EAAc,KAAA,IAAS,KAAK,SAAA,IAAa,UAAA;AAEhD,IAAM,SAAA,GAAkD;AAAA,EACtD,MAAA,kBAAQA,cAAA,CAACC,eAAA,EAAA,EAAI,SAAA,EAAU,QAAA,EAAS,CAAA;AAAA,EAChC,QAAA,kBAAUD,cAAA,CAACE,mBAAA,EAAA,EAAQ,SAAA,EAAU,QAAA,EAAS,CAAA;AAAA,EACtC,GAAA,kBAAKF,cAAA,CAACG,6BAAA,EAAA,EAAkB,SAA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J;ACnLO,SAAS,iBAAA,CAAkB,EAAE,kBAAA,EAAoB,GAAG,OAAM,EAA2B;AAC1F,EAAA,uBACE5B,cAAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,cAAA,EAAgB,CAAC,EAAA,qBACfA,eAAC6B,yCAAA,EAAA,EAAwB,UAAA,EAAY,IAAI,kBAAA,EAAwC;AAAA;AAAA,GAErF;AAEJ","file":"FilesViewerDialog-VJYQ7XZA.cjs","sourcesContent":["/**\n * The document viewer as a dialog (the files page's own viewer): a title, the tabs\n * the host offers, and under them the review (`DocumentReview`), the whole viewer, or a question\n * (`AskBar`) that starts a thread about the document. Views of existing parts, not a new viewer.\n *\n * A draft started with Create New (the session's `draftDocuments`) has no server record yet: it\n * shows the whole viewer only (its kind, name and recorder), titled from the draft.\n */\n\nimport { useRef, useState, type ReactNode } from 'react'\nimport { Eye, FileText, MessageSquareText, PenLine } from 'lucide-react'\nimport {\n DocumentReview,\n useArbiSessionState,\n useArbiSessionStore,\n useDocuments,\n type WorkspaceDocument,\n} from '@arbidocs/react'\nimport { parseVersionRef } from '@arbidocs/react/artifacts'\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '@arbidocs/react/ui'\nimport { AskBar } from '../../components/AskBar'\nimport { ErrorBoundary } from '../../components/ErrorBoundary'\nimport { SegmentedControl, type SegmentedOption } from '../../settings/SegmentedControl'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useSlashField } from '../ask/useSlashField'\nimport {\n DEFAULT_ASK_SUGGESTIONS,\n DEFAULT_DOCUMENT_VIEWER_LABELS,\n DEFAULT_DOCUMENT_VIEWER_TABS,\n type DocumentViewerDialogLabels,\n type DocumentViewerTab,\n} from './documentViewerTabs'\n\ntype ReviewDocument = Parameters<typeof DocumentReview>[0]['doc']\n\nexport interface DocumentViewerDialogProps {\n /** The document, or a version reference `doc-…@v{n}`. */\n documentId: string\n /** The views offered, in order. Default: review, document, ask. */\n tabs?: readonly DocumentViewerTab[]\n /** The view it opens on. Default: the first offered. */\n initialTab?: DocumentViewerTab\n labels?: DocumentViewerDialogLabels\n /** The ask view's suggested questions. */\n askSuggestions?: readonly string[]\n onClose: () => void\n /** The whole viewer, for the document view. */\n renderDocument: (documentId: string) => ReactNode\n}\n\nconst titleOf = (doc: WorkspaceDocument | undefined) =>\n doc?.doc_metadata?.title || doc?.file_name || 'Document'\n\nconst TAB_ICONS: Record<DocumentViewerTab, ReactNode> = {\n review: <Eye className=\"size-4\" />,\n document: <PenLine className=\"size-4\" />,\n ask: <MessageSquareText className=\"size-4\" />,\n}\n\nconst TAB_TEST_IDS: Record<DocumentViewerTab, string> = {\n review: 'review-tab-review',\n document: 'review-tab-pdf',\n ask: 'review-tab-qa',\n}\n\nexport function DocumentViewerDialog({\n documentId,\n tabs = DEFAULT_DOCUMENT_VIEWER_TABS,\n initialTab,\n labels: labelOverrides,\n askSuggestions = DEFAULT_ASK_SUGGESTIONS,\n onClose,\n renderDocument,\n}: DocumentViewerDialogProps) {\n const labels = { ...DEFAULT_DOCUMENT_VIEWER_LABELS, ...labelOverrides }\n const { workspaceId, live } = useConnectedWorkspace()\n const session = useArbiSessionStore()\n const { openNewConversation } = useBlocksEnvironment()\n const passageId = useArbiSessionState((s) => s.viewingDocument?.passageId ?? null)\n const draft = useArbiSessionState((s) => s.draftDocuments[documentId])\n const { data: documents } = useDocuments()\n const baseId = parseVersionRef(documentId).docId\n const doc = documents?.find((d) => d.external_id === baseId)\n const title = draft?.title || titleOf(doc)\n\n // The whole viewer needs a signed-in session (marking up, signing, versions). A draft is only\n // on the client: there is nothing to review or ask about until it is saved.\n const offered: readonly DocumentViewerTab[] = draft\n ? ['document']\n : tabs.filter((tab) => tab !== 'document' || live)\n const [chosen, setChosen] = useState<DocumentViewerTab | undefined>(initialTab)\n const tab = chosen && offered.includes(chosen) ? chosen : offered[0]\n\n const options: SegmentedOption<DocumentViewerTab>[] = offered.map((value) => ({\n value,\n label: labels[value],\n icon: TAB_ICONS[value],\n testId: TAB_TEST_IDS[value],\n }))\n\n // A question opens a new thread about the document, as the viewer's \"Chat\" does.\n const ask = (question: string) => {\n openNewConversation({ prompt: question })\n session.setNewChatDocumentId(baseId)\n }\n // The `/` menu: a skill's run is asked the same way, so its thread is about this document too.\n const [question, setQuestion] = useState('')\n const askInputRef = useRef<HTMLInputElement>(null)\n const slash = useSlashField({\n text: question,\n setText: setQuestion,\n inputRef: askInputRef,\n landing: 'chat',\n send: ask,\n })\n\n return (\n <Dialog open onOpenChange={(open) => !open && onClose()}>\n <DialogContent\n className=\"flex h-[90vh] max-w-[95vw] flex-col gap-0 p-0 sm:max-w-[95vw]\"\n data-testid=\"documents-dialog\"\n >\n <DialogHeader className=\"border-b px-4 py-3\">\n <DialogTitle className=\"flex min-w-0 items-center gap-2 pr-8 text-base\">\n <FileText className=\"size-4 shrink-0\" />\n <span className=\"truncate\" data-testid=\"documents-dialog-title\">\n {title}\n </span>\n </DialogTitle>\n <DialogDescription className=\"sr-only\">\n {offered.map((value) => labels[value]).join(', ')}: {title}\n </DialogDescription>\n {options.length > 1 && tab && (\n <SegmentedControl\n ariaLabel=\"Document view\"\n // A phone fits the three on one row: no label breaks over two lines.\n className=\"mt-2 w-fit max-w-full overflow-x-auto [&_button]:whitespace-nowrap max-sm:[&_button]:px-2.5\"\n value={tab}\n onChange={setChosen}\n options={options}\n />\n )}\n </DialogHeader>\n <div className=\"min-h-0 flex-1 overflow-hidden p-3\">\n {/* A view that fails to render says so here: the dialog and the page under it stay. */}\n <ErrorBoundary\n resetKey={`${documentId}|${tab}`}\n labels={{ title: \"This document couldn't be displayed\" }}\n testId=\"documents-dialog-error\"\n >\n {tab === 'review' && (\n <DocumentReview\n docId={baseId}\n doc={doc as ReviewDocument}\n workspaceId={workspaceId ?? undefined}\n activeChunkId={passageId}\n />\n )}\n {tab === 'document' && (\n <div className=\"h-full overflow-hidden\" data-testid=\"documents-dialog-viewer\">\n {renderDocument(documentId)}\n </div>\n )}\n {tab === 'ask' && (\n <div className=\"mx-auto max-w-2xl space-y-3 pt-6\" data-testid=\"doc-qa-panel\">\n <p className=\"text-sm text-muted-foreground\">{labels.askIntro}</p>\n {slash.launcher}\n <AskBar\n testId=\"doc-ask\"\n placeholder={labels.askPlaceholder.replace('{title}', title)}\n suggestions={[...askSuggestions]}\n onAsk={(text) => {\n if (!slash.startsSkill(text)) ask(text)\n }}\n value={question}\n onValueChange={setQuestion}\n onInputKeyDown={slash.onKeyDown}\n inputProps={slash.comboboxProps}\n inputRef={askInputRef}\n menu={slash.menu}\n />\n </div>\n )}\n </ErrorBoundary>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n","/**\n * The files page's own viewer (a page without a host viewer): `DocumentViewerDialog`, with the\n * whole `ConnectedDocumentViewer` as its document view. The page lazy-loads this module, so the\n * viewer stays out of the page's chunk.\n */\nimport { ConnectedDocumentViewer } from '../../viewer/ConnectedDocumentViewer'\nimport {\n DocumentViewerDialog,\n type DocumentViewerDialogProps,\n} from '../../viewer/DocumentViewerDialog'\n\nexport interface FilesViewerDialogProps extends Omit<DocumentViewerDialogProps, 'renderDocument'> {\n /** Where html/react artifacts load their sandbox runtime from. */\n artifactRuntimeUrl?: string\n}\n\nexport function FilesViewerDialog({ artifactRuntimeUrl, ...props }: FilesViewerDialogProps) {\n return (\n <DocumentViewerDialog\n {...props}\n renderDocument={(id) => (\n <ConnectedDocumentViewer documentId={id} artifactRuntimeUrl={artifactRuntimeUrl} />\n )}\n />\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/viewer/DocumentViewerDialog.tsx","../src/connection/files/page/FilesViewerDialog.tsx"],"names":["jsx","Eye","PenLine","MessageSquareText","DEFAULT_DOCUMENT_VIEWER_TABS","DEFAULT_ASK_SUGGESTIONS","DEFAULT_DOCUMENT_VIEWER_LABELS","useConnectedWorkspace","useArbiSessionStore","useBlocksEnvironment","useArbiSessionState","useDocuments","parseVersionRef","tab","useState","question","useRef","useSlashField","Dialog","jsxs","DialogContent","DialogHeader","DialogTitle","FileText","DialogDescription","SegmentedControl","ErrorBoundary","DocumentReview","AskBar","ConnectedDocumentViewer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAM,UAAU,CAAC,GAAA,KACf,KAAK,YAAA,EAAc,KAAA,IAAS,KAAK,SAAA,IAAa,UAAA;AAEhD,IAAM,SAAA,GAAkD;AAAA,EACtD,MAAA,kBAAQA,cAAA,CAACC,eAAA,EAAA,EAAI,SAAA,EAAU,QAAA,EAAS,CAAA;AAAA,EAChC,QAAA,kBAAUD,cAAA,CAACE,mBAAA,EAAA,EAAQ,SAAA,EAAU,QAAA,EAAS,CAAA;AAAA,EACtC,GAAA,kBAAKF,cAAA,CAACG,6BAAA,EAAA,EAAkB,SAAA,EAAU,QAAA,EAAS;AAC7C,CAAA;AAEA,IAAM,YAAA,GAAkD;AAAA,EACtD,MAAA,EAAQ,mBAAA;AAAA,EACR,QAAA,EAAU,gBAAA;AAAA,EACV,GAAA,EAAK;AACP,CAAA;AAEO,SAAS,oBAAA,CAAqB;AAAA,EACnC,UAAA;AAAA,EACA,IAAA,GAAOC,8CAAA;AAAA,EACP,UAAA;AAAA,EACA,MAAA,EAAQ,cAAA;AAAA,EACR,cAAA,GAAiBC,yCAAA;AAAA,EACjB,OAAA;AAAA,EACA;AACF,CAAA,EAA8B;AAC5B,EAAA,MAAM,MAAA,GAAS,EAAE,GAAGC,gDAAA,EAAgC,GAAG,cAAA,EAAe;AACtE,EAAA,MAAM,EAAE,WAAA,EAAa,IAAA,EAAK,GAAIC,uCAAA,EAAsB;AACpD,EAAA,MAAM,UAAUC,yBAAA,EAAoB;AACpC,EAAA,MAAM,EAAE,mBAAA,EAAoB,GAAI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,gCACPA,cAAA;AAAA,kBAAC4B,wBAAA;AAAA,kBAAA;AAAA,oBACC,MAAA,EAAO,SAAA;AAAA,oBACP,WAAA,EAAa,MAAA,CAAO,cAAA,CAAe,OAAA,CAAQ,WAAW,KAAK,CAAA;AAAA,oBAC3D,WAAA,EAAa,CAAC,GAAG,cAAc,CAAA;AAAA,oBAC/B,KAAA,EAAO,CAAC,IAAA,KAAS;AACf,sBAAA,IAAI,CAAC,KAAA,CAAM,WAAA,CAAY,IAAI,CAAA,MAAO,IAAI,CAAA;AAAA,oBACxC,CAAA;AAAA,oBACA,KAAA,EAAO,QAAA;AAAA,oBACP,aAAA,EAAe,WAAA;AAAA,oBACf,gBAAgB,KAAA,CAAM,SAAA;AAAA,oBACtB,YAAY,KAAA,CAAM,aAAA;AAAA,oBAClB,QAAA,EAAU,WAAA;AAAA,oBACV,MAAM,KAAA,CAAM;AAAA;AAAA;AACd,eAAA,EACF;AAAA;AAAA;AAAA,SAEJ,EACF;AAAA;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;ACnLO,SAAS,iBAAA,CAAkB,EAAE,kBAAA,EAAoB,GAAG,OAAM,EAA2B;AAC1F,EAAA,uBACE5B,cAAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,cAAA,EAAgB,CAAC,EAAA,qBACfA,eAAC6B,yCAAA,EAAA,EAAwB,UAAA,EAAY,IAAI,kBAAA,EAAwC;AAAA;AAAA,GAErF;AAEJ","file":"FilesViewerDialog-FFPW7TIK.cjs","sourcesContent":["/**\n * The document viewer as a dialog (the files page's own viewer): a title, the tabs\n * the host offers, and under them the review (`DocumentReview`), the whole viewer, or a question\n * (`AskBar`) that starts a thread about the document. Views of existing parts, not a new viewer.\n *\n * A draft started with Create New (the session's `draftDocuments`) has no server record yet: it\n * shows the whole viewer only (its kind, name and recorder), titled from the draft.\n */\n\nimport { useRef, useState, type ReactNode } from 'react'\nimport { Eye, FileText, MessageSquareText, PenLine } from 'lucide-react'\nimport {\n DocumentReview,\n useArbiSessionState,\n useArbiSessionStore,\n useDocuments,\n type WorkspaceDocument,\n} from '@arbidocs/react'\nimport { parseVersionRef } from '@arbidocs/react/artifacts'\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '@arbidocs/react/ui'\nimport { AskBar } from '../../components/AskBar'\nimport { ErrorBoundary } from '../../components/ErrorBoundary'\nimport { SegmentedControl, type SegmentedOption } from '../../settings/SegmentedControl'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useSlashField } from '../ask/useSlashField'\nimport {\n DEFAULT_ASK_SUGGESTIONS,\n DEFAULT_DOCUMENT_VIEWER_LABELS,\n DEFAULT_DOCUMENT_VIEWER_TABS,\n type DocumentViewerDialogLabels,\n type DocumentViewerTab,\n} from './documentViewerTabs'\n\ntype ReviewDocument = Parameters<typeof DocumentReview>[0]['doc']\n\nexport interface DocumentViewerDialogProps {\n /** The document, or a version reference `doc-…@v{n}`. */\n documentId: string\n /** The views offered, in order. Default: review, document, ask. */\n tabs?: readonly DocumentViewerTab[]\n /** The view it opens on. Default: the first offered. */\n initialTab?: DocumentViewerTab\n labels?: DocumentViewerDialogLabels\n /** The ask view's suggested questions. */\n askSuggestions?: readonly string[]\n onClose: () => void\n /** The whole viewer, for the document view. */\n renderDocument: (documentId: string) => ReactNode\n}\n\nconst titleOf = (doc: WorkspaceDocument | undefined) =>\n doc?.doc_metadata?.title || doc?.file_name || 'Document'\n\nconst TAB_ICONS: Record<DocumentViewerTab, ReactNode> = {\n review: <Eye className=\"size-4\" />,\n document: <PenLine className=\"size-4\" />,\n ask: <MessageSquareText className=\"size-4\" />,\n}\n\nconst TAB_TEST_IDS: Record<DocumentViewerTab, string> = {\n review: 'review-tab-review',\n document: 'review-tab-pdf',\n ask: 'review-tab-qa',\n}\n\nexport function DocumentViewerDialog({\n documentId,\n tabs = DEFAULT_DOCUMENT_VIEWER_TABS,\n initialTab,\n labels: labelOverrides,\n askSuggestions = DEFAULT_ASK_SUGGESTIONS,\n onClose,\n renderDocument,\n}: DocumentViewerDialogProps) {\n const labels = { ...DEFAULT_DOCUMENT_VIEWER_LABELS, ...labelOverrides }\n const { workspaceId, live } = useConnectedWorkspace()\n const session = useArbiSessionStore()\n const { openNewConversation } = useBlocksEnvironment()\n const passageId = useArbiSessionState((s) => s.viewingDocument?.passageId ?? null)\n const draft = useArbiSessionState((s) => s.draftDocuments[documentId])\n const { data: documents } = useDocuments()\n const baseId = parseVersionRef(documentId).docId\n const doc = documents?.find((d) => d.external_id === baseId)\n const title = draft?.title || titleOf(doc)\n\n // The whole viewer needs a signed-in session (marking up, signing, versions). A draft is only\n // on the client: there is nothing to review or ask about until it is saved.\n const offered: readonly DocumentViewerTab[] = draft\n ? ['document']\n : tabs.filter((tab) => tab !== 'document' || live)\n const [chosen, setChosen] = useState<DocumentViewerTab | undefined>(initialTab)\n const tab = chosen && offered.includes(chosen) ? chosen : offered[0]\n\n const options: SegmentedOption<DocumentViewerTab>[] = offered.map((value) => ({\n value,\n label: labels[value],\n icon: TAB_ICONS[value],\n testId: TAB_TEST_IDS[value],\n }))\n\n // A question opens a new thread about the document, as the viewer's \"Chat\" does.\n const ask = (question: string) => {\n openNewConversation({ prompt: question })\n session.setNewChatDocumentId(baseId)\n }\n // The `/` menu: a skill's run is asked the same way, so its thread is about this document too.\n const [question, setQuestion] = useState('')\n const askInputRef = useRef<HTMLInputElement>(null)\n const slash = useSlashField({\n text: question,\n setText: setQuestion,\n inputRef: askInputRef,\n landing: 'chat',\n send: ask,\n })\n\n return (\n <Dialog open onOpenChange={(open) => !open && onClose()}>\n <DialogContent\n className=\"flex h-[90vh] max-w-[95vw] flex-col gap-0 p-0 sm:max-w-[95vw]\"\n data-testid=\"documents-dialog\"\n >\n <DialogHeader className=\"border-b px-4 py-3\">\n <DialogTitle className=\"flex min-w-0 items-center gap-2 pr-8 text-base\">\n <FileText className=\"size-4 shrink-0\" />\n <span className=\"truncate\" data-testid=\"documents-dialog-title\">\n {title}\n </span>\n </DialogTitle>\n <DialogDescription className=\"sr-only\">\n {offered.map((value) => labels[value]).join(', ')}: {title}\n </DialogDescription>\n {options.length > 1 && tab && (\n <SegmentedControl\n ariaLabel=\"Document view\"\n // A phone fits the three on one row: no label breaks over two lines.\n className=\"mt-2 w-fit max-w-full overflow-x-auto [&_button]:whitespace-nowrap max-sm:[&_button]:px-2.5\"\n value={tab}\n onChange={setChosen}\n options={options}\n />\n )}\n </DialogHeader>\n <div className=\"min-h-0 flex-1 overflow-hidden p-3\">\n {/* A view that fails to render says so here: the dialog and the page under it stay. */}\n <ErrorBoundary\n resetKey={`${documentId}|${tab}`}\n labels={{ title: \"This document couldn't be displayed\" }}\n testId=\"documents-dialog-error\"\n >\n {tab === 'review' && (\n <DocumentReview\n docId={baseId}\n doc={doc as ReviewDocument}\n workspaceId={workspaceId ?? undefined}\n activeChunkId={passageId}\n />\n )}\n {tab === 'document' && (\n <div className=\"h-full overflow-hidden\" data-testid=\"documents-dialog-viewer\">\n {renderDocument(documentId)}\n </div>\n )}\n {tab === 'ask' && (\n <div className=\"mx-auto max-w-2xl space-y-3 pt-6\" data-testid=\"doc-qa-panel\">\n <p className=\"text-sm text-muted-foreground\">{labels.askIntro}</p>\n {slash.launcher}\n <AskBar\n testId=\"doc-ask\"\n placeholder={labels.askPlaceholder.replace('{title}', title)}\n suggestions={[...askSuggestions]}\n onAsk={(text) => {\n if (!slash.startsSkill(text)) ask(text)\n }}\n value={question}\n onValueChange={setQuestion}\n onInputKeyDown={slash.onKeyDown}\n inputProps={slash.comboboxProps}\n inputRef={askInputRef}\n menu={slash.menu}\n />\n </div>\n )}\n </ErrorBoundary>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n","/**\n * The files page's own viewer (a page without a host viewer): `DocumentViewerDialog`, with the\n * whole `ConnectedDocumentViewer` as its document view. The page lazy-loads this module, so the\n * viewer stays out of the page's chunk.\n */\nimport { ConnectedDocumentViewer } from '../../viewer/ConnectedDocumentViewer'\nimport {\n DocumentViewerDialog,\n type DocumentViewerDialogProps,\n} from '../../viewer/DocumentViewerDialog'\n\nexport interface FilesViewerDialogProps extends Omit<DocumentViewerDialogProps, 'renderDocument'> {\n /** Where html/react artifacts load their sandbox runtime from. */\n artifactRuntimeUrl?: string\n}\n\nexport function FilesViewerDialog({ artifactRuntimeUrl, ...props }: FilesViewerDialogProps) {\n return (\n <DocumentViewerDialog\n {...props}\n renderDocument={(id) => (\n <ConnectedDocumentViewer documentId={id} artifactRuntimeUrl={artifactRuntimeUrl} />\n )}\n />\n )\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkBD7P4KYQ_cjs = require('./chunk-BD7P4KYQ.cjs');
|
|
5
5
|
require('./chunk-GA5ZO4YA.cjs');
|
|
6
6
|
require('./chunk-VG5XNE4H.cjs');
|
|
7
7
|
require('./chunk-DDWLMYRO.cjs');
|
|
@@ -17,19 +17,19 @@ require('./chunk-PLIF5CUV.cjs');
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "DocxParticipants", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkBD7P4KYQ_cjs.DocxParticipants; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "DocxRibbon", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkBD7P4KYQ_cjs.DocxRibbon; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "NativeDocxEditor", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkBD7P4KYQ_cjs.NativeDocxEditor; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "contentPath", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function () { return chunkV3KLUWQQ_cjs.contentPath; }
|
|
33
33
|
});
|
|
34
|
-
//# sourceMappingURL=NativeDocxEditor-
|
|
35
|
-
//# sourceMappingURL=NativeDocxEditor-
|
|
34
|
+
//# sourceMappingURL=NativeDocxEditor-R2OKJLRY.cjs.map
|
|
35
|
+
//# sourceMappingURL=NativeDocxEditor-R2OKJLRY.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"NativeDocxEditor-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"NativeDocxEditor-R2OKJLRY.cjs"}
|
|
@@ -5000,6 +5000,7 @@ function TableTabKeys({ scope }) {
|
|
|
5000
5000
|
}, [scope]);
|
|
5001
5001
|
return null;
|
|
5002
5002
|
}
|
|
5003
|
+
var VERSION_REFUSAL_ERROR = "The editor and collaboration server need matching versions. Download your DOCX before reloading to preserve any local edits.";
|
|
5003
5004
|
var drafts = /* @__PURE__ */ new Map();
|
|
5004
5005
|
var pendingRecoveryWrites = /* @__PURE__ */ new Map();
|
|
5005
5006
|
var failedRecoveryWrites = /* @__PURE__ */ new Set();
|
|
@@ -5483,9 +5484,7 @@ function NativeDocxEditor({
|
|
|
5483
5484
|
setOffline(disconnected);
|
|
5484
5485
|
if (s === "error") {
|
|
5485
5486
|
if (coedit.formatRefusal(detail)) {
|
|
5486
|
-
setError(
|
|
5487
|
-
"The editor and collaboration server need matching versions. Download your DOCX before reloading to preserve any local edits."
|
|
5488
|
-
);
|
|
5487
|
+
setError(VERSION_REFUSAL_ERROR);
|
|
5489
5488
|
setStatus("Update required");
|
|
5490
5489
|
return;
|
|
5491
5490
|
}
|
|
@@ -5992,7 +5991,7 @@ function NativeDocxEditor({
|
|
|
5992
5991
|
if (previous) await recovery.store.remove(recovery.workspaceId, documentId, previous);
|
|
5993
5992
|
} catch {
|
|
5994
5993
|
setError(
|
|
5995
|
-
"A local recovery copy could not be saved. Keep this editor open or download your DOCX."
|
|
5994
|
+
(current) => current === VERSION_REFUSAL_ERROR ? current : "A local recovery copy could not be saved. Keep this editor open or download your DOCX."
|
|
5996
5995
|
);
|
|
5997
5996
|
}
|
|
5998
5997
|
})();
|
|
@@ -6336,5 +6335,5 @@ exports.useDefinedTerms = useDefinedTerms;
|
|
|
6336
6335
|
exports.useReview = useReview;
|
|
6337
6336
|
exports.useReviewItem = useReviewItem;
|
|
6338
6337
|
exports.withDirectEditing = withDirectEditing;
|
|
6339
|
-
//# sourceMappingURL=chunk-
|
|
6340
|
-
//# sourceMappingURL=chunk-
|
|
6338
|
+
//# sourceMappingURL=chunk-BD7P4KYQ.cjs.map
|
|
6339
|
+
//# sourceMappingURL=chunk-BD7P4KYQ.cjs.map
|