@arbidocs/blocks 0.4.87 → 0.4.88

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 (81) hide show
  1. package/dist/agents/index.cjs +211 -211
  2. package/dist/agents/index.js +6 -6
  3. package/dist/chat/index.cjs +125 -125
  4. package/dist/chat/index.js +3 -3
  5. package/dist/{chunk-2EI7NCUA.cjs → chunk-2CFW2ELM.cjs} +8 -2
  6. package/dist/chunk-2CFW2ELM.cjs.map +1 -0
  7. package/dist/{chunk-OR4CO743.cjs → chunk-5YXG342J.cjs} +3 -3
  8. package/dist/{chunk-OR4CO743.cjs.map → chunk-5YXG342J.cjs.map} +1 -1
  9. package/dist/{chunk-R26OHONI.js → chunk-6S5FLMWG.js} +83 -72
  10. package/dist/chunk-6S5FLMWG.js.map +1 -0
  11. package/dist/{chunk-P5ST47VY.js → chunk-DDF5GPIJ.js} +3 -3
  12. package/dist/{chunk-P5ST47VY.js.map → chunk-DDF5GPIJ.js.map} +1 -1
  13. package/dist/{chunk-PFA43QNX.js → chunk-EWSEQEPL.js} +3 -3
  14. package/dist/{chunk-PFA43QNX.js.map → chunk-EWSEQEPL.js.map} +1 -1
  15. package/dist/{chunk-X5K5PCRJ.cjs → chunk-FNEL2BYV.cjs} +18 -18
  16. package/dist/{chunk-X5K5PCRJ.cjs.map → chunk-FNEL2BYV.cjs.map} +1 -1
  17. package/dist/{chunk-LBE36YNZ.js → chunk-ICBAFX5B.js} +3 -3
  18. package/dist/{chunk-LBE36YNZ.js.map → chunk-ICBAFX5B.js.map} +1 -1
  19. package/dist/{chunk-C3DRLFU7.cjs → chunk-IF6VAYIA.cjs} +5 -5
  20. package/dist/{chunk-C3DRLFU7.cjs.map → chunk-IF6VAYIA.cjs.map} +1 -1
  21. package/dist/{chunk-O5NDG4EA.cjs → chunk-MP6FK43E.cjs} +3 -3
  22. package/dist/{chunk-O5NDG4EA.cjs.map → chunk-MP6FK43E.cjs.map} +1 -1
  23. package/dist/{chunk-AFSOUS5X.cjs → chunk-N26CXGXC.cjs} +83 -72
  24. package/dist/chunk-N26CXGXC.cjs.map +1 -0
  25. package/dist/{chunk-2FBQSQDW.js → chunk-NXWKMKZY.js} +298 -214
  26. package/dist/chunk-NXWKMKZY.js.map +1 -0
  27. package/dist/{chunk-QOADH2YB.cjs → chunk-UCAYNE44.cjs} +297 -213
  28. package/dist/chunk-UCAYNE44.cjs.map +1 -0
  29. package/dist/{chunk-UJM7TG44.js → chunk-UZV27QLC.js} +7 -7
  30. package/dist/{chunk-UJM7TG44.js.map → chunk-UZV27QLC.js.map} +1 -1
  31. package/dist/{chunk-GFYGYME3.js → chunk-W7NZRZ54.js} +3 -3
  32. package/dist/{chunk-GFYGYME3.js.map → chunk-W7NZRZ54.js.map} +1 -1
  33. package/dist/{chunk-HUJLKDWX.cjs → chunk-XMBYDLZQ.cjs} +4 -4
  34. package/dist/{chunk-HUJLKDWX.cjs.map → chunk-XMBYDLZQ.cjs.map} +1 -1
  35. package/dist/{chunk-WDD255XQ.js → chunk-XQDM6T6C.js} +3 -3
  36. package/dist/{chunk-WDD255XQ.js.map → chunk-XQDM6T6C.js.map} +1 -1
  37. package/dist/{chunk-ZV3BKLFY.cjs → chunk-Z5VUZ6YD.cjs} +3 -3
  38. package/dist/{chunk-ZV3BKLFY.cjs.map → chunk-Z5VUZ6YD.cjs.map} +1 -1
  39. package/dist/{chunk-YU2KUMGE.js → chunk-ZX2VPMBJ.js} +8 -2
  40. package/dist/chunk-ZX2VPMBJ.js.map +1 -0
  41. package/dist/connect/index.cjs +50 -50
  42. package/dist/connect/index.js +8 -8
  43. package/dist/facts/index.cjs +7 -7
  44. package/dist/facts/index.js +4 -4
  45. package/dist/files/index.cjs +4 -23
  46. package/dist/files/index.cjs.map +1 -1
  47. package/dist/files/index.js +4 -22
  48. package/dist/files/index.js.map +1 -1
  49. package/dist/files/views/TagFormParts.d.ts +0 -8
  50. package/dist/files/views/index.d.ts +1 -1
  51. package/dist/home/index.cjs +17 -17
  52. package/dist/home/index.js +3 -3
  53. package/dist/index.cjs +629 -537
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/index.js +116 -25
  56. package/dist/index.js.map +1 -1
  57. package/dist/retrieval/index.cjs +1 -1
  58. package/dist/retrieval/index.js +1 -1
  59. package/dist/settings/index.cjs +38 -38
  60. package/dist/settings/index.js +3 -3
  61. package/dist/shell/FilterInput.d.ts +3 -1
  62. package/dist/shell/index.cjs +5 -5
  63. package/dist/shell/index.js +2 -2
  64. package/dist/studio/index.cjs +4 -4
  65. package/dist/studio/index.js +3 -3
  66. package/dist/tags/TagDetail.d.ts +14 -2
  67. package/dist/tags/TagTable.d.ts +20 -11
  68. package/dist/tags/TagsNav.d.ts +28 -4
  69. package/dist/tags/index.d.ts +1 -1
  70. package/dist/tags/tagTableModel.d.ts +10 -2
  71. package/dist/workflow-canvas/index.cjs +13 -13
  72. package/dist/workflow-canvas/index.js +6 -6
  73. package/dist/workspaces/index.cjs +2 -2
  74. package/dist/workspaces/index.js +2 -2
  75. package/package.json +4 -4
  76. package/dist/chunk-2EI7NCUA.cjs.map +0 -1
  77. package/dist/chunk-2FBQSQDW.js.map +0 -1
  78. package/dist/chunk-AFSOUS5X.cjs.map +0 -1
  79. package/dist/chunk-QOADH2YB.cjs.map +0 -1
  80. package/dist/chunk-R26OHONI.js.map +0 -1
  81. package/dist/chunk-YU2KUMGE.js.map +0 -1
@@ -3,14 +3,14 @@
3
3
 
4
4
  var chunkNYBIKDWI_cjs = require('../chunk-NYBIKDWI.cjs');
5
5
  var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
6
- var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
6
+ var chunk2CFW2ELM_cjs = require('../chunk-2CFW2ELM.cjs');
7
7
  require('../chunk-OB5F4577.cjs');
8
8
  var chunkXKSFJYOD_cjs = require('../chunk-XKSFJYOD.cjs');
9
9
  var chunkVGOFFCMT_cjs = require('../chunk-VGOFFCMT.cjs');
10
10
  require('../chunk-PPCATBOY.cjs');
11
+ require('../chunk-C54XEN5T.cjs');
11
12
  var chunkFX3K6LNZ_cjs = require('../chunk-FX3K6LNZ.cjs');
12
13
  require('../chunk-MHVNT4J3.cjs');
13
- require('../chunk-C54XEN5T.cjs');
14
14
  require('../chunk-DES3K4SD.cjs');
15
15
 
16
16
 
@@ -201,15 +201,15 @@ Object.defineProperty(exports, "TabHeader", {
201
201
  });
202
202
  Object.defineProperty(exports, "DEFAULT_FILTER_FIELDS", {
203
203
  enumerable: true,
204
- get: function () { return chunk2EI7NCUA_cjs.DEFAULT_FILTER_FIELDS; }
204
+ get: function () { return chunk2CFW2ELM_cjs.DEFAULT_FILTER_FIELDS; }
205
205
  });
206
206
  Object.defineProperty(exports, "DEFAULT_FILTER_INPUT_LABELS", {
207
207
  enumerable: true,
208
- get: function () { return chunk2EI7NCUA_cjs.DEFAULT_FILTER_INPUT_LABELS; }
208
+ get: function () { return chunk2CFW2ELM_cjs.DEFAULT_FILTER_INPUT_LABELS; }
209
209
  });
210
210
  Object.defineProperty(exports, "FilterInput", {
211
211
  enumerable: true,
212
- get: function () { return chunk2EI7NCUA_cjs.FilterInput; }
212
+ get: function () { return chunk2CFW2ELM_cjs.FilterInput; }
213
213
  });
214
214
  Object.defineProperty(exports, "DEFAULT_DOCK_WIDTH", {
215
215
  enumerable: true,
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  export { ActionCluster, AskField, AskRow, AskTrigger, DEFAULT_ASK_FIELD_LABELS, DEFAULT_INSTALL_PROMPT_LABELS, DEFAULT_MOBILE_BARS_LABELS, DEFAULT_OFFLINE_PILL_LABELS, DEFAULT_REMOTE_CONTROL_PILL_LABELS, DEFAULT_SIDEBAR_LABELS, DEFAULT_TIP_CARD_LABELS, DEFAULT_WORKSPACE_KIND_LABELS, DEFAULT_WORKSPACE_SWITCHER_LABELS, INSTALL_PROMPT_DISMISSED_KEY, InfoBar, InstallPrompt, MobileAppBar, MobileTabBar, NotificationBell, OfflinePill, RemoteControlPill, STATUS_ROW_BASE_CLASS, STATUS_ROW_TONES, Sidebar, SidebarBadgeRow, SidebarRowAction, SidebarRowHoverContext, SplitLayout, StatusBadge, StatusRow, TipCard, UserMenu, WorkspaceIdentity, WorkspaceSwitcher, getInstallInstructions, initInstallPrompt, isIosDevice, promptAppInstall, resolveSidebarLayout, useInstallPrompt, useSidebarContext, useSidebarSettle, workspaceKindColor, workspaceKindMeta } from '../chunk-R3PDNQYT.js';
3
3
  export { DEFAULT_TAB_HEADER_LABELS, TabHeader } from '../chunk-4WWM3GQ5.js';
4
- export { DEFAULT_FILTER_FIELDS, DEFAULT_FILTER_INPUT_LABELS, FilterInput } from '../chunk-YU2KUMGE.js';
4
+ export { DEFAULT_FILTER_FIELDS, DEFAULT_FILTER_INPUT_LABELS, FilterInput } from '../chunk-ZX2VPMBJ.js';
5
5
  import '../chunk-S7PSMMRG.js';
6
6
  export { DEFAULT_DOCK_WIDTH, Toaster } from '../chunk-BV7FEMSI.js';
7
7
  export { DEFAULT_OVERLAY_ZONE_ID, DEFAULT_PAGE_CONTAINER_PADDING, DEFAULT_SIDEBAR_TOGGLE_BUTTON_LABELS, PageContainer, SHELL_BOTTOM_INSET_VAR, Shell, SidebarToggleButton, ToolButton, useDrawerBehavior, useOverlayZoneId, useShellBottomInset } from '../chunk-KZJAG7T3.js';
8
8
  import '../chunk-NPLYHR2E.js';
9
+ import '../chunk-76JDDMSP.js';
9
10
  export { BREAKPOINT_QUERIES, useIsNarrow, useIsPhone, useIsTouchScreen, useMediaQuery } from '../chunk-SLSBJRWW.js';
10
11
  import '../chunk-7F6CBP3Z.js';
11
- import '../chunk-76JDDMSP.js';
12
12
  import '../chunk-VUNV25KB.js';
13
13
  //# sourceMappingURL=index.js.map
14
14
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkHUJLKDWX_cjs = require('../chunk-HUJLKDWX.cjs');
4
+ var chunkXMBYDLZQ_cjs = require('../chunk-XMBYDLZQ.cjs');
5
5
  var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
6
6
  var chunk7QDX2CO4_cjs = require('../chunk-7QDX2CO4.cjs');
7
7
  var chunkMJCCBMM5_cjs = require('../chunk-MJCCBMM5.cjs');
@@ -10,14 +10,14 @@ require('../chunk-VPPX5XUF.cjs');
10
10
  var chunkPCB2BPN3_cjs = require('../chunk-PCB2BPN3.cjs');
11
11
  var chunkZW6FPIFC_cjs = require('../chunk-ZW6FPIFC.cjs');
12
12
  require('../chunk-OB5F4577.cjs');
13
- require('../chunk-O5NDG4EA.cjs');
13
+ require('../chunk-MP6FK43E.cjs');
14
14
  require('../chunk-VGOFFCMT.cjs');
15
15
  require('../chunk-B4SRYJLM.cjs');
16
16
  require('../chunk-7UTB4PHM.cjs');
17
17
  require('../chunk-PPCATBOY.cjs');
18
- require('../chunk-MHVNT4J3.cjs');
19
18
  var chunkC54XEN5T_cjs = require('../chunk-C54XEN5T.cjs');
20
19
  var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
20
+ require('../chunk-MHVNT4J3.cjs');
21
21
  require('../chunk-DES3K4SD.cjs');
22
22
  var lucideReact = require('lucide-react');
23
23
  var react$1 = require('@arbidocs/react');
@@ -883,7 +883,7 @@ function latestImageDocId(artifacts) {
883
883
  return null;
884
884
  }
885
885
  function useImageGen() {
886
- const task = chunkHUJLKDWX_cjs.useConnectedAiTask();
886
+ const task = chunkXMBYDLZQ_cjs.useConnectedAiTask();
887
887
  const { run } = task;
888
888
  const generate = react.useCallback(
889
889
  async (prompt, referenceDocIds = []) => {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useConnectedAiTask } from '../chunk-WDD255XQ.js';
2
+ import { useConnectedAiTask } from '../chunk-XQDM6T6C.js';
3
3
  import { useConnection } from '../chunk-OYMWV45N.js';
4
4
  import { PageHeader, MetricCard, DataTableBlock, StatGroup } from '../chunk-ZCF2JJFA.js';
5
5
  import { assetRefId, applyStoredTheme, AssetResolverProvider, ThemeEditor, applyThemeVars, tid, SectionHeading, PricingTable, Tabs as Tabs$1, Accordion, Gallery, VideoEmbed, ContactForm, Banner, MediaText, TeamGrid, Steps, TestimonialGrid, Columns, Spacer, Container, Hero, FeatureGrid, Testimonial, CTABanner, LogoCloud, FAQ, RichTextBlock, BlockImage, AvatarBlock, Navbar, Footer, ListBlock, isAssetRef, asAssetRef } from '../chunk-DLBUFHLY.js';
@@ -9,14 +9,14 @@ import '../chunk-4EZVCGRL.js';
9
9
  import { Callout } from '../chunk-UJE32SST.js';
10
10
  import { EmptyState } from '../chunk-P6GHJSLR.js';
11
11
  import '../chunk-S7PSMMRG.js';
12
- import '../chunk-PFA43QNX.js';
12
+ import '../chunk-EWSEQEPL.js';
13
13
  import '../chunk-KZJAG7T3.js';
14
14
  import '../chunk-HOXKR26S.js';
15
15
  import '../chunk-AA3PT6KR.js';
16
16
  import '../chunk-NPLYHR2E.js';
17
- import '../chunk-7F6CBP3Z.js';
18
17
  import { useBlocksEnvironment } from '../chunk-76JDDMSP.js';
19
18
  import { formatCount } from '../chunk-OXF2IFXG.js';
19
+ import '../chunk-7F6CBP3Z.js';
20
20
  import '../chunk-VUNV25KB.js';
21
21
  import { MessageSquare, Cpu, Code, Cloud, Layers, Target, Award, MapPin, Phone, Mail, Lock, Globe, Heart, Star, Rocket, Shield, Zap, Sparkles, Gavel, Scale, Bell, Activity, BarChart3, DollarSign, TrendingUp, Info, AlertCircle, CheckCircle, Clock, Calendar, Briefcase, Users, Folder, FileText, ArrowLeft, Palette, Loader2, RotateCcw, ChevronUp, ChevronDown, BrainCircuit, Bot, LayoutGrid, FileJson, Download, Crop, ImagePlus, Upload, Link2, Check, MessagesSquare } from 'lucide-react';
22
22
  import { useArbi, useThumbnails, useConfigs, useAgents, useWorkspaceDocs, useAiTask, useDocuments, ImageCropModal, DEFAULT_ASPECT_OPTIONS, useConversations } from '@arbidocs/react';
@@ -15,6 +15,8 @@ export interface TagDetailLabels {
15
15
  showing: string;
16
16
  noDocuments: string;
17
17
  noFacts: string;
18
+ /** An annotation with no value on a document. */
19
+ noValue: string;
18
20
  noThreads: string;
19
21
  untitledThread: string;
20
22
  /** When a thread was last active: `{date}`. */
@@ -25,11 +27,21 @@ export interface TagDetailLabels {
25
27
  loading: string;
26
28
  }
27
29
  export declare const DEFAULT_TAG_DETAIL_LABELS: TagDetailLabels;
28
- export interface TagDetailProps extends Pick<TagTableProps, 'onChangeValue' | 'onOpenDocument' | 'onOpenFact' | 'onOpenThread' | 'people'> {
30
+ export interface TagDetailProps extends Pick<TagTableProps, 'onChangeValue' | 'onOpenDocument' | 'onOpenFact' | 'onOpenThread' | 'people' | 'tags' | 'onOpenTag'> {
29
31
  /** The tag with its values and links (documents, facts, threads). */
30
32
  row: TagTableRow | undefined;
31
33
  /** Its kind's fields in the workspace (none: no Fields section). */
32
34
  fields?: TagTableField[];
35
+ /**
36
+ * What the tag's note on a document is, e.g. "Note" for an annotation or "Role" for a person.
37
+ * Given, each document row names it before the note.
38
+ */
39
+ noteLabel?: string;
40
+ /**
41
+ * The note is the point of the row (an annotation's value): shown prominently, and a document
42
+ * without one says so.
43
+ */
44
+ noteIsValue?: boolean;
33
45
  isLoading?: boolean;
34
46
  labels?: Partial<TagDetailLabels>;
35
47
  /** Labels of the field inputs (the empty choice). */
@@ -37,4 +49,4 @@ export interface TagDetailProps extends Pick<TagTableProps, 'onChangeValue' | 'o
37
49
  className?: string;
38
50
  testId?: string;
39
51
  }
40
- export declare function TagDetail({ row, fields, isLoading, people, onChangeValue, onOpenDocument, onOpenFact, onOpenThread, labels, fieldLabels, className, testId, }: TagDetailProps): import("react").JSX.Element;
52
+ export declare function TagDetail({ row, fields, isLoading, people, tags, onOpenTag, onChangeValue, onOpenDocument, onOpenFact, onOpenThread, noteLabel, noteIsValue, labels, fieldLabels, className, testId, }: TagDetailProps): import("react").JSX.Element;
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * A table of tags (every issue, every person, a label's children): one row per tag, a column per
3
3
  * field of their kind in the workspace, editable in place by type (text, number, date, checkbox,
4
- * choice, person), and the evidence behind each row (its linked documents, facts and threads, with
5
- * counts). Rows with no evidence are marked as gaps. Rows and columns can be added (the columns are
6
- * the kind's fields, edited as one list), and the table exported as a Word document snapshot (filed
7
- * in the workspace) or downloaded.
4
+ * choice, person, a link to other tags), and the items tagged with each row (its linked documents,
5
+ * facts and threads, with counts). A row with nothing tagged yet is a normal row with an empty
6
+ * cell. Rows and columns can be added (the columns are the kind's fields, edited as one list), and
7
+ * the table exported as a Word document snapshot (filed in the workspace) or downloaded.
8
8
  * The data and every write come from the host (`ConnectedTagTable` binds them to ARBI).
9
9
  */
10
10
  import { type ReactNode } from 'react';
@@ -27,10 +27,6 @@ export interface TagTableLabels {
27
27
  untitledThread: string;
28
28
  /** `{count}` more links than shown. */
29
29
  more: string;
30
- gap: string;
31
- gapsOnly: string;
32
- /** `{count}` rows without evidence. */
33
- gapCount: string;
34
30
  addRow: string;
35
31
  addRowPlaceholder: string;
36
32
  add: string;
@@ -67,7 +63,7 @@ export interface TagTableProps {
67
63
  onOpenFact?: (factId: string) => void;
68
64
  /** Open a linked thread (conversation). */
69
65
  onOpenThread?: (conversationId: string) => void;
70
- /** Open a row's tag (all its evidence). */
66
+ /** Open a row's tag (everything tagged with it). */
71
67
  onOpenRow?: (tagId: string) => void;
72
68
  /** Export the table as it stands (filed as a document). Absent: no export button. */
73
69
  onExport?: () => void | Promise<unknown>;
@@ -78,6 +74,17 @@ export interface TagTableProps {
78
74
  value: string;
79
75
  label: string;
80
76
  }>;
77
+ /**
78
+ * The tags a link column (`type: 'tag'`) offers — each with its kind; a column offers those of
79
+ * the kinds in its `options` — and names its values by.
80
+ */
81
+ tags?: ReadonlyArray<{
82
+ value: string;
83
+ label: string;
84
+ kind: string;
85
+ }>;
86
+ /** Open a linked tag (a link column's value). */
87
+ onOpenTag?: (tagId: string) => void;
81
88
  /** Extra controls in the toolbar. */
82
89
  actions?: ReactNode;
83
90
  labels?: Partial<TagTableLabels>;
@@ -88,12 +95,14 @@ export interface TagTableProps {
88
95
  * One editable field value of a tag, by its type: committed on blur or Enter (a checkbox and a
89
96
  * choice at once). A table cell, and a field of a single tag's form (`TagDetail`).
90
97
  */
91
- export declare function TagTableCell({ row, column, people, onChange, l, testId, }: {
98
+ export declare function TagTableCell({ row, column, people, tags, onOpenTag, onChange, l, testId, }: {
92
99
  row: TagTableRow;
93
100
  column: TagTableField;
94
101
  people?: TagTableProps['people'];
102
+ tags?: TagTableProps['tags'];
103
+ onOpenTag?: TagTableProps['onOpenTag'];
95
104
  onChange?: TagTableProps['onChangeValue'];
96
105
  l: TagTableLabels;
97
106
  testId: string;
98
107
  }): import("react").JSX.Element;
99
- export declare function TagTable({ table, isLoading, onChangeValue, onAddRow, onChangeColumns, onOpenDocument, onOpenFact, onOpenThread, onOpenRow, onExport, onDownload, people, actions, labels, className, testId, }: TagTableProps): import("react").JSX.Element;
108
+ export declare function TagTable({ table, isLoading, onChangeValue, onAddRow, onChangeColumns, onOpenDocument, onOpenFact, onOpenThread, onOpenRow, onExport, onDownload, people, tags, onOpenTag, actions, labels, className, testId, }: TagTableProps): import("react").JSX.Element;
@@ -1,8 +1,10 @@
1
1
  /**
2
2
  * The side navigation of a Tags page: the workspace's tags grouped by kind (labels, annotations,
3
3
  * issues, people, organisations, searches), each group with its count, each tag with how much
4
- * carries it, and nested tags (a label's sub-labels) under their parent. A group heading selects
5
- * the whole kind; a tag selects that tag. Data-free: the host passes the groups.
4
+ * carries it, and nested tags (sub-labels) under their parent. A group heading selects the whole
5
+ * kind; a tag selects that tag. One box finds and adds: typing filters the list, and a name that is
6
+ * not there yet is offered as a new tag ("Create …", or Enter). Data-free: the host passes the
7
+ * groups and creates.
6
8
  */
7
9
  import { type ReactNode } from 'react';
8
10
  export interface TagsNavItem {
@@ -12,8 +14,10 @@ export interface TagsNavItem {
12
14
  count?: number;
13
15
  /** A swatch colour (any CSS colour). */
14
16
  color?: string;
15
- /** Nested tags (e.g. a label's sub-labels). */
17
+ /** Nested tags (e.g. sub-labels). */
16
18
  children?: TagsNavItem[];
19
+ /** Other text the filter matches (e.g. the tag's field values). */
20
+ keywords?: string;
17
21
  }
18
22
  export interface TagsNavGroup {
19
23
  id: string;
@@ -31,14 +35,34 @@ export interface TagsNavLabels {
31
35
  clearFilter: string;
32
36
  empty: string;
33
37
  noMatch: string;
38
+ /** Offer to add the typed name: `{name}`. */
39
+ create: string;
34
40
  }
35
41
  export declare const DEFAULT_TAGS_NAV_LABELS: TagsNavLabels;
36
42
  export interface TagsNavProps {
37
43
  groups: TagsNavGroup[];
38
44
  selected: TagsNavSelection | null;
39
45
  onSelect: (selection: TagsNavSelection) => void;
46
+ /**
47
+ * Add a tag by the name typed in the box when no tag has that name (any case). Absent: the box
48
+ * only finds.
49
+ */
50
+ onCreate?: (name: string) => void | Promise<unknown>;
51
+ /**
52
+ * The filter text, when the box lives elsewhere (e.g. the page header's filter): the list then
53
+ * renders no box of its own and filters by this; `onFilterChange` hears a create clearing it.
54
+ */
55
+ filter?: string;
56
+ onFilterChange?: (text: string) => void;
57
+ /** Match items' `keywords` as well as their names. */
58
+ matchKeywords?: boolean;
40
59
  labels?: Partial<TagsNavLabels>;
41
60
  className?: string;
42
61
  testId?: string;
43
62
  }
44
- export declare function TagsNav({ groups, selected, onSelect, labels, className, testId, }: TagsNavProps): import("react").JSX.Element;
63
+ /** The tag named `name` (any case) in these groups, with its group; nested ones included. */
64
+ export declare function findTagsNavItem(groups: TagsNavGroup[], name: string): {
65
+ groupId: string;
66
+ item: TagsNavItem;
67
+ } | undefined;
68
+ export declare function TagsNav({ groups, selected, onSelect, onCreate, filter: controlledFilter, onFilterChange, matchKeywords, labels, className, testId, }: TagsNavProps): import("react").JSX.Element;
@@ -6,6 +6,6 @@
6
6
  export { TagTable, TagTableCell, DEFAULT_TAG_TABLE_LABELS, type TagTableProps, type TagTableLabels, } from './TagTable';
7
7
  export { TagColumnsEditor, DEFAULT_TAG_COLUMNS_EDITOR_LABELS, type TagColumnsEditorProps, type TagColumnsEditorLabels, } from './TagColumnsEditor';
8
8
  export { TagDetail, DEFAULT_TAG_DETAIL_LABELS, type TagDetailProps, type TagDetailLabels, } from './TagDetail';
9
- export { TagsNav, DEFAULT_TAGS_NAV_LABELS, type TagsNavProps, type TagsNavLabels, type TagsNavGroup, type TagsNavItem, type TagsNavSelection, } from './TagsNav';
9
+ export { TagsNav, findTagsNavItem, DEFAULT_TAGS_NAV_LABELS, type TagsNavProps, type TagsNavLabels, type TagsNavGroup, type TagsNavItem, type TagsNavSelection, } from './TagsNav';
10
10
  export { tagTableMarkdown, cellValue, cellText, parseCell, isGap, rowLinks, fieldWrites, type TagTableData, type TagTableRow, type TagTableLinks, type TagTableField, type TagTableFieldType, type TagTableFieldWrite, type TagTableMarkdownOptions, } from './tagTableModel';
11
11
  export { tagTableDocx, tagTableDocumentXml, DEFAULT_TAG_TABLE_DOCX_LABELS, TAG_TABLE_DOCX_LANDSCAPE_AFTER, type TagTableDocxLabels, type TagTableDocxOptions, } from './tagTableDocx';
@@ -5,7 +5,10 @@
5
5
  * row's value, the gaps, and the snapshot as a Markdown document.
6
6
  */
7
7
  import type { components } from '@arbidocs/client';
8
- /** A column: one of the kind's fields. */
8
+ /**
9
+ * A column: one of the kind's fields. A `'tag'` field links to tags (its `options` are the kinds it
10
+ * may point at; its value is a list of tag ids), e.g. a person's Organisation.
11
+ */
9
12
  export type TagTableField = components['schemas']['FieldDefinition'];
10
13
  export type TagTableFieldType = TagTableField['type'];
11
14
  /** A field as written back to the kind (`id` keeps it and its values). */
@@ -24,7 +27,12 @@ export declare const rowLinks: (row: TagTableRow) => TagTableLinks;
24
27
  export declare const cellValue: (row: TagTableRow, column: TagTableField) => unknown;
25
28
  /** A row with nothing behind it: no linked document, fact or thread. */
26
29
  export declare const isGap: (row: TagTableRow) => boolean;
27
- /** A value as text (a person by name, a checkbox as yes or no, blank as empty). */
30
+ /**
31
+ * The tags a link field (`type: 'tag'`) points at: a list of tag ids (a single id is read as one;
32
+ * anything else is none).
33
+ */
34
+ export declare function linkedTagIds(value: unknown): string[];
35
+ /** A value as text (a person or a linked tag by name, a checkbox as yes or no, blank as empty). */
28
36
  export declare function cellText(value: unknown, column: Pick<TagTableField, 'type'>, nameOf?: (id: string) => string | undefined): string;
29
37
  /** A typed input's text back as the value to store (`null` clears it). */
30
38
  export declare function parseCell(text: string, type: TagTableFieldType): unknown;
@@ -2,29 +2,29 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
5
- var chunkX5K5PCRJ_cjs = require('../chunk-X5K5PCRJ.cjs');
5
+ var chunkFNEL2BYV_cjs = require('../chunk-FNEL2BYV.cjs');
6
6
  require('../chunk-S5HZBXZA.cjs');
7
7
  require('../chunk-ZW6FPIFC.cjs');
8
8
  var chunk5XZU64E2_cjs = require('../chunk-5XZU64E2.cjs');
9
- require('../chunk-AFSOUS5X.cjs');
9
+ require('../chunk-N26CXGXC.cjs');
10
10
  require('../chunk-7RGLTF76.cjs');
11
11
  require('../chunk-3AFWGEDJ.cjs');
12
12
  require('../chunk-VFUWWH52.cjs');
13
13
  require('../chunk-DETZZBG2.cjs');
14
14
  require('../chunk-V4ISCZJ7.cjs');
15
- require('../chunk-2EI7NCUA.cjs');
16
- require('../chunk-ZV3BKLFY.cjs');
15
+ require('../chunk-2CFW2ELM.cjs');
16
+ require('../chunk-Z5VUZ6YD.cjs');
17
17
  require('../chunk-7D737FLE.cjs');
18
18
  require('../chunk-OB5F4577.cjs');
19
19
  require('../chunk-B4SRYJLM.cjs');
20
20
  require('../chunk-7UTB4PHM.cjs');
21
21
  require('../chunk-PPCATBOY.cjs');
22
+ require('../chunk-C54XEN5T.cjs');
23
+ require('../chunk-KDG6FER6.cjs');
22
24
  require('../chunk-ULWRNGGE.cjs');
23
25
  require('../chunk-IXALYQT7.cjs');
24
26
  require('../chunk-FX3K6LNZ.cjs');
25
27
  require('../chunk-MHVNT4J3.cjs');
26
- require('../chunk-C54XEN5T.cjs');
27
- require('../chunk-KDG6FER6.cjs');
28
28
  require('../chunk-DES3K4SD.cjs');
29
29
  var react = require('react');
30
30
  var react$2 = require('@arbidocs/react');
@@ -1488,7 +1488,7 @@ function triggerFields(trigger, clearOthers) {
1488
1488
  return {
1489
1489
  timezone: trigger.timezone,
1490
1490
  rrule: trigger.start === "repeat" ? trigger.rrule.trim() : none,
1491
- run_at: trigger.start === "once" ? chunkX5K5PCRJ_cjs.localInputToIso(trigger.runAt) : none,
1491
+ run_at: trigger.start === "once" ? chunkFNEL2BYV_cjs.localInputToIso(trigger.runAt) : none,
1492
1492
  event_kind: trigger.start === "event" ? trigger.eventKind.trim() : none,
1493
1493
  // A step signal is `workflow_signal` narrowed to one signal name.
1494
1494
  event_filter: filter ?? none,
@@ -1547,7 +1547,7 @@ function workflowRecordToBuilder(record) {
1547
1547
  ...record.skill_ref ? { workflow: record.skill_ref } : { run: { kind: "prompt", promptTemplate: record.prompt } }
1548
1548
  }
1549
1549
  ] : [];
1550
- const when = chunkX5K5PCRJ_cjs.workflowWhen(record);
1550
+ const when = chunkFNEL2BYV_cjs.workflowWhen(record);
1551
1551
  return {
1552
1552
  workflow: {
1553
1553
  id: record.external_id,
@@ -1561,7 +1561,7 @@ function workflowRecordToBuilder(record) {
1561
1561
  trigger: {
1562
1562
  ...DEFAULT_WORKFLOW_TRIGGER,
1563
1563
  start: when === "now" ? "manual" : when,
1564
- runAt: chunkX5K5PCRJ_cjs.isoToLocalInput(record.run_at),
1564
+ runAt: chunkFNEL2BYV_cjs.isoToLocalInput(record.run_at),
1565
1565
  rrule: record.rrule ?? "",
1566
1566
  timezone: record.timezone || DEFAULT_WORKFLOW_TRIGGER.timezone,
1567
1567
  eventKind: record.event_kind ?? "",
@@ -1617,7 +1617,7 @@ function triggerSummary(trigger, options = {}) {
1617
1617
  case "once":
1618
1618
  return trigger.runAt ? new Date(trigger.runAt).toLocaleString() : l.starts.once;
1619
1619
  case "repeat":
1620
- return trigger.rrule ? chunkX5K5PCRJ_cjs.describeRRule(trigger.rrule) : l.starts.repeat;
1620
+ return trigger.rrule ? chunkFNEL2BYV_cjs.describeRRule(trigger.rrule) : l.starts.repeat;
1621
1621
  case "event":
1622
1622
  if (isSignalTrigger(trigger))
1623
1623
  return trigger.signal ? l.signalSummary.replace("{signal}", trigger.signal) : l.stepSignals;
@@ -1676,7 +1676,7 @@ function TriggerInspector({
1676
1676
  }
1677
1677
  )
1678
1678
  ] }),
1679
- trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkX5K5PCRJ_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
1679
+ trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkFNEL2BYV_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
1680
1680
  trigger.start === "event" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
1681
1681
  /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.event }),
1682
1682
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1728,7 +1728,7 @@ function TriggerInspector({
1728
1728
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
1729
1729
  /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.agent }),
1730
1730
  /* @__PURE__ */ jsxRuntime.jsx(
1731
- chunkX5K5PCRJ_cjs.AgentSelect,
1731
+ chunkFNEL2BYV_cjs.AgentSelect,
1732
1732
  {
1733
1733
  agents,
1734
1734
  value: trigger.agentId,
@@ -2579,7 +2579,7 @@ function WorkflowPreview({
2579
2579
  renderIcon,
2580
2580
  testId
2581
2581
  }) {
2582
- const run = chunkX5K5PCRJ_cjs.useWorkflowPreview(workflow, {
2582
+ const run = chunkFNEL2BYV_cjs.useWorkflowPreview(workflow, {
2583
2583
  resolveWorkflow: (id) => workflows.find((w) => w.id === id),
2584
2584
  compose,
2585
2585
  answer
@@ -1,28 +1,28 @@
1
1
  "use client";
2
2
  import { useConnection } from '../chunk-OYMWV45N.js';
3
- import { workflowWhen, isoToLocalInput, describeRRule, RecurrenceBuilder, AgentSelect, useWorkflowPreview, localInputToIso } from '../chunk-UJM7TG44.js';
3
+ import { workflowWhen, isoToLocalInput, describeRRule, RecurrenceBuilder, AgentSelect, useWorkflowPreview, localInputToIso } from '../chunk-UZV27QLC.js';
4
4
  import '../chunk-4XJZ6AAY.js';
5
5
  import '../chunk-P6GHJSLR.js';
6
6
  import { workflowSteps, dependsOn, stepLevels, isIncompleteSignal, runFields, upstreamSteps, stepDependencies, canAssign, fromPlanSteps, layoutFromPlanSteps, validateWorkflowGraph, stepConfigProblems, WorkflowRunner, skillToWorkflow, assigneeName, orderSteps, toPlanSteps } from '../chunk-YX466FWL.js';
7
- import '../chunk-R26OHONI.js';
7
+ import '../chunk-6S5FLMWG.js';
8
8
  import '../chunk-4WWM3GQ5.js';
9
9
  import '../chunk-RFXJYIDV.js';
10
10
  import '../chunk-DPLRHEJZ.js';
11
11
  import '../chunk-EVUEIBNU.js';
12
12
  import '../chunk-NUNKSZKU.js';
13
- import '../chunk-YU2KUMGE.js';
14
- import '../chunk-P5ST47VY.js';
13
+ import '../chunk-ZX2VPMBJ.js';
14
+ import '../chunk-DDF5GPIJ.js';
15
15
  import '../chunk-XD2M6LIG.js';
16
16
  import '../chunk-S7PSMMRG.js';
17
17
  import '../chunk-HOXKR26S.js';
18
18
  import '../chunk-AA3PT6KR.js';
19
19
  import '../chunk-NPLYHR2E.js';
20
+ import '../chunk-76JDDMSP.js';
21
+ import '../chunk-OXF2IFXG.js';
20
22
  import '../chunk-TX2ZICS7.js';
21
23
  import '../chunk-ZPLG7QYF.js';
22
24
  import '../chunk-SLSBJRWW.js';
23
25
  import '../chunk-7F6CBP3Z.js';
24
- import '../chunk-76JDDMSP.js';
25
- import '../chunk-OXF2IFXG.js';
26
26
  import '../chunk-VUNV25KB.js';
27
27
  import { useMemo, useState, useEffect, useCallback, useRef } from 'react';
28
28
  import { useWorkspaceUsers, useTags, useDocuments, useWorkflows, useSkills, useAgents, useConversations, useCreateWorkflow, useUpdateWorkflow, useRunWorkflow } from '@arbidocs/react';
@@ -4,10 +4,10 @@
4
4
  var chunkXZIYRKLW_cjs = require('../chunk-XZIYRKLW.cjs');
5
5
  var chunkXAJIKT6Y_cjs = require('../chunk-XAJIKT6Y.cjs');
6
6
  var chunkOB5F4577_cjs = require('../chunk-OB5F4577.cjs');
7
- var chunk7G2LJMUG_cjs = require('../chunk-7G2LJMUG.cjs');
8
- var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
9
7
  require('../chunk-C54XEN5T.cjs');
10
8
  var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
9
+ var chunk7G2LJMUG_cjs = require('../chunk-7G2LJMUG.cjs');
10
+ var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
11
11
  require('../chunk-DES3K4SD.cjs');
12
12
  var react = require('react');
13
13
  var lucideReact = require('lucide-react');
@@ -2,10 +2,10 @@
2
2
  import { CollapsibleSection, KeyValueRow } from '../chunk-LGBAZD37.js';
3
3
  import { MemberAvatarStack } from '../chunk-XNOASBGW.js';
4
4
  import { ActionLink } from '../chunk-S7PSMMRG.js';
5
- export { RoleBadge, WorkspaceTypeBadgeView } from '../chunk-NBV56SGU.js';
6
- import { ModalHeader } from '../chunk-TX2ZICS7.js';
7
5
  import '../chunk-76JDDMSP.js';
8
6
  import { fromNow, fmtDate } from '../chunk-OXF2IFXG.js';
7
+ export { RoleBadge, WorkspaceTypeBadgeView } from '../chunk-NBV56SGU.js';
8
+ import { ModalHeader } from '../chunk-TX2ZICS7.js';
9
9
  import '../chunk-VUNV25KB.js';
10
10
  import { createContext, useContext, useMemo, useState, useCallback, useId } from 'react';
11
11
  import { FileText, MessagesSquare, Users, Check, ChevronRight, UserPlus, LogOut, AlertCircle, Plus, ArrowUpRight, AlignLeft, Globe, CreditCard, Loader2, FolderLock } from 'lucide-react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbidocs/blocks",
3
- "version": "0.4.87",
3
+ "version": "0.4.88",
4
4
  "description": "Composable, domain-neutral UI blocks for ARBI apps, organised by capability (retrieval, facts, agents, workspaces, citations, collaboration) plus shell, theme and site primitives, on top of @arbidocs/react.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -266,8 +266,8 @@
266
266
  "example:test:e2e": "playwright test -c examples/custom-ui/playwright.config.ts"
267
267
  },
268
268
  "dependencies": {
269
- "@arbidocs/client": "0.4.87",
270
- "@arbidocs/coedit": "0.4.87",
269
+ "@arbidocs/client": "0.4.88",
270
+ "@arbidocs/coedit": "0.4.88",
271
271
  "@dnd-kit/core": "^6.3.1",
272
272
  "@dnd-kit/sortable": "^10.0.0",
273
273
  "@dnd-kit/utilities": "^3.2.2",
@@ -293,7 +293,7 @@
293
293
  "zustand": "^5.0.14"
294
294
  },
295
295
  "peerDependencies": {
296
- "@arbidocs/react": "0.4.87",
296
+ "@arbidocs/react": "0.4.88",
297
297
  "@docx-editor.dev/core": "2.28.0",
298
298
  "@docx-editor.dev/react": "2.28.0",
299
299
  "@lexical/html": "0.35.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shell/FilterInput.tsx"],"names":["jsx","cn","testIdOr","jsxs","Filter","Input","X","Popover","PopoverTrigger","SlidersHorizontal","PopoverContent","Command","CommandList","CommandGroup","CommandItem","Check"],"mappings":";;;;;;;AAkBO,IAAM,qBAAA,GAAiE;AAAA,EAC5E,EAAE,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAO;AAAA,EAC/B,EAAE,KAAA,EAAO,QAAA,EAAU,KAAA,EAAO,QAAA;AAC5B;AAWO,IAAM,2BAAA,GAAiD;AAAA,EAC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M,SAAA,EAAU,QAAA,EAAS;AAAA;AAAA,mBAC5B;AAAA,kBACC,MAAA,EAAQ,UAAA,GAAa,MAAA,CAAO,KAAK,KAAK,MAAA,CAAO;AAAA;AAAA,eAAA;AAAA,cAjBzC,MAAA,CAAO;AAAA,aAkBd;AAAA,UAEJ,CAAC,CAAA,EACH,CAAA,EACF,CAAA,EACF,CAAA,EACF;AAAA,SAAA,EACF;AAAA,OAAA,EAEJ;AAAA;AAAA,GACF;AAEJ","file":"chunk-2EI7NCUA.cjs","sourcesContent":["/** Shared page filter with configurable searchable fields and optional quick-filter control. */\nimport type { ReactNode } from 'react'\nimport { X, Filter, SlidersHorizontal, Check } from 'lucide-react'\nimport {\n Command,\n CommandGroup,\n CommandItem,\n CommandList,\n Input,\n Popover,\n PopoverContent,\n PopoverTrigger,\n cn,\n} from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\nexport type FilterField = 'text' | 'labels'\n\nexport const DEFAULT_FILTER_FIELDS: { value: FilterField; label: string }[] = [\n { value: 'text', label: 'Text' },\n { value: 'labels', label: 'Labels' },\n]\n\nexport interface FilterInputLabels<Field extends string = FilterField> {\n placeholder: string\n clear: string\n chooseFields: string\n fieldsHeading: string\n /** Display name per searchable field. */\n fieldNames: Partial<Record<Field, string>>\n}\n\nexport const DEFAULT_FILTER_INPUT_LABELS: FilterInputLabels = {\n placeholder: 'Filter...',\n clear: 'Clear filter',\n chooseFields: 'Choose fields to filter',\n fieldsHeading: 'Filter fields',\n fieldNames: { text: 'Text', labels: 'Labels' },\n}\n\nexport interface FilterInputTestIds<Field extends string = FilterField> {\n root: string\n quick: string\n input: string\n fieldsButton: string\n field: (field: Field) => string\n}\n\nexport interface FilterInputProps<Field extends string = FilterField> {\n fieldOptions?: { value: Field; label: string }[]\n value: string\n /** Lists with one searchable field need no field selector. */\n hideFieldPicker?: boolean\n ariaLabel?: string\n onChange: (q: string) => void\n fields: Field[]\n onFieldsChange: (fields: Field[]) => void\n /**\n * The quick-filter dropdown trigger, embedded inside the input on the left\n * (mirroring the Files search box). When absent, a static funnel icon shows.\n */\n filter?: ReactNode\n /** Width classes for the box (default `w-44`). */\n className?: string\n /** No outline: a soft fill instead of the input border, for a header that is already ruled. */\n borderless?: boolean\n labels?: Partial<FilterInputLabels<Field>>\n testIds?: Partial<FilterInputTestIds<Field>>\n}\n\nexport function FilterInput<Field extends string = FilterField>({\n fieldOptions,\n value,\n hideFieldPicker = false,\n ariaLabel,\n onChange,\n fields,\n onFieldsChange,\n filter,\n className,\n borderless = false,\n labels,\n testIds,\n}: FilterInputProps<Field>) {\n const l = { ...DEFAULT_FILTER_INPUT_LABELS, ...labels }\n const options = fieldOptions ?? (DEFAULT_FILTER_FIELDS as { value: Field; label: string }[])\n const toggleField = (field: Field) =>\n onFieldsChange(fields.includes(field) ? fields.filter((f) => f !== field) : [...fields, field])\n\n return (\n <div\n className={cn('flex min-w-0 items-center', className ?? 'w-44 pointer-coarse:w-56')}\n data-testid={testIdOr(testIds?.root, { testId: 'facts-filter' })}\n >\n <div className=\"relative flex-1 min-w-0\">\n {filter ? (\n <div\n className=\"absolute left-1 top-1/2 z-10 -translate-y-1/2\"\n data-testid={testIdOr(testIds?.quick, { testId: 'facts-filter-quick' })}\n >\n {filter}\n </div>\n ) : (\n <Filter className=\"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground\" />\n )}\n <Input\n aria-label={ariaLabel}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n placeholder={l.placeholder}\n data-testid={testIdOr(testIds?.input, { testId: 'facts-filter-input' })}\n className={cn(\n 'h-7 pr-12 text-sm shadow-none focus-visible:ring-0 pointer-coarse:h-11 pointer-coarse:pr-12',\n // Touch: the 44px clear button only needs its room while there is text to clear, so\n // an empty field keeps space for its placeholder on a phone.\n value && 'pointer-coarse:pr-24',\n borderless\n ? 'border-transparent bg-muted/50 hover:bg-muted focus-visible:bg-muted'\n : 'border-input bg-background',\n filter ? 'pl-11' : 'pl-7',\n hideFieldPicker && 'pr-7 pointer-coarse:pr-11'\n )}\n />\n {value && (\n <button\n type=\"button\"\n onClick={() => onChange('')}\n aria-label={l.clear}\n className={cn(\n 'absolute top-1/2 z-10 -translate-y-1/2 text-muted-foreground hover:text-foreground pointer-coarse:flex pointer-coarse:size-11 pointer-coarse:items-center pointer-coarse:justify-center',\n hideFieldPicker\n ? 'right-1.5 pointer-coarse:right-0'\n : 'right-7 pointer-coarse:right-11'\n )}\n >\n <X className=\"size-3\" />\n </button>\n )}\n {/* Field picker — inside the input on the right, muted, exactly as the\n Files search box renders it. */}\n {!hideFieldPicker && (\n <Popover>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-label={l.chooseFields}\n data-testid={testIdOr(testIds?.fieldsButton, {\n testId: 'facts-filter-fields-button',\n })}\n className=\"absolute right-1.5 top-1/2 z-10 -translate-y-1/2 !h-5 !w-5 !p-0 text-muted-foreground/60 transition-colors hover:text-foreground pointer-coarse:right-0 pointer-coarse:!flex pointer-coarse:!h-11 pointer-coarse:!w-11 pointer-coarse:items-center pointer-coarse:justify-center\"\n >\n <SlidersHorizontal className=\"size-3.5\" />\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-44 p-0\" align=\"end\" sideOffset={4}>\n <Command shouldFilter={false}>\n <CommandList>\n <CommandGroup heading={l.fieldsHeading}>\n {options.map((option) => {\n const isSelected = fields.includes(option.value)\n return (\n <CommandItem\n key={option.value}\n onSelect={() => toggleField(option.value)}\n className=\"cursor-pointer text-sm\"\n data-testid={testIdOr(testIds?.field?.(option.value), {\n testId: `facts-filter-field-${option.value}`,\n })}\n >\n <div\n className={cn(\n 'mr-2 flex size-3.5 items-center justify-center rounded-sm border border-primary',\n isSelected\n ? 'bg-primary text-primary-foreground'\n : 'opacity-50 [&_svg]:invisible'\n )}\n >\n <Check className=\"size-3\" />\n </div>\n {labels?.fieldNames?.[option.value] ?? option.label}\n </CommandItem>\n )\n })}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )}\n </div>\n </div>\n )\n}\n"]}