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