@arbidocs/react 0.4.39 → 0.4.41

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.d.cts CHANGED
@@ -3656,6 +3656,9 @@ interface CitationRendererProps {
3656
3656
  onDismissCitation: () => void;
3657
3657
  /** Tells the user a citation was copied (or could not be). Optional: copying is silent without it. */
3658
3658
  notify?: (message: string, kind?: 'success' | 'error' | 'info') => void;
3659
+ /** Display names keyed by doc_ext_id. A chunk's `doc_title` is the raw upload name, which can
3660
+ * differ from the name the workspace shows; when a name is given here it is used instead. */
3661
+ docTitles?: ReadonlyMap<string, string>;
3659
3662
  }
3660
3663
  declare const CitationRenderer: React__default.NamedExoticComponent<CitationRendererProps>;
3661
3664
 
package/dist/index.d.ts CHANGED
@@ -3656,6 +3656,9 @@ interface CitationRendererProps {
3656
3656
  onDismissCitation: () => void;
3657
3657
  /** Tells the user a citation was copied (or could not be). Optional: copying is silent without it. */
3658
3658
  notify?: (message: string, kind?: 'success' | 'error' | 'info') => void;
3659
+ /** Display names keyed by doc_ext_id. A chunk's `doc_title` is the raw upload name, which can
3660
+ * differ from the name the workspace shows; when a name is given here it is used instead. */
3661
+ docTitles?: ReadonlyMap<string, string>;
3659
3662
  }
3660
3663
  declare const CitationRenderer: React__default.NamedExoticComponent<CitationRendererProps>;
3661
3664
 
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { arbiQueryKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-JPQUPDIS.js';
2
2
  export { DEFAULT_USD_PER_CREDIT, arbiQueryKeys, cleanDraftMarkdown, cleanDraftWithReport, creditsToUsd, formatCredits, isUsageMetered, promoteBoldTitle, repairParsedStructure, repairParsedTitle, stripAgentPreamble, unescapeMarkdown, unwrapCitationLinks, useActivity, useAgents, useAssistantQuery, useConfigs, useConversationThreads, useConversations, useDeleteAgents, useDocuments, useFacts, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSessions, useTags, useThumbnails, useUserUsageToday, useWorkspaceUsers, useWorkspaces } from './chunk-JPQUPDIS.js';
3
+ import { formatRelativeTime } from './chunk-UDOPD3GK.js';
4
+ export { DEFAULT_NOTIFY_TONE, NotificationBell, Toaster, formatRelativeTime, notify, seedNotifications, selectUnread, toast, useNotify } from './chunk-UDOPD3GK.js';
3
5
  import { MarkMenu, AiMarkdown, Card, Button, Badge, TagEntity, Input, FILE_TYPE_COLORS, getEntityIcon, UserEntity, getEntityColorStyles, AgentBadge, Textarea, Label, Slider, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, DocumentEntity, DocumentCard, useAudioRecorder, MicWaveformIndicator, IconToggle, classifyMediaError, formatElapsed, PassageCard } from './chunk-TM3EAMIR.js';
4
6
  export { AgentBadge, AiMarkdown, ArbiBotHeadIcon, AudIcon, Avatar, AvatarFallback, AvatarImage, BASE_COLORS, 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, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, IconToggle, ImgIcon, InlineMicButton, Input, Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY, PLACEHOLDER_COLOR, PassageCard, PdfIcon, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, RadioGroup, RadioGroupItem, RagDot, RelevanceDot, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, StatusPill, Switch, TAG_TYPE_ICONS, TAG_TYPE_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagEntity, Textarea, ThreadVisibilityIcon, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TxtIcon, UserEntity, UserMenu, VISIBILITY_ICONS, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, badgeVariants, buttonVariants, cardVariants, configureEntityRegistry, configureRagLabels, configureStatusRegistry, formatElapsed, getDocIcon, getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, toggleVariants, useAudioRecorder } from './chunk-TM3EAMIR.js';
5
7
  import { normalizeCitationMarkup, MarkdownRenderer } from './chunk-NVURJTYN.js';
6
8
  export { MarkdownRenderer, MarkdownStreamingContext, closeOpenEmphasis, markdownBaseComponents, normalizeCitationMarkup, splitMarkdownBlocks, trimOpenCitation } from './chunk-NVURJTYN.js';
7
- import { formatRelativeTime } from './chunk-UDOPD3GK.js';
8
- export { DEFAULT_NOTIFY_TONE, NotificationBell, Toaster, formatRelativeTime, notify, seedNotifications, selectUnread, toast, useNotify } from './chunk-UDOPD3GK.js';
9
9
  import { ScrollArea, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from './chunk-N5SVBDLC.js';
10
10
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ScrollArea, ScrollBar } from './chunk-N5SVBDLC.js';
11
11
  import { cn } from './chunk-SN5YV6FF.js';
@@ -2974,7 +2974,8 @@ var CitationRendererComponent = ({
2974
2974
  useCitationState,
2975
2975
  onCloseCitation,
2976
2976
  onDismissCitation,
2977
- notify: notify2
2977
+ notify: notify2,
2978
+ docTitles
2978
2979
  }) => {
2979
2980
  const chunkMap = useMemo(() => {
2980
2981
  const map = /* @__PURE__ */ new Map();
@@ -2983,14 +2984,18 @@ var CitationRendererComponent = ({
2983
2984
  if (docChunks && Array.isArray(docChunks)) {
2984
2985
  docChunks.forEach((chunk) => {
2985
2986
  if (chunk.metadata && chunk.metadata.chunk_ext_id) {
2986
- map.set(chunk.metadata.chunk_ext_id, chunk);
2987
+ const displayTitle = chunk.metadata.doc_ext_id ? docTitles?.get(chunk.metadata.doc_ext_id) : void 0;
2988
+ map.set(
2989
+ chunk.metadata.chunk_ext_id,
2990
+ displayTitle ? { ...chunk, metadata: { ...chunk.metadata, doc_title: displayTitle } } : chunk
2991
+ );
2987
2992
  }
2988
2993
  });
2989
2994
  }
2990
2995
  });
2991
2996
  }
2992
2997
  return map;
2993
- }, [citationData]);
2998
+ }, [citationData, docTitles]);
2994
2999
  const getChunkDetails = useCallback(
2995
3000
  (chunkIds) => [...new Set(chunkIds)].map((id) => chunkMap.get(id)).filter((c) => c !== void 0),
2996
3001
  [chunkMap]