@arbidocs/react 0.4.144 → 0.4.145
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/artifacts/index.cjs +11 -14
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.d.cts +1 -3
- package/dist/artifacts/index.d.ts +1 -3
- package/dist/artifacts/index.js +7 -10
- package/dist/artifacts/index.js.map +1 -1
- package/dist/{chunk-CVJ25DFD.cjs → chunk-CG6USBJX.cjs} +492 -11
- package/dist/chunk-CG6USBJX.cjs.map +1 -0
- package/dist/chunk-MUYBFDYJ.js +859 -0
- package/dist/chunk-MUYBFDYJ.js.map +1 -0
- package/dist/index.cjs +630 -327
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +644 -177
- package/dist/index.d.ts +644 -177
- package/dist/index.js +323 -157
- package/dist/index.js.map +1 -1
- package/dist/ui/index.cjs +9 -9
- package/dist/ui/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-CVJ25DFD.cjs.map +0 -1
- package/dist/chunk-E4VILXG5.js +0 -411
- package/dist/chunk-E4VILXG5.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { arbiMutationKeys, arbiQueryKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-
|
|
2
|
-
export { PROJECT_CREATION_DENIED_REASON, arbiMutationKeys, arbiQueryKeys, isUsageMetered, useActivity, useAgents, useAssistantQuery, useCanCreateProjects, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocuments, useFirmPool, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useTags, useThumbnails, useTopUpFirmPool, useUserUsageToday, useWorkspaceActivity, useWorkspaceUsers, useWorkspaces } from './chunk-
|
|
3
|
-
import { formatRelativeTime } from './chunk-MFMJHBJR.js';
|
|
4
|
-
export { DEFAULT_NOTIFY_TONE, MAX_SESSION_NOTIFICATIONS, NotificationBell, Toaster, configureNotify, formatRelativeTime, notify, persistNotifyHistory, seedNotifications, selectUnread, toast, useNotify } from './chunk-MFMJHBJR.js';
|
|
1
|
+
import { arbiMutationKeys, replayableTagMutations, patchDocuments, setCachedDocument, adjustTagCounts, arbiQueryKeys, patchCachedDocument, useDocuments, useConversations, useAssistantQuery, useConversationThreads, refreshDocuments, FINISHED_DOCUMENT_STATUSES, useWorkspaces, forgetDocuments, getCachedDocuments, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-MUYBFDYJ.js';
|
|
2
|
+
export { DOCUMENTS_FIRST_PAGE_MEASURE, DOCUMENTS_FIRST_PAGE_SIZE, DOCUMENTS_PAGE_SIZE, FINISHED_DOCUMENT_STATUSES, PROJECT_CREATION_DENIED_REASON, SIMILARITY_THRESHOLD, adjustTagCounts, arbiMutationKeys, arbiQueryKeys, forgetDocuments, getCachedDocuments, invalidateTagData, invalidateTagTables, isDocumentsLoading, isUsageMetered, patchCachedDocument, patchDocuments, patchWorkspaceTags, refreshDocuments, setCachedDocument, stopDocumentsLoading, subscribeDocumentRows, upsertDocuments, useActivity, useAgents, useAssistantQuery, useAvailableModels, useCanCreateProjects, useConfigs, useConversationThreads, useConversations, useCreateTag, useCurrentUser, useDeleteAgents, useDeleteTag, useDocument, useDocumentVersionList, useDocuments, useDocumentsById, useDocumentsLoading, useExtractEntities, useFirmPool, useHealth, useInvalidateTagData, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSetTagValues, useSimilarDocuments, useTagKindSchema, useTags, useThumbnails, useTopUpFirmPool, useUpdateTag, useUpdateTagKindSchema, useUserUsageToday, useWorkspaceActivity, useWorkspaceUsers, useWorkspaces } from './chunk-MUYBFDYJ.js';
|
|
5
3
|
import { downloadBlob } from './chunk-YYTX3W6C.js';
|
|
6
4
|
import { parseVersionRef } from './chunk-NNWMHMEC.js';
|
|
7
5
|
export { cleanDraftMarkdown, cleanDraftWithReport, promoteBoldTitle, repairParsedStructure, repairParsedTitle, stripAgentPreamble, unescapeMarkdown, unwrapCitationLinks } from './chunk-NNWMHMEC.js';
|
|
8
6
|
import './chunk-WUTL62MC.js';
|
|
7
|
+
import { formatRelativeTime } from './chunk-MFMJHBJR.js';
|
|
8
|
+
export { DEFAULT_NOTIFY_TONE, MAX_SESSION_NOTIFICATIONS, NotificationBell, Toaster, configureNotify, formatRelativeTime, notify, persistNotifyHistory, seedNotifications, selectUnread, toast, useNotify } from './chunk-MFMJHBJR.js';
|
|
9
9
|
import { returnFocusToMark, MarkMenu, AiMarkdown, Card, Badge, TagEntity, Input, FILE_TYPE_COLORS, getEntityIcon, UserEntity, getEntityColorStyles, AgentBadge, Textarea, Label, Slider, DocumentEntity, DocumentCard, useAudioRecorder, MicWaveformIndicator, IconToggle, classifyMediaError, formatElapsed, PassageCard } from './chunk-J3BYHBKW.js';
|
|
10
10
|
export { AUDIO_MIME_PREFERENCE, AgentBadge, AiMarkdown, ArbiBotHeadIcon, ArbiIcon, AudIcon, Avatar, AvatarFallback, AvatarImage, BASE_COLORS, Badge, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_SEGMENTER_CONFIG, DebouncedInput, DictateProvider, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, INITIAL_SEGMENTER_STATE, IconToggle, ImgIcon, InlineMicButton, Input, Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY, PLACEHOLDER_COLOR, PassageCard, PdfIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, RadioGroup, RadioGroupItem, RagDot, RelevanceDot, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, ShieldIcon, Slider, StatusPill, Switch, TAG_TYPE_ICONS, TAG_TYPE_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagEntity, Textarea, ThreadVisibilityIcon, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TxtIcon, UserEntity, UserMenu, VIDEO_MIME_PREFERENCE, VISIBILITY_ICONS, VerifiedBadge, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, agentAvatarColors, badgeVariants, cardVariants, classifyMediaError, configureEntityRegistry, configureRagLabels, configureStatusRegistry, createChunkedRecorder, flushSegmenter, formatElapsed, getDocIcon, getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, levelFromRms, pickRecorderMimeType, stepSegmenter, toggleVariants, useAudioRecorder } from './chunk-J3BYHBKW.js';
|
|
11
11
|
import { MarkdownRenderer } from './chunk-C44GO33B.js';
|
|
12
12
|
export { MarkdownCode, MarkdownLink, MarkdownRenderer, MarkdownStreamingContext, markdownBaseComponents, markdownSanitizeSchema, splitMarkdownBlocks } from './chunk-C44GO33B.js';
|
|
13
|
-
import { ScrollArea } from './chunk-W4H6XAIU.js';
|
|
14
|
-
export { ScrollArea, ScrollBar } from './chunk-W4H6XAIU.js';
|
|
15
13
|
import { Button, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from './chunk-YNNAJJ5Z.js';
|
|
16
14
|
export { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, buttonVariants } from './chunk-YNNAJJ5Z.js';
|
|
17
15
|
import { normalizeCitationMarkup } from './chunk-QRCMKEE6.js';
|
|
18
16
|
export { closeOpenEmphasis, normalizeCitationMarkup, trimOpenCitation } from './chunk-QRCMKEE6.js';
|
|
17
|
+
import { ScrollArea } from './chunk-W4H6XAIU.js';
|
|
18
|
+
export { ScrollArea, ScrollBar } from './chunk-W4H6XAIU.js';
|
|
19
19
|
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from './chunk-47CCGUWR.js';
|
|
20
20
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, PortalContainerProvider, usePortalContainer } from './chunk-47CCGUWR.js';
|
|
21
21
|
import { cn } from './chunk-SN5YV6FF.js';
|
|
@@ -24,8 +24,8 @@ import { AudioViewer, ImageViewer, VideoViewer } from './chunk-HDCRPPBW.js';
|
|
|
24
24
|
import { useArbi, ArbiContext } from './chunk-CPPBN2JB.js';
|
|
25
25
|
export { ArbiProvider, useArbi, useDeploymentDomain } from './chunk-CPPBN2JB.js';
|
|
26
26
|
import React, { memo, useState, createContext, useMemo, useCallback, useEffect, useRef, useLayoutEffect, useContext, useId, useSyncExternalStore, Fragment as Fragment$1 } from 'react';
|
|
27
|
-
import { useQueryClient, useMutation, useQuery,
|
|
28
|
-
import {
|
|
27
|
+
import { useQueryClient, useMutation, useQuery, onlineManager, partialMatchKey } from '@tanstack/react-query';
|
|
28
|
+
import { documents, doctags, houseTemplates, resolveCitations, summarizeCitations, settings, ArbiApiError, ACCOUNT_VENDOR, formatFileSize, connectWithReconnect, chats, identityErrorCode } from '@arbidocs/sdk/browser';
|
|
29
29
|
export { ACCOUNT_VENDOR, Arbi, ArbiError, DEFAULT_AI_USD_PER_GBP, PublicBookingError, bookPublicSlot, cancelPublicBooking, formatGbp, formatGbpPerMillionTokens, getPublicBookingPage, splitAppPasswords, usdToGbp } from '@arbidocs/sdk/browser';
|
|
30
30
|
import { Link, Trash2, CheckCheck, Check, Loader2, AlertTriangle, ShieldCheck, Copy, Sparkles, FileText, GitCompareArrows, Download, Search, CornerDownLeft, X, ArrowLeft, Send, Tags, Crown, Info, Activity, HardDrive, Gauge, Gift, PartyPopper, UserPlus, UserCheck, Reply, PenLine, AtSign, MessageCircleMore, FileX2, FileCheck2, Pencil, FolderPlus, SquareArrowOutUpRight, MessagesSquare, Paperclip, ArrowRight, MoreHorizontal, SquarePen, Mic, Pause, Play, Square, RotateCcw, Camera, Circle, Image as Image$1, AppWindow } from 'lucide-react';
|
|
31
31
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -559,7 +559,8 @@ function useArbiChat(options = {}) {
|
|
|
559
559
|
const recoveryIntervalMs = streamRecovery?.intervalMs ?? 3e3;
|
|
560
560
|
const recoveryTimeoutMs = streamRecovery?.timeoutMs ?? 12e4;
|
|
561
561
|
const arbi = useArbi();
|
|
562
|
-
const
|
|
562
|
+
const queryClient = useQueryClient();
|
|
563
|
+
const { data: docs = [], isLoading: isLoadingDocuments } = useDocuments(workspaceId);
|
|
563
564
|
const ordinaryHistory = useConversations(workspaceId, { enabled: !agentId, live: true });
|
|
564
565
|
const agentHistory = useAgentChats(agentId);
|
|
565
566
|
const stored = useMemo(
|
|
@@ -1099,6 +1100,7 @@ function useArbiChat(options = {}) {
|
|
|
1099
1100
|
setIsUploading(true);
|
|
1100
1101
|
setUploadError(null);
|
|
1101
1102
|
try {
|
|
1103
|
+
const uploaded = [];
|
|
1102
1104
|
for (const file of files) {
|
|
1103
1105
|
if (agentId) {
|
|
1104
1106
|
const staged = await arbi.agents.stageFile(agentId, file, file.name);
|
|
@@ -1106,16 +1108,17 @@ function useArbiChat(options = {}) {
|
|
|
1106
1108
|
...all.filter((existing) => existing.id !== staged.path),
|
|
1107
1109
|
{ id: staged.path, name: staged.name }
|
|
1108
1110
|
]);
|
|
1109
|
-
} else
|
|
1111
|
+
} else
|
|
1112
|
+
uploaded.push(...(await arbi.documents.uploadFile(file, file.name)).doc_ext_ids ?? []);
|
|
1110
1113
|
}
|
|
1111
|
-
if (
|
|
1114
|
+
if (uploaded.length) await refreshDocuments(queryClient, arbi, uploaded);
|
|
1112
1115
|
} catch (e) {
|
|
1113
1116
|
setUploadError(messageOf(e, "The upload failed."));
|
|
1114
1117
|
} finally {
|
|
1115
1118
|
setIsUploading(false);
|
|
1116
1119
|
}
|
|
1117
1120
|
},
|
|
1118
|
-
[arbi,
|
|
1121
|
+
[arbi, queryClient, agentId]
|
|
1119
1122
|
);
|
|
1120
1123
|
return {
|
|
1121
1124
|
assistantMode,
|
|
@@ -1403,28 +1406,21 @@ function useArbiWsTasks() {
|
|
|
1403
1406
|
function useArbiWsTask(docId) {
|
|
1404
1407
|
return useArbiWsStore((s) => s.tasks[docId]);
|
|
1405
1408
|
}
|
|
1406
|
-
var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
1407
|
-
"completed",
|
|
1408
|
-
"failed",
|
|
1409
|
-
"skipped",
|
|
1410
|
-
"empty",
|
|
1411
|
-
"low-content"
|
|
1412
|
-
]);
|
|
1413
1409
|
function useArbiDocumentSync(workspaceId) {
|
|
1414
1410
|
const queryClient = useQueryClient();
|
|
1411
|
+
const arbi = useArbi();
|
|
1415
1412
|
useArbiWebSocket((msg) => {
|
|
1416
1413
|
if (!workspaceId) return;
|
|
1417
1414
|
if (isMessageType(msg, "batch_complete")) {
|
|
1418
1415
|
if (msg.workspace_ext_id !== workspaceId) return;
|
|
1419
|
-
void queryClient
|
|
1416
|
+
if (msg.doc_ext_ids?.length) void refreshDocuments(queryClient, arbi, msg.doc_ext_ids);
|
|
1420
1417
|
void queryClient.invalidateQueries({ queryKey: arbiQueryKeys.tags(workspaceId) });
|
|
1421
1418
|
return;
|
|
1422
1419
|
}
|
|
1423
1420
|
if (isMessageType(msg, "task_update")) {
|
|
1424
1421
|
if (msg.workspace_ext_id !== workspaceId) return;
|
|
1425
|
-
if (
|
|
1426
|
-
void queryClient
|
|
1427
|
-
}
|
|
1422
|
+
if (FINISHED_DOCUMENT_STATUSES.has(msg.status))
|
|
1423
|
+
void refreshDocuments(queryClient, arbi, [msg.doc_ext_id]);
|
|
1428
1424
|
}
|
|
1429
1425
|
});
|
|
1430
1426
|
}
|
|
@@ -1619,143 +1615,291 @@ function useSearchFacts() {
|
|
|
1619
1615
|
mutationFn: (body) => arbi.facts.search(body)
|
|
1620
1616
|
});
|
|
1621
1617
|
}
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
if (!current) return;
|
|
1629
|
-
const next = reducer(current);
|
|
1630
|
-
if (next !== current) qc.setQueryData(key, next);
|
|
1618
|
+
var DocumentsSupportContext = createContext({});
|
|
1619
|
+
function DocumentsSupportProvider({
|
|
1620
|
+
support,
|
|
1621
|
+
children
|
|
1622
|
+
}) {
|
|
1623
|
+
return /* @__PURE__ */ jsx(DocumentsSupportContext.Provider, { value: support, children });
|
|
1631
1624
|
}
|
|
1632
|
-
function
|
|
1633
|
-
return
|
|
1625
|
+
function useDocumentsSupport() {
|
|
1626
|
+
return useContext(DocumentsSupportContext);
|
|
1634
1627
|
}
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
]
|
|
1628
|
+
|
|
1629
|
+
// src/documents/documents-writes.ts
|
|
1630
|
+
function applyOptimisticDocumentEdit(qc, updates) {
|
|
1631
|
+
const byId = new Map(updates.map((update) => [update.external_id, update]));
|
|
1632
|
+
const previous = [];
|
|
1633
|
+
patchDocuments(qc, (old) => {
|
|
1634
|
+
let changed = false;
|
|
1635
|
+
const next = old.map((doc) => {
|
|
1636
|
+
const update = byId.get(doc.external_id);
|
|
1637
|
+
if (!update) return doc;
|
|
1638
|
+
changed = true;
|
|
1639
|
+
previous.push(doc);
|
|
1640
|
+
return { ...doc, ...update };
|
|
1641
|
+
});
|
|
1642
|
+
return changed ? next : old;
|
|
1643
|
+
});
|
|
1644
|
+
const previousOwn = updates.map((update) => {
|
|
1645
|
+
const own = qc.getQueryData(
|
|
1646
|
+
arbiQueryKeys.document(update.external_id)
|
|
1647
|
+
);
|
|
1648
|
+
if (own) setCachedDocument(qc, { ...own, ...update });
|
|
1649
|
+
return [update.external_id, own];
|
|
1650
|
+
});
|
|
1651
|
+
return { optimistic: true, previous, previousOwn };
|
|
1652
|
+
}
|
|
1653
|
+
function rollbackOptimisticDocumentEdit(qc, context) {
|
|
1654
|
+
const edit = context;
|
|
1655
|
+
if (!edit?.optimistic) return;
|
|
1656
|
+
if (edit.previous.length) {
|
|
1657
|
+
const restore = new Map(edit.previous.map((doc) => [doc.external_id, doc]));
|
|
1658
|
+
patchDocuments(
|
|
1659
|
+
qc,
|
|
1660
|
+
(old) => old.some((doc) => restore.has(doc.external_id)) ? old.map((doc) => restore.get(doc.external_id) ?? doc) : old
|
|
1661
|
+
);
|
|
1662
|
+
}
|
|
1663
|
+
for (const [id, own] of edit.previousOwn) qc.setQueryData(arbiQueryKeys.document(id), own);
|
|
1640
1664
|
}
|
|
1641
|
-
function
|
|
1642
|
-
|
|
1643
|
-
const
|
|
1644
|
-
|
|
1645
|
-
const workspaceId = openWorkspaceId(arbi);
|
|
1646
|
-
return workspaceId ? invalidateTagData(qc, workspaceId) : Promise.resolve();
|
|
1647
|
-
}, [arbi, qc]);
|
|
1648
|
-
}
|
|
1649
|
-
function settleCreatedTag(qc, created) {
|
|
1650
|
-
const workspaceId = created.workspace_ext_id;
|
|
1651
|
-
patchWorkspaceTags(
|
|
1665
|
+
function settleUpdatedDocuments(qc, updated) {
|
|
1666
|
+
if (!updated.length) return;
|
|
1667
|
+
const byId = new Map(updated.map((doc) => [doc.external_id, doc]));
|
|
1668
|
+
patchDocuments(
|
|
1652
1669
|
qc,
|
|
1653
|
-
|
|
1654
|
-
(old) => old.some((t) => t.external_id === created.external_id) ? old : [...old, created]
|
|
1670
|
+
(old) => old.some((doc) => byId.has(doc.external_id)) ? old.map((doc) => byId.get(doc.external_id) ?? doc) : old
|
|
1655
1671
|
);
|
|
1656
|
-
|
|
1672
|
+
for (const doc of updated) setCachedDocument(qc, doc);
|
|
1657
1673
|
}
|
|
1658
|
-
function
|
|
1659
|
-
const
|
|
1660
|
-
|
|
1674
|
+
function patchEachDocument(qc, docIds, reducer) {
|
|
1675
|
+
const ids = new Set(docIds);
|
|
1676
|
+
patchDocuments(
|
|
1661
1677
|
qc,
|
|
1662
|
-
|
|
1663
|
-
(old) => old.map((t) => t.external_id === tag.external_id ? { ...t, ...tag } : t)
|
|
1678
|
+
(old) => old.some((doc) => ids.has(doc.external_id)) ? old.map((doc) => ids.has(doc.external_id) ? reducer(doc) : doc) : old
|
|
1664
1679
|
);
|
|
1665
|
-
|
|
1666
|
-
}
|
|
1667
|
-
|
|
1680
|
+
for (const id of ids) patchCachedDocument(qc, id, reducer);
|
|
1681
|
+
}
|
|
1682
|
+
function workspaceOf(qc, docId) {
|
|
1683
|
+
for (const [, docs] of qc.getQueriesData({
|
|
1684
|
+
queryKey: arbiQueryKeys.allDocuments()
|
|
1685
|
+
})) {
|
|
1686
|
+
const doc = Array.isArray(docs) ? docs.find((d) => d.external_id === docId) : void 0;
|
|
1687
|
+
if (doc) return doc.workspace_ext_id;
|
|
1688
|
+
}
|
|
1689
|
+
return qc.getQueryData(arbiQueryKeys.document(docId))?.workspace_ext_id;
|
|
1690
|
+
}
|
|
1691
|
+
function settleAssignedDocTags(qc, created) {
|
|
1692
|
+
const byDoc = /* @__PURE__ */ new Map();
|
|
1693
|
+
for (const doctag of created)
|
|
1694
|
+
byDoc.set(doctag.doc_ext_id, [...byDoc.get(doctag.doc_ext_id) ?? [], doctag]);
|
|
1695
|
+
const workspaces = /* @__PURE__ */ new Map();
|
|
1696
|
+
for (const doctag of created) {
|
|
1697
|
+
const workspaceId = workspaceOf(qc, doctag.doc_ext_id);
|
|
1698
|
+
if (!workspaceId) continue;
|
|
1699
|
+
const delta = workspaces.get(workspaceId) ?? /* @__PURE__ */ new Map();
|
|
1700
|
+
delta.set(doctag.tag_ext_id, (delta.get(doctag.tag_ext_id) ?? 0) + 1);
|
|
1701
|
+
workspaces.set(workspaceId, delta);
|
|
1702
|
+
}
|
|
1703
|
+
patchEachDocument(qc, byDoc.keys(), (doc) => ({
|
|
1704
|
+
...doc,
|
|
1705
|
+
doctags: [...doc.doctags ?? [], ...byDoc.get(doc.external_id) ?? []]
|
|
1706
|
+
}));
|
|
1707
|
+
for (const [workspaceId, delta] of workspaces) adjustTagCounts(qc, workspaceId, delta);
|
|
1708
|
+
}
|
|
1709
|
+
function settleRemovedDocTags(qc, { tagId, docIds }) {
|
|
1710
|
+
const ids = new Set(docIds);
|
|
1711
|
+
const removedByWorkspace = /* @__PURE__ */ new Map();
|
|
1712
|
+
for (const [, docs] of qc.getQueriesData({
|
|
1713
|
+
queryKey: arbiQueryKeys.allDocuments()
|
|
1714
|
+
})) {
|
|
1715
|
+
for (const doc of Array.isArray(docs) ? docs : []) {
|
|
1716
|
+
if (!ids.has(doc.external_id)) continue;
|
|
1717
|
+
if (!doc.doctags?.some((dt) => dt.tag_ext_id === tagId)) continue;
|
|
1718
|
+
removedByWorkspace.set(
|
|
1719
|
+
doc.workspace_ext_id,
|
|
1720
|
+
(removedByWorkspace.get(doc.workspace_ext_id) ?? 0) + 1
|
|
1721
|
+
);
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
patchEachDocument(qc, ids, (doc) => ({
|
|
1725
|
+
...doc,
|
|
1726
|
+
doctags: (doc.doctags ?? []).filter((dt) => dt.tag_ext_id !== tagId)
|
|
1727
|
+
}));
|
|
1728
|
+
for (const [workspaceId, removed] of removedByWorkspace)
|
|
1729
|
+
adjustTagCounts(qc, workspaceId, /* @__PURE__ */ new Map([[tagId, -removed]]));
|
|
1730
|
+
}
|
|
1731
|
+
function settleUpdatedDocTag(qc, updated) {
|
|
1732
|
+
patchEachDocument(qc, [updated.doc_ext_id], (doc) => ({
|
|
1733
|
+
...doc,
|
|
1734
|
+
doctags: (doc.doctags ?? []).map((dt) => dt.tag_ext_id === updated.tag_ext_id ? updated : dt)
|
|
1735
|
+
}));
|
|
1736
|
+
}
|
|
1737
|
+
var replayableDocumentMutations = [
|
|
1738
|
+
{
|
|
1739
|
+
mutationKey: arbiMutationKeys.updateDocuments(),
|
|
1740
|
+
run: (client, input) => documents.updateDocuments(client, input.documents),
|
|
1741
|
+
settle: (qc, updated) => settleUpdatedDocuments(qc, updated)
|
|
1742
|
+
},
|
|
1668
1743
|
{
|
|
1669
|
-
mutationKey: arbiMutationKeys.
|
|
1670
|
-
run: (client, input) =>
|
|
1671
|
-
settle: (qc, created) =>
|
|
1744
|
+
mutationKey: arbiMutationKeys.assignDocTags(),
|
|
1745
|
+
run: (client, input) => doctags.assignDocTags(client, input.tagId, input.docIds, input.note, input.citations),
|
|
1746
|
+
settle: (qc, created) => settleAssignedDocTags(qc, created)
|
|
1747
|
+
},
|
|
1748
|
+
{
|
|
1749
|
+
mutationKey: arbiMutationKeys.removeDocTags(),
|
|
1750
|
+
run: (client, input) => doctags.removeDocTags(client, input.tagId, input.docIds),
|
|
1751
|
+
settle: (qc, _data, input) => settleRemovedDocTags(qc, input)
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
mutationKey: arbiMutationKeys.updateDocTag(),
|
|
1755
|
+
run: (client, input) => doctags.updateDocTag(client, input.tagId, input.docId, {
|
|
1756
|
+
note: input.note,
|
|
1757
|
+
citations: input.citations
|
|
1758
|
+
}),
|
|
1759
|
+
settle: (qc, updated) => settleUpdatedDocTag(qc, updated)
|
|
1672
1760
|
}
|
|
1673
1761
|
];
|
|
1674
|
-
function
|
|
1762
|
+
function resolvingOffline(mutation) {
|
|
1763
|
+
const mutateAsync = ((variables, options) => {
|
|
1764
|
+
if (!onlineManager.isOnline()) {
|
|
1765
|
+
mutation.mutate(variables, options);
|
|
1766
|
+
return Promise.resolve(void 0);
|
|
1767
|
+
}
|
|
1768
|
+
return mutation.mutateAsync(variables, options);
|
|
1769
|
+
});
|
|
1770
|
+
return { ...mutation, mutateAsync };
|
|
1771
|
+
}
|
|
1772
|
+
function useUpdateDocuments() {
|
|
1675
1773
|
const arbi = useArbi();
|
|
1676
1774
|
const qc = useQueryClient();
|
|
1677
|
-
return
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1775
|
+
return resolvingOffline(
|
|
1776
|
+
useMutation({
|
|
1777
|
+
mutationKey: arbiMutationKeys.updateDocuments(),
|
|
1778
|
+
mutationFn: ({ documents }) => arbi.documents.update(documents),
|
|
1779
|
+
onMutate: ({ documents }) => onlineManager.isOnline() || !documents.length ? void 0 : applyOptimisticDocumentEdit(qc, documents),
|
|
1780
|
+
onError: (_error, _input, context) => rollbackOptimisticDocumentEdit(qc, context),
|
|
1781
|
+
onSuccess: (updated) => settleUpdatedDocuments(qc, updated)
|
|
1782
|
+
})
|
|
1783
|
+
);
|
|
1682
1784
|
}
|
|
1683
|
-
function
|
|
1785
|
+
function useDeleteDocuments() {
|
|
1684
1786
|
const arbi = useArbi();
|
|
1685
1787
|
const qc = useQueryClient();
|
|
1788
|
+
const { onDocumentsDeleted } = useDocumentsSupport();
|
|
1686
1789
|
return useMutation({
|
|
1687
|
-
mutationKey: arbiMutationKeys.
|
|
1688
|
-
mutationFn: (
|
|
1689
|
-
onSuccess: (
|
|
1790
|
+
mutationKey: arbiMutationKeys.deleteDocuments(),
|
|
1791
|
+
mutationFn: (docIds) => arbi.documents.delete(docIds),
|
|
1792
|
+
onSuccess: (_data, docIds) => {
|
|
1793
|
+
const gone = new Set(docIds);
|
|
1794
|
+
patchDocuments(
|
|
1795
|
+
qc,
|
|
1796
|
+
(old) => old.some((doc) => gone.has(doc.external_id)) ? old.filter((doc) => !gone.has(doc.external_id)) : old
|
|
1797
|
+
);
|
|
1798
|
+
forgetDocuments(qc, docIds);
|
|
1799
|
+
onDocumentsDeleted?.(docIds);
|
|
1800
|
+
return qc.invalidateQueries({ queryKey: arbiQueryKeys.workspaces() });
|
|
1801
|
+
}
|
|
1690
1802
|
});
|
|
1691
1803
|
}
|
|
1692
|
-
function
|
|
1804
|
+
async function settleUpload(qc, arbi, docIds, processingStatus) {
|
|
1805
|
+
if (docIds?.length) await refreshDocuments(qc, arbi, docIds, { processingStatus });
|
|
1806
|
+
await qc.invalidateQueries({ queryKey: arbiQueryKeys.workspaces() });
|
|
1807
|
+
}
|
|
1808
|
+
function useUploadDocuments() {
|
|
1693
1809
|
const arbi = useArbi();
|
|
1694
1810
|
const qc = useQueryClient();
|
|
1811
|
+
const { processingStatus } = useDocumentsSupport();
|
|
1695
1812
|
return useMutation({
|
|
1696
|
-
mutationKey: arbiMutationKeys.
|
|
1697
|
-
mutationFn: ({
|
|
1698
|
-
|
|
1699
|
-
values
|
|
1700
|
-
}) => arbi.tags.setValues(tagId, values),
|
|
1701
|
-
onSuccess: (tag) => settleChangedTag(qc, tag)
|
|
1813
|
+
mutationKey: arbiMutationKeys.uploadDocuments(),
|
|
1814
|
+
mutationFn: ({ files, options }) => arbi.documents.upload(files, options),
|
|
1815
|
+
onSuccess: (result) => settleUpload(qc, arbi, result.doc_ext_ids, processingStatus)
|
|
1702
1816
|
});
|
|
1703
1817
|
}
|
|
1704
|
-
function
|
|
1818
|
+
function useUploadUrls() {
|
|
1705
1819
|
const arbi = useArbi();
|
|
1706
1820
|
const qc = useQueryClient();
|
|
1821
|
+
const { processingStatus } = useDocumentsSupport();
|
|
1707
1822
|
return useMutation({
|
|
1708
|
-
mutationKey: arbiMutationKeys.
|
|
1709
|
-
mutationFn: (
|
|
1710
|
-
onSuccess: (
|
|
1711
|
-
const workspaceId = openWorkspaceId(arbi);
|
|
1712
|
-
if (!workspaceId) return;
|
|
1713
|
-
patchWorkspaceTags(
|
|
1714
|
-
qc,
|
|
1715
|
-
workspaceId,
|
|
1716
|
-
(old) => old.filter((t) => t.external_id !== tagId).map((t) => t.parent_ext_id === tagId ? { ...t, parent_ext_id: null } : t)
|
|
1717
|
-
);
|
|
1718
|
-
return Promise.all([
|
|
1719
|
-
invalidateTagTables(qc, workspaceId),
|
|
1720
|
-
qc.invalidateQueries({ queryKey: arbiQueryKeys.facts(workspaceId) })
|
|
1721
|
-
]);
|
|
1722
|
-
}
|
|
1823
|
+
mutationKey: arbiMutationKeys.uploadUrls(),
|
|
1824
|
+
mutationFn: ({ urls, shared, configExtId }) => arbi.documents.uploadUrl(urls, { shared, configExtId }),
|
|
1825
|
+
onSuccess: (result) => settleUpload(qc, arbi, result.doc_ext_ids, processingStatus)
|
|
1723
1826
|
});
|
|
1724
1827
|
}
|
|
1725
|
-
function
|
|
1828
|
+
function useAssignDocTags() {
|
|
1726
1829
|
const arbi = useArbi();
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1830
|
+
const qc = useQueryClient();
|
|
1831
|
+
return resolvingOffline(
|
|
1832
|
+
useMutation({
|
|
1833
|
+
mutationKey: arbiMutationKeys.assignDocTags(),
|
|
1834
|
+
mutationFn: ({ tagId, docIds, note, citations }) => arbi.doctags.assign(tagId, docIds, note, citations),
|
|
1835
|
+
onSuccess: (created) => settleAssignedDocTags(qc, created)
|
|
1836
|
+
})
|
|
1837
|
+
);
|
|
1731
1838
|
}
|
|
1732
|
-
function
|
|
1839
|
+
function useRemoveDocTags() {
|
|
1733
1840
|
const arbi = useArbi();
|
|
1734
|
-
const
|
|
1735
|
-
return
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1841
|
+
const qc = useQueryClient();
|
|
1842
|
+
return resolvingOffline(
|
|
1843
|
+
useMutation({
|
|
1844
|
+
mutationKey: arbiMutationKeys.removeDocTags(),
|
|
1845
|
+
mutationFn: ({ tagId, docIds }) => arbi.doctags.remove(tagId, docIds),
|
|
1846
|
+
onSuccess: (_data, input) => settleRemovedDocTags(qc, input)
|
|
1847
|
+
})
|
|
1848
|
+
);
|
|
1849
|
+
}
|
|
1850
|
+
function useUpdateDocTag() {
|
|
1851
|
+
const arbi = useArbi();
|
|
1852
|
+
const qc = useQueryClient();
|
|
1853
|
+
return resolvingOffline(
|
|
1854
|
+
useMutation({
|
|
1855
|
+
mutationKey: arbiMutationKeys.updateDocTag(),
|
|
1856
|
+
mutationFn: ({ tagId, docId, note, citations }) => arbi.doctags.update(tagId, docId, { note, citations }),
|
|
1857
|
+
onSuccess: (updated) => settleUpdatedDocTag(qc, updated)
|
|
1858
|
+
})
|
|
1859
|
+
);
|
|
1860
|
+
}
|
|
1861
|
+
function useGenerateDocTags() {
|
|
1862
|
+
const arbi = useArbi();
|
|
1863
|
+
const qc = useQueryClient();
|
|
1864
|
+
const { onProcessingQueued } = useDocumentsSupport();
|
|
1865
|
+
return useMutation({
|
|
1866
|
+
mutationKey: arbiMutationKeys.generateDocTags(),
|
|
1867
|
+
mutationFn: ({ tagIds, docIds, overwrite }) => arbi.doctags.generate(tagIds, docIds, { overwrite }),
|
|
1868
|
+
onMutate: ({ docIds }) => {
|
|
1869
|
+
if (!onProcessingQueued || !docIds.length) return void 0;
|
|
1870
|
+
const workspaceId = arbi.hasWorkspace ? arbi.getWorkspaceId() : "";
|
|
1871
|
+
const listed = new Map(
|
|
1872
|
+
(getCachedDocuments(qc, workspaceId) ?? []).map((doc) => [doc.external_id, doc])
|
|
1873
|
+
);
|
|
1874
|
+
return {
|
|
1875
|
+
undo: onProcessingQueued(
|
|
1876
|
+
docIds.map((docId) => ({
|
|
1877
|
+
docId,
|
|
1878
|
+
workspaceId,
|
|
1879
|
+
fileName: listed.get(docId)?.file_name ?? "",
|
|
1880
|
+
version: listed.get(docId)?.current_version ?? 1
|
|
1881
|
+
}))
|
|
1882
|
+
)
|
|
1883
|
+
};
|
|
1884
|
+
},
|
|
1885
|
+
onError: (_error, _input, context) => context?.undo()
|
|
1739
1886
|
});
|
|
1740
1887
|
}
|
|
1741
|
-
function
|
|
1888
|
+
function useFinaliseTranslation() {
|
|
1742
1889
|
const arbi = useArbi();
|
|
1743
1890
|
const qc = useQueryClient();
|
|
1891
|
+
const { processingStatus } = useDocumentsSupport();
|
|
1744
1892
|
return useMutation({
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
kind,
|
|
1748
|
-
fields
|
|
1749
|
-
}) => arbi.tagKinds.update(kind, fields),
|
|
1750
|
-
onSuccess: (schema) => {
|
|
1751
|
-
const workspaceId = openWorkspaceId(arbi);
|
|
1752
|
-
if (!workspaceId) return;
|
|
1753
|
-
qc.setQueryData(arbiQueryKeys.tagKind(workspaceId, schema.kind), schema);
|
|
1754
|
-
return invalidateTagData(qc, workspaceId);
|
|
1755
|
-
}
|
|
1893
|
+
mutationFn: (docId) => arbi.documents.finaliseTranslation(docId),
|
|
1894
|
+
onSuccess: (result) => void refreshDocuments(qc, arbi, [result.document_ext_id], { processingStatus })
|
|
1756
1895
|
});
|
|
1757
1896
|
}
|
|
1758
|
-
|
|
1897
|
+
|
|
1898
|
+
// src/offline.ts
|
|
1899
|
+
var REPLAYABLE = [
|
|
1900
|
+
...replayableTagMutations,
|
|
1901
|
+
...replayableDocumentMutations
|
|
1902
|
+
];
|
|
1759
1903
|
function isReplayableArbiMutation(mutationKey) {
|
|
1760
1904
|
return !!mutationKey && REPLAYABLE.some((m) => partialMatchKey(mutationKey, m.mutationKey));
|
|
1761
1905
|
}
|
|
@@ -1767,6 +1911,25 @@ function registerArbiMutationDefaults(queryClient, client) {
|
|
|
1767
1911
|
});
|
|
1768
1912
|
}
|
|
1769
1913
|
}
|
|
1914
|
+
var OFFLINE_READABLE = [
|
|
1915
|
+
"documents",
|
|
1916
|
+
"document",
|
|
1917
|
+
"documentsById",
|
|
1918
|
+
"documentVersions",
|
|
1919
|
+
"similarDocuments"
|
|
1920
|
+
];
|
|
1921
|
+
function isOfflineReadableArbiQuery(queryKey) {
|
|
1922
|
+
return queryKey[0] === "arbi" && OFFLINE_READABLE.includes(queryKey[1]);
|
|
1923
|
+
}
|
|
1924
|
+
function isRestorableArbiQueryOnline(queryKey, data) {
|
|
1925
|
+
if (queryKey[0] !== "arbi") return true;
|
|
1926
|
+
if (queryKey[1] === "documents") return false;
|
|
1927
|
+
const docs = Array.isArray(data) ? data : [data];
|
|
1928
|
+
return !docs.some((doc) => {
|
|
1929
|
+
const status = doc?.status;
|
|
1930
|
+
return !!status && !FINISHED_DOCUMENT_STATUSES.has(status);
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1770
1933
|
function useFilteredProjects(filters, options) {
|
|
1771
1934
|
const arbi = useArbi();
|
|
1772
1935
|
return useQuery({
|
|
@@ -2262,6 +2425,34 @@ function usePasswordChangeForm({
|
|
|
2262
2425
|
}
|
|
2263
2426
|
};
|
|
2264
2427
|
}
|
|
2428
|
+
function useUserSettings(options) {
|
|
2429
|
+
const arbi = useArbi();
|
|
2430
|
+
return useQuery({
|
|
2431
|
+
queryKey: arbiQueryKeys.userSettings(),
|
|
2432
|
+
queryFn: () => arbi.settings.get(),
|
|
2433
|
+
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
2434
|
+
});
|
|
2435
|
+
}
|
|
2436
|
+
function useUpdateUserSettings() {
|
|
2437
|
+
const arbi = useArbi();
|
|
2438
|
+
const qc = useQueryClient();
|
|
2439
|
+
return useMutation({
|
|
2440
|
+
mutationFn: (patch) => arbi.settings.update(patch),
|
|
2441
|
+
onMutate: async (patch) => {
|
|
2442
|
+
await qc.cancelQueries({ queryKey: arbiQueryKeys.userSettings() });
|
|
2443
|
+
const previous = qc.getQueryData(arbiQueryKeys.userSettings());
|
|
2444
|
+
qc.setQueryData(
|
|
2445
|
+
arbiQueryKeys.userSettings(),
|
|
2446
|
+
(old) => old ? { ...old, ...patch } : old
|
|
2447
|
+
);
|
|
2448
|
+
return { previous };
|
|
2449
|
+
},
|
|
2450
|
+
onError: (_err, _patch, context) => {
|
|
2451
|
+
qc.setQueryData(arbiQueryKeys.userSettings(), context?.previous);
|
|
2452
|
+
},
|
|
2453
|
+
onSettled: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.userSettings() })
|
|
2454
|
+
});
|
|
2455
|
+
}
|
|
2265
2456
|
function toNotificationPreferences(stored, keys) {
|
|
2266
2457
|
const checked = Object.fromEntries(keys.map((key) => [key, stored?.[key] ?? true]));
|
|
2267
2458
|
return {
|
|
@@ -2271,14 +2462,6 @@ function toNotificationPreferences(stored, keys) {
|
|
|
2271
2462
|
categoryPatch: (key, value) => ({ [key]: value })
|
|
2272
2463
|
};
|
|
2273
2464
|
}
|
|
2274
|
-
function useUserSettings(options) {
|
|
2275
|
-
const arbi = useArbi();
|
|
2276
|
-
return useQuery({
|
|
2277
|
-
queryKey: arbiQueryKeys.userSettings(),
|
|
2278
|
-
queryFn: () => arbi.settings.get(),
|
|
2279
|
-
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
2280
|
-
});
|
|
2281
|
-
}
|
|
2282
2465
|
function useNotificationPreferences(keys, options) {
|
|
2283
2466
|
const arbi = useArbi();
|
|
2284
2467
|
const qc = useQueryClient();
|
|
@@ -7791,13 +7974,6 @@ function DocumentCardMenu({
|
|
|
7791
7974
|
testId = "document-card-menu"
|
|
7792
7975
|
}) {
|
|
7793
7976
|
const arbi = useArbi();
|
|
7794
|
-
const queryClient = useQueryClient();
|
|
7795
|
-
const invalidateDocuments = () => {
|
|
7796
|
-
const workspaceId = arbi.getWorkspaceId();
|
|
7797
|
-
if (workspaceId) {
|
|
7798
|
-
void queryClient.invalidateQueries({ queryKey: arbiQueryKeys.documents(workspaceId) });
|
|
7799
|
-
}
|
|
7800
|
-
};
|
|
7801
7977
|
const download = useMutation({
|
|
7802
7978
|
mutationFn: async () => {
|
|
7803
7979
|
const response = await arbi.documents.download(docId);
|
|
@@ -7813,10 +7989,7 @@ function DocumentCardMenu({
|
|
|
7813
7989
|
URL.revokeObjectURL(url);
|
|
7814
7990
|
}
|
|
7815
7991
|
});
|
|
7816
|
-
const remove =
|
|
7817
|
-
mutationFn: () => arbi.documents.delete([docId]),
|
|
7818
|
-
onSuccess: invalidateDocuments
|
|
7819
|
-
});
|
|
7992
|
+
const remove = useDeleteDocuments();
|
|
7820
7993
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
7821
7994
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
7822
7995
|
"button",
|
|
@@ -7855,7 +8028,7 @@ function DocumentCardMenu({
|
|
|
7855
8028
|
/* @__PURE__ */ jsxs(
|
|
7856
8029
|
DropdownMenuItem,
|
|
7857
8030
|
{
|
|
7858
|
-
onSelect: () => remove.mutate(),
|
|
8031
|
+
onSelect: () => remove.mutate([docId]),
|
|
7859
8032
|
disabled: remove.isPending,
|
|
7860
8033
|
className: "text-destructive focus:text-destructive",
|
|
7861
8034
|
"data-testid": `${testId}-delete`,
|
|
@@ -7934,21 +8107,14 @@ function DocumentGallery({
|
|
|
7934
8107
|
},
|
|
7935
8108
|
[onOpenDocument, session]
|
|
7936
8109
|
);
|
|
7937
|
-
const arbi = useArbi();
|
|
7938
|
-
const queryClient = useQueryClient();
|
|
7939
8110
|
const [renamingId, setRenamingId] = React.useState(null);
|
|
7940
|
-
const
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
if (activeWorkspace) {
|
|
7948
|
-
void queryClient.invalidateQueries({ queryKey: arbiQueryKeys.documents(activeWorkspace) });
|
|
7949
|
-
}
|
|
7950
|
-
}
|
|
7951
|
-
});
|
|
8111
|
+
const update = useUpdateDocuments();
|
|
8112
|
+
const rename = (doc, title) => update.mutate(
|
|
8113
|
+
{
|
|
8114
|
+
documents: [{ external_id: doc.external_id, doc_metadata: { ...doc.doc_metadata, title } }]
|
|
8115
|
+
},
|
|
8116
|
+
{ onSettled: () => setRenamingId(null) }
|
|
8117
|
+
);
|
|
7952
8118
|
if (isLoading) {
|
|
7953
8119
|
return /* @__PURE__ */ jsx(
|
|
7954
8120
|
"div",
|
|
@@ -7997,7 +8163,7 @@ function DocumentGallery({
|
|
|
7997
8163
|
viewing: viewingDocId === id,
|
|
7998
8164
|
onOpen: () => openDocument(id),
|
|
7999
8165
|
renaming: renamingId === id,
|
|
8000
|
-
onCommitRename: (newTitle) => rename
|
|
8166
|
+
onCommitRename: (newTitle) => rename(doc, newTitle),
|
|
8001
8167
|
onCancelRename: () => setRenamingId(null),
|
|
8002
8168
|
actions: /* @__PURE__ */ jsx(
|
|
8003
8169
|
DocumentCardMenu,
|
|
@@ -8561,6 +8727,6 @@ function hasVideoTrack(blob) {
|
|
|
8561
8727
|
});
|
|
8562
8728
|
}
|
|
8563
8729
|
|
|
8564
|
-
export { ALLOWED_PORTAL_ORIGINS, AccountClientProvider, ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiSessionStateProvider, ArbiWebSocketProvider, ArtifactCanvas, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_ACTION, BOX_SEAT_REFUSED_TITLE, CalendarSupportProvider, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, DirectMessages, DmAvatar, DmComposer, DocQaPanel, DocSearch, DocumentCardMenu, DocumentGallery, DocumentReview, DocumentTable, DraftTitleControls, EMPTY_SESSION_STATE, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, ImageCropModal, ImageCropper, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, MailClientProvider, MailOfflineUnavailableError, MessageArtifactCard, MessageBubble, MessageThread, OpenAIIcon, PhotoCapture, ProviderIcon, RUN_WINDOW_MS, SIGNATURE_NOTIFICATION_TYPES, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, WORK_NOTIFICATION_LABELS, accountPath, aliasTakenMessage, annotateThread, announceMailDraftReplaced, arbiAccountClient, arbiMailClient, calendarQueryKeys, callNotificationMeta, captureFrameAsBlob, connectOAuthCalendarAccount, createArbiSessionStore, createMailClient, cropImage, dayKey, defaultMailAlias, deploymentUserMeta, describeActivity, describeServerNotification, documentActivityMeta, documentActivityPhrase, documentDisplayName, docxMentionMeta, downloadRecoveryFile, fileAttachment, formatIdentityPrice, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, inputRequestTitle, invalidateCalendarEvents, invalidateCalendars,
|
|
8730
|
+
export { ALLOWED_PORTAL_ORIGINS, AccountClientProvider, ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiSessionStateProvider, ArbiWebSocketProvider, ArtifactCanvas, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_ACTION, BOX_SEAT_REFUSED_TITLE, CalendarSupportProvider, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, DirectMessages, DmAvatar, DmComposer, DocQaPanel, DocSearch, DocumentCardMenu, DocumentGallery, DocumentReview, DocumentTable, DocumentsSupportProvider, DraftTitleControls, EMPTY_SESSION_STATE, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, ImageCropModal, ImageCropper, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, MailClientProvider, MailOfflineUnavailableError, MessageArtifactCard, MessageBubble, MessageThread, OpenAIIcon, PhotoCapture, ProviderIcon, RUN_WINDOW_MS, SIGNATURE_NOTIFICATION_TYPES, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, WORK_NOTIFICATION_LABELS, accountPath, aliasTakenMessage, annotateThread, announceMailDraftReplaced, applyOptimisticDocumentEdit, arbiAccountClient, arbiMailClient, calendarQueryKeys, callNotificationMeta, captureFrameAsBlob, connectOAuthCalendarAccount, createArbiSessionStore, createMailClient, cropImage, dayKey, defaultMailAlias, deploymentUserMeta, describeActivity, describeServerNotification, documentActivityMeta, documentActivityPhrase, documentDisplayName, docxMentionMeta, downloadRecoveryFile, fileAttachment, formatIdentityPrice, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, inputRequestTitle, invalidateCalendarEvents, invalidateCalendars, isAliasTakenError, isDeploymentAdmin, isDeploymentUserNotification, isOfflineReadableArbiQuery, isQueuedCalendarWrite, isReplayableArbiMutation, isRestorableArbiQueryOnline, isSignatureNotificationType, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, nextViewingDocument, notificationUserName, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, registerArbiMutationDefaults, resetCalendarAccountSyncState, resolveActiveWorkspace, rollbackOptimisticDocumentEdit, safePortalUrl, selectIsGenerating, selectViewingDocumentId, signatureNotificationPhrase, signatureRequestMeta, supportsHouseTemplates, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useAccountClient, useActOnStep, useAddHolidayCalendar, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useAppPasswords, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiSessionState, useArbiSessionStore, useArbiShellWorkspaces, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssignDocTags, useAuthorizeLimits, useAvatarCrop, useBookingPages, useCalDavProfiles, useCalendarAccounts, useCalendarEvent, useCalendarEventByUid, useCalendarEvents, useCalendarInvitations, useCalendarOutbox, useCalendarOverlays, useCalendarSettings, useCalendarShares, useCalendarSupport, useCalendars, useCameraStream, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfirmEmailChange, useConnectCalDavAccount, useConnectMailAccount, useConnectOAuthAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationUsage, useCreateAgent, useCreateAppPassword, useCreateCalendar, useCreateContact, useCreateEvent, useCreateFact, useCreateFacts, useCreateFeed, useCreateRoom, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDecideCounter, useDeleteAccount, useDeleteAccountFlow, useDeleteBookingPage, useDeleteCalendar, useDeleteContact, useDeleteDocuments, useDeleteEvent, useDeleteFact, useDeleteNotifications, useDeleteSkill, useDeleteWorkflow, useDirectMessages, useDisconnectCalendarAccount, useDisconnectMailAccount, useDocumentsSupport, useEmailChange, useFacts, useFetchCalendarEvent, useFilteredProjects, useFinaliseTranslation, useFindTime, useFollowThread, useFreeBusy, useGenerateAgentAvatar, useGenerateDocTags, useGrantAgentAccess, useHolidayCountries, useHouseTemplateCandidates, useIdentityVerification, useIdentityVerificationFlow, useImportCalendar, useInviteContacts, useMailAccounts, useMailAttachmentText, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useMarkNotificationsRead, useMcpTools, useMoveEvent, useNameEditor, useNotificationPreferences, useNotifications, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, usePublishCalendar, useRefreshCalendar, useRemoveDocTags, useRequestEmailChange, useRespondToEvent, useResumeCalendarAccountConnect, useRevokeAgentAccess, useRevokeAppPassword, useRooms, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveBookingPage, useSaveCalendarSettings, useSaveMailDraft, useSearchContacts, useSearchFacts, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetSkillVisibility, useSetWorkspaceHouseTemplate, useShareCalendar, useShellWorkspaces, useSignOut, useSkillSource, useSkills, useStartAgentSession, useStartCalendarAccountOAuth, useStartWorkQuery, useSubscribeCalendar, useSyncAccountsOnOpen, useSyncCalendarAccount, useTerminateSession, useUnshareCalendar, useUpdateCalendar, useUpdateCalendarAccount, useUpdateContact, useUpdateConversation, useUpdateDocTag, useUpdateDocuments, useUpdateEvent, useUpdateFact, useUpdateMailMessage, useUpdateProfile, useUpdateProjectFields, useUpdateUserSettings, useUpdateWorkflow, useUploadDocuments, useUploadSkillFiles, useUploadUrls, useUserSettings, useVideoRecorder, useWorkNotifications, useWorkflowRuns, useWorkflows, useWorkspaceDocs, useWorkspaceNotificationLevel, userDisplayName, userInitials, workflowStepOf, workspaceHouseTemplateId };
|
|
8565
8731
|
//# sourceMappingURL=index.js.map
|
|
8566
8732
|
//# sourceMappingURL=index.js.map
|