@bikdotai/bik-component-library 0.0.852 → 0.0.853-beta.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 (102) hide show
  1. package/dist/cjs/components/add-variableV2/AddDataPill.js +10 -0
  2. package/dist/cjs/components/add-variableV2/AddDataPill.js.map +1 -0
  3. package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
  4. package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +11 -11
  6. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  7. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +5 -5
  8. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  9. package/dist/cjs/components/agent-builder/components/MentionEditor.js +7 -1
  10. package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
  11. package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
  12. package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
  13. package/dist/cjs/components/agent-builder/components/MentionPicker.js +41 -14
  14. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  15. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +6 -5
  16. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  17. package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js +2 -2
  18. package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
  19. package/dist/cjs/components/agent-builder/components/VariableInlineField.js +65 -0
  20. package/dist/cjs/components/agent-builder/components/VariableInlineField.js.map +1 -0
  21. package/dist/cjs/components/agent-builder/components/VariableTriggerArea.js +10 -0
  22. package/dist/cjs/components/agent-builder/components/VariableTriggerArea.js.map +1 -0
  23. package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
  24. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
  25. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
  26. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  27. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
  28. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  29. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +4 -4
  30. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  31. package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
  32. package/dist/cjs/components/variable-picker-v3/Content.js.map +1 -1
  33. package/dist/cjs/editor/BikEditor.js +1 -1
  34. package/dist/cjs/editor/BikEditor.js.map +1 -1
  35. package/dist/cjs/editor/BikEditor.styles.js +11 -3
  36. package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
  37. package/dist/cjs/editor/BikEditor.types.js.map +1 -1
  38. package/dist/cjs/editor/extensions/mention/MentionDropdown.js +1 -1
  39. package/dist/cjs/editor/extensions/mention/MentionDropdown.js.map +1 -1
  40. package/dist/cjs/editor/extensions/mention/MentionExtension.js +1 -1
  41. package/dist/cjs/editor/extensions/mention/MentionExtension.js.map +1 -1
  42. package/dist/cjs/index.js +1 -1
  43. package/dist/esm/components/add-variableV2/AddDataPill.d.ts +24 -0
  44. package/dist/esm/components/add-variableV2/AddDataPill.js +33 -0
  45. package/dist/esm/components/add-variableV2/AddDataPill.js.map +1 -0
  46. package/dist/esm/components/add-variableV2/index.d.ts +1 -0
  47. package/dist/esm/components/agent-builder/AgentBuilder.js +71 -69
  48. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  49. package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +8 -0
  50. package/dist/esm/components/agent-builder/components/ConfigToolPanel.d.ts +8 -0
  51. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +182 -136
  52. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  53. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +3 -0
  54. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +214 -207
  55. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  56. package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +12 -0
  57. package/dist/esm/components/agent-builder/components/MentionEditor.js +144 -103
  58. package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
  59. package/dist/esm/components/agent-builder/components/MentionField.js +48 -45
  60. package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
  61. package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +14 -1
  62. package/dist/esm/components/agent-builder/components/MentionPicker.js +276 -208
  63. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  64. package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +8 -0
  65. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +184 -168
  66. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  67. package/dist/esm/components/agent-builder/components/ToolInstructionsField.d.ts +9 -0
  68. package/dist/esm/components/agent-builder/components/ToolInstructionsField.js +67 -48
  69. package/dist/esm/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
  70. package/dist/esm/components/agent-builder/components/VariableInlineField.d.ts +26 -0
  71. package/dist/esm/components/agent-builder/components/VariableInlineField.js +149 -0
  72. package/dist/esm/components/agent-builder/components/VariableInlineField.js.map +1 -0
  73. package/dist/esm/components/agent-builder/components/VariableTriggerArea.d.ts +46 -0
  74. package/dist/esm/components/agent-builder/components/VariableTriggerArea.js +118 -0
  75. package/dist/esm/components/agent-builder/components/VariableTriggerArea.js.map +1 -0
  76. package/dist/esm/components/agent-builder/constants/tools.d.ts +1 -1
  77. package/dist/esm/components/agent-builder/constants/tools.js +13 -12
  78. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  79. package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +7 -0
  80. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +99 -96
  81. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  82. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +160 -156
  83. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  84. package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +14 -4
  85. package/dist/esm/components/agent-builder/utils/mentionSerialization.js +54 -36
  86. package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  87. package/dist/esm/components/variable-picker-v3/Content.js +16 -15
  88. package/dist/esm/components/variable-picker-v3/Content.js.map +1 -1
  89. package/dist/esm/editor/BikEditor.js +70 -64
  90. package/dist/esm/editor/BikEditor.js.map +1 -1
  91. package/dist/esm/editor/BikEditor.styles.js +12 -4
  92. package/dist/esm/editor/BikEditor.styles.js.map +1 -1
  93. package/dist/esm/editor/BikEditor.types.d.ts +9 -0
  94. package/dist/esm/editor/BikEditor.types.js.map +1 -1
  95. package/dist/esm/editor/extensions/mention/MentionDropdown.js +28 -28
  96. package/dist/esm/editor/extensions/mention/MentionDropdown.js.map +1 -1
  97. package/dist/esm/editor/extensions/mention/MentionExtension.js +23 -19
  98. package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
  99. package/dist/esm/icons/index.d.ts +25 -25
  100. package/dist/esm/index.js +543 -541
  101. package/dist/esm/index.js.map +1 -1
  102. package/package.json +1 -1
@@ -1,301 +1,369 @@
1
- import { jsxs as k, jsx as s, Fragment as ee } from "react/jsx-runtime";
2
- import te from "../../../assets/icons/chevronRight.svg.js";
3
- import ne from "../../../assets/icons/searchIcon.svg.js";
4
- import oe from "../../../icons/Arrows/Normal arrows/ArrowLeft.js";
5
- import { useState as q, useMemo as y, useEffect as N, useRef as re } from "react";
6
- import p from "styled-components";
7
- import { TitleSmall as ie, BodySecondary as le, BodyCaption as ae } from "../../TypographyStyle.js";
8
- import { COLORS as r } from "../../../constants/Theme.js";
9
- import { CATEGORIES as ce, toolSourceRank as W, isIntegrationSource as se, CONFIG_TOOL_SOURCES as de } from "../constants/tools.js";
10
- import { toolSourceLabel as U } from "../utils/mentionSerialization.js";
11
- import { renderSourceIcon as X, sourceIcon as P } from "../utils/sourceIcons.js";
12
- import Y from "../../../icons/Informational/Common UI/Shield.js";
13
- const g = (a) => a.meta, R = (a) => g(a)?.plainLabel ?? a.label, ue = "__bik_create_subagent__", ze = ({
1
+ import { jsxs as k, jsx as l, Fragment as re } from "react/jsx-runtime";
2
+ import ne from "../../../assets/icons/chevronRight.svg.js";
3
+ import oe from "../../../assets/icons/searchIcon.svg.js";
4
+ import ie from "../../../icons/Arrows/Normal arrows/ArrowLeft.js";
5
+ import { useState as O, useMemo as w, useEffect as U, useRef as le } from "react";
6
+ import h from "styled-components";
7
+ import { TitleSmall as ae, BodySecondary as ce, BodyCaption as se } from "../../TypographyStyle.js";
8
+ import { COLORS as o } from "../../../constants/Theme.js";
9
+ import { PickerType as de } from "../../variable-picker-v3/model.js";
10
+ import { CATEGORIES as he, toolSourceRank as X, isIntegrationSource as ue, CONFIG_TOOL_SOURCES as pe } from "../constants/tools.js";
11
+ import { toolSourceLabel as V } from "../utils/mentionSerialization.js";
12
+ import { renderSourceIcon as Y, sourceIcon as _ } from "../utils/sourceIcons.js";
13
+ import { VariablePicker as fe } from "../../variable-picker-v3/VariablePicker.js";
14
+ import Z from "../../../icons/Informational/Common UI/Shield.js";
15
+ const g = (a) => a.meta, R = (a) => g(a)?.plainLabel ?? a.label, ge = "__bik_create_subagent__", je = ({
14
16
  items: a,
15
- onSelect: C,
16
- registerKeyHandler: L,
17
- onClose: w,
17
+ onSelect: $,
18
+ registerKeyHandler: C,
19
+ onClose: v,
18
20
  onCreateSubAgent: I,
19
21
  initialSource: j,
20
- toolActions: v,
21
- integrationStatus: F,
22
- onConnectIntegration: G
22
+ toolActions: y,
23
+ integrationStatus: G,
24
+ onConnectIntegration: H,
25
+ variablesData: z,
26
+ onSelectVariable: D
23
27
  }) => {
24
- const [Z, _] = q(null), [c, z] = q(j ?? null), [$, b] = q(-1), [S, J] = q(""), m = y(
28
+ const [K, L] = O(null), [d, M] = O(j ?? null), [A, b] = O(-1), [S, J] = O(""), m = w(
25
29
  () => a.filter((e) => g(e)?.kind === "tool"),
26
30
  [a]
27
- ), A = y(
31
+ ), B = w(
28
32
  () => a.filter((e) => g(e)?.kind === "subagent"),
29
33
  [a]
30
- ), O = y(() => {
34
+ ), F = w(() => {
31
35
  const e = [];
32
- return m.forEach((o) => {
33
- const h = g(o)?.source ?? "other";
34
- e.includes(h) || e.push(h);
36
+ return m.forEach((n) => {
37
+ const p = g(n)?.source ?? "other";
38
+ e.includes(p) || e.push(p);
35
39
  }), e;
36
- }, [m]), D = y(
40
+ }, [m]), N = w(
37
41
  () => new Map(
38
- (v ?? []).map((e) => [e.source, e])
42
+ (y ?? []).map((e) => [e.source, e])
39
43
  ),
40
- [v]
41
- ), B = y(
42
- () => ce.filter(
43
- (e) => e.key === "tool" ? m.length > 0 || (v?.length ?? 0) > 0 : A.length > 0 || !!I
44
- ),
45
- [m.length, A.length, I, v?.length]
46
- ), M = B.length === 1 ? B[0].key : null, d = Z ?? M, u = d ? d === "subagent" ? (
44
+ [y]
45
+ ), E = w(
46
+ () => he.filter((e) => e.key === "tool" ? m.length > 0 || (y?.length ?? 0) > 0 : e.key === "variable" ? (z?.length ?? 0) > 0 && !!D : B.length > 0 || !!I),
47
+ [
48
+ m.length,
49
+ B.length,
50
+ I,
51
+ y?.length,
52
+ z?.length,
53
+ D
54
+ ]
55
+ ), P = E.length === 1 ? E[0].key : null, i = K ?? P, u = i ? i === "subagent" ? (
47
56
  // Always titled — with a back arrow only when the category chooser is above.
48
57
  {
49
58
  title: "Sub-agent",
50
- onBack: M ? void 0 : () => _(null)
59
+ onBack: P ? void 0 : () => L(null)
51
60
  }
52
- ) : c ? {
53
- title: U(c),
61
+ ) : i === "variable" ? {
62
+ title: "Variables",
63
+ onBack: P ? void 0 : () => L(null)
64
+ } : d ? {
65
+ title: V(d),
54
66
  // Deep-linked to a source (opened from a right-panel source button):
55
67
  // that source IS the root, so no back arrow. Otherwise back clears the
56
68
  // source — returning to the source chooser.
57
- onBack: j ? void 0 : () => z(null),
58
- icon: P(c)
69
+ onBack: j ? void 0 : () => M(null),
70
+ icon: _(d)
59
71
  } : (
60
72
  // Always titled — matches the Sub-agent header; back arrow only when the
61
73
  // category chooser is above (i.e. not the sole category).
62
74
  {
63
75
  title: "Tools",
64
- onBack: M ? void 0 : () => _(null)
76
+ onBack: P ? void 0 : () => L(null)
65
77
  }
66
- ) : null, l = y(() => {
67
- if (!d)
68
- return B.map((t) => ({
78
+ ) : null, s = w(() => {
79
+ if (!i)
80
+ return E.map((t) => ({
69
81
  id: t.key,
70
82
  label: t.label,
71
83
  drillsIn: !0,
72
84
  onActivate: () => {
73
- _(t.key), z(null);
85
+ L(t.key), M(null);
74
86
  }
75
87
  }));
76
- if (d === "subagent") {
77
- const t = S.trim().toLowerCase(), f = A.filter((x) => !t || R(x).toLowerCase().includes(t)).map((x) => ({
88
+ if (i === "subagent") {
89
+ const t = S.trim().toLowerCase(), f = B.filter((x) => !t || R(x).toLowerCase().includes(t)).map((x) => ({
78
90
  id: String(x.id),
79
91
  label: R(x),
80
92
  drillsIn: !1,
81
- onActivate: () => C(x)
93
+ onActivate: () => $(x)
82
94
  }));
83
95
  return I && f.push({
84
- id: ue,
96
+ id: ge,
85
97
  label: "Create new",
86
98
  drillsIn: !1,
87
99
  isCreate: !0,
88
100
  onActivate: () => {
89
- w?.(), I();
101
+ v?.(), I();
90
102
  }
91
103
  }), f;
92
104
  }
93
- if (!c) {
94
- const t = (v ?? []).map((n) => n.source).filter((n) => !O.includes(n)), f = [...O, ...t], x = (n) => {
95
- const i = D.get(n);
96
- if ((i !== void 0 ? i.connected : F?.[n]) === !1)
105
+ if (i === "variable")
106
+ return [];
107
+ if (!d) {
108
+ const t = (y ?? []).map((r) => r.source).filter((r) => !F.includes(r)), f = [...F, ...t], x = (r) => {
109
+ const c = N.get(r);
110
+ if ((c !== void 0 ? c.connected : G?.[r]) === !1)
97
111
  return {
98
- id: n,
99
- label: U(n),
112
+ id: r,
113
+ label: V(r),
100
114
  drillsIn: !1,
101
- icon: P(n) ?? i?.icon,
115
+ icon: _(r) ?? c?.icon,
102
116
  rightLabel: "Connect",
103
117
  onActivate: () => {
104
- w?.(), i?.onConnect ? i.onConnect() : G?.(n);
118
+ v?.(), c?.onConnect ? c.onConnect() : H?.(r);
105
119
  }
106
120
  };
107
- const V = m.filter(
108
- (E) => (g(E)?.source ?? "other") === n
121
+ const W = m.filter(
122
+ (T) => (g(T)?.source ?? "other") === r
109
123
  );
110
- if (V.length + (i ? 1 : 0) === 1 && !(i === void 0 && se(n))) {
111
- const E = P(n) ?? i?.icon;
112
- if (i)
124
+ if (W.length + (c ? 1 : 0) === 1 && !(c === void 0 && ue(r))) {
125
+ const T = _(r) ?? c?.icon;
126
+ if (c)
113
127
  return {
114
- id: n,
115
- label: i.label,
128
+ id: r,
129
+ label: c.label,
116
130
  drillsIn: !1,
117
- icon: E,
131
+ icon: T,
118
132
  onActivate: () => {
119
- w?.(), i.onSelect();
133
+ v?.(), c.onSelect();
120
134
  }
121
135
  };
122
- const T = V[0];
136
+ const q = W[0];
123
137
  return {
124
- id: String(T.id),
125
- label: R(T),
138
+ id: String(q.id),
139
+ label: R(q),
126
140
  drillsIn: !1,
127
- icon: E,
128
- authRequired: g(T)?.authRequired,
129
- onActivate: () => C(T)
141
+ icon: T,
142
+ authRequired: g(q)?.authRequired,
143
+ onActivate: () => $(q)
130
144
  };
131
145
  }
132
146
  return {
133
- id: n,
134
- label: U(n),
147
+ id: r,
148
+ label: V(r),
135
149
  drillsIn: !0,
136
- icon: P(n) ?? i?.icon,
137
- onActivate: () => z(n)
150
+ icon: _(r) ?? c?.icon,
151
+ onActivate: () => M(r)
138
152
  };
139
153
  };
140
- return f.sort((n, i) => W(n) - W(i)).map(x);
154
+ return f.sort((r, c) => X(r) - X(c)).map(x);
141
155
  }
142
- const e = S.trim().toLowerCase(), o = m.filter((t) => (g(t)?.source ?? "other") === c).filter((t) => !e || R(t).toLowerCase().includes(e)).map((t) => ({
156
+ const e = S.trim().toLowerCase(), n = m.filter((t) => (g(t)?.source ?? "other") === d).filter((t) => !e || R(t).toLowerCase().includes(e)).map((t) => ({
143
157
  id: String(t.id),
144
158
  label: R(t),
145
159
  drillsIn: !1,
146
160
  authRequired: g(t)?.authRequired,
147
- onActivate: () => C(t)
148
- })), h = D.get(c);
149
- if (h) {
150
- const t = c in de;
151
- o.push({
152
- id: `create:${c}`,
153
- label: h.label,
161
+ onActivate: () => $(t)
162
+ })), p = N.get(d);
163
+ if (p) {
164
+ const t = d in pe;
165
+ n.push({
166
+ id: `create:${d}`,
167
+ label: p.label,
154
168
  drillsIn: !1,
155
169
  isCreate: !t,
156
170
  onActivate: () => {
157
- w?.(), h.onSelect();
171
+ v?.(), p.onSelect();
158
172
  }
159
173
  });
160
174
  }
161
- return o;
175
+ return n;
162
176
  }, [
177
+ i,
178
+ E,
163
179
  d,
164
- B,
165
- c,
166
180
  S,
167
181
  m,
168
- A,
169
- O,
170
- C,
171
- w,
172
- I,
173
- v,
174
- D,
182
+ B,
175
183
  F,
176
- G
184
+ $,
185
+ v,
186
+ I,
187
+ y,
188
+ N,
189
+ G,
190
+ H
177
191
  ]);
178
- N(() => b(-1), [d, c, S, a]), N(() => J(""), [d, c]);
179
- const Q = re({ rows: l, activeIndex: $, header: u });
180
- Q.current = { rows: l, activeIndex: $, header: u }, N(() => {
181
- if (L)
182
- return L((e) => {
183
- const { rows: o, activeIndex: h, header: t } = Q.current;
192
+ U(() => b(-1), [i, d, S, a]), U(() => J(""), [i, d]);
193
+ const Q = le({ rows: s, activeIndex: A, header: u });
194
+ Q.current = { rows: s, activeIndex: A, header: u }, U(() => {
195
+ if (C)
196
+ return C((e) => {
197
+ const { rows: n, activeIndex: p, header: t } = Q.current;
198
+ if (!n.length && e.key !== "ArrowLeft")
199
+ return !1;
184
200
  switch (e.key) {
185
201
  case "ArrowDown":
186
- return o.length && b((f) => (f + 1) % o.length), !0;
202
+ return b((f) => (f + 1) % n.length), !0;
187
203
  case "ArrowUp":
188
- return o.length && b((f) => (f + o.length - 1) % o.length), !0;
204
+ return b((f) => (f + n.length - 1) % n.length), !0;
189
205
  case "ArrowRight":
190
206
  case "Enter":
191
- return (o[h] ?? o[0])?.onActivate(), !0;
207
+ return (n[p] ?? n[0])?.onActivate(), !0;
192
208
  case "ArrowLeft":
193
209
  return t?.onBack ? (t.onBack(), !0) : !1;
194
210
  default:
195
211
  return !1;
196
212
  }
197
- }), () => L(null);
198
- }, [L]);
199
- const K = d ? l.length && !l[0].drillsIn ? "items" : "sources" : "categories", H = d === "tool" && !!c || d === "subagent";
200
- return /* @__PURE__ */ k(pe, { className: `bik-mention-picker bik-mention-picker--${K}`, children: [
201
- u && /* @__PURE__ */ k(
202
- ve,
203
- {
204
- type: "button",
205
- onClick: u.onBack,
206
- disabled: !u.onBack,
207
- style: {
208
- background: r.surface.subdued,
209
- cursor: u.onBack ? "pointer" : "default"
210
- },
211
- children: [
212
- u.onBack && /* @__PURE__ */ s(
213
+ }), () => C(null);
214
+ }, [C]);
215
+ const ee = i ? s.length && !s[0].drillsIn ? "items" : "sources" : "categories", te = i === "tool" && !!d || i === "subagent";
216
+ return /* @__PURE__ */ k(
217
+ be,
218
+ {
219
+ className: `bik-mention-picker bik-mention-picker--${ee}`,
220
+ $fixedHeight: i === "variable",
221
+ children: [
222
+ u && /* @__PURE__ */ k(
223
+ $e,
224
+ {
225
+ type: "button",
226
+ onClick: u.onBack,
227
+ disabled: !u.onBack,
228
+ style: {
229
+ background: o.surface.subdued,
230
+ cursor: u.onBack ? "pointer" : "default"
231
+ },
232
+ children: [
233
+ u.onBack && /* @__PURE__ */ l(
234
+ ie,
235
+ {
236
+ width: 20,
237
+ height: 20,
238
+ color: o.content.primary
239
+ }
240
+ ),
241
+ u.icon && Y(u.icon),
242
+ /* @__PURE__ */ k(ae, { children: [
243
+ " ",
244
+ u.title
245
+ ] })
246
+ ]
247
+ }
248
+ ),
249
+ te && /* @__PURE__ */ k(ke, { children: [
250
+ /* @__PURE__ */ l(
213
251
  oe,
214
252
  {
215
253
  width: 20,
216
254
  height: 20,
217
- color: r.content.primary
255
+ color: o.content.placeholder
218
256
  }
219
257
  ),
220
- u.icon && X(u.icon),
221
- /* @__PURE__ */ k(ie, { children: [
222
- " ",
223
- u.title
224
- ] })
225
- ]
226
- }
227
- ),
228
- H && /* @__PURE__ */ k(he, { children: [
229
- /* @__PURE__ */ s(
230
- ne,
231
- {
232
- width: 20,
233
- height: 20,
234
- color: r.content.placeholder
235
- }
236
- ),
237
- /* @__PURE__ */ s(
238
- fe,
239
- {
240
- autoFocus: !0,
241
- value: S,
242
- placeholder: "Search",
243
- "data-test": "mention-picker-search",
244
- onChange: (e) => J(e.target.value),
245
- onKeyDown: (e) => {
246
- l.length && (e.key === "ArrowDown" ? (e.preventDefault(), b((o) => (o + 1) % l.length)) : e.key === "ArrowUp" ? (e.preventDefault(), b((o) => (o + l.length - 1) % l.length)) : e.key === "Enter" && (e.preventDefault(), (l[$] ?? l[0])?.onActivate()));
247
- }
248
- }
249
- )
250
- ] }),
251
- l.length === 0 ? /* @__PURE__ */ s(ye, { children: d === "subagent" ? null : "No tools available" }) : l.map((e, o) => /* @__PURE__ */ s(
252
- ge,
253
- {
254
- type: "button",
255
- $active: o === $,
256
- onMouseEnter: () => b(o),
257
- onMouseLeave: () => b(-1),
258
- onClick: e.onActivate,
259
- children: e.isCreate ? /* @__PURE__ */ s(ke, { children: e.label }) : /* @__PURE__ */ k(ee, { children: [
260
- /* @__PURE__ */ k(be, { children: [
261
- X(e.icon),
262
- /* @__PURE__ */ s(le, { color: r.content.primary, children: e.label }),
263
- e.authRequired && /* @__PURE__ */ s(
264
- Y,
265
- {
266
- size: 16,
267
- "aria-label": "This tool requires customer verification"
258
+ /* @__PURE__ */ l(
259
+ ve,
260
+ {
261
+ autoFocus: !0,
262
+ value: S,
263
+ placeholder: "Search",
264
+ "data-test": "mention-picker-search",
265
+ onChange: (e) => J(e.target.value),
266
+ onKeyDown: (e) => {
267
+ s.length && (e.key === "ArrowDown" ? (e.preventDefault(), b((n) => (n + 1) % s.length)) : e.key === "ArrowUp" ? (e.preventDefault(), b((n) => (n + s.length - 1) % s.length)) : e.key === "Enter" && (e.preventDefault(), (s[A] ?? s[0])?.onActivate()));
268
268
  }
269
- )
270
- ] }),
271
- e.rightLabel ? /* @__PURE__ */ s(xe, { children: e.rightLabel }) : e.drillsIn && /* @__PURE__ */ s(te, { width: 12, height: 12 })
269
+ }
270
+ )
271
+ ] }),
272
+ i === "variable" ? (
273
+ // Shared variable catalog, embedded as this drill-in view. The fill
274
+ // wrapper hands it the remaining card height, so ITS search bar stays
275
+ // fixed and only the variable list below scrolls. Selecting a
276
+ // variable dismisses the menu FIRST (strips the typed "@" + query),
277
+ // then hands the variable up to insert its `{{token}}` at the cursor.
278
+ /* @__PURE__ */ l(xe, { children: /* @__PURE__ */ l(
279
+ fe,
280
+ {
281
+ type: de.EMBEDDED,
282
+ data: z ?? [],
283
+ showRecommendedBar: !0,
284
+ skipDefaultVariableContent: !0,
285
+ onSelect: (e) => {
286
+ v?.(), D?.(e);
287
+ }
288
+ }
289
+ ) })
290
+ ) : s.length === 0 ? /* @__PURE__ */ l(Ce, { children: i === "subagent" ? null : "No tools available" }) : /* @__PURE__ */ l(me, { children: s.map((e, n) => /* @__PURE__ */ l(
291
+ ye,
292
+ {
293
+ type: "button",
294
+ $active: n === A,
295
+ onMouseEnter: () => b(n),
296
+ onMouseLeave: () => b(-1),
297
+ onClick: e.onActivate,
298
+ children: e.isCreate ? /* @__PURE__ */ l(Re, { children: e.label }) : /* @__PURE__ */ k(re, { children: [
299
+ /* @__PURE__ */ k(we, { children: [
300
+ Y(e.icon),
301
+ /* @__PURE__ */ l(ce, { color: o.content.primary, children: e.label }),
302
+ e.authRequired && /* @__PURE__ */ l(
303
+ Z,
304
+ {
305
+ size: 14,
306
+ "aria-label": "Requires customer verification"
307
+ }
308
+ )
309
+ ] }),
310
+ e.rightLabel ? /* @__PURE__ */ l(Se, { children: e.rightLabel }) : e.drillsIn && /* @__PURE__ */ l(ne, { width: 12, height: 12 })
311
+ ] })
312
+ },
313
+ e.id
314
+ )) }),
315
+ s.some((e) => e.authRequired) && /* @__PURE__ */ k(Ie, { children: [
316
+ /* @__PURE__ */ l(Z, { size: 16 }),
317
+ /* @__PURE__ */ l(se, { color: o.content.secondary, children: "This tool requires customer verification" })
272
318
  ] })
273
- },
274
- e.id
275
- )),
276
- l.some((e) => e.authRequired) && /* @__PURE__ */ k(me, { children: [
277
- /* @__PURE__ */ s(Y, { size: 16 }),
278
- /* @__PURE__ */ s(ae, { color: r.content.secondary, children: "This tool requires customer verification" })
279
- ] })
280
- ] });
281
- }, pe = p.div`
319
+ ]
320
+ }
321
+ );
322
+ }, be = h.div`
282
323
  display: flex;
283
324
  flex-direction: column;
284
325
  min-width: 240px;
285
- max-height: 301px;
286
- overflow-y: auto;
287
- background: ${r.surface.standard};
288
- border: 1px solid ${r.stroke.primary};
326
+ /* Variables view is 45px taller: that is what the embedded picker's "Only
327
+ Recommended" bar costs, so the variable list keeps the room it had before
328
+ the bar was turned on (VariablePicker's calculateHeight subtracts it). */
329
+ ${(a) => a.$fixedHeight ? "height: 346px;" : "max-height: 301px;"}
330
+ overflow: hidden;
331
+ background: ${o.surface.standard};
332
+ border: 1px solid ${o.stroke.primary};
289
333
  border-radius: 4px;
290
334
  box-shadow: 0px -2px 8px 0px #0000001f;
291
- `, he = p.div`
335
+ `, me = h.div`
336
+ flex: 1 1 auto;
337
+ min-height: 0;
338
+ overflow-y: auto;
339
+ scrollbar-width: none;
340
+
341
+ &::-webkit-scrollbar {
342
+ display: none;
343
+ }
344
+ `, xe = h.div`
345
+ flex: 1 1 auto;
346
+ min-height: 0;
347
+
348
+ > div {
349
+ height: 100%;
350
+ }
351
+
352
+ * {
353
+ scrollbar-width: none;
354
+ }
355
+
356
+ *::-webkit-scrollbar {
357
+ display: none;
358
+ }
359
+ `, ke = h.div`
292
360
  display: flex;
293
361
  align-items: center;
294
362
  gap: 8px;
295
363
  padding: 10px 12px;
296
364
  flex-shrink: 0;
297
- border-bottom: 1px solid ${r.stroke.primary};
298
- `, fe = p.input`
365
+ border-bottom: 1px solid ${o.stroke.primary};
366
+ `, ve = h.input`
299
367
  flex: 1;
300
368
  min-width: 0;
301
369
  border: none;
@@ -303,12 +371,12 @@ const g = (a) => a.meta, R = (a) => g(a)?.plainLabel ?? a.label, ue = "__bik_cre
303
371
  background: transparent;
304
372
  font-family: Inter;
305
373
  font-size: 14px;
306
- color: ${r.content.primary};
374
+ color: ${o.content.primary};
307
375
 
308
376
  &::placeholder {
309
- color: ${r.content.placeholder};
377
+ color: ${o.content.placeholder};
310
378
  }
311
- `, ge = p.button`
379
+ `, ye = h.button`
312
380
  display: flex;
313
381
  justify-content: space-between;
314
382
  align-items: center;
@@ -322,45 +390,45 @@ const g = (a) => a.meta, R = (a) => g(a)?.plainLabel ?? a.label, ue = "__bik_cre
322
390
  box-sizing: border-box;
323
391
  flex-shrink: 0;
324
392
  border: none;
325
- border-bottom: 1px solid ${r.stroke.primary};
326
- background: ${(a) => a.$active ? r.surface.subdued : "transparent"};
393
+ border-bottom: 1px solid ${o.stroke.primary};
394
+ background: ${(a) => a.$active ? o.surface.subdued : "transparent"};
327
395
  cursor: pointer;
328
396
  text-align: left;
329
397
 
330
398
  &:hover {
331
- background: ${r.surface.hovered};
399
+ background: ${o.surface.hovered};
332
400
  }
333
- `, be = p.div`
401
+ `, we = h.div`
334
402
  display: flex;
335
403
  align-items: center;
336
404
  gap: 12px;
337
405
  min-width: 0;
338
- `, me = p.div`
406
+ `, Ie = h.div`
339
407
  display: flex;
340
408
  align-items: center;
341
409
  gap: 6px;
342
410
  padding: 8px 12px;
343
- border-top: 1px solid ${r.stroke.primary};
344
- `, xe = p.span`
411
+ border-top: 1px solid ${o.stroke.primary};
412
+ `, Se = h.span`
345
413
  flex-shrink: 0;
346
- color: ${r.content.brand};
414
+ color: ${o.content.brand};
347
415
  font-family: Inter;
348
416
  font-size: 14px;
349
417
  font-weight: 600;
350
418
  white-space: nowrap;
351
- `, ke = p.div`
419
+ `, Re = h.div`
352
420
  width: 100%;
353
421
  text-align: center;
354
- color: ${r.content.brand};
422
+ color: ${o.content.brand};
355
423
  font-family: Inter;
356
424
  font-size: 14px;
357
425
  font-weight: 600;
358
- `, ve = p.button`
426
+ `, $e = h.button`
359
427
  display: flex;
360
428
  align-items: center;
361
429
  padding: 12px 16px;
362
430
  border: none;
363
- border-bottom: 1px solid ${r.stroke.primary};
431
+ border-bottom: 1px solid ${o.stroke.primary};
364
432
  background: transparent;
365
433
  cursor: pointer;
366
434
  font-family: Inter;
@@ -370,13 +438,13 @@ const g = (a) => a.meta, R = (a) => g(a)?.plainLabel ?? a.label, ue = "__bik_cre
370
438
  box-sizing: border-box;
371
439
  flex-shrink: 0;
372
440
  gap: 4px;
373
- `, ye = p.div`
441
+ `, Ce = h.div`
374
442
  padding: 12px 10px;
375
443
  font-family: Inter;
376
444
  font-size: 13px;
377
- color: ${r.content.secondary};
445
+ color: ${o.content.secondary};
378
446
  `;
379
447
  export {
380
- ze as MentionPicker
448
+ je as MentionPicker
381
449
  };
382
450
  //# sourceMappingURL=MentionPicker.js.map