@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.
- 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/toaster/Toaster.js +1 -1
- package/dist/cjs/components/toaster/Toaster.js.map +1 -1
- package/dist/cjs/components/toaster/Toaster.styled.js +7 -7
- package/dist/cjs/components/toaster/Toaster.styled.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 +8 -0
- 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 +76 -74
- 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 +195 -188
- 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 +286 -218
- 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 +192 -176
- 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 +14 -13
- 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 +164 -160
- 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/toaster/Toaster.js +30 -25
- package/dist/esm/components/toaster/Toaster.js.map +1 -1
- package/dist/esm/components/toaster/Toaster.styled.js +5 -5
- package/dist/esm/components/toaster/Toaster.styled.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 +40 -34
- package/dist/esm/editor/BikEditor.js.map +1 -1
- package/dist/esm/editor/BikEditor.styles.js +20 -12
- 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,325 +1,393 @@
|
|
|
1
|
-
import { jsxs 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
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
},
|
|
19
|
-
items:
|
|
20
|
-
onSelect:
|
|
21
|
-
registerKeyHandler:
|
|
22
|
-
onClose:
|
|
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:
|
|
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 [
|
|
30
|
-
() =>
|
|
31
|
-
[
|
|
32
|
-
),
|
|
33
|
-
() =>
|
|
34
|
-
[
|
|
35
|
-
),
|
|
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
|
|
38
|
-
const f =
|
|
41
|
+
return k.forEach((n) => {
|
|
42
|
+
const f = b(n)?.source ?? "other";
|
|
39
43
|
e.includes(f) || e.push(f);
|
|
40
44
|
}), e;
|
|
41
|
-
}, [
|
|
45
|
+
}, [k]), U = I(
|
|
42
46
|
() => new Map(
|
|
43
47
|
(y ?? []).map((e) => [e.source, e])
|
|
44
48
|
),
|
|
45
49
|
[y]
|
|
46
|
-
),
|
|
47
|
-
() =>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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:
|
|
64
|
+
onBack: _ ? void 0 : () => T(null)
|
|
56
65
|
}
|
|
57
|
-
) :
|
|
58
|
-
title:
|
|
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:
|
|
72
|
+
icon: ne
|
|
61
73
|
} : i ? {
|
|
62
|
-
title:
|
|
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:
|
|
68
|
-
|
|
79
|
+
onBack: H ? void 0 : () => S(
|
|
80
|
+
z(i) ? v : null
|
|
69
81
|
),
|
|
70
|
-
icon:
|
|
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:
|
|
88
|
+
onBack: _ ? void 0 : () => T(null)
|
|
77
89
|
}
|
|
78
|
-
) : null,
|
|
79
|
-
if (!
|
|
80
|
-
return
|
|
81
|
-
id:
|
|
82
|
-
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
|
-
|
|
97
|
+
T(r.key), S(null);
|
|
86
98
|
}
|
|
87
99
|
}));
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
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:
|
|
103
|
+
label: A(g),
|
|
92
104
|
drillsIn: !1,
|
|
93
|
-
onActivate: () =>
|
|
105
|
+
onActivate: () => L(g)
|
|
94
106
|
}));
|
|
95
107
|
return R && p.push({
|
|
96
|
-
id:
|
|
108
|
+
id: ye,
|
|
97
109
|
label: "Create new",
|
|
98
110
|
drillsIn: !1,
|
|
99
111
|
isCreate: !0,
|
|
100
112
|
onActivate: () => {
|
|
101
|
-
|
|
113
|
+
w?.(), R();
|
|
102
114
|
}
|
|
103
115
|
}), p;
|
|
104
116
|
}
|
|
117
|
+
if (a === "variable")
|
|
118
|
+
return [];
|
|
105
119
|
if (!i || i === v) {
|
|
106
|
-
const
|
|
107
|
-
const l =
|
|
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:
|
|
125
|
+
label: Y(t),
|
|
112
126
|
drillsIn: !1,
|
|
113
|
-
icon:
|
|
127
|
+
icon: q(t) ?? l?.icon,
|
|
114
128
|
rightLabel: "Connect",
|
|
115
129
|
onActivate: () => {
|
|
116
|
-
|
|
130
|
+
w?.(), l?.onConnect ? l.onConnect() : K?.(t);
|
|
117
131
|
}
|
|
118
132
|
};
|
|
119
|
-
const
|
|
120
|
-
(
|
|
133
|
+
const Z = k.filter(
|
|
134
|
+
(P) => (b(P)?.source ?? "other") === t
|
|
121
135
|
);
|
|
122
|
-
if (
|
|
123
|
-
const
|
|
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
|
-
|
|
145
|
+
w?.(), l.onSelect();
|
|
132
146
|
}
|
|
133
147
|
};
|
|
134
|
-
const
|
|
148
|
+
const N = Z[0];
|
|
135
149
|
return {
|
|
136
|
-
id: String(
|
|
137
|
-
label:
|
|
150
|
+
id: String(N.id),
|
|
151
|
+
label: A(N),
|
|
138
152
|
drillsIn: !1,
|
|
139
|
-
icon:
|
|
140
|
-
authRequired:
|
|
141
|
-
onActivate: () =>
|
|
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:
|
|
160
|
+
label: Y(t),
|
|
147
161
|
drillsIn: !0,
|
|
148
|
-
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) =>
|
|
154
|
-
const
|
|
155
|
-
return p.some((t) =>
|
|
156
|
-
rank:
|
|
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:
|
|
173
|
+
label: ee,
|
|
160
174
|
drillsIn: !0,
|
|
161
|
-
icon:
|
|
175
|
+
icon: ne,
|
|
162
176
|
onActivate: () => S(v)
|
|
163
177
|
}
|
|
164
|
-
}),
|
|
178
|
+
}), X.sort((t, l) => t.rank - l.rank).map((t) => t.row);
|
|
165
179
|
}
|
|
166
|
-
const e =
|
|
167
|
-
id: String(
|
|
168
|
-
label:
|
|
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:
|
|
171
|
-
onActivate: () =>
|
|
172
|
-
})), f =
|
|
184
|
+
authRequired: b(r)?.authRequired,
|
|
185
|
+
onActivate: () => L(r)
|
|
186
|
+
})), f = U.get(i);
|
|
173
187
|
if (f) {
|
|
174
|
-
const
|
|
175
|
-
|
|
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: !
|
|
193
|
+
isCreate: !r,
|
|
180
194
|
onActivate: () => {
|
|
181
|
-
|
|
195
|
+
w?.(), f.onSelect();
|
|
182
196
|
}
|
|
183
197
|
});
|
|
184
198
|
}
|
|
185
|
-
return
|
|
199
|
+
return n;
|
|
186
200
|
}, [
|
|
187
|
-
|
|
188
|
-
_,
|
|
189
|
-
i,
|
|
190
|
-
A,
|
|
191
|
-
x,
|
|
201
|
+
a,
|
|
192
202
|
O,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
203
|
+
i,
|
|
204
|
+
E,
|
|
205
|
+
k,
|
|
206
|
+
B,
|
|
207
|
+
F,
|
|
208
|
+
L,
|
|
209
|
+
w,
|
|
196
210
|
R,
|
|
197
211
|
y,
|
|
198
|
-
|
|
212
|
+
U,
|
|
199
213
|
J,
|
|
200
214
|
K
|
|
201
215
|
]);
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
if (
|
|
206
|
-
return
|
|
207
|
-
const { rows:
|
|
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
|
|
226
|
+
return m((p) => (p + 1) % n.length), !0;
|
|
211
227
|
case "ArrowUp":
|
|
212
|
-
return
|
|
228
|
+
return m((p) => (p + n.length - 1) % n.length), !0;
|
|
213
229
|
case "ArrowRight":
|
|
214
230
|
case "Enter":
|
|
215
|
-
return (
|
|
231
|
+
return (n[f] ?? n[0])?.onActivate(), !0;
|
|
216
232
|
case "ArrowLeft":
|
|
217
|
-
return
|
|
233
|
+
return r?.onBack ? (r.onBack(), !0) : !1;
|
|
218
234
|
default:
|
|
219
235
|
return !1;
|
|
220
236
|
}
|
|
221
|
-
}), () =>
|
|
222
|
-
}, [
|
|
223
|
-
const
|
|
224
|
-
return /* @__PURE__ */
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
{
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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:
|
|
279
|
+
color: o.content.placeholder
|
|
242
280
|
}
|
|
243
281
|
),
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
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
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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
|
-
`,
|
|
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 ${
|
|
322
|
-
`,
|
|
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: ${
|
|
398
|
+
color: ${o.content.primary};
|
|
331
399
|
|
|
332
400
|
&::placeholder {
|
|
333
|
-
color: ${
|
|
401
|
+
color: ${o.content.placeholder};
|
|
334
402
|
}
|
|
335
|
-
`,
|
|
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 ${
|
|
350
|
-
background: ${(
|
|
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: ${
|
|
423
|
+
background: ${o.surface.hovered};
|
|
356
424
|
}
|
|
357
|
-
`,
|
|
425
|
+
`, Ce = u.div`
|
|
358
426
|
display: flex;
|
|
359
427
|
align-items: center;
|
|
360
428
|
gap: 12px;
|
|
361
429
|
min-width: 0;
|
|
362
|
-
`,
|
|
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 ${
|
|
368
|
-
`,
|
|
435
|
+
border-top: 1px solid ${o.stroke.primary};
|
|
436
|
+
`, $e = u.span`
|
|
369
437
|
flex-shrink: 0;
|
|
370
|
-
color: ${
|
|
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
|
-
`,
|
|
443
|
+
`, Be = u.div`
|
|
376
444
|
width: 100%;
|
|
377
445
|
text-align: center;
|
|
378
|
-
color: ${
|
|
446
|
+
color: ${o.content.brand};
|
|
379
447
|
font-family: Inter;
|
|
380
448
|
font-size: 14px;
|
|
381
449
|
font-weight: 600;
|
|
382
|
-
`,
|
|
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 ${
|
|
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
|
-
`,
|
|
465
|
+
`, _e = u.div`
|
|
398
466
|
padding: 12px 10px;
|
|
399
467
|
font-family: Inter;
|
|
400
468
|
font-size: 13px;
|
|
401
|
-
color: ${
|
|
469
|
+
color: ${o.content.secondary};
|
|
402
470
|
`;
|
|
403
471
|
export {
|
|
404
|
-
|
|
472
|
+
Xe as MentionPicker
|
|
405
473
|
};
|
|
406
474
|
//# sourceMappingURL=MentionPicker.js.map
|