@bikdotai/bik-component-library 0.0.870 → 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/components/bik-copilot/CopilotPanel.js +1 -1
- package/dist/cjs/components/bik-copilot/CopilotPanel.js.map +1 -1
- package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js +1 -1
- package/dist/cjs/components/bik-copilot/useCopilotStreamChat.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/components/bik-copilot/CopilotPanel.js +235 -244
- package/dist/esm/components/bik-copilot/CopilotPanel.js.map +1 -1
- package/dist/esm/components/bik-copilot/model.d.ts +4 -2
- package/dist/esm/components/bik-copilot/useCopilotStreamChat.d.ts +0 -18
- package/dist/esm/components/bik-copilot/useCopilotStreamChat.js +168 -163
- package/dist/esm/components/bik-copilot/useCopilotStreamChat.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,130 +1,148 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useState as
|
|
1
|
+
import { jsx as o, jsxs as d, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import ue from "../../../assets/icons/delete.svg.js";
|
|
3
|
+
import he from "../../../assets/icons/edit.svg.js";
|
|
4
|
+
import U from "../../../assets/icons/plus.svg.js";
|
|
5
|
+
import { useState as S, useRef as X, useEffect as fe } from "react";
|
|
6
6
|
import D from "styled-components";
|
|
7
|
-
import { TitleSmall as
|
|
8
|
-
import { COLORS as
|
|
9
|
-
import { SideSection as
|
|
10
|
-
import { isIntegrationSource as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
import { TitleSmall as pe, BodyCaption as w, BodySecondary as Y } from "../../TypographyStyle.js";
|
|
8
|
+
import { COLORS as s } from "../../../constants/Theme.js";
|
|
9
|
+
import { SideSection as me, SideSectionHeader as Se, AddIconButton as be, SourceButtonRow as ge, SourceButton as Z, SelectableRow as ve, RowLabel as ye, RowText as we, RowActions as $e, RowMenuButton as P, RowActionDivider as Ce } from "../AgentBuilder.styled.js";
|
|
10
|
+
import { isIntegrationSource as ke } from "../constants/tools.js";
|
|
11
|
+
import { toolSourceLabel as Ee } from "../utils/mentionSerialization.js";
|
|
12
|
+
import { renderSourceIcon as I, sourceIcon as Re } from "../utils/sourceIcons.js";
|
|
13
|
+
import { MentionPicker as Ae } from "./MentionPicker.js";
|
|
14
|
+
import { Dropdown as G } from "../../dropdown/Dropdown.js";
|
|
15
|
+
import { unwrapDropdownValue as T } from "../../dropdown/utils.js";
|
|
16
|
+
import { Button as Ie } from "../../button/Button.js";
|
|
17
|
+
import { DeleteConfirmationModal as De } from "../../states-modal/DeleteConfirmationModal.js";
|
|
18
|
+
import { Tooltip as $ } from "../../tooltips/Tooltip.js";
|
|
19
|
+
import _e from "../../../icons/Informational/Common UI/Shield.js";
|
|
20
|
+
const O = "__bik_create_new__", Te = ({
|
|
21
|
+
title: u,
|
|
21
22
|
helper: _,
|
|
22
|
-
items:
|
|
23
|
-
addableOptions:
|
|
24
|
-
onAdd:
|
|
25
|
-
onRemove:
|
|
26
|
-
dataTestPrefix:
|
|
27
|
-
emptyText:
|
|
28
|
-
createOption:
|
|
29
|
-
onConfigure:
|
|
30
|
-
sourceGroups:
|
|
23
|
+
items: h,
|
|
24
|
+
addableOptions: b,
|
|
25
|
+
onAdd: g,
|
|
26
|
+
onRemove: B,
|
|
27
|
+
dataTestPrefix: c,
|
|
28
|
+
emptyText: ne,
|
|
29
|
+
createOption: l,
|
|
30
|
+
onConfigure: L,
|
|
31
|
+
sourceGroups: f,
|
|
31
32
|
mentionItems: C,
|
|
32
|
-
actionSources:
|
|
33
|
-
confirmDelete:
|
|
34
|
-
pickerOpensUp:
|
|
35
|
-
appLabel:
|
|
33
|
+
actionSources: z,
|
|
34
|
+
confirmDelete: m,
|
|
35
|
+
pickerOpensUp: x,
|
|
36
|
+
appLabel: M,
|
|
37
|
+
integrationStatus: oe,
|
|
38
|
+
onConnectIntegration: te
|
|
36
39
|
}) => {
|
|
37
|
-
const [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
const [p, r] = S(!1), [H, k] = S(null), [j, q] = S(null), [le, E] = S(null), v = !!f && f.length > 0, W = (() => {
|
|
41
|
+
const e = [], n = /* @__PURE__ */ new Map();
|
|
42
|
+
return (z ?? []).filter((t) => t.connected !== !1).forEach((t) => {
|
|
43
|
+
n.has(t.source) || (n.set(t.source, []), e.push(t.source)), n.get(t.source)?.push(t);
|
|
44
|
+
}), e.map((t) => {
|
|
45
|
+
const a = n.get(t) ?? [];
|
|
46
|
+
return {
|
|
47
|
+
source: t,
|
|
48
|
+
actions: a,
|
|
49
|
+
icon: a[0].icon,
|
|
50
|
+
// One capability reads as itself ("Send email"); several read as the
|
|
51
|
+
// brand that holds them ("Google Sheets").
|
|
52
|
+
label: a.length > 1 ? Ee(t, M) : a[0].label
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
})(), R = f?.find((e) => e.source === le), i = C !== void 0, F = X(null), K = X(null), [y, A] = S(null);
|
|
56
|
+
fe(() => {
|
|
57
|
+
if (!i || !p)
|
|
40
58
|
return;
|
|
41
|
-
const e = (
|
|
42
|
-
const
|
|
43
|
-
!
|
|
44
|
-
},
|
|
45
|
-
|
|
59
|
+
const e = (t) => {
|
|
60
|
+
const a = t.target;
|
|
61
|
+
!F.current?.contains(a) && !K.current?.contains(a) && r(!1);
|
|
62
|
+
}, n = (t) => {
|
|
63
|
+
t.key === "Escape" && r(!1);
|
|
46
64
|
};
|
|
47
|
-
return document.addEventListener("mousedown", e), document.addEventListener("keydown",
|
|
48
|
-
document.removeEventListener("mousedown", e), document.removeEventListener("keydown",
|
|
65
|
+
return document.addEventListener("mousedown", e), document.addEventListener("keydown", n), () => {
|
|
66
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", n);
|
|
49
67
|
};
|
|
50
|
-
}, [
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
if ((C?.length ?? 0) === 0 &&
|
|
54
|
-
|
|
68
|
+
}, [i, p]);
|
|
69
|
+
const re = v ? i || h.length > 0 : i || b.length > 0 || !!l && h.length > 0, ce = h.length === 0 && !!l && !v && !i, N = W.length > 0, ie = (v || N) && h.length === 0, de = () => {
|
|
70
|
+
if (i) {
|
|
71
|
+
if ((C?.length ?? 0) === 0 && l) {
|
|
72
|
+
l.onSelect();
|
|
55
73
|
return;
|
|
56
74
|
}
|
|
57
|
-
|
|
75
|
+
A(null), r((e) => !e);
|
|
58
76
|
return;
|
|
59
77
|
}
|
|
60
|
-
if (
|
|
61
|
-
E(null),
|
|
78
|
+
if (v) {
|
|
79
|
+
E(null), r((e) => !e);
|
|
62
80
|
return;
|
|
63
81
|
}
|
|
64
|
-
if (
|
|
65
|
-
|
|
82
|
+
if (b.length === 0 && l) {
|
|
83
|
+
l.onSelect();
|
|
66
84
|
return;
|
|
67
85
|
}
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
if (
|
|
86
|
+
r((e) => !e);
|
|
87
|
+
}, se = (e, n) => {
|
|
88
|
+
if (j)
|
|
71
89
|
return;
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
const
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
|
|
90
|
+
const t = n();
|
|
91
|
+
t && typeof t.then == "function" && (q(e), t.finally(() => q(null)));
|
|
92
|
+
}, ae = () => h.map((e) => {
|
|
93
|
+
const n = e.onConfigure ?? (L ? () => L(e.id) : void 0);
|
|
94
|
+
return /* @__PURE__ */ d(
|
|
95
|
+
ve,
|
|
78
96
|
{
|
|
79
|
-
"data-test": `${
|
|
97
|
+
"data-test": `${c}-row-${e.id}`,
|
|
80
98
|
children: [
|
|
81
99
|
I(e.icon),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ d(ye, { children: [
|
|
101
|
+
/* @__PURE__ */ o($, { body: e.label, placement: "top", children: /* @__PURE__ */ o(we, { children: /* @__PURE__ */ o(Y, { numberOfLines: 1, color: s.content.primary, children: e.label }) }) }),
|
|
84
102
|
e.authRequired && // Order tools touch customer-private data — the shield flags that
|
|
85
103
|
// this agent must verify the customer before the tool can run.
|
|
86
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ o($, { body: "Requires customer verification", placement: "top", children: /* @__PURE__ */ o(
|
|
87
105
|
"span",
|
|
88
106
|
{
|
|
89
|
-
"data-test": `${
|
|
107
|
+
"data-test": `${c}-auth-${e.id}`,
|
|
90
108
|
style: { display: "inline-flex", flexShrink: 0 },
|
|
91
|
-
children: /* @__PURE__ */
|
|
109
|
+
children: /* @__PURE__ */ o(_e, { size: 16 })
|
|
92
110
|
}
|
|
93
111
|
) })
|
|
94
112
|
] }),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
113
|
+
/* @__PURE__ */ d($e, { children: [
|
|
114
|
+
n && // Configurable rows (sub-agents, Rest API / email tools) get an
|
|
97
115
|
// always-visible edit icon.
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
116
|
+
/* @__PURE__ */ o($, { body: "Edit", placement: "top", children: /* @__PURE__ */ o(
|
|
117
|
+
P,
|
|
100
118
|
{
|
|
101
|
-
"data-test": `${
|
|
119
|
+
"data-test": `${c}-edit-${e.id}`,
|
|
102
120
|
"aria-label": `Edit ${e.label}`,
|
|
103
|
-
disabled:
|
|
104
|
-
onClick: () =>
|
|
105
|
-
children: /* @__PURE__ */
|
|
106
|
-
|
|
121
|
+
disabled: j !== null,
|
|
122
|
+
onClick: () => se(e.id, n),
|
|
123
|
+
children: /* @__PURE__ */ o(
|
|
124
|
+
he,
|
|
107
125
|
{
|
|
108
126
|
width: 16,
|
|
109
127
|
height: 16,
|
|
110
|
-
color:
|
|
128
|
+
color: s.content.secondary
|
|
111
129
|
}
|
|
112
130
|
)
|
|
113
131
|
}
|
|
114
132
|
) }),
|
|
115
|
-
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
|
|
133
|
+
n && /* @__PURE__ */ o(Ce, { "aria-hidden": !0 }),
|
|
134
|
+
/* @__PURE__ */ o($, { body: "Delete", placement: "top", children: /* @__PURE__ */ o(
|
|
135
|
+
P,
|
|
118
136
|
{
|
|
119
|
-
"data-test": `${
|
|
137
|
+
"data-test": `${c}-delete-${e.id}`,
|
|
120
138
|
"aria-label": `Delete ${e.label}`,
|
|
121
|
-
onClick: () =>
|
|
122
|
-
children: /* @__PURE__ */
|
|
123
|
-
|
|
139
|
+
onClick: () => m ? k(e.id) : B(e.id),
|
|
140
|
+
children: /* @__PURE__ */ o(
|
|
141
|
+
ue,
|
|
124
142
|
{
|
|
125
143
|
width: 16,
|
|
126
144
|
height: 16,
|
|
127
|
-
color:
|
|
145
|
+
color: s.content.secondary
|
|
128
146
|
}
|
|
129
147
|
)
|
|
130
148
|
}
|
|
@@ -134,221 +152,228 @@ const G = "__bik_create_new__", Xe = ({
|
|
|
134
152
|
},
|
|
135
153
|
e.id
|
|
136
154
|
);
|
|
137
|
-
}),
|
|
138
|
-
...
|
|
155
|
+
}), V = l ? [
|
|
156
|
+
...b,
|
|
139
157
|
{
|
|
140
|
-
label:
|
|
141
|
-
value:
|
|
142
|
-
searchKey:
|
|
143
|
-
customComponent: /* @__PURE__ */
|
|
158
|
+
label: l.label,
|
|
159
|
+
value: O,
|
|
160
|
+
searchKey: l.label,
|
|
161
|
+
customComponent: /* @__PURE__ */ o(
|
|
144
162
|
"div",
|
|
145
163
|
{
|
|
146
164
|
style: {
|
|
147
165
|
width: "100%",
|
|
148
166
|
textAlign: "center",
|
|
149
|
-
color:
|
|
167
|
+
color: s.content.brand,
|
|
150
168
|
fontFamily: "Inter",
|
|
151
169
|
fontSize: 14,
|
|
152
170
|
fontWeight: 600
|
|
153
171
|
},
|
|
154
|
-
children:
|
|
172
|
+
children: l.label
|
|
155
173
|
}
|
|
156
174
|
)
|
|
157
175
|
}
|
|
158
|
-
] :
|
|
159
|
-
|
|
176
|
+
] : b, J = i ? /* @__PURE__ */ o(
|
|
177
|
+
Ae,
|
|
160
178
|
{
|
|
161
179
|
items: C ?? [],
|
|
162
180
|
query: "",
|
|
163
181
|
activeIndex: 0,
|
|
164
|
-
initialSource:
|
|
182
|
+
initialSource: y ?? void 0,
|
|
165
183
|
onSelect: (e) => {
|
|
166
|
-
|
|
184
|
+
r(!1), g(String(e.id));
|
|
167
185
|
},
|
|
168
|
-
onClose: () =>
|
|
169
|
-
onCreateSubAgent:
|
|
170
|
-
|
|
186
|
+
onClose: () => r(!1),
|
|
187
|
+
onCreateSubAgent: l ? () => {
|
|
188
|
+
r(!1), l.onSelect();
|
|
171
189
|
} : void 0,
|
|
172
|
-
toolActions:
|
|
190
|
+
toolActions: N ? z?.map((e) => ({
|
|
173
191
|
...e,
|
|
174
192
|
onSelect: () => {
|
|
175
|
-
|
|
193
|
+
r(!1), e.onSelect();
|
|
176
194
|
}
|
|
177
195
|
})) : void 0,
|
|
178
|
-
integrationStatus: Object.fromEntries(
|
|
179
|
-
(
|
|
196
|
+
integrationStatus: oe ?? Object.fromEntries(
|
|
197
|
+
(f ?? []).filter((e) => e.connected !== void 0).map((e) => [e.source, e.connected])
|
|
180
198
|
),
|
|
181
199
|
onConnectIntegration: (e) => {
|
|
182
|
-
|
|
200
|
+
r(!1);
|
|
201
|
+
const n = f?.find((t) => t.source === e);
|
|
202
|
+
if (n?.onConnect) {
|
|
203
|
+
n.onConnect();
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
te?.(e);
|
|
183
207
|
},
|
|
184
|
-
appLabel:
|
|
208
|
+
appLabel: M
|
|
185
209
|
},
|
|
186
|
-
|
|
210
|
+
y ?? "__root__"
|
|
187
211
|
) : null;
|
|
188
|
-
return /* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
212
|
+
return /* @__PURE__ */ d(me, { children: [
|
|
213
|
+
/* @__PURE__ */ d(Se, { children: [
|
|
214
|
+
/* @__PURE__ */ o(pe, { color: s.content.primary, children: u }),
|
|
215
|
+
re && /* @__PURE__ */ d(Be, { ref: F, children: [
|
|
216
|
+
/* @__PURE__ */ o(
|
|
217
|
+
be,
|
|
194
218
|
{
|
|
195
|
-
"data-test": `${
|
|
196
|
-
onClick:
|
|
197
|
-
"aria-label": `Add ${
|
|
198
|
-
children: /* @__PURE__ */
|
|
219
|
+
"data-test": `${c}-add`,
|
|
220
|
+
onClick: de,
|
|
221
|
+
"aria-label": `Add ${u}`,
|
|
222
|
+
children: /* @__PURE__ */ o(U, { width: 16, height: 16, color: s.content.primary })
|
|
199
223
|
}
|
|
200
224
|
),
|
|
201
|
-
|
|
202
|
-
|
|
225
|
+
i && p && y === null && /* @__PURE__ */ o(
|
|
226
|
+
ee,
|
|
203
227
|
{
|
|
204
|
-
$up:
|
|
205
|
-
"data-test": `${
|
|
206
|
-
children:
|
|
228
|
+
$up: x,
|
|
229
|
+
"data-test": `${c}-picker`,
|
|
230
|
+
children: J
|
|
207
231
|
}
|
|
208
232
|
)
|
|
209
233
|
] })
|
|
210
234
|
] }),
|
|
211
|
-
_ && /* @__PURE__ */
|
|
212
|
-
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
|
|
235
|
+
_ && /* @__PURE__ */ o(w, { color: s.content.secondary, children: _ }),
|
|
236
|
+
ie ? /* @__PURE__ */ d(Le, { ref: i ? K : void 0, children: [
|
|
237
|
+
/* @__PURE__ */ d(ge, { "data-test": `${c}-sources`, children: [
|
|
238
|
+
f?.map((e) => {
|
|
239
|
+
const n = e.connected !== !1 && e.options.length === 1 && !ke(e.source) ? e.options[0] : void 0;
|
|
240
|
+
return /* @__PURE__ */ d(
|
|
241
|
+
Z,
|
|
218
242
|
{
|
|
219
243
|
type: "button",
|
|
220
|
-
"data-test": `${
|
|
244
|
+
"data-test": `${c}-source-${e.source}`,
|
|
221
245
|
onClick: () => {
|
|
222
246
|
if (e.connected === !1) {
|
|
223
247
|
e.onConnect?.();
|
|
224
248
|
return;
|
|
225
249
|
}
|
|
226
|
-
if (
|
|
227
|
-
|
|
250
|
+
if (n) {
|
|
251
|
+
r(!1), g(n.value);
|
|
228
252
|
return;
|
|
229
253
|
}
|
|
230
|
-
if (
|
|
231
|
-
|
|
254
|
+
if (i) {
|
|
255
|
+
A(e.source), r(!0);
|
|
232
256
|
return;
|
|
233
257
|
}
|
|
234
258
|
E(e.source);
|
|
235
259
|
},
|
|
236
260
|
children: [
|
|
237
|
-
I(
|
|
238
|
-
/* @__PURE__ */
|
|
261
|
+
I(Re(e.source), -4),
|
|
262
|
+
/* @__PURE__ */ o(w, { color: s.content.primary, children: n ? n.label : e.label }),
|
|
239
263
|
e.connected === !1 && // Not connected → show "Connect" upfront (consistent with
|
|
240
264
|
// the `@` picker); clicking runs the connect flow.
|
|
241
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ o(Y, { color: s.content.brand, children: "Connect" })
|
|
242
266
|
]
|
|
243
267
|
},
|
|
244
268
|
e.source
|
|
245
269
|
);
|
|
246
270
|
}),
|
|
247
|
-
|
|
248
|
-
|
|
271
|
+
W.map(({ source: e, label: n, icon: t, actions: a }) => /* @__PURE__ */ d(
|
|
272
|
+
Z,
|
|
249
273
|
{
|
|
250
274
|
type: "button",
|
|
251
|
-
"data-test": `${
|
|
252
|
-
onClick:
|
|
253
|
-
|
|
275
|
+
"data-test": `${c}-action-${e}`,
|
|
276
|
+
onClick: () => {
|
|
277
|
+
if (a.length > 1 && i) {
|
|
278
|
+
A(e), r(!0);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
r(!1), a[0].onSelect();
|
|
254
282
|
},
|
|
255
283
|
children: [
|
|
256
|
-
I(
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
e.connected === !1 && // Not connected → "Connect" upfront (consistent with the
|
|
259
|
-
// source buttons and the `@` picker).
|
|
260
|
-
/* @__PURE__ */ n(A, { color: d.content.brand, children: "Connect" })
|
|
284
|
+
I(t, -4),
|
|
285
|
+
/* @__PURE__ */ o(w, { color: s.content.primary, children: n })
|
|
261
286
|
]
|
|
262
287
|
},
|
|
263
|
-
e
|
|
288
|
+
e
|
|
264
289
|
))
|
|
265
290
|
] }),
|
|
266
|
-
|
|
267
|
-
|
|
291
|
+
i && p && y !== null && /* @__PURE__ */ o(
|
|
292
|
+
ee,
|
|
268
293
|
{
|
|
269
294
|
$align: "left",
|
|
270
|
-
$up:
|
|
271
|
-
"data-test": `${
|
|
272
|
-
children:
|
|
295
|
+
$up: x,
|
|
296
|
+
"data-test": `${c}-picker`,
|
|
297
|
+
children: J
|
|
273
298
|
}
|
|
274
299
|
),
|
|
275
|
-
!
|
|
276
|
-
|
|
300
|
+
!i && R && /* @__PURE__ */ o(
|
|
301
|
+
G,
|
|
277
302
|
{
|
|
278
|
-
"data-test": `${
|
|
303
|
+
"data-test": `${c}-dropdown`,
|
|
279
304
|
size: "small",
|
|
280
305
|
width: "100%",
|
|
281
306
|
isSearchable: !0,
|
|
282
307
|
placeHolder: `Search ${R.label} tools`,
|
|
283
308
|
options: R.options,
|
|
284
309
|
onSelect: (e) => {
|
|
285
|
-
const
|
|
286
|
-
E(null),
|
|
310
|
+
const n = T(e);
|
|
311
|
+
E(null), r(!1), n && g(n);
|
|
287
312
|
}
|
|
288
313
|
}
|
|
289
314
|
)
|
|
290
|
-
] }) : /* @__PURE__ */
|
|
291
|
-
!
|
|
292
|
-
|
|
315
|
+
] }) : /* @__PURE__ */ d(Q, { children: [
|
|
316
|
+
!i && p && V.length > 0 && /* @__PURE__ */ o(
|
|
317
|
+
G,
|
|
293
318
|
{
|
|
294
|
-
"data-test": `${
|
|
319
|
+
"data-test": `${c}-dropdown`,
|
|
295
320
|
size: "small",
|
|
296
321
|
width: "100%",
|
|
297
322
|
isSearchable: !0,
|
|
298
|
-
placeHolder: `Select ${
|
|
299
|
-
options:
|
|
323
|
+
placeHolder: `Select ${u.toLowerCase()}`,
|
|
324
|
+
options: V,
|
|
300
325
|
onSelect: (e) => {
|
|
301
|
-
const
|
|
302
|
-
|
|
326
|
+
const n = T(e);
|
|
327
|
+
r(!1), n && (n === O ? l?.onSelect() : g(n));
|
|
303
328
|
}
|
|
304
329
|
}
|
|
305
330
|
),
|
|
306
|
-
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
|
|
309
|
-
|
|
331
|
+
h.length === 0 && !p ? /* @__PURE__ */ d(Q, { children: [
|
|
332
|
+
/* @__PURE__ */ o(w, { color: s.content.placeholder, children: ne }),
|
|
333
|
+
ce && l && /* @__PURE__ */ o(
|
|
334
|
+
Ie,
|
|
310
335
|
{
|
|
311
|
-
"data-test": `${
|
|
336
|
+
"data-test": `${c}-create`,
|
|
312
337
|
buttonType: "secondary",
|
|
313
338
|
size: "small",
|
|
314
339
|
matchParentWidth: !0,
|
|
315
|
-
LeadingIcon:
|
|
316
|
-
buttonText:
|
|
317
|
-
onClick:
|
|
340
|
+
LeadingIcon: U,
|
|
341
|
+
buttonText: l.label,
|
|
342
|
+
onClick: l.onSelect
|
|
318
343
|
}
|
|
319
344
|
)
|
|
320
|
-
] }) :
|
|
345
|
+
] }) : ae()
|
|
321
346
|
] }),
|
|
322
|
-
|
|
323
|
-
|
|
347
|
+
m && H && /* @__PURE__ */ o(
|
|
348
|
+
De,
|
|
324
349
|
{
|
|
325
|
-
"data-test": `${
|
|
326
|
-
header: `Delete this ${
|
|
327
|
-
subHeader: `Deleting this ${
|
|
350
|
+
"data-test": `${c}-delete-confirm`,
|
|
351
|
+
header: `Delete this ${m.noun}?`,
|
|
352
|
+
subHeader: `Deleting this ${m.noun} will also remove it from your instructions, wherever it's referenced.`,
|
|
328
353
|
confirmationText: "Delete",
|
|
329
|
-
zIndex:
|
|
354
|
+
zIndex: m.zIndex,
|
|
330
355
|
onDeleteConfirmed: () => {
|
|
331
|
-
|
|
356
|
+
B(H), k(null);
|
|
332
357
|
},
|
|
333
358
|
onCancelClicked: () => k(null)
|
|
334
359
|
}
|
|
335
360
|
)
|
|
336
361
|
] });
|
|
337
|
-
},
|
|
362
|
+
}, Be = D.div`
|
|
338
363
|
position: relative;
|
|
339
364
|
display: flex;
|
|
340
|
-
`,
|
|
365
|
+
`, Le = D.div`
|
|
341
366
|
position: relative;
|
|
342
367
|
display: flex;
|
|
343
368
|
flex-direction: column;
|
|
344
369
|
gap: 8px;
|
|
345
|
-
`,
|
|
370
|
+
`, ee = D.div`
|
|
346
371
|
position: absolute;
|
|
347
|
-
${(
|
|
348
|
-
${(
|
|
372
|
+
${(u) => u.$up ? "bottom: calc(100% + 4px);" : "top: calc(100% + 4px);"}
|
|
373
|
+
${(u) => u.$align === "left" ? "left: 0;" : "right: 0;"}
|
|
349
374
|
z-index: 30;
|
|
350
375
|
`;
|
|
351
376
|
export {
|
|
352
|
-
|
|
377
|
+
Te as SelectableListSection
|
|
353
378
|
};
|
|
354
379
|
//# sourceMappingURL=SelectableListSection.js.map
|