@bikdotai/bik-component-library 0.0.831-beta.1 → 0.0.831-beta.3
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 +6 -6
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +2 -2
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/DrawerHeaderText.js +3 -3
- package/dist/cjs/components/agent-builder/components/DrawerHeaderText.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +19 -19
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +4 -4
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js +4 -4
- 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/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 +2 -0
- package/dist/cjs/components/agent-builder/utils/toolActions.js.map +1 -0
- package/dist/cjs/components/states-modal/DeleteConfirmationModal.js +1 -1
- package/dist/cjs/components/states-modal/DeleteConfirmationModal.js.map +1 -1
- package/dist/cjs/icons/Media/Visual/{FormkitNeutral.js → Frame26086263.js} +1 -1
- package/dist/cjs/icons/Media/Visual/Frame26086263.js.map +1 -0
- package/dist/cjs/icons/Media/Visual/{FormkitSad.js → IconTrailing.js} +1 -1
- package/dist/cjs/icons/Media/Visual/IconTrailing.js.map +1 -0
- package/dist/cjs/icons/Social/Social/SlackIcon.js +2 -0
- package/dist/cjs/icons/Social/Social/SlackIcon.js.map +1 -0
- package/dist/cjs/icons/index.js +1 -1
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +92 -101
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +149 -154
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/DrawerHeaderText.d.ts +2 -9
- package/dist/esm/components/agent-builder/components/DrawerHeaderText.js +15 -19
- package/dist/esm/components/agent-builder/components/DrawerHeaderText.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionField.js +57 -66
- package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +66 -55
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +77 -80
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +10 -0
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +134 -118
- package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +144 -148
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/sourceIcons.js +14 -14
- package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/toolActions.d.ts +11 -0
- package/dist/esm/components/agent-builder/utils/toolActions.js +15 -0
- package/dist/esm/components/agent-builder/utils/toolActions.js.map +1 -0
- package/dist/esm/components/states-modal/DeleteConfirmationModal.d.ts +2 -0
- package/dist/esm/components/states-modal/DeleteConfirmationModal.js +11 -10
- package/dist/esm/components/states-modal/DeleteConfirmationModal.js.map +1 -1
- package/dist/esm/icons/Media/Visual/Frame26086263.d.ts +7 -0
- package/dist/esm/icons/Media/Visual/{FormkitNeutral.js → Frame26086263.js} +1 -1
- package/dist/esm/icons/Media/Visual/Frame26086263.js.map +1 -0
- package/dist/esm/icons/Media/Visual/IconTrailing.d.ts +7 -0
- package/dist/esm/icons/Media/Visual/{FormkitSad.js → IconTrailing.js} +1 -1
- package/dist/esm/icons/Media/Visual/IconTrailing.js.map +1 -0
- package/dist/esm/icons/Media/Visual/index.d.ts +2 -2
- package/dist/esm/icons/Social/Social/SlackIcon.d.ts +7 -0
- package/dist/esm/icons/Social/Social/SlackIcon.js +47 -0
- package/dist/esm/icons/Social/Social/SlackIcon.js.map +1 -0
- package/dist/esm/icons/Social/Social/index.d.ts +1 -0
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/icons/index.js +246 -244
- package/dist/esm/icons/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/icons/Media/Visual/FormkitNeutral.js.map +0 -1
- package/dist/cjs/icons/Media/Visual/FormkitSad.js.map +0 -1
- package/dist/esm/icons/Media/Visual/FormkitNeutral.js.map +0 -1
- package/dist/esm/icons/Media/Visual/FormkitSad.js.map +0 -1
|
@@ -1,81 +1,56 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import j from "../../../assets/icons/delete.svg.js";
|
|
3
|
+
import z from "../../../assets/icons/plus.svg.js";
|
|
4
4
|
import { useState as n } from "react";
|
|
5
5
|
import x from "styled-components";
|
|
6
6
|
import { TitleSmall as c } from "../../TypographyStyle.js";
|
|
7
7
|
import { COLORS as s } from "../../../constants/Theme.js";
|
|
8
8
|
import { FieldBlock as d } from "../AgentBuilder.styled.js";
|
|
9
9
|
import { AGENT_CHAR_LIMITS as F } from "../constants/charLimits.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { ToolInstructionsField as K } from "./ToolInstructionsField.js";
|
|
14
|
-
import { SideModal as Q } from "../../side-modal/SideModal.js";
|
|
10
|
+
import { DRAWER_BODY_STYLE as G, DRAWER_HEADER_STYLE as J, DrawerHeaderText as U } from "./DrawerHeaderText.js";
|
|
11
|
+
import { ToolInstructionsField as Y } from "./ToolInstructionsField.js";
|
|
12
|
+
import { SideModal as V } from "../../side-modal/SideModal.js";
|
|
15
13
|
import { Input as m } from "../../input/Input.js";
|
|
16
|
-
import { Dropdown as
|
|
17
|
-
import { unwrapDropdownValue as
|
|
18
|
-
import { Button as
|
|
19
|
-
import { BikEditor as
|
|
20
|
-
const
|
|
14
|
+
import { Dropdown as W } from "../../dropdown/Dropdown.js";
|
|
15
|
+
import { unwrapDropdownValue as K } from "../../dropdown/utils.js";
|
|
16
|
+
import { Button as Q } from "../../button/Button.js";
|
|
17
|
+
import { BikEditor as w } from "../../../editor/BikEditor.js";
|
|
18
|
+
const X = ["GET", "POST", "PUT", "PATCH", "DELETE"], Z = X.map((i) => ({
|
|
21
19
|
label: i,
|
|
22
20
|
value: i
|
|
23
|
-
})),
|
|
21
|
+
})), Se = ({
|
|
24
22
|
onClose: i,
|
|
25
|
-
onSave:
|
|
23
|
+
onSave: k,
|
|
26
24
|
initial: a,
|
|
27
|
-
onImprove:
|
|
25
|
+
onImprove: A,
|
|
28
26
|
charLimits: T = F,
|
|
29
|
-
zIndex:
|
|
27
|
+
zIndex: P
|
|
30
28
|
}) => {
|
|
31
|
-
const [
|
|
29
|
+
const [h, B] = n(a?.name ?? ""), [v, D] = n(a?.instructions ?? ""), [u, O] = n(a?.url ?? ""), [y, L] = n(
|
|
32
30
|
a?.method ?? "POST"
|
|
33
|
-
), [g,
|
|
31
|
+
), [g, f] = n(
|
|
34
32
|
a?.headers ?? [{ key: "", value: "" }]
|
|
35
33
|
), [S, _] = n(a?.requestBody ?? ""), [b, M] = n(
|
|
36
34
|
a?.responseSample ?? ""
|
|
37
|
-
), [C, R] = n(!1), H = (r, t) =>
|
|
38
|
-
(o) => o.map((p,
|
|
39
|
-
),
|
|
40
|
-
if (!E || C)
|
|
41
|
-
return;
|
|
42
|
-
const r = {
|
|
43
|
-
id: a?.id ?? `restapi_${Date.now().toString(36)}`,
|
|
44
|
-
name: u.trim(),
|
|
45
|
-
instructions: v,
|
|
46
|
-
url: h.trim(),
|
|
47
|
-
method: f,
|
|
48
|
-
// Drop fully-empty header rows.
|
|
49
|
-
headers: g.filter((o) => o.key.trim() || o.value.trim()),
|
|
50
|
-
requestBody: S,
|
|
51
|
-
responseSample: b
|
|
52
|
-
}, t = A(r);
|
|
53
|
-
if (t && typeof t.then == "function") {
|
|
54
|
-
R(!0);
|
|
55
|
-
try {
|
|
56
|
-
await t;
|
|
57
|
-
} finally {
|
|
58
|
-
R(!1);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
35
|
+
), [C, R] = n(!1), H = (r, t) => f(
|
|
36
|
+
(o) => o.map((p, $) => $ === r ? { ...p, ...t } : p)
|
|
37
|
+
), q = () => f((r) => [...r, { key: "", value: "" }]), N = (r) => f((t) => t.filter((o, p) => p !== r)), E = h.trim().length > 0 && u.trim().length > 0;
|
|
62
38
|
return /* @__PURE__ */ l(
|
|
63
|
-
|
|
39
|
+
V,
|
|
64
40
|
{
|
|
65
41
|
header: "Rest API",
|
|
66
42
|
closeOnEscapeKey: !1,
|
|
67
|
-
zIndex:
|
|
43
|
+
zIndex: P,
|
|
68
44
|
headerCustomComponent: /* @__PURE__ */ e(
|
|
69
|
-
|
|
45
|
+
U,
|
|
70
46
|
{
|
|
71
47
|
title: "Rest API",
|
|
72
|
-
subtitle: "Connect to any API endpoint. Configure the request, then test it with a sample response."
|
|
73
|
-
icon: J[G.RestApi]
|
|
48
|
+
subtitle: "Connect to any API endpoint. Configure the request, then test it with a sample response."
|
|
74
49
|
}
|
|
75
50
|
),
|
|
76
51
|
width: "431px",
|
|
77
|
-
headerStyle:
|
|
78
|
-
bodyStyle:
|
|
52
|
+
headerStyle: J,
|
|
53
|
+
bodyStyle: G,
|
|
79
54
|
onClose: i,
|
|
80
55
|
saveButtonProps: {
|
|
81
56
|
"data-test": "restapi-save",
|
|
@@ -84,7 +59,29 @@ const te = ["GET", "POST", "PUT", "PATCH", "DELETE"], re = te.map((i) => ({
|
|
|
84
59
|
size: "small",
|
|
85
60
|
disabled: !E,
|
|
86
61
|
isLoading: C,
|
|
87
|
-
onClick:
|
|
62
|
+
onClick: async () => {
|
|
63
|
+
if (!E || C)
|
|
64
|
+
return;
|
|
65
|
+
const r = {
|
|
66
|
+
id: a?.id ?? `restapi_${Date.now().toString(36)}`,
|
|
67
|
+
name: h.trim(),
|
|
68
|
+
instructions: v,
|
|
69
|
+
url: u.trim(),
|
|
70
|
+
method: y,
|
|
71
|
+
// Drop fully-empty header rows.
|
|
72
|
+
headers: g.filter((o) => o.key.trim() || o.value.trim()),
|
|
73
|
+
requestBody: S,
|
|
74
|
+
responseSample: b
|
|
75
|
+
}, t = k(r);
|
|
76
|
+
if (t && typeof t.then == "function") {
|
|
77
|
+
R(!0);
|
|
78
|
+
try {
|
|
79
|
+
await t;
|
|
80
|
+
} finally {
|
|
81
|
+
R(!1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
88
85
|
},
|
|
89
86
|
cancelButtonProps: {
|
|
90
87
|
"data-test": "restapi-cancel",
|
|
@@ -102,21 +99,21 @@ const te = ["GET", "POST", "PUT", "PATCH", "DELETE"], re = te.map((i) => ({
|
|
|
102
99
|
labelText: "Name",
|
|
103
100
|
labelTextBold: !0,
|
|
104
101
|
placeholder: "Enter name",
|
|
105
|
-
value:
|
|
102
|
+
value: h,
|
|
106
103
|
maxCharLimit: T.name,
|
|
107
|
-
onChangeText:
|
|
104
|
+
onChangeText: B
|
|
108
105
|
}
|
|
109
106
|
),
|
|
110
107
|
/* @__PURE__ */ e(
|
|
111
|
-
|
|
108
|
+
Y,
|
|
112
109
|
{
|
|
113
110
|
"data-test": "restapi-instructions",
|
|
114
111
|
label: "Instructions",
|
|
115
112
|
value: v,
|
|
116
|
-
onChange:
|
|
113
|
+
onChange: D,
|
|
117
114
|
maxLength: T.instructions,
|
|
118
115
|
placeholder: "Describe how should the LLM generate the rest API",
|
|
119
|
-
onImprove:
|
|
116
|
+
onImprove: A
|
|
120
117
|
}
|
|
121
118
|
),
|
|
122
119
|
/* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(
|
|
@@ -128,22 +125,22 @@ const te = ["GET", "POST", "PUT", "PATCH", "DELETE"], re = te.map((i) => ({
|
|
|
128
125
|
labelTextBold: !0,
|
|
129
126
|
placeholder: "https://",
|
|
130
127
|
type: "url",
|
|
131
|
-
value:
|
|
132
|
-
onChangeText:
|
|
128
|
+
value: u,
|
|
129
|
+
onChangeText: O
|
|
133
130
|
}
|
|
134
131
|
) }),
|
|
135
132
|
/* @__PURE__ */ l(d, { children: [
|
|
136
133
|
/* @__PURE__ */ e(c, { color: s.content.primary, children: "HTTP method" }),
|
|
137
134
|
/* @__PURE__ */ e(
|
|
138
|
-
|
|
135
|
+
W,
|
|
139
136
|
{
|
|
140
137
|
"data-test": "restapi-method",
|
|
141
138
|
size: "small",
|
|
142
139
|
width: "100%",
|
|
143
|
-
options:
|
|
144
|
-
defaultOptions: [{ label:
|
|
140
|
+
options: Z,
|
|
141
|
+
defaultOptions: [{ label: y, value: y }],
|
|
145
142
|
onSelect: (r) => {
|
|
146
|
-
const t =
|
|
143
|
+
const t = K(r);
|
|
147
144
|
t && L(t);
|
|
148
145
|
}
|
|
149
146
|
}
|
|
@@ -153,7 +150,7 @@ const te = ["GET", "POST", "PUT", "PATCH", "DELETE"], re = te.map((i) => ({
|
|
|
153
150
|
/* @__PURE__ */ e(c, { color: s.content.primary, children: "Headers" }),
|
|
154
151
|
g.map((r, t) => (
|
|
155
152
|
// eslint-disable-next-line react/no-array-index-key
|
|
156
|
-
/* @__PURE__ */ l(
|
|
153
|
+
/* @__PURE__ */ l(ee, { "data-test": `restapi-header-${t}`, children: [
|
|
157
154
|
/* @__PURE__ */ e(
|
|
158
155
|
m,
|
|
159
156
|
{
|
|
@@ -175,14 +172,14 @@ const te = ["GET", "POST", "PUT", "PATCH", "DELETE"], re = te.map((i) => ({
|
|
|
175
172
|
}
|
|
176
173
|
),
|
|
177
174
|
/* @__PURE__ */ e(
|
|
178
|
-
|
|
175
|
+
re,
|
|
179
176
|
{
|
|
180
177
|
type: "button",
|
|
181
178
|
"aria-label": "Remove header",
|
|
182
179
|
"data-test": `restapi-header-remove-${t}`,
|
|
183
|
-
onClick: () =>
|
|
180
|
+
onClick: () => N(t),
|
|
184
181
|
children: /* @__PURE__ */ e(
|
|
185
|
-
|
|
182
|
+
j,
|
|
186
183
|
{
|
|
187
184
|
width: 16,
|
|
188
185
|
height: 16,
|
|
@@ -193,26 +190,26 @@ const te = ["GET", "POST", "PUT", "PATCH", "DELETE"], re = te.map((i) => ({
|
|
|
193
190
|
)
|
|
194
191
|
] }, t)
|
|
195
192
|
)),
|
|
196
|
-
/* @__PURE__ */ e(
|
|
197
|
-
|
|
193
|
+
/* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(
|
|
194
|
+
Q,
|
|
198
195
|
{
|
|
199
196
|
"data-test": "restapi-add-header",
|
|
200
197
|
buttonType: "dashRegular",
|
|
201
198
|
size: "small",
|
|
202
|
-
LeadingIcon:
|
|
199
|
+
LeadingIcon: z,
|
|
203
200
|
buttonText: "Add header",
|
|
204
|
-
onClick:
|
|
201
|
+
onClick: q
|
|
205
202
|
}
|
|
206
203
|
) })
|
|
207
204
|
] }),
|
|
208
205
|
/* @__PURE__ */ l(d, { children: [
|
|
209
206
|
/* @__PURE__ */ e(c, { color: s.content.primary, children: "Request " }),
|
|
210
207
|
/* @__PURE__ */ e(
|
|
211
|
-
|
|
208
|
+
w,
|
|
212
209
|
{
|
|
213
210
|
features: { jsonMode: !0 },
|
|
214
211
|
initialContent: S,
|
|
215
|
-
style:
|
|
212
|
+
style: I,
|
|
216
213
|
placeholder: "Type or paste JSON here",
|
|
217
214
|
onChange: (r) => _(r.text),
|
|
218
215
|
minHeight: "120px",
|
|
@@ -223,10 +220,10 @@ const te = ["GET", "POST", "PUT", "PATCH", "DELETE"], re = te.map((i) => ({
|
|
|
223
220
|
/* @__PURE__ */ l(d, { children: [
|
|
224
221
|
/* @__PURE__ */ e(c, { color: s.content.primary, children: "Response " }),
|
|
225
222
|
/* @__PURE__ */ e(
|
|
226
|
-
|
|
223
|
+
w,
|
|
227
224
|
{
|
|
228
225
|
features: { jsonMode: !0 },
|
|
229
|
-
style:
|
|
226
|
+
style: I,
|
|
230
227
|
initialContent: b,
|
|
231
228
|
placeholder: "Type or paste JSON here",
|
|
232
229
|
onChange: (r) => M(r.text),
|
|
@@ -238,13 +235,13 @@ const te = ["GET", "POST", "PUT", "PATCH", "DELETE"], re = te.map((i) => ({
|
|
|
238
235
|
]
|
|
239
236
|
}
|
|
240
237
|
);
|
|
241
|
-
},
|
|
238
|
+
}, ee = x.div`
|
|
242
239
|
display: flex;
|
|
243
240
|
align-items: center;
|
|
244
241
|
gap: 8px;
|
|
245
|
-
`,
|
|
242
|
+
`, te = x.div`
|
|
246
243
|
display: flex;
|
|
247
|
-
`,
|
|
244
|
+
`, re = x.button`
|
|
248
245
|
display: inline-flex;
|
|
249
246
|
align-items: center;
|
|
250
247
|
justify-content: center;
|
|
@@ -259,12 +256,12 @@ const te = ["GET", "POST", "PUT", "PATCH", "DELETE"], re = te.map((i) => ({
|
|
|
259
256
|
&:hover {
|
|
260
257
|
border-color: ${s.content.secondary};
|
|
261
258
|
}
|
|
262
|
-
`,
|
|
259
|
+
`, I = {
|
|
263
260
|
borderRadius: "4px",
|
|
264
261
|
overflow: "hidden"
|
|
265
262
|
};
|
|
266
263
|
export {
|
|
267
|
-
|
|
268
|
-
|
|
264
|
+
I as JsonFieldBox,
|
|
265
|
+
Se as RestApiToolPanel
|
|
269
266
|
};
|
|
270
267
|
//# sourceMappingURL=RestApiToolPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestApiToolPanel.js","sources":["../../../../../src/components/agent-builder/components/RestApiToolPanel.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport { BikEditor } from '@src/editor';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { Dropdown, unwrapDropdownValue } from '@src/components/dropdown';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { Input } from '@src/components/input';\nimport { SideModal } from '@src/components/side-modal';\nimport { TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tRestApiHeader,\n\tRestApiMethod,\n\tRestApiToolConfig,\n} from '../AgentBuilder.model';\nimport { FieldBlock } from '../AgentBuilder.styled';\nimport type { AgentCharLimits } from '../constants/charLimits';\nimport { AGENT_CHAR_LIMITS } from '../constants/charLimits';\nimport { ToolSource } from '../constants/tools';\nimport { SOURCE_ICONS } from '../utils/sourceIcons';\nimport {\n\tDRAWER_BODY_STYLE,\n\tDRAWER_HEADER_STYLE,\n\tDrawerHeaderText,\n} from './DrawerHeaderText';\nimport { ToolInstructionsField } from './ToolInstructionsField';\n\ninterface RestApiToolPanelProps {\n\tonClose: () => void;\n\t/** Persist the config. A pending promise shows the Save loader. */\n\tonSave: (config: RestApiToolConfig) => void | Promise<void>;\n\t/** Seed values when editing an existing tool. */\n\tinitial?: RestApiToolConfig;\n\t/** Optional \"Improve with AI\" for the instructions field. Omit to hide it. */\n\tonImprove?: (text: string) => Promise<string>;\n\tcharLimits?: AgentCharLimits;\n\t/** SideModal stacking order — raise it when opened over another drawer. */\n\tzIndex?: number;\n}\n\nconst METHODS: RestApiMethod[] = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];\nconst METHOD_OPTIONS: SingleOption[] = METHODS.map((m) => ({\n\tlabel: m,\n\tvalue: m,\n}));\n\n/**\n * Right-side drawer to configure a \"Rest API\" tool: the endpoint the agent can\n * call, plus a JSON request-body template and a sample response. Mount it fresh\n * per open (key it) so `initial` seeds the state. Built on the shared `SideModal`\n * shell and the BikEditor JSON body mode for the Request / Response editors.\n */\nexport const RestApiToolPanel: React.FC<RestApiToolPanelProps> = ({\n\tonClose,\n\tonSave,\n\tinitial,\n\tonImprove,\n\tcharLimits = AGENT_CHAR_LIMITS,\n\tzIndex,\n}) => {\n\tconst [name, setName] = useState(initial?.name ?? '');\n\tconst [instructions, setInstructions] = useState(initial?.instructions ?? '');\n\tconst [url, setUrl] = useState(initial?.url ?? '');\n\tconst [method, setMethod] = useState<RestApiMethod>(\n\t\tinitial?.method ?? 'POST',\n\t);\n\tconst [headers, setHeaders] = useState<RestApiHeader[]>(\n\t\tinitial?.headers ?? [{ key: '', value: '' }],\n\t);\n\tconst [requestBody, setRequestBody] = useState(initial?.requestBody ?? '');\n\tconst [responseSample, setResponseSample] = useState(\n\t\tinitial?.responseSample ?? '',\n\t);\n\tconst [saving, setSaving] = useState(false);\n\n\tconst patchHeader = (i: number, patch: Partial<RestApiHeader>) =>\n\t\tsetHeaders((prev) =>\n\t\t\tprev.map((h, idx) => (idx === i ? { ...h, ...patch } : h)),\n\t\t);\n\tconst addHeader = () =>\n\t\tsetHeaders((prev) => [...prev, { key: '', value: '' }]);\n\tconst removeHeader = (i: number) =>\n\t\tsetHeaders((prev) => prev.filter((_, idx) => idx !== i));\n\n\tconst canSave = name.trim().length > 0 && url.trim().length > 0;\n\n\tconst handleSave = async () => {\n\t\tif (!canSave || saving) {\n\t\t\treturn;\n\t\t}\n\t\tconst config: RestApiToolConfig = {\n\t\t\tid: initial?.id ?? `restapi_${Date.now().toString(36)}`,\n\t\t\tname: name.trim(),\n\t\t\tinstructions,\n\t\t\turl: url.trim(),\n\t\t\tmethod,\n\t\t\t// Drop fully-empty header rows.\n\t\t\theaders: headers.filter((h) => h.key.trim() || h.value.trim()),\n\t\t\trequestBody,\n\t\t\tresponseSample,\n\t\t};\n\t\tconst result = onSave(config);\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\tsetSaving(true);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t} finally {\n\t\t\t\tsetSaving(false);\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (\n\t\t<SideModal\n\t\t\theader=\"Rest API\"\n\t\t\tcloseOnEscapeKey={false}\n\t\t\tzIndex={zIndex}\n\t\t\theaderCustomComponent={\n\t\t\t\t<DrawerHeaderText\n\t\t\t\t\ttitle=\"Rest API\"\n\t\t\t\t\tsubtitle=\"Connect to any API endpoint. Configure the request, then test it with a sample response.\"\n\t\t\t\t\ticon={SOURCE_ICONS[ToolSource.RestApi]}\n\t\t\t\t/>\n\t\t\t}\n\t\t\twidth=\"431px\"\n\t\t\theaderStyle={DRAWER_HEADER_STYLE}\n\t\t\tbodyStyle={DRAWER_BODY_STYLE}\n\t\t\tonClose={onClose}\n\t\t\tsaveButtonProps={{\n\t\t\t\t'data-test': 'restapi-save',\n\t\t\t\tbuttonText: 'Save',\n\t\t\t\tbuttonType: 'primary',\n\t\t\t\tsize: 'small',\n\t\t\t\tdisabled: !canSave,\n\t\t\t\tisLoading: saving,\n\t\t\t\tonClick: handleSave,\n\t\t\t}}\n\t\t\tcancelButtonProps={{\n\t\t\t\t'data-test': 'restapi-cancel',\n\t\t\t\tbuttonText: 'Cancel',\n\t\t\t\tbuttonType: 'tertiaryGray',\n\t\t\t\tsize: 'small',\n\t\t\t\tonClick: onClose,\n\t\t\t}}\n\t\t>\n\t\t\t<Input\n\t\t\t\tdata-test=\"restapi-name\"\n\t\t\t\tvariant=\"small\"\n\t\t\t\tlabelText=\"Name\"\n\t\t\t\tlabelTextBold\n\t\t\t\tplaceholder=\"Enter name\"\n\t\t\t\tvalue={name}\n\t\t\t\tmaxCharLimit={charLimits.name}\n\t\t\t\tonChangeText={setName}\n\t\t\t/>\n\n\t\t\t<ToolInstructionsField\n\t\t\t\tdata-test=\"restapi-instructions\"\n\t\t\t\tlabel=\"Instructions\"\n\t\t\t\tvalue={instructions}\n\t\t\t\tonChange={setInstructions}\n\t\t\t\tmaxLength={charLimits.instructions}\n\t\t\t\tplaceholder=\"Describe how should the LLM generate the rest API\"\n\t\t\t\tonImprove={onImprove}\n\t\t\t/>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<Input\n\t\t\t\t\tdata-test=\"restapi-url\"\n\t\t\t\t\tvariant=\"small\"\n\t\t\t\t\tlabelText=\"Request URL\"\n\t\t\t\t\tlabelTextBold\n\t\t\t\t\tplaceholder=\"https://\"\n\t\t\t\t\ttype=\"url\"\n\t\t\t\t\tvalue={url}\n\t\t\t\t\tonChangeText={setUrl}\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>HTTP method</TitleSmall>\n\t\t\t\t<Dropdown\n\t\t\t\t\tdata-test=\"restapi-method\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\toptions={METHOD_OPTIONS}\n\t\t\t\t\tdefaultOptions={[{ label: method, value: method }]}\n\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\tsetMethod(v as RestApiMethod);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Headers</TitleSmall>\n\t\t\t\t{headers.map((h, i) => (\n\t\t\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t\t\t<HeaderRow key={i} data-test={`restapi-header-${i}`}>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tvariant=\"small\"\n\t\t\t\t\t\t\thideInputHeader\n\t\t\t\t\t\t\tplaceholder=\"Accept\"\n\t\t\t\t\t\t\tvalue={h.key}\n\t\t\t\t\t\t\tonChangeText={(v) => patchHeader(i, { key: v })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tvariant=\"small\"\n\t\t\t\t\t\t\thideInputHeader\n\t\t\t\t\t\t\tplaceholder=\"Value\"\n\t\t\t\t\t\t\tvalue={h.value}\n\t\t\t\t\t\t\tonChangeText={(v) => patchHeader(i, { value: v })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<IconBtn\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"Remove header\"\n\t\t\t\t\t\t\tdata-test={`restapi-header-remove-${i}`}\n\t\t\t\t\t\t\tonClick={() => removeHeader(i)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DeleteIcon\n\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</IconBtn>\n\t\t\t\t\t</HeaderRow>\n\t\t\t\t))}\n\t\t\t\t<AddHeaderRow>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tdata-test=\"restapi-add-header\"\n\t\t\t\t\t\tbuttonType=\"dashRegular\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\tbuttonText=\"Add header\"\n\t\t\t\t\t\tonClick={addHeader}\n\t\t\t\t\t/>\n\t\t\t\t</AddHeaderRow>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Request </TitleSmall>\n\t\t\t\t<BikEditor\n\t\t\t\t\tfeatures={{ jsonMode: true }}\n\t\t\t\t\tinitialContent={requestBody}\n\t\t\t\t\tstyle={JsonFieldBox}\n\t\t\t\t\tplaceholder=\"Type or paste JSON here\"\n\t\t\t\t\tonChange={(c) => setRequestBody(c.text)}\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\tmaxHeight=\"240px\"\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Response </TitleSmall>\n\t\t\t\t<BikEditor\n\t\t\t\t\tfeatures={{ jsonMode: true }}\n\t\t\t\t\tstyle={JsonFieldBox}\n\t\t\t\t\tinitialContent={responseSample}\n\t\t\t\t\tplaceholder=\"Type or paste JSON here\"\n\t\t\t\t\tonChange={(c) => setResponseSample(c.text)}\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\tmaxHeight=\"240px\"\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\t\t</SideModal>\n\t);\n};\n\nconst HeaderRow = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n`;\n\nconst AddHeaderRow = styled.div`\n\tdisplay: flex;\n`;\n\nconst IconBtn = styled.button`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex-shrink: 0;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tbackground: ${COLORS.surface.standard};\n\tcursor: pointer;\n\n\t&:hover {\n\t\tborder-color: ${COLORS.content.secondary};\n\t}\n`;\n\nexport const JsonFieldBox = {\n\tborderRadius: '4px',\n\toverflow: 'hidden',\n};\n"],"names":["METHODS","METHOD_OPTIONS","m","RestApiToolPanel","onClose","onSave","initial","onImprove","charLimits","AGENT_CHAR_LIMITS","zIndex","name","setName","useState","instructions","setInstructions","url","setUrl","method","setMethod","headers","setHeaders","requestBody","setRequestBody","responseSample","setResponseSample","saving","setSaving","patchHeader","i","patch","prev","h","idx","addHeader","removeHeader","_","canSave","handleSave","config","result","jsxs","SideModal","jsx","DrawerHeaderText","SOURCE_ICONS","ToolSource","DRAWER_HEADER_STYLE","DRAWER_BODY_STYLE","Input","ToolInstructionsField","FieldBlock","TitleSmall","COLORS","Dropdown","opt","v","unwrapDropdownValue","HeaderRow","IconBtn","DeleteIcon","AddHeaderRow","Button","PlusIcon","BikEditor","JsonFieldBox","c","styled"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,MAAMA,KAA2B,CAAC,OAAO,QAAQ,OAAO,SAAS,QAAQ,GACnEC,KAAiCD,GAAQ,IAAI,CAACE,OAAO;AAAA,EAC1D,OAAOA;AAAA,EACP,OAAOA;AACR,EAAE,GAQWC,KAAoD,CAAC;AAAA,EACjE,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC,IAAaC;AAAA,EACb,QAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAASP,GAAS,QAAQ,EAAE,GAC9C,CAACQ,GAAcC,CAAe,IAAIF,EAASP,GAAS,gBAAgB,EAAE,GACtE,CAACU,GAAKC,CAAM,IAAIJ,EAASP,GAAS,OAAO,EAAE,GAC3C,CAACY,GAAQC,CAAS,IAAIN;AAAA,IAC3BP,GAAS,UAAU;AAAA,EAAA,GAEd,CAACc,GAASC,CAAU,IAAIR;AAAA,IAC7BP,GAAS,WAAW,CAAC,EAAE,KAAK,IAAI,OAAO,IAAI;AAAA,EAAA,GAEtC,CAACgB,GAAaC,CAAc,IAAIV,EAASP,GAAS,eAAe,EAAE,GACnE,CAACkB,GAAgBC,CAAiB,IAAIZ;AAAA,IAC3CP,GAAS,kBAAkB;AAAA,EAAA,GAEtB,CAACoB,GAAQC,CAAS,IAAId,EAAS,EAAK,GAEpCe,IAAc,CAACC,GAAWC,MAC/BT;AAAA,IAAW,CAACU,MACXA,EAAK,IAAI,CAACC,GAAGC,MAASA,MAAQJ,IAAI,EAAE,GAAGG,GAAG,GAAGF,EAAA,IAAUE,CAAE;AAAA,EAAA,GAErDE,IAAY,MACjBb,EAAW,CAACU,MAAS,CAAC,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;AACX;"}
|
|
1
|
+
{"version":3,"file":"RestApiToolPanel.js","sources":["../../../../../src/components/agent-builder/components/RestApiToolPanel.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport { BikEditor } from '@src/editor';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { Dropdown, unwrapDropdownValue } from '@src/components/dropdown';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { Input } from '@src/components/input';\nimport { SideModal } from '@src/components/side-modal';\nimport { TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tRestApiHeader,\n\tRestApiMethod,\n\tRestApiToolConfig,\n} from '../AgentBuilder.model';\nimport { FieldBlock } from '../AgentBuilder.styled';\nimport type { AgentCharLimits } from '../constants/charLimits';\nimport { AGENT_CHAR_LIMITS } from '../constants/charLimits';\nimport {\n\tDRAWER_BODY_STYLE,\n\tDRAWER_HEADER_STYLE,\n\tDrawerHeaderText,\n} from './DrawerHeaderText';\nimport { ToolInstructionsField } from './ToolInstructionsField';\n\ninterface RestApiToolPanelProps {\n\tonClose: () => void;\n\t/** Persist the config. A pending promise shows the Save loader. */\n\tonSave: (config: RestApiToolConfig) => void | Promise<void>;\n\t/** Seed values when editing an existing tool. */\n\tinitial?: RestApiToolConfig;\n\t/** Optional \"Improve with AI\" for the instructions field. Omit to hide it. */\n\tonImprove?: (text: string) => Promise<string>;\n\tcharLimits?: AgentCharLimits;\n\t/** SideModal stacking order — raise it when opened over another drawer. */\n\tzIndex?: number;\n}\n\nconst METHODS: RestApiMethod[] = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];\nconst METHOD_OPTIONS: SingleOption[] = METHODS.map((m) => ({\n\tlabel: m,\n\tvalue: m,\n}));\n\n/**\n * Right-side drawer to configure a \"Rest API\" tool: the endpoint the agent can\n * call, plus a JSON request-body template and a sample response. Mount it fresh\n * per open (key it) so `initial` seeds the state. Built on the shared `SideModal`\n * shell and the BikEditor JSON body mode for the Request / Response editors.\n */\nexport const RestApiToolPanel: React.FC<RestApiToolPanelProps> = ({\n\tonClose,\n\tonSave,\n\tinitial,\n\tonImprove,\n\tcharLimits = AGENT_CHAR_LIMITS,\n\tzIndex,\n}) => {\n\tconst [name, setName] = useState(initial?.name ?? '');\n\tconst [instructions, setInstructions] = useState(initial?.instructions ?? '');\n\tconst [url, setUrl] = useState(initial?.url ?? '');\n\tconst [method, setMethod] = useState<RestApiMethod>(\n\t\tinitial?.method ?? 'POST',\n\t);\n\tconst [headers, setHeaders] = useState<RestApiHeader[]>(\n\t\tinitial?.headers ?? [{ key: '', value: '' }],\n\t);\n\tconst [requestBody, setRequestBody] = useState(initial?.requestBody ?? '');\n\tconst [responseSample, setResponseSample] = useState(\n\t\tinitial?.responseSample ?? '',\n\t);\n\tconst [saving, setSaving] = useState(false);\n\n\tconst patchHeader = (i: number, patch: Partial<RestApiHeader>) =>\n\t\tsetHeaders((prev) =>\n\t\t\tprev.map((h, idx) => (idx === i ? { ...h, ...patch } : h)),\n\t\t);\n\tconst addHeader = () =>\n\t\tsetHeaders((prev) => [...prev, { key: '', value: '' }]);\n\tconst removeHeader = (i: number) =>\n\t\tsetHeaders((prev) => prev.filter((_, idx) => idx !== i));\n\n\tconst canSave = name.trim().length > 0 && url.trim().length > 0;\n\n\tconst handleSave = async () => {\n\t\tif (!canSave || saving) {\n\t\t\treturn;\n\t\t}\n\t\tconst config: RestApiToolConfig = {\n\t\t\tid: initial?.id ?? `restapi_${Date.now().toString(36)}`,\n\t\t\tname: name.trim(),\n\t\t\tinstructions,\n\t\t\turl: url.trim(),\n\t\t\tmethod,\n\t\t\t// Drop fully-empty header rows.\n\t\t\theaders: headers.filter((h) => h.key.trim() || h.value.trim()),\n\t\t\trequestBody,\n\t\t\tresponseSample,\n\t\t};\n\t\tconst result = onSave(config);\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\tsetSaving(true);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t} finally {\n\t\t\t\tsetSaving(false);\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (\n\t\t<SideModal\n\t\t\theader=\"Rest API\"\n\t\t\tcloseOnEscapeKey={false}\n\t\t\tzIndex={zIndex}\n\t\t\theaderCustomComponent={\n\t\t\t\t<DrawerHeaderText\n\t\t\t\t\ttitle=\"Rest API\"\n\t\t\t\t\tsubtitle=\"Connect to any API endpoint. Configure the request, then test it with a sample response.\"\n\t\t\t\t/>\n\t\t\t}\n\t\t\twidth=\"431px\"\n\t\t\theaderStyle={DRAWER_HEADER_STYLE}\n\t\t\tbodyStyle={DRAWER_BODY_STYLE}\n\t\t\tonClose={onClose}\n\t\t\tsaveButtonProps={{\n\t\t\t\t'data-test': 'restapi-save',\n\t\t\t\tbuttonText: 'Save',\n\t\t\t\tbuttonType: 'primary',\n\t\t\t\tsize: 'small',\n\t\t\t\tdisabled: !canSave,\n\t\t\t\tisLoading: saving,\n\t\t\t\tonClick: handleSave,\n\t\t\t}}\n\t\t\tcancelButtonProps={{\n\t\t\t\t'data-test': 'restapi-cancel',\n\t\t\t\tbuttonText: 'Cancel',\n\t\t\t\tbuttonType: 'tertiaryGray',\n\t\t\t\tsize: 'small',\n\t\t\t\tonClick: onClose,\n\t\t\t}}\n\t\t>\n\t\t\t<Input\n\t\t\t\tdata-test=\"restapi-name\"\n\t\t\t\tvariant=\"small\"\n\t\t\t\tlabelText=\"Name\"\n\t\t\t\tlabelTextBold\n\t\t\t\tplaceholder=\"Enter name\"\n\t\t\t\tvalue={name}\n\t\t\t\tmaxCharLimit={charLimits.name}\n\t\t\t\tonChangeText={setName}\n\t\t\t/>\n\n\t\t\t<ToolInstructionsField\n\t\t\t\tdata-test=\"restapi-instructions\"\n\t\t\t\tlabel=\"Instructions\"\n\t\t\t\tvalue={instructions}\n\t\t\t\tonChange={setInstructions}\n\t\t\t\tmaxLength={charLimits.instructions}\n\t\t\t\tplaceholder=\"Describe how should the LLM generate the rest API\"\n\t\t\t\tonImprove={onImprove}\n\t\t\t/>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<Input\n\t\t\t\t\tdata-test=\"restapi-url\"\n\t\t\t\t\tvariant=\"small\"\n\t\t\t\t\tlabelText=\"Request URL\"\n\t\t\t\t\tlabelTextBold\n\t\t\t\t\tplaceholder=\"https://\"\n\t\t\t\t\ttype=\"url\"\n\t\t\t\t\tvalue={url}\n\t\t\t\t\tonChangeText={setUrl}\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>HTTP method</TitleSmall>\n\t\t\t\t<Dropdown\n\t\t\t\t\tdata-test=\"restapi-method\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\toptions={METHOD_OPTIONS}\n\t\t\t\t\tdefaultOptions={[{ label: method, value: method }]}\n\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\tsetMethod(v as RestApiMethod);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Headers</TitleSmall>\n\t\t\t\t{headers.map((h, i) => (\n\t\t\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t\t\t<HeaderRow key={i} data-test={`restapi-header-${i}`}>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tvariant=\"small\"\n\t\t\t\t\t\t\thideInputHeader\n\t\t\t\t\t\t\tplaceholder=\"Accept\"\n\t\t\t\t\t\t\tvalue={h.key}\n\t\t\t\t\t\t\tonChangeText={(v) => patchHeader(i, { key: v })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tvariant=\"small\"\n\t\t\t\t\t\t\thideInputHeader\n\t\t\t\t\t\t\tplaceholder=\"Value\"\n\t\t\t\t\t\t\tvalue={h.value}\n\t\t\t\t\t\t\tonChangeText={(v) => patchHeader(i, { value: v })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<IconBtn\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"Remove header\"\n\t\t\t\t\t\t\tdata-test={`restapi-header-remove-${i}`}\n\t\t\t\t\t\t\tonClick={() => removeHeader(i)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DeleteIcon\n\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</IconBtn>\n\t\t\t\t\t</HeaderRow>\n\t\t\t\t))}\n\t\t\t\t<AddHeaderRow>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tdata-test=\"restapi-add-header\"\n\t\t\t\t\t\tbuttonType=\"dashRegular\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\tbuttonText=\"Add header\"\n\t\t\t\t\t\tonClick={addHeader}\n\t\t\t\t\t/>\n\t\t\t\t</AddHeaderRow>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Request </TitleSmall>\n\t\t\t\t<BikEditor\n\t\t\t\t\tfeatures={{ jsonMode: true }}\n\t\t\t\t\tinitialContent={requestBody}\n\t\t\t\t\tstyle={JsonFieldBox}\n\t\t\t\t\tplaceholder=\"Type or paste JSON here\"\n\t\t\t\t\tonChange={(c) => setRequestBody(c.text)}\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\tmaxHeight=\"240px\"\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Response </TitleSmall>\n\t\t\t\t<BikEditor\n\t\t\t\t\tfeatures={{ jsonMode: true }}\n\t\t\t\t\tstyle={JsonFieldBox}\n\t\t\t\t\tinitialContent={responseSample}\n\t\t\t\t\tplaceholder=\"Type or paste JSON here\"\n\t\t\t\t\tonChange={(c) => setResponseSample(c.text)}\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\tmaxHeight=\"240px\"\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\t\t</SideModal>\n\t);\n};\n\nconst HeaderRow = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n`;\n\nconst AddHeaderRow = styled.div`\n\tdisplay: flex;\n`;\n\nconst IconBtn = styled.button`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex-shrink: 0;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tbackground: ${COLORS.surface.standard};\n\tcursor: pointer;\n\n\t&:hover {\n\t\tborder-color: ${COLORS.content.secondary};\n\t}\n`;\n\nexport const JsonFieldBox = {\n\tborderRadius: '4px',\n\toverflow: 'hidden',\n};\n"],"names":["METHODS","METHOD_OPTIONS","m","RestApiToolPanel","onClose","onSave","initial","onImprove","charLimits","AGENT_CHAR_LIMITS","zIndex","name","setName","useState","instructions","setInstructions","url","setUrl","method","setMethod","headers","setHeaders","requestBody","setRequestBody","responseSample","setResponseSample","saving","setSaving","patchHeader","i","patch","prev","h","idx","addHeader","removeHeader","_","canSave","jsxs","SideModal","jsx","DrawerHeaderText","DRAWER_HEADER_STYLE","DRAWER_BODY_STYLE","config","result","Input","ToolInstructionsField","FieldBlock","TitleSmall","COLORS","Dropdown","opt","v","unwrapDropdownValue","HeaderRow","IconBtn","DeleteIcon","AddHeaderRow","Button","PlusIcon","BikEditor","JsonFieldBox","c","styled"],"mappings":";;;;;;;;;;;;;;;;;AAwCA,MAAMA,IAA2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AACqB;AAAA,YAAA;AAAA,cACA,UAAU,EAAE,UAAU,GAAA;AAAA,cACtB,gBAAgBvC;AAAA,cAChB,OAAOwC;AAAA,cACP,aAAY;AAAA,cACZ,UAAU,CAACC,MAAMxC,EAAewC,EAAE,IAAI;AAAA,cACtC,WAAU;AAAA,cACV,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACX,GACD;AAAA,0BAECf,GAAA,EACA,UAAA;AAAA,UAAA,gBAAAR,EAACS,GAAA,EAAW,OAAOC,EAAO,QAAQ,SAAS,UAAA,aAAS;AAAA,UACpD,gBAAAV;AAAA,YAACqB;AAAA,YAAA;AAAA,cACA,UAAU,EAAE,UAAU,GAAA;AAAA,cACtB,OAAOC;AAAA,cACP,gBAAgBtC;AAAA,cAChB,aAAY;AAAA,cACZ,UAAU,CAACuC,MAAMtC,EAAkBsC,EAAE,IAAI;AAAA,cACzC,WAAU;AAAA,cACV,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACX,EAAA,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGH,GAEMR,KAAYS,EAAO;AAAA;AAAA;AAAA;AAAA,GAMnBN,KAAeM,EAAO;AAAA;AAAA,GAItBR,KAAUQ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAOFd,EAAO,OAAO,OAAO;AAAA;AAAA,eAE3BA,EAAO,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA,kBAIpBA,EAAO,QAAQ,SAAS;AAAA;AAAA,GAI7BY,IAAe;AAAA,EAC3B,cAAc;AAAA,EACd,UAAU;AACX;"}
|
|
@@ -71,6 +71,16 @@ interface SelectableListSectionProps {
|
|
|
71
71
|
* `sourceGroups`) AND as rows inside the `@` picker's Tools view.
|
|
72
72
|
*/
|
|
73
73
|
actionSources?: ToolAction[];
|
|
74
|
+
/**
|
|
75
|
+
* When set, the row Delete icon opens a confirmation modal (instead of
|
|
76
|
+
* removing immediately); `onRemove` runs only on confirm. `noun` fills the one
|
|
77
|
+
* shared message template ("Delete this <noun>?" …); `zIndex` raises the modal
|
|
78
|
+
* above a parent drawer. Omit to delete directly.
|
|
79
|
+
*/
|
|
80
|
+
confirmDelete?: {
|
|
81
|
+
noun: string;
|
|
82
|
+
zIndex?: number;
|
|
83
|
+
};
|
|
74
84
|
}
|
|
75
85
|
export declare const SelectableListSection: React.FC<SelectableListSectionProps>;
|
|
76
86
|
export {};
|