@arbidocs/react 0.3.136 → 0.3.138
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/chunk-J4MX2W4H.js +26 -0
- package/dist/chunk-J4MX2W4H.js.map +1 -0
- package/dist/chunk-ZMTLGO3K.cjs +29 -0
- package/dist/chunk-ZMTLGO3K.cjs.map +1 -0
- package/dist/index.cjs +53 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +18 -28
- package/dist/index.js.map +1 -1
- package/dist/viewers/index.cjs +728 -0
- package/dist/viewers/index.cjs.map +1 -0
- package/dist/viewers/index.d.cts +161 -0
- package/dist/viewers/index.d.ts +161 -0
- package/dist/viewers/index.js +715 -0
- package/dist/viewers/index.js.map +1 -0
- package/package.json +37 -4
package/dist/index.d.cts
CHANGED
|
@@ -13,6 +13,7 @@ import { LucideIcon, StickyNote } from 'lucide-react';
|
|
|
13
13
|
import { Components } from 'react-markdown';
|
|
14
14
|
import { ToasterProps } from 'sonner';
|
|
15
15
|
export { ToasterProps, toast } from 'sonner';
|
|
16
|
+
import { ColDef } from 'ag-grid-community';
|
|
16
17
|
import 'clsx';
|
|
17
18
|
import '@radix-ui/react-avatar';
|
|
18
19
|
import 'class-variance-authority/types';
|
|
@@ -2554,15 +2555,31 @@ interface DocumentTableProps {
|
|
|
2554
2555
|
documents?: DocResponse$2[];
|
|
2555
2556
|
/** Called when a row (document) is opened — row click or name-pill click. */
|
|
2556
2557
|
onOpenDocument?: (id: string) => void;
|
|
2558
|
+
/**
|
|
2559
|
+
* Whether clicking anywhere in a row opens the document. Default true.
|
|
2560
|
+
*
|
|
2561
|
+
* Set false when the grid is used for bulk work: a reviewer building a
|
|
2562
|
+
* selection to code together will inevitably click a row, and navigating away
|
|
2563
|
+
* mid-selection loses it. With this off, the name pill stays the way to open
|
|
2564
|
+
* a document and the row is purely a selection target.
|
|
2565
|
+
*/
|
|
2566
|
+
openOnRowClick?: boolean;
|
|
2557
2567
|
/** Controlled selection (external ids). Falls back to the SDK ui store. */
|
|
2558
2568
|
selectedIds?: string[];
|
|
2559
2569
|
/** Called with the new selection (external ids). Falls back to the SDK ui store. */
|
|
2560
2570
|
onSelectionChange?: (ids: string[]) => void;
|
|
2561
2571
|
/** Grid height. Number → pixels; string passed through. Default 480. */
|
|
2562
2572
|
height?: number | string;
|
|
2573
|
+
/**
|
|
2574
|
+
* Extra columns appended after the built-ins — e.g. one per coding field in a
|
|
2575
|
+
* review protocol, so a grid can be coded across rather than document by
|
|
2576
|
+
* document. Standard AG Grid `ColDef`s; give each an explicit `colId`, since
|
|
2577
|
+
* AG Grid persists column state and auto-generated ids reorder unexpectedly.
|
|
2578
|
+
*/
|
|
2579
|
+
extraColumns?: ColDef<DocResponse$2>[];
|
|
2563
2580
|
className?: string;
|
|
2564
2581
|
}
|
|
2565
|
-
declare function DocumentTable({ workspaceId, documents, onOpenDocument, selectedIds, onSelectionChange, height, className, }: DocumentTableProps): React__default.JSX.Element;
|
|
2582
|
+
declare function DocumentTable({ workspaceId, documents, onOpenDocument, openOnRowClick, selectedIds, onSelectionChange, height, extraColumns, className, }: DocumentTableProps): React__default.JSX.Element;
|
|
2566
2583
|
|
|
2567
2584
|
/**
|
|
2568
2585
|
* DocumentCard — the canonical document thumbnail tile.
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { LucideIcon, StickyNote } from 'lucide-react';
|
|
|
13
13
|
import { Components } from 'react-markdown';
|
|
14
14
|
import { ToasterProps } from 'sonner';
|
|
15
15
|
export { ToasterProps, toast } from 'sonner';
|
|
16
|
+
import { ColDef } from 'ag-grid-community';
|
|
16
17
|
import 'clsx';
|
|
17
18
|
import '@radix-ui/react-avatar';
|
|
18
19
|
import 'class-variance-authority/types';
|
|
@@ -2554,15 +2555,31 @@ interface DocumentTableProps {
|
|
|
2554
2555
|
documents?: DocResponse$2[];
|
|
2555
2556
|
/** Called when a row (document) is opened — row click or name-pill click. */
|
|
2556
2557
|
onOpenDocument?: (id: string) => void;
|
|
2558
|
+
/**
|
|
2559
|
+
* Whether clicking anywhere in a row opens the document. Default true.
|
|
2560
|
+
*
|
|
2561
|
+
* Set false when the grid is used for bulk work: a reviewer building a
|
|
2562
|
+
* selection to code together will inevitably click a row, and navigating away
|
|
2563
|
+
* mid-selection loses it. With this off, the name pill stays the way to open
|
|
2564
|
+
* a document and the row is purely a selection target.
|
|
2565
|
+
*/
|
|
2566
|
+
openOnRowClick?: boolean;
|
|
2557
2567
|
/** Controlled selection (external ids). Falls back to the SDK ui store. */
|
|
2558
2568
|
selectedIds?: string[];
|
|
2559
2569
|
/** Called with the new selection (external ids). Falls back to the SDK ui store. */
|
|
2560
2570
|
onSelectionChange?: (ids: string[]) => void;
|
|
2561
2571
|
/** Grid height. Number → pixels; string passed through. Default 480. */
|
|
2562
2572
|
height?: number | string;
|
|
2573
|
+
/**
|
|
2574
|
+
* Extra columns appended after the built-ins — e.g. one per coding field in a
|
|
2575
|
+
* review protocol, so a grid can be coded across rather than document by
|
|
2576
|
+
* document. Standard AG Grid `ColDef`s; give each an explicit `colId`, since
|
|
2577
|
+
* AG Grid persists column state and auto-generated ids reorder unexpectedly.
|
|
2578
|
+
*/
|
|
2579
|
+
extraColumns?: ColDef<DocResponse$2>[];
|
|
2563
2580
|
className?: string;
|
|
2564
2581
|
}
|
|
2565
|
-
declare function DocumentTable({ workspaceId, documents, onOpenDocument, selectedIds, onSelectionChange, height, className, }: DocumentTableProps): React__default.JSX.Element;
|
|
2582
|
+
declare function DocumentTable({ workspaceId, documents, onOpenDocument, openOnRowClick, selectedIds, onSelectionChange, height, extraColumns, className, }: DocumentTableProps): React__default.JSX.Element;
|
|
2566
2583
|
|
|
2567
2584
|
/**
|
|
2568
2585
|
* DocumentCard — the canonical document thumbnail tile.
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { cn, Avatar, AvatarFallback, AvatarImage, Tooltip, TooltipTrigger, TooltipContent, Popover, PopoverTrigger, PopoverContent, AiMarkdown, Card, Button, Badge, MarkdownRenderer, Input, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, ScrollArea, Textarea, Slider, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem, Checkbox } from './chunk-VTX77MYP.js';
|
|
2
2
|
export { AiMarkdown, Avatar, AvatarFallback, AvatarImage, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, HoverCard, HoverCardContent, HoverCardTrigger, Input, Label, MarkdownRenderer, MarkdownStreamingContext, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cardVariants, cn, markdownBaseComponents, splitMarkdownBlocks, toggleVariants } from './chunk-VTX77MYP.js';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useArbi, ArbiProvider } from './chunk-J4MX2W4H.js';
|
|
4
|
+
export { ArbiProvider, useArbi } from './chunk-J4MX2W4H.js';
|
|
5
|
+
import React2, { memo, useState, createContext, forwardRef, useMemo, useCallback, useId, useRef, useContext, useEffect } from 'react';
|
|
7
6
|
import { useQuery, useMutation, useQueries, QueryClient, QueryClientProvider, useQueryClient } from '@tanstack/react-query';
|
|
7
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
import { connectWithReconnect, resolveCitations, summarizeCitations } from '@arbidocs/sdk/browser';
|
|
9
|
+
export { Arbi, ArbiError } from '@arbidocs/sdk/browser';
|
|
8
10
|
import { Trash2, CheckCheck, Check, MessageCircleMore, MoreVertical, MessageSquareLock, Info, FileQuestion, BookOpen, Upload, LogOut, LayoutGrid, Bell, MessageSquare, CircleUserRound, Wrench, Package, ClipboardList, UserPlus, Contact, Settings2, Users, User, StickyNote, FolderPlus, Hash, EyeOff, Eye, CaptionsOff, FolderOpen, MessageSquareMore, MessageSquarePlus, MessageSquareText, MessageSquareOff, MessagesSquare, Columns3Cog, SquarePlus, SquareM, ChevronsDown, Bot, Calendar, Search, Folder, List, SquareCheckBig, Loader2, AlertTriangle, ShieldCheck, Copy, Sparkles, FileText, GitCompareArrows, Download, Image as Image$1, CornerDownLeft, X, ArrowLeft, Send, Tags, Crown, Activity, Gauge, Gift, PartyPopper, UserCheck, FileX2, FileCheck2, Pencil, SquareArrowOutUpRight, XCircle, CheckCircle2, ArrowRight, ChevronDown, MoreHorizontal, SquarePen, FileX, SkipForward, CheckCircle } from 'lucide-react';
|
|
9
11
|
import { isMessageType } from '@arbidocs/client';
|
|
10
12
|
export { isMessageType } from '@arbidocs/client';
|
|
@@ -18,17 +20,6 @@ import Cropper from 'react-easy-crop';
|
|
|
18
20
|
import { AgGridReact } from 'ag-grid-react';
|
|
19
21
|
import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community';
|
|
20
22
|
|
|
21
|
-
var ArbiContext = createContext(null);
|
|
22
|
-
function ArbiProvider({ children, ...options }) {
|
|
23
|
-
const arbi = useMemo(
|
|
24
|
-
() => new Arbi(options),
|
|
25
|
-
// Stable on url + deploymentDomain — re-creating the instance on every render would be wrong
|
|
26
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
|
-
[options.url, options.deploymentDomain, options.credentials]
|
|
28
|
-
);
|
|
29
|
-
return /* @__PURE__ */ jsx(ArbiContext.Provider, { value: arbi, children });
|
|
30
|
-
}
|
|
31
|
-
|
|
32
23
|
// src/chat/styles.ts
|
|
33
24
|
var DEFAULT_THEME = {
|
|
34
25
|
primaryColor: "#00adef",
|
|
@@ -351,13 +342,6 @@ function agentStatusStyle(theme) {
|
|
|
351
342
|
alignSelf: "flex-start"
|
|
352
343
|
};
|
|
353
344
|
}
|
|
354
|
-
function useArbi() {
|
|
355
|
-
const arbi = useContext(ArbiContext);
|
|
356
|
-
if (!arbi) {
|
|
357
|
-
throw new Error("useArbi() must be used within an <ArbiProvider>");
|
|
358
|
-
}
|
|
359
|
-
return arbi;
|
|
360
|
-
}
|
|
361
345
|
function AuthScreen({ theme, labels, onLogin }) {
|
|
362
346
|
const arbi = useArbi();
|
|
363
347
|
const [mode, setMode] = useState("login");
|
|
@@ -2947,8 +2931,8 @@ Question: ${question}`,
|
|
|
2947
2931
|
`Suggest 3-6 concise, reusable labels for the document "${docName ?? docId}" \u2014 covering document type, the key issues it touches, and any key parties. Return them as a short comma-separated list with a one-line rationale for each.`,
|
|
2948
2932
|
[docId]
|
|
2949
2933
|
);
|
|
2950
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", "data-testid": "doc-qa", children: [
|
|
2951
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2934
|
+
return /* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-3", "data-testid": "doc-qa", children: [
|
|
2935
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2952
2936
|
/* @__PURE__ */ jsx(
|
|
2953
2937
|
Input,
|
|
2954
2938
|
{
|
|
@@ -2956,7 +2940,7 @@ Question: ${question}`,
|
|
|
2956
2940
|
onChange: (e) => setQ(e.target.value),
|
|
2957
2941
|
onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(), ask()),
|
|
2958
2942
|
placeholder: "Ask about this document\u2026",
|
|
2959
|
-
className: "bg-card text-sm placeholder:text-muted-foreground/70 focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
2943
|
+
className: "min-w-0 flex-1 bg-card text-sm placeholder:text-muted-foreground/70 focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
2960
2944
|
"data-testid": "doc-qa-input"
|
|
2961
2945
|
}
|
|
2962
2946
|
),
|
|
@@ -2967,6 +2951,7 @@ Question: ${question}`,
|
|
|
2967
2951
|
size: "icon",
|
|
2968
2952
|
onClick: ask,
|
|
2969
2953
|
disabled: task.isRunning || !q.trim(),
|
|
2954
|
+
className: "shrink-0",
|
|
2970
2955
|
"data-testid": "doc-qa-send",
|
|
2971
2956
|
children: /* @__PURE__ */ jsx(Send, { className: "size-4" })
|
|
2972
2957
|
}
|
|
@@ -2978,6 +2963,7 @@ Question: ${question}`,
|
|
|
2978
2963
|
size: "sm",
|
|
2979
2964
|
onClick: suggestTags,
|
|
2980
2965
|
disabled: task.isRunning,
|
|
2966
|
+
className: "shrink-0",
|
|
2981
2967
|
"data-testid": "doc-qa-tags",
|
|
2982
2968
|
children: [
|
|
2983
2969
|
/* @__PURE__ */ jsx(Tags, { className: "size-4" }),
|
|
@@ -6120,9 +6106,11 @@ function DocumentTable({
|
|
|
6120
6106
|
workspaceId,
|
|
6121
6107
|
documents,
|
|
6122
6108
|
onOpenDocument,
|
|
6109
|
+
openOnRowClick = true,
|
|
6123
6110
|
selectedIds,
|
|
6124
6111
|
onSelectionChange,
|
|
6125
6112
|
height = 480,
|
|
6113
|
+
extraColumns,
|
|
6126
6114
|
className
|
|
6127
6115
|
}) {
|
|
6128
6116
|
const query = useDocuments(workspaceId, { enabled: !documents });
|
|
@@ -6254,9 +6242,10 @@ function DocumentTable({
|
|
|
6254
6242
|
sortable: true,
|
|
6255
6243
|
field: "folder",
|
|
6256
6244
|
valueFormatter: (p) => p.value || "\u2014"
|
|
6257
|
-
}
|
|
6245
|
+
},
|
|
6246
|
+
...extraColumns ?? []
|
|
6258
6247
|
],
|
|
6259
|
-
[openDocument, viewingDocId, tagNameById]
|
|
6248
|
+
[openDocument, viewingDocId, tagNameById, extraColumns]
|
|
6260
6249
|
);
|
|
6261
6250
|
const handleGridReady = (e) => {
|
|
6262
6251
|
gridApiRef.current = e.api;
|
|
@@ -6267,6 +6256,7 @@ function DocumentTable({
|
|
|
6267
6256
|
emitSelection(ids);
|
|
6268
6257
|
};
|
|
6269
6258
|
const handleRowClicked = (e) => {
|
|
6259
|
+
if (!openOnRowClick) return;
|
|
6270
6260
|
const id = e.data?.external_id;
|
|
6271
6261
|
if (id) openDocument(id);
|
|
6272
6262
|
};
|
|
@@ -6743,6 +6733,6 @@ function DocumentGallery({
|
|
|
6743
6733
|
);
|
|
6744
6734
|
}
|
|
6745
6735
|
|
|
6746
|
-
export { ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, ArbiChat, ArbiChatPanel, ArbiIcon,
|
|
6736
|
+
export { ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, ArbiChat, ArbiChatPanel, ArbiIcon, ArbiWebSocketProvider, ArtifactCanvas, AudIcon, BASE_COLORS2 as BASE_COLORS, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_NOTIFY_TONE, DirectMessages, DmAvatar, DmComposer, DocIcon, DocQaPanel, DocSearch, DocumentCard, DocumentCardMenu, DocumentEntity, DocumentGallery, DocumentReview, DocumentTable, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, HtmlIcon, ImageCropModal, ImageCropper, ImgIcon, LinkedInIcon, MessageArtifactCard, MessageBubble2 as MessageBubble, MessageThread, NEUTRAL_GRAY2 as NEUTRAL_GRAY, NotificationBell, OpenAIIcon, PLACEHOLDER_COLOR, PdfIcon, ProjectEntity, ProviderIcon, RagDot, SemanticSearch, StatusPill, TAG_TYPE_ICONS, TAG_TYPE_LABELS, TagEntity, Toaster, TxtIcon, TypingIndicator, UserEntity, UserMenu, VISIBILITY_ICONS, VidIcon, VisibilityIcon, XlsIcon, arbiQueryKeys, configureEntityRegistry, configureRagLabels, configureStatusRegistry, cropImage, describeActivity, formatRelativeTime, getEntityColor2 as getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getNotificationTypeMeta, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceActionText, getWorkspaceColor, getWorkspaceSentPhrase, isWorkspaceNotificationType, notify, parseActivityContent, redlineStats, seedNotifications, selectUnread, textToArtifact, toRedlineMarkdown, useActivity, useAgents, useAiTask, useArbiConnected, useArbiDocumentSync, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssistantQuery, useCommandPalette, useConfigs, useConversations, useDeleteAgents, useDirectMessages, useDocuments, useHealth, useMemories, useNotify, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSemanticSearch, useSessions, useTags, useTasks, useThumbnails, useUserUsageToday, useWorkspaceChronology, useWorkspaceDocs, useWorkspaces, userDisplayName, userInitials };
|
|
6747
6737
|
//# sourceMappingURL=index.js.map
|
|
6748
6738
|
//# sourceMappingURL=index.js.map
|