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