@arbidocs/react 0.3.177 → 0.3.179
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/index.cjs +24 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -15
- package/dist/index.d.ts +20 -15
- package/dist/index.js +17 -38
- package/dist/index.js.map +1 -1
- package/dist/viewers/index.cjs +5 -2
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.d.cts +7 -0
- package/dist/viewers/index.d.ts +7 -0
- package/dist/viewers/index.js +5 -2
- package/dist/viewers/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -468,12 +468,12 @@ declare function useDocuments(workspaceId: string | undefined, options?: {
|
|
|
468
468
|
doctags: {
|
|
469
469
|
note?: string | null | undefined;
|
|
470
470
|
citations?: {
|
|
471
|
-
|
|
471
|
+
doc_ext_id: string;
|
|
472
|
+
chunks?: {
|
|
472
473
|
chunk_id: string;
|
|
473
|
-
doc_ext_id?: string | null | undefined;
|
|
474
474
|
page?: number | null | undefined;
|
|
475
|
-
}[];
|
|
476
|
-
} | null | undefined;
|
|
475
|
+
}[] | undefined;
|
|
476
|
+
}[] | null | undefined;
|
|
477
477
|
external_id: string;
|
|
478
478
|
doc_ext_id: string;
|
|
479
479
|
tag_ext_id: string;
|
|
@@ -519,6 +519,7 @@ declare function useTags(workspaceId: string | undefined, options?: {
|
|
|
519
519
|
shared: boolean;
|
|
520
520
|
parent_ext_id?: string | null | undefined;
|
|
521
521
|
doctag_count: number;
|
|
522
|
+
facttag_count: number;
|
|
522
523
|
created_by_ext_id: string;
|
|
523
524
|
updated_by_ext_id?: string | null | undefined;
|
|
524
525
|
created_at: string;
|
|
@@ -887,12 +888,12 @@ declare function useWorkspaceDocs(workspaceId?: string): {
|
|
|
887
888
|
doctags: {
|
|
888
889
|
note?: string | null | undefined;
|
|
889
890
|
citations?: {
|
|
890
|
-
|
|
891
|
+
doc_ext_id: string;
|
|
892
|
+
chunks?: {
|
|
891
893
|
chunk_id: string;
|
|
892
|
-
doc_ext_id?: string | null | undefined;
|
|
893
894
|
page?: number | null | undefined;
|
|
894
|
-
}[];
|
|
895
|
-
} | null | undefined;
|
|
895
|
+
}[] | undefined;
|
|
896
|
+
}[] | null | undefined;
|
|
896
897
|
external_id: string;
|
|
897
898
|
doc_ext_id: string;
|
|
898
899
|
tag_ext_id: string;
|
|
@@ -1571,11 +1572,8 @@ interface DocumentEntityProps {
|
|
|
1571
1572
|
onClick?: (e: React__default.MouseEvent) => void;
|
|
1572
1573
|
/** Click handler for the icon only */
|
|
1573
1574
|
onIconClick?: (e: React__default.MouseEvent) => void;
|
|
1574
|
-
/** When true, the file-type icon
|
|
1575
|
-
*
|
|
1576
|
-
showHoverEye?: boolean;
|
|
1577
|
-
/** When true, the Eye is pinned on (not just hover) — marks the document that
|
|
1578
|
-
* is currently open/being viewed. Implies the hover-swap behaviour. */
|
|
1575
|
+
/** When true, the file-type icon is replaced by a pinned Eye — marks the
|
|
1576
|
+
* document that is currently open/being viewed. */
|
|
1579
1577
|
viewing?: boolean;
|
|
1580
1578
|
/** Small overlay pinned to the icon's corner (e.g. an "available offline" pip). */
|
|
1581
1579
|
iconBadge?: React__default.ReactNode;
|
|
@@ -1584,11 +1582,16 @@ interface DocumentEntityProps {
|
|
|
1584
1582
|
/** When true, the pill fills the available width and the name truncates via
|
|
1585
1583
|
* CSS so the trailing ⋯ menu pins to the right edge. */
|
|
1586
1584
|
fullWidth?: boolean;
|
|
1585
|
+
/** Render the WHOLE title (skip the 30-char `clampLabel` string cut) while
|
|
1586
|
+
* keeping the normal content-width layout — for callers that want the full
|
|
1587
|
+
* name to show/wrap (via a `labelClassName`) without `fullWidth`'s w-full.
|
|
1588
|
+
* `fullWidth` already implies this. */
|
|
1589
|
+
noClamp?: boolean;
|
|
1587
1590
|
/** Override the default folder/title hover tooltip. */
|
|
1588
1591
|
tooltipContent?: React__default.ReactNode;
|
|
1589
1592
|
className?: string;
|
|
1590
1593
|
}
|
|
1591
|
-
declare function DocumentEntity({ doc, icon, size, labelMaxWidth, labelClassName, onClick, onIconClick,
|
|
1594
|
+
declare function DocumentEntity({ doc, icon, size, labelMaxWidth, labelClassName, onClick, onIconClick, viewing, iconBadge, actions, tooltipContent, className, fullWidth, noClamp, }: DocumentEntityProps): React__default.JSX.Element;
|
|
1592
1595
|
|
|
1593
1596
|
/**
|
|
1594
1597
|
* TagEntity Component
|
|
@@ -1641,7 +1644,9 @@ declare function TagEntity({ tag, size, className, onClick, showTooltip, tooltip
|
|
|
1641
1644
|
declare const TAG_TYPE_LABELS: Record<string, string>;
|
|
1642
1645
|
/** Icon mapping for tag types. */
|
|
1643
1646
|
declare const TAG_TYPE_ICONS: Record<string, typeof StickyNote>;
|
|
1644
|
-
/** Resolve the icon component for a tag type, with the `text` (
|
|
1647
|
+
/** Resolve the icon component for a tag type, with the `text` (NotebookPen) fallback.
|
|
1648
|
+
* Annotations share the NotebookPen mark used by the AI Annotate bulk action, so
|
|
1649
|
+
* the table column and the batch bar name the same thing the same way. */
|
|
1645
1650
|
declare function getTagTypeIcon(type?: string | null): typeof StickyNote;
|
|
1646
1651
|
/** Resolve the human-readable label for a tag type, falling back to the raw type. */
|
|
1647
1652
|
declare function getTagTypeLabel(type?: string | null): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -468,12 +468,12 @@ declare function useDocuments(workspaceId: string | undefined, options?: {
|
|
|
468
468
|
doctags: {
|
|
469
469
|
note?: string | null | undefined;
|
|
470
470
|
citations?: {
|
|
471
|
-
|
|
471
|
+
doc_ext_id: string;
|
|
472
|
+
chunks?: {
|
|
472
473
|
chunk_id: string;
|
|
473
|
-
doc_ext_id?: string | null | undefined;
|
|
474
474
|
page?: number | null | undefined;
|
|
475
|
-
}[];
|
|
476
|
-
} | null | undefined;
|
|
475
|
+
}[] | undefined;
|
|
476
|
+
}[] | null | undefined;
|
|
477
477
|
external_id: string;
|
|
478
478
|
doc_ext_id: string;
|
|
479
479
|
tag_ext_id: string;
|
|
@@ -519,6 +519,7 @@ declare function useTags(workspaceId: string | undefined, options?: {
|
|
|
519
519
|
shared: boolean;
|
|
520
520
|
parent_ext_id?: string | null | undefined;
|
|
521
521
|
doctag_count: number;
|
|
522
|
+
facttag_count: number;
|
|
522
523
|
created_by_ext_id: string;
|
|
523
524
|
updated_by_ext_id?: string | null | undefined;
|
|
524
525
|
created_at: string;
|
|
@@ -887,12 +888,12 @@ declare function useWorkspaceDocs(workspaceId?: string): {
|
|
|
887
888
|
doctags: {
|
|
888
889
|
note?: string | null | undefined;
|
|
889
890
|
citations?: {
|
|
890
|
-
|
|
891
|
+
doc_ext_id: string;
|
|
892
|
+
chunks?: {
|
|
891
893
|
chunk_id: string;
|
|
892
|
-
doc_ext_id?: string | null | undefined;
|
|
893
894
|
page?: number | null | undefined;
|
|
894
|
-
}[];
|
|
895
|
-
} | null | undefined;
|
|
895
|
+
}[] | undefined;
|
|
896
|
+
}[] | null | undefined;
|
|
896
897
|
external_id: string;
|
|
897
898
|
doc_ext_id: string;
|
|
898
899
|
tag_ext_id: string;
|
|
@@ -1571,11 +1572,8 @@ interface DocumentEntityProps {
|
|
|
1571
1572
|
onClick?: (e: React__default.MouseEvent) => void;
|
|
1572
1573
|
/** Click handler for the icon only */
|
|
1573
1574
|
onIconClick?: (e: React__default.MouseEvent) => void;
|
|
1574
|
-
/** When true, the file-type icon
|
|
1575
|
-
*
|
|
1576
|
-
showHoverEye?: boolean;
|
|
1577
|
-
/** When true, the Eye is pinned on (not just hover) — marks the document that
|
|
1578
|
-
* is currently open/being viewed. Implies the hover-swap behaviour. */
|
|
1575
|
+
/** When true, the file-type icon is replaced by a pinned Eye — marks the
|
|
1576
|
+
* document that is currently open/being viewed. */
|
|
1579
1577
|
viewing?: boolean;
|
|
1580
1578
|
/** Small overlay pinned to the icon's corner (e.g. an "available offline" pip). */
|
|
1581
1579
|
iconBadge?: React__default.ReactNode;
|
|
@@ -1584,11 +1582,16 @@ interface DocumentEntityProps {
|
|
|
1584
1582
|
/** When true, the pill fills the available width and the name truncates via
|
|
1585
1583
|
* CSS so the trailing ⋯ menu pins to the right edge. */
|
|
1586
1584
|
fullWidth?: boolean;
|
|
1585
|
+
/** Render the WHOLE title (skip the 30-char `clampLabel` string cut) while
|
|
1586
|
+
* keeping the normal content-width layout — for callers that want the full
|
|
1587
|
+
* name to show/wrap (via a `labelClassName`) without `fullWidth`'s w-full.
|
|
1588
|
+
* `fullWidth` already implies this. */
|
|
1589
|
+
noClamp?: boolean;
|
|
1587
1590
|
/** Override the default folder/title hover tooltip. */
|
|
1588
1591
|
tooltipContent?: React__default.ReactNode;
|
|
1589
1592
|
className?: string;
|
|
1590
1593
|
}
|
|
1591
|
-
declare function DocumentEntity({ doc, icon, size, labelMaxWidth, labelClassName, onClick, onIconClick,
|
|
1594
|
+
declare function DocumentEntity({ doc, icon, size, labelMaxWidth, labelClassName, onClick, onIconClick, viewing, iconBadge, actions, tooltipContent, className, fullWidth, noClamp, }: DocumentEntityProps): React__default.JSX.Element;
|
|
1592
1595
|
|
|
1593
1596
|
/**
|
|
1594
1597
|
* TagEntity Component
|
|
@@ -1641,7 +1644,9 @@ declare function TagEntity({ tag, size, className, onClick, showTooltip, tooltip
|
|
|
1641
1644
|
declare const TAG_TYPE_LABELS: Record<string, string>;
|
|
1642
1645
|
/** Icon mapping for tag types. */
|
|
1643
1646
|
declare const TAG_TYPE_ICONS: Record<string, typeof StickyNote>;
|
|
1644
|
-
/** Resolve the icon component for a tag type, with the `text` (
|
|
1647
|
+
/** Resolve the icon component for a tag type, with the `text` (NotebookPen) fallback.
|
|
1648
|
+
* Annotations share the NotebookPen mark used by the AI Annotate bulk action, so
|
|
1649
|
+
* the table column and the batch bar name the same thing the same way. */
|
|
1645
1650
|
declare function getTagTypeIcon(type?: string | null): typeof StickyNote;
|
|
1646
1651
|
/** Resolve the human-readable label for a tag type, falling back to the raw type. */
|
|
1647
1652
|
declare function getTagTypeLabel(type?: string | null): string;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useArbi, ArbiProvider, AudioViewer, ImageViewer, VideoViewer } from './chunk-JKO3NR5L.js';
|
|
2
|
-
export { ArbiProvider, useArbi } from './chunk-JKO3NR5L.js';
|
|
3
1
|
import { cn, Avatar, AvatarFallback, AvatarImage, Tooltip, TooltipTrigger, TooltipContent, Popover, PopoverTrigger, PopoverContent, AiMarkdown, Card, Button, Badge, MarkdownRenderer, Input, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, ScrollArea, Textarea, Slider, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, DropdownMenuLabel, DropdownMenuSeparator, Checkbox, useAudioRecorder, MicWaveformIndicator, IconToggle, classifyMediaError, formatElapsed } from './chunk-I256BUCX.js';
|
|
4
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, DictateProvider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, HoverCard, HoverCardContent, HoverCardTrigger, IconToggle, InlineMicButton, Input, Label, MarkdownRenderer, MarkdownStreamingContext, MicRecordingOverlay, MicWaveformIndicator, 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, formatElapsed, markdownBaseComponents, splitMarkdownBlocks, toggleVariants, useAudioRecorder } from './chunk-I256BUCX.js';
|
|
3
|
+
import { useArbi, ArbiProvider, AudioViewer, ImageViewer, VideoViewer } from './chunk-JKO3NR5L.js';
|
|
4
|
+
export { ArbiProvider, useArbi } from './chunk-JKO3NR5L.js';
|
|
5
5
|
import React2, { memo, useState, createContext, forwardRef, useMemo, useCallback, useId, useRef, useContext, useEffect, Fragment as Fragment$1 } from 'react';
|
|
6
6
|
import { useQuery, useMutation, useQueries, QueryClient, QueryClientProvider, useQueryClient } from '@tanstack/react-query';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -2449,14 +2449,14 @@ var TAG_TYPE_ICONS = {
|
|
|
2449
2449
|
checkbox: SquareCheckBig,
|
|
2450
2450
|
select: List,
|
|
2451
2451
|
number: Hash,
|
|
2452
|
-
text:
|
|
2452
|
+
text: NotebookPen,
|
|
2453
2453
|
folder: Folder,
|
|
2454
2454
|
search: Search,
|
|
2455
2455
|
date: Calendar,
|
|
2456
2456
|
assistant: Bot
|
|
2457
2457
|
};
|
|
2458
2458
|
function getTagTypeIcon(type) {
|
|
2459
|
-
return TAG_TYPE_ICONS[type ?? "text"] ||
|
|
2459
|
+
return TAG_TYPE_ICONS[type ?? "text"] || NotebookPen;
|
|
2460
2460
|
}
|
|
2461
2461
|
function getTagTypeLabel(type) {
|
|
2462
2462
|
const t = type ?? "text";
|
|
@@ -2572,7 +2572,7 @@ function DocumentReview({
|
|
|
2572
2572
|
const list = [];
|
|
2573
2573
|
const chunkTag = /* @__PURE__ */ new Map();
|
|
2574
2574
|
for (const dt of doc?.doctags ?? []) {
|
|
2575
|
-
const chunkIds = dt.citations
|
|
2575
|
+
const chunkIds = (dt.citations ?? []).flatMap((d) => (d.chunks ?? []).map((c) => c.chunk_id));
|
|
2576
2576
|
if (chunkIds.length === 0) continue;
|
|
2577
2577
|
list.push({
|
|
2578
2578
|
key: dt.tag_ext_id,
|
|
@@ -4284,51 +4284,32 @@ function DocumentEntity({
|
|
|
4284
4284
|
labelClassName,
|
|
4285
4285
|
onClick,
|
|
4286
4286
|
onIconClick,
|
|
4287
|
-
showHoverEye,
|
|
4288
4287
|
viewing,
|
|
4289
4288
|
iconBadge,
|
|
4290
4289
|
actions,
|
|
4291
4290
|
tooltipContent,
|
|
4292
4291
|
className,
|
|
4293
|
-
fullWidth
|
|
4292
|
+
fullWidth,
|
|
4293
|
+
noClamp
|
|
4294
4294
|
}) {
|
|
4295
4295
|
const title = getDocumentTitle(doc);
|
|
4296
4296
|
const ext = doc.file_name?.split(".").pop()?.toLowerCase();
|
|
4297
4297
|
const iconSize = size === "base" ? 16 : 14;
|
|
4298
4298
|
const eyeSizeClass = size === "base" ? "h-4 w-4" : "h-3.5 w-3.5";
|
|
4299
4299
|
const baseIcon = icon ?? getDocIcon(doc.file_name, iconSize);
|
|
4300
|
-
const
|
|
4301
|
-
|
|
4302
|
-
showEye ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4303
|
-
/* @__PURE__ */ jsx(
|
|
4304
|
-
"span",
|
|
4305
|
-
{
|
|
4306
|
-
className: cn(
|
|
4307
|
-
"transition-opacity",
|
|
4308
|
-
viewing ? "opacity-0" : "group-hover/pill:opacity-0 group-has-[[data-state=open]]/pill:opacity-0"
|
|
4309
|
-
),
|
|
4310
|
-
children: baseIcon
|
|
4311
|
-
}
|
|
4312
|
-
),
|
|
4313
|
-
/* @__PURE__ */ jsx(
|
|
4314
|
-
Eye,
|
|
4315
|
-
{
|
|
4316
|
-
className: cn(
|
|
4317
|
-
"absolute inset-0 m-auto transition-opacity",
|
|
4318
|
-
eyeSizeClass,
|
|
4319
|
-
viewing ? "text-primary-foreground opacity-100" : "text-primary opacity-0 group-hover/pill:opacity-100 group-has-[[data-state=open]]/pill:opacity-100"
|
|
4320
|
-
)
|
|
4321
|
-
}
|
|
4322
|
-
)
|
|
4323
|
-
] }) : baseIcon,
|
|
4300
|
+
const displayIcon = viewing || iconBadge ? /* @__PURE__ */ jsxs("span", { className: "relative inline-flex flex-shrink-0 items-center justify-center", children: [
|
|
4301
|
+
viewing ? /* @__PURE__ */ jsx(Eye, { className: cn("text-primary-foreground", eyeSizeClass) }) : baseIcon,
|
|
4324
4302
|
iconBadge
|
|
4325
4303
|
] }) : baseIcon;
|
|
4326
|
-
const defaultTooltip = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 text-xs max-w-[
|
|
4327
|
-
doc.folder &&
|
|
4304
|
+
const defaultTooltip = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 text-xs max-w-[440px]", children: [
|
|
4305
|
+
doc.folder && // `flex-wrap` so a deep folder path wraps WITHIN the balloon instead of
|
|
4306
|
+
// spilling out of it (each path segment is atomic and wraps as a unit;
|
|
4307
|
+
// `min-w-0` + `break-all` lets a single over-long segment break too).
|
|
4308
|
+
/* @__PURE__ */ jsxs("span", { className: "flex flex-wrap items-center gap-0.5 text-muted-foreground", children: [
|
|
4328
4309
|
/* @__PURE__ */ jsx(FolderOpen, { className: "h-3 w-3 text-yellow-600 shrink-0" }),
|
|
4329
|
-
doc.folder.split("/").map((part, i, arr) => /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5
|
|
4310
|
+
doc.folder.split("/").map((part, i, arr) => /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-0.5", children: [
|
|
4330
4311
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/50 mx-0.5", children: "/" }),
|
|
4331
|
-
/* @__PURE__ */ jsx("span", { className: i < arr.length - 1 ? "text-muted-foreground/70" : ""
|
|
4312
|
+
/* @__PURE__ */ jsx("span", { className: `break-all ${i < arr.length - 1 ? "text-muted-foreground/70" : ""}`, children: part })
|
|
4332
4313
|
] }, i))
|
|
4333
4314
|
] }),
|
|
4334
4315
|
/* @__PURE__ */ jsxs("span", { className: "font-medium break-words", children: [
|
|
@@ -4341,7 +4322,7 @@ function DocumentEntity({
|
|
|
4341
4322
|
{
|
|
4342
4323
|
icon: displayIcon,
|
|
4343
4324
|
size,
|
|
4344
|
-
label: fullWidth ? title : clampLabel(title),
|
|
4325
|
+
label: fullWidth || noClamp ? title : clampLabel(title),
|
|
4345
4326
|
labelMaxWidth: labelMaxWidth ?? "max-w-[140px]",
|
|
4346
4327
|
labelClassName,
|
|
4347
4328
|
fullWidth,
|
|
@@ -6628,7 +6609,6 @@ function DocumentTable({
|
|
|
6628
6609
|
doc,
|
|
6629
6610
|
size: "base",
|
|
6630
6611
|
fullWidth: true,
|
|
6631
|
-
showHoverEye: true,
|
|
6632
6612
|
viewing: viewingDocId === doc.external_id,
|
|
6633
6613
|
onClick: (e) => {
|
|
6634
6614
|
e.stopPropagation();
|
|
@@ -6929,7 +6909,6 @@ function DocumentCard({
|
|
|
6929
6909
|
{
|
|
6930
6910
|
doc,
|
|
6931
6911
|
fullWidth: true,
|
|
6932
|
-
showHoverEye: true,
|
|
6933
6912
|
viewing,
|
|
6934
6913
|
tooltipContent,
|
|
6935
6914
|
labelClassName: "font-semibold",
|