@bikdotai/bik-component-library 0.0.841 → 0.0.842
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/MentionPicker.js +26 -20
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RequireVerificationModal.js +2 -0
- package/dist/cjs/components/agent-builder/components/RequireVerificationModal.js.map +1 -0
- 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/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 +1 -1
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/cjs/icons/Informational/Common UI/Shield.js +1 -1
- package/dist/cjs/icons/Informational/Common UI/Shield.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +31 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +142 -122
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/RequireVerificationModal.d.ts +18 -0
- package/dist/esm/components/agent-builder/components/RequireVerificationModal.js +74 -0
- package/dist/esm/components/agent-builder/components/RequireVerificationModal.js.map +1 -0
- package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +5 -0
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +117 -106
- package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +286 -204
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +2 -0
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js +41 -40
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/esm/icons/Informational/Common UI/Shield.d.ts +1 -2
- package/dist/esm/icons/Informational/Common UI/Shield.js +10 -11
- package/dist/esm/icons/Informational/Common UI/Shield.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { TitleMedium as d, BodyPrimary as c } from "../../TypographyStyle.js";
|
|
3
|
+
import { COLORS as t } from "../../../constants/Theme.js";
|
|
4
|
+
import { ModalBody as s, ModalActions as m } from "../AgentBuilder.styled.js";
|
|
5
|
+
import { StyledModal as u } from "../../modals/styledModal.js";
|
|
6
|
+
import h from "../../../icons/Informational/eCommerce/ShieldCheck.js";
|
|
7
|
+
import { Button as n } from "../../button/Button.js";
|
|
8
|
+
const C = ({ open: o, toolLabel: a, onCancel: r, onConfirm: l }) => o ? /* @__PURE__ */ e(
|
|
9
|
+
u,
|
|
10
|
+
{
|
|
11
|
+
"data-test": "agent-require-verification-modal",
|
|
12
|
+
open: !0,
|
|
13
|
+
onClose: r,
|
|
14
|
+
width: "480px",
|
|
15
|
+
children: /* @__PURE__ */ i(s, { style: { alignItems: "center", textAlign: "center" }, children: [
|
|
16
|
+
/* @__PURE__ */ e(
|
|
17
|
+
"span",
|
|
18
|
+
{
|
|
19
|
+
style: {
|
|
20
|
+
display: "inline-flex",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
justifyContent: "center",
|
|
23
|
+
width: 48,
|
|
24
|
+
height: 48,
|
|
25
|
+
borderRadius: "50%",
|
|
26
|
+
background: t.background.brandVeryLight
|
|
27
|
+
},
|
|
28
|
+
children: /* @__PURE__ */ e(h, { size: 24, color: t.content.brand })
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ e(d, { color: t.content.primary, children: "This will change who can use this agent" }),
|
|
32
|
+
/* @__PURE__ */ i(
|
|
33
|
+
c,
|
|
34
|
+
{
|
|
35
|
+
color: t.content.secondary,
|
|
36
|
+
style: { lineHeight: "24px" },
|
|
37
|
+
children: [
|
|
38
|
+
"‘",
|
|
39
|
+
a,
|
|
40
|
+
"’ always requires customer authentication. Customers will be asked to verify their identity before this agent responds, once you go live."
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ i(m, { children: [
|
|
45
|
+
/* @__PURE__ */ e("div", { style: { display: "flex" }, children: /* @__PURE__ */ e(
|
|
46
|
+
n,
|
|
47
|
+
{
|
|
48
|
+
"data-test": "agent-require-verification-cancel",
|
|
49
|
+
buttonType: "secondary",
|
|
50
|
+
size: "medium",
|
|
51
|
+
matchParentWidth: !0,
|
|
52
|
+
buttonText: "Cancel",
|
|
53
|
+
onClick: r
|
|
54
|
+
}
|
|
55
|
+
) }),
|
|
56
|
+
/* @__PURE__ */ e("div", { style: { display: "flex" }, children: /* @__PURE__ */ e(
|
|
57
|
+
n,
|
|
58
|
+
{
|
|
59
|
+
"data-test": "agent-require-verification-confirm",
|
|
60
|
+
buttonType: "primary",
|
|
61
|
+
size: "medium",
|
|
62
|
+
matchParentWidth: !0,
|
|
63
|
+
buttonText: "Add tool",
|
|
64
|
+
onClick: l
|
|
65
|
+
}
|
|
66
|
+
) })
|
|
67
|
+
] })
|
|
68
|
+
] })
|
|
69
|
+
}
|
|
70
|
+
) : null;
|
|
71
|
+
export {
|
|
72
|
+
C as RequireVerificationModal
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=RequireVerificationModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequireVerificationModal.js","sources":["../../../../../src/components/agent-builder/components/RequireVerificationModal.tsx"],"sourcesContent":["import { ShieldCheck } from '@src/icons';\nimport React from 'react';\nimport { Button } from '@src/components/button';\nimport { StyledModal } from '@src/components/modals';\nimport { BodyPrimary, TitleMedium } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { ModalActions, ModalBody } from '../AgentBuilder.styled';\n\ninterface RequireVerificationModalProps {\n\topen: boolean;\n\t/** Name of the tool being added (shown in the copy). */\n\ttoolLabel: string;\n\t/** Dismiss without adding the tool (X / outside click / Cancel). */\n\tonCancel: () => void;\n\t/** Turn on customer verification and add the tool. */\n\tonConfirm: () => void;\n}\n\n/**\n * Shown when the merchant attaches a tool that touches customer-private data\n * (`auth_required`) while customer verification is off. Verification is mandatory\n * for such tools — confirming (\"Add tool\") turns it on and adds the tool;\n * cancelling skips the add. Centred layout per Figma (node 1165-21717).\n */\nexport const RequireVerificationModal: React.FC<\n\tRequireVerificationModalProps\n> = ({ open, toolLabel, onCancel, onConfirm }) => {\n\tif (!open) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StyledModal\n\t\t\tdata-test=\"agent-require-verification-modal\"\n\t\t\topen\n\t\t\tonClose={onCancel}\n\t\t\twidth=\"480px\"\n\t\t>\n\t\t\t<ModalBody style={{ alignItems: 'center', textAlign: 'center' }}>\n\t\t\t\t<span\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tdisplay: 'inline-flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\twidth: 48,\n\t\t\t\t\t\theight: 48,\n\t\t\t\t\t\tborderRadius: '50%',\n\t\t\t\t\t\tbackground: COLORS.background.brandVeryLight,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<ShieldCheck size={24} color={COLORS.content.brand} />\n\t\t\t\t</span>\n\t\t\t\t<TitleMedium color={COLORS.content.primary}>\n\t\t\t\t\tThis will change who can use this agent\n\t\t\t\t</TitleMedium>\n\t\t\t\t<BodyPrimary\n\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\tstyle={{ lineHeight: '24px' }}\n\t\t\t\t>\n\t\t\t\t\t‘{toolLabel}’ always requires customer authentication. Customers will\n\t\t\t\t\tbe asked to verify their identity before this agent responds, once you\n\t\t\t\t\tgo live.\n\t\t\t\t</BodyPrimary>\n\n\t\t\t\t<ModalActions>\n\t\t\t\t\t<div style={{ display: 'flex' }}>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tdata-test=\"agent-require-verification-cancel\"\n\t\t\t\t\t\t\tbuttonType=\"secondary\"\n\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\tmatchParentWidth\n\t\t\t\t\t\t\tbuttonText=\"Cancel\"\n\t\t\t\t\t\t\tonClick={onCancel}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style={{ display: 'flex' }}>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tdata-test=\"agent-require-verification-confirm\"\n\t\t\t\t\t\t\tbuttonType=\"primary\"\n\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\tmatchParentWidth\n\t\t\t\t\t\t\tbuttonText=\"Add tool\"\n\t\t\t\t\t\t\tonClick={onConfirm}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</ModalActions>\n\t\t\t</ModalBody>\n\t\t</StyledModal>\n\t);\n};\n"],"names":["RequireVerificationModal","open","toolLabel","onCancel","onConfirm","jsx","StyledModal","jsxs","ModalBody","COLORS","ShieldCheck","TitleMedium","BodyPrimary","ModalActions","Button"],"mappings":";;;;;;;AAwBO,MAAMA,IAET,CAAC,EAAE,MAAAC,GAAM,WAAAC,GAAW,UAAAC,GAAU,WAAAC,QAC5BH,IAKJ,gBAAAI;AAAA,EAACC;AAAA,EAAA;AAAA,IACA,aAAU;AAAA,IACV,MAAI;AAAA,IACJ,SAASH;AAAA,IACT,OAAM;AAAA,IAEN,UAAA,gBAAAI,EAACC,KAAU,OAAO,EAAE,YAAY,UAAU,WAAW,YACpD,UAAA;AAAA,MAAA,gBAAAH;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,OAAO;AAAA,YACN,SAAS;AAAA,YACT,YAAY;AAAA,YACZ,gBAAgB;AAAA,YAChB,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,cAAc;AAAA,YACd,YAAYI,EAAO,WAAW;AAAA,UAAA;AAAA,UAG/B,4BAACC,GAAA,EAAY,MAAM,IAAI,OAAOD,EAAO,QAAQ,MAAA,CAAO;AAAA,QAAA;AAAA,MAAA;AAAA,wBAEpDE,GAAA,EAAY,OAAOF,EAAO,QAAQ,SAAS,UAAA,2CAE5C;AAAA,MACA,gBAAAF;AAAA,QAACK;AAAA,QAAA;AAAA,UACA,OAAOH,EAAO,QAAQ;AAAA,UACtB,OAAO,EAAE,YAAY,OAAA;AAAA,UACrB,UAAA;AAAA,YAAA;AAAA,YACEP;AAAA,YAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,wBAKZW,GAAA,EACA,UAAA;AAAA,QAAA,gBAAAR,EAAC,OAAA,EAAI,OAAO,EAAE,SAAS,UACtB,UAAA,gBAAAA;AAAA,UAACS;AAAA,UAAA;AAAA,YACA,aAAU;AAAA,YACV,YAAW;AAAA,YACX,MAAK;AAAA,YACL,kBAAgB;AAAA,YAChB,YAAW;AAAA,YACX,SAASX;AAAA,UAAA;AAAA,QAAA,GAEX;AAAA,0BACC,OAAA,EAAI,OAAO,EAAE,SAAS,UACtB,UAAA,gBAAAE;AAAA,UAACS;AAAA,UAAA;AAAA,YACA,aAAU;AAAA,YACV,YAAW;AAAA,YACX,MAAK;AAAA,YACL,kBAAgB;AAAA,YAChB,YAAW;AAAA,YACX,SAASV;AAAA,UAAA;AAAA,QAAA,EACV,CACD;AAAA,MAAA,EAAA,CACD;AAAA,IAAA,EAAA,CACD;AAAA,EAAA;AAAA,IA1DM;"}
|
|
@@ -8,6 +8,11 @@ export interface SelectableItem {
|
|
|
8
8
|
label: string;
|
|
9
9
|
/** Leading brand glyph (e.g. a tool's source icon). */
|
|
10
10
|
icon?: SourceIcon;
|
|
11
|
+
/**
|
|
12
|
+
* True when the tool touches customer-private data and the agent must verify
|
|
13
|
+
* the customer first (backend `auth_required`). Shows a shield glyph on the row.
|
|
14
|
+
*/
|
|
15
|
+
authRequired?: boolean;
|
|
11
16
|
/**
|
|
12
17
|
* When set, this row shows an edit (Configure) icon that calls this instead of
|
|
13
18
|
* the section-level `onConfigure`. Use for rows that open their own drawer
|
|
@@ -2,63 +2,64 @@ import { jsx as n, jsxs as d, Fragment as U } from "react/jsx-runtime";
|
|
|
2
2
|
import ie from "../../../assets/icons/delete.svg.js";
|
|
3
3
|
import de from "../../../assets/icons/edit.svg.js";
|
|
4
4
|
import J from "../../../assets/icons/plus.svg.js";
|
|
5
|
-
import { useState as m, useRef as
|
|
6
|
-
import
|
|
7
|
-
import { TitleSmall as ae, BodyCaption as
|
|
5
|
+
import { useState as m, useRef as Q, useEffect as se } from "react";
|
|
6
|
+
import I from "styled-components";
|
|
7
|
+
import { TitleSmall as ae, BodyCaption as $, BodySecondary as A } from "../../TypographyStyle.js";
|
|
8
8
|
import { COLORS as i } from "../../../constants/Theme.js";
|
|
9
|
-
import { SideSection as ue, SideSectionHeader as he, AddIconButton as fe, SourceButtonRow as pe, SourceButton as
|
|
10
|
-
import { renderSourceIcon as
|
|
11
|
-
import { MentionPicker as
|
|
12
|
-
import { Dropdown as
|
|
13
|
-
import { unwrapDropdownValue as
|
|
9
|
+
import { SideSection as ue, SideSectionHeader as he, AddIconButton as fe, SourceButtonRow as pe, SourceButton as X, SelectableRow as me, RowText as Se, RowActions as ye, RowMenuButton as Y, RowActionDivider as be } from "../AgentBuilder.styled.js";
|
|
10
|
+
import { renderSourceIcon as R, SOURCE_ICONS as ve } from "../utils/sourceIcons.js";
|
|
11
|
+
import { MentionPicker as $e } from "./MentionPicker.js";
|
|
12
|
+
import { Dropdown as Z } from "../../dropdown/Dropdown.js";
|
|
13
|
+
import { unwrapDropdownValue as P } from "../../dropdown/utils.js";
|
|
14
14
|
import { Button as ge } from "../../button/Button.js";
|
|
15
|
-
import { DeleteConfirmationModal as
|
|
16
|
-
import { Tooltip as
|
|
17
|
-
|
|
15
|
+
import { DeleteConfirmationModal as we } from "../../states-modal/DeleteConfirmationModal.js";
|
|
16
|
+
import { Tooltip as g } from "../../tooltips/Tooltip.js";
|
|
17
|
+
import Ce from "../../../icons/Informational/Common UI/Shield.js";
|
|
18
|
+
const G = "__bik_create_new__", Ve = ({
|
|
18
19
|
title: s,
|
|
19
|
-
helper:
|
|
20
|
+
helper: _,
|
|
20
21
|
items: u,
|
|
21
22
|
addableOptions: S,
|
|
22
|
-
onAdd:
|
|
23
|
-
onRemove:
|
|
24
|
-
dataTestPrefix:
|
|
23
|
+
onAdd: w,
|
|
24
|
+
onRemove: D,
|
|
25
|
+
dataTestPrefix: t,
|
|
25
26
|
emptyText: O,
|
|
26
|
-
createOption:
|
|
27
|
+
createOption: l,
|
|
27
28
|
onConfigure: B,
|
|
28
29
|
sourceGroups: h,
|
|
29
30
|
mentionItems: L,
|
|
30
|
-
actionSources:
|
|
31
|
+
actionSources: y,
|
|
31
32
|
confirmDelete: p,
|
|
32
33
|
pickerOpensUp: z
|
|
33
34
|
}) => {
|
|
34
|
-
const [f,
|
|
35
|
+
const [f, r] = m(!1), [x, C] = m(null), [H, M] = m(null), [ee, k] = m(null), b = !!h && h.length > 0, E = h?.find((e) => e.source === ee), c = L !== void 0, j = Q(null), q = Q(null), [v, N] = m(null);
|
|
35
36
|
se(() => {
|
|
36
37
|
if (!c || !f)
|
|
37
38
|
return;
|
|
38
39
|
const e = (a) => {
|
|
39
|
-
const
|
|
40
|
-
!j.current?.contains(
|
|
40
|
+
const V = a.target;
|
|
41
|
+
!j.current?.contains(V) && !q.current?.contains(V) && r(!1);
|
|
41
42
|
}, o = (a) => {
|
|
42
|
-
a.key === "Escape" &&
|
|
43
|
+
a.key === "Escape" && r(!1);
|
|
43
44
|
};
|
|
44
45
|
return document.addEventListener("mousedown", e), document.addEventListener("keydown", o), () => {
|
|
45
46
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", o);
|
|
46
47
|
};
|
|
47
48
|
}, [c, f]);
|
|
48
|
-
const ne =
|
|
49
|
+
const ne = b ? c || u.length > 0 : c || S.length > 0 || !!l && u.length > 0, oe = u.length === 0 && !!l && !b && !c, W = !!y && y.length > 0, te = (b || W) && u.length === 0, le = () => {
|
|
49
50
|
if (c) {
|
|
50
|
-
|
|
51
|
+
N(null), r((e) => !e);
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
|
-
if (
|
|
54
|
-
|
|
54
|
+
if (b) {
|
|
55
|
+
k(null), r((e) => !e);
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
|
-
if (S.length === 0 &&
|
|
58
|
-
|
|
58
|
+
if (S.length === 0 && l) {
|
|
59
|
+
l.onSelect();
|
|
59
60
|
return;
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
+
r((e) => !e);
|
|
62
63
|
}, re = (e, o) => {
|
|
63
64
|
if (H)
|
|
64
65
|
return;
|
|
@@ -69,17 +70,27 @@ const G = "__bik_create_new__", Ke = ({
|
|
|
69
70
|
return /* @__PURE__ */ d(
|
|
70
71
|
me,
|
|
71
72
|
{
|
|
72
|
-
"data-test": `${
|
|
73
|
+
"data-test": `${t}-row-${e.id}`,
|
|
73
74
|
children: [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
R(e.icon),
|
|
76
|
+
e.authRequired && // Order tools touch customer-private data — the shield flags that
|
|
77
|
+
// this agent must verify the customer before the tool can run.
|
|
78
|
+
/* @__PURE__ */ n(g, { body: "Requires customer verification", placement: "top", children: /* @__PURE__ */ n(
|
|
79
|
+
"span",
|
|
80
|
+
{
|
|
81
|
+
"data-test": `${t}-auth-${e.id}`,
|
|
82
|
+
style: { display: "inline-flex", flexShrink: 0 },
|
|
83
|
+
children: /* @__PURE__ */ n(Ce, { size: 16 })
|
|
84
|
+
}
|
|
85
|
+
) }),
|
|
86
|
+
/* @__PURE__ */ n(g, { body: e.label, placement: "top", children: /* @__PURE__ */ n(Se, { children: /* @__PURE__ */ n(A, { numberOfLines: 1, color: i.content.primary, children: e.label }) }) }),
|
|
87
|
+
/* @__PURE__ */ d(ye, { children: [
|
|
77
88
|
o && // Configurable rows (sub-agents, Rest API / email tools) get an
|
|
78
89
|
// always-visible edit icon.
|
|
79
|
-
/* @__PURE__ */ n(
|
|
80
|
-
|
|
90
|
+
/* @__PURE__ */ n(g, { body: "Edit", placement: "top", children: /* @__PURE__ */ n(
|
|
91
|
+
Y,
|
|
81
92
|
{
|
|
82
|
-
"data-test": `${
|
|
93
|
+
"data-test": `${t}-edit-${e.id}`,
|
|
83
94
|
"aria-label": `Edit ${e.label}`,
|
|
84
95
|
disabled: H !== null,
|
|
85
96
|
onClick: () => re(e.id, o),
|
|
@@ -93,13 +104,13 @@ const G = "__bik_create_new__", Ke = ({
|
|
|
93
104
|
)
|
|
94
105
|
}
|
|
95
106
|
) }),
|
|
96
|
-
o && /* @__PURE__ */ n(
|
|
97
|
-
/* @__PURE__ */ n(
|
|
98
|
-
|
|
107
|
+
o && /* @__PURE__ */ n(be, { "aria-hidden": !0 }),
|
|
108
|
+
/* @__PURE__ */ n(g, { body: "Delete", placement: "top", children: /* @__PURE__ */ n(
|
|
109
|
+
Y,
|
|
99
110
|
{
|
|
100
|
-
"data-test": `${
|
|
111
|
+
"data-test": `${t}-delete-${e.id}`,
|
|
101
112
|
"aria-label": `Delete ${e.label}`,
|
|
102
|
-
onClick: () => p ?
|
|
113
|
+
onClick: () => p ? C(e.id) : D(e.id),
|
|
103
114
|
children: /* @__PURE__ */ n(
|
|
104
115
|
ie,
|
|
105
116
|
{
|
|
@@ -115,12 +126,12 @@ const G = "__bik_create_new__", Ke = ({
|
|
|
115
126
|
},
|
|
116
127
|
e.id
|
|
117
128
|
);
|
|
118
|
-
}),
|
|
129
|
+
}), F = l ? [
|
|
119
130
|
...S,
|
|
120
131
|
{
|
|
121
|
-
label:
|
|
132
|
+
label: l.label,
|
|
122
133
|
value: G,
|
|
123
|
-
searchKey:
|
|
134
|
+
searchKey: l.label,
|
|
124
135
|
customComponent: /* @__PURE__ */ n(
|
|
125
136
|
"div",
|
|
126
137
|
{
|
|
@@ -132,196 +143,196 @@ const G = "__bik_create_new__", Ke = ({
|
|
|
132
143
|
fontSize: 14,
|
|
133
144
|
fontWeight: 600
|
|
134
145
|
},
|
|
135
|
-
children:
|
|
146
|
+
children: l.label
|
|
136
147
|
}
|
|
137
148
|
)
|
|
138
149
|
}
|
|
139
|
-
] : S,
|
|
140
|
-
|
|
150
|
+
] : S, K = c ? /* @__PURE__ */ n(
|
|
151
|
+
$e,
|
|
141
152
|
{
|
|
142
153
|
items: L ?? [],
|
|
143
154
|
query: "",
|
|
144
155
|
activeIndex: 0,
|
|
145
|
-
initialSource:
|
|
156
|
+
initialSource: v ?? void 0,
|
|
146
157
|
onSelect: (e) => {
|
|
147
|
-
|
|
158
|
+
r(!1), w(String(e.id));
|
|
148
159
|
},
|
|
149
|
-
onClose: () =>
|
|
150
|
-
onCreateSubAgent:
|
|
151
|
-
|
|
160
|
+
onClose: () => r(!1),
|
|
161
|
+
onCreateSubAgent: l ? () => {
|
|
162
|
+
r(!1), l.onSelect();
|
|
152
163
|
} : void 0,
|
|
153
|
-
toolActions:
|
|
164
|
+
toolActions: W ? y?.map((e) => ({
|
|
154
165
|
...e,
|
|
155
166
|
onSelect: () => {
|
|
156
|
-
|
|
167
|
+
r(!1), e.onSelect();
|
|
157
168
|
}
|
|
158
169
|
})) : void 0,
|
|
159
170
|
integrationStatus: Object.fromEntries(
|
|
160
171
|
(h ?? []).filter((e) => e.connected !== void 0).map((e) => [e.source, e.connected])
|
|
161
172
|
),
|
|
162
173
|
onConnectIntegration: (e) => {
|
|
163
|
-
|
|
174
|
+
r(!1), h?.find((o) => o.source === e)?.onConnect?.();
|
|
164
175
|
}
|
|
165
176
|
},
|
|
166
|
-
|
|
177
|
+
v ?? "__root__"
|
|
167
178
|
) : null;
|
|
168
179
|
return /* @__PURE__ */ d(ue, { children: [
|
|
169
180
|
/* @__PURE__ */ d(he, { children: [
|
|
170
181
|
/* @__PURE__ */ n(ae, { color: i.content.primary, children: s }),
|
|
171
|
-
ne && /* @__PURE__ */ d(
|
|
182
|
+
ne && /* @__PURE__ */ d(ke, { ref: j, children: [
|
|
172
183
|
/* @__PURE__ */ n(
|
|
173
184
|
fe,
|
|
174
185
|
{
|
|
175
|
-
"data-test": `${
|
|
186
|
+
"data-test": `${t}-add`,
|
|
176
187
|
onClick: le,
|
|
177
188
|
"aria-label": `Add ${s}`,
|
|
178
189
|
children: /* @__PURE__ */ n(J, { width: 16, height: 16, color: i.content.primary })
|
|
179
190
|
}
|
|
180
191
|
),
|
|
181
|
-
c && f &&
|
|
192
|
+
c && f && v === null && /* @__PURE__ */ n(
|
|
182
193
|
T,
|
|
183
194
|
{
|
|
184
195
|
$up: z,
|
|
185
|
-
"data-test": `${
|
|
186
|
-
children:
|
|
196
|
+
"data-test": `${t}-picker`,
|
|
197
|
+
children: K
|
|
187
198
|
}
|
|
188
199
|
)
|
|
189
200
|
] })
|
|
190
201
|
] }),
|
|
191
|
-
|
|
192
|
-
te ? /* @__PURE__ */ d(
|
|
193
|
-
/* @__PURE__ */ d(pe, { "data-test": `${
|
|
202
|
+
_ && /* @__PURE__ */ n($, { color: i.content.secondary, children: _ }),
|
|
203
|
+
te ? /* @__PURE__ */ d(Ee, { ref: c ? q : void 0, children: [
|
|
204
|
+
/* @__PURE__ */ d(pe, { "data-test": `${t}-sources`, children: [
|
|
194
205
|
h?.map((e) => /* @__PURE__ */ d(
|
|
195
|
-
|
|
206
|
+
X,
|
|
196
207
|
{
|
|
197
208
|
type: "button",
|
|
198
|
-
"data-test": `${
|
|
209
|
+
"data-test": `${t}-source-${e.source}`,
|
|
199
210
|
onClick: () => {
|
|
200
211
|
if (e.connected === !1) {
|
|
201
212
|
e.onConnect?.();
|
|
202
213
|
return;
|
|
203
214
|
}
|
|
204
215
|
if (c) {
|
|
205
|
-
|
|
216
|
+
N(e.source), r(!0);
|
|
206
217
|
return;
|
|
207
218
|
}
|
|
208
|
-
|
|
219
|
+
k(e.source);
|
|
209
220
|
},
|
|
210
221
|
children: [
|
|
211
|
-
|
|
212
|
-
/* @__PURE__ */ n(
|
|
222
|
+
R(ve[e.source], -4),
|
|
223
|
+
/* @__PURE__ */ n($, { color: i.content.primary, children: e.label }),
|
|
213
224
|
e.connected === !1 && // Not connected → show "Connect" upfront (consistent with
|
|
214
225
|
// the `@` picker); clicking runs the connect flow.
|
|
215
|
-
/* @__PURE__ */ n(
|
|
226
|
+
/* @__PURE__ */ n(A, { color: i.content.brand, children: "Connect" })
|
|
216
227
|
]
|
|
217
228
|
},
|
|
218
229
|
e.source
|
|
219
230
|
)),
|
|
220
|
-
|
|
221
|
-
|
|
231
|
+
y?.map((e) => /* @__PURE__ */ d(
|
|
232
|
+
X,
|
|
222
233
|
{
|
|
223
234
|
type: "button",
|
|
224
|
-
"data-test": `${
|
|
235
|
+
"data-test": `${t}-action-${e.source}`,
|
|
225
236
|
onClick: e.connected === !1 ? () => e.onConnect?.() : () => {
|
|
226
|
-
|
|
237
|
+
r(!1), e.onSelect();
|
|
227
238
|
},
|
|
228
239
|
children: [
|
|
229
|
-
|
|
230
|
-
/* @__PURE__ */ n(
|
|
240
|
+
R(e.icon, -4),
|
|
241
|
+
/* @__PURE__ */ n($, { color: i.content.primary, children: e.label }),
|
|
231
242
|
e.connected === !1 && // Not connected → "Connect" upfront (consistent with the
|
|
232
243
|
// source buttons and the `@` picker).
|
|
233
|
-
/* @__PURE__ */ n(
|
|
244
|
+
/* @__PURE__ */ n(A, { color: i.content.brand, children: "Connect" })
|
|
234
245
|
]
|
|
235
246
|
},
|
|
236
247
|
e.source
|
|
237
248
|
))
|
|
238
249
|
] }),
|
|
239
|
-
c && f &&
|
|
250
|
+
c && f && v !== null && /* @__PURE__ */ n(
|
|
240
251
|
T,
|
|
241
252
|
{
|
|
242
253
|
$align: "left",
|
|
243
254
|
$up: z,
|
|
244
|
-
"data-test": `${
|
|
245
|
-
children:
|
|
255
|
+
"data-test": `${t}-picker`,
|
|
256
|
+
children: K
|
|
246
257
|
}
|
|
247
258
|
),
|
|
248
|
-
!c &&
|
|
249
|
-
|
|
259
|
+
!c && E && /* @__PURE__ */ n(
|
|
260
|
+
Z,
|
|
250
261
|
{
|
|
251
|
-
"data-test": `${
|
|
262
|
+
"data-test": `${t}-dropdown`,
|
|
252
263
|
size: "small",
|
|
253
264
|
width: "100%",
|
|
254
265
|
isSearchable: !0,
|
|
255
|
-
placeHolder: `Search ${
|
|
256
|
-
options:
|
|
266
|
+
placeHolder: `Search ${E.label} tools`,
|
|
267
|
+
options: E.options,
|
|
257
268
|
onSelect: (e) => {
|
|
258
|
-
const o =
|
|
259
|
-
|
|
269
|
+
const o = P(e);
|
|
270
|
+
k(null), r(!1), o && w(o);
|
|
260
271
|
}
|
|
261
272
|
}
|
|
262
273
|
)
|
|
263
274
|
] }) : /* @__PURE__ */ d(U, { children: [
|
|
264
|
-
!c && f &&
|
|
265
|
-
|
|
275
|
+
!c && f && F.length > 0 && /* @__PURE__ */ n(
|
|
276
|
+
Z,
|
|
266
277
|
{
|
|
267
|
-
"data-test": `${
|
|
278
|
+
"data-test": `${t}-dropdown`,
|
|
268
279
|
size: "small",
|
|
269
280
|
width: "100%",
|
|
270
281
|
isSearchable: !0,
|
|
271
282
|
placeHolder: `Select ${s.toLowerCase()}`,
|
|
272
|
-
options:
|
|
283
|
+
options: F,
|
|
273
284
|
onSelect: (e) => {
|
|
274
|
-
const o =
|
|
275
|
-
|
|
285
|
+
const o = P(e);
|
|
286
|
+
r(!1), o && (o === G ? l?.onSelect() : w(o));
|
|
276
287
|
}
|
|
277
288
|
}
|
|
278
289
|
),
|
|
279
290
|
u.length === 0 && !f ? /* @__PURE__ */ d(U, { children: [
|
|
280
|
-
/* @__PURE__ */ n(
|
|
281
|
-
oe &&
|
|
291
|
+
/* @__PURE__ */ n($, { color: i.content.placeholder, children: O }),
|
|
292
|
+
oe && l && /* @__PURE__ */ n(
|
|
282
293
|
ge,
|
|
283
294
|
{
|
|
284
|
-
"data-test": `${
|
|
295
|
+
"data-test": `${t}-create`,
|
|
285
296
|
buttonType: "secondary",
|
|
286
297
|
size: "small",
|
|
287
298
|
matchParentWidth: !0,
|
|
288
299
|
LeadingIcon: J,
|
|
289
|
-
buttonText:
|
|
290
|
-
onClick:
|
|
300
|
+
buttonText: l.label,
|
|
301
|
+
onClick: l.onSelect
|
|
291
302
|
}
|
|
292
303
|
)
|
|
293
304
|
] }) : ce()
|
|
294
305
|
] }),
|
|
295
306
|
p && x && /* @__PURE__ */ n(
|
|
296
|
-
|
|
307
|
+
we,
|
|
297
308
|
{
|
|
298
|
-
"data-test": `${
|
|
309
|
+
"data-test": `${t}-delete-confirm`,
|
|
299
310
|
header: `Delete this ${p.noun}?`,
|
|
300
311
|
subHeader: `Deleting this ${p.noun} will also remove it from your instructions, wherever it's referenced.`,
|
|
301
312
|
confirmationText: "Delete",
|
|
302
313
|
zIndex: p.zIndex,
|
|
303
314
|
onDeleteConfirmed: () => {
|
|
304
|
-
|
|
315
|
+
D(x), C(null);
|
|
305
316
|
},
|
|
306
|
-
onCancelClicked: () =>
|
|
317
|
+
onCancelClicked: () => C(null)
|
|
307
318
|
}
|
|
308
319
|
)
|
|
309
320
|
] });
|
|
310
|
-
},
|
|
321
|
+
}, ke = I.div`
|
|
311
322
|
position: relative;
|
|
312
323
|
display: flex;
|
|
313
|
-
`,
|
|
324
|
+
`, Ee = I.div`
|
|
314
325
|
position: relative;
|
|
315
326
|
display: flex;
|
|
316
327
|
flex-direction: column;
|
|
317
328
|
gap: 8px;
|
|
318
|
-
`, T =
|
|
329
|
+
`, T = I.div`
|
|
319
330
|
position: absolute;
|
|
320
331
|
${(s) => s.$up ? "bottom: calc(100% + 4px);" : "top: calc(100% + 4px);"}
|
|
321
332
|
${(s) => s.$align === "left" ? "left: 0;" : "right: 0;"}
|
|
322
333
|
z-index: 30;
|
|
323
334
|
`;
|
|
324
335
|
export {
|
|
325
|
-
|
|
336
|
+
Ve as SelectableListSection
|
|
326
337
|
};
|
|
327
338
|
//# sourceMappingURL=SelectableListSection.js.map
|