@arbidocs/react 0.4.129 → 0.4.130
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 +52 -53
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.js +3 -5
- package/dist/artifacts/index.js.map +1 -1
- package/dist/{chunk-BOJHNPNJ.cjs → chunk-6PPWZILQ.cjs} +16 -11
- package/dist/chunk-6PPWZILQ.cjs.map +1 -0
- package/dist/{chunk-G6FHNURH.js → chunk-NNWMHMEC.js} +60 -3
- package/dist/chunk-NNWMHMEC.js.map +1 -0
- package/dist/{chunk-6AWF4HFU.js → chunk-PPRKQK4P.js} +16 -11
- package/dist/chunk-PPRKQK4P.js.map +1 -0
- package/dist/{chunk-AFGE55RQ.cjs → chunk-UN3AZUXX.cjs} +2 -11
- package/dist/chunk-UN3AZUXX.cjs.map +1 -0
- package/dist/{chunk-5WXNTCI3.js → chunk-XV7EOUQM.js} +3 -11
- package/dist/chunk-XV7EOUQM.js.map +1 -0
- package/dist/{chunk-5DCRIWCA.cjs → chunk-ZWFMFOGP.cjs} +68 -2
- package/dist/chunk-ZWFMFOGP.cjs.map +1 -0
- package/dist/document-tools/index.cjs +4 -5
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.js +1 -2
- package/dist/document-tools/index.js.map +1 -1
- package/dist/{index-C7OqcKY3.d.ts → index-D8NvRj3J.d.cts} +16 -7
- package/dist/{index-C7OqcKY3.d.cts → index-D8NvRj3J.d.ts} +16 -7
- package/dist/index.cjs +368 -203
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +224 -90
- package/dist/index.d.ts +224 -90
- package/dist/index.js +232 -73
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +10 -6
- package/dist/shell/index.d.cts +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-5DCRIWCA.cjs.map +0 -1
- package/dist/chunk-5WXNTCI3.js.map +0 -1
- package/dist/chunk-6AWF4HFU.js.map +0 -1
- package/dist/chunk-74UTKIWQ.js +0 -62
- package/dist/chunk-74UTKIWQ.js.map +0 -1
- package/dist/chunk-AFGE55RQ.cjs.map +0 -1
- package/dist/chunk-BOJHNPNJ.cjs.map +0 -1
- package/dist/chunk-G6FHNURH.js.map +0 -1
- package/dist/chunk-NUFEZBA5.cjs +0 -72
- package/dist/chunk-NUFEZBA5.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { arbiQueryKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-
|
|
2
|
-
export { PROJECT_CREATION_DENIED_REASON, arbiQueryKeys, isUsageMetered, useActivity, useAgents, useAssistantQuery, useCanCreateProjects, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocuments, useFacts, useFirmPool, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage,
|
|
1
|
+
import { arbiQueryKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-XV7EOUQM.js';
|
|
2
|
+
export { PROJECT_CREATION_DENIED_REASON, arbiQueryKeys, isUsageMetered, useActivity, useAgents, useAssistantQuery, useCanCreateProjects, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocuments, useFacts, useFirmPool, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useTags, useThumbnails, useTopUpFirmPool, useUserUsageToday, useWorkspaceActivity, useWorkspaceUsers, useWorkspaces } from './chunk-XV7EOUQM.js';
|
|
3
3
|
import { downloadBlob } from './chunk-6JSXDLIQ.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { parseVersionRef } from './chunk-NNWMHMEC.js';
|
|
5
|
+
export { cleanDraftMarkdown, cleanDraftWithReport, promoteBoldTitle, repairParsedStructure, repairParsedTitle, stripAgentPreamble, unescapeMarkdown, unwrapCitationLinks } from './chunk-NNWMHMEC.js';
|
|
6
|
+
import './chunk-WUTL62MC.js';
|
|
7
|
+
import { formatRelativeTime } from './chunk-PPRKQK4P.js';
|
|
8
|
+
export { DEFAULT_NOTIFY_TONE, NotificationBell, Toaster, formatRelativeTime, notify, seedNotifications, selectUnread, toast, useNotify } from './chunk-PPRKQK4P.js';
|
|
7
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';
|
|
8
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';
|
|
9
11
|
import { MarkdownRenderer } from './chunk-C44GO33B.js';
|
|
@@ -25,7 +27,7 @@ import React, { memo, useState, createContext, useMemo, useCallback, useEffect,
|
|
|
25
27
|
import { useQueryClient, useMutation, useQuery, onlineManager } from '@tanstack/react-query';
|
|
26
28
|
import { resolveCitations, summarizeCitations, settings, formatFileSize, connectWithReconnect, chats, identityErrorCode } from '@arbidocs/sdk/browser';
|
|
27
29
|
export { Arbi, ArbiError, DEFAULT_AI_USD_PER_GBP, formatGbp, formatGbpPerMillionTokens, usdToGbp } from '@arbidocs/sdk/browser';
|
|
28
|
-
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, 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';
|
|
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';
|
|
29
31
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
30
32
|
import { isMessageType, passwordChangeErrorMessage, createRecoveryFile } from '@arbidocs/client';
|
|
31
33
|
export { isMessageType } from '@arbidocs/client';
|
|
@@ -1637,6 +1639,91 @@ function useDeleteContact() {
|
|
|
1637
1639
|
onSuccess: () => invalidate()
|
|
1638
1640
|
});
|
|
1639
1641
|
}
|
|
1642
|
+
var AccountClientContext = createContext(null);
|
|
1643
|
+
function arbiProfile(arbi) {
|
|
1644
|
+
const profile = arbi.user.profile();
|
|
1645
|
+
return profile ? toProfileView(profile) : null;
|
|
1646
|
+
}
|
|
1647
|
+
function arbiAccountClient(arbi, overrides = {}) {
|
|
1648
|
+
return {
|
|
1649
|
+
profile: () => arbiProfile(arbi),
|
|
1650
|
+
onProfileChange: (listener) => arbi.user.onProfileChange(() => listener()),
|
|
1651
|
+
updateProfile: async (vars) => {
|
|
1652
|
+
await arbi.profile.update({
|
|
1653
|
+
...vars.givenName !== void 0 && { given_name: vars.givenName.trim() },
|
|
1654
|
+
...vars.familyName !== void 0 && { family_name: vars.familyName.trim() },
|
|
1655
|
+
...vars.picture !== void 0 && { picture: vars.picture }
|
|
1656
|
+
});
|
|
1657
|
+
},
|
|
1658
|
+
requestEmailChange: (newEmail) => arbi.account.requestEmailChange(newEmail),
|
|
1659
|
+
confirmEmailChange: async (newEmail, code) => {
|
|
1660
|
+
await arbi.account.confirmEmailChange(newEmail, code);
|
|
1661
|
+
},
|
|
1662
|
+
changePassword: (vars) => arbi.account.changePassword(vars),
|
|
1663
|
+
listSessions: () => arbi.sessions.list(),
|
|
1664
|
+
currentSessionId: () => arbi.sessions.currentId(),
|
|
1665
|
+
terminateSession: (sessionId) => arbi.sessions.terminate(sessionId),
|
|
1666
|
+
signOut: async ({ everywhere } = {}) => {
|
|
1667
|
+
if (everywhere) await arbi.sessions.logoutAll();
|
|
1668
|
+
else await arbi.logout();
|
|
1669
|
+
},
|
|
1670
|
+
requestDeletion: () => arbi.account.requestDeletion(),
|
|
1671
|
+
identity: {
|
|
1672
|
+
status: () => arbi.identity.status(),
|
|
1673
|
+
purchase: () => arbi.identity.purchase(),
|
|
1674
|
+
startSession: () => arbi.identity.startSession(),
|
|
1675
|
+
refresh: () => arbi.identity.refresh(),
|
|
1676
|
+
acceptName: () => arbi.identity.acceptName(),
|
|
1677
|
+
remove: () => arbi.identity.remove()
|
|
1678
|
+
},
|
|
1679
|
+
...overrides
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1682
|
+
var NO_ACCOUNT_ERROR = "The account needs an <AccountClientProvider> or an <ArbiProvider> above it";
|
|
1683
|
+
var refuse = () => Promise.reject(new Error(NO_ACCOUNT_ERROR));
|
|
1684
|
+
var NO_ACCOUNT = {
|
|
1685
|
+
client: {
|
|
1686
|
+
profile: () => null,
|
|
1687
|
+
onProfileChange: () => () => {
|
|
1688
|
+
},
|
|
1689
|
+
updateProfile: refuse,
|
|
1690
|
+
requestEmailChange: refuse,
|
|
1691
|
+
confirmEmailChange: refuse,
|
|
1692
|
+
changePassword: refuse,
|
|
1693
|
+
listSessions: refuse,
|
|
1694
|
+
currentSessionId: () => null,
|
|
1695
|
+
terminateSession: refuse,
|
|
1696
|
+
signOut: refuse,
|
|
1697
|
+
requestDeletion: refuse,
|
|
1698
|
+
identity: {
|
|
1699
|
+
status: refuse,
|
|
1700
|
+
purchase: refuse,
|
|
1701
|
+
startSession: refuse,
|
|
1702
|
+
refresh: refuse,
|
|
1703
|
+
acceptName: refuse,
|
|
1704
|
+
remove: refuse
|
|
1705
|
+
}
|
|
1706
|
+
},
|
|
1707
|
+
enabled: false
|
|
1708
|
+
};
|
|
1709
|
+
function AccountClientProvider({
|
|
1710
|
+
client,
|
|
1711
|
+
enabled = true,
|
|
1712
|
+
children
|
|
1713
|
+
}) {
|
|
1714
|
+
const value = useMemo(() => ({ client, enabled }), [client, enabled]);
|
|
1715
|
+
return /* @__PURE__ */ jsx(AccountClientContext.Provider, { value, children });
|
|
1716
|
+
}
|
|
1717
|
+
function useAccountClient() {
|
|
1718
|
+
const provided = useContext(AccountClientContext);
|
|
1719
|
+
const arbi = useContext(ArbiContext);
|
|
1720
|
+
const fallback = useMemo(() => arbi ? arbiAccountClient(arbi) : null, [arbi]);
|
|
1721
|
+
if (provided) return provided;
|
|
1722
|
+
if (!arbi || !fallback) return NO_ACCOUNT;
|
|
1723
|
+
return { client: fallback, enabled: arbi.isLoggedIn };
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
// src/account/profile.ts
|
|
1640
1727
|
function toProfileView(profile) {
|
|
1641
1728
|
return {
|
|
1642
1729
|
...profile,
|
|
@@ -1644,29 +1731,26 @@ function toProfileView(profile) {
|
|
|
1644
1731
|
};
|
|
1645
1732
|
}
|
|
1646
1733
|
function useProfile(options) {
|
|
1647
|
-
const
|
|
1734
|
+
const { client, enabled } = useAccountClient();
|
|
1735
|
+
const qc = useQueryClient();
|
|
1736
|
+
useEffect(
|
|
1737
|
+
() => client.onProfileChange(() => qc.setQueryData(arbiQueryKeys.profile(), client.profile())),
|
|
1738
|
+
[client, qc]
|
|
1739
|
+
);
|
|
1648
1740
|
return useQuery({
|
|
1649
1741
|
queryKey: arbiQueryKeys.profile(),
|
|
1650
|
-
queryFn: () =>
|
|
1651
|
-
|
|
1652
|
-
return profile ? toProfileView(profile) : null;
|
|
1653
|
-
},
|
|
1654
|
-
enabled: (options?.enabled ?? true) && arbi.isLoggedIn,
|
|
1742
|
+
queryFn: () => client.profile(),
|
|
1743
|
+
enabled: (options?.enabled ?? true) && enabled,
|
|
1655
1744
|
staleTime: Infinity
|
|
1656
1745
|
});
|
|
1657
1746
|
}
|
|
1658
1747
|
function useUpdateProfile() {
|
|
1659
|
-
const
|
|
1748
|
+
const { client } = useAccountClient();
|
|
1660
1749
|
const qc = useQueryClient();
|
|
1661
1750
|
return useMutation({
|
|
1662
1751
|
mutationFn: async (vars) => {
|
|
1663
|
-
await
|
|
1664
|
-
|
|
1665
|
-
...vars.familyName !== void 0 && { family_name: vars.familyName.trim() },
|
|
1666
|
-
...vars.picture !== void 0 && { picture: vars.picture }
|
|
1667
|
-
});
|
|
1668
|
-
const profile = arbi.user.profile();
|
|
1669
|
-
return profile ? toProfileView(profile) : null;
|
|
1752
|
+
await client.updateProfile(vars);
|
|
1753
|
+
return client.profile();
|
|
1670
1754
|
},
|
|
1671
1755
|
onSuccess: (profile) => {
|
|
1672
1756
|
qc.setQueryData(arbiQueryKeys.profile(), profile);
|
|
@@ -1744,20 +1828,17 @@ function useAvatarCrop({
|
|
|
1744
1828
|
};
|
|
1745
1829
|
}
|
|
1746
1830
|
function useRequestEmailChange() {
|
|
1747
|
-
const
|
|
1831
|
+
const { client } = useAccountClient();
|
|
1748
1832
|
return useMutation({
|
|
1749
|
-
mutationFn: (newEmail) =>
|
|
1833
|
+
mutationFn: (newEmail) => client.requestEmailChange(newEmail)
|
|
1750
1834
|
});
|
|
1751
1835
|
}
|
|
1752
1836
|
function useConfirmEmailChange() {
|
|
1753
|
-
const
|
|
1837
|
+
const { client } = useAccountClient();
|
|
1754
1838
|
const qc = useQueryClient();
|
|
1755
1839
|
return useMutation({
|
|
1756
|
-
mutationFn: ({ newEmail, code }) =>
|
|
1757
|
-
onSuccess: () =>
|
|
1758
|
-
const profile = arbi.user.profile();
|
|
1759
|
-
qc.setQueryData(arbiQueryKeys.profile(), profile ? toProfileView(profile) : null);
|
|
1760
|
-
}
|
|
1840
|
+
mutationFn: ({ newEmail, code }) => client.confirmEmailChange(newEmail, code),
|
|
1841
|
+
onSuccess: () => qc.setQueryData(arbiQueryKeys.profile(), client.profile())
|
|
1761
1842
|
});
|
|
1762
1843
|
}
|
|
1763
1844
|
function useEmailChange({
|
|
@@ -1821,9 +1902,9 @@ function useEmailChange({
|
|
|
1821
1902
|
};
|
|
1822
1903
|
}
|
|
1823
1904
|
function usePasswordChange() {
|
|
1824
|
-
const
|
|
1905
|
+
const { client } = useAccountClient();
|
|
1825
1906
|
return useMutation({
|
|
1826
|
-
mutationFn: (vars) =>
|
|
1907
|
+
mutationFn: (vars) => client.changePassword(vars)
|
|
1827
1908
|
});
|
|
1828
1909
|
}
|
|
1829
1910
|
var DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES = {
|
|
@@ -2034,24 +2115,32 @@ function useFollowThread(conversationId, options) {
|
|
|
2034
2115
|
error: save.error
|
|
2035
2116
|
};
|
|
2036
2117
|
}
|
|
2118
|
+
function useSessions(options) {
|
|
2119
|
+
const { client, enabled } = useAccountClient();
|
|
2120
|
+
return useQuery({
|
|
2121
|
+
queryKey: arbiQueryKeys.sessions(),
|
|
2122
|
+
queryFn: () => client.listSessions(),
|
|
2123
|
+
enabled: (options?.enabled ?? true) && enabled
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2037
2126
|
function useTerminateSession() {
|
|
2038
|
-
const
|
|
2127
|
+
const { client } = useAccountClient();
|
|
2039
2128
|
const qc = useQueryClient();
|
|
2040
2129
|
return useMutation({
|
|
2041
|
-
mutationFn: (sessionId) =>
|
|
2130
|
+
mutationFn: (sessionId) => client.terminateSession(sessionId),
|
|
2042
2131
|
onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.sessions() })
|
|
2043
2132
|
});
|
|
2044
2133
|
}
|
|
2045
|
-
function
|
|
2046
|
-
const
|
|
2134
|
+
function useSignOut() {
|
|
2135
|
+
const { client } = useAccountClient();
|
|
2047
2136
|
const qc = useQueryClient();
|
|
2048
2137
|
return useMutation({
|
|
2049
|
-
mutationFn: () =>
|
|
2050
|
-
|
|
2138
|
+
mutationFn: (options = {}) => client.signOut(options),
|
|
2139
|
+
onSettled: () => qc.clear()
|
|
2051
2140
|
});
|
|
2052
2141
|
}
|
|
2053
2142
|
function useCurrentSessionId() {
|
|
2054
|
-
return
|
|
2143
|
+
return useAccountClient().client.currentSessionId();
|
|
2055
2144
|
}
|
|
2056
2145
|
function parseDeleteAccountBlockers(error) {
|
|
2057
2146
|
const body = error?.apiError ?? error;
|
|
@@ -2066,8 +2155,8 @@ function parseDeleteAccountBlockers(error) {
|
|
|
2066
2155
|
return [];
|
|
2067
2156
|
}
|
|
2068
2157
|
function useDeleteAccount() {
|
|
2069
|
-
const
|
|
2070
|
-
return useMutation({ mutationFn: () =>
|
|
2158
|
+
const { client } = useAccountClient();
|
|
2159
|
+
return useMutation({ mutationFn: () => client.requestDeletion() });
|
|
2071
2160
|
}
|
|
2072
2161
|
function useDeleteAccountFlow({
|
|
2073
2162
|
userEmail,
|
|
@@ -2388,22 +2477,12 @@ function useIdentityVerificationFlow(api, {
|
|
|
2388
2477
|
};
|
|
2389
2478
|
}
|
|
2390
2479
|
function useIdentityVerification(options = {}) {
|
|
2391
|
-
const
|
|
2480
|
+
const { client, enabled } = useAccountClient();
|
|
2392
2481
|
const qc = useQueryClient();
|
|
2393
|
-
const
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
startSession: () => arbi.identity.startSession(),
|
|
2398
|
-
refresh: () => arbi.identity.refresh(),
|
|
2399
|
-
acceptName: () => arbi.identity.acceptName(),
|
|
2400
|
-
remove: () => arbi.identity.remove()
|
|
2401
|
-
}),
|
|
2402
|
-
[arbi]
|
|
2403
|
-
);
|
|
2404
|
-
const { onVerifiedChange, onNameAccepted } = options;
|
|
2405
|
-
return useIdentityVerificationFlow(api, {
|
|
2406
|
-
enabled: arbi.isLoggedIn,
|
|
2482
|
+
const { onVerifiedChange, onNameAccepted, formatPrice } = options;
|
|
2483
|
+
return useIdentityVerificationFlow(client.identity, {
|
|
2484
|
+
enabled,
|
|
2485
|
+
formatPrice,
|
|
2407
2486
|
onVerifiedChange: (verified) => {
|
|
2408
2487
|
void qc.invalidateQueries({ queryKey: arbiQueryKeys.profile() });
|
|
2409
2488
|
onVerifiedChange?.(verified);
|
|
@@ -4656,6 +4735,9 @@ function getNotificationTypeMeta(type) {
|
|
|
4656
4735
|
return { Icon: FileText, iconClassName: "text-primary", label: "Document" };
|
|
4657
4736
|
case "contact_accepted":
|
|
4658
4737
|
return { Icon: UserCheck, iconClassName: "text-green-500", label: "Invitation" };
|
|
4738
|
+
case "deployment_user_invited":
|
|
4739
|
+
case "deployment_user_registered":
|
|
4740
|
+
return { Icon: UserPlus, iconClassName: "text-primary", label: "Users" };
|
|
4659
4741
|
case "signup_reward":
|
|
4660
4742
|
return { Icon: PartyPopper, iconClassName: "text-green-600", label: "Signup bonus" };
|
|
4661
4743
|
case "referral_reward":
|
|
@@ -6098,12 +6180,89 @@ function CommandPaletteProvider({
|
|
|
6098
6180
|
/* @__PURE__ */ jsx(CommandPalette, { open: isOpen, onOpenChange: setIsOpen, ...paletteProps })
|
|
6099
6181
|
] });
|
|
6100
6182
|
}
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6183
|
+
|
|
6184
|
+
// src/session/store.ts
|
|
6185
|
+
var EMPTY_SESSION_STATE = {
|
|
6186
|
+
workspaceId: null,
|
|
6187
|
+
conversationId: null,
|
|
6188
|
+
viewingDocument: null,
|
|
6189
|
+
selectedDocumentIds: [],
|
|
6190
|
+
generating: {},
|
|
6191
|
+
paMode: false,
|
|
6192
|
+
conversationDocuments: {}
|
|
6193
|
+
};
|
|
6194
|
+
var selectViewingDocumentId = (state) => state.viewingDocument ? parseVersionRef(state.viewingDocument.id).docId : null;
|
|
6195
|
+
var selectIsGenerating = (conversationId) => (state) => !!conversationId && !!state.generating[conversationId]?.isGenerating;
|
|
6196
|
+
function nextViewingDocument(current, input) {
|
|
6197
|
+
if (!input) return null;
|
|
6198
|
+
const same = current?.id === input.id;
|
|
6199
|
+
return {
|
|
6200
|
+
id: input.id,
|
|
6201
|
+
page: input.page !== void 0 ? input.page : same ? current?.page ?? null : null,
|
|
6202
|
+
passageId: input.passageId !== void 0 ? input.passageId : current?.passageId ?? null
|
|
6203
|
+
};
|
|
6204
|
+
}
|
|
6205
|
+
function createArbiSessionStore(initial = {}) {
|
|
6206
|
+
let state = { ...EMPTY_SESSION_STATE, ...initial };
|
|
6207
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
6208
|
+
const update = (patch) => {
|
|
6209
|
+
state = { ...state, ...patch };
|
|
6210
|
+
listeners.forEach((listener) => listener());
|
|
6211
|
+
};
|
|
6212
|
+
return {
|
|
6213
|
+
getState: () => state,
|
|
6214
|
+
subscribe: (listener) => {
|
|
6215
|
+
listeners.add(listener);
|
|
6216
|
+
return () => listeners.delete(listener);
|
|
6217
|
+
},
|
|
6218
|
+
setWorkspaceId: (workspaceId) => {
|
|
6219
|
+
if (state.workspaceId !== workspaceId) update({ workspaceId });
|
|
6220
|
+
},
|
|
6221
|
+
setConversationId: (conversationId) => {
|
|
6222
|
+
if (state.conversationId !== conversationId) update({ conversationId });
|
|
6223
|
+
},
|
|
6224
|
+
setViewingDocument: (input) => update({ viewingDocument: nextViewingDocument(state.viewingDocument, input) }),
|
|
6225
|
+
setSelectedDocumentIds: (ids) => update({ selectedDocumentIds: ids }),
|
|
6226
|
+
setConversationGenerating: (conversationId, isGenerating) => {
|
|
6227
|
+
const current = state.generating[conversationId];
|
|
6228
|
+
update({
|
|
6229
|
+
generating: {
|
|
6230
|
+
...state.generating,
|
|
6231
|
+
[conversationId]: {
|
|
6232
|
+
isGenerating,
|
|
6233
|
+
error: isGenerating ? null : current?.error ?? null,
|
|
6234
|
+
startTime: isGenerating ? Date.now() : null
|
|
6235
|
+
}
|
|
6236
|
+
}
|
|
6237
|
+
});
|
|
6238
|
+
},
|
|
6239
|
+
setPaMode: (paMode) => {
|
|
6240
|
+
if (state.paMode !== paMode) update({ paMode });
|
|
6241
|
+
},
|
|
6242
|
+
setConversationDocuments: (conversationId, documents) => update({
|
|
6243
|
+
conversationDocuments: { ...state.conversationDocuments, [conversationId]: documents }
|
|
6244
|
+
})
|
|
6245
|
+
};
|
|
6246
|
+
}
|
|
6247
|
+
var ArbiSessionStoreContext = createContext(null);
|
|
6248
|
+
var moduleDefault = null;
|
|
6249
|
+
var defaultStore = () => moduleDefault ??= createArbiSessionStore();
|
|
6250
|
+
function ArbiSessionStateProvider({
|
|
6251
|
+
store,
|
|
6252
|
+
children
|
|
6253
|
+
}) {
|
|
6254
|
+
const enclosing = useContext(ArbiSessionStoreContext);
|
|
6255
|
+
const [own] = useState(createArbiSessionStore);
|
|
6256
|
+
return /* @__PURE__ */ jsx(ArbiSessionStoreContext.Provider, { value: store ?? enclosing ?? own, children });
|
|
6257
|
+
}
|
|
6258
|
+
function useArbiSessionStore() {
|
|
6259
|
+
return useContext(ArbiSessionStoreContext) ?? defaultStore();
|
|
6260
|
+
}
|
|
6261
|
+
function useArbiSessionState(selector) {
|
|
6262
|
+
const store = useArbiSessionStore();
|
|
6263
|
+
const select = () => selector(store.getState());
|
|
6264
|
+
return useSyncExternalStore(store.subscribe, select, select);
|
|
6265
|
+
}
|
|
6107
6266
|
ModuleRegistry.registerModules([AllCommunityModule]);
|
|
6108
6267
|
function formatBytes(bytes) {
|
|
6109
6268
|
if (bytes == null || Number.isNaN(bytes)) return "\u2014";
|
|
@@ -6148,19 +6307,19 @@ function DocumentTable({
|
|
|
6148
6307
|
}
|
|
6149
6308
|
return map;
|
|
6150
6309
|
}, [tagsQuery.data]);
|
|
6151
|
-
const
|
|
6152
|
-
const
|
|
6153
|
-
const
|
|
6154
|
-
const
|
|
6310
|
+
const session = useArbiSessionStore();
|
|
6311
|
+
const storeSelected = useArbiSessionState((s) => s.selectedDocumentIds);
|
|
6312
|
+
const storeSetSelected = session.setSelectedDocumentIds;
|
|
6313
|
+
const viewingDocId = useArbiSessionState(selectViewingDocumentId);
|
|
6155
6314
|
const effectiveSelected = selectedIds ?? storeSelected;
|
|
6156
6315
|
const emitSelection = onSelectionChange ?? storeSetSelected;
|
|
6157
6316
|
const gridApiRef = React.useRef(null);
|
|
6158
6317
|
const openDocument = React.useCallback(
|
|
6159
6318
|
(id) => {
|
|
6160
|
-
|
|
6319
|
+
session.setViewingDocument({ id });
|
|
6161
6320
|
onOpenDocument?.(id);
|
|
6162
6321
|
},
|
|
6163
|
-
[onOpenDocument,
|
|
6322
|
+
[onOpenDocument, session]
|
|
6164
6323
|
);
|
|
6165
6324
|
const applySelection = React.useCallback(() => {
|
|
6166
6325
|
const api = gridApiRef.current;
|
|
@@ -6437,10 +6596,10 @@ function DocumentGallery({
|
|
|
6437
6596
|
);
|
|
6438
6597
|
const thumbsQuery = useThumbnails(docIds);
|
|
6439
6598
|
const thumbs = thumbsQuery.data ?? {};
|
|
6440
|
-
const
|
|
6441
|
-
const
|
|
6442
|
-
const
|
|
6443
|
-
const
|
|
6599
|
+
const session = useArbiSessionStore();
|
|
6600
|
+
const storeSelected = useArbiSessionState((s) => s.selectedDocumentIds);
|
|
6601
|
+
const storeSetSelected = session.setSelectedDocumentIds;
|
|
6602
|
+
const viewingDocId = useArbiSessionState(selectViewingDocumentId);
|
|
6444
6603
|
const effectiveSelected = selectedIds ?? storeSelected;
|
|
6445
6604
|
const emitSelection = onSelectionChange ?? storeSetSelected;
|
|
6446
6605
|
const selectedSet = React.useMemo(() => new Set(effectiveSelected), [effectiveSelected]);
|
|
@@ -6455,10 +6614,10 @@ function DocumentGallery({
|
|
|
6455
6614
|
);
|
|
6456
6615
|
const openDocument = React.useCallback(
|
|
6457
6616
|
(id) => {
|
|
6458
|
-
|
|
6617
|
+
session.setViewingDocument({ id });
|
|
6459
6618
|
onOpenDocument?.(id);
|
|
6460
6619
|
},
|
|
6461
|
-
[onOpenDocument,
|
|
6620
|
+
[onOpenDocument, session]
|
|
6462
6621
|
);
|
|
6463
6622
|
const arbi = useArbi();
|
|
6464
6623
|
const queryClient = useQueryClient();
|
|
@@ -7087,6 +7246,6 @@ function hasVideoTrack(blob) {
|
|
|
7087
7246
|
});
|
|
7088
7247
|
}
|
|
7089
7248
|
|
|
7090
|
-
export { ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiWebSocketProvider, ArtifactCanvas, 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, 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, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, accountPath, aliasTakenMessage, annotateThread, announceMailDraftReplaced, arbiMailClient, captureFrameAsBlob, createMailClient, cropImage, dayKey, defaultMailAlias, describeActivity, downloadRecoveryFile, fileAttachment, formatIdentityPrice, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isAliasTakenError, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useActOnStep, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useArbiChat, useArbiConnected, useArbiDocumentSync,
|
|
7249
|
+
export { AccountClientProvider, ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiSessionStateProvider, ArbiWebSocketProvider, ArtifactCanvas, 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, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, accountPath, aliasTakenMessage, annotateThread, announceMailDraftReplaced, arbiAccountClient, arbiMailClient, captureFrameAsBlob, createArbiSessionStore, createMailClient, cropImage, dayKey, defaultMailAlias, describeActivity, downloadRecoveryFile, fileAttachment, formatIdentityPrice, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isAliasTakenError, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, nextViewingDocument, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, selectIsGenerating, selectViewingDocumentId, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useAccountClient, useActOnStep, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiSessionState, useArbiSessionStore, useArbiShellWorkspaces, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAvatarCrop, useCameraStream, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfirmEmailChange, useConnectMailAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationUsage, useCreateAgent, useCreateContact, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteContact, useDeleteWorkflow, useDirectMessages, useDisconnectMailAccount, useEmailChange, useFilteredProjects, useFollowThread, useGrantAgentAccess, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useInviteContacts, useMailAccounts, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useNameEditor, useNotificationPreferences, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveMailDraft, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetTagValues, useShellWorkspaces, useSignOut, useSkills, useStartAgentSession, useStartWorkQuery, useTagKindSchema, useTerminateSession, useUpdateContact, useUpdateConversation, useUpdateMailMessage, useUpdateProfile, useUpdateProjectFields, useUpdateTagKindSchema, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceDocs, useWorkspaceNotificationLevel, userDisplayName, userInitials, workflowStepOf };
|
|
7091
7250
|
//# sourceMappingURL=index.js.map
|
|
7092
7251
|
//# sourceMappingURL=index.js.map
|