@bikdotai/bik-component-library 0.0.853 → 0.0.855

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