@bikdotai/bik-component-library 0.0.850-tools-beta.0 → 0.0.850
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/assets/icons/ShipStation.svg.js +1 -1
- package/dist/cjs/assets/icons/ShipStation.svg.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +40 -22
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +1 -1
- 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/DiscardModal.js +1 -1
- package/dist/cjs/components/agent-builder/components/DiscardModal.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 +1 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +32 -24
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RequireVerificationModal.js +1 -1
- package/dist/cjs/components/agent-builder/components/RequireVerificationModal.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +4 -4
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js +2 -2
- 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/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 +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/components/agent-listing/AgentListing.js +1 -1
- package/dist/cjs/components/agent-listing/AgentListing.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentTable.js +1 -1
- package/dist/cjs/components/agent-listing/AgentTable.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/cjs/components/agent-listing/AiAgentsEmptyState.js +2 -0
- package/dist/cjs/components/agent-listing/AiAgentsEmptyState.js.map +1 -0
- package/dist/cjs/editor/BikEditor.js +1 -1
- package/dist/cjs/editor/BikEditor.js.map +1 -1
- package/dist/cjs/editor/BikEditor.styles.js +21 -16
- 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/buildExtensions.js +2 -2
- package/dist/cjs/editor/extensions/buildExtensions.js.map +1 -1
- package/dist/cjs/editor/extensions/characterLimit/CharacterLimitExtension.js +3 -3
- package/dist/cjs/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
- package/dist/cjs/editor/extensions/mention/MentionChipNodeView.js +2 -0
- package/dist/cjs/editor/extensions/mention/MentionChipNodeView.js.map +1 -0
- package/dist/cjs/editor/extensions/mention/MentionExtension.js +1 -1
- package/dist/cjs/editor/extensions/mention/MentionExtension.js.map +1 -1
- package/dist/cjs/icons/Informational/Common UI/ShieldOutline.js +2 -0
- package/dist/cjs/icons/Informational/Common UI/ShieldOutline.js.map +1 -0
- package/dist/cjs/icons/index.js +1 -1
- package/dist/esm/assets/icons/ShipStation.svg.js +2 -2
- package/dist/esm/assets/icons/ShipStation.svg.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +3 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +61 -42
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +1 -1
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +5 -0
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +243 -227
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/DiscardModal.js +57 -49
- package/dist/esm/components/agent-builder/components/DiscardModal.js.map +1 -1
- package/dist/esm/components/agent-builder/components/GoLiveModal.js +26 -22
- package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +1 -1
- package/dist/esm/components/agent-builder/components/MentionEditor.js +93 -77
- package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +194 -168
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/RequireVerificationModal.js +5 -5
- package/dist/esm/components/agent-builder/components/RequireVerificationModal.js.map +1 -1
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +118 -109
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +149 -133
- package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/esm/components/agent-builder/constants/tools.d.ts +9 -11
- package/dist/esm/components/agent-builder/constants/tools.js +24 -21
- package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +6 -2
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +46 -43
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +209 -183
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +3 -2
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js +24 -19
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +9 -1
- package/dist/esm/components/agent-builder/utils/sourceIcons.js +15 -9
- package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentListing.js +79 -83
- package/dist/esm/components/agent-listing/AgentListing.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentListing.model.d.ts +6 -0
- package/dist/esm/components/agent-listing/AgentTable.d.ts +2 -0
- package/dist/esm/components/agent-listing/AgentTable.js +29 -27
- package/dist/esm/components/agent-listing/AgentTable.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentTableRow.d.ts +2 -0
- package/dist/esm/components/agent-listing/AgentTableRow.js +51 -37
- package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/esm/components/agent-listing/AiAgentsEmptyState.d.ts +22 -0
- package/dist/esm/components/agent-listing/AiAgentsEmptyState.js +22 -0
- package/dist/esm/components/agent-listing/AiAgentsEmptyState.js.map +1 -0
- package/dist/esm/editor/BikEditor.js +129 -126
- package/dist/esm/editor/BikEditor.js.map +1 -1
- package/dist/esm/editor/BikEditor.styles.js +24 -19
- package/dist/esm/editor/BikEditor.styles.js.map +1 -1
- package/dist/esm/editor/BikEditor.types.d.ts +17 -0
- package/dist/esm/editor/BikEditor.types.js.map +1 -1
- package/dist/esm/editor/extensions/buildExtensions.d.ts +7 -0
- package/dist/esm/editor/extensions/buildExtensions.js +30 -24
- package/dist/esm/editor/extensions/buildExtensions.js.map +1 -1
- package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.d.ts +20 -3
- package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.js +40 -25
- package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
- package/dist/esm/editor/extensions/mention/MentionChipNodeView.d.ts +17 -0
- package/dist/esm/editor/extensions/mention/MentionChipNodeView.js +39 -0
- package/dist/esm/editor/extensions/mention/MentionChipNodeView.js.map +1 -0
- package/dist/esm/editor/extensions/mention/MentionExtension.d.ts +1 -1
- package/dist/esm/editor/extensions/mention/MentionExtension.js +67 -45
- package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
- package/dist/esm/icons/Informational/Common UI/ShieldOutline.d.ts +7 -0
- package/dist/esm/icons/Informational/Common UI/ShieldOutline.js +35 -0
- package/dist/esm/icons/Informational/Common UI/ShieldOutline.js.map +1 -0
- package/dist/esm/icons/Informational/Common UI/index.d.ts +1 -0
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/icons/index.js +172 -170
- package/dist/esm/icons/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,300 +1,319 @@
|
|
|
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 { CATEGORIES as
|
|
10
|
-
import { toolSourceLabel as
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
items:
|
|
15
|
-
onSelect:
|
|
16
|
-
registerKeyHandler:
|
|
17
|
-
onClose:
|
|
18
|
-
onCreateSubAgent:
|
|
19
|
-
initialSource:
|
|
20
|
-
toolActions:
|
|
21
|
-
integrationStatus:
|
|
22
|
-
onConnectIntegration:
|
|
1
|
+
import { jsxs as k, jsx as s, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
+
import ie from "../../../assets/icons/chevronRight.svg.js";
|
|
3
|
+
import le from "../../../assets/icons/searchIcon.svg.js";
|
|
4
|
+
import ae from "../../../icons/Arrows/Normal arrows/ArrowLeft.js";
|
|
5
|
+
import { useState as A, useMemo as y, useEffect as U, useRef as ce } from "react";
|
|
6
|
+
import h from "styled-components";
|
|
7
|
+
import { TitleSmall as se, BodySecondary as de, BodyCaption as ue } from "../../TypographyStyle.js";
|
|
8
|
+
import { COLORS as o } from "../../../constants/Theme.js";
|
|
9
|
+
import { CATEGORIES as pe, isIntegrationSource as j, toolSourceRank as F, CONFIG_TOOL_SOURCES as he, INTEGRATIONS_RANK as fe } from "../constants/tools.js";
|
|
10
|
+
import { toolSourceLabel as J } from "../utils/mentionSerialization.js";
|
|
11
|
+
import { renderSourceIcon as H, sourceIcon as P } from "../utils/sourceIcons.js";
|
|
12
|
+
import ee from "../../../icons/Informational/Common UI/Shield.js";
|
|
13
|
+
const b = (a) => a.meta, C = (a) => b(a)?.plainLabel ?? a.label, ge = "__bik_create_subagent__", Ne = ({
|
|
14
|
+
items: a,
|
|
15
|
+
onSelect: $,
|
|
16
|
+
registerKeyHandler: L,
|
|
17
|
+
onClose: w,
|
|
18
|
+
onCreateSubAgent: I,
|
|
19
|
+
initialSource: Q,
|
|
20
|
+
toolActions: v,
|
|
21
|
+
integrationStatus: V,
|
|
22
|
+
onConnectIntegration: W
|
|
23
23
|
}) => {
|
|
24
|
-
const [
|
|
25
|
-
() =>
|
|
26
|
-
[
|
|
27
|
-
),
|
|
28
|
-
() =>
|
|
29
|
-
[
|
|
30
|
-
),
|
|
24
|
+
const [te, z] = A(null), [c, B] = A(Q ?? null), [R, D] = A(null), [_, m] = A(-1), [S, X] = A(""), x = y(
|
|
25
|
+
() => a.filter((e) => b(e)?.kind === "tool"),
|
|
26
|
+
[a]
|
|
27
|
+
), T = y(
|
|
28
|
+
() => a.filter((e) => b(e)?.kind === "subagent"),
|
|
29
|
+
[a]
|
|
30
|
+
), N = y(() => {
|
|
31
31
|
const e = [];
|
|
32
|
-
return
|
|
33
|
-
const f =
|
|
32
|
+
return x.forEach((r) => {
|
|
33
|
+
const f = b(r)?.source ?? "other";
|
|
34
34
|
e.includes(f) || e.push(f);
|
|
35
35
|
}), e;
|
|
36
|
-
}, [
|
|
36
|
+
}, [x]), M = y(
|
|
37
37
|
() => new Map(
|
|
38
|
-
(
|
|
38
|
+
(v ?? []).map((e) => [e.source, e])
|
|
39
39
|
),
|
|
40
|
-
[
|
|
41
|
-
),
|
|
42
|
-
() =>
|
|
43
|
-
(e) => e.key === "tool" ?
|
|
40
|
+
[v]
|
|
41
|
+
), E = y(
|
|
42
|
+
() => pe.filter(
|
|
43
|
+
(e) => e.key === "tool" ? x.length > 0 || (v?.length ?? 0) > 0 : T.length > 0 || !!I
|
|
44
44
|
),
|
|
45
|
-
[
|
|
46
|
-
),
|
|
45
|
+
[x.length, T.length, I, v?.length]
|
|
46
|
+
), G = E.length === 1 ? E[0].key : null, d = te ?? G, u = d ? d === "subagent" ? (
|
|
47
47
|
// Always titled — with a back arrow only when the category chooser is above.
|
|
48
48
|
{
|
|
49
49
|
title: "Sub-agent",
|
|
50
|
-
onBack:
|
|
50
|
+
onBack: G ? void 0 : () => z(null)
|
|
51
51
|
}
|
|
52
52
|
) : c ? {
|
|
53
|
-
title:
|
|
53
|
+
title: J(c),
|
|
54
54
|
// Deep-linked to a source (opened from a right-panel source button):
|
|
55
|
-
// that source IS the root, so no back arrow.
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
// that source IS the root, so no back arrow. Otherwise back clears the
|
|
56
|
+
// source — returning to the Integrations group if we came via it (its
|
|
57
|
+
// `group` state is untouched), else to the source chooser.
|
|
58
|
+
onBack: Q ? void 0 : () => B(null),
|
|
59
|
+
icon: P(c)
|
|
60
|
+
} : R === "integrations" ? { title: "Integrations", onBack: () => D(null) } : (
|
|
60
61
|
// Always titled — matches the Sub-agent header; back arrow only when the
|
|
61
62
|
// category chooser is above (i.e. not the sole category).
|
|
62
63
|
{
|
|
63
64
|
title: "Tools",
|
|
64
|
-
onBack:
|
|
65
|
+
onBack: G ? void 0 : () => z(null)
|
|
65
66
|
}
|
|
66
|
-
) : null,
|
|
67
|
+
) : null, l = y(() => {
|
|
67
68
|
if (!d)
|
|
68
|
-
return
|
|
69
|
+
return E.map((n) => ({
|
|
69
70
|
id: n.key,
|
|
70
71
|
label: n.label,
|
|
71
72
|
drillsIn: !0,
|
|
72
73
|
onActivate: () => {
|
|
73
|
-
|
|
74
|
+
z(n.key), B(null), D(null);
|
|
74
75
|
}
|
|
75
76
|
}));
|
|
76
77
|
if (d === "subagent") {
|
|
77
|
-
const n =
|
|
78
|
-
id: String(
|
|
79
|
-
label:
|
|
78
|
+
const n = S.trim().toLowerCase(), p = T.filter((g) => !n || C(g).toLowerCase().includes(n)).map((g) => ({
|
|
79
|
+
id: String(g.id),
|
|
80
|
+
label: C(g),
|
|
80
81
|
drillsIn: !1,
|
|
81
|
-
onActivate: () =>
|
|
82
|
+
onActivate: () => $(g)
|
|
82
83
|
}));
|
|
83
|
-
return
|
|
84
|
-
id:
|
|
84
|
+
return I && p.push({
|
|
85
|
+
id: ge,
|
|
85
86
|
label: "Create new",
|
|
86
87
|
drillsIn: !1,
|
|
87
88
|
isCreate: !0,
|
|
88
89
|
onActivate: () => {
|
|
89
|
-
|
|
90
|
+
w?.(), I();
|
|
90
91
|
}
|
|
91
|
-
}),
|
|
92
|
+
}), p;
|
|
92
93
|
}
|
|
93
94
|
if (!c) {
|
|
94
|
-
const n = (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if ((r !== void 0 ? r.connected : U?.[t]) === !1)
|
|
95
|
+
const n = (v ?? []).map((t) => t.source).filter((t) => !N.includes(t)), p = [...N, ...n], g = (t) => {
|
|
96
|
+
const i = M.get(t);
|
|
97
|
+
if ((i !== void 0 ? i.connected : V?.[t]) === !1)
|
|
98
98
|
return {
|
|
99
99
|
id: t,
|
|
100
|
-
label:
|
|
100
|
+
label: J(t),
|
|
101
101
|
drillsIn: !1,
|
|
102
|
-
icon:
|
|
102
|
+
icon: P(t) ?? i?.icon,
|
|
103
103
|
rightLabel: "Connect",
|
|
104
104
|
onActivate: () => {
|
|
105
|
-
|
|
105
|
+
w?.(), i?.onConnect ? i.onConnect() : W?.(t);
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
const
|
|
109
|
-
(
|
|
108
|
+
const K = x.filter(
|
|
109
|
+
(q) => (b(q)?.source ?? "other") === t
|
|
110
110
|
);
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
111
|
+
if (K.length + (i ? 1 : 0) === 1) {
|
|
112
|
+
const q = P(t) ?? i?.icon;
|
|
113
|
+
if (i)
|
|
114
114
|
return {
|
|
115
115
|
id: t,
|
|
116
|
-
label:
|
|
116
|
+
label: i.label,
|
|
117
117
|
drillsIn: !1,
|
|
118
|
-
icon:
|
|
118
|
+
icon: q,
|
|
119
119
|
onActivate: () => {
|
|
120
|
-
|
|
120
|
+
w?.(), i.onSelect();
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
|
-
const
|
|
123
|
+
const O = K[0];
|
|
124
124
|
return {
|
|
125
|
-
id: String(
|
|
126
|
-
label:
|
|
125
|
+
id: String(O.id),
|
|
126
|
+
label: C(O),
|
|
127
127
|
drillsIn: !1,
|
|
128
|
-
icon:
|
|
129
|
-
authRequired:
|
|
130
|
-
onActivate: () =>
|
|
128
|
+
icon: q,
|
|
129
|
+
authRequired: b(O)?.authRequired,
|
|
130
|
+
onActivate: () => $(O)
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
return {
|
|
134
134
|
id: t,
|
|
135
|
-
label:
|
|
135
|
+
label: J(t),
|
|
136
136
|
drillsIn: !0,
|
|
137
|
-
icon:
|
|
138
|
-
onActivate: () =>
|
|
137
|
+
icon: P(t) ?? i?.icon,
|
|
138
|
+
onActivate: () => B(t)
|
|
139
139
|
};
|
|
140
|
-
}
|
|
140
|
+
};
|
|
141
|
+
if (R === "integrations")
|
|
142
|
+
return p.filter(j).sort((t, i) => F(t) - F(i)).map(g);
|
|
143
|
+
const Z = p.filter((t) => !j(t)).map((t) => ({ rank: F(t), row: g(t) }));
|
|
144
|
+
return p.some(j) && Z.push({
|
|
145
|
+
rank: fe,
|
|
146
|
+
row: {
|
|
147
|
+
id: "__integrations__",
|
|
148
|
+
label: "Integrations",
|
|
149
|
+
drillsIn: !0,
|
|
150
|
+
onActivate: () => {
|
|
151
|
+
D("integrations"), B(null);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}), Z.sort((t, i) => t.rank - i.rank).map((t) => t.row);
|
|
141
155
|
}
|
|
142
|
-
const e =
|
|
156
|
+
const e = S.trim().toLowerCase(), r = x.filter((n) => (b(n)?.source ?? "other") === c).filter((n) => !e || C(n).toLowerCase().includes(e)).map((n) => ({
|
|
143
157
|
id: String(n.id),
|
|
144
|
-
label:
|
|
158
|
+
label: C(n),
|
|
145
159
|
drillsIn: !1,
|
|
146
|
-
authRequired:
|
|
147
|
-
onActivate: () =>
|
|
148
|
-
})), f =
|
|
160
|
+
authRequired: b(n)?.authRequired,
|
|
161
|
+
onActivate: () => $(n)
|
|
162
|
+
})), f = M.get(c);
|
|
149
163
|
if (f) {
|
|
150
|
-
const n = c in
|
|
151
|
-
|
|
164
|
+
const n = c in he;
|
|
165
|
+
r.push({
|
|
152
166
|
id: `create:${c}`,
|
|
153
167
|
label: f.label,
|
|
154
168
|
drillsIn: !1,
|
|
155
169
|
isCreate: !n,
|
|
156
170
|
onActivate: () => {
|
|
157
|
-
|
|
171
|
+
w?.(), f.onSelect();
|
|
158
172
|
}
|
|
159
173
|
});
|
|
160
174
|
}
|
|
161
|
-
return
|
|
175
|
+
return r;
|
|
162
176
|
}, [
|
|
163
177
|
d,
|
|
164
|
-
|
|
178
|
+
E,
|
|
165
179
|
c,
|
|
166
|
-
|
|
167
|
-
m,
|
|
168
|
-
L,
|
|
169
|
-
P,
|
|
180
|
+
R,
|
|
170
181
|
S,
|
|
171
|
-
k,
|
|
172
|
-
y,
|
|
173
182
|
x,
|
|
174
183
|
T,
|
|
175
|
-
|
|
176
|
-
|
|
184
|
+
N,
|
|
185
|
+
$,
|
|
186
|
+
w,
|
|
187
|
+
I,
|
|
188
|
+
v,
|
|
189
|
+
M,
|
|
190
|
+
V,
|
|
191
|
+
W
|
|
177
192
|
]);
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
193
|
+
U(
|
|
194
|
+
() => m(-1),
|
|
195
|
+
[d, c, R, S, a]
|
|
196
|
+
), U(() => X(""), [d, c, R]);
|
|
197
|
+
const Y = ce({ rows: l, activeIndex: _, header: u });
|
|
198
|
+
Y.current = { rows: l, activeIndex: _, header: u }, U(() => {
|
|
199
|
+
if (L)
|
|
200
|
+
return L((e) => {
|
|
201
|
+
const { rows: r, activeIndex: f, header: n } = Y.current;
|
|
184
202
|
switch (e.key) {
|
|
185
203
|
case "ArrowDown":
|
|
186
|
-
return
|
|
204
|
+
return r.length && m((p) => (p + 1) % r.length), !0;
|
|
187
205
|
case "ArrowUp":
|
|
188
|
-
return
|
|
206
|
+
return r.length && m((p) => (p + r.length - 1) % r.length), !0;
|
|
189
207
|
case "ArrowRight":
|
|
190
208
|
case "Enter":
|
|
191
|
-
return (
|
|
209
|
+
return (r[f] ?? r[0])?.onActivate(), !0;
|
|
192
210
|
case "ArrowLeft":
|
|
193
211
|
return n?.onBack ? (n.onBack(), !0) : !1;
|
|
194
212
|
default:
|
|
195
213
|
return !1;
|
|
196
214
|
}
|
|
197
|
-
}), () =>
|
|
198
|
-
}, [
|
|
199
|
-
const
|
|
200
|
-
return /* @__PURE__ */
|
|
201
|
-
u && /* @__PURE__ */
|
|
202
|
-
|
|
215
|
+
}), () => L(null);
|
|
216
|
+
}, [L]);
|
|
217
|
+
const ne = d ? l.length && !l[0].drillsIn ? "items" : "sources" : "categories", re = d === "tool" && !!c || d === "subagent";
|
|
218
|
+
return /* @__PURE__ */ k(be, { className: `bik-mention-picker bik-mention-picker--${ne}`, children: [
|
|
219
|
+
u && /* @__PURE__ */ k(
|
|
220
|
+
Re,
|
|
203
221
|
{
|
|
204
222
|
type: "button",
|
|
205
223
|
onClick: u.onBack,
|
|
206
224
|
disabled: !u.onBack,
|
|
207
225
|
style: {
|
|
208
|
-
background:
|
|
226
|
+
background: o.surface.subdued,
|
|
209
227
|
cursor: u.onBack ? "pointer" : "default"
|
|
210
228
|
},
|
|
211
229
|
children: [
|
|
212
230
|
u.onBack && /* @__PURE__ */ s(
|
|
213
|
-
|
|
231
|
+
ae,
|
|
214
232
|
{
|
|
215
233
|
width: 20,
|
|
216
234
|
height: 20,
|
|
217
|
-
color:
|
|
235
|
+
color: o.content.primary
|
|
218
236
|
}
|
|
219
237
|
),
|
|
220
|
-
u.icon &&
|
|
221
|
-
/* @__PURE__ */
|
|
238
|
+
u.icon && H(u.icon),
|
|
239
|
+
/* @__PURE__ */ k(se, { children: [
|
|
222
240
|
" ",
|
|
223
241
|
u.title
|
|
224
242
|
] })
|
|
225
243
|
]
|
|
226
244
|
}
|
|
227
245
|
),
|
|
228
|
-
|
|
246
|
+
re && /* @__PURE__ */ k(me, { children: [
|
|
229
247
|
/* @__PURE__ */ s(
|
|
230
|
-
|
|
248
|
+
le,
|
|
231
249
|
{
|
|
232
250
|
width: 20,
|
|
233
251
|
height: 20,
|
|
234
|
-
color:
|
|
252
|
+
color: o.content.placeholder
|
|
235
253
|
}
|
|
236
254
|
),
|
|
237
255
|
/* @__PURE__ */ s(
|
|
238
|
-
|
|
256
|
+
xe,
|
|
239
257
|
{
|
|
240
258
|
autoFocus: !0,
|
|
241
|
-
value:
|
|
259
|
+
value: S,
|
|
242
260
|
placeholder: "Search",
|
|
243
261
|
"data-test": "mention-picker-search",
|
|
244
|
-
onChange: (e) =>
|
|
262
|
+
onChange: (e) => X(e.target.value),
|
|
245
263
|
onKeyDown: (e) => {
|
|
246
|
-
|
|
264
|
+
l.length && (e.key === "ArrowDown" ? (e.preventDefault(), m((r) => (r + 1) % l.length)) : e.key === "ArrowUp" ? (e.preventDefault(), m((r) => (r + l.length - 1) % l.length)) : e.key === "Enter" && (e.preventDefault(), (l[_] ?? l[0])?.onActivate()));
|
|
247
265
|
}
|
|
248
266
|
}
|
|
249
267
|
)
|
|
250
268
|
] }),
|
|
251
|
-
|
|
252
|
-
|
|
269
|
+
l.length === 0 ? /* @__PURE__ */ s(Se, { children: d === "subagent" ? null : "No tools available" }) : l.map((e, r) => /* @__PURE__ */ s(
|
|
270
|
+
ke,
|
|
253
271
|
{
|
|
254
272
|
type: "button",
|
|
255
|
-
$active:
|
|
256
|
-
onMouseEnter: () =>
|
|
257
|
-
onMouseLeave: () =>
|
|
273
|
+
$active: r === _,
|
|
274
|
+
onMouseEnter: () => m(r),
|
|
275
|
+
onMouseLeave: () => m(-1),
|
|
258
276
|
onClick: e.onActivate,
|
|
259
|
-
children: e.isCreate ? /* @__PURE__ */ s(
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
|
|
262
|
-
/* @__PURE__ */ s(
|
|
277
|
+
children: e.isCreate ? /* @__PURE__ */ s(Ie, { children: e.label }) : /* @__PURE__ */ k(oe, { children: [
|
|
278
|
+
/* @__PURE__ */ k(ve, { children: [
|
|
279
|
+
H(e.icon),
|
|
280
|
+
/* @__PURE__ */ s(de, { color: o.content.primary, children: e.label }),
|
|
263
281
|
e.authRequired && /* @__PURE__ */ s(
|
|
264
|
-
|
|
282
|
+
ee,
|
|
265
283
|
{
|
|
266
|
-
size:
|
|
267
|
-
"aria-label": "
|
|
284
|
+
size: 16,
|
|
285
|
+
"aria-label": "This tool requires customer verification"
|
|
268
286
|
}
|
|
269
287
|
)
|
|
270
288
|
] }),
|
|
271
|
-
e.rightLabel ? /* @__PURE__ */ s(
|
|
289
|
+
e.rightLabel ? /* @__PURE__ */ s(we, { children: e.rightLabel }) : e.drillsIn && /* @__PURE__ */ s(ie, { width: 12, height: 12 })
|
|
272
290
|
] })
|
|
273
291
|
},
|
|
274
292
|
e.id
|
|
275
293
|
)),
|
|
276
|
-
|
|
277
|
-
/* @__PURE__ */ s(
|
|
278
|
-
/* @__PURE__ */ s(
|
|
294
|
+
l.some((e) => e.authRequired) && /* @__PURE__ */ k(ye, { children: [
|
|
295
|
+
/* @__PURE__ */ s(ee, { size: 16 }),
|
|
296
|
+
/* @__PURE__ */ s(ue, { color: o.content.secondary, children: "This tool requires customer verification" })
|
|
279
297
|
] })
|
|
280
298
|
] });
|
|
281
|
-
},
|
|
299
|
+
}, be = h.div`
|
|
282
300
|
display: flex;
|
|
283
301
|
flex-direction: column;
|
|
284
302
|
min-width: 240px;
|
|
285
303
|
max-height: 301px;
|
|
286
304
|
overflow-y: auto;
|
|
287
|
-
background: ${
|
|
288
|
-
border: 1px solid ${
|
|
305
|
+
background: ${o.surface.standard};
|
|
306
|
+
border: 1px solid ${o.stroke.primary};
|
|
289
307
|
border-radius: 4px;
|
|
290
308
|
box-shadow: 0px -2px 8px 0px #0000001f;
|
|
291
|
-
`,
|
|
309
|
+
`, me = h.div`
|
|
292
310
|
display: flex;
|
|
293
311
|
align-items: center;
|
|
294
312
|
gap: 8px;
|
|
295
313
|
padding: 10px 12px;
|
|
296
|
-
|
|
297
|
-
|
|
314
|
+
flex-shrink: 0;
|
|
315
|
+
border-bottom: 1px solid ${o.stroke.primary};
|
|
316
|
+
`, xe = h.input`
|
|
298
317
|
flex: 1;
|
|
299
318
|
min-width: 0;
|
|
300
319
|
border: none;
|
|
@@ -302,12 +321,12 @@ const h = (l) => l.meta, I = (l) => h(l)?.plainLabel ?? l.label, se = "__bik_cre
|
|
|
302
321
|
background: transparent;
|
|
303
322
|
font-family: Inter;
|
|
304
323
|
font-size: 14px;
|
|
305
|
-
color: ${
|
|
324
|
+
color: ${o.content.primary};
|
|
306
325
|
|
|
307
326
|
&::placeholder {
|
|
308
|
-
color: ${
|
|
327
|
+
color: ${o.content.placeholder};
|
|
309
328
|
}
|
|
310
|
-
`,
|
|
329
|
+
`, ke = h.button`
|
|
311
330
|
display: flex;
|
|
312
331
|
justify-content: space-between;
|
|
313
332
|
align-items: center;
|
|
@@ -315,60 +334,67 @@ const h = (l) => l.meta, I = (l) => h(l)?.plainLabel ?? l.label, se = "__bik_cre
|
|
|
315
334
|
width: 100%;
|
|
316
335
|
padding: 8px 10px;
|
|
317
336
|
height: 48px;
|
|
337
|
+
/* The card is a flex column with a max-height; without these a long list
|
|
338
|
+
compresses its rows below 48px (why only the short first step looked right)
|
|
339
|
+
instead of scrolling. Pin the row so the card scrolls instead. */
|
|
340
|
+
box-sizing: border-box;
|
|
341
|
+
flex-shrink: 0;
|
|
318
342
|
border: none;
|
|
319
|
-
border-bottom: 1px solid ${
|
|
320
|
-
background: ${(
|
|
343
|
+
border-bottom: 1px solid ${o.stroke.primary};
|
|
344
|
+
background: ${(a) => a.$active ? o.surface.subdued : "transparent"};
|
|
321
345
|
cursor: pointer;
|
|
322
346
|
text-align: left;
|
|
323
347
|
|
|
324
348
|
&:hover {
|
|
325
|
-
background: ${
|
|
349
|
+
background: ${o.surface.hovered};
|
|
326
350
|
}
|
|
327
|
-
`,
|
|
351
|
+
`, ve = h.div`
|
|
328
352
|
display: flex;
|
|
329
353
|
align-items: center;
|
|
330
354
|
gap: 12px;
|
|
331
355
|
min-width: 0;
|
|
332
|
-
`,
|
|
356
|
+
`, ye = h.div`
|
|
333
357
|
display: flex;
|
|
334
358
|
align-items: center;
|
|
335
359
|
gap: 6px;
|
|
336
360
|
padding: 8px 12px;
|
|
337
|
-
border-top: 1px solid ${
|
|
338
|
-
`,
|
|
361
|
+
border-top: 1px solid ${o.stroke.primary};
|
|
362
|
+
`, we = h.span`
|
|
339
363
|
flex-shrink: 0;
|
|
340
|
-
color: ${
|
|
364
|
+
color: ${o.content.brand};
|
|
341
365
|
font-family: Inter;
|
|
342
366
|
font-size: 14px;
|
|
343
367
|
font-weight: 600;
|
|
344
368
|
white-space: nowrap;
|
|
345
|
-
`,
|
|
369
|
+
`, Ie = h.div`
|
|
346
370
|
width: 100%;
|
|
347
371
|
text-align: center;
|
|
348
|
-
color: ${
|
|
372
|
+
color: ${o.content.brand};
|
|
349
373
|
font-family: Inter;
|
|
350
374
|
font-size: 14px;
|
|
351
375
|
font-weight: 600;
|
|
352
|
-
`,
|
|
376
|
+
`, Re = h.button`
|
|
353
377
|
display: flex;
|
|
354
378
|
align-items: center;
|
|
355
379
|
padding: 12px 16px;
|
|
356
380
|
border: none;
|
|
357
|
-
border-bottom: 1px solid ${
|
|
381
|
+
border-bottom: 1px solid ${o.stroke.primary};
|
|
358
382
|
background: transparent;
|
|
359
383
|
cursor: pointer;
|
|
360
384
|
font-family: Inter;
|
|
361
385
|
font-size: 12px;
|
|
362
386
|
font-weight: 600;
|
|
363
387
|
height: 48px;
|
|
388
|
+
box-sizing: border-box;
|
|
389
|
+
flex-shrink: 0;
|
|
364
390
|
gap: 4px;
|
|
365
|
-
`,
|
|
391
|
+
`, Se = h.div`
|
|
366
392
|
padding: 12px 10px;
|
|
367
393
|
font-family: Inter;
|
|
368
394
|
font-size: 13px;
|
|
369
|
-
color: ${
|
|
395
|
+
color: ${o.content.secondary};
|
|
370
396
|
`;
|
|
371
397
|
export {
|
|
372
|
-
|
|
398
|
+
Ne as MentionPicker
|
|
373
399
|
};
|
|
374
400
|
//# sourceMappingURL=MentionPicker.js.map
|