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