@arbidocs/react 0.4.122 → 0.4.124

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkAFGE55RQ_cjs = require('../chunk-AFGE55RQ.cjs');
4
4
  var chunk3AADNIOK_cjs = require('../chunk-3AADNIOK.cjs');
5
- var chunkT4IJHRRD_cjs = require('../chunk-T4IJHRRD.cjs');
5
+ var chunkNUFEZBA5_cjs = require('../chunk-NUFEZBA5.cjs');
6
6
  var chunk5DCRIWCA_cjs = require('../chunk-5DCRIWCA.cjs');
7
7
  var chunkVOFNX4P6_cjs = require('../chunk-VOFNX4P6.cjs');
8
8
  var chunkTBELZWGV_cjs = require('../chunk-TBELZWGV.cjs');
@@ -281,19 +281,19 @@ function useArtifactText(docId, options) {
281
281
  ...DEFAULT_ARTIFACT_TEXT_RETRY,
282
282
  ...options?.retry
283
283
  };
284
- const enabled = (options?.enabled ?? true) && chunkT4IJHRRD_cjs.isDocumentId(docId) && arbi.hasWorkspace;
284
+ const enabled = (options?.enabled ?? true) && chunkNUFEZBA5_cjs.isDocumentId(docId) && arbi.hasWorkspace;
285
285
  const query = reactQuery.useQuery({
286
286
  // Under the shared `parsedDoc` key, so a document's invalidation reaches it too.
287
287
  queryKey: [...chunkAFGE55RQ_cjs.arbiQueryKeys.parsedDoc(docId ?? "", "marker"), "artifact-text"],
288
288
  queryFn: async () => {
289
- const { docId: plainId, version } = chunkT4IJHRRD_cjs.parseVersionRef(docId);
289
+ const { docId: plainId, version } = chunkNUFEZBA5_cjs.parseVersionRef(docId);
290
290
  const parsed = await arbi.documents.getParsedContent(
291
291
  plainId,
292
292
  "marker",
293
293
  version ?? void 0
294
294
  );
295
295
  if (!parsed.chunks?.some((c) => c.content?.trim())) throw new NotParsedYetError();
296
- return chunkT4IJHRRD_cjs.flattenChunks(parsed.chunks, { unescape: true });
296
+ return chunkNUFEZBA5_cjs.flattenChunks(parsed.chunks, { unescape: true });
297
297
  },
298
298
  enabled,
299
299
  retry: (failureCount, error) => !isRefusal(error) && failureCount < attempts,
@@ -331,7 +331,7 @@ function useArtifactText(docId, options) {
331
331
 
332
332
  // src/artifacts/useArtifactSession.ts
333
333
  function useArtifactVersions(workspaceId, docId) {
334
- const plainId = docId ? chunkT4IJHRRD_cjs.parseVersionRef(docId).docId : null;
334
+ const plainId = docId ? chunkNUFEZBA5_cjs.parseVersionRef(docId).docId : null;
335
335
  const { data: documents } = chunkAFGE55RQ_cjs.useDocuments(workspaceId);
336
336
  const listed = react.useMemo(
337
337
  () => (documents ?? []).find((d) => d.external_id === plainId),
@@ -341,7 +341,7 @@ function useArtifactVersions(workspaceId, docId) {
341
341
  enabled: !!plainId && documents !== void 0 && !listed
342
342
  });
343
343
  return react.useMemo(
344
- () => listed ? chunkT4IJHRRD_cjs.documentVersions(listed) : chunkT4IJHRRD_cjs.toArtifactVersions(plainId, history),
344
+ () => listed ? chunkNUFEZBA5_cjs.documentVersions(listed) : chunkNUFEZBA5_cjs.toArtifactVersions(plainId, history),
345
345
  [listed, history, plainId]
346
346
  );
347
347
  }
@@ -356,7 +356,7 @@ function useSaveArtifactVersion() {
356
356
  fileName,
357
357
  {
358
358
  wpType: wpType ?? "artifact",
359
- versionOf: versionOf ? chunkT4IJHRRD_cjs.parseVersionRef(versionOf).docId : void 0,
359
+ versionOf: versionOf ? chunkNUFEZBA5_cjs.parseVersionRef(versionOf).docId : void 0,
360
360
  configExtId: configId ?? void 0
361
361
  }
362
362
  );
@@ -385,7 +385,7 @@ function useArtifactSession(options) {
385
385
  const [saved, setSaved] = react.useState(null);
386
386
  const adopted = saved && saved.forId === hostDocId ? saved : null;
387
387
  const docId = adopted?.id ?? hostDocId;
388
- const isLocal = !chunkT4IJHRRD_cjs.isDocumentId(docId);
388
+ const isLocal = !chunkNUFEZBA5_cjs.isDocumentId(docId);
389
389
  const [ownCompareId, setOwnCompareId] = react.useState(null);
390
390
  const activeCompareId = compareId === void 0 ? ownCompareId : compareId;
391
391
  const changeCompare = react.useCallback(
@@ -401,7 +401,7 @@ function useArtifactSession(options) {
401
401
  enabled: !!activeCompareId
402
402
  });
403
403
  const saveVersion = useSaveArtifactVersion();
404
- const current = chunkT4IJHRRD_cjs.findVersion(versions, docId);
404
+ const current = chunkNUFEZBA5_cjs.findVersion(versions, docId);
405
405
  const save = react.useCallback(
406
406
  async (content) => {
407
407
  const result = await saveVersion.mutateAsync({
@@ -418,7 +418,7 @@ function useArtifactSession(options) {
418
418
  );
419
419
  const handleSaved = react.useCallback(
420
420
  (result, content) => {
421
- if (!chunkT4IJHRRD_cjs.isDocumentId(hostDocId) && result.docId)
421
+ if (!chunkNUFEZBA5_cjs.isDocumentId(hostDocId) && result.docId)
422
422
  setSaved({ forId: hostDocId, id: result.docId, text: content });
423
423
  onSaved?.(result, content);
424
424
  },
@@ -447,7 +447,7 @@ function useArtifactSession(options) {
447
447
  isLoading,
448
448
  status,
449
449
  versions,
450
- labelOf: (id) => chunkT4IJHRRD_cjs.versionLabel(versions, id),
450
+ labelOf: (id) => chunkNUFEZBA5_cjs.versionLabel(versions, id),
451
451
  view: {
452
452
  content: session.baseline,
453
453
  isEditing: session.isEditing,
@@ -503,7 +503,7 @@ function useStreamedArtifact({
503
503
  const started = react.useRef(null);
504
504
  const content = artifact?.content ?? "";
505
505
  const title = artifact?.title ?? "Draft";
506
- const passThrough = !!artifact && chunkT4IJHRRD_cjs.isDocumentId(artifact.doc_ext_id);
506
+ const passThrough = !!artifact && chunkNUFEZBA5_cjs.isDocumentId(artifact.doc_ext_id);
507
507
  const needsSave = settled && !!artifact && !passThrough && !!content.trim() && !!workspaceId;
508
508
  react.useEffect(() => {
509
509
  const key = `${attempt}:${content}`;
@@ -566,39 +566,39 @@ Object.defineProperty(exports, "revertRedlineRegion", {
566
566
  });
567
567
  Object.defineProperty(exports, "documentVersions", {
568
568
  enumerable: true,
569
- get: function () { return chunkT4IJHRRD_cjs.documentVersions; }
569
+ get: function () { return chunkNUFEZBA5_cjs.documentVersions; }
570
570
  });
571
571
  Object.defineProperty(exports, "findVersion", {
572
572
  enumerable: true,
573
- get: function () { return chunkT4IJHRRD_cjs.findVersion; }
573
+ get: function () { return chunkNUFEZBA5_cjs.findVersion; }
574
574
  });
575
575
  Object.defineProperty(exports, "flattenChunks", {
576
576
  enumerable: true,
577
- get: function () { return chunkT4IJHRRD_cjs.flattenChunks; }
577
+ get: function () { return chunkNUFEZBA5_cjs.flattenChunks; }
578
578
  });
579
579
  Object.defineProperty(exports, "isDocumentId", {
580
580
  enumerable: true,
581
- get: function () { return chunkT4IJHRRD_cjs.isDocumentId; }
581
+ get: function () { return chunkNUFEZBA5_cjs.isDocumentId; }
582
582
  });
583
583
  Object.defineProperty(exports, "parseVersionRef", {
584
584
  enumerable: true,
585
- get: function () { return chunkT4IJHRRD_cjs.parseVersionRef; }
585
+ get: function () { return chunkNUFEZBA5_cjs.parseVersionRef; }
586
586
  });
587
587
  Object.defineProperty(exports, "savedFromId", {
588
588
  enumerable: true,
589
- get: function () { return chunkT4IJHRRD_cjs.savedFromId; }
589
+ get: function () { return chunkNUFEZBA5_cjs.savedFromId; }
590
590
  });
591
591
  Object.defineProperty(exports, "toArtifactVersions", {
592
592
  enumerable: true,
593
- get: function () { return chunkT4IJHRRD_cjs.toArtifactVersions; }
593
+ get: function () { return chunkNUFEZBA5_cjs.toArtifactVersions; }
594
594
  });
595
595
  Object.defineProperty(exports, "versionLabel", {
596
596
  enumerable: true,
597
- get: function () { return chunkT4IJHRRD_cjs.versionLabel; }
597
+ get: function () { return chunkNUFEZBA5_cjs.versionLabel; }
598
598
  });
599
599
  Object.defineProperty(exports, "versionRef", {
600
600
  enumerable: true,
601
- get: function () { return chunkT4IJHRRD_cjs.versionRef; }
601
+ get: function () { return chunkNUFEZBA5_cjs.versionRef; }
602
602
  });
603
603
  Object.defineProperty(exports, "cleanDraftMarkdown", {
604
604
  enumerable: true,
@@ -72,6 +72,9 @@ interface DocVersionEntry {
72
72
  /** The version an edit started from, when it was not the previous one. */
73
73
  made_from?: number | null;
74
74
  is_current?: boolean | null;
75
+ /** The assistant message whose turn made this version, and its thread (none: a person's). */
76
+ source_message_ext_id?: string | null;
77
+ conversation_ext_id?: string | null;
75
78
  }
76
79
  /** The fields of a workspace document the version list needs (a subset of the API type). */
77
80
  interface VersionedDoc {
@@ -98,6 +101,11 @@ interface ArtifactVersion {
98
101
  isCurrent: boolean;
99
102
  /** The version this one was saved from (an older one than the previous version when restored). */
100
103
  savedFromId?: string | null;
104
+ /** The thread (and its message) whose turn made this version; none for a person's. */
105
+ thread?: {
106
+ conversationId: string;
107
+ messageId: string | null;
108
+ } | null;
101
109
  }
102
110
  /** `doc-…@v{n}`: a reference to version `n` of a document. */
103
111
  declare function versionRef(docId: string, version: number): string;
@@ -72,6 +72,9 @@ interface DocVersionEntry {
72
72
  /** The version an edit started from, when it was not the previous one. */
73
73
  made_from?: number | null;
74
74
  is_current?: boolean | null;
75
+ /** The assistant message whose turn made this version, and its thread (none: a person's). */
76
+ source_message_ext_id?: string | null;
77
+ conversation_ext_id?: string | null;
75
78
  }
76
79
  /** The fields of a workspace document the version list needs (a subset of the API type). */
77
80
  interface VersionedDoc {
@@ -98,6 +101,11 @@ interface ArtifactVersion {
98
101
  isCurrent: boolean;
99
102
  /** The version this one was saved from (an older one than the previous version when restored). */
100
103
  savedFromId?: string | null;
104
+ /** The thread (and its message) whose turn made this version; none for a person's. */
105
+ thread?: {
106
+ conversationId: string;
107
+ messageId: string | null;
108
+ } | null;
101
109
  }
102
110
  /** `doc-…@v{n}`: a reference to version `n` of a document. */
103
111
  declare function versionRef(docId: string, version: number): string;
@@ -1,8 +1,8 @@
1
1
  import { arbiQueryKeys, useDocuments, useDocumentVersionList } from '../chunk-5WXNTCI3.js';
2
2
  import { revertRedlineRegion, buildHybridRedlineWithRegions, buildHybridRedlineMarkdown } from '../chunk-74N436VK.js';
3
3
  export { buildHybridRedlineMarkdown, buildHybridRedlineWithRegions, revertRedlineRegion } from '../chunk-74N436VK.js';
4
- import { isDocumentId, parseVersionRef, flattenChunks, documentVersions, toArtifactVersions, findVersion, versionLabel } from '../chunk-HKUD2NZN.js';
5
- export { documentVersions, findVersion, flattenChunks, isDocumentId, parseVersionRef, savedFromId, toArtifactVersions, versionLabel, versionRef } from '../chunk-HKUD2NZN.js';
4
+ import { isDocumentId, parseVersionRef, flattenChunks, documentVersions, toArtifactVersions, findVersion, versionLabel } from '../chunk-74UTKIWQ.js';
5
+ export { documentVersions, findVersion, flattenChunks, isDocumentId, parseVersionRef, savedFromId, toArtifactVersions, versionLabel, versionRef } from '../chunk-74UTKIWQ.js';
6
6
  import { cleanDraftWithReport } from '../chunk-G6FHNURH.js';
7
7
  export { cleanDraftMarkdown, cleanDraftWithReport, promoteBoldTitle, repairParsedStructure, repairParsedTitle, stripAgentPreamble, unescapeMarkdown, unwrapCitationLinks } from '../chunk-G6FHNURH.js';
8
8
  import { normalizeMarkdown } from '../chunk-WUTL62MC.js';
@@ -1786,13 +1786,14 @@ var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset
1786
1786
  sideOffset,
1787
1787
  collisionPadding: getCollisionPadding(),
1788
1788
  className: cn(
1789
- "z-50 w-72 max-w-[calc(100vw-1rem)] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover p-4 text-popover-foreground shadow-lg outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
1789
+ "z-50 w-72 max-w-[calc(100vw-1rem)] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-lg outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
1790
1790
  className
1791
1791
  ),
1792
1792
  ...props
1793
1793
  }
1794
1794
  ) }));
1795
1795
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
1796
+ var PopoverClose = PopoverPrimitive.Close;
1796
1797
  var FINE_OPEN_DELAY = 350;
1797
1798
  var FINE_CLOSE_DELAY = 180;
1798
1799
  var silentFocusMarks = /* @__PURE__ */ new WeakSet();
@@ -4403,6 +4404,6 @@ function DocumentCard({
4403
4404
  );
4404
4405
  }
4405
4406
 
4406
- export { AUDIO_MIME_PREFERENCE, AgentBadge, AiMarkdown, ArbiBotHeadIcon, ArbiIcon, AudIcon, Avatar, AvatarFallback, AvatarImage, BASE_COLORS2 as BASE_COLORS, Badge, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_SEGMENTER_CONFIG, DictateProvider, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, INITIAL_SEGMENTER_STATE, IconToggle, ImgIcon, InlineMicButton, Input, Label2 as Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY2 as 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, Separator2 as 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, VIDEO_MIME_PREFERENCE, VISIBILITY_ICONS, VerifiedBadge, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, badgeVariants, cardVariants, classifyMediaError, configureEntityRegistry, configureRagLabels, configureStatusRegistry, createChunkedRecorder, flushSegmenter, formatElapsed, getDocIcon, getEntityColor2 as getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, levelFromRms, pickRecorderMimeType, returnFocusToMark, stepSegmenter, toggleVariants, useAudioRecorder };
4407
- //# sourceMappingURL=chunk-FLZ3OT2V.js.map
4408
- //# sourceMappingURL=chunk-FLZ3OT2V.js.map
4407
+ export { AUDIO_MIME_PREFERENCE, AgentBadge, AiMarkdown, ArbiBotHeadIcon, ArbiIcon, AudIcon, Avatar, AvatarFallback, AvatarImage, BASE_COLORS2 as BASE_COLORS, Badge, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_SEGMENTER_CONFIG, DictateProvider, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, INITIAL_SEGMENTER_STATE, IconToggle, ImgIcon, InlineMicButton, Input, Label2 as Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY2 as NEUTRAL_GRAY, PLACEHOLDER_COLOR, PassageCard, PdfIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, RadioGroup, RadioGroupItem, RagDot, RelevanceDot, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as 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, VIDEO_MIME_PREFERENCE, VISIBILITY_ICONS, VerifiedBadge, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, badgeVariants, cardVariants, classifyMediaError, configureEntityRegistry, configureRagLabels, configureStatusRegistry, createChunkedRecorder, flushSegmenter, formatElapsed, getDocIcon, getEntityColor2 as getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, levelFromRms, pickRecorderMimeType, returnFocusToMark, stepSegmenter, toggleVariants, useAudioRecorder };
4408
+ //# sourceMappingURL=chunk-5PQO46PE.js.map
4409
+ //# sourceMappingURL=chunk-5PQO46PE.js.map