@arbidocs/blocks 0.4.69 → 0.4.71
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 +161 -1
- package/bin/arbidocs-copy-pdf-assets.mjs +112 -0
- package/dist/{StreamedArtifactEditor-OPL4KXOT.js → StreamedArtifactEditor-HTNPG4NB.js} +3 -2
- package/dist/StreamedArtifactEditor-HTNPG4NB.js.map +1 -0
- package/dist/{StreamedArtifactEditor-RIKG6CJQ.cjs → StreamedArtifactEditor-IZWYNFMM.cjs} +3 -2
- package/dist/StreamedArtifactEditor-IZWYNFMM.cjs.map +1 -0
- package/dist/agents/index.cjs +221 -220
- package/dist/agents/index.js +5 -4
- package/dist/artifacts/editor/index.cjs +1 -0
- package/dist/artifacts/editor/index.js +1 -0
- package/dist/artifacts/index.cjs +1 -0
- package/dist/artifacts/index.js +1 -0
- package/dist/auth/index.cjs +1 -0
- package/dist/auth/index.js +1 -0
- package/dist/chat/index.cjs +67 -66
- package/dist/chat/index.js +3 -2
- package/dist/{chunk-CW4WXGEN.js → chunk-3TVTG7FK.js} +3 -3
- package/dist/{chunk-CW4WXGEN.js.map → chunk-3TVTG7FK.js.map} +1 -1
- package/dist/chunk-4DVEGXZQ.cjs +72 -0
- package/dist/chunk-4DVEGXZQ.cjs.map +1 -0
- package/dist/{chunk-EHXSBH6U.js → chunk-5HOAOKZL.js} +4 -2
- package/dist/chunk-5HOAOKZL.js.map +1 -0
- package/dist/{chunk-ZYZMCNIS.cjs → chunk-7M22KND4.cjs} +5 -5
- package/dist/{chunk-ZYZMCNIS.cjs.map → chunk-7M22KND4.cjs.map} +1 -1
- package/dist/{chunk-ZQB7HNE6.js → chunk-BMWZTNZB.js} +3 -3
- package/dist/{chunk-ZQB7HNE6.js.map → chunk-BMWZTNZB.js.map} +1 -1
- package/dist/chunk-DES3K4SD.cjs +18 -0
- package/dist/chunk-DES3K4SD.cjs.map +1 -0
- package/dist/{chunk-4HZ46XP2.js → chunk-HLMFU7L2.js} +5 -5
- package/dist/{chunk-4HZ46XP2.js.map → chunk-HLMFU7L2.js.map} +1 -1
- package/dist/{chunk-BR2CPKFU.cjs → chunk-LTA2IAQB.cjs} +6 -6
- package/dist/{chunk-BR2CPKFU.cjs.map → chunk-LTA2IAQB.cjs.map} +1 -1
- package/dist/chunk-ODWCTAH7.js +66 -0
- package/dist/chunk-ODWCTAH7.js.map +1 -0
- package/dist/{chunk-TLQQV7WW.cjs → chunk-THO7DZNN.cjs} +4 -2
- package/dist/chunk-THO7DZNN.cjs.map +1 -0
- package/dist/chunk-VUNV25KB.js +15 -0
- package/dist/chunk-VUNV25KB.js.map +1 -0
- package/dist/{chunk-WKNAFILY.cjs → chunk-XNRGCQPZ.cjs} +3 -3
- package/dist/{chunk-WKNAFILY.cjs.map → chunk-XNRGCQPZ.cjs.map} +1 -1
- package/dist/citations/index.cjs +1 -0
- package/dist/citations/index.js +1 -0
- package/dist/collaboration/index.cjs +1 -0
- package/dist/collaboration/index.js +1 -0
- package/dist/connect/docx.cjs +3 -2
- package/dist/connect/docx.cjs.map +1 -1
- package/dist/connect/docx.js +2 -1
- package/dist/connect/docx.js.map +1 -1
- package/dist/connect/index.cjs +26 -25
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +7 -6
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectionProvider.d.ts +5 -0
- package/dist/connection/types.d.ts +6 -0
- package/dist/document-tools/DocumentToolButtons.d.ts +29 -0
- package/dist/document-tools/MarkupNotices.d.ts +12 -0
- package/dist/document-tools/MarkupViewNote.d.ts +11 -0
- package/dist/document-tools/SignDocumentDialog.d.ts +20 -0
- package/dist/document-tools/SignatureCertificate.d.ts +26 -0
- package/dist/document-tools/SignatureStatus.d.ts +24 -0
- package/dist/document-tools/VersionSnapshotBar.d.ts +27 -0
- package/dist/document-tools/index.cjs +637 -0
- package/dist/document-tools/index.cjs.map +1 -0
- package/dist/document-tools/index.d.ts +7 -0
- package/dist/document-tools/index.js +623 -0
- package/dist/document-tools/index.js.map +1 -0
- package/dist/document-tools/production/ProductionSetDialog.d.ts +23 -0
- package/dist/document-tools/production/index.cjs +102 -0
- package/dist/document-tools/production/index.cjs.map +1 -0
- package/dist/document-tools/production/index.d.ts +1 -0
- package/dist/document-tools/production/index.js +100 -0
- package/dist/document-tools/production/index.js.map +1 -0
- package/dist/document-tools/viewer/AnnotatedPdfViewer.d.ts +54 -0
- package/dist/document-tools/viewer/SignaturePlacementViewer.d.ts +20 -0
- package/dist/document-tools/viewer/index.cjs +273 -0
- package/dist/document-tools/viewer/index.cjs.map +1 -0
- package/dist/document-tools/viewer/index.d.ts +2 -0
- package/dist/document-tools/viewer/index.js +268 -0
- package/dist/document-tools/viewer/index.js.map +1 -0
- package/dist/docx/index.cjs +1 -0
- package/dist/docx/index.cjs.map +1 -1
- package/dist/docx/index.js +1 -0
- package/dist/docx/index.js.map +1 -1
- package/dist/facts/index.cjs +1 -0
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.js +1 -0
- package/dist/facts/index.js.map +1 -1
- package/dist/files/cells/DocumentNameCell.d.ts +3 -1
- package/dist/files/index.cjs +39 -67
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.js +20 -63
- package/dist/files/index.js.map +1 -1
- package/dist/home/index.cjs +1 -0
- package/dist/home/index.cjs.map +1 -1
- package/dist/home/index.js +1 -0
- package/dist/home/index.js.map +1 -1
- package/dist/index.cjs +481 -480
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/lib-6QPUXAQS.cjs +9674 -0
- package/dist/lib-6QPUXAQS.cjs.map +1 -0
- package/dist/lib-NRGL2JGF.js +9672 -0
- package/dist/lib-NRGL2JGF.js.map +1 -0
- package/dist/retrieval/index.cjs +1 -0
- package/dist/retrieval/index.js +1 -0
- package/dist/settings/index.cjs +2 -1
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.js +2 -1
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/index.cjs +1 -0
- package/dist/shell/index.js +1 -0
- package/dist/site/index.cjs +1 -0
- package/dist/site/index.js +1 -0
- package/dist/studio/index.cjs +5 -4
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +3 -2
- package/dist/studio/index.js.map +1 -1
- package/dist/timeline/index.cjs +1 -0
- package/dist/timeline/index.js +1 -0
- package/dist/workspaces/index.cjs +1 -0
- package/dist/workspaces/index.cjs.map +1 -1
- package/dist/workspaces/index.js +1 -0
- package/dist/workspaces/index.js.map +1 -1
- package/package.json +32 -4
- package/dist/StreamedArtifactEditor-OPL4KXOT.js.map +0 -1
- package/dist/StreamedArtifactEditor-RIKG6CJQ.cjs.map +0 -1
- package/dist/chunk-EHXSBH6U.js.map +0 -1
- package/dist/chunk-TLQQV7WW.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/connection/ArbiAppProvider.tsx","../../src/connection/ConnectedTaskAccessRequest.tsx","../../src/connection/ConnectedSkillUpload.tsx","../../src/connection/StreamedArtifact.tsx","../../src/connection/useConnectedShellWorkspaces.ts","../../src/connection/ConnectedSettings.tsx","../../src/connection/useConnectedDocxNotifications.ts","../../src/connection/useConnectedWorkNotifications.ts","../../src/connection/ConnectedAgentChatPanel.tsx"],"names":["jsx","useState","jsxs","Button","notify","useWorkspaces","useEffect","useNotify"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,wBAAA,CAAyB,EAAE,QAAA,EAAS,EAA4B;AACvE,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,aAAA,EAAc;AACjC,EAAA,uBACE,GAAA,CAAC,qBAAA,EAAA,EAAsB,OAAA,EAAS,MAAA,KAAW,iBAAkB,QAAA,EAAS,CAAA;AAE1E;AAEO,SAAS,eAAA,CAAgB;AAAA,EAC9B,MAAA;AAAA,EACA;AACF,CAAA,EAGG;AACD,EAAA,MAAM,CAAC,WAAW,CAAA,G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EAE9F,CAAA;AAEJ","file":"index.js","sourcesContent":["/**\n * Composition root for a host app on the ARBI React SDK.\n *\n * QueryClientProvider → react-query cache shared with the SDK\n * ArbiProvider → the SDK's Arbi instance (no network until login)\n * ConnectionProvider → demo/live auth + workspace layer\n *\n * With no live `apiUrl`, ArbiProvider is still mounted (cheap, inert) against\n * `demoApiUrl` and the app runs entirely in seeded demo mode.\n */\nimport { useState, type ReactNode } from 'react'\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { ArbiProvider, ArbiWebSocketProvider } from '@arbidocs/react'\nimport { ConnectionProvider, useConnection } from './ConnectionProvider'\nimport type { ArbiConnectionConfig } from './types'\n\n/**\n * Opens the shared SDK WebSocket once the app is live-authenticated (demo /\n * logged-out sessions have no backend, so they stay disconnected). Lives inside\n * ConnectionProvider so it can read the live status.\n */\nfunction ConnectionBoundWebSocket({ children }: { children: ReactNode }) {\n const { status } = useConnection()\n return (\n <ArbiWebSocketProvider enabled={status === 'authenticated'}>{children}</ArbiWebSocketProvider>\n )\n}\n\nexport function ArbiAppProvider({\n config,\n children,\n}: {\n config: ArbiConnectionConfig\n children: ReactNode\n}) {\n const [queryClient] = useState(\n () =>\n new QueryClient({\n defaultOptions: { queries: { staleTime: 30_000, retry: 1, refetchOnWindowFocus: false } },\n })\n )\n\n const providerUrl = config.apiUrl || config.demoApiUrl || 'https://demo.arbi.local'\n\n return (\n <QueryClientProvider client={queryClient}>\n <ArbiProvider url={providerUrl}>\n <ConnectionProvider config={config}>\n <ConnectionBoundWebSocket>{children}</ConnectionBoundWebSocket>\n </ConnectionProvider>\n </ArbiProvider>\n </QueryClientProvider>\n )\n}\n","import { useConversations, useRunConversation } from '@arbidocs/react'\nimport { Button } from '@arbidocs/react/ui'\nimport { useConnection } from './ConnectionProvider'\n\n/** Approval for a parked agent run, scoped to the currently selected task. */\nexport function ConnectedTaskAccessRequest({ conversationId }: { conversationId?: string }) {\n const { workspaceId } = useConnection()\n const tasks = useConversations(workspaceId ?? undefined, { live: true })\n const run = useRunConversation()\n const task = tasks.data?.find((item) => item.external_id === conversationId)\n if (!task?.pending_auth_request_id || !task.is_owner) return null\n return (\n <section\n className=\"flex flex-wrap items-center gap-3 rounded-lg border bg-card p-3\"\n data-testid=\"task-chat-access-request\"\n >\n <p className=\"flex-1 text-sm\">This task is waiting for temporary workspace access.</p>\n <Button\n disabled={run.isPending}\n onClick={() => run.mutate(task.external_id)}\n data-testid=\"task-chat-allow-access\"\n >\n {run.isPending ? 'Allowing access…' : 'Allow access and run'}\n </Button>\n {run.error && (\n <p role=\"alert\" className=\"w-full text-sm text-destructive\">\n {run.error.message}\n </p>\n )}\n </section>\n )\n}\n","import { useState } from 'react'\nimport { useUploadSkillFiles } from '@arbidocs/react'\nimport { Button, Input, Label } from '@arbidocs/react/ui'\n\n/** Import a main skill file; uploaded skills appear in the shared skill launcher. */\nexport function ConnectedSkillUpload() {\n const [name, setName] = useState('')\n const [file, setFile] = useState<File | null>(null)\n const upload = useUploadSkillFiles()\n const slug = name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9_-]+/g, '-')\n .replace(/^-+|-+$/g, '')\n return (\n <section className=\"space-y-3 rounded-lg border p-4\" data-testid=\"skill-upload\">\n <h2 className=\"text-sm font-semibold\">Add a skill</h2>\n <p className=\"text-xs text-muted-foreground\">\n Upload a SKILL.md file containing the instructions your assistant should follow.\n </p>\n <Label htmlFor=\"skill-upload-name\">Skill name</Label>\n <Input\n id=\"skill-upload-name\"\n value={name}\n onChange={(event) => setName(event.target.value)}\n placeholder=\"disclosure-review\"\n data-testid=\"skill-upload-name\"\n />\n <Input\n type=\"file\"\n accept=\".md\"\n aria-label=\"Skill instructions file\"\n onChange={(event) => setFile(event.target.files?.[0] ?? null)}\n data-testid=\"skill-upload-file\"\n />\n <Button\n disabled={!slug || !file || upload.isPending}\n onClick={() =>\n file && upload.mutate([{ folder: `skills/${slug}`, fileName: 'SKILL.md', content: file }])\n }\n data-testid=\"skill-upload-submit\"\n >\n {upload.isPending ? 'Uploading…' : 'Upload skill'}\n </Button>\n {upload.isSuccess && (\n <p role=\"status\" className=\"text-sm\">\n Uploaded. The skill will appear once processing finishes.\n </p>\n )}\n {upload.error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {upload.error.message}\n </p>\n )}\n </section>\n )\n}\n","import { lazy, Suspense } from 'react'\nimport { ArtifactCanvas } from '@arbidocs/react'\nimport { useStreamedArtifact, type UseStreamedArtifactOptions } from '@arbidocs/react/artifacts'\nimport {\n StreamedArtifactFrame,\n type StreamedArtifactFrameLabels,\n type StreamedArtifactFrameTestIds,\n} from '../artifacts/StreamedArtifactFrame'\nimport type { ArtifactEvent } from './ai'\nimport type { StreamedArtifactEditorProps } from './StreamedArtifactEditor'\n\n// The editor (MDXEditor, Lexical) stays out of the bundle until a draft is ready to edit.\nconst StreamedArtifactEditor = lazy(() => import('./StreamedArtifactEditor'))\n\nexport interface StreamedArtifactProps\n extends\n Pick<UseStreamedArtifactOptions, 'configId' | 'parseRetry' | 'clean'>,\n Pick<\n StreamedArtifactEditorProps,\n 'editorProps' | 'onSaved' | 'onSaveError' | 'actions' | 'hideDefaultActions'\n > {\n /** The artifacts of the agent run (`useConnectedAiTask().artifacts`). */\n artifacts: ArtifactEvent[]\n workspaceId: string | undefined\n /** The agent is still working: show the live canvas. */\n busy: boolean\n /** The run failed; with no draft the canvas shows it. */\n error?: string | null\n stepCount?: number\n busyHint?: string\n emptyHint?: string\n className?: string\n /** Root test id of the editor; the preparing state is `${testId}-preparing`. */\n testId?: string\n labels?: Partial<StreamedArtifactFrameLabels>\n testIds?: Partial<StreamedArtifactFrameTestIds>\n}\n\n/**\n * An agent-drafted artifact from stream to editor, in one part. Pass the run's `artifacts` and\n * whether it is `busy`; it shows\n *\n * 1. the live `ArtifactCanvas` while the agent streams;\n * 2. \"Preparing editor...\" (the canvas stays readable underneath) while the finished draft is\n * cleaned (`cleanDraftMarkdown`), stored as version 1 of the artifact (`wpType: 'artifact'`)\n * and parsed by the backend, which can take up to about a minute;\n * 3. `ArtifactEditor` on the stored version (edit, save a new version, version list, compare\n * with track changes) when its text is ready;\n * 4. an error with Retry when storing or parsing fails.\n *\n * Needs `<ArbiProvider>` + React Query. The host imports the editor stylesheet\n * (`@mdxeditor/editor/style.css`) and defines the global `Prism` in a module it imports at app\n * start (see the Artifacts section of docs/design/blocks-package.md).\n *\n * ```tsx\n * const task = useConnectedAiTask()\n * <StreamedArtifact artifacts={task.artifacts} workspaceId={workspaceId} busy={task.status === 'running'} error={task.error} />\n * ```\n */\nexport function StreamedArtifact({\n artifacts,\n workspaceId,\n busy,\n error = null,\n stepCount,\n busyHint,\n emptyHint,\n className,\n testId = 'streamed-artifact',\n configId,\n parseRetry,\n clean,\n editorProps,\n onSaved,\n onSaveError,\n actions,\n hideDefaultActions,\n labels,\n testIds,\n}: StreamedArtifactProps) {\n const streamed = useStreamedArtifact({\n artifacts,\n workspaceId,\n settled: !busy && !error,\n configId,\n parseRetry,\n clean,\n })\n const canvas = (\n <ArtifactCanvas\n artifacts={artifacts}\n className={streamed.phase === 'streaming' ? className : undefined}\n busy={busy}\n busyHint={busyHint}\n stepCount={stepCount}\n error={error}\n emptyHint={emptyHint}\n />\n )\n return (\n <StreamedArtifactFrame\n phase={streamed.phase}\n canvas={canvas}\n className={className}\n error={streamed.error?.message}\n onRetry={streamed.retry}\n labels={labels}\n testIds={{ preparing: `${testId}-preparing`, error: `${testId}-error`, ...testIds }}\n >\n <Suspense fallback={canvas}>\n {streamed.docId && (\n <StreamedArtifactEditor\n key={streamed.docId}\n workspaceId={workspaceId}\n docId={streamed.docId}\n title={streamed.artifact?.title ?? 'Draft'}\n testId={testId}\n className={className}\n editorProps={editorProps}\n onSaved={onSaved}\n onSaveError={onSaveError}\n actions={actions}\n hideDefaultActions={hideDefaultActions}\n />\n )}\n </Suspense>\n </StreamedArtifactFrame>\n )\n}\n","import {\n useShellWorkspaces,\n useWorkspaces,\n type ShellWorkspaceSource,\n type UseShellWorkspacesOptions,\n type UseShellWorkspacesResult,\n} from '@arbidocs/react'\nimport { useConnection } from './ConnectionProvider'\n\nexport type UseConnectedShellWorkspacesOptions = Omit<\n UseShellWorkspacesOptions,\n 'workspaces' | 'isLoading' | 'loadError' | 'selectedId' | 'select'\n>\n\n/**\n * `useShellWorkspaces` wired to the connection layer: the account's live workspaces, the\n * connection's single selection as the active workspace, and `open` = `setWorkspace` (opens it on\n * the server, remembers it for the next login) then `onOpened`.\n *\n * ```tsx\n * const { active, recent, open } = useConnectedShellWorkspaces({\n * seed: { workspaces: demoWorkspaces, activeId: 'demo-1' },\n * onOpened: () => navigate('/app/documents'),\n * })\n * ```\n */\nexport function useConnectedShellWorkspaces(\n options: UseConnectedShellWorkspacesOptions = {}\n): UseShellWorkspacesResult {\n const { workspaceId, setWorkspace } = useConnection()\n const query = useWorkspaces()\n return useShellWorkspaces({\n ...options,\n workspaces: Array.isArray(query.data) ? (query.data as ShellWorkspaceSource[]) : undefined,\n isLoading: query.isLoading,\n loadError: query.error,\n selectedId: workspaceId,\n select: (workspace) => setWorkspace(workspace.id),\n })\n}\n","/**\n * The account area of a settings page, bound to the ARBI SDK: each section is a blocks part wired\n * to its `@arbidocs/react` hook, so a host drops them in a `SettingsPanel` and owns only the\n * layout (see the \"Settings page recipe\" in docs/design/blocks-package.md).\n *\n * Every section takes an optional `notify` for toasts and renders the default test ids of its\n * part. Anything the hooks cannot know (the recovery-key download, the billing link of a blocked\n * deletion, the password policy) is a prop.\n */\nimport { useMemo, useState, type ReactNode } from 'react'\nimport { KeyRound, Radio, UserCircle } from 'lucide-react'\nimport {\n ImageCropModal,\n useAvatarCrop,\n useConfirmEmailChange,\n useCurrentSessionId,\n useDeleteAccount,\n useDeleteAccountFlow,\n useEmailChange,\n useLogoutAllSessions,\n useNameEditor,\n useNotificationPreferences,\n usePasswordChange,\n usePasswordChangeForm,\n useProfile,\n useRequestEmailChange,\n useSessions,\n useTerminateSession,\n useUpdateProfile,\n useWorkspaces,\n type AvatarFileProblem,\n type PasswordChangeResult,\n} from '@arbidocs/react'\nimport { Button } from '@arbidocs/react/ui'\nimport { initials } from '../lib/format'\nimport { AvatarPicker } from '../settings/AvatarPicker'\nimport { ProfileCard } from '../settings/ProfileCard'\nimport {\n SettingsActionRow,\n SettingsCard,\n SettingsDangerZone,\n SettingsRow,\n SettingsSection,\n} from '../settings/SettingsPanel'\nimport { PasswordChangeDialog } from '../settings/PasswordChangeDialog'\nimport { ActiveSessionsDialog, DeleteAccountDialog } from '../settings/AccountDialogs'\nimport { LogoutDialog } from '../settings/LogoutDialog'\nimport { NotificationCategoryList } from '../settings/NotificationCategoryList'\nimport {\n EMAIL_NOTIFICATION_CATEGORIES,\n EMAIL_NOTIFICATION_KEYS,\n toActiveSessionViews,\n toDeleteBlockerViews,\n toLogoutSessionViews,\n toNotificationCategories,\n type EmailNotificationCategoryDef,\n} from '../settings/account-views'\nimport { useConnection } from './ConnectionProvider'\n\nexport type SettingsNotify = (message: string, kind: 'success' | 'error') => void\n\n/** The error text of a failed call: the backend `detail` when it sent one. */\nfunction errorText(error: unknown, fallback: string): string {\n const body = (error as { apiError?: { detail?: unknown } } | null)?.apiError\n return typeof body?.detail === 'string' ? body.detail : fallback\n}\n\nconst AVATAR_PROBLEMS: Record<AvatarFileProblem, string> = {\n 'not-image': 'Please choose an image file',\n 'too-large': 'Image must be 5 MB or smaller',\n unreadable: \"Couldn't read that image — try a different file\",\n}\n\n// ── Profile ─────────────────────────────────────────────────────────────────\n\nexport interface ConnectedProfileCardProps {\n notify?: SettingsNotify\n /** Section heading; default `Profile`. */\n title?: ReactNode\n}\n\n/** Avatar, editable name and email change of the signed-in user (`ProfileCard`). */\nexport function ConnectedProfileCard({ notify, title = 'Profile' }: ConnectedProfileCardProps) {\n const { data: profile } = useProfile()\n const updateProfile = useUpdateProfile()\n const requestEmailChange = useRequestEmailChange()\n const confirmEmailChange = useConfirmEmailChange()\n const { user } = useConnection()\n\n const name = useNameEditor({\n givenName: profile?.givenName,\n familyName: profile?.familyName,\n save: async (next) => {\n try {\n await updateProfile.mutateAsync(next)\n notify?.('Name updated', 'success')\n } catch (e) {\n notify?.('Failed to update name', 'error')\n throw e\n }\n },\n })\n const avatar = useAvatarCrop({\n upload: async (picture) => {\n try {\n await updateProfile.mutateAsync({ picture })\n notify?.('Profile picture updated', 'success')\n } catch (e) {\n notify?.('Failed to update picture', 'error')\n throw e\n }\n },\n onProblem: (problem) => notify?.(AVATAR_PROBLEMS[problem], 'error'),\n })\n const email = useEmailChange({\n requestCode: async (address) => {\n try {\n await requestEmailChange.mutateAsync(address)\n notify?.('Verification code sent to your new email', 'success')\n } catch (e) {\n notify?.(errorText(e, 'Failed to send verification code'), 'error')\n throw e\n }\n },\n confirm: async (args) => {\n try {\n await confirmEmailChange.mutateAsync(args)\n notify?.('Email address updated', 'success')\n } catch (e) {\n notify?.(errorText(e, 'Invalid or expired verification code'), 'error')\n throw e\n }\n },\n })\n\n const display = profile?.fullName || user?.name || 'Unnamed'\n return (\n <SettingsSection icon={<UserCircle />} title={title}>\n <ProfileCard\n avatar={\n <>\n <AvatarPicker\n pictureUrl={profile?.picture ?? user?.picture}\n initials={initials(display)}\n fallbackClassName=\"bg-primary text-primary-foreground\"\n isUploading={avatar.isUploading}\n onFileChosen={avatar.onFileChosen}\n />\n <ImageCropModal\n open={avatar.pendingImage !== null}\n image={avatar.pendingImage}\n title=\"Crop your photo\"\n aspect={1}\n cropShape=\"round\"\n output={{ maxSize: 128, mimeType: 'image/jpeg', quality: 0.85 }}\n onComplete={avatar.onCropComplete}\n onCancel={avatar.onCropCancel}\n />\n </>\n }\n name={{ ...name, display, isSaving: name.isSaving }}\n email={profile?.email ?? user?.email ?? ''}\n isSso={profile?.isSso ?? false}\n onStartEmailChange={email.onStart}\n emailChange={email.isOpen ? email : undefined}\n />\n </SettingsSection>\n )\n}\n\n// ── Security: password ──────────────────────────────────────────────────────\n\n/** The default password policy: 8 characters, an uppercase letter or symbol, a digit. */\nexport function defaultUnmetPasswordRequirement(password: string): string | null {\n if (password.length < 8) return 'Minimum 8 characters'\n if (!/[A-Z!@#$%^&*()_+\\-=[\\]{};':\"\\\\|,.<>/?]/.test(password)) {\n return 'At least one uppercase letter or special character'\n }\n if (!/[0-9]/.test(password)) return 'At least one number'\n return null\n}\n\nexport interface ConnectedSecuritySectionProps {\n notify?: SettingsNotify\n /** The host's password policy; default is {@link defaultUnmetPasswordRequirement}. */\n getUnmetRequirement?: (password: string) => string | null\n /** The recovery-key download for the key the new password produced (shown on success). */\n renderRecoveryKey?: (result: PasswordChangeResult) => ReactNode\n /** Extra rows under \"Change password\" (e.g. \"Save recovery key\"). */\n children?: ReactNode\n}\n\n/** The Security card: \"Change password\" and the dialog behind it (`PasswordChangeDialog`). */\nexport function ConnectedSecuritySection({\n notify,\n getUnmetRequirement = defaultUnmetPasswordRequirement,\n renderRecoveryKey,\n children,\n}: ConnectedSecuritySectionProps) {\n const [open, setOpen] = useState(false)\n const change = usePasswordChange()\n // Only workspaces the user belongs to are re-keyed.\n const { data: workspaces } = useWorkspaces({ enabled: open })\n const workspaceCount = (workspaces ?? []).filter((w) => w.is_member).length\n const form = usePasswordChangeForm<PasswordChangeResult>({\n getUnmetRequirement,\n submit: async (vars) => {\n const result = await change.mutateAsync(vars)\n notify?.('Password changed successfully', 'success')\n return result\n },\n onClose: () => setOpen(false),\n })\n\n return (\n <SettingsSection icon={<KeyRound />} title=\"Security\">\n <SettingsCard padding=\"sm\">\n <SettingsActionRow\n title=\"Change password\"\n description=\"Used to sign in and to encrypt your data. Changing it re-encrypts everything in your account.\"\n onClick={() => setOpen(true)}\n testId=\"change-password-button\"\n />\n {children}\n </SettingsCard>\n <PasswordChangeDialog\n open={open}\n onClose={form.onCancel}\n recoveryMode={false}\n currentPassword={form.currentPassword}\n onCurrentPasswordChange={form.onCurrentPasswordChange}\n newPassword={form.newPassword}\n onNewPasswordChange={form.onNewPasswordChange}\n confirmPassword={form.confirmPassword}\n onConfirmPasswordChange={form.onConfirmPasswordChange}\n getUnmetRequirement={getUnmetRequirement}\n workspaceCount={workspaceCount}\n error={form.error}\n isProcessing={form.isProcessing}\n isSubmitDisabled={form.isSubmitDisabled}\n onSubmit={form.onSubmit}\n success={form.result ? (renderRecoveryKey?.(form.result) ?? <></>) : null}\n onDone={form.onDone}\n />\n </SettingsSection>\n )\n}\n\n// ── Notifications ───────────────────────────────────────────────────────────\n\nexport interface ConnectedNotificationPreferencesProps {\n /** Categories to offer; default {@link EMAIL_NOTIFICATION_CATEGORIES}. */\n categories?: readonly EmailNotificationCategoryDef[]\n title?: ReactNode\n}\n\n/** The email-notification switches (`NotificationCategoryList`) over the user settings. */\nexport function ConnectedNotificationPreferences({\n categories = EMAIL_NOTIFICATION_CATEGORIES,\n title = 'Notifications',\n}: ConnectedNotificationPreferencesProps) {\n const keys = useMemo(\n () =>\n categories === EMAIL_NOTIFICATION_CATEGORIES\n ? EMAIL_NOTIFICATION_KEYS\n : categories.map((c) => c.key),\n [categories]\n )\n const prefs = useNotificationPreferences(keys)\n return (\n <SettingsSection title={title}>\n <SettingsCard className=\"space-y-0\">\n <NotificationCategoryList\n masterId=\"emailNotifications\"\n masterTitle=\"Email Notifications\"\n masterDescription=\"Email me about activity when I’m away\"\n masterChecked={prefs.masterChecked}\n onMasterChange={prefs.setAll}\n categories={toNotificationCategories(prefs.checked, categories)}\n onCategoryChange={prefs.setCategory}\n />\n </SettingsCard>\n </SettingsSection>\n )\n}\n\n// ── Sessions ────────────────────────────────────────────────────────────────\n\nexport interface ConnectedSessionsRowProps {\n notify?: SettingsNotify\n /** Ask before ending a session; resolve `false` to cancel. Default: end at once. */\n confirm?: (message: string) => Promise<boolean> | boolean\n /** Glyph per session status. */\n renderSessionIcon?: (status: string) => ReactNode\n}\n\n/** \"Active sessions\" row with the manage dialog (`ActiveSessionsDialog`); end any but this device. */\nexport function ConnectedSessionsRow({\n notify,\n confirm,\n renderSessionIcon,\n}: ConnectedSessionsRowProps) {\n const [open, setOpen] = useState(false)\n const sessions = useSessions({ enabled: open })\n const currentSessionId = useCurrentSessionId()\n const terminate = useTerminateSession()\n const views = toActiveSessionViews(sessions.data ?? [], {\n currentSessionId,\n terminatingId: terminate.isPending ? terminate.variables : null,\n renderIcon: renderSessionIcon,\n })\n return (\n <>\n <SettingsRow\n label=\"Active sessions\"\n description=\"Devices and agents currently signed in to your account.\"\n >\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setOpen(true)}\n className=\"flex items-center gap-2\"\n data-testid=\"active-sessions-button\"\n >\n <Radio className=\"h-4 w-4\" />\n Manage\n </Button>\n </SettingsRow>\n <ActiveSessionsDialog\n open={open}\n onOpenChange={setOpen}\n isLoading={sessions.isLoading}\n sessions={views}\n onTerminate={(id) => {\n void (async () => {\n const view = views.find((v) => v.id === id)\n const label = view?.detail.split(' · ')[0]\n const ok =\n (await confirm?.(\n `End the session on ${label}? It will be signed out immediately.`\n )) ?? true\n if (!ok) return\n try {\n await terminate.mutateAsync(id)\n } catch {\n notify?.('Failed to end session. Please try again.', 'error')\n }\n })()\n }}\n />\n </>\n )\n}\n\nexport interface ConnectedLogoutDialogProps {\n open: boolean\n onClose: () => void\n isOnline?: boolean\n renderSessionIcon?: (status: string) => ReactNode\n}\n\n/** Sign out of this device or all devices (`LogoutDialog`), listing the active sessions. */\nexport function ConnectedLogoutDialog({\n open,\n onClose,\n isOnline = true,\n renderSessionIcon,\n}: ConnectedLogoutDialogProps) {\n const { logout } = useConnection()\n const sessions = useSessions({ enabled: open })\n const logoutAll = useLogoutAllSessions()\n return (\n <LogoutDialog\n open={open}\n onClose={onClose}\n onLogoutThis={() => {\n onClose()\n logout()\n }}\n onLogoutAll={() => {\n onClose()\n // The server drops every session first; the connection then forgets this one.\n void logoutAll.mutateAsync().finally(logout)\n }}\n canLogoutAll\n isOnline={isOnline}\n sessions={toLogoutSessionViews(sessions.data ?? [])}\n renderSessionIcon={renderSessionIcon}\n />\n )\n}\n\n// ── Danger zone ─────────────────────────────────────────────────────────────\n\nexport interface ConnectedDangerZoneProps {\n notify?: SettingsNotify\n /** Link to the billing page for a deletion blocked by an active subscription. */\n renderSubscriptionLink?: () => ReactNode\n}\n\n/** \"Delete your account\": the collapsed danger zone and the two-step dialog (`DeleteAccountDialog`). */\nexport function ConnectedDangerZone({ notify, renderSubscriptionLink }: ConnectedDangerZoneProps) {\n const [zoneOpen, setZoneOpen] = useState(false)\n const [dialogOpen, setDialogOpen] = useState(false)\n const { user, logout } = useConnection()\n const remove = useDeleteAccount()\n const flow = useDeleteAccountFlow({\n userEmail: user?.email ?? '',\n remove: () => remove.mutateAsync(),\n onClose: () => setDialogOpen(false),\n onDeleted: logout,\n onError: () => notify?.('Failed to delete account. Please try again.', 'error'),\n })\n return (\n <>\n <SettingsDangerZone\n isOpen={zoneOpen}\n onToggle={() => setZoneOpen((o) => !o)}\n title=\"Delete your account\"\n description=\"Once deleted, your account will be immediately closed and you will be logged out. This action cannot be undone.\"\n action={\n <Button\n variant=\"destructive\"\n size=\"sm\"\n disabled={!user?.email}\n onClick={() => setDialogOpen(true)}\n data-testid=\"delete-account-button\"\n >\n Delete Account\n </Button>\n }\n />\n <DeleteAccountDialog\n open={dialogOpen}\n onClose={flow.onClose}\n step={flow.step}\n blockers={toDeleteBlockerViews(flow.blockers, renderSubscriptionLink)}\n onContinue={flow.onContinue}\n onBack={flow.onBack}\n userEmail={user?.email ?? ''}\n confirmEmail={flow.confirmEmail}\n onConfirmEmailChange={flow.onConfirmEmailChange}\n isDeleting={flow.isDeleting}\n onSubmit={flow.onSubmit}\n />\n </>\n )\n}\n","import { useEffect } from 'react'\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport { useArbi, useArbiWebSocket, notify, type AppNotification } from '@arbidocs/react'\nimport { useNotify } from '@arbidocs/react/shell'\nimport { useConnection } from './ConnectionProvider'\n\n/** Bridge persisted document mentions to the shared bell; hosts own routing. */\nexport function useConnectedDocxNotifications(\n onOpen: (target: {\n workspaceId: string\n documentId: string\n commentId: string\n }) => void | Promise<void>\n) {\n const arbi = useArbi()\n const { status, user, apiUrl } = useConnection()\n const queries = useQueryClient()\n const source = `docx-mentions:${apiUrl}:${user?.externalId || ''}`\n const queryKey = ['docx-mentions', apiUrl, user?.externalId]\n const { data = [] } = useQuery({\n queryKey,\n queryFn: () => arbi.notifications.list('docx_mention'),\n enabled: status === 'authenticated',\n refetchInterval: 30_000,\n })\n useArbiWebSocket((message) => {\n if (message.type === 'docx_mention') void queries.invalidateQueries({ queryKey })\n })\n useEffect(() => {\n const items: AppNotification[] = []\n if (status === 'authenticated')\n for (const note of data) {\n if (note.recipient.external_id !== user?.externalId || !note.workspace_ext_id) continue\n try {\n const target = JSON.parse(note.content || '{}') as {\n document_id?: string\n comment_id?: string\n }\n if (!target.document_id?.startsWith('doc-') || !target.comment_id) continue\n const documentId = target.document_id,\n commentId = target.comment_id,\n workspaceId = note.workspace_ext_id\n items.push({\n id: `docx:${note.external_id}`,\n title: 'Mentioned you in a document comment',\n description: [note.sender.given_name, note.sender.family_name]\n .filter(Boolean)\n .join(' '),\n variant: 'info',\n ts: Date.parse(note.created_at),\n read: note.read,\n source,\n onSelect: () => {\n void Promise.resolve(onOpen({ documentId, commentId, workspaceId })).catch((error) =>\n notify.error(\n error instanceof Error ? error.message : 'Could not open the document.'\n )\n )\n },\n })\n } catch {\n /* Ignore invalid legacy payloads. */\n }\n }\n useNotify.getState().syncSource(source, items)\n return () => useNotify.getState().syncSource(source, [])\n }, [data, status, user?.externalId, source, onOpen])\n const markRead = async (ids: string[]) => {\n try {\n await arbi.notifications.markRead(ids)\n await queries.invalidateQueries({ queryKey })\n } catch {\n notify.error('Could not mark document mentions read.')\n }\n }\n return {\n onMarkRead: (id: string) => {\n if (id.startsWith('docx:')) void markRead([id.slice(5)])\n },\n onMarkAllRead: () => {\n void markRead(\n data\n .filter((note) => !note.read && note.recipient.external_id === user?.externalId)\n .map((note) => note.external_id)\n )\n },\n }\n}\n","import { useEffect } from 'react'\nimport { useWorkNotifications, notify, type AppNotification } from '@arbidocs/react'\nimport { useNotify } from '@arbidocs/react/shell'\nimport type { components } from '@arbidocs/client'\nimport { useConnection } from './ConnectionProvider'\n\nexport type WorkNotificationTarget =\n | { kind: 'conversation'; workspaceId: string; conversationId: string; messageId?: string }\n | { kind: 'workflow'; workspaceId?: string; workflowId: string }\n\n/** Persisted work notifications in the shared bell; the consumer owns navigation. */\nexport function useConnectedWorkNotifications(\n onOpen: (target: WorkNotificationTarget) => void | Promise<void>\n) {\n const { status, user, apiUrl } = useConnection()\n const source = `work-notifications:${apiUrl}:${user?.externalId || ''}`\n const { data = [], markRead: persistRead } = useWorkNotifications({\n apiUrl,\n userId: user?.externalId,\n enabled: status === 'authenticated',\n })\n useEffect(() => {\n const items: AppNotification[] = []\n if (status === 'authenticated')\n for (const note of data) {\n if (note.recipient.external_id !== user?.externalId) continue\n const mapped = mapWorkNotification(note)\n if (!mapped) continue\n items.push({\n id: `work:${note.external_id}`,\n title: mapped.title,\n variant:\n note.type === 'workflow_failed'\n ? 'error'\n : note.type === 'conversation_done'\n ? 'success'\n : 'info',\n ts: Date.parse(note.created_at),\n read: note.read,\n source,\n onSelect: () => {\n void Promise.resolve()\n .then(() => onOpen(mapped.target))\n .catch((error) =>\n notify.error(\n error instanceof Error ? error.message : 'Could not open this notification.'\n )\n )\n },\n })\n }\n useNotify.getState().syncSource(source, items)\n return () => useNotify.getState().syncSource(source, [])\n }, [data, status, user?.externalId, source, onOpen])\n const markRead = async (ids: string[]) => {\n if (!ids.length) return\n try {\n await persistRead(ids)\n } catch {\n notify.error('Could not mark work notifications read.')\n }\n }\n return {\n onMarkRead: (id: string) => {\n // Only received, currently loaded work rows belong to this source.\n if (\n data.some(\n (note) =>\n `work:${note.external_id}` === id &&\n note.recipient.external_id === user?.externalId &&\n mapWorkNotification(note)\n )\n )\n void markRead([id.slice(5)])\n },\n onMarkAllRead: () => {\n void markRead(\n data\n .filter(\n (note) =>\n !note.read &&\n note.recipient.external_id === user?.externalId &&\n mapWorkNotification(note)\n )\n .map((note) => note.external_id)\n )\n },\n }\n}\n\n/** Route from explicit IDs; encrypted task text is never needed for a link. */\nexport function mapWorkNotification(note: components['schemas']['NotificationResponse']): {\n title: string\n target: WorkNotificationTarget\n} | null {\n const sender =\n [note.sender.given_name, note.sender.family_name].filter(Boolean).join(' ') || note.sender.email\n if (note.type === 'workflow_failed') {\n try {\n const payload = JSON.parse(note.content || '{}') as { workflow_ext_id?: string }\n if (!payload.workflow_ext_id?.match(/^wfl-[a-zA-Z0-9]+$/)) return null\n if (\n note.workspace_ext_id?.match(/^wrk-[a-zA-Z0-9]+$/) &&\n note.conversation_ext_id?.match(/^con-[a-zA-Z0-9]+$/)\n ) {\n return {\n title: 'A workflow failed to run',\n target: {\n kind: 'conversation',\n workspaceId: note.workspace_ext_id,\n conversationId: note.conversation_ext_id,\n },\n }\n }\n return {\n title: 'A workflow failed to run',\n target: {\n kind: 'workflow',\n workflowId: payload.workflow_ext_id,\n workspaceId: note.workspace_ext_id || undefined,\n },\n }\n } catch {\n return null\n }\n }\n const titles: Partial<Record<components['schemas']['NotificationType'], string>> = {\n mention: `${sender} mentioned you in a conversation`,\n workspace_access_request: `${sender} needs workspace access to run a task`,\n conversation_ready: `${sender} has a task ready`,\n conversation_done: `${sender} marked a task done`,\n }\n const title = titles[note.type]\n if (!title || !note.workspace_ext_id || !note.conversation_ext_id?.match(/^con-[a-zA-Z0-9]+$/))\n return null\n return {\n title,\n target: {\n kind: 'conversation',\n workspaceId: note.workspace_ext_id,\n conversationId: note.conversation_ext_id,\n ...(note.message_ext_id ? { messageId: note.message_ext_id } : {}),\n },\n }\n}\n","import {\n useAgentSession,\n useStartAgentSession,\n useCloseAgentSession,\n useArbiChat,\n} from '@arbidocs/react'\nimport { Button } from '@arbidocs/react/ui'\nimport { ChatPage } from '../chat/ChatPage'\n\nexport interface ConnectedAgentChatPanelProps {\n agentId: string\n workspaceId: string\n agentName?: string\n}\n\nfunction ActiveChat({ agentId, workspaceId }: ConnectedAgentChatPanelProps) {\n const chat = useArbiChat({ agentId, workspaceId })\n return (\n <ChatPage\n chat={{ ...chat, assistantMode: undefined, setAssistantMode: undefined }}\n documentsRequired={false}\n compactHeader\n surface=\"dock\"\n emptyTitle=\"What would you like me to do?\"\n emptyDescription=\"This agent works through its own login. Upload files here to stage them in its sandbox.\"\n className=\"h-[min(65vh,650px)] min-h-[380px]\"\n />\n )\n}\n\n/** An owned agent's independent login and chat, using the shared controller and chat surface. */\nexport function ConnectedAgentChatPanel({\n agentId,\n workspaceId,\n agentName = 'Agent',\n}: ConnectedAgentChatPanelProps) {\n const session = useAgentSession(agentId)\n const start = useStartAgentSession()\n const close = useCloseAgentSession()\n const ready = session.data?.active && session.data.workspace_ext_id === workspaceId\n const busy = start.isPending || close.isPending\n const error = start.error ?? close.error ?? session.error\n return (\n <section className=\"space-y-3\" data-testid=\"agent-chat-panel\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <p className=\"text-sm\" data-testid=\"agent-chat-session-status\">\n {agentName} ·{' '}\n {ready\n ? 'Signed in to this workspace'\n : session.data?.active\n ? `Signed in to ${session.data.workspace_name ?? 'another workspace'}`\n : 'Signed out'}\n </p>\n <div className=\"flex gap-2\">\n {!ready && (\n <Button\n type=\"button\"\n disabled={busy || session.isLoading}\n onClick={() => start.mutate({ agentId, workspaceId })}\n data-testid=\"agent-chat-login\"\n >\n {start.isPending ? 'Signing in…' : 'Sign in here'}\n </Button>\n )}\n {session.data?.active && (\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={busy}\n onClick={() => close.mutate(agentId)}\n data-testid=\"agent-chat-logout\"\n >\n {close.isPending ? 'Signing out…' : 'Sign out agent'}\n </Button>\n )}\n </div>\n </div>\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error.message}\n </p>\n )}\n {ready && (\n <ActiveChat key={`${agentId}:${workspaceId}`} agentId={agentId} workspaceId={workspaceId} />\n )}\n </section>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/connection/ArbiAppProvider.tsx","../../src/connection/ConnectedTaskAccessRequest.tsx","../../src/connection/ConnectedSkillUpload.tsx","../../src/connection/StreamedArtifact.tsx","../../src/connection/useConnectedShellWorkspaces.ts","../../src/connection/ConnectedSettings.tsx","../../src/connection/useConnectedDocxNotifications.ts","../../src/connection/useConnectedWorkNotifications.ts","../../src/connection/ConnectedAgentChatPanel.tsx"],"names":["jsx","useState","jsxs","Button","notify","useWorkspaces","useEffect","useNotify"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,wBAAA,CAAyB,EAAE,QAAA,EAAS,EAA4B;AACvE,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,aAAA,EAAc;AACjC,EAAA,uBACE,GAAA,CAAC,qBAAA,EAAA,EAAsB,OAAA,EAAS,MAAA,KAAW,iBAAkB,QAAA,EAAS,CAAA;AAE1E;AAEO,SAAS,eAAA,CAAgB;AAAA,EAC9B,MAAA;AAAA,EACA;AACF,CAAA,EAGG;AACD,EAAA,MAAM,CAAC,WAAW,CAAA,GAAI,QAAA;AAAA,IACpB,MACE,IAAI,WAAA,CAAY;AAAA,MACd,cAAA,EAAgB,EAAE,OAAA,EAAS,EAAE,SAAA,EAAW,KAAQ,KAAA,EAAO,CAAA,EAAG,oBAAA,EAAsB,KAAA,EAAM;AAAE,KACzF;AAAA,GACL;AAEA,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,MAAA,IAAU,MAAA,CAAO,UAAA,IAAc,yBAAA;AAE1D,EAAA,2BACG,mBAAA,EAAA,EAAoB,MAAA,EAAQ,aAC3B,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,KAAK,WAAA,EAAa,gBAAA,EAAkB,OAAO,gBAAA,EACvD,QAAA,kBAAA,GAAA,CAAC,sBAAmB,MAAA,EAClB,QAAA,kBAAA,GAAA,CAAC,4BAA0B,QAAA,EAAS,CAAA,EACtC,GACF,CAAA,EACF,CAAA;AAEJ;ACh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AAA;AAAA,SACrC;AAAA,QAED,OAAA,CAAQ,IAAA,EAAM,MAAA,oBACbH,GAAAA;AAAA,UAACG,MAAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,QAAA;AAAA,YACL,OAAA,EAAQ,SAAA;AAAA,YACR,QAAA,EAAU,IAAA;AAAA,YACV,OAAA,EAAS,MAAM,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA;AAAA,YACnC,aAAA,EAAY,mBAAA;AAAA,YAEX,QAAA,EAAA,KAAA,CAAM,YAAY,mBAAA,GAAiB;AAAA;AAAA;AACtC,OAAA,EAEJ;AAAA,KAAA,EACF,CAAA;AAAA,IACC,KAAA,oBACCH,GAAAA,CAAC,GAAA,EAAA,EAAE,MAAK,OAAA,EAAQ,SAAA,EAAU,0BAAA,EACvB,QAAA,EAAA,KAAA,CAAM,OAAA,EACT,CAAA;AAAA,IAED,KAAA,oBACCA,GAAAA,CAAC,UAAA,EAAA,EAA6C,OAAA,EAAkB,eAA/C,CAAA,EAAG,OAAO,CAAA,CAAA,EAAI,WAAW,CAAA,CAAgD;AAAA,GAAA,EAE9F,CAAA;AAEJ","file":"index.js","sourcesContent":["/**\n * Composition root for a host app on the ARBI React SDK.\n *\n * QueryClientProvider → react-query cache shared with the SDK\n * ArbiProvider → the SDK's Arbi instance (no network until login)\n * ConnectionProvider → demo/live auth + workspace layer\n *\n * With no live `apiUrl`, ArbiProvider is still mounted (cheap, inert) against\n * `demoApiUrl` and the app runs entirely in seeded demo mode.\n */\nimport { useState, type ReactNode } from 'react'\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { ArbiProvider, ArbiWebSocketProvider } from '@arbidocs/react'\nimport { ConnectionProvider, useConnection } from './ConnectionProvider'\nimport type { ArbiConnectionConfig } from './types'\n\n/**\n * Opens the shared SDK WebSocket once the app is live-authenticated (demo /\n * logged-out sessions have no backend, so they stay disconnected). Lives inside\n * ConnectionProvider so it can read the live status.\n */\nfunction ConnectionBoundWebSocket({ children }: { children: ReactNode }) {\n const { status } = useConnection()\n return (\n <ArbiWebSocketProvider enabled={status === 'authenticated'}>{children}</ArbiWebSocketProvider>\n )\n}\n\nexport function ArbiAppProvider({\n config,\n children,\n}: {\n config: ArbiConnectionConfig\n children: ReactNode\n}) {\n const [queryClient] = useState(\n () =>\n new QueryClient({\n defaultOptions: { queries: { staleTime: 30_000, retry: 1, refetchOnWindowFocus: false } },\n })\n )\n\n const providerUrl = config.apiUrl || config.demoApiUrl || 'https://demo.arbi.local'\n\n return (\n <QueryClientProvider client={queryClient}>\n <ArbiProvider url={providerUrl} deploymentDomain={config.deploymentDomain}>\n <ConnectionProvider config={config}>\n <ConnectionBoundWebSocket>{children}</ConnectionBoundWebSocket>\n </ConnectionProvider>\n </ArbiProvider>\n </QueryClientProvider>\n )\n}\n","import { useConversations, useRunConversation } from '@arbidocs/react'\nimport { Button } from '@arbidocs/react/ui'\nimport { useConnection } from './ConnectionProvider'\n\n/** Approval for a parked agent run, scoped to the currently selected task. */\nexport function ConnectedTaskAccessRequest({ conversationId }: { conversationId?: string }) {\n const { workspaceId } = useConnection()\n const tasks = useConversations(workspaceId ?? undefined, { live: true })\n const run = useRunConversation()\n const task = tasks.data?.find((item) => item.external_id === conversationId)\n if (!task?.pending_auth_request_id || !task.is_owner) return null\n return (\n <section\n className=\"flex flex-wrap items-center gap-3 rounded-lg border bg-card p-3\"\n data-testid=\"task-chat-access-request\"\n >\n <p className=\"flex-1 text-sm\">This task is waiting for temporary workspace access.</p>\n <Button\n disabled={run.isPending}\n onClick={() => run.mutate(task.external_id)}\n data-testid=\"task-chat-allow-access\"\n >\n {run.isPending ? 'Allowing access…' : 'Allow access and run'}\n </Button>\n {run.error && (\n <p role=\"alert\" className=\"w-full text-sm text-destructive\">\n {run.error.message}\n </p>\n )}\n </section>\n )\n}\n","import { useState } from 'react'\nimport { useUploadSkillFiles } from '@arbidocs/react'\nimport { Button, Input, Label } from '@arbidocs/react/ui'\n\n/** Import a main skill file; uploaded skills appear in the shared skill launcher. */\nexport function ConnectedSkillUpload() {\n const [name, setName] = useState('')\n const [file, setFile] = useState<File | null>(null)\n const upload = useUploadSkillFiles()\n const slug = name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9_-]+/g, '-')\n .replace(/^-+|-+$/g, '')\n return (\n <section className=\"space-y-3 rounded-lg border p-4\" data-testid=\"skill-upload\">\n <h2 className=\"text-sm font-semibold\">Add a skill</h2>\n <p className=\"text-xs text-muted-foreground\">\n Upload a SKILL.md file containing the instructions your assistant should follow.\n </p>\n <Label htmlFor=\"skill-upload-name\">Skill name</Label>\n <Input\n id=\"skill-upload-name\"\n value={name}\n onChange={(event) => setName(event.target.value)}\n placeholder=\"disclosure-review\"\n data-testid=\"skill-upload-name\"\n />\n <Input\n type=\"file\"\n accept=\".md\"\n aria-label=\"Skill instructions file\"\n onChange={(event) => setFile(event.target.files?.[0] ?? null)}\n data-testid=\"skill-upload-file\"\n />\n <Button\n disabled={!slug || !file || upload.isPending}\n onClick={() =>\n file && upload.mutate([{ folder: `skills/${slug}`, fileName: 'SKILL.md', content: file }])\n }\n data-testid=\"skill-upload-submit\"\n >\n {upload.isPending ? 'Uploading…' : 'Upload skill'}\n </Button>\n {upload.isSuccess && (\n <p role=\"status\" className=\"text-sm\">\n Uploaded. The skill will appear once processing finishes.\n </p>\n )}\n {upload.error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {upload.error.message}\n </p>\n )}\n </section>\n )\n}\n","import { lazy, Suspense } from 'react'\nimport { ArtifactCanvas } from '@arbidocs/react'\nimport { useStreamedArtifact, type UseStreamedArtifactOptions } from '@arbidocs/react/artifacts'\nimport {\n StreamedArtifactFrame,\n type StreamedArtifactFrameLabels,\n type StreamedArtifactFrameTestIds,\n} from '../artifacts/StreamedArtifactFrame'\nimport type { ArtifactEvent } from './ai'\nimport type { StreamedArtifactEditorProps } from './StreamedArtifactEditor'\n\n// The editor (MDXEditor, Lexical) stays out of the bundle until a draft is ready to edit.\nconst StreamedArtifactEditor = lazy(() => import('./StreamedArtifactEditor'))\n\nexport interface StreamedArtifactProps\n extends\n Pick<UseStreamedArtifactOptions, 'configId' | 'parseRetry' | 'clean'>,\n Pick<\n StreamedArtifactEditorProps,\n 'editorProps' | 'onSaved' | 'onSaveError' | 'actions' | 'hideDefaultActions'\n > {\n /** The artifacts of the agent run (`useConnectedAiTask().artifacts`). */\n artifacts: ArtifactEvent[]\n workspaceId: string | undefined\n /** The agent is still working: show the live canvas. */\n busy: boolean\n /** The run failed; with no draft the canvas shows it. */\n error?: string | null\n stepCount?: number\n busyHint?: string\n emptyHint?: string\n className?: string\n /** Root test id of the editor; the preparing state is `${testId}-preparing`. */\n testId?: string\n labels?: Partial<StreamedArtifactFrameLabels>\n testIds?: Partial<StreamedArtifactFrameTestIds>\n}\n\n/**\n * An agent-drafted artifact from stream to editor, in one part. Pass the run's `artifacts` and\n * whether it is `busy`; it shows\n *\n * 1. the live `ArtifactCanvas` while the agent streams;\n * 2. \"Preparing editor...\" (the canvas stays readable underneath) while the finished draft is\n * cleaned (`cleanDraftMarkdown`), stored as version 1 of the artifact (`wpType: 'artifact'`)\n * and parsed by the backend, which can take up to about a minute;\n * 3. `ArtifactEditor` on the stored version (edit, save a new version, version list, compare\n * with track changes) when its text is ready;\n * 4. an error with Retry when storing or parsing fails.\n *\n * Needs `<ArbiProvider>` + React Query. The host imports the editor stylesheet\n * (`@mdxeditor/editor/style.css`) and defines the global `Prism` in a module it imports at app\n * start (see the Artifacts section of docs/design/blocks-package.md).\n *\n * ```tsx\n * const task = useConnectedAiTask()\n * <StreamedArtifact artifacts={task.artifacts} workspaceId={workspaceId} busy={task.status === 'running'} error={task.error} />\n * ```\n */\nexport function StreamedArtifact({\n artifacts,\n workspaceId,\n busy,\n error = null,\n stepCount,\n busyHint,\n emptyHint,\n className,\n testId = 'streamed-artifact',\n configId,\n parseRetry,\n clean,\n editorProps,\n onSaved,\n onSaveError,\n actions,\n hideDefaultActions,\n labels,\n testIds,\n}: StreamedArtifactProps) {\n const streamed = useStreamedArtifact({\n artifacts,\n workspaceId,\n settled: !busy && !error,\n configId,\n parseRetry,\n clean,\n })\n const canvas = (\n <ArtifactCanvas\n artifacts={artifacts}\n className={streamed.phase === 'streaming' ? className : undefined}\n busy={busy}\n busyHint={busyHint}\n stepCount={stepCount}\n error={error}\n emptyHint={emptyHint}\n />\n )\n return (\n <StreamedArtifactFrame\n phase={streamed.phase}\n canvas={canvas}\n className={className}\n error={streamed.error?.message}\n onRetry={streamed.retry}\n labels={labels}\n testIds={{ preparing: `${testId}-preparing`, error: `${testId}-error`, ...testIds }}\n >\n <Suspense fallback={canvas}>\n {streamed.docId && (\n <StreamedArtifactEditor\n key={streamed.docId}\n workspaceId={workspaceId}\n docId={streamed.docId}\n title={streamed.artifact?.title ?? 'Draft'}\n testId={testId}\n className={className}\n editorProps={editorProps}\n onSaved={onSaved}\n onSaveError={onSaveError}\n actions={actions}\n hideDefaultActions={hideDefaultActions}\n />\n )}\n </Suspense>\n </StreamedArtifactFrame>\n )\n}\n","import {\n useShellWorkspaces,\n useWorkspaces,\n type ShellWorkspaceSource,\n type UseShellWorkspacesOptions,\n type UseShellWorkspacesResult,\n} from '@arbidocs/react'\nimport { useConnection } from './ConnectionProvider'\n\nexport type UseConnectedShellWorkspacesOptions = Omit<\n UseShellWorkspacesOptions,\n 'workspaces' | 'isLoading' | 'loadError' | 'selectedId' | 'select'\n>\n\n/**\n * `useShellWorkspaces` wired to the connection layer: the account's live workspaces, the\n * connection's single selection as the active workspace, and `open` = `setWorkspace` (opens it on\n * the server, remembers it for the next login) then `onOpened`.\n *\n * ```tsx\n * const { active, recent, open } = useConnectedShellWorkspaces({\n * seed: { workspaces: demoWorkspaces, activeId: 'demo-1' },\n * onOpened: () => navigate('/app/documents'),\n * })\n * ```\n */\nexport function useConnectedShellWorkspaces(\n options: UseConnectedShellWorkspacesOptions = {}\n): UseShellWorkspacesResult {\n const { workspaceId, setWorkspace } = useConnection()\n const query = useWorkspaces()\n return useShellWorkspaces({\n ...options,\n workspaces: Array.isArray(query.data) ? (query.data as ShellWorkspaceSource[]) : undefined,\n isLoading: query.isLoading,\n loadError: query.error,\n selectedId: workspaceId,\n select: (workspace) => setWorkspace(workspace.id),\n })\n}\n","/**\n * The account area of a settings page, bound to the ARBI SDK: each section is a blocks part wired\n * to its `@arbidocs/react` hook, so a host drops them in a `SettingsPanel` and owns only the\n * layout (see the \"Settings page recipe\" in docs/design/blocks-package.md).\n *\n * Every section takes an optional `notify` for toasts and renders the default test ids of its\n * part. Anything the hooks cannot know (the recovery-key download, the billing link of a blocked\n * deletion, the password policy) is a prop.\n */\nimport { useMemo, useState, type ReactNode } from 'react'\nimport { KeyRound, Radio, UserCircle } from 'lucide-react'\nimport {\n ImageCropModal,\n useAvatarCrop,\n useConfirmEmailChange,\n useCurrentSessionId,\n useDeleteAccount,\n useDeleteAccountFlow,\n useEmailChange,\n useLogoutAllSessions,\n useNameEditor,\n useNotificationPreferences,\n usePasswordChange,\n usePasswordChangeForm,\n useProfile,\n useRequestEmailChange,\n useSessions,\n useTerminateSession,\n useUpdateProfile,\n useWorkspaces,\n type AvatarFileProblem,\n type PasswordChangeResult,\n} from '@arbidocs/react'\nimport { Button } from '@arbidocs/react/ui'\nimport { initials } from '../lib/format'\nimport { AvatarPicker } from '../settings/AvatarPicker'\nimport { ProfileCard } from '../settings/ProfileCard'\nimport {\n SettingsActionRow,\n SettingsCard,\n SettingsDangerZone,\n SettingsRow,\n SettingsSection,\n} from '../settings/SettingsPanel'\nimport { PasswordChangeDialog } from '../settings/PasswordChangeDialog'\nimport { ActiveSessionsDialog, DeleteAccountDialog } from '../settings/AccountDialogs'\nimport { LogoutDialog } from '../settings/LogoutDialog'\nimport { NotificationCategoryList } from '../settings/NotificationCategoryList'\nimport {\n EMAIL_NOTIFICATION_CATEGORIES,\n EMAIL_NOTIFICATION_KEYS,\n toActiveSessionViews,\n toDeleteBlockerViews,\n toLogoutSessionViews,\n toNotificationCategories,\n type EmailNotificationCategoryDef,\n} from '../settings/account-views'\nimport { useConnection } from './ConnectionProvider'\n\nexport type SettingsNotify = (message: string, kind: 'success' | 'error') => void\n\n/** The error text of a failed call: the backend `detail` when it sent one. */\nfunction errorText(error: unknown, fallback: string): string {\n const body = (error as { apiError?: { detail?: unknown } } | null)?.apiError\n return typeof body?.detail === 'string' ? body.detail : fallback\n}\n\nconst AVATAR_PROBLEMS: Record<AvatarFileProblem, string> = {\n 'not-image': 'Please choose an image file',\n 'too-large': 'Image must be 5 MB or smaller',\n unreadable: \"Couldn't read that image — try a different file\",\n}\n\n// ── Profile ─────────────────────────────────────────────────────────────────\n\nexport interface ConnectedProfileCardProps {\n notify?: SettingsNotify\n /** Section heading; default `Profile`. */\n title?: ReactNode\n}\n\n/** Avatar, editable name and email change of the signed-in user (`ProfileCard`). */\nexport function ConnectedProfileCard({ notify, title = 'Profile' }: ConnectedProfileCardProps) {\n const { data: profile } = useProfile()\n const updateProfile = useUpdateProfile()\n const requestEmailChange = useRequestEmailChange()\n const confirmEmailChange = useConfirmEmailChange()\n const { user } = useConnection()\n\n const name = useNameEditor({\n givenName: profile?.givenName,\n familyName: profile?.familyName,\n save: async (next) => {\n try {\n await updateProfile.mutateAsync(next)\n notify?.('Name updated', 'success')\n } catch (e) {\n notify?.('Failed to update name', 'error')\n throw e\n }\n },\n })\n const avatar = useAvatarCrop({\n upload: async (picture) => {\n try {\n await updateProfile.mutateAsync({ picture })\n notify?.('Profile picture updated', 'success')\n } catch (e) {\n notify?.('Failed to update picture', 'error')\n throw e\n }\n },\n onProblem: (problem) => notify?.(AVATAR_PROBLEMS[problem], 'error'),\n })\n const email = useEmailChange({\n requestCode: async (address) => {\n try {\n await requestEmailChange.mutateAsync(address)\n notify?.('Verification code sent to your new email', 'success')\n } catch (e) {\n notify?.(errorText(e, 'Failed to send verification code'), 'error')\n throw e\n }\n },\n confirm: async (args) => {\n try {\n await confirmEmailChange.mutateAsync(args)\n notify?.('Email address updated', 'success')\n } catch (e) {\n notify?.(errorText(e, 'Invalid or expired verification code'), 'error')\n throw e\n }\n },\n })\n\n const display = profile?.fullName || user?.name || 'Unnamed'\n return (\n <SettingsSection icon={<UserCircle />} title={title}>\n <ProfileCard\n avatar={\n <>\n <AvatarPicker\n pictureUrl={profile?.picture ?? user?.picture}\n initials={initials(display)}\n fallbackClassName=\"bg-primary text-primary-foreground\"\n isUploading={avatar.isUploading}\n onFileChosen={avatar.onFileChosen}\n />\n <ImageCropModal\n open={avatar.pendingImage !== null}\n image={avatar.pendingImage}\n title=\"Crop your photo\"\n aspect={1}\n cropShape=\"round\"\n output={{ maxSize: 128, mimeType: 'image/jpeg', quality: 0.85 }}\n onComplete={avatar.onCropComplete}\n onCancel={avatar.onCropCancel}\n />\n </>\n }\n name={{ ...name, display, isSaving: name.isSaving }}\n email={profile?.email ?? user?.email ?? ''}\n isSso={profile?.isSso ?? false}\n onStartEmailChange={email.onStart}\n emailChange={email.isOpen ? email : undefined}\n />\n </SettingsSection>\n )\n}\n\n// ── Security: password ──────────────────────────────────────────────────────\n\n/** The default password policy: 8 characters, an uppercase letter or symbol, a digit. */\nexport function defaultUnmetPasswordRequirement(password: string): string | null {\n if (password.length < 8) return 'Minimum 8 characters'\n if (!/[A-Z!@#$%^&*()_+\\-=[\\]{};':\"\\\\|,.<>/?]/.test(password)) {\n return 'At least one uppercase letter or special character'\n }\n if (!/[0-9]/.test(password)) return 'At least one number'\n return null\n}\n\nexport interface ConnectedSecuritySectionProps {\n notify?: SettingsNotify\n /** The host's password policy; default is {@link defaultUnmetPasswordRequirement}. */\n getUnmetRequirement?: (password: string) => string | null\n /** The recovery-key download for the key the new password produced (shown on success). */\n renderRecoveryKey?: (result: PasswordChangeResult) => ReactNode\n /** Extra rows under \"Change password\" (e.g. \"Save recovery key\"). */\n children?: ReactNode\n}\n\n/** The Security card: \"Change password\" and the dialog behind it (`PasswordChangeDialog`). */\nexport function ConnectedSecuritySection({\n notify,\n getUnmetRequirement = defaultUnmetPasswordRequirement,\n renderRecoveryKey,\n children,\n}: ConnectedSecuritySectionProps) {\n const [open, setOpen] = useState(false)\n const change = usePasswordChange()\n // Only workspaces the user belongs to are re-keyed.\n const { data: workspaces } = useWorkspaces({ enabled: open })\n const workspaceCount = (workspaces ?? []).filter((w) => w.is_member).length\n const form = usePasswordChangeForm<PasswordChangeResult>({\n getUnmetRequirement,\n submit: async (vars) => {\n const result = await change.mutateAsync(vars)\n notify?.('Password changed successfully', 'success')\n return result\n },\n onClose: () => setOpen(false),\n })\n\n return (\n <SettingsSection icon={<KeyRound />} title=\"Security\">\n <SettingsCard padding=\"sm\">\n <SettingsActionRow\n title=\"Change password\"\n description=\"Used to sign in and to encrypt your data. Changing it re-encrypts everything in your account.\"\n onClick={() => setOpen(true)}\n testId=\"change-password-button\"\n />\n {children}\n </SettingsCard>\n <PasswordChangeDialog\n open={open}\n onClose={form.onCancel}\n recoveryMode={false}\n currentPassword={form.currentPassword}\n onCurrentPasswordChange={form.onCurrentPasswordChange}\n newPassword={form.newPassword}\n onNewPasswordChange={form.onNewPasswordChange}\n confirmPassword={form.confirmPassword}\n onConfirmPasswordChange={form.onConfirmPasswordChange}\n getUnmetRequirement={getUnmetRequirement}\n workspaceCount={workspaceCount}\n error={form.error}\n isProcessing={form.isProcessing}\n isSubmitDisabled={form.isSubmitDisabled}\n onSubmit={form.onSubmit}\n success={form.result ? (renderRecoveryKey?.(form.result) ?? <></>) : null}\n onDone={form.onDone}\n />\n </SettingsSection>\n )\n}\n\n// ── Notifications ───────────────────────────────────────────────────────────\n\nexport interface ConnectedNotificationPreferencesProps {\n /** Categories to offer; default {@link EMAIL_NOTIFICATION_CATEGORIES}. */\n categories?: readonly EmailNotificationCategoryDef[]\n title?: ReactNode\n}\n\n/** The email-notification switches (`NotificationCategoryList`) over the user settings. */\nexport function ConnectedNotificationPreferences({\n categories = EMAIL_NOTIFICATION_CATEGORIES,\n title = 'Notifications',\n}: ConnectedNotificationPreferencesProps) {\n const keys = useMemo(\n () =>\n categories === EMAIL_NOTIFICATION_CATEGORIES\n ? EMAIL_NOTIFICATION_KEYS\n : categories.map((c) => c.key),\n [categories]\n )\n const prefs = useNotificationPreferences(keys)\n return (\n <SettingsSection title={title}>\n <SettingsCard className=\"space-y-0\">\n <NotificationCategoryList\n masterId=\"emailNotifications\"\n masterTitle=\"Email Notifications\"\n masterDescription=\"Email me about activity when I’m away\"\n masterChecked={prefs.masterChecked}\n onMasterChange={prefs.setAll}\n categories={toNotificationCategories(prefs.checked, categories)}\n onCategoryChange={prefs.setCategory}\n />\n </SettingsCard>\n </SettingsSection>\n )\n}\n\n// ── Sessions ────────────────────────────────────────────────────────────────\n\nexport interface ConnectedSessionsRowProps {\n notify?: SettingsNotify\n /** Ask before ending a session; resolve `false` to cancel. Default: end at once. */\n confirm?: (message: string) => Promise<boolean> | boolean\n /** Glyph per session status. */\n renderSessionIcon?: (status: string) => ReactNode\n}\n\n/** \"Active sessions\" row with the manage dialog (`ActiveSessionsDialog`); end any but this device. */\nexport function ConnectedSessionsRow({\n notify,\n confirm,\n renderSessionIcon,\n}: ConnectedSessionsRowProps) {\n const [open, setOpen] = useState(false)\n const sessions = useSessions({ enabled: open })\n const currentSessionId = useCurrentSessionId()\n const terminate = useTerminateSession()\n const views = toActiveSessionViews(sessions.data ?? [], {\n currentSessionId,\n terminatingId: terminate.isPending ? terminate.variables : null,\n renderIcon: renderSessionIcon,\n })\n return (\n <>\n <SettingsRow\n label=\"Active sessions\"\n description=\"Devices and agents currently signed in to your account.\"\n >\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setOpen(true)}\n className=\"flex items-center gap-2\"\n data-testid=\"active-sessions-button\"\n >\n <Radio className=\"h-4 w-4\" />\n Manage\n </Button>\n </SettingsRow>\n <ActiveSessionsDialog\n open={open}\n onOpenChange={setOpen}\n isLoading={sessions.isLoading}\n sessions={views}\n onTerminate={(id) => {\n void (async () => {\n const view = views.find((v) => v.id === id)\n const label = view?.detail.split(' · ')[0]\n const ok =\n (await confirm?.(\n `End the session on ${label}? It will be signed out immediately.`\n )) ?? true\n if (!ok) return\n try {\n await terminate.mutateAsync(id)\n } catch {\n notify?.('Failed to end session. Please try again.', 'error')\n }\n })()\n }}\n />\n </>\n )\n}\n\nexport interface ConnectedLogoutDialogProps {\n open: boolean\n onClose: () => void\n isOnline?: boolean\n renderSessionIcon?: (status: string) => ReactNode\n}\n\n/** Sign out of this device or all devices (`LogoutDialog`), listing the active sessions. */\nexport function ConnectedLogoutDialog({\n open,\n onClose,\n isOnline = true,\n renderSessionIcon,\n}: ConnectedLogoutDialogProps) {\n const { logout } = useConnection()\n const sessions = useSessions({ enabled: open })\n const logoutAll = useLogoutAllSessions()\n return (\n <LogoutDialog\n open={open}\n onClose={onClose}\n onLogoutThis={() => {\n onClose()\n logout()\n }}\n onLogoutAll={() => {\n onClose()\n // The server drops every session first; the connection then forgets this one.\n void logoutAll.mutateAsync().finally(logout)\n }}\n canLogoutAll\n isOnline={isOnline}\n sessions={toLogoutSessionViews(sessions.data ?? [])}\n renderSessionIcon={renderSessionIcon}\n />\n )\n}\n\n// ── Danger zone ─────────────────────────────────────────────────────────────\n\nexport interface ConnectedDangerZoneProps {\n notify?: SettingsNotify\n /** Link to the billing page for a deletion blocked by an active subscription. */\n renderSubscriptionLink?: () => ReactNode\n}\n\n/** \"Delete your account\": the collapsed danger zone and the two-step dialog (`DeleteAccountDialog`). */\nexport function ConnectedDangerZone({ notify, renderSubscriptionLink }: ConnectedDangerZoneProps) {\n const [zoneOpen, setZoneOpen] = useState(false)\n const [dialogOpen, setDialogOpen] = useState(false)\n const { user, logout } = useConnection()\n const remove = useDeleteAccount()\n const flow = useDeleteAccountFlow({\n userEmail: user?.email ?? '',\n remove: () => remove.mutateAsync(),\n onClose: () => setDialogOpen(false),\n onDeleted: logout,\n onError: () => notify?.('Failed to delete account. Please try again.', 'error'),\n })\n return (\n <>\n <SettingsDangerZone\n isOpen={zoneOpen}\n onToggle={() => setZoneOpen((o) => !o)}\n title=\"Delete your account\"\n description=\"Once deleted, your account will be immediately closed and you will be logged out. This action cannot be undone.\"\n action={\n <Button\n variant=\"destructive\"\n size=\"sm\"\n disabled={!user?.email}\n onClick={() => setDialogOpen(true)}\n data-testid=\"delete-account-button\"\n >\n Delete Account\n </Button>\n }\n />\n <DeleteAccountDialog\n open={dialogOpen}\n onClose={flow.onClose}\n step={flow.step}\n blockers={toDeleteBlockerViews(flow.blockers, renderSubscriptionLink)}\n onContinue={flow.onContinue}\n onBack={flow.onBack}\n userEmail={user?.email ?? ''}\n confirmEmail={flow.confirmEmail}\n onConfirmEmailChange={flow.onConfirmEmailChange}\n isDeleting={flow.isDeleting}\n onSubmit={flow.onSubmit}\n />\n </>\n )\n}\n","import { useEffect } from 'react'\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport { useArbi, useArbiWebSocket, notify, type AppNotification } from '@arbidocs/react'\nimport { useNotify } from '@arbidocs/react/shell'\nimport { useConnection } from './ConnectionProvider'\n\n/** Bridge persisted document mentions to the shared bell; hosts own routing. */\nexport function useConnectedDocxNotifications(\n onOpen: (target: {\n workspaceId: string\n documentId: string\n commentId: string\n }) => void | Promise<void>\n) {\n const arbi = useArbi()\n const { status, user, apiUrl } = useConnection()\n const queries = useQueryClient()\n const source = `docx-mentions:${apiUrl}:${user?.externalId || ''}`\n const queryKey = ['docx-mentions', apiUrl, user?.externalId]\n const { data = [] } = useQuery({\n queryKey,\n queryFn: () => arbi.notifications.list('docx_mention'),\n enabled: status === 'authenticated',\n refetchInterval: 30_000,\n })\n useArbiWebSocket((message) => {\n if (message.type === 'docx_mention') void queries.invalidateQueries({ queryKey })\n })\n useEffect(() => {\n const items: AppNotification[] = []\n if (status === 'authenticated')\n for (const note of data) {\n if (note.recipient.external_id !== user?.externalId || !note.workspace_ext_id) continue\n try {\n const target = JSON.parse(note.content || '{}') as {\n document_id?: string\n comment_id?: string\n }\n if (!target.document_id?.startsWith('doc-') || !target.comment_id) continue\n const documentId = target.document_id,\n commentId = target.comment_id,\n workspaceId = note.workspace_ext_id\n items.push({\n id: `docx:${note.external_id}`,\n title: 'Mentioned you in a document comment',\n description: [note.sender.given_name, note.sender.family_name]\n .filter(Boolean)\n .join(' '),\n variant: 'info',\n ts: Date.parse(note.created_at),\n read: note.read,\n source,\n onSelect: () => {\n void Promise.resolve(onOpen({ documentId, commentId, workspaceId })).catch((error) =>\n notify.error(\n error instanceof Error ? error.message : 'Could not open the document.'\n )\n )\n },\n })\n } catch {\n /* Ignore invalid legacy payloads. */\n }\n }\n useNotify.getState().syncSource(source, items)\n return () => useNotify.getState().syncSource(source, [])\n }, [data, status, user?.externalId, source, onOpen])\n const markRead = async (ids: string[]) => {\n try {\n await arbi.notifications.markRead(ids)\n await queries.invalidateQueries({ queryKey })\n } catch {\n notify.error('Could not mark document mentions read.')\n }\n }\n return {\n onMarkRead: (id: string) => {\n if (id.startsWith('docx:')) void markRead([id.slice(5)])\n },\n onMarkAllRead: () => {\n void markRead(\n data\n .filter((note) => !note.read && note.recipient.external_id === user?.externalId)\n .map((note) => note.external_id)\n )\n },\n }\n}\n","import { useEffect } from 'react'\nimport { useWorkNotifications, notify, type AppNotification } from '@arbidocs/react'\nimport { useNotify } from '@arbidocs/react/shell'\nimport type { components } from '@arbidocs/client'\nimport { useConnection } from './ConnectionProvider'\n\nexport type WorkNotificationTarget =\n | { kind: 'conversation'; workspaceId: string; conversationId: string; messageId?: string }\n | { kind: 'workflow'; workspaceId?: string; workflowId: string }\n\n/** Persisted work notifications in the shared bell; the consumer owns navigation. */\nexport function useConnectedWorkNotifications(\n onOpen: (target: WorkNotificationTarget) => void | Promise<void>\n) {\n const { status, user, apiUrl } = useConnection()\n const source = `work-notifications:${apiUrl}:${user?.externalId || ''}`\n const { data = [], markRead: persistRead } = useWorkNotifications({\n apiUrl,\n userId: user?.externalId,\n enabled: status === 'authenticated',\n })\n useEffect(() => {\n const items: AppNotification[] = []\n if (status === 'authenticated')\n for (const note of data) {\n if (note.recipient.external_id !== user?.externalId) continue\n const mapped = mapWorkNotification(note)\n if (!mapped) continue\n items.push({\n id: `work:${note.external_id}`,\n title: mapped.title,\n variant:\n note.type === 'workflow_failed'\n ? 'error'\n : note.type === 'conversation_done'\n ? 'success'\n : 'info',\n ts: Date.parse(note.created_at),\n read: note.read,\n source,\n onSelect: () => {\n void Promise.resolve()\n .then(() => onOpen(mapped.target))\n .catch((error) =>\n notify.error(\n error instanceof Error ? error.message : 'Could not open this notification.'\n )\n )\n },\n })\n }\n useNotify.getState().syncSource(source, items)\n return () => useNotify.getState().syncSource(source, [])\n }, [data, status, user?.externalId, source, onOpen])\n const markRead = async (ids: string[]) => {\n if (!ids.length) return\n try {\n await persistRead(ids)\n } catch {\n notify.error('Could not mark work notifications read.')\n }\n }\n return {\n onMarkRead: (id: string) => {\n // Only received, currently loaded work rows belong to this source.\n if (\n data.some(\n (note) =>\n `work:${note.external_id}` === id &&\n note.recipient.external_id === user?.externalId &&\n mapWorkNotification(note)\n )\n )\n void markRead([id.slice(5)])\n },\n onMarkAllRead: () => {\n void markRead(\n data\n .filter(\n (note) =>\n !note.read &&\n note.recipient.external_id === user?.externalId &&\n mapWorkNotification(note)\n )\n .map((note) => note.external_id)\n )\n },\n }\n}\n\n/** Route from explicit IDs; encrypted task text is never needed for a link. */\nexport function mapWorkNotification(note: components['schemas']['NotificationResponse']): {\n title: string\n target: WorkNotificationTarget\n} | null {\n const sender =\n [note.sender.given_name, note.sender.family_name].filter(Boolean).join(' ') || note.sender.email\n if (note.type === 'workflow_failed') {\n try {\n const payload = JSON.parse(note.content || '{}') as { workflow_ext_id?: string }\n if (!payload.workflow_ext_id?.match(/^wfl-[a-zA-Z0-9]+$/)) return null\n if (\n note.workspace_ext_id?.match(/^wrk-[a-zA-Z0-9]+$/) &&\n note.conversation_ext_id?.match(/^con-[a-zA-Z0-9]+$/)\n ) {\n return {\n title: 'A workflow failed to run',\n target: {\n kind: 'conversation',\n workspaceId: note.workspace_ext_id,\n conversationId: note.conversation_ext_id,\n },\n }\n }\n return {\n title: 'A workflow failed to run',\n target: {\n kind: 'workflow',\n workflowId: payload.workflow_ext_id,\n workspaceId: note.workspace_ext_id || undefined,\n },\n }\n } catch {\n return null\n }\n }\n const titles: Partial<Record<components['schemas']['NotificationType'], string>> = {\n mention: `${sender} mentioned you in a conversation`,\n workspace_access_request: `${sender} needs workspace access to run a task`,\n conversation_ready: `${sender} has a task ready`,\n conversation_done: `${sender} marked a task done`,\n }\n const title = titles[note.type]\n if (!title || !note.workspace_ext_id || !note.conversation_ext_id?.match(/^con-[a-zA-Z0-9]+$/))\n return null\n return {\n title,\n target: {\n kind: 'conversation',\n workspaceId: note.workspace_ext_id,\n conversationId: note.conversation_ext_id,\n ...(note.message_ext_id ? { messageId: note.message_ext_id } : {}),\n },\n }\n}\n","import {\n useAgentSession,\n useStartAgentSession,\n useCloseAgentSession,\n useArbiChat,\n} from '@arbidocs/react'\nimport { Button } from '@arbidocs/react/ui'\nimport { ChatPage } from '../chat/ChatPage'\n\nexport interface ConnectedAgentChatPanelProps {\n agentId: string\n workspaceId: string\n agentName?: string\n}\n\nfunction ActiveChat({ agentId, workspaceId }: ConnectedAgentChatPanelProps) {\n const chat = useArbiChat({ agentId, workspaceId })\n return (\n <ChatPage\n chat={{ ...chat, assistantMode: undefined, setAssistantMode: undefined }}\n documentsRequired={false}\n compactHeader\n surface=\"dock\"\n emptyTitle=\"What would you like me to do?\"\n emptyDescription=\"This agent works through its own login. Upload files here to stage them in its sandbox.\"\n className=\"h-[min(65vh,650px)] min-h-[380px]\"\n />\n )\n}\n\n/** An owned agent's independent login and chat, using the shared controller and chat surface. */\nexport function ConnectedAgentChatPanel({\n agentId,\n workspaceId,\n agentName = 'Agent',\n}: ConnectedAgentChatPanelProps) {\n const session = useAgentSession(agentId)\n const start = useStartAgentSession()\n const close = useCloseAgentSession()\n const ready = session.data?.active && session.data.workspace_ext_id === workspaceId\n const busy = start.isPending || close.isPending\n const error = start.error ?? close.error ?? session.error\n return (\n <section className=\"space-y-3\" data-testid=\"agent-chat-panel\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <p className=\"text-sm\" data-testid=\"agent-chat-session-status\">\n {agentName} ·{' '}\n {ready\n ? 'Signed in to this workspace'\n : session.data?.active\n ? `Signed in to ${session.data.workspace_name ?? 'another workspace'}`\n : 'Signed out'}\n </p>\n <div className=\"flex gap-2\">\n {!ready && (\n <Button\n type=\"button\"\n disabled={busy || session.isLoading}\n onClick={() => start.mutate({ agentId, workspaceId })}\n data-testid=\"agent-chat-login\"\n >\n {start.isPending ? 'Signing in…' : 'Sign in here'}\n </Button>\n )}\n {session.data?.active && (\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={busy}\n onClick={() => close.mutate(agentId)}\n data-testid=\"agent-chat-logout\"\n >\n {close.isPending ? 'Signing out…' : 'Sign out agent'}\n </Button>\n )}\n </div>\n </div>\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error.message}\n </p>\n )}\n {ready && (\n <ActiveChat key={`${agentId}:${workspaceId}`} agentId={agentId} workspaceId={workspaceId} />\n )}\n </section>\n )\n}\n"]}
|
|
@@ -14,6 +14,11 @@ interface ConnectionValue {
|
|
|
14
14
|
workspaceId: string | null;
|
|
15
15
|
apiConfigured: boolean;
|
|
16
16
|
apiUrl: string;
|
|
17
|
+
/**
|
|
18
|
+
* The deployment domain the user's keys are derived for (`arbi.getDeploymentDomain()`), for the
|
|
19
|
+
* document tools' e-signing. `undefined` in demo mode.
|
|
20
|
+
*/
|
|
21
|
+
deploymentDomain: string | undefined;
|
|
17
22
|
error: string | null;
|
|
18
23
|
/** Default assistant config ext_id (for the AI hooks). */
|
|
19
24
|
assistantConfig?: string;
|
|
@@ -41,6 +41,12 @@ export interface AssistantMessage {
|
|
|
41
41
|
export interface ArbiConnectionConfig {
|
|
42
42
|
/** Live backend URL. Empty string ⇒ run entirely in seeded demo mode. */
|
|
43
43
|
apiUrl: string;
|
|
44
|
+
/**
|
|
45
|
+
* The deployment domain the users' keys are derived for (signing re-derives them). Default: the
|
|
46
|
+
* hostname of `apiUrl`, as the SDK computes it. Set it only when the API is served from another
|
|
47
|
+
* host than the one users registered on.
|
|
48
|
+
*/
|
|
49
|
+
deploymentDomain?: string;
|
|
44
50
|
/** Inert URL used to mount the SDK provider when there's no live backend. */
|
|
45
51
|
demoApiUrl?: string;
|
|
46
52
|
/** Preferred live workspace ext_id (else the first workspace is used). */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The viewer-header buttons of the PDF document tools: Annotate, Show original, Download with
|
|
3
|
+
* markup and Sign. Separate parts so a host can place them among its own header actions. On a
|
|
4
|
+
* narrow (`compact`) header each is icon-only; its accessible name stays.
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
interface ToggleProps {
|
|
8
|
+
/** On (pressed). */
|
|
9
|
+
active: boolean;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
compact?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Annotate mode: highlight, comment, stamp, redact. */
|
|
14
|
+
export declare function AnnotateButton({ active, onClick, compact }: ToggleProps): ReactElement;
|
|
15
|
+
/** The markup is the default view of a marked-up PDF; this shows the untouched file. */
|
|
16
|
+
export declare function ShowOriginalButton({ active, onClick, compact }: ToggleProps): ReactElement;
|
|
17
|
+
/**
|
|
18
|
+
* "Download with markup": the PDF with its annotations, which Acrobat and Preview show. With a
|
|
19
|
+
* `disabledReason` (a signed, locked version) it is off and says why.
|
|
20
|
+
*/
|
|
21
|
+
export declare function DownloadMarkupButton({ onClick, disabledReason, }: {
|
|
22
|
+
onClick: () => void;
|
|
23
|
+
disabledReason?: string;
|
|
24
|
+
}): ReactElement;
|
|
25
|
+
/** One line where a signed version's content can be edited: an edit is a new, unsigned version. */
|
|
26
|
+
export declare function SignedEditNote(): ReactElement;
|
|
27
|
+
/** Sign: choose where the signature goes, then sign. */
|
|
28
|
+
export declare function SignButton({ active, onClick, compact }: ToggleProps): ReactElement;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one-line notices above the PDF about its markup: annotations found in this browser from
|
|
3
|
+
* before markup was saved on the server (for a shared document: add them to the shared markup, or
|
|
4
|
+
* discard), and markup that sits on an older version (open it, or copy its open comments here).
|
|
5
|
+
*/
|
|
6
|
+
import type { LegacyPrompt, OlderMarkupNote } from '@arbidocs/react/document-tools';
|
|
7
|
+
export interface MarkupNoticesProps {
|
|
8
|
+
legacyPrompt: LegacyPrompt | null;
|
|
9
|
+
olderNote: OlderMarkupNote | null;
|
|
10
|
+
onOpenVersion: (version: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function MarkupNotices({ legacyPrompt, olderNote, onOpenVersion }: MarkupNoticesProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which view of a marked-up PDF is on screen, spelled out beside the title, with the switch to the
|
|
3
|
+
* other one. The narrow header's "Show original" is an unlabelled page icon, so on its own it read
|
|
4
|
+
* as no control at all, and nothing said whether the page showed the markup or the original.
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
export interface MarkupViewNoteProps {
|
|
8
|
+
showOriginal: boolean;
|
|
9
|
+
onToggle: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function MarkupViewNote({ showOriginal, onToggle }: MarkupViewNoteProps): ReactElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sign a document electronically: confirm the name, choose whether the date is shown, read the
|
|
3
|
+
* statement of intent, re-enter the password. Only the signature (and the date, if ticked) is drawn
|
|
4
|
+
* on the page; a role, a firm or a place go on as ordinary annotation text. Anyone can click the
|
|
5
|
+
* signature to check it. The signed copy is saved as a new version and opened, with an offer to
|
|
6
|
+
* email it when the host gives the tools an `emailDocument`. Needs a `<DocumentToolsProvider>` with
|
|
7
|
+
* a `user` (its email) and a `deploymentDomain`, inside a React Query `QueryClientProvider`.
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactElement } from 'react';
|
|
10
|
+
import { type SignatureAppearance } from '@arbidocs/react/document-tools';
|
|
11
|
+
export interface SignDocumentDialogProps {
|
|
12
|
+
open: boolean;
|
|
13
|
+
onOpenChange: (open: boolean) => void;
|
|
14
|
+
documentId: string;
|
|
15
|
+
/** The PDF the viewer is showing. */
|
|
16
|
+
pdfBlob: Blob;
|
|
17
|
+
/** Where the signature goes; omitted = bottom of the last page. */
|
|
18
|
+
appearance?: SignatureAppearance;
|
|
19
|
+
}
|
|
20
|
+
export declare function SignDocumentDialog({ open, onOpenChange, documentId, pdfBlob, appearance, }: SignDocumentDialogProps): ReactElement;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The certificate of an ARBI signature: the page the link on a signed PDF's signature opens, for
|
|
3
|
+
* anyone, signed in or not. Plain English and short: who signed and when, what ARBI checks, the
|
|
4
|
+
* result, any counter-signatures, and "Check your copy", which hashes a PDF in the browser and
|
|
5
|
+
* compares it with the signed document and each signed revision (the file never leaves the
|
|
6
|
+
* device). No email addresses and no
|
|
7
|
+
* document content. Presentational: `verification` comes from `useSignatureVerification` in
|
|
8
|
+
* `@arbidocs/react/document-tools`.
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactElement } from 'react';
|
|
11
|
+
import { type SignatureVerification } from '@arbidocs/react/document-tools';
|
|
12
|
+
export interface SignatureCertificateProps {
|
|
13
|
+
/** The signature reference (`sig-…`), shown at the foot of the page. */
|
|
14
|
+
reference?: string;
|
|
15
|
+
verification?: SignatureVerification;
|
|
16
|
+
isLoading?: boolean;
|
|
17
|
+
/** Why the signature could not be checked. */
|
|
18
|
+
error?: string | null;
|
|
19
|
+
/** The error is a passing one (too many checks): say it calmly, not as a failure. */
|
|
20
|
+
isErrorTransient?: boolean;
|
|
21
|
+
/** How signing times are shown. Default: {@link formatSignedAt}. */
|
|
22
|
+
formatDate?: (iso: string) => string;
|
|
23
|
+
/** Offer "Check your copy". Default on. */
|
|
24
|
+
allowCopyCheck?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function SignatureCertificate({ reference, verification, isLoading, error, isErrorTransient, formatDate, allowCopyCheck, }: SignatureCertificateProps): ReactElement;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "Signed — locked" note in the viewer header (a signed version changes only by a further
|
|
3
|
+
* signature), which opens the signature details: who signed and when,
|
|
4
|
+
* whether the document is unchanged since, and "View certificate", the public page anyone can
|
|
5
|
+
* check the signature on (the same page the signature on the PDF links to). Read from the PDF
|
|
6
|
+
* itself (GET .../signatures). A counter-signed copy lists every signature, oldest first.
|
|
7
|
+
*/
|
|
8
|
+
import type { ReactElement } from 'react';
|
|
9
|
+
import { type SignatureStatusResponse } from '@arbidocs/react/document-tools';
|
|
10
|
+
/** "14 Oct 2026, 12:00" in the reader's locale and time zone. */
|
|
11
|
+
export declare function formatSignedAt(iso: string): string;
|
|
12
|
+
export interface SignatureStatusProps {
|
|
13
|
+
status: SignatureStatusResponse;
|
|
14
|
+
/** How the signing time is shown. Default: {@link formatSignedAt}. */
|
|
15
|
+
formatDate?: (iso: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* The certificate page of a signature in this app. Preferred over the `certificate_url` the API
|
|
18
|
+
* returns (which is on the deployment domain). Default: the enclosing `<DocumentToolsProvider>`'s
|
|
19
|
+
* `certificateUrl`, if any; without either, the API's `certificate_url`, else
|
|
20
|
+
* `/verify/{reference}` on this origin.
|
|
21
|
+
*/
|
|
22
|
+
certificateUrl?: (reference: string) => string;
|
|
23
|
+
}
|
|
24
|
+
export declare function SignatureStatus({ status, formatDate, certificateUrl, }: SignatureStatusProps): ReactElement;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bar above an older version opened read-only: which version it is, "Ask about this version"
|
|
3
|
+
* (when the host has an assistant) and the way back to the current version. Put it in the viewer's
|
|
4
|
+
* sticky header, not the content area: a PDF view scrolls its first page into view, which would
|
|
5
|
+
* scroll a bar above it out of sight.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactElement } from 'react';
|
|
8
|
+
export interface VersionSnapshotBarLabels {
|
|
9
|
+
/** `Version 2 · read only`; `number` is undefined when the version is not known. */
|
|
10
|
+
title: (number: number | undefined) => string;
|
|
11
|
+
ask: string;
|
|
12
|
+
returnToCurrent: string;
|
|
13
|
+
/** For documents edited live (Word, artifacts), where "current" is the live document. */
|
|
14
|
+
returnToLive: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const DEFAULT_VERSION_SNAPSHOT_BAR_LABELS: VersionSnapshotBarLabels;
|
|
17
|
+
export interface VersionSnapshotBarProps {
|
|
18
|
+
/** The version's number, when known. */
|
|
19
|
+
versionNumber?: number;
|
|
20
|
+
/** The document is edited live: the way back says "live document". */
|
|
21
|
+
live?: boolean;
|
|
22
|
+
/** Ask the assistant about this version. Omitted: no ask action. */
|
|
23
|
+
onAsk?: () => void;
|
|
24
|
+
onReturn: () => void;
|
|
25
|
+
labels?: Partial<VersionSnapshotBarLabels>;
|
|
26
|
+
}
|
|
27
|
+
export declare function VersionSnapshotBar({ versionNumber, live, onAsk, onReturn, labels: overrides, }: VersionSnapshotBarProps): ReactElement;
|