@bikdotai/bik-component-library 0.0.863-beta.6 → 0.0.863
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +42 -174
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js +3 -3
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/cjs/components/agent-builder/constants/steps.js +1 -1
- package/dist/cjs/components/agent-builder/constants/steps.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/Step1About.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step1About.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +2 -2
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +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/index.js +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.js +99 -105
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +0 -76
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +0 -91
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +93 -271
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +27 -27
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +42 -34
- package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/esm/components/agent-builder/constants/steps.d.ts +1 -31
- package/dist/esm/components/agent-builder/constants/steps.js +6 -15
- package/dist/esm/components/agent-builder/constants/steps.js.map +1 -1
- package/dist/esm/components/agent-builder/constants/tools.d.ts +6 -5
- 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 +1 -13
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +175 -192
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/index.d.ts +2 -7
- package/dist/esm/components/agent-builder/steps/Step1About.js +13 -15
- package/dist/esm/components/agent-builder/steps/Step1About.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +49 -54
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.d.ts +0 -11
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +23 -127
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +4 -0
- package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentTableRow.js +38 -71
- package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/esm/index.js +634 -644
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/cjs/components/agent-builder/components/AgentStateModal.js +0 -2
- package/dist/cjs/components/agent-builder/components/AgentStateModal.js.map +0 -1
- package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js +0 -2
- package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js.map +0 -1
- package/dist/cjs/components/agent-builder/components/ChannelsSection.js +0 -2
- package/dist/cjs/components/agent-builder/components/ChannelsSection.js.map +0 -1
- package/dist/cjs/components/agent-builder/constants/channels.js +0 -2
- package/dist/cjs/components/agent-builder/constants/channels.js.map +0 -1
- package/dist/esm/components/agent-builder/components/AgentStateModal.d.ts +0 -47
- package/dist/esm/components/agent-builder/components/AgentStateModal.js +0 -82
- package/dist/esm/components/agent-builder/components/AgentStateModal.js.map +0 -1
- package/dist/esm/components/agent-builder/components/ChannelSelectModal.d.ts +0 -26
- package/dist/esm/components/agent-builder/components/ChannelSelectModal.js +0 -121
- package/dist/esm/components/agent-builder/components/ChannelSelectModal.js.map +0 -1
- package/dist/esm/components/agent-builder/components/ChannelsSection.d.ts +0 -10
- package/dist/esm/components/agent-builder/components/ChannelsSection.js +0 -183
- package/dist/esm/components/agent-builder/components/ChannelsSection.js.map +0 -1
- package/dist/esm/components/agent-builder/constants/channels.d.ts +0 -56
- package/dist/esm/components/agent-builder/constants/channels.js +0 -41
- package/dist/esm/components/agent-builder/constants/channels.js.map +0 -1
|
@@ -1,96 +1,93 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { COLORS as
|
|
4
|
-
import { BuilderRoot as
|
|
5
|
-
import { AgentBuilderFooter as
|
|
6
|
-
import { AgentBuilderTopBar as
|
|
7
|
-
import { DiscardModal as
|
|
8
|
-
import { GoLiveModal as
|
|
9
|
-
import { StepRail as
|
|
10
|
-
import { UndoToast as
|
|
11
|
-
import { AgentBuilderProvider as
|
|
12
|
-
import { Step1About as
|
|
13
|
-
import { Step2WhenItStepsIn as
|
|
14
|
-
import { Step3HowItResponds as
|
|
15
|
-
import { Step4HandoverRules as
|
|
16
|
-
import { Spinner as
|
|
17
|
-
const
|
|
18
|
-
const { activeStep: d } =
|
|
1
|
+
import { jsx as o, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { useState as i, useCallback as t } from "react";
|
|
3
|
+
import { COLORS as ce } from "../../constants/Theme.js";
|
|
4
|
+
import { BuilderRoot as de, Main as ue, Rail as fe, Content as ge, ContentCard as me, StepScroll as he } from "./AgentBuilder.styled.js";
|
|
5
|
+
import { AgentBuilderFooter as ve } from "./components/AgentBuilderFooter.js";
|
|
6
|
+
import { AgentBuilderTopBar as pe } from "./components/AgentBuilderTopBar.js";
|
|
7
|
+
import { DiscardModal as Se } from "./components/DiscardModal.js";
|
|
8
|
+
import { GoLiveModal as be } from "./components/GoLiveModal.js";
|
|
9
|
+
import { StepRail as Ce } from "./components/StepRail.js";
|
|
10
|
+
import { UndoToast as Ae } from "./components/UndoToast.js";
|
|
11
|
+
import { AgentBuilderProvider as Le, useAgentBuilderContext as De } from "./context/AgentBuilderContext.js";
|
|
12
|
+
import { Step1About as ye } from "./steps/Step1About.js";
|
|
13
|
+
import { Step2WhenItStepsIn as Te } from "./steps/Step2WhenItStepsIn.js";
|
|
14
|
+
import { Step3HowItResponds as Be } from "./steps/Step3HowItResponds.js";
|
|
15
|
+
import { Step4HandoverRules as we } from "./steps/Step4HandoverRules.js";
|
|
16
|
+
import { Spinner as Ge } from "../spinner/Spinner.js";
|
|
17
|
+
const Ie = () => {
|
|
18
|
+
const { activeStep: d } = De();
|
|
19
19
|
switch (d) {
|
|
20
20
|
case "about":
|
|
21
|
-
return /* @__PURE__ */ o(
|
|
21
|
+
return /* @__PURE__ */ o(ye, {});
|
|
22
22
|
case "trigger":
|
|
23
|
-
return /* @__PURE__ */ o(
|
|
23
|
+
return /* @__PURE__ */ o(Te, {});
|
|
24
24
|
case "response":
|
|
25
|
-
return /* @__PURE__ */ o(
|
|
25
|
+
return /* @__PURE__ */ o(Be, {});
|
|
26
26
|
case "handover":
|
|
27
|
-
return /* @__PURE__ */ o(
|
|
27
|
+
return /* @__PURE__ */ o(we, {});
|
|
28
28
|
default:
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, Pe = (d) => {
|
|
32
32
|
const {
|
|
33
33
|
config: P,
|
|
34
34
|
onChange: v,
|
|
35
35
|
onStepChange: u,
|
|
36
36
|
onDiscard: p,
|
|
37
|
-
onSaveDraft:
|
|
37
|
+
onSaveDraft: s,
|
|
38
38
|
onPublish: S,
|
|
39
|
-
onBack:
|
|
40
|
-
onTestAgent:
|
|
41
|
-
onGoToDashboard:
|
|
39
|
+
onBack: f,
|
|
40
|
+
onTestAgent: g,
|
|
41
|
+
onGoToDashboard: m,
|
|
42
42
|
onCreateSubAgent: r,
|
|
43
43
|
onFetchSubAgent: M,
|
|
44
44
|
onUpdateSubAgent: k,
|
|
45
45
|
onImproveSubAgent: R,
|
|
46
46
|
onImproveToolInstructions: x,
|
|
47
47
|
onConnectIntegration: j,
|
|
48
|
-
|
|
49
|
-
onSmartAgentHandover: F,
|
|
50
|
-
...N
|
|
48
|
+
...H
|
|
51
49
|
} = d, {
|
|
52
50
|
value: l,
|
|
53
|
-
activeStep:
|
|
54
|
-
availableTools:
|
|
55
|
-
availableSubAgents:
|
|
56
|
-
availableIntents:
|
|
57
|
-
availableModels:
|
|
58
|
-
configToolTemplates:
|
|
59
|
-
integrationStatus:
|
|
60
|
-
variablesData:
|
|
61
|
-
validation:
|
|
62
|
-
applicationType:
|
|
63
|
-
|
|
64
|
-
charLimits: X,
|
|
51
|
+
activeStep: F,
|
|
52
|
+
availableTools: N,
|
|
53
|
+
availableSubAgents: O,
|
|
54
|
+
availableIntents: U = [],
|
|
55
|
+
availableModels: z = [],
|
|
56
|
+
configToolTemplates: E,
|
|
57
|
+
integrationStatus: W,
|
|
58
|
+
variablesData: $,
|
|
59
|
+
validation: q,
|
|
60
|
+
applicationType: J,
|
|
61
|
+
charLimits: K,
|
|
65
62
|
isSaving: b,
|
|
66
63
|
isPublishing: C,
|
|
67
|
-
isLoading:
|
|
68
|
-
footerHint:
|
|
69
|
-
disableStepNavigation:
|
|
64
|
+
isLoading: Q,
|
|
65
|
+
footerHint: V = "Changes don’t affect customers until you go live",
|
|
66
|
+
disableStepNavigation: X,
|
|
70
67
|
debugLog: A
|
|
71
|
-
} = P, [L, a] =
|
|
72
|
-
(e, ...
|
|
73
|
-
A && console.log(`[AgentBuilder] ${e}`, ...
|
|
68
|
+
} = P, [L, a] = i(null), [D, y] = i(!1), [Y, T] = i(!1), [Z, c] = i(!1), [B, w] = i(!1), n = t(
|
|
69
|
+
(e, ...le) => {
|
|
70
|
+
A && console.log(`[AgentBuilder] ${e}`, ...le);
|
|
74
71
|
},
|
|
75
72
|
[A]
|
|
76
|
-
),
|
|
73
|
+
), _ = t(
|
|
77
74
|
(e) => {
|
|
78
75
|
n("onChange", e), v(e);
|
|
79
76
|
},
|
|
80
77
|
[n, v]
|
|
81
|
-
),
|
|
78
|
+
), ee = t(
|
|
82
79
|
(e) => {
|
|
83
80
|
n("onStepChange", e), u?.(e);
|
|
84
81
|
},
|
|
85
82
|
[n, u]
|
|
86
|
-
),
|
|
83
|
+
), ne = t(() => (n("onSaveDraft"), s()), [n, s]), oe = t(() => (n("onPublish"), S()), [n, S]), te = t(() => {
|
|
87
84
|
n("onBack"), c(!0);
|
|
88
|
-
}, [n]),
|
|
85
|
+
}, [n]), ae = t(() => {
|
|
89
86
|
n("onDiscardAndLeave"), c(!1), p();
|
|
90
87
|
}, [n, p]), G = t(async () => {
|
|
91
88
|
n("onSaveDraftAndLeave");
|
|
92
|
-
const e =
|
|
93
|
-
if (
|
|
89
|
+
const e = s();
|
|
90
|
+
if (e && typeof e.then == "function") {
|
|
94
91
|
w(!0);
|
|
95
92
|
try {
|
|
96
93
|
await e;
|
|
@@ -98,10 +95,10 @@ const ke = () => {
|
|
|
98
95
|
w(!1);
|
|
99
96
|
}
|
|
100
97
|
}
|
|
101
|
-
|
|
102
|
-
}, [n,
|
|
98
|
+
c(!1), f?.();
|
|
99
|
+
}, [n, s, f]), ie = t(async () => {
|
|
103
100
|
n("onTestAgent");
|
|
104
|
-
const e =
|
|
101
|
+
const e = g?.();
|
|
105
102
|
if (e && typeof e.then == "function") {
|
|
106
103
|
T(!0);
|
|
107
104
|
try {
|
|
@@ -110,16 +107,16 @@ const ke = () => {
|
|
|
110
107
|
T(!1);
|
|
111
108
|
}
|
|
112
109
|
}
|
|
113
|
-
}, [n,
|
|
114
|
-
n("onGoToDashboard"),
|
|
115
|
-
}, [n,
|
|
110
|
+
}, [n, g]), I = t(() => {
|
|
111
|
+
n("onGoToDashboard"), m?.();
|
|
112
|
+
}, [n, m]), se = t(
|
|
116
113
|
(e) => (n("onCreateSubAgent", e), r ? r(e) : Promise.reject(new Error("onCreateSubAgent not provided"))),
|
|
117
114
|
[n, r]
|
|
118
|
-
),
|
|
115
|
+
), re = async () => {
|
|
119
116
|
n("onGoLiveConfirm");
|
|
120
|
-
const e =
|
|
117
|
+
const e = oe();
|
|
121
118
|
if (e && typeof e.then == "function") {
|
|
122
|
-
|
|
119
|
+
y(!0);
|
|
123
120
|
try {
|
|
124
121
|
await e, a("success");
|
|
125
122
|
} finally {
|
|
@@ -129,46 +126,43 @@ const ke = () => {
|
|
|
129
126
|
a("success");
|
|
130
127
|
};
|
|
131
128
|
return /* @__PURE__ */ o(
|
|
132
|
-
|
|
129
|
+
Le,
|
|
133
130
|
{
|
|
134
131
|
value: l,
|
|
135
|
-
onChange:
|
|
136
|
-
activeStep:
|
|
137
|
-
onStepChange: u ?
|
|
138
|
-
availableTools:
|
|
139
|
-
availableSubAgents:
|
|
140
|
-
availableIntents:
|
|
141
|
-
availableModels:
|
|
142
|
-
configToolTemplates:
|
|
143
|
-
integrationStatus:
|
|
132
|
+
onChange: _,
|
|
133
|
+
activeStep: F,
|
|
134
|
+
onStepChange: u ? ee : void 0,
|
|
135
|
+
availableTools: N,
|
|
136
|
+
availableSubAgents: O,
|
|
137
|
+
availableIntents: U,
|
|
138
|
+
availableModels: z,
|
|
139
|
+
configToolTemplates: E,
|
|
140
|
+
integrationStatus: W,
|
|
144
141
|
onConnectIntegration: j,
|
|
145
|
-
variablesData:
|
|
146
|
-
validation:
|
|
147
|
-
applicationType:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
charLimits: X,
|
|
152
|
-
disableStepNavigation: _,
|
|
153
|
-
onCreateSubAgent: r ? ce : void 0,
|
|
142
|
+
variablesData: $,
|
|
143
|
+
validation: q,
|
|
144
|
+
applicationType: J,
|
|
145
|
+
charLimits: K,
|
|
146
|
+
disableStepNavigation: X,
|
|
147
|
+
onCreateSubAgent: r ? se : void 0,
|
|
154
148
|
onFetchSubAgent: M,
|
|
155
149
|
onUpdateSubAgent: k,
|
|
156
150
|
onImproveSubAgent: R,
|
|
157
151
|
onImproveToolInstructions: x,
|
|
158
|
-
children: /* @__PURE__ */
|
|
152
|
+
children: /* @__PURE__ */ h(de, { "data-test": H["data-test"] ?? "agent-builder", children: [
|
|
159
153
|
/* @__PURE__ */ o(
|
|
160
|
-
|
|
154
|
+
pe,
|
|
161
155
|
{
|
|
162
156
|
name: l.name,
|
|
163
157
|
status: l.status,
|
|
164
|
-
onBack:
|
|
158
|
+
onBack: f ? te : void 0,
|
|
165
159
|
onSaveDraft: G,
|
|
166
160
|
isSaving: b || B
|
|
167
161
|
}
|
|
168
162
|
),
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */ o(
|
|
171
|
-
/* @__PURE__ */ o(
|
|
163
|
+
/* @__PURE__ */ h(ue, { children: [
|
|
164
|
+
/* @__PURE__ */ o(fe, { children: /* @__PURE__ */ o(Ce, {}) }),
|
|
165
|
+
/* @__PURE__ */ o(ge, { children: Q ? /* @__PURE__ */ o(
|
|
172
166
|
"div",
|
|
173
167
|
{
|
|
174
168
|
style: {
|
|
@@ -177,16 +171,16 @@ const ke = () => {
|
|
|
177
171
|
justifyContent: "center",
|
|
178
172
|
height: "100%"
|
|
179
173
|
},
|
|
180
|
-
children: /* @__PURE__ */ o(
|
|
174
|
+
children: /* @__PURE__ */ o(Ge, { size: "large", color: ce.stroke.brand })
|
|
181
175
|
}
|
|
182
|
-
) : /* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */ o(
|
|
176
|
+
) : /* @__PURE__ */ h(me, { children: [
|
|
177
|
+
/* @__PURE__ */ o(he, { children: /* @__PURE__ */ o(Ie, {}) }),
|
|
184
178
|
/* @__PURE__ */ o(
|
|
185
|
-
|
|
179
|
+
ve,
|
|
186
180
|
{
|
|
187
|
-
footerHint:
|
|
188
|
-
onTestAgent:
|
|
189
|
-
isTesting:
|
|
181
|
+
footerHint: V,
|
|
182
|
+
onTestAgent: g ? ie : void 0,
|
|
183
|
+
isTesting: Y,
|
|
190
184
|
onGoLive: () => {
|
|
191
185
|
n("onGoLive"), a("confirm");
|
|
192
186
|
},
|
|
@@ -196,39 +190,39 @@ const ke = () => {
|
|
|
196
190
|
] }) })
|
|
197
191
|
] }),
|
|
198
192
|
/* @__PURE__ */ o(
|
|
199
|
-
|
|
193
|
+
be,
|
|
200
194
|
{
|
|
201
195
|
mode: L,
|
|
202
196
|
onClose: () => {
|
|
203
197
|
const e = L === "success";
|
|
204
198
|
a(null), e && I();
|
|
205
199
|
},
|
|
206
|
-
onConfirm:
|
|
200
|
+
onConfirm: re,
|
|
207
201
|
onSaveDraft: () => {
|
|
208
|
-
a(null),
|
|
202
|
+
a(null), ne();
|
|
209
203
|
},
|
|
210
|
-
onGoToDashboard:
|
|
204
|
+
onGoToDashboard: m ? I : void 0,
|
|
211
205
|
isPublishing: C || D
|
|
212
206
|
}
|
|
213
207
|
),
|
|
214
208
|
/* @__PURE__ */ o(
|
|
215
|
-
|
|
209
|
+
Se,
|
|
216
210
|
{
|
|
217
|
-
open:
|
|
211
|
+
open: Z,
|
|
218
212
|
onClose: () => c(!1),
|
|
219
|
-
onDiscard:
|
|
213
|
+
onDiscard: ae,
|
|
220
214
|
onSaveDraft: G,
|
|
221
215
|
disableSaveDraft: !l.name.trim(),
|
|
222
216
|
isSaving: b || B
|
|
223
217
|
}
|
|
224
218
|
),
|
|
225
|
-
/* @__PURE__ */ o(
|
|
219
|
+
/* @__PURE__ */ o(Ae, {})
|
|
226
220
|
] })
|
|
227
221
|
}
|
|
228
222
|
);
|
|
229
223
|
};
|
|
230
|
-
|
|
224
|
+
Pe.displayName = "AgentBuilder";
|
|
231
225
|
export {
|
|
232
|
-
|
|
226
|
+
Pe as AgentBuilder
|
|
233
227
|
};
|
|
234
228
|
//# sourceMappingURL=AgentBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentBuilder.js","sources":["../../../../src/components/agent-builder/AgentBuilder.tsx"],"sourcesContent":["import React, { useCallback, useState } from 'react';\nimport { Spinner } from '@src/components/spinner';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tAgentBuilderProps,\n\tAgentValue,\n\tSubAgentDraft,\n} from './AgentBuilder.model';\nimport {\n\tBuilderRoot,\n\tContent,\n\tContentCard,\n\tMain,\n\tRail,\n\tStepScroll,\n} from './AgentBuilder.styled';\nimport { AgentBuilderFooter } from './components/AgentBuilderFooter';\nimport { AgentBuilderTopBar } from './components/AgentBuilderTopBar';\nimport { DiscardModal } from './components/DiscardModal';\nimport { GoLiveModal, GoLiveModalMode } from './components/GoLiveModal';\nimport { StepRail } from './components/StepRail';\nimport { UndoToast } from './components/UndoToast';\nimport {\n\tAgentBuilderProvider,\n\tuseAgentBuilderContext,\n} from './context/AgentBuilderContext';\nimport { Step1About } from './steps/Step1About';\nimport { Step2WhenItStepsIn } from './steps/Step2WhenItStepsIn';\nimport { Step3HowItResponds } from './steps/Step3HowItResponds';\nimport { Step4HandoverRules } from './steps/Step4HandoverRules';\n\nconst StepContent: React.FC = () => {\n\tconst { activeStep } = useAgentBuilderContext();\n\tswitch (activeStep) {\n\t\tcase 'about':\n\t\t\treturn <Step1About />;\n\t\tcase 'trigger':\n\t\t\treturn <Step2WhenItStepsIn />;\n\t\tcase 'response':\n\t\t\treturn <Step3HowItResponds />;\n\t\tcase 'handover':\n\t\t\treturn <Step4HandoverRules />;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n\n/**\n * 4-step creation/edit wizard body for an AI agent. Presentational and\n * controlled — the consumer owns the `value`, persistence and routing.\n *\n * @example\n * <AgentBuilder\n * value={agent}\n * onChange={(patch) => setAgent({ ...agent, ...patch })}\n * availableTools={tools}\n * availableSubAgents={subAgents}\n * onDiscard={() => router.back()}\n * onSaveDraft={saveDraft}\n * onPublish={publish}\n * />\n */\nexport const AgentBuilder: React.FC<AgentBuilderProps> = (props) => {\n\tconst {\n\t\tconfig,\n\t\tonChange,\n\t\tonStepChange,\n\t\tonDiscard,\n\t\tonSaveDraft,\n\t\tonPublish,\n\t\tonBack,\n\t\tonTestAgent,\n\t\tonGoToDashboard,\n\t\tonCreateSubAgent,\n\t\tonFetchSubAgent,\n\t\tonUpdateSubAgent,\n\t\tonImproveSubAgent,\n\t\tonImproveToolInstructions,\n\t\tonConnectIntegration,\n\t\tonManageChannels,\n\t\tonSmartAgentHandover,\n\t\t...rest\n\t} = props;\n\tconst {\n\t\tvalue,\n\t\tactiveStep,\n\t\tavailableTools,\n\t\tavailableSubAgents,\n\t\tavailableIntents = [],\n\t\tavailableModels = [],\n\t\tconfigToolTemplates,\n\t\tintegrationStatus,\n\t\tvariablesData,\n\t\tvalidation,\n\t\tapplicationType,\n\t\tavailableChannels,\n\t\tcharLimits,\n\t\tisSaving,\n\t\tisPublishing,\n\t\tisLoading,\n\t\tfooterHint = 'Changes don’t affect customers until you go live',\n\t\tdisableStepNavigation,\n\t\tdebugLog,\n\t} = config;\n\n\tconst [modalMode, setModalMode] = useState<GoLiveModalMode>(null);\n\tconst [publishingLocal, setPublishingLocal] = useState(false);\n\t// True while onTestAgent's async work (e.g. save-as-draft before the test\n\t// modal opens) is in flight — loads + disables the Test agent button.\n\tconst [testingLocal, setTestingLocal] = useState(false);\n\t// Back was pressed → confirm leaving (save draft / discard) before navigating.\n\tconst [showLeaveConfirm, setShowLeaveConfirm] = useState(false);\n\tconst [savingAndLeaving, setSavingAndLeaving] = useState(false);\n\n\t// Gated debug logging: each handler logs at its start only when `debugLog`.\n\tconst logAction = useCallback(\n\t\t(action: string, ...args: unknown[]) => {\n\t\t\tif (debugLog) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(`[AgentBuilder] ${action}`, ...args);\n\t\t\t}\n\t\t},\n\t\t[debugLog],\n\t);\n\n\tconst handleChange = useCallback(\n\t\t(patch: Partial<AgentValue>) => {\n\t\t\tlogAction('onChange', patch);\n\t\t\tonChange(patch);\n\t\t},\n\t\t[logAction, onChange],\n\t);\n\tconst handleStepChange = useCallback(\n\t\t(step: Parameters<NonNullable<typeof onStepChange>>[0]) => {\n\t\t\tlogAction('onStepChange', step);\n\t\t\tonStepChange?.(step);\n\t\t},\n\t\t[logAction, onStepChange],\n\t);\n\tconst handleSaveDraft = useCallback(() => {\n\t\tlogAction('onSaveDraft');\n\t\treturn onSaveDraft();\n\t}, [logAction, onSaveDraft]);\n\tconst handlePublish = useCallback(() => {\n\t\tlogAction('onPublish');\n\t\treturn onPublish();\n\t}, [logAction, onPublish]);\n\t// Back opens the \"Save as draft?\" confirmation rather than leaving directly.\n\tconst handleBack = useCallback(() => {\n\t\tlogAction('onBack');\n\t\tsetShowLeaveConfirm(true);\n\t}, [logAction]);\n\n\t// Modal \"Discard\" defers to the parent's discard handler (same as the top bar).\n\tconst handleDiscardAndLeave = useCallback(() => {\n\t\tlogAction('onDiscardAndLeave');\n\t\tsetShowLeaveConfirm(false);\n\t\tonDiscard();\n\t}, [logAction, onDiscard]);\n\n\tconst handleSaveDraftAndLeave = useCallback(async () => {\n\t\tlogAction('onSaveDraftAndLeave');\n\t\tconst result = onSaveDraft();\n\t\t// Closed up front for the same reason as go-live: the caller's saving dialog\n\t\t// would otherwise stack a second overlay on top of this one.\n\t\tsetShowLeaveConfirm(false);\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\tsetSavingAndLeaving(true);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t} finally {\n\t\t\t\tsetSavingAndLeaving(false);\n\t\t\t}\n\t\t}\n\t\tonBack?.();\n\t}, [logAction, onSaveDraft, onBack]);\n\tconst handleTestAgent = useCallback(async () => {\n\t\tlogAction('onTestAgent');\n\t\tconst result = onTestAgent?.();\n\t\t// A new agent saves as draft before the test modal opens — that's slow, so\n\t\t// disable + load the button until it settles (prevents double-triggering).\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\tsetTestingLocal(true);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t} finally {\n\t\t\t\tsetTestingLocal(false);\n\t\t\t}\n\t\t}\n\t}, [logAction, onTestAgent]);\n\tconst handleGoToDashboard = useCallback(() => {\n\t\tlogAction('onGoToDashboard');\n\t\tonGoToDashboard?.();\n\t}, [logAction, onGoToDashboard]);\n\tconst handleCreateSubAgent = useCallback(\n\t\t(draft: SubAgentDraft) => {\n\t\t\tlogAction('onCreateSubAgent', draft);\n\t\t\treturn onCreateSubAgent\n\t\t\t\t? onCreateSubAgent(draft)\n\t\t\t\t: Promise.reject(new Error('onCreateSubAgent not provided'));\n\t\t},\n\t\t[logAction, onCreateSubAgent],\n\t);\n\n\tconst handleConfirmGoLive = async () => {\n\t\tlogAction('onGoLiveConfirm');\n\t\tconst result = handlePublish();\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\t// Close before handing the screen to the caller's in-flight dialog: two\n\t\t\t// modals at once means two stacked overlays and this one's cross showing\n\t\t\t// through. The footer's Go live button keeps spinning via `isPublishing`,\n\t\t\t// so a caller with no dialog of its own still shows progress.\n\t\t\tsetModalMode(null);\n\t\t\tsetPublishingLocal(true);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t\tsetModalMode('success');\n\t\t\t} finally {\n\t\t\t\tsetPublishingLocal(false);\n\t\t\t}\n\t\t} else {\n\t\t\tsetModalMode('success');\n\t\t}\n\t};\n\n\treturn (\n\t\t<AgentBuilderProvider\n\t\t\tvalue={value}\n\t\t\tonChange={handleChange}\n\t\t\tactiveStep={activeStep}\n\t\t\tonStepChange={onStepChange ? handleStepChange : undefined}\n\t\t\tavailableTools={availableTools}\n\t\t\tavailableSubAgents={availableSubAgents}\n\t\t\tavailableIntents={availableIntents}\n\t\t\tavailableModels={availableModels}\n\t\t\tconfigToolTemplates={configToolTemplates}\n\t\t\tintegrationStatus={integrationStatus}\n\t\t\tonConnectIntegration={onConnectIntegration}\n\t\t\tvariablesData={variablesData}\n\t\t\tvalidation={validation}\n\t\t\tapplicationType={applicationType}\n\t\t\tavailableChannels={availableChannels}\n\t\t\tonManageChannels={onManageChannels}\n\t\t\tonSmartAgentHandover={onSmartAgentHandover}\n\t\t\tcharLimits={charLimits}\n\t\t\tdisableStepNavigation={disableStepNavigation}\n\t\t\tonCreateSubAgent={onCreateSubAgent ? handleCreateSubAgent : undefined}\n\t\t\tonFetchSubAgent={onFetchSubAgent}\n\t\t\tonUpdateSubAgent={onUpdateSubAgent}\n\t\t\tonImproveSubAgent={onImproveSubAgent}\n\t\t\tonImproveToolInstructions={onImproveToolInstructions}\n\t\t>\n\t\t\t<BuilderRoot data-test={rest['data-test'] ?? 'agent-builder'}>\n\t\t\t\t<AgentBuilderTopBar\n\t\t\t\t\tname={value.name}\n\t\t\t\t\tstatus={value.status}\n\t\t\t\t\tonBack={onBack ? handleBack : undefined}\n\t\t\t\t\tonSaveDraft={handleSaveDraftAndLeave}\n\t\t\t\t\tisSaving={isSaving || savingAndLeaving}\n\t\t\t\t/>\n\n\t\t\t\t<Main>\n\t\t\t\t\t<Rail>\n\t\t\t\t\t\t<StepRail />\n\t\t\t\t\t</Rail>\n\t\t\t\t\t<Content>\n\t\t\t\t\t\t{isLoading ? (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Spinner size=\"large\" color={COLORS.stroke.brand} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ContentCard>\n\t\t\t\t\t\t\t\t<StepScroll>\n\t\t\t\t\t\t\t\t\t<StepContent />\n\t\t\t\t\t\t\t\t</StepScroll>\n\t\t\t\t\t\t\t\t<AgentBuilderFooter\n\t\t\t\t\t\t\t\t\tfooterHint={footerHint}\n\t\t\t\t\t\t\t\t\tonTestAgent={onTestAgent ? handleTestAgent : undefined}\n\t\t\t\t\t\t\t\t\tisTesting={testingLocal}\n\t\t\t\t\t\t\t\t\tonGoLive={() => {\n\t\t\t\t\t\t\t\t\t\tlogAction('onGoLive');\n\t\t\t\t\t\t\t\t\t\tsetModalMode('confirm');\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tisPublishing={isPublishing || publishingLocal}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ContentCard>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Content>\n\t\t\t\t</Main>\n\n\t\t\t\t<GoLiveModal\n\t\t\t\t\tmode={modalMode}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tconst wasSuccess = modalMode === 'success';\n\t\t\t\t\t\tsetModalMode(null);\n\t\t\t\t\t\tif (wasSuccess) {\n\t\t\t\t\t\t\thandleGoToDashboard();\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonConfirm={handleConfirmGoLive}\n\t\t\t\t\tonSaveDraft={() => {\n\t\t\t\t\t\tsetModalMode(null);\n\t\t\t\t\t\thandleSaveDraft();\n\t\t\t\t\t}}\n\t\t\t\t\tonGoToDashboard={onGoToDashboard ? handleGoToDashboard : undefined}\n\t\t\t\t\tisPublishing={isPublishing || publishingLocal}\n\t\t\t\t/>\n\n\t\t\t\t<DiscardModal\n\t\t\t\t\topen={showLeaveConfirm}\n\t\t\t\t\tonClose={() => setShowLeaveConfirm(false)}\n\t\t\t\t\tonDiscard={handleDiscardAndLeave}\n\t\t\t\t\tonSaveDraft={handleSaveDraftAndLeave}\n\t\t\t\t\tdisableSaveDraft={!value.name.trim()}\n\t\t\t\t\tisSaving={isSaving || savingAndLeaving}\n\t\t\t\t/>\n\n\t\t\t\t<UndoToast />\n\t\t\t</BuilderRoot>\n\t\t</AgentBuilderProvider>\n\t);\n};\n\nAgentBuilder.displayName = 'AgentBuilder';\n"],"names":["StepContent","activeStep","useAgentBuilderContext","Step1About","Step2WhenItStepsIn","Step3HowItResponds","Step4HandoverRules","AgentBuilder","props","config","onChange","onStepChange","onDiscard","onSaveDraft","onPublish","onBack","onTestAgent","onGoToDashboard","onCreateSubAgent","onFetchSubAgent","onUpdateSubAgent","onImproveSubAgent","onImproveToolInstructions","onConnectIntegration","onManageChannels","onSmartAgentHandover","rest","value","availableTools","availableSubAgents","availableIntents","availableModels","configToolTemplates","integrationStatus","variablesData","validation","applicationType","availableChannels","charLimits","isSaving","isPublishing","isLoading","footerHint","disableStepNavigation","debugLog","modalMode","setModalMode","useState","publishingLocal","setPublishingLocal","testingLocal","setTestingLocal","showLeaveConfirm","setShowLeaveConfirm","savingAndLeaving","setSavingAndLeaving","logAction","useCallback","action","args","handleChange","patch","handleStepChange","step","handleSaveDraft","handlePublish","handleBack","handleDiscardAndLeave","handleSaveDraftAndLeave","result","handleTestAgent","handleGoToDashboard","handleCreateSubAgent","draft","handleConfirmGoLive","jsx","AgentBuilderProvider","BuilderRoot","AgentBuilderTopBar","Main","Rail","StepRail","Content","Spinner","COLORS","ContentCard","StepScro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ACd;AAAA,YACA,gBAAA2E;AAAA,cAACY;AAAA,cAAA;AAAA,gBACA,YAAA7C;AAAA,gBACA,aAAa1B,IAAcsD,KAAkB;AAAA,gBAC7C,WAAWpB;AAAA,gBACX,UAAU,MAAM;AACf,kBAAAM,EAAU,UAAU,GACpBV,EAAa,SAAS;AAAA,gBACvB;AAAA,gBACA,cAAcN,KAAgBQ;AAAA,cAAA;AAAA,YAAA;AAAA,UAC/B,EAAA,CACD,EAAA,CAEF;AAAA,QAAA,GACD;AAAA,QAEA,gBAAA2B;AAAA,UAACa;AAAA,UAAA;AAAA,YACA,MAAM3C;AAAA,YACN,SAAS,MAAM;AACd,oBAAM4C,IAAa5C,MAAc;AACjC,cAAAC,EAAa,IAAI,GACb2C,KACHlB,EAAA;AAAA,YAEF;AAAA,YACA,WAAWG;AAAA,YACX,aAAa,MAAM;AAClB,cAAA5B,EAAa,IAAI,GACjBkB,GAAA;AAAA,YACD;AAAA,YACA,iBAAiB/C,IAAkBsD,IAAsB;AAAA,YACzD,cAAc/B,KAAgBQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAG/B,gBAAA2B;AAAA,UAACe;AAAA,UAAA;AAAA,YACA,MAAMtC;AAAA,YACN,SAAS,MAAMC,EAAoB,EAAK;AAAA,YACxC,WAAWc;AAAA,YACX,aAAaC;AAAA,YACb,kBAAkB,CAACzC,EAAM,KAAK,KAAA;AAAA,YAC9B,UAAUY,KAAYe;AAAA,UAAA;AAAA,QAAA;AAAA,0BAGtBqC,IAAA,CAAA,CAAU;AAAA,MAAA,EAAA,CACZ;AAAA,IAAA;AAAA,EAAA;AAGH;AAEApF,GAAa,cAAc;"}
|
|
1
|
+
{"version":3,"file":"AgentBuilder.js","sources":["../../../../src/components/agent-builder/AgentBuilder.tsx"],"sourcesContent":["import React, { useCallback, useState } from 'react';\nimport { Spinner } from '@src/components/spinner';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tAgentBuilderProps,\n\tAgentValue,\n\tSubAgentDraft,\n} from './AgentBuilder.model';\nimport {\n\tBuilderRoot,\n\tContent,\n\tContentCard,\n\tMain,\n\tRail,\n\tStepScroll,\n} from './AgentBuilder.styled';\nimport { AgentBuilderFooter } from './components/AgentBuilderFooter';\nimport { AgentBuilderTopBar } from './components/AgentBuilderTopBar';\nimport { DiscardModal } from './components/DiscardModal';\nimport { GoLiveModal, GoLiveModalMode } from './components/GoLiveModal';\nimport { StepRail } from './components/StepRail';\nimport { UndoToast } from './components/UndoToast';\nimport {\n\tAgentBuilderProvider,\n\tuseAgentBuilderContext,\n} from './context/AgentBuilderContext';\nimport { Step1About } from './steps/Step1About';\nimport { Step2WhenItStepsIn } from './steps/Step2WhenItStepsIn';\nimport { Step3HowItResponds } from './steps/Step3HowItResponds';\nimport { Step4HandoverRules } from './steps/Step4HandoverRules';\n\nconst StepContent: React.FC = () => {\n\tconst { activeStep } = useAgentBuilderContext();\n\tswitch (activeStep) {\n\t\tcase 'about':\n\t\t\treturn <Step1About />;\n\t\tcase 'trigger':\n\t\t\treturn <Step2WhenItStepsIn />;\n\t\tcase 'response':\n\t\t\treturn <Step3HowItResponds />;\n\t\tcase 'handover':\n\t\t\treturn <Step4HandoverRules />;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n\n/**\n * 4-step creation/edit wizard body for an AI agent. Presentational and\n * controlled — the consumer owns the `value`, persistence and routing.\n *\n * @example\n * <AgentBuilder\n * value={agent}\n * onChange={(patch) => setAgent({ ...agent, ...patch })}\n * availableTools={tools}\n * availableSubAgents={subAgents}\n * onDiscard={() => router.back()}\n * onSaveDraft={saveDraft}\n * onPublish={publish}\n * />\n */\nexport const AgentBuilder: React.FC<AgentBuilderProps> = (props) => {\n\tconst {\n\t\tconfig,\n\t\tonChange,\n\t\tonStepChange,\n\t\tonDiscard,\n\t\tonSaveDraft,\n\t\tonPublish,\n\t\tonBack,\n\t\tonTestAgent,\n\t\tonGoToDashboard,\n\t\tonCreateSubAgent,\n\t\tonFetchSubAgent,\n\t\tonUpdateSubAgent,\n\t\tonImproveSubAgent,\n\t\tonImproveToolInstructions,\n\t\tonConnectIntegration,\n\t\t...rest\n\t} = props;\n\tconst {\n\t\tvalue,\n\t\tactiveStep,\n\t\tavailableTools,\n\t\tavailableSubAgents,\n\t\tavailableIntents = [],\n\t\tavailableModels = [],\n\t\tconfigToolTemplates,\n\t\tintegrationStatus,\n\t\tvariablesData,\n\t\tvalidation,\n\t\tapplicationType,\n\t\tcharLimits,\n\t\tisSaving,\n\t\tisPublishing,\n\t\tisLoading,\n\t\tfooterHint = 'Changes don’t affect customers until you go live',\n\t\tdisableStepNavigation,\n\t\tdebugLog,\n\t} = config;\n\n\tconst [modalMode, setModalMode] = useState<GoLiveModalMode>(null);\n\tconst [publishingLocal, setPublishingLocal] = useState(false);\n\t// True while onTestAgent's async work (e.g. save-as-draft before the test\n\t// modal opens) is in flight — loads + disables the Test agent button.\n\tconst [testingLocal, setTestingLocal] = useState(false);\n\t// Back was pressed → confirm leaving (save draft / discard) before navigating.\n\tconst [showLeaveConfirm, setShowLeaveConfirm] = useState(false);\n\tconst [savingAndLeaving, setSavingAndLeaving] = useState(false);\n\n\t// Gated debug logging: each handler logs at its start only when `debugLog`.\n\tconst logAction = useCallback(\n\t\t(action: string, ...args: unknown[]) => {\n\t\t\tif (debugLog) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(`[AgentBuilder] ${action}`, ...args);\n\t\t\t}\n\t\t},\n\t\t[debugLog],\n\t);\n\n\tconst handleChange = useCallback(\n\t\t(patch: Partial<AgentValue>) => {\n\t\t\tlogAction('onChange', patch);\n\t\t\tonChange(patch);\n\t\t},\n\t\t[logAction, onChange],\n\t);\n\tconst handleStepChange = useCallback(\n\t\t(step: Parameters<NonNullable<typeof onStepChange>>[0]) => {\n\t\t\tlogAction('onStepChange', step);\n\t\t\tonStepChange?.(step);\n\t\t},\n\t\t[logAction, onStepChange],\n\t);\n\tconst handleSaveDraft = useCallback(() => {\n\t\tlogAction('onSaveDraft');\n\t\treturn onSaveDraft();\n\t}, [logAction, onSaveDraft]);\n\tconst handlePublish = useCallback(() => {\n\t\tlogAction('onPublish');\n\t\treturn onPublish();\n\t}, [logAction, onPublish]);\n\t// Back opens the \"Save as draft?\" confirmation rather than leaving directly.\n\tconst handleBack = useCallback(() => {\n\t\tlogAction('onBack');\n\t\tsetShowLeaveConfirm(true);\n\t}, [logAction]);\n\n\t// Modal \"Discard\" defers to the parent's discard handler (same as the top bar).\n\tconst handleDiscardAndLeave = useCallback(() => {\n\t\tlogAction('onDiscardAndLeave');\n\t\tsetShowLeaveConfirm(false);\n\t\tonDiscard();\n\t}, [logAction, onDiscard]);\n\n\tconst handleSaveDraftAndLeave = useCallback(async () => {\n\t\tlogAction('onSaveDraftAndLeave');\n\t\tconst result = onSaveDraft();\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\tsetSavingAndLeaving(true);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t} finally {\n\t\t\t\tsetSavingAndLeaving(false);\n\t\t\t}\n\t\t}\n\t\tsetShowLeaveConfirm(false);\n\t\tonBack?.();\n\t}, [logAction, onSaveDraft, onBack]);\n\tconst handleTestAgent = useCallback(async () => {\n\t\tlogAction('onTestAgent');\n\t\tconst result = onTestAgent?.();\n\t\t// A new agent saves as draft before the test modal opens — that's slow, so\n\t\t// disable + load the button until it settles (prevents double-triggering).\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\tsetTestingLocal(true);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t} finally {\n\t\t\t\tsetTestingLocal(false);\n\t\t\t}\n\t\t}\n\t}, [logAction, onTestAgent]);\n\tconst handleGoToDashboard = useCallback(() => {\n\t\tlogAction('onGoToDashboard');\n\t\tonGoToDashboard?.();\n\t}, [logAction, onGoToDashboard]);\n\tconst handleCreateSubAgent = useCallback(\n\t\t(draft: SubAgentDraft) => {\n\t\t\tlogAction('onCreateSubAgent', draft);\n\t\t\treturn onCreateSubAgent\n\t\t\t\t? onCreateSubAgent(draft)\n\t\t\t\t: Promise.reject(new Error('onCreateSubAgent not provided'));\n\t\t},\n\t\t[logAction, onCreateSubAgent],\n\t);\n\n\tconst handleConfirmGoLive = async () => {\n\t\tlogAction('onGoLiveConfirm');\n\t\tconst result = handlePublish();\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\tsetPublishingLocal(true);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t\tsetModalMode('success');\n\t\t\t} finally {\n\t\t\t\tsetPublishingLocal(false);\n\t\t\t}\n\t\t} else {\n\t\t\tsetModalMode('success');\n\t\t}\n\t};\n\n\treturn (\n\t\t<AgentBuilderProvider\n\t\t\tvalue={value}\n\t\t\tonChange={handleChange}\n\t\t\tactiveStep={activeStep}\n\t\t\tonStepChange={onStepChange ? handleStepChange : undefined}\n\t\t\tavailableTools={availableTools}\n\t\t\tavailableSubAgents={availableSubAgents}\n\t\t\tavailableIntents={availableIntents}\n\t\t\tavailableModels={availableModels}\n\t\t\tconfigToolTemplates={configToolTemplates}\n\t\t\tintegrationStatus={integrationStatus}\n\t\t\tonConnectIntegration={onConnectIntegration}\n\t\t\tvariablesData={variablesData}\n\t\t\tvalidation={validation}\n\t\t\tapplicationType={applicationType}\n\t\t\tcharLimits={charLimits}\n\t\t\tdisableStepNavigation={disableStepNavigation}\n\t\t\tonCreateSubAgent={onCreateSubAgent ? handleCreateSubAgent : undefined}\n\t\t\tonFetchSubAgent={onFetchSubAgent}\n\t\t\tonUpdateSubAgent={onUpdateSubAgent}\n\t\t\tonImproveSubAgent={onImproveSubAgent}\n\t\t\tonImproveToolInstructions={onImproveToolInstructions}\n\t\t>\n\t\t\t<BuilderRoot data-test={rest['data-test'] ?? 'agent-builder'}>\n\t\t\t\t<AgentBuilderTopBar\n\t\t\t\t\tname={value.name}\n\t\t\t\t\tstatus={value.status}\n\t\t\t\t\tonBack={onBack ? handleBack : undefined}\n\t\t\t\t\tonSaveDraft={handleSaveDraftAndLeave}\n\t\t\t\t\tisSaving={isSaving || savingAndLeaving}\n\t\t\t\t/>\n\n\t\t\t\t<Main>\n\t\t\t\t\t<Rail>\n\t\t\t\t\t\t<StepRail />\n\t\t\t\t\t</Rail>\n\t\t\t\t\t<Content>\n\t\t\t\t\t\t{isLoading ? (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Spinner size=\"large\" color={COLORS.stroke.brand} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ContentCard>\n\t\t\t\t\t\t\t\t<StepScroll>\n\t\t\t\t\t\t\t\t\t<StepContent />\n\t\t\t\t\t\t\t\t</StepScroll>\n\t\t\t\t\t\t\t\t<AgentBuilderFooter\n\t\t\t\t\t\t\t\t\tfooterHint={footerHint}\n\t\t\t\t\t\t\t\t\tonTestAgent={onTestAgent ? handleTestAgent : undefined}\n\t\t\t\t\t\t\t\t\tisTesting={testingLocal}\n\t\t\t\t\t\t\t\t\tonGoLive={() => {\n\t\t\t\t\t\t\t\t\t\tlogAction('onGoLive');\n\t\t\t\t\t\t\t\t\t\tsetModalMode('confirm');\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tisPublishing={isPublishing || publishingLocal}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ContentCard>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Content>\n\t\t\t\t</Main>\n\n\t\t\t\t<GoLiveModal\n\t\t\t\t\tmode={modalMode}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tconst wasSuccess = modalMode === 'success';\n\t\t\t\t\t\tsetModalMode(null);\n\t\t\t\t\t\tif (wasSuccess) {\n\t\t\t\t\t\t\thandleGoToDashboard();\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonConfirm={handleConfirmGoLive}\n\t\t\t\t\tonSaveDraft={() => {\n\t\t\t\t\t\tsetModalMode(null);\n\t\t\t\t\t\thandleSaveDraft();\n\t\t\t\t\t}}\n\t\t\t\t\tonGoToDashboard={onGoToDashboard ? handleGoToDashboard : undefined}\n\t\t\t\t\tisPublishing={isPublishing || publishingLocal}\n\t\t\t\t/>\n\n\t\t\t\t<DiscardModal\n\t\t\t\t\topen={showLeaveConfirm}\n\t\t\t\t\tonClose={() => setShowLeaveConfirm(false)}\n\t\t\t\t\tonDiscard={handleDiscardAndLeave}\n\t\t\t\t\tonSaveDraft={handleSaveDraftAndLeave}\n\t\t\t\t\tdisableSaveDraft={!value.name.trim()}\n\t\t\t\t\tisSaving={isSaving || savingAndLeaving}\n\t\t\t\t/>\n\n\t\t\t\t<UndoToast />\n\t\t\t</BuilderRoot>\n\t\t</AgentBuilderProvider>\n\t);\n};\n\nAgentBuilder.displayName = 'AgentBuilder';\n"],"names":["StepContent","activeStep","useAgentBuilderContext","Step1About","Step2WhenItStepsIn","Step3HowItResponds","Step4HandoverRules","AgentBuilder","props","config","onChange","onStepChange","onDiscard","onSaveDraft","onPublish","onBack","onTestAgent","onGoToDashboard","onCreateSubAgent","onFetchSubAgent","onUpdateSubAgent","onImproveSubAgent","onImproveToolInstructions","onConnectIntegration","rest","value","availableTools","availableSubAgents","availableIntents","availableModels","configToolTemplates","integrationStatus","variablesData","validation","applicationType","charLimits","isSaving","isPublishing","isLoading","footerHint","disableStepNavigation","debugLog","modalMode","setModalMode","useState","publishingLocal","setPublishingLocal","testingLocal","setTestingLocal","showLeaveConfirm","setShowLeaveConfirm","savingAndLeaving","setSavingAndLeaving","logAction","useCallback","action","args","handleChange","patch","handleStepChange","step","handleSaveDraft","handlePublish","handleBack","handleDiscardAndLeave","handleSaveDraftAndLeave","result","handleTestAgent","handleGoToDashboard","handleCreateSubAgent","draft","handleConfirmGoLive","jsx","AgentBuilderProvider","BuilderRoot","AgentBuilderTopBar","Main","Rail","StepRail","Content","Spinner","COLORS","ContentCard","StepScroll","AgentBuilderFooter","GoLiveModal","wasSuccess","DiscardModal","UndoToast"],"mappings":";;;;;;;;;;;;;;;;AA+BA,MAAMA,KAAwB,MAAM;AACnC,QAAM,EAAE,YAAAC,EAAA,IAAeC,GAAA;AACvB,UAAQD,GAAA;AAAA,IACP,KAAK;AACJ,+BAAQE,IAAA,EAAW;AAAA,IACpB,KAAK;AACJ,+BAAQC,IAAA,EAAmB;AAAA,IAC5B,KAAK;AACJ,+BAAQC,IAAA,EAAmB;AAAA,IAC5B,KAAK;AACJ,+BAAQC,IAAA,EAAmB;AAAA,IAC5B;AACC,aAAO;AAAA,EAAA;AAEV,GAiBaC,KAA4C,CAACC,MAAU;AACnE,QAAM;AAAA,IACL,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACAhB,GACE;AAAA,IACL,OAAAiB;AAAA,IACA,YAAAxB;AAAA,IACA,gBAAAyB;AAAA,IACA,oBAAAC;AAAA,IACA,kBAAAC,IAAmB,CAAA;AAAA,IACnB,iBAAAC,IAAkB,CAAA;AAAA,IAClB,qBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAA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A,CAAY,GACd;AAAA,YACA,gBAAAwE;AAAA,cAACY;AAAA,cAAA;AAAA,gBACA,YAAA7C;AAAA,gBACA,aAAavB,IAAcmD,KAAkB;AAAA,gBAC7C,WAAWpB;AAAA,gBACX,UAAU,MAAM;AACf,kBAAAM,EAAU,UAAU,GACpBV,EAAa,SAAS;AAAA,gBACvB;AAAA,gBACA,cAAcN,KAAgBQ;AAAA,cAAA;AAAA,YAAA;AAAA,UAC/B,EAAA,CACD,EAAA,CAEF;AAAA,QAAA,GACD;AAAA,QAEA,gBAAA2B;AAAA,UAACa;AAAA,UAAA;AAAA,YACA,MAAM3C;AAAA,YACN,SAAS,MAAM;AACd,oBAAM4C,IAAa5C,MAAc;AACjC,cAAAC,EAAa,IAAI,GACb2C,KACHlB,EAAA;AAAA,YAEF;AAAA,YACA,WAAWG;AAAA,YACX,aAAa,MAAM;AAClB,cAAA5B,EAAa,IAAI,GACjBkB,GAAA;AAAA,YACD;AAAA,YACA,iBAAiB5C,IAAkBmD,IAAsB;AAAA,YACzD,cAAc/B,KAAgBQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAG/B,gBAAA2B;AAAA,UAACe;AAAA,UAAA;AAAA,YACA,MAAMtC;AAAA,YACN,SAAS,MAAMC,EAAoB,EAAK;AAAA,YACxC,WAAWc;AAAA,YACX,aAAaC;AAAA,YACb,kBAAkB,CAACxC,EAAM,KAAK,KAAA;AAAA,YAC9B,UAAUW,KAAYe;AAAA,UAAA;AAAA,QAAA;AAAA,0BAGtBqC,IAAA,CAAA,CAAU;AAAA,MAAA,EAAA,CACZ;AAAA,IAAA;AAAA,EAAA;AAGH;AAEAjF,GAAa,cAAc;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AgentConfig, AgentHandoverConfig, AgentToolDoc, IntentOption, ModelOption, StepKey, StepValidation, SubAgentRef, Trigger } from '@bikdotai/bik-models/ai-agents';
|
|
2
|
-
import { Channels } from '@bikdotai/bik-models/campaigns/models/Channel';
|
|
3
2
|
import { ApplicationType } from '@bikdotai/bik-models/growth';
|
|
4
3
|
import { VariableListInterfaceV3 } from '../variable-picker-v3/model';
|
|
5
4
|
import { AgentCharLimits } from './constants/charLimits';
|
|
@@ -33,12 +32,6 @@ export type AgentValue = AgentConfig & {
|
|
|
33
32
|
* meaningful for entry agents (sub-agents don't trigger).
|
|
34
33
|
*/
|
|
35
34
|
authentication?: Authentication;
|
|
36
|
-
/**
|
|
37
|
-
* Channels (and the specific accounts within each) this agent is activated on
|
|
38
|
-
* — Step 1's "Channels to activate it on" section. Empty / omitted means the
|
|
39
|
-
* agent runs on nothing yet.
|
|
40
|
-
*/
|
|
41
|
-
channels?: AgentChannelSelection[];
|
|
42
35
|
};
|
|
43
36
|
/** Per-agent customer verification config (see {@link AgentValue.authentication}). */
|
|
44
37
|
export interface Authentication {
|
|
@@ -47,53 +40,6 @@ export interface Authentication {
|
|
|
47
40
|
/** ONE method per agent; default "email_otp". */
|
|
48
41
|
type: 'email_otp' | 'phone_otp';
|
|
49
42
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Which surface an account belongs to.
|
|
52
|
-
*
|
|
53
|
-
* These are the shared `Channels` members from bik-models — NOT a re-spelled
|
|
54
|
-
* copy — narrowed to the three the builder actually supports. TypeScript treats
|
|
55
|
-
* each enum member as its own type, so this stays in lockstep with the platform
|
|
56
|
-
* enum while making `Channels.SMS` (and friends) a compile error here.
|
|
57
|
-
*
|
|
58
|
-
* Supporting another channel is two edits: add its member below, then add its
|
|
59
|
-
* entry to `CHANNEL_PRESENTATION` — which is typed
|
|
60
|
-
* `Record<AgentChannelType, …>`, so the compiler will insist on it.
|
|
61
|
-
*/
|
|
62
|
-
export type AgentChannelType = Channels.WHATSAPP | Channels.EMAIL | Channels.INSTAGRAM;
|
|
63
|
-
/** Whether the store's connection to an account is currently healthy. */
|
|
64
|
-
export type AgentChannelStatus = 'connected' | 'disconnected';
|
|
65
|
-
/**
|
|
66
|
-
* One connected account within a channel. The two ids are deliberately
|
|
67
|
-
* separate: `channelName` is the merchant-facing handle (a WhatsApp number, an
|
|
68
|
-
* inbox address, an Instagram username) and is ALL that's ever rendered, while
|
|
69
|
-
* `channelId` is the backend's opaque id and is ALL that's ever persisted.
|
|
70
|
-
* Never show `channelId`; never persist `channelName`.
|
|
71
|
-
*/
|
|
72
|
-
export interface AgentChannelAccount {
|
|
73
|
-
/** Backend id. Persisted in {@link AgentChannelSelection.channelIds}. */
|
|
74
|
-
channelId: string;
|
|
75
|
-
/** Merchant-facing handle shown on the chip / row. */
|
|
76
|
-
channelName: string;
|
|
77
|
-
/**
|
|
78
|
-
* Connection health. `'disconnected'` flags the account (negative chip +
|
|
79
|
-
* a row-level alert) so the merchant can go reconnect it. Defaults to
|
|
80
|
-
* `'connected'` when omitted.
|
|
81
|
-
*/
|
|
82
|
-
status?: AgentChannelStatus;
|
|
83
|
-
}
|
|
84
|
-
/** A channel the store has, plus every account connected under it. */
|
|
85
|
-
export interface AgentChannel {
|
|
86
|
-
type: AgentChannelType;
|
|
87
|
-
/** Overrides the built-in label for `type`. Required for unknown types. */
|
|
88
|
-
label?: string;
|
|
89
|
-
accounts: AgentChannelAccount[];
|
|
90
|
-
}
|
|
91
|
-
/** The agent's activation on one channel (see {@link AgentValue.channels}). */
|
|
92
|
-
export interface AgentChannelSelection {
|
|
93
|
-
type: AgentChannelType;
|
|
94
|
-
/** Backend {@link AgentChannelAccount.channelId}s — never display names. */
|
|
95
|
-
channelIds: string[];
|
|
96
|
-
}
|
|
97
43
|
/**
|
|
98
44
|
* The picker reads `AgentToolDoc`'s fields. `auth_required` is a backend-derived
|
|
99
45
|
* (read-only) flag — true when the tool touches customer-private data (order
|
|
@@ -256,7 +202,6 @@ export interface SubAgentDraft {
|
|
|
256
202
|
/** "Rest API" tools configured for this sub-agent (bespoke drawer). */
|
|
257
203
|
restApiTools?: RestApiToolConfig[];
|
|
258
204
|
}
|
|
259
|
-
export { Channels } from '@bikdotai/bik-models/campaigns/models/Channel';
|
|
260
205
|
export type { AgentConfig, AgentToolDoc, AgentStatus, StepKey, StepValidation, TriggerMode, Trigger, HandoverMethod, AgentHandoverConfig, SubAgentRef, IntentOption, ModelOption, } from '@bikdotai/bik-models/ai-agents';
|
|
261
206
|
/**
|
|
262
207
|
* All non-function (data / reference / flag) props, grouped into one object.
|
|
@@ -297,13 +242,6 @@ export interface AgentBuilderConfig {
|
|
|
297
242
|
variablesData?: VariableListInterfaceV3[];
|
|
298
243
|
/** Host application context the merchant runs in (e.g. ApplicationType.MANIFEST). */
|
|
299
244
|
applicationType?: ApplicationType;
|
|
300
|
-
/**
|
|
301
|
-
* The store's connected channels + accounts, for Step 1's "Channels to
|
|
302
|
-
* activate it on" section. Omit (or pass empty) to hide the section entirely.
|
|
303
|
-
* The library owns the label / glyph / tint for the known channel types and
|
|
304
|
-
* renders unknown ones from `label`.
|
|
305
|
-
*/
|
|
306
|
-
availableChannels?: AgentChannel[];
|
|
307
245
|
/** Optional consumer-supplied validity; merged over the builder's derived validity. */
|
|
308
246
|
validation?: Partial<StepValidation>;
|
|
309
247
|
/**
|
|
@@ -393,20 +331,6 @@ export interface AgentBuilderProps {
|
|
|
393
331
|
* `integrationStatus` so the source unblocks.
|
|
394
332
|
*/
|
|
395
333
|
onConnectIntegration?: (source: ToolSource) => void;
|
|
396
|
-
/**
|
|
397
|
-
* Open the consumer's channel-management screen — the "Channel management"
|
|
398
|
-
* link in the account picker's footer. Always called with the channel the
|
|
399
|
-
* merchant opened the picker for, so the consumer can deep-link straight to
|
|
400
|
-
* it. Omit to hide the link.
|
|
401
|
-
*/
|
|
402
|
-
onManageChannels?: (type: AgentChannelType) => void;
|
|
403
|
-
/**
|
|
404
|
-
* Open the consumer's smart-agent-handover settings — the link inside Step 4's
|
|
405
|
-
* "Use default settings" card, which is where those defaults are actually
|
|
406
|
-
* defined. BIK only (see {@link AgentBuilderConfig.applicationType}); omit to
|
|
407
|
-
* render the card's subtitle as plain text with no link.
|
|
408
|
-
*/
|
|
409
|
-
onSmartAgentHandover?: () => void;
|
|
410
334
|
/** Test id applied to the builder root for e2e/component tests. */
|
|
411
335
|
'data-test'?: string;
|
|
412
336
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
export declare const BuilderRoot: import('styled-components').StyledComponent<"div", any, {
|
|
3
2
|
className: "bik-builder-root";
|
|
4
3
|
}, "className">;
|
|
@@ -140,29 +139,6 @@ export declare const ModalBody: import('styled-components').StyledComponent<"div
|
|
|
140
139
|
export declare const ModalIcon: import('styled-components').StyledComponent<"div", any, {
|
|
141
140
|
className: "bik-modal-icon";
|
|
142
141
|
}, "className">;
|
|
143
|
-
/**
|
|
144
|
-
* The go-live SUCCESS dialog's natural height, which every state of
|
|
145
|
-
* `AgentStateModal` is pinned to so the card doesn't resize as a publish moves
|
|
146
|
-
* loading → error, or loading → success (a different dialog at the same size).
|
|
147
|
-
*
|
|
148
|
-
* 24 + 24 padding + 64 icon + 8 gap + 28 title (TitleMedium 20/28) + 8 gap
|
|
149
|
-
* + 48 body (BodyPrimary 16/24, two lines at this width) + 24 gap
|
|
150
|
-
* + 40 action row (medium Button: 10px padding + 20px line-height) = 268.
|
|
151
|
-
*
|
|
152
|
-
* Deliberately NOT on `ModalBody`: DiscardModal and RequireVerificationModal share
|
|
153
|
-
* it and are not part of this sequence.
|
|
154
|
-
*/
|
|
155
|
-
export declare const AGENT_STATE_MODAL_MIN_HEIGHT = 268;
|
|
156
|
-
/** `ModalBody` pinned to the height above. The body itself is NOT centred — that
|
|
157
|
-
* floats the action row in the middle of the card. The hero takes the slack instead
|
|
158
|
-
* (see `AgentStateModalHero`), so the actions stay at the bottom, above the body's
|
|
159
|
-
* own 24px padding. */
|
|
160
|
-
export declare const AgentStateModalBody: import('styled-components').StyledComponent<"div", any, {
|
|
161
|
-
className: "bik-modal-body";
|
|
162
|
-
}, "className">;
|
|
163
|
-
/** Badge + title + message. Grows into whatever height the pinned card has spare and
|
|
164
|
-
* centres itself there, which is what keeps the actions pinned to the bottom. */
|
|
165
|
-
export declare const AgentStateModalHero: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
166
142
|
export declare const ModalActions: import('styled-components').StyledComponent<"div", any, {
|
|
167
143
|
className: "bik-modal-actions";
|
|
168
144
|
}, "className">;
|
|
@@ -170,70 +146,3 @@ export declare const ModalActions: import('styled-components').StyledComponent<"
|
|
|
170
146
|
export declare const FieldActionRow: import('styled-components').StyledComponent<"div", any, {
|
|
171
147
|
className: "bik-field-action-row";
|
|
172
148
|
}, "className">;
|
|
173
|
-
export declare const ChannelsSectionRoot: import('styled-components').StyledComponent<"div", any, {
|
|
174
|
-
className: "bik-channels-section";
|
|
175
|
-
}, "className">;
|
|
176
|
-
/** "Channel management" / "Smart agent handover" — a text link, not a Button. */
|
|
177
|
-
export declare const ChannelsLink: import('styled-components').StyledComponent<"button", any, {
|
|
178
|
-
className: "bik-channels-link";
|
|
179
|
-
}, "className">;
|
|
180
|
-
/** One channel's card. */
|
|
181
|
-
export declare const ChannelCard: import('styled-components').StyledComponent<"div", any, {
|
|
182
|
-
className: "bik-channel-card";
|
|
183
|
-
}, "className">;
|
|
184
|
-
export declare const ChannelRow: import('styled-components').StyledComponent<"div", any, {
|
|
185
|
-
className: "bik-channel-row";
|
|
186
|
-
}, "className">;
|
|
187
|
-
export declare const ChannelRowMain: import('styled-components').StyledComponent<"div", any, {
|
|
188
|
-
className: "bik-channel-row-main";
|
|
189
|
-
}, "className">;
|
|
190
|
-
/** Label + glyph. Fixed-width so every card's chips start on the same column. */
|
|
191
|
-
export declare const ChannelIdentity: import('styled-components').StyledComponent<"div", any, {
|
|
192
|
-
className: "bik-channel-identity";
|
|
193
|
-
}, "className">;
|
|
194
|
-
/** Tinted 24×24 square holding the 16px brand glyph. */
|
|
195
|
-
export declare const ChannelGlyph: import('styled-components').StyledComponent<"div", any, {
|
|
196
|
-
className: "bik-channel-glyph";
|
|
197
|
-
} & {
|
|
198
|
-
tint: string;
|
|
199
|
-
}, "className">;
|
|
200
|
-
/** The account chips. Wraps rather than overflowing when a store has many. */
|
|
201
|
-
export declare const ChannelChips: import('styled-components').StyledComponent<"div", any, {
|
|
202
|
-
className: "bik-channel-chips";
|
|
203
|
-
}, "className">;
|
|
204
|
-
/**
|
|
205
|
-
* Hover target for a chip's tooltip.
|
|
206
|
-
*
|
|
207
|
-
* Tippy attaches a ref to its child to use as the trigger, but `Tag` is a plain
|
|
208
|
-
* function component with no `forwardRef` — so wrapping a Tag directly gives
|
|
209
|
-
* Tippy no DOM node and the tooltip silently never opens. This span is the node
|
|
210
|
-
* it can hold on to. (`IconButton` wraps its disabled tooltip the same way.)
|
|
211
|
-
*/
|
|
212
|
-
export declare const ChipTooltipTarget: import('styled-components').StyledComponent<"span", any, {
|
|
213
|
-
className: "bik-chip-tooltip-target";
|
|
214
|
-
}, "className">;
|
|
215
|
-
/** Scrollable account list inside the picker modal. */
|
|
216
|
-
export declare const ChannelPickerList: import('styled-components').StyledComponent<"div", any, {
|
|
217
|
-
className: "bik-channel-picker-list";
|
|
218
|
-
}, "className">;
|
|
219
|
-
export declare const ChannelPickerRow: import('styled-components').StyledComponent<"div", any, {
|
|
220
|
-
className: "bik-channel-picker-row";
|
|
221
|
-
}, "className">;
|
|
222
|
-
/**
|
|
223
|
-
* Glyph + account name inside a picker row. Figma wraps these in their own
|
|
224
|
-
* `px-4` group, so the checkbox sits 12px from the glyph but the glyph sits 8px
|
|
225
|
-
* from the label.
|
|
226
|
-
*/
|
|
227
|
-
export declare const ChannelPickerAccount: import('styled-components').StyledComponent<"div", any, {
|
|
228
|
-
className: "bik-channel-picker-account";
|
|
229
|
-
}, "className">;
|
|
230
|
-
export declare const ChannelPickerBody: import('styled-components').StyledComponent<"div", any, {
|
|
231
|
-
className: "bik-channel-picker-body";
|
|
232
|
-
}, "className">;
|
|
233
|
-
/**
|
|
234
|
-
* Figma reserves a 24×24 slot for a checkbox (an 18px box inset by 3px), but the
|
|
235
|
-
* library's CheckBox renders the bare 18px box. Without this the checkbox column
|
|
236
|
-
* — and everything after it — sits 3px tight against the design. Passed as
|
|
237
|
-
* CheckBox's `style`, which lands on its container.
|
|
238
|
-
*/
|
|
239
|
-
export declare const CHECKBOX_SLOT: React.CSSProperties;
|