@uipath/apollo-wind 2.67.1 → 2.69.0

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 (54) hide show
  1. package/dist/components/forms/metadata-form.cjs +40 -44
  2. package/dist/components/forms/metadata-form.js +40 -44
  3. package/dist/components/ui/code-block.cjs +375 -0
  4. package/dist/components/ui/code-block.d.ts +38 -0
  5. package/dist/components/ui/code-block.js +307 -0
  6. package/dist/components/ui/index.cjs +268 -191
  7. package/dist/components/ui/index.d.ts +7 -0
  8. package/dist/components/ui/index.js +7 -0
  9. package/dist/components/ui/json-tree-view/JsonTree.cjs +2 -2
  10. package/dist/components/ui/json-tree-view/JsonTree.js +1 -1
  11. package/dist/components/ui/json-tree-view/JsonTree.types.d.ts +26 -0
  12. package/dist/components/ui/json-tree-view/JsonTreeRow.cjs +13 -10
  13. package/dist/components/ui/json-tree-view/JsonTreeRow.js +14 -11
  14. package/dist/components/ui/json-tree-view/JsonTreeToolbar.cjs +22 -11
  15. package/dist/components/ui/json-tree-view/JsonTreeToolbar.d.ts +6 -1
  16. package/dist/components/ui/json-tree-view/JsonTreeToolbar.js +22 -11
  17. package/dist/components/ui/json-tree-view/NodeKey.cjs +4 -0
  18. package/dist/components/ui/json-tree-view/NodeKey.js +4 -0
  19. package/dist/components/ui/json-tree-view/RowActions.cjs +23 -17
  20. package/dist/components/ui/json-tree-view/RowActions.d.ts +4 -1
  21. package/dist/components/ui/json-tree-view/RowActions.js +23 -17
  22. package/dist/components/ui/json-tree-view/buildJsonTree.cjs +99 -44
  23. package/dist/components/ui/json-tree-view/buildJsonTree.d.ts +15 -2
  24. package/dist/components/ui/json-tree-view/buildJsonTree.js +97 -45
  25. package/dist/components/ui/json-tree-view/index.cjs +26 -23
  26. package/dist/components/ui/json-tree-view/index.d.ts +2 -2
  27. package/dist/components/ui/json-tree-view/index.js +2 -2
  28. package/dist/components/ui/live-region.cjs +106 -0
  29. package/dist/components/ui/live-region.d.ts +31 -0
  30. package/dist/components/ui/live-region.js +72 -0
  31. package/dist/components/ui/loading-dots.cjs +95 -0
  32. package/dist/components/ui/loading-dots.d.ts +21 -0
  33. package/dist/components/ui/loading-dots.js +55 -0
  34. package/dist/components/ui/markdown.cjs +428 -0
  35. package/dist/components/ui/markdown.d.ts +55 -0
  36. package/dist/components/ui/markdown.js +378 -0
  37. package/dist/components/ui/panel-tabs.cjs +99 -0
  38. package/dist/components/ui/panel-tabs.d.ts +34 -0
  39. package/dist/components/ui/panel-tabs.js +53 -0
  40. package/dist/components/ui/thinking-indicator.cjs +146 -0
  41. package/dist/components/ui/thinking-indicator.d.ts +38 -0
  42. package/dist/components/ui/thinking-indicator.js +106 -0
  43. package/dist/components/ui/tool-call.cjs +359 -0
  44. package/dist/components/ui/tool-call.d.ts +75 -0
  45. package/dist/components/ui/tool-call.js +301 -0
  46. package/dist/index.cjs +334 -246
  47. package/dist/index.d.ts +15 -1
  48. package/dist/index.js +9 -2
  49. package/dist/styles.css +239 -0
  50. package/dist/tailwind.utilities.css +21 -0
  51. package/package.json +7 -1
  52. /package/dist/{components/ui/json-tree-view → lib}/clipboard.cjs +0 -0
  53. /package/dist/{components/ui/json-tree-view → lib}/clipboard.d.ts +0 -0
  54. /package/dist/{components/ui/json-tree-view → lib}/clipboard.js +0 -0
@@ -14,6 +14,7 @@ export * from './calendar';
14
14
  export * from './card';
15
15
  export * from './chart';
16
16
  export * from './checkbox';
17
+ export * from './code-block';
17
18
  export * from './collapsible';
18
19
  export * from './combobox';
19
20
  export * from './command';
@@ -37,7 +38,10 @@ export * from './input-group';
37
38
  export * from './json-tree-view';
38
39
  export * from './label';
39
40
  export * from './layout';
41
+ export * from './live-region';
42
+ export * from './loading-dots';
40
43
  export * from './lockable-value-field';
44
+ export * from './markdown';
41
45
  export * from './marker';
42
46
  export * from './message';
43
47
  export * from './message-scroller';
@@ -66,10 +70,13 @@ export * from './stats-card';
66
70
  export * from './stepper';
67
71
  export * from './switch';
68
72
  export * from './table';
73
+ export * from './panel-tabs';
69
74
  export * from './tabs';
70
75
  export * from './textarea';
76
+ export * from './thinking-indicator';
71
77
  export * from './toggle';
72
78
  export * from './toggle-group';
79
+ export * from './tool-call';
73
80
  export * from './tooltip';
74
81
  export type { FileTreeViewIconMap, FileTreeViewItem, FileTreeViewItemAction, FileTreeViewMenuItem, FileTreeViewProps, FileTreeViewSelectionMode, TreeViewIconMap, TreeViewItem, TreeViewItemAction, TreeViewMenuItem, TreeViewProps, TreeViewSelectionMode, } from './tree-view';
75
82
  export { default as FileTreeView, TreeView } from './tree-view';
@@ -15,6 +15,7 @@ export * from "./calendar.js";
15
15
  export * from "./card.js";
16
16
  export * from "./chart.js";
17
17
  export * from "./checkbox.js";
18
+ export * from "./code-block.js";
18
19
  export * from "./collapsible.js";
19
20
  export * from "./combobox.js";
20
21
  export * from "./command.js";
@@ -38,7 +39,10 @@ export * from "./input-group.js";
38
39
  export * from "./json-tree-view/index.js";
39
40
  export * from "./label.js";
40
41
  export * from "./layout/index.js";
42
+ export * from "./live-region.js";
43
+ export * from "./loading-dots.js";
41
44
  export * from "./lockable-value-field/index.js";
45
+ export * from "./markdown.js";
42
46
  export * from "./marker.js";
43
47
  export * from "./message.js";
44
48
  export * from "./message-scroller/index.js";
@@ -67,10 +71,13 @@ export * from "./stats-card.js";
67
71
  export * from "./stepper.js";
68
72
  export * from "./switch.js";
69
73
  export * from "./table.js";
74
+ export * from "./panel-tabs.js";
70
75
  export * from "./tabs.js";
71
76
  export * from "./textarea.js";
77
+ export * from "./thinking-indicator.js";
72
78
  export * from "./toggle.js";
73
79
  export * from "./toggle-group.js";
80
+ export * from "./tool-call.js";
74
81
  export * from "./tooltip.js";
75
82
  export * from "./variable-picker/index.js";
76
83
  export * from "./variable-value-control.js";
@@ -30,8 +30,8 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const react_virtual_namespaceObject = require("@tanstack/react-virtual");
31
31
  const external_react_namespaceObject = require("react");
32
32
  const index_cjs_namespaceObject = require("../../../lib/index.cjs");
33
+ const clipboard_cjs_namespaceObject = require("../../../lib/clipboard.cjs");
33
34
  const external_buildJsonTree_cjs_namespaceObject = require("./buildJsonTree.cjs");
34
- const external_clipboard_cjs_namespaceObject = require("./clipboard.cjs");
35
35
  const external_JsonTreeRow_cjs_namespaceObject = require("./JsonTreeRow.cjs");
36
36
  const external_JsonTreeTooltip_cjs_namespaceObject = require("./JsonTreeTooltip.cjs");
37
37
  const external_strings_cjs_namespaceObject = require("./strings.cjs");
@@ -153,7 +153,7 @@ function JsonTreeViewContent({ nodes, collapsed = {}, onToggleCollapsed, query,
153
153
  if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
154
154
  }, []);
155
155
  const copy = (node, kind, text)=>{
156
- (0, external_clipboard_cjs_namespaceObject.copyTextToClipboard)(text).then((ok)=>{
156
+ (0, clipboard_cjs_namespaceObject.copyTextToClipboard)(text).then((ok)=>{
157
157
  if (!ok) return;
158
158
  setCopied({
159
159
  path: node.path,
@@ -2,8 +2,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useVirtualizer } from "@tanstack/react-virtual";
3
3
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
4
4
  import { cn } from "../../../lib/index.js";
5
+ import { copyTextToClipboard } from "../../../lib/clipboard.js";
5
6
  import { flattenJsonTree } from "./buildJsonTree.js";
6
- import { copyTextToClipboard } from "./clipboard.js";
7
7
  import { JsonTreeRow, JsonTreeRowContextProvider, ROW_MIN_HEIGHT_PX } from "./JsonTreeRow.js";
8
8
  import { JsonTreeTooltipProvider } from "./JsonTreeTooltip.js";
9
9
  import { JsonTreeViewProvider, useJsonTreeViewStrings } from "./strings.js";
@@ -127,6 +127,11 @@ export interface NodeDecoration {
127
127
  label?: string;
128
128
  /** Small muted text after the key label (e.g. an identifier). */
129
129
  sublabel?: string;
130
+ /**
131
+ * Shows the sublabel only while the row is hovered or holds focus. It sits
132
+ * in the row's flexible space, so revealing it never moves the trailing cluster.
133
+ */
134
+ sublabelOnHover?: boolean;
130
135
  /** Replaces the type badge's icon and/or color. */
131
136
  badge?: NodeDecorationBadge;
132
137
  /** Small pill rendered next to the key (e.g. "mocked"). */
@@ -135,6 +140,17 @@ export interface NodeDecoration {
135
140
  * Hides the built-in keys/items count on a container row.
136
141
  */
137
142
  hideCount?: boolean;
143
+ /**
144
+ * Hides the value cell on a scalar row, for a row that names something
145
+ * (e.g. a node with no output yet) rather than holding a value.
146
+ */
147
+ hideValue?: boolean;
148
+ /**
149
+ * Content in the row's trailing cluster, between the `start` and `end`
150
+ * actions (e.g. a count). The cluster never shrinks, so it stays in place
151
+ * while the key and sublabel truncate.
152
+ */
153
+ meta?: ReactNode;
138
154
  }
139
155
  /** Context passed to a custom value cell renderer. */
140
156
  export interface RenderValueContext {
@@ -176,6 +192,16 @@ export interface NodeAction {
176
192
  disabled?: boolean;
177
193
  /** Color tone; `error` tints a destructive action. Defaults to neutral. */
178
194
  tone?: NodeDecorationTone;
195
+ /**
196
+ * Keeps the action visible at rest instead of revealing it on row hover.
197
+ * For a row's primary action. Ignored once actions collapse into the menu.
198
+ */
199
+ persistent?: boolean;
200
+ /**
201
+ * Where the action sits in the row's trailing cluster: `start` renders it
202
+ * before the decoration `meta`, `end` (the default) after it.
203
+ */
204
+ placement?: 'start' | 'end';
179
205
  }
180
206
  /** Context passed to `nodeActions`, mirroring the value-cell edit context. */
181
207
  export interface NodeActionContext {
@@ -42,12 +42,12 @@ const external_JsonTypeBadge_cjs_namespaceObject = require("./JsonTypeBadge.cjs"
42
42
  const external_NodeKey_cjs_namespaceObject = require("./NodeKey.cjs");
43
43
  const external_RowActions_cjs_namespaceObject = require("./RowActions.cjs");
44
44
  const external_ScalarValueCell_cjs_namespaceObject = require("./ScalarValueCell.cjs");
45
- const ROW_CLASS = 'group flex min-h-7 cursor-default items-center gap-1.5 py-1 pr-1 transition hover:bg-surface-overlay';
45
+ const ROW_CLASS = 'group flex min-h-7 cursor-default items-center gap-2 py-1 pr-1 transition hover:bg-surface-overlay';
46
46
  const ROW_MIN_HEIGHT_PX = 28;
47
47
  const VALUE_CELL_CLASS = 'flex min-w-8 flex-1 items-center';
48
48
  function rowIndent(depth, extra = 0) {
49
49
  return {
50
- paddingLeft: `${6 + 12 * depth + extra}px`
50
+ paddingLeft: `${8 + 16 * depth + extra}px`
51
51
  };
52
52
  }
53
53
  const KEY_ALIGN_OFFSET = 44;
@@ -138,12 +138,13 @@ function JsonTreeRow({ node, depth }) {
138
138
  isContainer ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
139
139
  type: "button",
140
140
  onClick: ()=>onToggleCollapsed?.(node.path),
141
- "aria-label": collapsed[node.path] ? strings.expandKey(node.key) : strings.collapseKey(node.key),
142
- "aria-expanded": !collapsed[node.path],
143
- className: "grid size-2.5 shrink-0 cursor-pointer place-items-center text-foreground-subtle transition hover:text-foreground",
141
+ disabled: !onToggleCollapsed,
142
+ "aria-label": (0, external_buildJsonTree_cjs_namespaceObject.isPathCollapsed)(collapsed, node.path) ? strings.expandKey(node.key) : strings.collapseKey(node.key),
143
+ "aria-expanded": !(0, external_buildJsonTree_cjs_namespaceObject.isPathCollapsed)(collapsed, node.path),
144
+ className: "grid size-2.5 shrink-0 cursor-pointer place-items-center text-foreground-subtle transition hover:text-foreground disabled:cursor-default disabled:hover:text-foreground-subtle",
144
145
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
145
146
  size: 10,
146
- className: (0, index_cjs_namespaceObject.cn)('transition-transform duration-100', collapsed[node.path] && '-rotate-90')
147
+ className: (0, index_cjs_namespaceObject.cn)('transition-transform duration-100', (0, external_buildJsonTree_cjs_namespaceObject.isPathCollapsed)(collapsed, node.path) && '-rotate-90')
147
148
  })
148
149
  }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
149
150
  className: "size-2.5 shrink-0"
@@ -168,7 +169,7 @@ function JsonTreeRow({ node, depth }) {
168
169
  "aria-label": strings.pathCopied
169
170
  }),
170
171
  decoration?.sublabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
171
- className: "min-w-0 truncate font-mono text-[10px] text-foreground-subtle leading-4",
172
+ className: (0, index_cjs_namespaceObject.cn)('min-w-0 truncate font-mono text-[10px] text-foreground-subtle leading-4', decoration.sublabelOnHover && 'hidden group-hover:block group-focus-within:block'),
172
173
  children: decoration.sublabel
173
174
  }),
174
175
  node.required && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_label_cjs_namespaceObject.RequiredIndicator, {
@@ -191,12 +192,13 @@ function JsonTreeRow({ node, depth }) {
191
192
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_RowActions_cjs_namespaceObject.RowActions, {
192
193
  node: node,
193
194
  actions: actions,
194
- maxInline: maxInlineActions
195
+ maxInline: maxInlineActions,
196
+ meta: decoration?.meta
195
197
  })
196
198
  ]
197
199
  }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
198
200
  children: [
199
- !wrapped && (null != customCell ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
201
+ !wrapped && !decoration?.hideValue && (null != customCell ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
200
202
  className: VALUE_CELL_CLASS,
201
203
  children: customCell
202
204
  }) : !(readOnly && void 0 === node.value || isTemplate) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
@@ -226,7 +228,8 @@ function JsonTreeRow({ node, depth }) {
226
228
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_RowActions_cjs_namespaceObject.RowActions, {
227
229
  node: node,
228
230
  actions: actions,
229
- maxInline: maxInlineActions
231
+ maxInline: maxInlineActions,
232
+ meta: decoration?.meta
230
233
  })
231
234
  ]
232
235
  })
@@ -4,7 +4,7 @@ import { RequiredIndicator } from "../label.js";
4
4
  import { ChevronDown, CircleCheck, Copy, Pencil, WrapText } from "lucide-react";
5
5
  import { createContext, useContext } from "react";
6
6
  import { useJsonTreeViewStrings } from "./strings.js";
7
- import { formatLeafValue, isArrayItemTemplateRoot } from "./buildJsonTree.js";
7
+ import { formatLeafValue, isArrayItemTemplateRoot, isPathCollapsed } from "./buildJsonTree.js";
8
8
  import { DecorationChip } from "./DecorationChip.js";
9
9
  import { JsonContainerEditor } from "./JsonContainerEditor.js";
10
10
  import { JsonMultilineLeafEditor } from "./JsonMultilineLeafEditor.js";
@@ -12,12 +12,12 @@ import { JsonTypeBadge } from "./JsonTypeBadge.js";
12
12
  import { NodeKey } from "./NodeKey.js";
13
13
  import { RowActions } from "./RowActions.js";
14
14
  import { ScalarValueCell, valueColorClass } from "./ScalarValueCell.js";
15
- const ROW_CLASS = 'group flex min-h-7 cursor-default items-center gap-1.5 py-1 pr-1 transition hover:bg-surface-overlay';
15
+ const ROW_CLASS = 'group flex min-h-7 cursor-default items-center gap-2 py-1 pr-1 transition hover:bg-surface-overlay';
16
16
  const ROW_MIN_HEIGHT_PX = 28;
17
17
  const VALUE_CELL_CLASS = 'flex min-w-8 flex-1 items-center';
18
18
  function rowIndent(depth, extra = 0) {
19
19
  return {
20
- paddingLeft: `${6 + 12 * depth + extra}px`
20
+ paddingLeft: `${8 + 16 * depth + extra}px`
21
21
  };
22
22
  }
23
23
  const KEY_ALIGN_OFFSET = 44;
@@ -108,12 +108,13 @@ function JsonTreeRow({ node, depth }) {
108
108
  isContainer ? /*#__PURE__*/ jsx("button", {
109
109
  type: "button",
110
110
  onClick: ()=>onToggleCollapsed?.(node.path),
111
- "aria-label": collapsed[node.path] ? strings.expandKey(node.key) : strings.collapseKey(node.key),
112
- "aria-expanded": !collapsed[node.path],
113
- className: "grid size-2.5 shrink-0 cursor-pointer place-items-center text-foreground-subtle transition hover:text-foreground",
111
+ disabled: !onToggleCollapsed,
112
+ "aria-label": isPathCollapsed(collapsed, node.path) ? strings.expandKey(node.key) : strings.collapseKey(node.key),
113
+ "aria-expanded": !isPathCollapsed(collapsed, node.path),
114
+ className: "grid size-2.5 shrink-0 cursor-pointer place-items-center text-foreground-subtle transition hover:text-foreground disabled:cursor-default disabled:hover:text-foreground-subtle",
114
115
  children: /*#__PURE__*/ jsx(ChevronDown, {
115
116
  size: 10,
116
- className: cn('transition-transform duration-100', collapsed[node.path] && '-rotate-90')
117
+ className: cn('transition-transform duration-100', isPathCollapsed(collapsed, node.path) && '-rotate-90')
117
118
  })
118
119
  }) : /*#__PURE__*/ jsx("div", {
119
120
  className: "size-2.5 shrink-0"
@@ -138,7 +139,7 @@ function JsonTreeRow({ node, depth }) {
138
139
  "aria-label": strings.pathCopied
139
140
  }),
140
141
  decoration?.sublabel && /*#__PURE__*/ jsx("span", {
141
- className: "min-w-0 truncate font-mono text-[10px] text-foreground-subtle leading-4",
142
+ className: cn('min-w-0 truncate font-mono text-[10px] text-foreground-subtle leading-4', decoration.sublabelOnHover && 'hidden group-hover:block group-focus-within:block'),
142
143
  children: decoration.sublabel
143
144
  }),
144
145
  node.required && /*#__PURE__*/ jsx(RequiredIndicator, {
@@ -161,12 +162,13 @@ function JsonTreeRow({ node, depth }) {
161
162
  /*#__PURE__*/ jsx(RowActions, {
162
163
  node: node,
163
164
  actions: actions,
164
- maxInline: maxInlineActions
165
+ maxInline: maxInlineActions,
166
+ meta: decoration?.meta
165
167
  })
166
168
  ]
167
169
  }) : /*#__PURE__*/ jsxs(Fragment, {
168
170
  children: [
169
- !wrapped && (null != customCell ? /*#__PURE__*/ jsx("span", {
171
+ !wrapped && !decoration?.hideValue && (null != customCell ? /*#__PURE__*/ jsx("span", {
170
172
  className: VALUE_CELL_CLASS,
171
173
  children: customCell
172
174
  }) : !(readOnly && void 0 === node.value || isTemplate) && /*#__PURE__*/ jsxs(Fragment, {
@@ -196,7 +198,8 @@ function JsonTreeRow({ node, depth }) {
196
198
  /*#__PURE__*/ jsx(RowActions, {
197
199
  node: node,
198
200
  actions: actions,
199
- maxInline: maxInlineActions
201
+ maxInline: maxInlineActions,
202
+ meta: decoration?.meta
200
203
  })
201
204
  ]
202
205
  })
@@ -45,7 +45,7 @@ function JsonTreeToolbar({ strings, tooltipContentClassName, ...props }) {
45
45
  })
46
46
  });
47
47
  }
48
- function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filters, activeFilterId = null, onFilterChange, allCollapsed = false, onToggleAll, leading, controlsHidden = false, className }) {
48
+ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filters, activeFilterId = null, onFilterChange, allCollapsed = false, onToggleAll, leading, trailing, controlsHidden = false, className }) {
49
49
  const strings = (0, external_strings_cjs_namespaceObject.useJsonTreeViewStrings)();
50
50
  const [searchOpen, setSearchOpen] = (0, external_react_namespaceObject.useState)(false);
51
51
  const activeFilter = filters?.find((f)=>f.id === activeFilterId);
@@ -67,7 +67,7 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
67
67
  className: "relative flex min-w-0 flex-1 items-center overflow-hidden",
68
68
  children: [
69
69
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Search, {
70
- size: 13,
70
+ size: 12,
71
71
  className: "pointer-events-none absolute left-2 text-foreground-subtle"
72
72
  }),
73
73
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_cjs_namespaceObject.Input, {
@@ -78,7 +78,10 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
78
78
  value: query,
79
79
  onChange: (e)=>onQueryChange(e.target.value),
80
80
  onKeyDown: (e)=>{
81
- if ('Escape' === e.key) closeSearch();
81
+ if ('Escape' !== e.key) return;
82
+ e.preventDefault();
83
+ e.stopPropagation();
84
+ closeSearch();
82
85
  },
83
86
  "aria-label": resolvedSearchPlaceholder,
84
87
  placeholder: resolvedSearchPlaceholder,
@@ -86,7 +89,7 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
86
89
  paddingLeft: '1.75rem',
87
90
  paddingRight: '1.5rem'
88
91
  },
89
- className: "h-6 w-full text-foreground placeholder:text-foreground-subtle focus-visible:ring-0"
92
+ className: "h-5 w-full text-foreground placeholder:text-foreground-subtle focus-visible:ring-0"
90
93
  }),
91
94
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
92
95
  type: "button",
@@ -109,13 +112,13 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
109
112
  delay: true,
110
113
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
111
114
  variant: "ghost",
112
- size: "3xs",
115
+ size: "4xs",
113
116
  icon: true,
114
117
  onClick: ()=>setSearchOpen(true),
115
118
  "aria-label": searchActionLabel,
116
119
  className: "rounded text-foreground-subtle hover:bg-surface-overlay hover:text-foreground",
117
120
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Search, {
118
- size: 14
121
+ size: 12
119
122
  })
120
123
  })
121
124
  })
@@ -131,13 +134,13 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
131
134
  asChild: true,
132
135
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button, {
133
136
  variant: "ghost",
134
- size: "3xs",
137
+ size: "4xs",
135
138
  icon: true,
136
139
  "aria-label": filterLabel,
137
140
  className: "relative rounded text-foreground-subtle hover:bg-surface-overlay hover:text-foreground",
138
141
  children: [
139
142
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Filter, {
140
- size: 14
143
+ size: 12
141
144
  }),
142
145
  activeFilter && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
143
146
  className: "absolute right-0.5 top-0.5 size-1.5 rounded-full bg-primary ring-1 ring-surface"
@@ -183,19 +186,27 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
183
186
  delay: true,
184
187
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
185
188
  variant: "ghost",
186
- size: "3xs",
189
+ size: "4xs",
187
190
  icon: true,
188
191
  onClick: onToggleAll,
189
192
  "aria-label": toggleAllLabel,
190
193
  className: "rounded text-foreground-subtle hover:bg-surface-overlay hover:text-foreground",
191
194
  children: allCollapsed ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronsUpDown, {
192
- size: 14
195
+ size: 12
193
196
  }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronsDownUp, {
194
- size: 14
197
+ size: 12
195
198
  })
196
199
  })
197
200
  })
198
201
  ]
202
+ }),
203
+ trailing && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
204
+ children: [
205
+ controlsHidden && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
206
+ className: "flex-1"
207
+ }),
208
+ trailing
209
+ ]
199
210
  })
200
211
  ]
201
212
  });
@@ -21,7 +21,12 @@ export interface JsonTreeToolbarProps {
21
21
  */
22
22
  leading?: ReactNode;
23
23
  /**
24
- * Hides the search / filter / collapse controls, keeping only `leading`.
24
+ * Content rendered at the end of the row, after the tree controls (e.g. a
25
+ * node output mode select). Stays visible when `controlsHidden` is set.
26
+ */
27
+ trailing?: ReactNode;
28
+ /**
29
+ * Hides the search / filter / collapse controls, keeping only `leading` and `trailing`.
25
30
  * Use when a non-tree tab is active and the controls would be inert.
26
31
  */
27
32
  controlsHidden?: boolean;
@@ -17,7 +17,7 @@ function JsonTreeToolbar({ strings, tooltipContentClassName, ...props }) {
17
17
  })
18
18
  });
19
19
  }
20
- function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filters, activeFilterId = null, onFilterChange, allCollapsed = false, onToggleAll, leading, controlsHidden = false, className }) {
20
+ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filters, activeFilterId = null, onFilterChange, allCollapsed = false, onToggleAll, leading, trailing, controlsHidden = false, className }) {
21
21
  const strings = useJsonTreeViewStrings();
22
22
  const [searchOpen, setSearchOpen] = useState(false);
23
23
  const activeFilter = filters?.find((f)=>f.id === activeFilterId);
@@ -39,7 +39,7 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
39
39
  className: "relative flex min-w-0 flex-1 items-center overflow-hidden",
40
40
  children: [
41
41
  /*#__PURE__*/ jsx(Search, {
42
- size: 13,
42
+ size: 12,
43
43
  className: "pointer-events-none absolute left-2 text-foreground-subtle"
44
44
  }),
45
45
  /*#__PURE__*/ jsx(Input, {
@@ -50,7 +50,10 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
50
50
  value: query,
51
51
  onChange: (e)=>onQueryChange(e.target.value),
52
52
  onKeyDown: (e)=>{
53
- if ('Escape' === e.key) closeSearch();
53
+ if ('Escape' !== e.key) return;
54
+ e.preventDefault();
55
+ e.stopPropagation();
56
+ closeSearch();
54
57
  },
55
58
  "aria-label": resolvedSearchPlaceholder,
56
59
  placeholder: resolvedSearchPlaceholder,
@@ -58,7 +61,7 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
58
61
  paddingLeft: '1.75rem',
59
62
  paddingRight: '1.5rem'
60
63
  },
61
- className: "h-6 w-full text-foreground placeholder:text-foreground-subtle focus-visible:ring-0"
64
+ className: "h-5 w-full text-foreground placeholder:text-foreground-subtle focus-visible:ring-0"
62
65
  }),
63
66
  /*#__PURE__*/ jsx("button", {
64
67
  type: "button",
@@ -81,13 +84,13 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
81
84
  delay: true,
82
85
  children: /*#__PURE__*/ jsx(Button, {
83
86
  variant: "ghost",
84
- size: "3xs",
87
+ size: "4xs",
85
88
  icon: true,
86
89
  onClick: ()=>setSearchOpen(true),
87
90
  "aria-label": searchActionLabel,
88
91
  className: "rounded text-foreground-subtle hover:bg-surface-overlay hover:text-foreground",
89
92
  children: /*#__PURE__*/ jsx(Search, {
90
- size: 14
93
+ size: 12
91
94
  })
92
95
  })
93
96
  })
@@ -103,13 +106,13 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
103
106
  asChild: true,
104
107
  children: /*#__PURE__*/ jsxs(Button, {
105
108
  variant: "ghost",
106
- size: "3xs",
109
+ size: "4xs",
107
110
  icon: true,
108
111
  "aria-label": filterLabel,
109
112
  className: "relative rounded text-foreground-subtle hover:bg-surface-overlay hover:text-foreground",
110
113
  children: [
111
114
  /*#__PURE__*/ jsx(Filter, {
112
- size: 14
115
+ size: 12
113
116
  }),
114
117
  activeFilter && /*#__PURE__*/ jsx("span", {
115
118
  className: "absolute right-0.5 top-0.5 size-1.5 rounded-full bg-primary ring-1 ring-surface"
@@ -155,19 +158,27 @@ function JsonTreeToolbarContent({ query, onQueryChange, searchPlaceholder, filte
155
158
  delay: true,
156
159
  children: /*#__PURE__*/ jsx(Button, {
157
160
  variant: "ghost",
158
- size: "3xs",
161
+ size: "4xs",
159
162
  icon: true,
160
163
  onClick: onToggleAll,
161
164
  "aria-label": toggleAllLabel,
162
165
  className: "rounded text-foreground-subtle hover:bg-surface-overlay hover:text-foreground",
163
166
  children: allCollapsed ? /*#__PURE__*/ jsx(ChevronsUpDown, {
164
- size: 14
167
+ size: 12
165
168
  }) : /*#__PURE__*/ jsx(ChevronsDownUp, {
166
- size: 14
169
+ size: 12
167
170
  })
168
171
  })
169
172
  })
170
173
  ]
174
+ }),
175
+ trailing && /*#__PURE__*/ jsxs(Fragment, {
176
+ children: [
177
+ controlsHidden && /*#__PURE__*/ jsx("div", {
178
+ className: "flex-1"
179
+ }),
180
+ trailing
181
+ ]
171
182
  })
172
183
  ]
173
184
  });
@@ -45,6 +45,10 @@ function NodeKey({ node, label, displayPath, onCopyPath, className }) {
45
45
  content: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
46
46
  className: "flex max-w-60 flex-col gap-1",
47
47
  children: [
48
+ null != label && label !== node.key && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
49
+ className: "text-xs font-semibold leading-4",
50
+ children: label
51
+ }),
48
52
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
49
53
  className: "break-all font-mono text-xs font-semibold leading-4",
50
54
  children: copyPathText
@@ -17,6 +17,10 @@ function NodeKey({ node, label, displayPath, onCopyPath, className }) {
17
17
  content: /*#__PURE__*/ jsxs("div", {
18
18
  className: "flex max-w-60 flex-col gap-1",
19
19
  children: [
20
+ null != label && label !== node.key && /*#__PURE__*/ jsx("span", {
21
+ className: "text-xs font-semibold leading-4",
22
+ children: label
23
+ }),
20
24
  /*#__PURE__*/ jsx("span", {
21
25
  className: "break-all font-mono text-xs font-semibold leading-4",
22
26
  children: copyPathText
@@ -41,32 +41,38 @@ const ACTION_TONE_CLASS = {
41
41
  warning: 'text-warning hover:text-warning',
42
42
  error: 'text-error hover:text-error'
43
43
  };
44
- function RowActions({ node, actions, maxInline }) {
44
+ function RowActions({ node, actions, maxInline, meta }) {
45
45
  const strings = (0, external_strings_cjs_namespaceObject.useJsonTreeViewStrings)();
46
46
  const [menuOpen, setMenuOpen] = (0, external_react_namespaceObject.useState)(false);
47
- if (0 === actions.length) return null;
47
+ if (0 === actions.length && null == meta) return null;
48
48
  const overflowing = actions.length > maxInline;
49
49
  const inline = overflowing ? [] : actions;
50
50
  const overflow = overflowing ? actions : [];
51
51
  const moreLabel = strings.moreActions;
52
+ const renderInline = (action)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeTooltip_cjs_namespaceObject.JsonTreeTooltip, {
53
+ content: action.tooltip ?? action.label,
54
+ placement: "top",
55
+ delay: true,
56
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
57
+ variant: "ghost",
58
+ size: "4xs",
59
+ icon: true,
60
+ disabled: action.disabled,
61
+ onClick: ()=>action.onSelect(node),
62
+ "aria-label": action.label,
63
+ className: (0, index_cjs_namespaceObject.cn)(ACTION_BUTTON_CLASS, '[&_svg]:size-2.75', action.tone && ACTION_TONE_CLASS[action.tone], action.persistent && 'opacity-100', action.active && 'text-brand opacity-100 hover:text-brand'),
64
+ children: action.icon
65
+ })
66
+ }, action.id);
52
67
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
53
68
  className: "ml-auto flex shrink-0 items-center gap-0.5",
54
69
  children: [
55
- inline.map((action)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeTooltip_cjs_namespaceObject.JsonTreeTooltip, {
56
- content: action.tooltip ?? action.label,
57
- placement: "top",
58
- delay: true,
59
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
60
- variant: "ghost",
61
- size: "4xs",
62
- icon: true,
63
- disabled: action.disabled,
64
- onClick: ()=>action.onSelect(node),
65
- "aria-label": action.label,
66
- className: (0, index_cjs_namespaceObject.cn)(ACTION_BUTTON_CLASS, '[&_svg]:size-2.75', action.tone && ACTION_TONE_CLASS[action.tone], action.active && 'text-brand opacity-100 hover:text-brand'),
67
- children: action.icon
68
- })
69
- }, action.id)),
70
+ inline.filter((action)=>'start' === action.placement).map(renderInline),
71
+ null != meta && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
72
+ className: "mx-1.5 flex shrink-0 items-center",
73
+ children: meta
74
+ }),
75
+ inline.filter((action)=>'start' !== action.placement).map(renderInline),
70
76
  overflow.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenu, {
71
77
  open: menuOpen,
72
78
  onOpenChange: setMenuOpen,
@@ -1,3 +1,4 @@
1
+ import { type ReactNode } from 'react';
1
2
  import type { JsonTreeNode, NodeAction } from './JsonTree.types';
2
3
  export interface RowActionsProps {
3
4
  node: JsonTreeNode;
@@ -5,6 +6,8 @@ export interface RowActionsProps {
5
6
  actions: NodeAction[];
6
7
  /** When the action count exceeds this cap, all actions collapse into one menu. */
7
8
  maxInline: number;
9
+ /** Decoration `meta`, rendered between the `start` and `end` actions. */
10
+ meta?: ReactNode;
8
11
  }
9
12
  /**
10
13
  * The trailing icon-button group for a row. Renders `actions` uniformly (icon,
@@ -12,4 +15,4 @@ export interface RowActionsProps {
12
15
  * inline; when the count exceeds that cap, every action moves into one menu so
13
16
  * the row has a single, predictable overflow state.
14
17
  */
15
- export declare function RowActions({ node, actions, maxInline }: RowActionsProps): import("react/jsx-runtime").JSX.Element | null;
18
+ export declare function RowActions({ node, actions, maxInline, meta }: RowActionsProps): import("react/jsx-runtime").JSX.Element | null;