@arbidocs/blocks 0.5.75 → 0.5.76

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.
Files changed (175) hide show
  1. package/README.md +23 -0
  2. package/dist/{ConnectedDocumentViewer-U5TQ4LFJ.js → ConnectedDocumentViewer-4LRZ5N3L.js} +6 -6
  3. package/dist/{ConnectedDocumentViewer-U5TQ4LFJ.js.map → ConnectedDocumentViewer-4LRZ5N3L.js.map} +1 -1
  4. package/dist/{ConnectedDocumentViewer-ID2RG5MF.cjs → ConnectedDocumentViewer-FREQM2ES.cjs} +7 -7
  5. package/dist/{ConnectedDocumentViewer-ID2RG5MF.cjs.map → ConnectedDocumentViewer-FREQM2ES.cjs.map} +1 -1
  6. package/dist/{ConnectedNativeDocxComparison-PBMS77ZP.js → ConnectedNativeDocxComparison-P7OJ3UVK.js} +6 -6
  7. package/dist/{ConnectedNativeDocxComparison-PBMS77ZP.js.map → ConnectedNativeDocxComparison-P7OJ3UVK.js.map} +1 -1
  8. package/dist/{ConnectedNativeDocxComparison-R4OFGVHY.cjs → ConnectedNativeDocxComparison-RQIKQM5O.cjs} +7 -7
  9. package/dist/{ConnectedNativeDocxComparison-R4OFGVHY.cjs.map → ConnectedNativeDocxComparison-RQIKQM5O.cjs.map} +1 -1
  10. package/dist/{ConnectedNativeDocxEditor-27JZI2D5.js → ConnectedNativeDocxEditor-HX3FDJ2T.js} +5 -5
  11. package/dist/{ConnectedNativeDocxEditor-27JZI2D5.js.map → ConnectedNativeDocxEditor-HX3FDJ2T.js.map} +1 -1
  12. package/dist/{ConnectedNativeDocxEditor-774XRIP3.cjs → ConnectedNativeDocxEditor-XKQV7A37.cjs} +7 -7
  13. package/dist/{ConnectedNativeDocxEditor-774XRIP3.cjs.map → ConnectedNativeDocxEditor-XKQV7A37.cjs.map} +1 -1
  14. package/dist/{ConnectedStreamedWordArtifact-7TNIQTVE.cjs → ConnectedStreamedWordArtifact-CSRL4SCO.cjs} +7 -7
  15. package/dist/ConnectedStreamedWordArtifact-CSRL4SCO.cjs.map +1 -0
  16. package/dist/{ConnectedStreamedWordArtifact-XEFXYMKS.js → ConnectedStreamedWordArtifact-SSH6M5LN.js} +6 -6
  17. package/dist/ConnectedStreamedWordArtifact-SSH6M5LN.js.map +1 -0
  18. package/dist/{DocumentReviewCard-7OPL6PWG.cjs → DocumentReviewCard-3PZJPVQC.cjs} +14 -14
  19. package/dist/{DocumentReviewCard-7OPL6PWG.cjs.map → DocumentReviewCard-3PZJPVQC.cjs.map} +1 -1
  20. package/dist/{DocumentReviewCard-NDHCFYYT.js → DocumentReviewCard-KHMHG7A5.js} +9 -9
  21. package/dist/{DocumentReviewCard-NDHCFYYT.js.map → DocumentReviewCard-KHMHG7A5.js.map} +1 -1
  22. package/dist/{WorkspaceTableView-4INHJ7QK.js → WorkspaceTableView-4VMCTOFT.js} +5 -5
  23. package/dist/{WorkspaceTableView-4INHJ7QK.js.map → WorkspaceTableView-4VMCTOFT.js.map} +1 -1
  24. package/dist/{WorkspaceTableView-BTUSU3N3.cjs → WorkspaceTableView-Q44KNO3Z.cjs} +7 -7
  25. package/dist/{WorkspaceTableView-BTUSU3N3.cjs.map → WorkspaceTableView-Q44KNO3Z.cjs.map} +1 -1
  26. package/dist/agents/index.cjs +281 -281
  27. package/dist/agents/index.js +4 -4
  28. package/dist/{chunk-E3ILJRG4.cjs → chunk-2HECOUXC.cjs} +4 -3
  29. package/dist/chunk-2HECOUXC.cjs.map +1 -0
  30. package/dist/{chunk-AQPZ4QMV.cjs → chunk-3J2ASIM7.cjs} +3 -3
  31. package/dist/chunk-3J2ASIM7.cjs.map +1 -0
  32. package/dist/{chunk-QCFNPQWS.cjs → chunk-3LJUTIS6.cjs} +44 -44
  33. package/dist/{chunk-QCFNPQWS.cjs.map → chunk-3LJUTIS6.cjs.map} +1 -1
  34. package/dist/chunk-4B6HYQTW.cjs +20 -0
  35. package/dist/chunk-4B6HYQTW.cjs.map +1 -0
  36. package/dist/{chunk-4UMVAJJZ.js → chunk-6NEBHZIF.js} +4 -4
  37. package/dist/{chunk-4UMVAJJZ.js.map → chunk-6NEBHZIF.js.map} +1 -1
  38. package/dist/{chunk-IMIE5NOQ.js → chunk-7E5GV4R7.js} +4 -4
  39. package/dist/{chunk-IMIE5NOQ.js.map → chunk-7E5GV4R7.js.map} +1 -1
  40. package/dist/{chunk-LNXMSIKU.js → chunk-AWFEB4YJ.js} +8 -8
  41. package/dist/{chunk-LNXMSIKU.js.map → chunk-AWFEB4YJ.js.map} +1 -1
  42. package/dist/{chunk-JMQLTMJ7.js → chunk-B3BD5IJR.js} +16 -20
  43. package/dist/chunk-B3BD5IJR.js.map +1 -0
  44. package/dist/{chunk-5Q2U7GLI.cjs → chunk-CDW3W5U5.cjs} +4 -4
  45. package/dist/{chunk-5Q2U7GLI.cjs.map → chunk-CDW3W5U5.cjs.map} +1 -1
  46. package/dist/{chunk-SK5TP4DP.js → chunk-DBPPOJQM.js} +3 -3
  47. package/dist/{chunk-SK5TP4DP.js.map → chunk-DBPPOJQM.js.map} +1 -1
  48. package/dist/{chunk-NJ3YV3VM.cjs → chunk-DMYBHKNQ.cjs} +27 -27
  49. package/dist/{chunk-NJ3YV3VM.cjs.map → chunk-DMYBHKNQ.cjs.map} +1 -1
  50. package/dist/{chunk-563BHHHO.cjs → chunk-E6S6WHXL.cjs} +9 -9
  51. package/dist/{chunk-563BHHHO.cjs.map → chunk-E6S6WHXL.cjs.map} +1 -1
  52. package/dist/{chunk-BV34QPKE.js → chunk-EASXRDYQ.js} +3 -3
  53. package/dist/{chunk-BV34QPKE.js.map → chunk-EASXRDYQ.js.map} +1 -1
  54. package/dist/{chunk-JOFUAQTV.js → chunk-HWNVAQBX.js} +3 -3
  55. package/dist/{chunk-JOFUAQTV.js.map → chunk-HWNVAQBX.js.map} +1 -1
  56. package/dist/{chunk-PNWSEIWS.cjs → chunk-I3HK46DH.cjs} +4 -4
  57. package/dist/{chunk-PNWSEIWS.cjs.map → chunk-I3HK46DH.cjs.map} +1 -1
  58. package/dist/{chunk-GJKXYX47.js → chunk-IJ2CTMA7.js} +3 -3
  59. package/dist/{chunk-GJKXYX47.js.map → chunk-IJ2CTMA7.js.map} +1 -1
  60. package/dist/{chunk-7ZL6OVGO.cjs → chunk-IQFHOKQH.cjs} +23 -46
  61. package/dist/chunk-IQFHOKQH.cjs.map +1 -0
  62. package/dist/{chunk-7ZCM2GR2.js → chunk-IRCGXKLB.js} +3 -3
  63. package/dist/{chunk-7ZCM2GR2.js.map → chunk-IRCGXKLB.js.map} +1 -1
  64. package/dist/{chunk-G4GLDQLY.js → chunk-KG3W76BB.js} +3 -3
  65. package/dist/chunk-KG3W76BB.js.map +1 -0
  66. package/dist/{chunk-B66CICTP.cjs → chunk-KHLPBCRZ.cjs} +52 -52
  67. package/dist/{chunk-B66CICTP.cjs.map → chunk-KHLPBCRZ.cjs.map} +1 -1
  68. package/dist/{chunk-J4SEJSSV.js → chunk-KPIR4MJV.js} +6 -6
  69. package/dist/{chunk-J4SEJSSV.js.map → chunk-KPIR4MJV.js.map} +1 -1
  70. package/dist/{chunk-PA4EGGCI.js → chunk-KSHTODQZ.js} +3 -3
  71. package/dist/{chunk-PA4EGGCI.js.map → chunk-KSHTODQZ.js.map} +1 -1
  72. package/dist/{chunk-PT6D5B6L.cjs → chunk-MAUJVVFJ.cjs} +360 -410
  73. package/dist/chunk-MAUJVVFJ.cjs.map +1 -0
  74. package/dist/{chunk-MP7XCRHV.js → chunk-NRI5DKJE.js} +4 -3
  75. package/dist/chunk-NRI5DKJE.js.map +1 -0
  76. package/dist/{chunk-XXPDAENX.cjs → chunk-PGTDQBMX.cjs} +7 -7
  77. package/dist/{chunk-XXPDAENX.cjs.map → chunk-PGTDQBMX.cjs.map} +1 -1
  78. package/dist/{chunk-4JKK6S7U.cjs → chunk-S7G3A52F.cjs} +5 -5
  79. package/dist/{chunk-4JKK6S7U.cjs.map → chunk-S7G3A52F.cjs.map} +1 -1
  80. package/dist/{chunk-OUCWTKQT.js → chunk-SBFQF3BU.js} +4 -4
  81. package/dist/{chunk-OUCWTKQT.js.map → chunk-SBFQF3BU.js.map} +1 -1
  82. package/dist/{chunk-52VME6ZS.cjs → chunk-SIOBGNRY.cjs} +18 -18
  83. package/dist/{chunk-52VME6ZS.cjs.map → chunk-SIOBGNRY.cjs.map} +1 -1
  84. package/dist/chunk-SK3GBHPJ.js +15 -0
  85. package/dist/chunk-SK3GBHPJ.js.map +1 -0
  86. package/dist/{chunk-RADE22SM.cjs → chunk-T2OG3CPR.cjs} +4 -4
  87. package/dist/{chunk-RADE22SM.cjs.map → chunk-T2OG3CPR.cjs.map} +1 -1
  88. package/dist/{chunk-IGQJ6ET3.js → chunk-TWSOU6SE.js} +421 -501
  89. package/dist/chunk-TWSOU6SE.js.map +1 -0
  90. package/dist/{chunk-QRV4XYFJ.js → chunk-UCD7644N.js} +3 -3
  91. package/dist/{chunk-QRV4XYFJ.js.map → chunk-UCD7644N.js.map} +1 -1
  92. package/dist/{chunk-TQ4VGQHG.js → chunk-ULUCGL24.js} +3 -3
  93. package/dist/{chunk-TQ4VGQHG.js.map → chunk-ULUCGL24.js.map} +1 -1
  94. package/dist/{chunk-IRI6LPDX.cjs → chunk-UR4OSH2Q.cjs} +4 -4
  95. package/dist/{chunk-IRI6LPDX.cjs.map → chunk-UR4OSH2Q.cjs.map} +1 -1
  96. package/dist/{chunk-66QN6ZJR.cjs → chunk-URZAK3A3.cjs} +36 -36
  97. package/dist/{chunk-66QN6ZJR.cjs.map → chunk-URZAK3A3.cjs.map} +1 -1
  98. package/dist/{chunk-57S2PLCM.js → chunk-V2QWATXQ.js} +3 -3
  99. package/dist/{chunk-57S2PLCM.js.map → chunk-V2QWATXQ.js.map} +1 -1
  100. package/dist/{chunk-55JI2IGZ.cjs → chunk-VBLJNOVP.cjs} +4 -4
  101. package/dist/{chunk-55JI2IGZ.cjs.map → chunk-VBLJNOVP.cjs.map} +1 -1
  102. package/dist/{chunk-KFAFWPZK.cjs → chunk-VRMACPJR.cjs} +7 -7
  103. package/dist/{chunk-KFAFWPZK.cjs.map → chunk-VRMACPJR.cjs.map} +1 -1
  104. package/dist/{chunk-5Y6V7F6W.cjs → chunk-VWUNPAR2.cjs} +15 -19
  105. package/dist/chunk-VWUNPAR2.cjs.map +1 -0
  106. package/dist/{chunk-T3GTQXGP.js → chunk-W7CQ5MLR.js} +3 -3
  107. package/dist/{chunk-T3GTQXGP.js.map → chunk-W7CQ5MLR.js.map} +1 -1
  108. package/dist/{chunk-AOBNXZLS.cjs → chunk-Y3VXKSW7.cjs} +594 -674
  109. package/dist/chunk-Y3VXKSW7.cjs.map +1 -0
  110. package/dist/{chunk-RTYU6ZGO.cjs → chunk-YCABQ5W4.cjs} +4 -4
  111. package/dist/{chunk-RTYU6ZGO.cjs.map → chunk-YCABQ5W4.cjs.map} +1 -1
  112. package/dist/{chunk-EWHD3BY5.js → chunk-ZHHUEYSB.js} +25 -48
  113. package/dist/chunk-ZHHUEYSB.js.map +1 -0
  114. package/dist/{chunk-5PKIDR2Q.js → chunk-ZHJVABQ6.js} +361 -406
  115. package/dist/chunk-ZHJVABQ6.js.map +1 -0
  116. package/dist/connect/docx.cjs +11 -11
  117. package/dist/connect/docx.js +7 -7
  118. package/dist/connect/index.cjs +1448 -1367
  119. package/dist/connect/index.cjs.map +1 -1
  120. package/dist/connect/index.d.ts +2 -0
  121. package/dist/connect/index.js +545 -466
  122. package/dist/connect/index.js.map +1 -1
  123. package/dist/connect/viewer.cjs +5 -5
  124. package/dist/connect/viewer.js +4 -4
  125. package/dist/connection/account-cluster/ConnectedAccountCluster.d.ts +2 -1
  126. package/dist/connection/facts/useFactFilters.d.ts +46 -0
  127. package/dist/connection/files/fields/ConnectedTagForm.d.ts +1 -1
  128. package/dist/connection/report-problem/ReportProblemDialog.d.ts +10 -8
  129. package/dist/connection/report-problem/useReportProblem.d.ts +2 -6
  130. package/dist/connection/tags/ConnectedTagTable.d.ts +1 -1
  131. package/dist/connection/tags/ConnectedTagsPage.d.ts +3 -1
  132. package/dist/connection/tags/TagsPageSections.d.ts +5 -3
  133. package/dist/connection/tags/tagged-content.d.ts +10 -0
  134. package/dist/connection/threads/useThreadTagFilter.d.ts +10 -0
  135. package/dist/connection/tips/ConnectedTipBar.d.ts +2 -1
  136. package/dist/connection/tips/useContextualHints.d.ts +6 -1
  137. package/dist/embed/index.cjs +13 -12
  138. package/dist/embed/index.js +8 -7
  139. package/dist/facts/index.cjs +45 -45
  140. package/dist/facts/index.js +2 -2
  141. package/dist/files/index.cjs +226 -226
  142. package/dist/files/index.js +2 -2
  143. package/dist/index.cjs +423 -367
  144. package/dist/index.cjs.map +1 -1
  145. package/dist/index.js +76 -16
  146. package/dist/index.js.map +1 -1
  147. package/dist/settings/FilterChip.d.ts +2 -1
  148. package/dist/settings/TriStateFilterMenu.d.ts +1 -0
  149. package/dist/settings/index.cjs +158 -158
  150. package/dist/settings/index.js +2 -2
  151. package/dist/shell/index.cjs +14 -14
  152. package/dist/shell/index.js +1 -1
  153. package/dist/styles.css +1 -1
  154. package/dist/tags/TagDetail.d.ts +2 -2
  155. package/dist/tags/TagTable.d.ts +17 -3
  156. package/dist/tags/index.d.ts +1 -1
  157. package/dist/workflow-canvas/index.cjs +29 -29
  158. package/dist/workflow-canvas/index.js +12 -12
  159. package/node_modules/@arbidocs/coedit/package.json +1 -1
  160. package/package.json +5 -5
  161. package/dist/ConnectedStreamedWordArtifact-7TNIQTVE.cjs.map +0 -1
  162. package/dist/ConnectedStreamedWordArtifact-XEFXYMKS.js.map +0 -1
  163. package/dist/chunk-5PKIDR2Q.js.map +0 -1
  164. package/dist/chunk-5Y6V7F6W.cjs.map +0 -1
  165. package/dist/chunk-7ZL6OVGO.cjs.map +0 -1
  166. package/dist/chunk-AOBNXZLS.cjs.map +0 -1
  167. package/dist/chunk-AQPZ4QMV.cjs.map +0 -1
  168. package/dist/chunk-E3ILJRG4.cjs.map +0 -1
  169. package/dist/chunk-EWHD3BY5.js.map +0 -1
  170. package/dist/chunk-G4GLDQLY.js.map +0 -1
  171. package/dist/chunk-IGQJ6ET3.js.map +0 -1
  172. package/dist/chunk-JMQLTMJ7.js.map +0 -1
  173. package/dist/chunk-MP7XCRHV.js.map +0 -1
  174. package/dist/chunk-PT6D5B6L.cjs.map +0 -1
  175. package/dist/connection/tags/TagPlacement.d.ts +0 -16
@@ -1,13 +1,14 @@
1
1
  "use client";
2
2
  import { page, minuteUtc, cell, paragraph, documentXml, docxPackage, TABLE_DOCUMENT_STYLES, groupDefinitions, compareDefinitions } from './chunk-IYUKJESY.js';
3
- import { RowNavigatorControls, LabelPickerList } from './chunk-JMQLTMJ7.js';
4
- import { DetailLoading, DetailBody, DetailSection, DetailFields, DetailField, DetailLinkList, DetailLinkItem, DetailEmpty } from './chunk-ZCOVDK2E.js';
5
- import { taskActivityHeadline, DEFAULT_TASK_ACTIVITY_LABELS } from './chunk-57S2PLCM.js';
3
+ import { RowNavigatorControls } from './chunk-B3BD5IJR.js';
4
+ import { DetailLoading, DetailBody, DetailSection, DetailLinkList, DetailLinkItem, DetailEmpty, DetailFields, DetailField } from './chunk-ZCOVDK2E.js';
5
+ import { taskActivityHeadline, DEFAULT_TASK_ACTIVITY_LABELS } from './chunk-V2QWATXQ.js';
6
+ import { GridView } from './chunk-7F5Z4K5W.js';
6
7
  import { DocumentPicker } from './chunk-WNDIVNPT.js';
7
8
  import { ModalHeader } from './chunk-TX2ZICS7.js';
8
9
  import { useState, useEffect, useMemo, useCallback } from 'react';
9
- import { Sparkle, Search, Pencil, ArrowUp, ArrowDown, X, Plus, Loader2, ArrowUpRight, ChevronDown, SlidersHorizontal, Download, FileDown, FileText, Lightbulb, MessagesSquare, Workflow, MessageSquare, Activity } from 'lucide-react';
10
- import { cn, Input, Textarea, Button, Checkbox, getEntityLabel, tagKindNouns, tagKindTitle, Popover, PopoverTrigger, PopoverContent, getEntityColor, isImageDocument, getDocumentTitle, Dialog, DialogContent, DialogTitle, DialogDescription } from '@arbidocs/react/ui';
10
+ import { Sparkle, Search, Pencil, ArrowUp, ArrowDown, X, Plus, Loader2, ArrowUpRight, ChevronDown, MoreHorizontal, SlidersHorizontal, FileDown, Download, FileText, Lightbulb, MessagesSquare, Workflow, MessageSquare, Activity } from 'lucide-react';
11
+ import { cn, Input, Textarea, Button, Checkbox, TagEntity, Popover, PopoverTrigger, PopoverContent, getEntityLabel, tagKindNouns, tagKindTitle, isImageDocument, getDocumentTitle, Dialog, DialogContent, DialogTitle, DialogDescription } from '@arbidocs/react/ui';
11
12
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
12
13
 
13
14
  function useTipsPlacement({
@@ -49,17 +50,6 @@ function useTipsPlacement({
49
50
  onHoverChange: setPaused
50
51
  };
51
52
  }
52
-
53
- // src/tips/visibility.ts
54
- var TIPS_VISIBILITY_OVERRIDE = "tips:visibility";
55
- function setHintsSessionOverride(layout, value) {
56
- layout.setTransientView(TIPS_VISIBILITY_OVERRIDE, value ?? void 0);
57
- }
58
- var WELCOME_REPLAY_VIEW = "tips:welcomeReplay";
59
- function startWelcomeReplay(layout) {
60
- setHintsSessionOverride(layout, true);
61
- layout.setTransientView(WELCOME_REPLAY_VIEW, true);
62
- }
63
53
  var SPARKLE_DELAYS = ["0s", "0.1s", "0.2s"];
64
54
  var SPLASH_CLASS = "fixed top-0 left-0 w-full h-full flex flex-col items-center justify-center bg-background bg-opacity-50 z-50";
65
55
  function useShowAfter(delayMs) {
@@ -802,7 +792,7 @@ var DEFAULT_TAG_TABLE_LABELS = {
802
792
  addRow: "Add row",
803
793
  addRowPlaceholder: "Name of the new row",
804
794
  add: "Add",
805
- export: "Export as Word document",
795
+ export: "Save as Word document",
806
796
  download: "Download .docx",
807
797
  exporting: "Exporting\u2026",
808
798
  empty: "No rows yet.",
@@ -810,10 +800,9 @@ var DEFAULT_TAG_TABLE_LABELS = {
810
800
  noColumns: "No columns yet: add one to give each row a value.",
811
801
  choose: "\u2014",
812
802
  yes: "Yes",
813
- editColumns: "Columns"
803
+ editColumns: "Columns",
804
+ moreActions: "More"
814
805
  };
815
- var ROW_LABEL_WIDTH = "w-[11rem]";
816
- var EVIDENCE_WIDTH = "w-[14rem]";
817
806
  var ROW_LABEL = "line-clamp-3 whitespace-normal break-words";
818
807
  function TagTableCell({
819
808
  row,
@@ -921,17 +910,17 @@ function TagLinkCell({
921
910
  {
922
911
  type: "button",
923
912
  onClick: () => onOpenTag(id),
924
- className: "inline-flex min-w-0 max-w-full items-center truncate rounded-md border border-border px-1.5 py-0.5 text-xs hover:border-primary/40 hover:text-primary",
913
+ className: "inline-flex min-w-0 max-w-full items-center focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
925
914
  "data-testid": `${testId}-link-${id}`,
926
- children: label(id)
915
+ children: /* @__PURE__ */ jsx(TagEntity, { tag: { external_id: id, name: label(id) }, showTooltip: false, wrap: true })
927
916
  },
928
917
  id
929
918
  ) : /* @__PURE__ */ jsx(
930
919
  "span",
931
920
  {
932
- className: "inline-flex min-w-0 max-w-full truncate rounded-md border border-border px-1.5 py-0.5 text-xs",
921
+ className: "inline-flex min-w-0 max-w-full",
933
922
  "data-testid": `${testId}-link-${id}`,
934
- children: label(id)
923
+ children: /* @__PURE__ */ jsx(TagEntity, { tag: { external_id: id, name: label(id) }, showTooltip: false, wrap: true })
935
924
  },
936
925
  id
937
926
  )
@@ -952,11 +941,25 @@ function TagLinkCell({
952
941
  title: `Open ${label(current)}`,
953
942
  "data-testid": `${testId}-open`,
954
943
  children: [
955
- label(current),
944
+ /* @__PURE__ */ jsx(
945
+ TagEntity,
946
+ {
947
+ tag: { external_id: current, name: label(current) },
948
+ showTooltip: false,
949
+ wrap: true
950
+ }
951
+ ),
956
952
  /* @__PURE__ */ jsx(ArrowUpRight, { className: "ml-0.5 inline size-3.5 align-[-2px] text-muted-foreground" })
957
953
  ]
958
954
  }
959
- ) : /* @__PURE__ */ jsx("span", { className: "max-w-full px-1 text-sm break-words", children: label(current) })),
955
+ ) : /* @__PURE__ */ jsx(
956
+ TagEntity,
957
+ {
958
+ tag: { external_id: current, name: label(current) },
959
+ showTooltip: false,
960
+ wrap: true
961
+ }
962
+ )),
960
963
  /* @__PURE__ */ jsxs(
961
964
  "span",
962
965
  {
@@ -990,87 +993,55 @@ function TagLinkCell({
990
993
  );
991
994
  }
992
995
  var countText = (count2, one, many) => count2 === 1 ? one : count2 ? many.replace("{count}", String(count2)) : null;
993
- function Evidence({
996
+ function TagContentCounts({
994
997
  row,
995
998
  l,
996
- onOpenDocument,
997
- onOpenFact,
998
- onOpenThread,
999
+ onOpenTaggedItems,
999
1000
  onOpenRow,
1000
1001
  testId
1001
1002
  }) {
1002
1003
  if (isGap(row)) return null;
1003
1004
  const links = rowLinks(row);
1004
- const docs = links.docs ?? [];
1005
- const facts = links.facts ?? [];
1006
- const threads = links.threads ?? [];
1007
- const more = links.doc_count - docs.length + (links.fact_count - facts.length) + (links.thread_count - threads.length);
1008
- const chip = "inline-flex min-w-0 max-w-full items-center gap-1 truncate rounded-md border border-border px-1.5 py-0.5 text-xs hover:border-primary/40 hover:text-primary disabled:hover:border-border disabled:hover:text-inherit";
1009
- return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-1", "data-testid": testId, children: [
1010
- /* @__PURE__ */ jsx("span", { className: "mr-1 w-full text-xs text-muted-foreground", children: [
1011
- countText(links.doc_count, l.document, l.documents),
1012
- countText(links.fact_count, l.fact, l.facts),
1013
- countText(links.thread_count, l.thread, l.threads)
1014
- ].filter(Boolean).join(" \xB7 ") }),
1015
- docs.map((d) => /* @__PURE__ */ jsxs(
1016
- "button",
1017
- {
1018
- type: "button",
1019
- className: chip,
1020
- title: d.note ? `${d.file_name}: ${d.note}` : d.file_name,
1021
- disabled: !onOpenDocument,
1022
- onClick: () => onOpenDocument?.(d.doc_ext_id),
1023
- "data-testid": `${testId}-doc-${d.doc_ext_id}`,
1024
- children: [
1025
- /* @__PURE__ */ jsx(FileText, { className: "size-3 shrink-0" }),
1026
- /* @__PURE__ */ jsx("span", { className: "truncate", children: d.file_name })
1027
- ]
1028
- },
1029
- d.doc_ext_id
1030
- )),
1031
- facts.map((f) => /* @__PURE__ */ jsxs(
1032
- "button",
1033
- {
1034
- type: "button",
1035
- className: chip,
1036
- title: f.text,
1037
- disabled: !onOpenFact,
1038
- onClick: () => onOpenFact?.(f.fact_ext_id),
1039
- "data-testid": `${testId}-fact-${f.fact_ext_id}`,
1040
- children: [
1041
- /* @__PURE__ */ jsx(Lightbulb, { className: "size-3 shrink-0" }),
1042
- /* @__PURE__ */ jsx("span", { className: "truncate", children: f.text })
1043
- ]
1044
- },
1045
- f.fact_ext_id
1046
- )),
1047
- threads.map((t) => /* @__PURE__ */ jsxs(
1005
+ const groups = [
1006
+ {
1007
+ kind: "documents",
1008
+ count: links.doc_count,
1009
+ label: countText(links.doc_count, l.document, l.documents),
1010
+ Icon: FileText
1011
+ },
1012
+ {
1013
+ kind: "facts",
1014
+ count: links.fact_count,
1015
+ label: countText(links.fact_count, l.fact, l.facts),
1016
+ Icon: Lightbulb
1017
+ },
1018
+ {
1019
+ kind: "threads",
1020
+ count: links.thread_count,
1021
+ label: countText(links.thread_count, l.thread, l.threads),
1022
+ Icon: MessagesSquare
1023
+ }
1024
+ ].filter((group) => group.count > 0);
1025
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", "data-testid": testId, children: groups.map(({ kind, label, Icon }, index) => /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
1026
+ index > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-muted-foreground", children: " \xB7 " }),
1027
+ onOpenTaggedItems || onOpenRow ? /* @__PURE__ */ jsxs(
1048
1028
  "button",
1049
1029
  {
1050
1030
  type: "button",
1051
- className: chip,
1052
- title: t.title || l.untitledThread,
1053
- disabled: !onOpenThread,
1054
- onClick: () => onOpenThread?.(t.conversation_ext_id),
1055
- "data-testid": `${testId}-thread-${t.conversation_ext_id}`,
1031
+ className: "inline-flex items-center gap-1 text-sm text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1032
+ "data-testid": `${testId}-${kind}`,
1033
+ title: `Show ${label} tagged \u201C${row.name}\u201D`,
1034
+ onClick: () => onOpenTaggedItems ? onOpenTaggedItems(row.external_id, kind) : onOpenRow?.(row.external_id),
1056
1035
  children: [
1057
- /* @__PURE__ */ jsx(MessagesSquare, { className: "size-3 shrink-0" }),
1058
- /* @__PURE__ */ jsx("span", { className: "truncate", children: t.title || l.untitledThread })
1036
+ /* @__PURE__ */ jsx(Icon, { className: "size-3.5" }),
1037
+ label
1059
1038
  ]
1060
- },
1061
- t.conversation_ext_id
1062
- )),
1063
- more > 0 && (onOpenRow ? /* @__PURE__ */ jsx(
1064
- "button",
1065
- {
1066
- type: "button",
1067
- className: "text-xs text-primary hover:underline",
1068
- onClick: () => onOpenRow(row.external_id),
1069
- "data-testid": `${testId}-more`,
1070
- children: l.more.replace("{count}", String(more))
1071
1039
  }
1072
- ) : /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", "data-testid": `${testId}-more`, children: l.more.replace("{count}", String(more)) }))
1073
- ] });
1040
+ ) : /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-sm text-muted-foreground", children: [
1041
+ /* @__PURE__ */ jsx(Icon, { className: "size-3.5" }),
1042
+ label
1043
+ ] })
1044
+ ] }, kind)) });
1074
1045
  }
1075
1046
  function TagTable({
1076
1047
  table,
@@ -1078,21 +1049,20 @@ function TagTable({
1078
1049
  onChangeValue,
1079
1050
  onAddRow,
1080
1051
  onChangeColumns,
1081
- onOpenDocument,
1082
- onOpenFact,
1083
- onOpenThread,
1084
1052
  onOpenRow,
1053
+ onOpenTaggedItems,
1085
1054
  onExport,
1086
1055
  onDownload,
1087
1056
  people,
1088
1057
  tags,
1089
1058
  onOpenTag,
1090
1059
  actions,
1060
+ secondaryActions,
1091
1061
  labels,
1092
1062
  className,
1093
1063
  testId = "tag-table"
1094
1064
  }) {
1095
- const l = { ...DEFAULT_TAG_TABLE_LABELS, ...labels };
1065
+ const l = useMemo(() => ({ ...DEFAULT_TAG_TABLE_LABELS, ...labels }), [labels]);
1096
1066
  const columns = useMemo(() => table?.columns ?? [], [table]);
1097
1067
  const rows = table?.rows ?? [];
1098
1068
  const [editingColumns, setEditingColumns] = useState(false);
@@ -1110,58 +1080,185 @@ function TagTable({
1110
1080
  setAdding(false);
1111
1081
  }
1112
1082
  };
1083
+ const columnDefs = useMemo(
1084
+ () => [
1085
+ {
1086
+ colId: "name",
1087
+ headerName: l.row,
1088
+ field: "name",
1089
+ width: 176,
1090
+ minWidth: 160,
1091
+ pinned: "left",
1092
+ sortable: true,
1093
+ filter: false,
1094
+ autoHeight: true,
1095
+ cellClass: "px-3! py-2! leading-normal!",
1096
+ cellRenderer: ({ data: row }) => row ? onOpenRow ? /* @__PURE__ */ jsx(
1097
+ "button",
1098
+ {
1099
+ type: "button",
1100
+ className: cn(
1101
+ ROW_LABEL,
1102
+ "text-left font-medium hover:text-primary hover:underline"
1103
+ ),
1104
+ title: row.name,
1105
+ onClick: () => onOpenRow(row.external_id),
1106
+ "data-testid": `${testId}-row-${row.external_id}-label`,
1107
+ children: /* @__PURE__ */ jsx(TagEntity, { tag: row, showTooltip: false, wrap: true })
1108
+ }
1109
+ ) : /* @__PURE__ */ jsx(
1110
+ "span",
1111
+ {
1112
+ className: cn(ROW_LABEL, "font-medium"),
1113
+ title: row.name,
1114
+ "data-testid": `${testId}-row-${row.external_id}-label`,
1115
+ children: /* @__PURE__ */ jsx(TagEntity, { tag: row, showTooltip: false, wrap: true })
1116
+ }
1117
+ ) : null
1118
+ },
1119
+ {
1120
+ colId: "evidence",
1121
+ headerName: l.evidence,
1122
+ width: 250,
1123
+ minWidth: 224,
1124
+ flex: 1,
1125
+ sortable: true,
1126
+ filter: false,
1127
+ autoHeight: true,
1128
+ cellClass: "px-3! py-2! leading-normal!",
1129
+ valueGetter: ({ data }) => {
1130
+ if (!data) return 0;
1131
+ const links = rowLinks(data);
1132
+ return links.doc_count + links.fact_count + links.thread_count;
1133
+ },
1134
+ cellRenderer: ({ data: row }) => row ? /* @__PURE__ */ jsx(
1135
+ TagContentCounts,
1136
+ {
1137
+ row,
1138
+ l,
1139
+ onOpenRow,
1140
+ onOpenTaggedItems,
1141
+ testId: `${testId}-evidence-${row.external_id}`
1142
+ }
1143
+ ) : null
1144
+ },
1145
+ ...columns.map((column) => ({
1146
+ colId: column.id,
1147
+ headerName: column.name,
1148
+ flex: 1,
1149
+ minWidth: 150,
1150
+ sortable: true,
1151
+ filter: false,
1152
+ // These are native inline editors: let their caret, select and checkbox keys work.
1153
+ suppressKeyboardEvent: ({ event }) => event.target instanceof HTMLElement && Boolean(
1154
+ event.target.closest(
1155
+ 'input, select, textarea, button, [role="checkbox"], [role="combobox"]'
1156
+ )
1157
+ ),
1158
+ cellClass: "px-1.5! py-1! leading-normal!",
1159
+ valueGetter: ({ data }) => {
1160
+ if (!data) return null;
1161
+ const value = cellValue(data, column);
1162
+ if (value == null || value === "") return null;
1163
+ if (column.type === "number") return Number(value);
1164
+ if (column.type === "checkbox") return value ? 1 : 0;
1165
+ return cellText(
1166
+ value,
1167
+ column,
1168
+ (id) => people?.find((p) => p.value === id)?.label ?? tags?.find((t) => t.value === id)?.label
1169
+ );
1170
+ },
1171
+ cellRenderer: ({ data: row }) => row ? /* @__PURE__ */ jsx(
1172
+ TagTableCell,
1173
+ {
1174
+ row,
1175
+ column,
1176
+ people,
1177
+ tags,
1178
+ onOpenTag,
1179
+ onChange: onChangeValue,
1180
+ l,
1181
+ testId: `${testId}-cell-${row.external_id}-${column.id}`
1182
+ }
1183
+ ) : null
1184
+ }))
1185
+ ],
1186
+ [columns, l, people, tags, onOpenRow, onOpenTaggedItems, onOpenTag, onChangeValue, testId]
1187
+ );
1113
1188
  return /* @__PURE__ */ jsxs("div", { className: cn("space-y-3", className), "data-testid": testId, children: [
1114
1189
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ jsxs("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
1115
1190
  actions,
1116
- onChangeColumns && /* @__PURE__ */ jsxs(
1117
- Button,
1118
- {
1119
- variant: "outline",
1120
- size: "sm",
1121
- "aria-pressed": editingColumns,
1122
- onClick: () => setEditingColumns((v) => !v),
1123
- "data-testid": `${testId}-edit-columns`,
1124
- children: [
1125
- /* @__PURE__ */ jsx(SlidersHorizontal, { className: "size-4" }),
1126
- l.editColumns
1127
- ]
1128
- }
1129
- ),
1130
- onDownload && /* @__PURE__ */ jsxs(
1131
- Button,
1132
- {
1133
- variant: "outline",
1134
- size: "sm",
1135
- disabled: rows.length === 0,
1136
- onClick: () => void onDownload(),
1137
- "data-testid": `${testId}-download`,
1138
- children: [
1139
- /* @__PURE__ */ jsx(Download, { className: "size-4" }),
1140
- l.download
1141
- ]
1142
- }
1143
- ),
1144
- onExport && /* @__PURE__ */ jsxs(
1145
- Button,
1146
- {
1147
- variant: "outline",
1148
- size: "sm",
1149
- disabled: exporting || rows.length === 0,
1150
- onClick: async () => {
1151
- setExporting(true);
1152
- try {
1153
- await onExport();
1154
- } finally {
1155
- setExporting(false);
1156
- }
1157
- },
1158
- "data-testid": `${testId}-export`,
1159
- children: [
1160
- exporting ? /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(FileDown, { className: "size-4" }),
1161
- exporting ? l.exporting : l.export
1162
- ]
1163
- }
1164
- )
1191
+ (secondaryActions || onChangeColumns || onDownload || onExport) && /* @__PURE__ */ jsxs(Popover, { children: [
1192
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
1193
+ Button,
1194
+ {
1195
+ variant: "ghost",
1196
+ size: "sm",
1197
+ "aria-label": l.moreActions,
1198
+ "data-testid": `${testId}-more`,
1199
+ children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" })
1200
+ }
1201
+ ) }),
1202
+ /* @__PURE__ */ jsxs(
1203
+ PopoverContent,
1204
+ {
1205
+ align: "end",
1206
+ className: "flex w-auto min-w-48 flex-col items-stretch gap-1 p-2",
1207
+ children: [
1208
+ secondaryActions,
1209
+ onChangeColumns && /* @__PURE__ */ jsxs(
1210
+ Button,
1211
+ {
1212
+ variant: "ghost",
1213
+ size: "sm",
1214
+ className: "justify-start",
1215
+ onClick: () => setEditingColumns((v) => !v),
1216
+ "data-testid": `${testId}-edit-columns`,
1217
+ children: [
1218
+ /* @__PURE__ */ jsx(SlidersHorizontal, { className: "size-4" }),
1219
+ " ",
1220
+ l.editColumns
1221
+ ]
1222
+ }
1223
+ ),
1224
+ onExport && /* @__PURE__ */ jsxs(
1225
+ Button,
1226
+ {
1227
+ disabled: exporting || rows.length === 0,
1228
+ variant: "ghost",
1229
+ size: "sm",
1230
+ className: "justify-start",
1231
+ onClick: () => {
1232
+ setExporting(true);
1233
+ void Promise.resolve().then(() => onExport()).finally(() => setExporting(false));
1234
+ },
1235
+ "data-testid": `${testId}-export`,
1236
+ children: [
1237
+ exporting ? /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(FileDown, { className: "size-4" }),
1238
+ exporting ? l.exporting : l.export
1239
+ ]
1240
+ }
1241
+ ),
1242
+ onDownload && /* @__PURE__ */ jsxs(
1243
+ Button,
1244
+ {
1245
+ disabled: rows.length === 0,
1246
+ variant: "ghost",
1247
+ size: "sm",
1248
+ className: "justify-start",
1249
+ onClick: () => void onDownload(),
1250
+ "data-testid": `${testId}-download`,
1251
+ children: [
1252
+ /* @__PURE__ */ jsx(Download, { className: "size-4" }),
1253
+ " ",
1254
+ l.download
1255
+ ]
1256
+ }
1257
+ )
1258
+ ]
1259
+ }
1260
+ )
1261
+ ] })
1165
1262
  ] }) }),
1166
1263
  editingColumns && onChangeColumns && /* @__PURE__ */ jsx(
1167
1264
  TagColumnsEditor,
@@ -1218,113 +1315,20 @@ function TagTable({
1218
1315
  " ",
1219
1316
  l.loading
1220
1317
  ] }) : /* @__PURE__ */ jsxs("div", { className: "overflow-x-auto rounded-lg border border-border", children: [
1221
- /* @__PURE__ */ jsxs(
1222
- "table",
1318
+ /* @__PURE__ */ jsx(
1319
+ GridView,
1223
1320
  {
1224
- className: "w-full min-w-[36rem] table-fixed border-collapse text-sm",
1225
- "data-testid": `${testId}-table`,
1226
- children: [
1227
- /* @__PURE__ */ jsx("thead", { className: "bg-muted/40", children: /* @__PURE__ */ jsxs("tr", { children: [
1228
- /* @__PURE__ */ jsx(
1229
- "th",
1230
- {
1231
- className: cn(
1232
- ROW_LABEL_WIDTH,
1233
- "sticky left-0 z-10 bg-muted/40 px-3 py-2 text-left font-medium"
1234
- ),
1235
- children: l.row
1236
- }
1237
- ),
1238
- columns.map((c) => /* @__PURE__ */ jsx(
1239
- "th",
1240
- {
1241
- className: "truncate px-3 py-2 text-left font-medium",
1242
- title: c.name,
1243
- "data-testid": `${testId}-column-${c.id}`,
1244
- children: c.name
1245
- },
1246
- c.id
1247
- )),
1248
- /* @__PURE__ */ jsx("th", { className: cn(EVIDENCE_WIDTH, "px-3 py-2 text-left font-medium"), children: l.evidence })
1249
- ] }) }),
1250
- /* @__PURE__ */ jsxs("tbody", { children: [
1251
- rows.map((row) => {
1252
- const id = row.external_id;
1253
- return /* @__PURE__ */ jsxs(
1254
- "tr",
1255
- {
1256
- className: "border-t border-border align-top",
1257
- "data-testid": `${testId}-row-${id}`,
1258
- children: [
1259
- /* @__PURE__ */ jsx(
1260
- "th",
1261
- {
1262
- scope: "row",
1263
- className: cn(
1264
- ROW_LABEL_WIDTH,
1265
- "sticky left-0 z-10 bg-background px-3 py-2 text-left font-medium"
1266
- ),
1267
- children: onOpenRow ? /* @__PURE__ */ jsx(
1268
- "button",
1269
- {
1270
- type: "button",
1271
- className: cn(ROW_LABEL, "text-left hover:text-primary hover:underline"),
1272
- title: row.name,
1273
- onClick: () => onOpenRow(id),
1274
- "data-testid": `${testId}-row-${id}-label`,
1275
- children: row.name
1276
- }
1277
- ) : /* @__PURE__ */ jsx(
1278
- "span",
1279
- {
1280
- className: ROW_LABEL,
1281
- title: row.name,
1282
- "data-testid": `${testId}-row-${id}-label`,
1283
- children: row.name
1284
- }
1285
- )
1286
- }
1287
- ),
1288
- columns.map((c) => /* @__PURE__ */ jsx("td", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsx(
1289
- TagTableCell,
1290
- {
1291
- row,
1292
- column: c,
1293
- people,
1294
- tags,
1295
- onOpenTag,
1296
- onChange: onChangeValue,
1297
- l,
1298
- testId: `${testId}-cell-${id}-${c.id}`
1299
- }
1300
- ) }, c.id)),
1301
- /* @__PURE__ */ jsx("td", { className: "min-w-0 px-3 py-2", children: /* @__PURE__ */ jsx(
1302
- Evidence,
1303
- {
1304
- row,
1305
- l,
1306
- onOpenDocument,
1307
- onOpenFact,
1308
- onOpenThread,
1309
- onOpenRow,
1310
- testId: `${testId}-evidence-${id}`
1311
- }
1312
- ) })
1313
- ]
1314
- },
1315
- id
1316
- );
1317
- }),
1318
- rows.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
1319
- "td",
1320
- {
1321
- colSpan: columns.length + 2,
1322
- className: "px-3 py-6 text-center text-sm text-muted-foreground",
1323
- children: l.empty
1324
- }
1325
- ) })
1326
- ] })
1327
- ]
1321
+ items: rows,
1322
+ columnDefs,
1323
+ getItemId: (row) => row.external_id,
1324
+ height: "auto",
1325
+ emptyState: { title: l.empty },
1326
+ gridOptions: {
1327
+ ensureDomOrder: true,
1328
+ domLayout: "autoHeight"
1329
+ },
1330
+ getRowTestId: (row) => `${testId}-row-${row.external_id}`,
1331
+ testId: `${testId}-table`
1328
1332
  }
1329
1333
  ),
1330
1334
  columns.length === 0 && rows.length > 0 && /* @__PURE__ */ jsx("p", { className: "border-t border-border px-3 py-2 text-xs text-muted-foreground", children: l.noColumns })
@@ -1362,6 +1366,7 @@ function TagDetail({
1362
1366
  onOpenDocument,
1363
1367
  onOpenFact,
1364
1368
  onOpenThread,
1369
+ onOpenTaggedItems,
1365
1370
  noteLabel,
1366
1371
  noteIsValue = false,
1367
1372
  renderPassages,
@@ -1379,6 +1384,105 @@ function TagDetail({
1379
1384
  const threads = links.threads ?? [];
1380
1385
  const passages = (n) => n === 1 ? l.passage : l.passages.replace("{count}", String(n));
1381
1386
  return /* @__PURE__ */ jsxs(DetailBody, { className, testId, children: [
1387
+ onOpenTaggedItems ? /* @__PURE__ */ jsx(
1388
+ TagContentCounts,
1389
+ {
1390
+ row,
1391
+ l: cellLabels,
1392
+ onOpenTaggedItems,
1393
+ testId: `${testId}-counts`
1394
+ }
1395
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
1396
+ /* @__PURE__ */ jsx(
1397
+ DetailSection,
1398
+ {
1399
+ title: l.documents,
1400
+ count: links.doc_count,
1401
+ shown: docs.length,
1402
+ showingLabel: l.showing,
1403
+ testId: `${testId}-documents`,
1404
+ children: docs.length ? /* @__PURE__ */ jsx(DetailLinkList, { children: docs.map((d) => /* @__PURE__ */ jsx(
1405
+ DetailLinkItem,
1406
+ {
1407
+ icon: /* @__PURE__ */ jsx(FileText, { className: "size-4" }),
1408
+ onClick: onOpenDocument ? () => onOpenDocument(d.doc_ext_id) : void 0,
1409
+ testId: `${testId}-doc-${d.doc_ext_id}`,
1410
+ trailing: d.citations_count > 0 && !renderPassages && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: passages(d.citations_count) }),
1411
+ after: d.citations_count > 0 && renderPassages && /* @__PURE__ */ jsx("span", { className: "shrink-0 px-3 py-2 text-xs", children: renderPassages(d, passages(d.citations_count)) }),
1412
+ children: /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
1413
+ /* @__PURE__ */ jsx("span", { className: "block truncate font-medium", children: d.file_name }),
1414
+ (d.note || noteIsValue) && /* @__PURE__ */ jsxs(
1415
+ "span",
1416
+ {
1417
+ className: cn(
1418
+ "mt-0.5 flex min-w-0 items-baseline gap-2",
1419
+ noteIsValue ? "text-base text-foreground" : "text-muted-foreground"
1420
+ ),
1421
+ "data-testid": `${testId}-doc-${d.doc_ext_id}-note`,
1422
+ children: [
1423
+ noteLabel && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: noteLabel }),
1424
+ /* @__PURE__ */ jsx(
1425
+ "span",
1426
+ {
1427
+ className: cn(
1428
+ "line-clamp-3 min-w-0 whitespace-pre-line",
1429
+ noteIsValue && "font-semibold",
1430
+ !d.note && "font-normal italic text-muted-foreground"
1431
+ ),
1432
+ children: d.note || l.noValue
1433
+ }
1434
+ )
1435
+ ]
1436
+ }
1437
+ )
1438
+ ] })
1439
+ },
1440
+ d.doc_ext_id
1441
+ )) }) : /* @__PURE__ */ jsx(DetailEmpty, { children: l.noDocuments })
1442
+ }
1443
+ ),
1444
+ /* @__PURE__ */ jsx(
1445
+ DetailSection,
1446
+ {
1447
+ title: l.facts,
1448
+ count: links.fact_count,
1449
+ shown: facts.length,
1450
+ showingLabel: l.showing,
1451
+ testId: `${testId}-facts`,
1452
+ children: facts.length ? /* @__PURE__ */ jsx(DetailLinkList, { children: facts.map((f) => /* @__PURE__ */ jsx(
1453
+ DetailLinkItem,
1454
+ {
1455
+ icon: /* @__PURE__ */ jsx(Lightbulb, { className: "size-4" }),
1456
+ onClick: onOpenFact ? () => onOpenFact(f.fact_ext_id) : void 0,
1457
+ testId: `${testId}-fact-${f.fact_ext_id}`,
1458
+ children: /* @__PURE__ */ jsx("span", { className: "line-clamp-3 min-w-0 flex-1", children: f.text })
1459
+ },
1460
+ f.fact_ext_id
1461
+ )) }) : /* @__PURE__ */ jsx(DetailEmpty, { children: l.noFacts })
1462
+ }
1463
+ ),
1464
+ /* @__PURE__ */ jsx(
1465
+ DetailSection,
1466
+ {
1467
+ title: l.threads,
1468
+ count: links.thread_count,
1469
+ shown: threads.length,
1470
+ showingLabel: l.showing,
1471
+ testId: `${testId}-threads`,
1472
+ children: threads.length ? /* @__PURE__ */ jsx(DetailLinkList, { children: threads.map((t) => /* @__PURE__ */ jsx(
1473
+ DetailLinkItem,
1474
+ {
1475
+ icon: /* @__PURE__ */ jsx(MessagesSquare, { className: "size-4" }),
1476
+ onClick: onOpenThread ? () => onOpenThread(t.conversation_ext_id) : void 0,
1477
+ testId: `${testId}-thread-${t.conversation_ext_id}`,
1478
+ trailing: /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: l.threadUpdated.replace("{date}", formatDay(t.updated_at)) }),
1479
+ children: /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate font-medium", children: t.title || l.untitledThread })
1480
+ },
1481
+ t.conversation_ext_id
1482
+ )) }) : /* @__PURE__ */ jsx(DetailEmpty, { children: l.noThreads })
1483
+ }
1484
+ )
1485
+ ] }),
1382
1486
  fields.length > 0 && /* @__PURE__ */ jsx(DetailSection, { title: l.fields, testId: `${testId}-fields`, children: /* @__PURE__ */ jsx(DetailFields, { children: fields.map((field) => /* @__PURE__ */ jsx(DetailField, { label: field.name, children: /* @__PURE__ */ jsx(
1383
1487
  TagTableCell,
1384
1488
  {
@@ -1391,96 +1495,7 @@ function TagDetail({
1391
1495
  l: cellLabels,
1392
1496
  testId: `${testId}-field-${field.id}`
1393
1497
  }
1394
- ) }, field.id)) }) }),
1395
- /* @__PURE__ */ jsx(
1396
- DetailSection,
1397
- {
1398
- title: l.documents,
1399
- count: links.doc_count,
1400
- shown: docs.length,
1401
- showingLabel: l.showing,
1402
- testId: `${testId}-documents`,
1403
- children: docs.length ? /* @__PURE__ */ jsx(DetailLinkList, { children: docs.map((d) => /* @__PURE__ */ jsx(
1404
- DetailLinkItem,
1405
- {
1406
- icon: /* @__PURE__ */ jsx(FileText, { className: "size-4" }),
1407
- onClick: onOpenDocument ? () => onOpenDocument(d.doc_ext_id) : void 0,
1408
- testId: `${testId}-doc-${d.doc_ext_id}`,
1409
- trailing: d.citations_count > 0 && !renderPassages && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: passages(d.citations_count) }),
1410
- after: d.citations_count > 0 && renderPassages && /* @__PURE__ */ jsx("span", { className: "shrink-0 px-3 py-2 text-xs", children: renderPassages(d, passages(d.citations_count)) }),
1411
- children: /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
1412
- /* @__PURE__ */ jsx("span", { className: "block truncate font-medium", children: d.file_name }),
1413
- (d.note || noteIsValue) && /* @__PURE__ */ jsxs(
1414
- "span",
1415
- {
1416
- className: cn(
1417
- "mt-0.5 flex min-w-0 items-baseline gap-2",
1418
- noteIsValue ? "text-base text-foreground" : "text-muted-foreground"
1419
- ),
1420
- "data-testid": `${testId}-doc-${d.doc_ext_id}-note`,
1421
- children: [
1422
- noteLabel && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: noteLabel }),
1423
- /* @__PURE__ */ jsx(
1424
- "span",
1425
- {
1426
- className: cn(
1427
- "line-clamp-3 min-w-0 whitespace-pre-line",
1428
- noteIsValue && "font-semibold",
1429
- !d.note && "font-normal italic text-muted-foreground"
1430
- ),
1431
- children: d.note || l.noValue
1432
- }
1433
- )
1434
- ]
1435
- }
1436
- )
1437
- ] })
1438
- },
1439
- d.doc_ext_id
1440
- )) }) : /* @__PURE__ */ jsx(DetailEmpty, { children: l.noDocuments })
1441
- }
1442
- ),
1443
- /* @__PURE__ */ jsx(
1444
- DetailSection,
1445
- {
1446
- title: l.facts,
1447
- count: links.fact_count,
1448
- shown: facts.length,
1449
- showingLabel: l.showing,
1450
- testId: `${testId}-facts`,
1451
- children: facts.length ? /* @__PURE__ */ jsx(DetailLinkList, { children: facts.map((f) => /* @__PURE__ */ jsx(
1452
- DetailLinkItem,
1453
- {
1454
- icon: /* @__PURE__ */ jsx(Lightbulb, { className: "size-4" }),
1455
- onClick: onOpenFact ? () => onOpenFact(f.fact_ext_id) : void 0,
1456
- testId: `${testId}-fact-${f.fact_ext_id}`,
1457
- children: /* @__PURE__ */ jsx("span", { className: "line-clamp-3 min-w-0 flex-1", children: f.text })
1458
- },
1459
- f.fact_ext_id
1460
- )) }) : /* @__PURE__ */ jsx(DetailEmpty, { children: l.noFacts })
1461
- }
1462
- ),
1463
- /* @__PURE__ */ jsx(
1464
- DetailSection,
1465
- {
1466
- title: l.threads,
1467
- count: links.thread_count,
1468
- shown: threads.length,
1469
- showingLabel: l.showing,
1470
- testId: `${testId}-threads`,
1471
- children: threads.length ? /* @__PURE__ */ jsx(DetailLinkList, { children: threads.map((t) => /* @__PURE__ */ jsx(
1472
- DetailLinkItem,
1473
- {
1474
- icon: /* @__PURE__ */ jsx(MessagesSquare, { className: "size-4" }),
1475
- onClick: onOpenThread ? () => onOpenThread(t.conversation_ext_id) : void 0,
1476
- testId: `${testId}-thread-${t.conversation_ext_id}`,
1477
- trailing: /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: l.threadUpdated.replace("{date}", formatDay(t.updated_at)) }),
1478
- children: /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate font-medium", children: t.title || l.untitledThread })
1479
- },
1480
- t.conversation_ext_id
1481
- )) }) : /* @__PURE__ */ jsx(DetailEmpty, { children: l.noThreads })
1482
- }
1483
- )
1498
+ ) }, field.id)) }) })
1484
1499
  ] });
1485
1500
  }
1486
1501
 
@@ -1750,66 +1765,6 @@ function tagKindDescription(kind) {
1750
1765
  return `${tagKindTitle(kind, { plural: true })}.`;
1751
1766
  }
1752
1767
  }
1753
- function TagPicker({ tags, selectedId, kinds, onSelect, onCreate }) {
1754
- const [open, setOpen] = useState(false);
1755
- const [kind, ...otherKinds] = kinds;
1756
- const noun = tagKindNouns(kind);
1757
- const create = (name, as) => {
1758
- setOpen(false);
1759
- void onCreate?.(name, as);
1760
- };
1761
- const selected = tags.find((t) => t.external_id === selectedId);
1762
- const placeholder = onCreate ? `Find or create a ${noun.singular}\u2026` : `Find a ${noun.singular}\u2026`;
1763
- return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
1764
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
1765
- "button",
1766
- {
1767
- type: "button",
1768
- className: "flex h-9 w-72 max-w-full items-center gap-2 rounded-md border border-input bg-background px-3 text-left text-sm hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1769
- "data-testid": "tags-picker",
1770
- children: [
1771
- /* @__PURE__ */ jsx(Search, { className: "size-4 shrink-0 text-muted-foreground" }),
1772
- /* @__PURE__ */ jsx("span", { className: selected ? "min-w-0 flex-1 truncate" : "flex-1 text-muted-foreground", children: selected?.name ?? placeholder }),
1773
- /* @__PURE__ */ jsx(ChevronDown, { className: "size-4 shrink-0 text-muted-foreground" })
1774
- ]
1775
- }
1776
- ) }),
1777
- open && /* @__PURE__ */ jsx(
1778
- PopoverContent,
1779
- {
1780
- className: "w-[var(--radix-popover-trigger-width)] min-w-72 p-0",
1781
- align: "start",
1782
- sideOffset: 4,
1783
- "data-testid": "tags-picker-list",
1784
- children: /* @__PURE__ */ jsx(
1785
- LabelPickerList,
1786
- {
1787
- options: tags.map((t) => ({
1788
- id: t.external_id,
1789
- name: t.name,
1790
- color: getEntityColor(t.external_id, "medium")
1791
- })),
1792
- appliedIds: new Set(selectedId ? [selectedId] : []),
1793
- onToggle: (id) => {
1794
- setOpen(false);
1795
- onSelect(id);
1796
- },
1797
- onCreate: onCreate ? (name) => create(name, kind) : void 0,
1798
- moreCreates: onCreate ? otherKinds.map((other) => ({
1799
- label: (name) => `Create ${tagKindNouns(other).singular} \u201C${name}\u201D`,
1800
- onCreate: (name) => create(name, other)
1801
- })) : void 0,
1802
- labels: {
1803
- searchPlaceholder: placeholder,
1804
- noLabels: `No ${noun.plural} yet`,
1805
- create: (name) => `Create ${noun.singular} \u201C${name}\u201D`
1806
- }
1807
- }
1808
- )
1809
- }
1810
- )
1811
- ] });
1812
- }
1813
1768
  var EXTRACT_LIMIT = 500;
1814
1769
  var isTopLevel = (d) => !d.parent_ext_id;
1815
1770
  function ExtractEntitiesDialog({
@@ -1926,6 +1881,6 @@ function ExtractEntitiesDialog({
1926
1881
  ) });
1927
1882
  }
1928
1883
 
1929
- export { DEFAULT_GLOSSARY_LABELS, DEFAULT_TAG_COLUMNS_EDITOR_LABELS, DEFAULT_TAG_DETAIL_LABELS, DEFAULT_TAG_TABLE_DOCX_LABELS, DEFAULT_TAG_TABLE_LABELS, DEFAULT_WORKSPACE_ACTIVITY_LABELS, EXTRACT_LIMIT, EntityIdentityBar, ExtractEntitiesDialog, GridRowNavigator, IDENTITY_NAME_MAX_LENGTH, LoadingIndicator, TAG_TABLE_DOCX_LANDSCAPE_AFTER, TIPS_VISIBILITY_OVERRIDE, TagColumnsEditor, TagDetail, TagPicker, TagTable, TagTableCell, Toolbar, WELCOME_REPLAY_VIEW, WorkspaceActivityList, cellText, cellValue, documentCount, entitiesPhrase, fieldWrites, glossaryDocumentXml, glossaryDocx, glossaryEntries, glossaryFileName, glossaryMarkdown, isGap, parseCell, rowLinks, setHintsSessionOverride, startWelcomeReplay, tagDetailLabels, tagKindDescription, tagNoteLabel, tagTableDocumentXml, tagTableDocx, tagTableLabels, tagTableMarkdown, tagsPageNouns, useTipsPlacement, workspaceActivityHeadline, workspaceActivityTarget };
1930
- //# sourceMappingURL=chunk-5PKIDR2Q.js.map
1931
- //# sourceMappingURL=chunk-5PKIDR2Q.js.map
1884
+ export { DEFAULT_GLOSSARY_LABELS, DEFAULT_TAG_COLUMNS_EDITOR_LABELS, DEFAULT_TAG_DETAIL_LABELS, DEFAULT_TAG_TABLE_DOCX_LABELS, DEFAULT_TAG_TABLE_LABELS, DEFAULT_WORKSPACE_ACTIVITY_LABELS, EXTRACT_LIMIT, EntityIdentityBar, ExtractEntitiesDialog, GridRowNavigator, IDENTITY_NAME_MAX_LENGTH, LoadingIndicator, TAG_TABLE_DOCX_LANDSCAPE_AFTER, TagColumnsEditor, TagDetail, TagTable, TagTableCell, Toolbar, WorkspaceActivityList, cellText, cellValue, documentCount, entitiesPhrase, fieldWrites, glossaryDocumentXml, glossaryDocx, glossaryEntries, glossaryFileName, glossaryMarkdown, isGap, parseCell, rowLinks, tagDetailLabels, tagKindDescription, tagNoteLabel, tagTableDocumentXml, tagTableDocx, tagTableLabels, tagTableMarkdown, tagsPageNouns, useTipsPlacement, workspaceActivityHeadline, workspaceActivityTarget };
1885
+ //# sourceMappingURL=chunk-ZHJVABQ6.js.map
1886
+ //# sourceMappingURL=chunk-ZHJVABQ6.js.map