@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.
- package/dist/cjs/components/add-variableV2/AddDataPill.js +10 -0
- package/dist/cjs/components/add-variableV2/AddDataPill.js.map +1 -0
- package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +11 -11
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +5 -5
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js +7 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +41 -14
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +6 -5
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js +2 -2
- package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/VariableInlineField.js +65 -0
- package/dist/cjs/components/agent-builder/components/VariableInlineField.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/VariableTriggerArea.js +10 -0
- package/dist/cjs/components/agent-builder/components/VariableTriggerArea.js.map +1 -0
- package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
- package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +4 -4
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js.map +1 -1
- package/dist/cjs/editor/BikEditor.js +1 -1
- package/dist/cjs/editor/BikEditor.js.map +1 -1
- package/dist/cjs/editor/BikEditor.styles.js +11 -3
- package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
- package/dist/cjs/editor/BikEditor.types.js.map +1 -1
- package/dist/cjs/editor/extensions/mention/MentionDropdown.js +1 -1
- package/dist/cjs/editor/extensions/mention/MentionDropdown.js.map +1 -1
- package/dist/cjs/editor/extensions/mention/MentionExtension.js +1 -1
- package/dist/cjs/editor/extensions/mention/MentionExtension.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/add-variableV2/AddDataPill.d.ts +24 -0
- package/dist/esm/components/add-variableV2/AddDataPill.js +33 -0
- package/dist/esm/components/add-variableV2/AddDataPill.js.map +1 -0
- package/dist/esm/components/add-variableV2/index.d.ts +1 -0
- package/dist/esm/components/agent-builder/AgentBuilder.js +71 -69
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +8 -0
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.d.ts +8 -0
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +182 -136
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +3 -0
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +214 -207
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +12 -0
- package/dist/esm/components/agent-builder/components/MentionEditor.js +144 -103
- package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionField.js +48 -45
- package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +14 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +276 -208
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +8 -0
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +184 -168
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.d.ts +9 -0
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.js +67 -48
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/VariableInlineField.d.ts +26 -0
- package/dist/esm/components/agent-builder/components/VariableInlineField.js +149 -0
- package/dist/esm/components/agent-builder/components/VariableInlineField.js.map +1 -0
- package/dist/esm/components/agent-builder/components/VariableTriggerArea.d.ts +46 -0
- package/dist/esm/components/agent-builder/components/VariableTriggerArea.js +118 -0
- package/dist/esm/components/agent-builder/components/VariableTriggerArea.js.map +1 -0
- package/dist/esm/components/agent-builder/constants/tools.d.ts +1 -1
- package/dist/esm/components/agent-builder/constants/tools.js +13 -12
- package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +7 -0
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +99 -96
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +160 -156
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +14 -4
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js +54 -36
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/esm/components/variable-picker-v3/Content.js +16 -15
- package/dist/esm/components/variable-picker-v3/Content.js.map +1 -1
- package/dist/esm/editor/BikEditor.js +70 -64
- package/dist/esm/editor/BikEditor.js.map +1 -1
- package/dist/esm/editor/BikEditor.styles.js +12 -4
- package/dist/esm/editor/BikEditor.styles.js.map +1 -1
- package/dist/esm/editor/BikEditor.types.d.ts +9 -0
- package/dist/esm/editor/BikEditor.types.js.map +1 -1
- package/dist/esm/editor/extensions/mention/MentionDropdown.js +28 -28
- package/dist/esm/editor/extensions/mention/MentionDropdown.js.map +1 -1
- package/dist/esm/editor/extensions/mention/MentionExtension.js +23 -19
- package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/index.js +543 -541
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,301 +1,369 @@
|
|
|
1
|
-
import { jsxs as k, jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useState as
|
|
6
|
-
import
|
|
7
|
-
import { TitleSmall as
|
|
8
|
-
import { COLORS as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import Y from "
|
|
13
|
-
|
|
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:
|
|
16
|
-
registerKeyHandler:
|
|
17
|
-
onClose:
|
|
17
|
+
onSelect: $,
|
|
18
|
+
registerKeyHandler: C,
|
|
19
|
+
onClose: v,
|
|
18
20
|
onCreateSubAgent: I,
|
|
19
21
|
initialSource: j,
|
|
20
|
-
toolActions:
|
|
21
|
-
integrationStatus:
|
|
22
|
-
onConnectIntegration:
|
|
22
|
+
toolActions: y,
|
|
23
|
+
integrationStatus: G,
|
|
24
|
+
onConnectIntegration: H,
|
|
25
|
+
variablesData: z,
|
|
26
|
+
onSelectVariable: D
|
|
23
27
|
}) => {
|
|
24
|
-
const [
|
|
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
|
-
),
|
|
31
|
+
), B = w(
|
|
28
32
|
() => a.filter((e) => g(e)?.kind === "subagent"),
|
|
29
33
|
[a]
|
|
30
|
-
),
|
|
34
|
+
), F = w(() => {
|
|
31
35
|
const e = [];
|
|
32
|
-
return m.forEach((
|
|
33
|
-
const
|
|
34
|
-
e.includes(
|
|
36
|
+
return m.forEach((n) => {
|
|
37
|
+
const p = g(n)?.source ?? "other";
|
|
38
|
+
e.includes(p) || e.push(p);
|
|
35
39
|
}), e;
|
|
36
|
-
}, [m]),
|
|
40
|
+
}, [m]), N = w(
|
|
37
41
|
() => new Map(
|
|
38
|
-
(
|
|
42
|
+
(y ?? []).map((e) => [e.source, e])
|
|
39
43
|
),
|
|
40
|
-
[
|
|
41
|
-
),
|
|
42
|
-
() =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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:
|
|
59
|
+
onBack: P ? void 0 : () => L(null)
|
|
51
60
|
}
|
|
52
|
-
) :
|
|
53
|
-
title:
|
|
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 : () =>
|
|
58
|
-
icon:
|
|
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:
|
|
76
|
+
onBack: P ? void 0 : () => L(null)
|
|
65
77
|
}
|
|
66
|
-
) : null,
|
|
67
|
-
if (!
|
|
68
|
-
return
|
|
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
|
-
|
|
85
|
+
L(t.key), M(null);
|
|
74
86
|
}
|
|
75
87
|
}));
|
|
76
|
-
if (
|
|
77
|
-
const t = S.trim().toLowerCase(), f =
|
|
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: () =>
|
|
93
|
+
onActivate: () => $(x)
|
|
82
94
|
}));
|
|
83
95
|
return I && f.push({
|
|
84
|
-
id:
|
|
96
|
+
id: ge,
|
|
85
97
|
label: "Create new",
|
|
86
98
|
drillsIn: !1,
|
|
87
99
|
isCreate: !0,
|
|
88
100
|
onActivate: () => {
|
|
89
|
-
|
|
101
|
+
v?.(), I();
|
|
90
102
|
}
|
|
91
103
|
}), f;
|
|
92
104
|
}
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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:
|
|
99
|
-
label:
|
|
112
|
+
id: r,
|
|
113
|
+
label: V(r),
|
|
100
114
|
drillsIn: !1,
|
|
101
|
-
icon:
|
|
115
|
+
icon: _(r) ?? c?.icon,
|
|
102
116
|
rightLabel: "Connect",
|
|
103
117
|
onActivate: () => {
|
|
104
|
-
|
|
118
|
+
v?.(), c?.onConnect ? c.onConnect() : H?.(r);
|
|
105
119
|
}
|
|
106
120
|
};
|
|
107
|
-
const
|
|
108
|
-
(
|
|
121
|
+
const W = m.filter(
|
|
122
|
+
(T) => (g(T)?.source ?? "other") === r
|
|
109
123
|
);
|
|
110
|
-
if (
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
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:
|
|
115
|
-
label:
|
|
128
|
+
id: r,
|
|
129
|
+
label: c.label,
|
|
116
130
|
drillsIn: !1,
|
|
117
|
-
icon:
|
|
131
|
+
icon: T,
|
|
118
132
|
onActivate: () => {
|
|
119
|
-
|
|
133
|
+
v?.(), c.onSelect();
|
|
120
134
|
}
|
|
121
135
|
};
|
|
122
|
-
const
|
|
136
|
+
const q = W[0];
|
|
123
137
|
return {
|
|
124
|
-
id: String(
|
|
125
|
-
label: R(
|
|
138
|
+
id: String(q.id),
|
|
139
|
+
label: R(q),
|
|
126
140
|
drillsIn: !1,
|
|
127
|
-
icon:
|
|
128
|
-
authRequired: g(
|
|
129
|
-
onActivate: () =>
|
|
141
|
+
icon: T,
|
|
142
|
+
authRequired: g(q)?.authRequired,
|
|
143
|
+
onActivate: () => $(q)
|
|
130
144
|
};
|
|
131
145
|
}
|
|
132
146
|
return {
|
|
133
|
-
id:
|
|
134
|
-
label:
|
|
147
|
+
id: r,
|
|
148
|
+
label: V(r),
|
|
135
149
|
drillsIn: !0,
|
|
136
|
-
icon:
|
|
137
|
-
onActivate: () =>
|
|
150
|
+
icon: _(r) ?? c?.icon,
|
|
151
|
+
onActivate: () => M(r)
|
|
138
152
|
};
|
|
139
153
|
};
|
|
140
|
-
return f.sort((
|
|
154
|
+
return f.sort((r, c) => X(r) - X(c)).map(x);
|
|
141
155
|
}
|
|
142
|
-
const e = S.trim().toLowerCase(),
|
|
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: () =>
|
|
148
|
-
})),
|
|
149
|
-
if (
|
|
150
|
-
const t =
|
|
151
|
-
|
|
152
|
-
id: `create:${
|
|
153
|
-
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
|
-
|
|
171
|
+
v?.(), p.onSelect();
|
|
158
172
|
}
|
|
159
173
|
});
|
|
160
174
|
}
|
|
161
|
-
return
|
|
175
|
+
return n;
|
|
162
176
|
}, [
|
|
177
|
+
i,
|
|
178
|
+
E,
|
|
163
179
|
d,
|
|
164
|
-
B,
|
|
165
|
-
c,
|
|
166
180
|
S,
|
|
167
181
|
m,
|
|
168
|
-
|
|
169
|
-
O,
|
|
170
|
-
C,
|
|
171
|
-
w,
|
|
172
|
-
I,
|
|
173
|
-
v,
|
|
174
|
-
D,
|
|
182
|
+
B,
|
|
175
183
|
F,
|
|
176
|
-
|
|
184
|
+
$,
|
|
185
|
+
v,
|
|
186
|
+
I,
|
|
187
|
+
y,
|
|
188
|
+
N,
|
|
189
|
+
G,
|
|
190
|
+
H
|
|
177
191
|
]);
|
|
178
|
-
|
|
179
|
-
const Q =
|
|
180
|
-
Q.current = { rows:
|
|
181
|
-
if (
|
|
182
|
-
return
|
|
183
|
-
const { rows:
|
|
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
|
|
202
|
+
return b((f) => (f + 1) % n.length), !0;
|
|
187
203
|
case "ArrowUp":
|
|
188
|
-
return
|
|
204
|
+
return b((f) => (f + n.length - 1) % n.length), !0;
|
|
189
205
|
case "ArrowRight":
|
|
190
206
|
case "Enter":
|
|
191
|
-
return (
|
|
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
|
-
}), () =>
|
|
198
|
-
}, [
|
|
199
|
-
const
|
|
200
|
-
return /* @__PURE__ */ k(
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
{
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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:
|
|
255
|
+
color: o.content.placeholder
|
|
218
256
|
}
|
|
219
257
|
),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
|
|
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
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
-
`,
|
|
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 ${
|
|
298
|
-
`,
|
|
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: ${
|
|
374
|
+
color: ${o.content.primary};
|
|
307
375
|
|
|
308
376
|
&::placeholder {
|
|
309
|
-
color: ${
|
|
377
|
+
color: ${o.content.placeholder};
|
|
310
378
|
}
|
|
311
|
-
`,
|
|
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 ${
|
|
326
|
-
background: ${(a) => a.$active ?
|
|
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: ${
|
|
399
|
+
background: ${o.surface.hovered};
|
|
332
400
|
}
|
|
333
|
-
`,
|
|
401
|
+
`, we = h.div`
|
|
334
402
|
display: flex;
|
|
335
403
|
align-items: center;
|
|
336
404
|
gap: 12px;
|
|
337
405
|
min-width: 0;
|
|
338
|
-
`,
|
|
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 ${
|
|
344
|
-
`,
|
|
411
|
+
border-top: 1px solid ${o.stroke.primary};
|
|
412
|
+
`, Se = h.span`
|
|
345
413
|
flex-shrink: 0;
|
|
346
|
-
color: ${
|
|
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
|
-
`,
|
|
419
|
+
`, Re = h.div`
|
|
352
420
|
width: 100%;
|
|
353
421
|
text-align: center;
|
|
354
|
-
color: ${
|
|
422
|
+
color: ${o.content.brand};
|
|
355
423
|
font-family: Inter;
|
|
356
424
|
font-size: 14px;
|
|
357
425
|
font-weight: 600;
|
|
358
|
-
`,
|
|
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 ${
|
|
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
|
-
`,
|
|
441
|
+
`, Ce = h.div`
|
|
374
442
|
padding: 12px 10px;
|
|
375
443
|
font-family: Inter;
|
|
376
444
|
font-size: 13px;
|
|
377
|
-
color: ${
|
|
445
|
+
color: ${o.content.secondary};
|
|
378
446
|
`;
|
|
379
447
|
export {
|
|
380
|
-
|
|
448
|
+
je as MentionPicker
|
|
381
449
|
};
|
|
382
450
|
//# sourceMappingURL=MentionPicker.js.map
|