@epam/ai-dial-skill-editor 1.2.0-dev.14 → 1.2.0-dev.141
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/components/SkillEditor/SkillEditor.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +7 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/index.css +2 -2
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +366 -290
- package/models/skill-editor-props.d.ts +28 -1
- package/models/skill-editor-props.d.ts.map +1 -1
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -1,84 +1,97 @@
|
|
|
1
|
-
import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as t,
|
|
2
|
-
import { Accordion as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { IconArrowNarrowLeft as
|
|
5
|
-
import { Suspense as
|
|
6
|
-
import { DialFileNodeType as
|
|
7
|
-
import { LazyMarkdownEditor as
|
|
8
|
-
|
|
1
|
+
import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as t, TextRefinementField as n, buildCssVars as r, formatFileSize as i, mergeClasses as a, useAvailableHeightCap as o, useTextRefinement as s } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { Accordion as c, CaptionText as l, DIAL_ICON_SIZE as u, DIAL_KIT_ICON_STROKE as d, EditorThemes as f, ErrorText as p, FileDropzone as m, GhostButton as h, GhostIconButton as ee, Input as g, Label as te, NeutralButton as _, Popup as ne, PopupSize as re, PrimaryButton as ie, Spinner as v, Textarea as ae } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
4
|
+
import { IconArrowNarrowLeft as S, IconFileText as C, IconPlus as oe, IconTrashX as se, IconUpload as w } from "@tabler/icons-react";
|
|
5
|
+
import { Suspense as ce, lazy as T, useCallback as E, useEffect as D, useId as O, useMemo as k, useRef as A, useState as j } from "react";
|
|
6
|
+
import { DialFileNodeType as M, DialFoldersTree as le } from "@epam/ai-dial-react-file-manager";
|
|
7
|
+
import { LazyMarkdownEditor as ue } from "@epam/ai-dial-ui-kit/editors";
|
|
8
|
+
a("flex flex-col", {
|
|
9
|
+
body: "_body_m2y60_2",
|
|
10
|
+
sideColumn: "_sideColumn_m2y60_6",
|
|
11
|
+
reservedColumn: "_reservedColumn_m2y60_10"
|
|
12
|
+
}.sideColumn);
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region ../builder-form/src/constants/public-class-names.ts
|
|
15
|
+
var de = {
|
|
16
|
+
layout: "dial-builder-form-layout",
|
|
17
|
+
section: "dial-builder-form-section"
|
|
18
|
+
}, N = {
|
|
9
19
|
headerBorder: "_headerBorder_1kidu_1",
|
|
10
20
|
footerBorder: "_footerBorder_1kidu_5",
|
|
11
21
|
sidebarBorder: "_sidebarBorder_1kidu_9"
|
|
12
|
-
},
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
}, fe = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: i, leftContent: o, rightContent: s, isSaving: c = !1, labels: l, styles: f, dir: p }) => {
|
|
23
|
+
let m = O(), h = c ? l?.savingStatusLabel ?? "Saving" : "", g = r({
|
|
24
|
+
"--el-header-border-color": f?.colors?.headerBorderColor,
|
|
25
|
+
"--el-sidebar-border-color": f?.colors?.sidebarBorderColor
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ x("div", {
|
|
28
|
+
dir: p,
|
|
29
|
+
className: a("flex min-h-0 flex-1 flex-col", de.layout),
|
|
30
|
+
style: g,
|
|
21
31
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ b("span", {
|
|
23
33
|
role: "status",
|
|
24
34
|
"aria-live": "polite",
|
|
25
35
|
className: "sr-only",
|
|
26
|
-
id:
|
|
27
|
-
children:
|
|
36
|
+
id: m,
|
|
37
|
+
children: h
|
|
28
38
|
}),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
className:
|
|
31
|
-
children: [/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ x("div", {
|
|
40
|
+
className: a("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", N.headerBorder),
|
|
41
|
+
children: [/* @__PURE__ */ x("div", {
|
|
32
42
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
34
|
-
icon: /* @__PURE__ */
|
|
35
|
-
size:
|
|
36
|
-
stroke:
|
|
43
|
+
children: [/* @__PURE__ */ b(ee, {
|
|
44
|
+
icon: /* @__PURE__ */ b(S, {
|
|
45
|
+
size: u.LG,
|
|
46
|
+
stroke: d,
|
|
37
47
|
"aria-hidden": !0,
|
|
38
48
|
className: "rtl:scale-x-[-1]"
|
|
39
49
|
}),
|
|
40
|
-
"aria-label":
|
|
50
|
+
"aria-label": n,
|
|
41
51
|
onClick: t
|
|
42
|
-
}), /* @__PURE__ */
|
|
52
|
+
}), /* @__PURE__ */ b("h1", {
|
|
43
53
|
className: "dial-h2-text min-w-0 truncate",
|
|
44
54
|
children: e
|
|
45
55
|
})]
|
|
46
|
-
}),
|
|
56
|
+
}), i != null && /* @__PURE__ */ b("div", {
|
|
47
57
|
className: "hidden shrink-0 items-center gap-2 desktop:flex",
|
|
48
|
-
children:
|
|
58
|
+
children: i
|
|
49
59
|
})]
|
|
50
60
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ x("div", {
|
|
52
62
|
className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
|
|
53
|
-
children: [/* @__PURE__ */
|
|
54
|
-
className:
|
|
63
|
+
children: [/* @__PURE__ */ b("div", {
|
|
64
|
+
className: a(s == null ? "desktop:flex-1" : "desktop:w-[360px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", s == null ? void 0 : N.sidebarBorder),
|
|
55
65
|
children: o
|
|
56
|
-
}), s != null && /* @__PURE__ */
|
|
66
|
+
}), s != null && /* @__PURE__ */ b("div", {
|
|
57
67
|
className: "desktop:flex-1 desktop:overflow-y-auto",
|
|
58
68
|
children: s
|
|
59
69
|
})]
|
|
60
70
|
}),
|
|
61
|
-
|
|
62
|
-
className:
|
|
63
|
-
children:
|
|
71
|
+
i != null && /* @__PURE__ */ b("div", {
|
|
72
|
+
className: a("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", N.footerBorder),
|
|
73
|
+
children: i
|
|
64
74
|
})
|
|
65
75
|
]
|
|
66
76
|
});
|
|
67
|
-
},
|
|
68
|
-
|
|
77
|
+
}, pe = {
|
|
78
|
+
root: "dial-skill-editor-root",
|
|
79
|
+
refineFeedback: "dial-skill-editor-refine-feedback"
|
|
80
|
+
}, P = (e) => !!e.dataTransfer?.types.includes("Files"), me = (e) => {
|
|
81
|
+
let [t, n] = j(!1), r = A(0);
|
|
69
82
|
return {
|
|
70
83
|
isDragActive: t,
|
|
71
84
|
dropZoneHandlers: {
|
|
72
|
-
onDragEnter:
|
|
85
|
+
onDragEnter: E((e) => {
|
|
73
86
|
P(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
74
87
|
}, []),
|
|
75
|
-
onDragLeave:
|
|
88
|
+
onDragLeave: E((e) => {
|
|
76
89
|
P(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
77
90
|
}, []),
|
|
78
|
-
onDragOver:
|
|
91
|
+
onDragOver: E((e) => {
|
|
79
92
|
P(e) && e.preventDefault();
|
|
80
93
|
}, []),
|
|
81
|
-
onDrop:
|
|
94
|
+
onDrop: E((t) => {
|
|
82
95
|
if (!P(t)) return;
|
|
83
96
|
t.preventDefault(), r.current = 0, n(!1);
|
|
84
97
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
@@ -91,17 +104,17 @@ var M = {
|
|
|
91
104
|
}({}), L = (e) => {
|
|
92
105
|
let t = e.lastIndexOf("/");
|
|
93
106
|
return t === -1 ? null : e.slice(0, t);
|
|
94
|
-
},
|
|
107
|
+
}, he = (e) => {
|
|
95
108
|
let t = e.lastIndexOf("/");
|
|
96
109
|
return t === -1 ? e : e.slice(t + 1);
|
|
97
|
-
},
|
|
110
|
+
}, ge = (e) => {
|
|
98
111
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
99
112
|
let n = t.get(e);
|
|
100
113
|
if (n) return n;
|
|
101
114
|
let r = {
|
|
102
115
|
path: e,
|
|
103
|
-
name:
|
|
104
|
-
nodeType:
|
|
116
|
+
name: he(e),
|
|
117
|
+
nodeType: M.FOLDER,
|
|
105
118
|
parentPath: L(e),
|
|
106
119
|
folderId: e,
|
|
107
120
|
items: []
|
|
@@ -116,7 +129,7 @@ var M = {
|
|
|
116
129
|
t.set(r.path, {
|
|
117
130
|
path: r.path,
|
|
118
131
|
name: r.name,
|
|
119
|
-
nodeType:
|
|
132
|
+
nodeType: M.ITEM,
|
|
120
133
|
parentPath: L(r.path),
|
|
121
134
|
folderId: L(r.path) ?? ""
|
|
122
135
|
});
|
|
@@ -135,74 +148,74 @@ var M = {
|
|
|
135
148
|
n ? n.items = [...n.items ?? [], e] : r.push(e);
|
|
136
149
|
}
|
|
137
150
|
return r;
|
|
138
|
-
},
|
|
151
|
+
}, _e = ({ isVisible: e, labels: t }) => {
|
|
139
152
|
if (!e) return null;
|
|
140
153
|
let n = t ?? {};
|
|
141
|
-
return /* @__PURE__ */
|
|
154
|
+
return /* @__PURE__ */ b("div", {
|
|
142
155
|
role: "status",
|
|
143
156
|
"aria-live": "polite",
|
|
144
|
-
className:
|
|
145
|
-
children: /* @__PURE__ */
|
|
157
|
+
className: a("pointer-events-none absolute inset-0 z-[100] flex items-center justify-center backdrop-blur-sm"),
|
|
158
|
+
children: /* @__PURE__ */ x("div", {
|
|
146
159
|
className: "flex flex-col items-center text-center",
|
|
147
160
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ b(w, {
|
|
149
162
|
size: 100,
|
|
150
163
|
className: "text-accent-primary",
|
|
151
164
|
"aria-hidden": !0,
|
|
152
|
-
stroke:
|
|
165
|
+
stroke: d
|
|
153
166
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ b("span", {
|
|
155
168
|
className: "dial-h3-text mt-5",
|
|
156
169
|
children: n.dropOverlayTitle ?? "Upload files"
|
|
157
170
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ b("span", {
|
|
159
172
|
className: "dial-small-text mt-4",
|
|
160
173
|
children: n.dropOverlaySubtitle ?? "Drop files here to add them to this skill"
|
|
161
174
|
})
|
|
162
175
|
]
|
|
163
176
|
})
|
|
164
177
|
});
|
|
165
|
-
},
|
|
178
|
+
}, R = /* @__PURE__ */ function(e) {
|
|
166
179
|
return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
|
|
167
180
|
}({}), z = /* @__PURE__ */ function(e) {
|
|
168
181
|
return e.Valid = "valid", e.Invalid = "invalid", e;
|
|
169
|
-
}({}), B = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"),
|
|
170
|
-
let o = a ?? {}, [s, c] =
|
|
182
|
+
}({}), B = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), ve = 0, ye = () => `skill-file-candidate-${++ve}`, be = ({ isOpen: e, onClose: t, fileActions: n, initialFiles: r, labels: a }) => {
|
|
183
|
+
let o = a ?? {}, [s, c] = j([]), [l, u] = j(/* @__PURE__ */ new Map()), [f, g] = j([]), [te, _] = j(!1), [ae, S] = j(), [oe, w] = j(!1), ce = O(), T = (e) => {
|
|
171
184
|
let t = e.map((e) => ({
|
|
172
|
-
id:
|
|
185
|
+
id: ye(),
|
|
173
186
|
file: e,
|
|
174
187
|
path: B(e)
|
|
175
188
|
}));
|
|
176
189
|
S(void 0), c((e) => [...e, ...t]);
|
|
177
|
-
},
|
|
190
|
+
}, E = (e) => {
|
|
178
191
|
c((t) => t.filter((t) => t.id !== e));
|
|
179
192
|
};
|
|
180
|
-
|
|
181
|
-
e && (c((
|
|
182
|
-
id:
|
|
193
|
+
D(() => {
|
|
194
|
+
e && (c((r ?? []).map((e) => ({
|
|
195
|
+
id: ye(),
|
|
183
196
|
file: e,
|
|
184
197
|
path: B(e)
|
|
185
|
-
}))),
|
|
186
|
-
}, [e]),
|
|
198
|
+
}))), u(/* @__PURE__ */ new Map()), g([]), S(void 0));
|
|
199
|
+
}, [e]), D(() => {
|
|
187
200
|
if (!e) return;
|
|
188
201
|
let t = !1;
|
|
189
202
|
if (s.length === 0) {
|
|
190
|
-
|
|
203
|
+
u(/* @__PURE__ */ new Map()), g([]);
|
|
191
204
|
return;
|
|
192
205
|
}
|
|
193
|
-
return
|
|
194
|
-
t || (
|
|
206
|
+
return _(!0), n.validateBatch(s).then(({ results: e, batchErrors: n }) => {
|
|
207
|
+
t || (u(new Map(e.map((e) => [e.candidateId, e]))), g(n.map((e) => e.message)));
|
|
195
208
|
}).finally(() => {
|
|
196
|
-
t ||
|
|
209
|
+
t || _(!1);
|
|
197
210
|
}), () => {
|
|
198
211
|
t = !0;
|
|
199
212
|
};
|
|
200
213
|
}, [s, e]);
|
|
201
|
-
let
|
|
214
|
+
let k = s.some((e) => l.get(e.id)?.status === z.Invalid), A = s.length > 0 && s.every((e) => l.get(e.id)?.status === z.Invalid), M = s.length > 0 && !k && f.length === 0 && !te && !oe, le = async () => {
|
|
202
215
|
w(!0), S(void 0);
|
|
203
216
|
try {
|
|
204
217
|
let { results: e, batchErrors: r } = await n.validateBatch(s), i = new Map(e.map((e) => [e.candidateId, e]));
|
|
205
|
-
if (
|
|
218
|
+
if (u(i), g(r.map((e) => e.message)), s.some((e) => i.get(e.id)?.status === z.Invalid) || r.length > 0) return;
|
|
206
219
|
let a = await n.commitBatch(s);
|
|
207
220
|
if (a.error) {
|
|
208
221
|
S(a.error);
|
|
@@ -213,384 +226,447 @@ var M = {
|
|
|
213
226
|
w(!1);
|
|
214
227
|
}
|
|
215
228
|
};
|
|
216
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ b(ne, {
|
|
217
230
|
open: e,
|
|
218
231
|
header: o.uploadDialogTitle ?? "Upload files from device",
|
|
219
232
|
size: re.Sm,
|
|
220
233
|
closeAriaLabel: o.uploadDialogCloseAriaLabel ?? "Close",
|
|
221
234
|
onClose: t,
|
|
222
|
-
footer: /* @__PURE__ */
|
|
235
|
+
footer: /* @__PURE__ */ x("div", {
|
|
223
236
|
className: "flex min-h-[44px] items-center justify-end gap-2 px-6 py-4",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ b(h, {
|
|
225
238
|
label: o.uploadCancelLabel ?? "Cancel",
|
|
226
239
|
onClick: t
|
|
227
|
-
}), /* @__PURE__ */
|
|
240
|
+
}), /* @__PURE__ */ b(ie, {
|
|
228
241
|
label: o.uploadConfirmLabel ?? "Add",
|
|
229
|
-
iconBefore:
|
|
242
|
+
iconBefore: oe ? /* @__PURE__ */ b(v, {
|
|
230
243
|
size: 16,
|
|
231
244
|
ariaLabel: ""
|
|
232
245
|
}) : void 0,
|
|
233
|
-
onClick: () => void
|
|
246
|
+
onClick: () => void le(),
|
|
234
247
|
disabled: !M
|
|
235
248
|
})]
|
|
236
249
|
}),
|
|
237
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ x("div", {
|
|
238
251
|
className: "flex flex-col gap-4 px-6 py-4",
|
|
239
252
|
children: [
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
label: /* @__PURE__ */ y
|
|
253
|
+
/* @__PURE__ */ b(m, {
|
|
254
|
+
label: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
|
|
242
255
|
className: "desktop:hidden",
|
|
243
256
|
children: o.uploadDropZoneMobileLabel ?? "Click here to upload"
|
|
244
|
-
}), /* @__PURE__ */
|
|
257
|
+
}), /* @__PURE__ */ b("span", {
|
|
245
258
|
className: "hidden desktop:inline",
|
|
246
259
|
children: o.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
|
|
247
260
|
})] }),
|
|
248
261
|
ariaLabel: o.uploadDropZoneAriaLabel ?? "Upload files",
|
|
249
262
|
multiple: !0,
|
|
250
|
-
className:
|
|
251
|
-
onChange:
|
|
263
|
+
className: A ? "border-error hover:border-error" : void 0,
|
|
264
|
+
onChange: T
|
|
252
265
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ b("span", {
|
|
254
267
|
role: "status",
|
|
255
268
|
"aria-live": "polite",
|
|
256
269
|
className: "sr-only",
|
|
257
|
-
id:
|
|
258
|
-
children:
|
|
270
|
+
id: ce,
|
|
271
|
+
children: f.map((e) => `${o.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
|
|
259
272
|
}),
|
|
260
|
-
|
|
261
|
-
s.length > 0 && /* @__PURE__ */
|
|
273
|
+
f.map((e) => /* @__PURE__ */ b(p, { text: e }, e)),
|
|
274
|
+
s.length > 0 && /* @__PURE__ */ b("ul", {
|
|
262
275
|
className: "flex flex-col gap-2",
|
|
263
276
|
children: s.map((e) => {
|
|
264
|
-
let t =
|
|
265
|
-
return /* @__PURE__ */
|
|
277
|
+
let t = l.get(e.id), n = t?.kind === R.Manifest, r = t?.status === z.Invalid;
|
|
278
|
+
return /* @__PURE__ */ x("li", {
|
|
266
279
|
className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
|
|
267
280
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ b(C, {
|
|
269
282
|
size: 20,
|
|
270
283
|
"aria-hidden": !0,
|
|
271
|
-
stroke:
|
|
284
|
+
stroke: d
|
|
272
285
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ x("div", {
|
|
274
287
|
className: "flex min-w-0 flex-1 flex-col",
|
|
275
288
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ b("span", {
|
|
277
290
|
className: "dial-small-text truncate",
|
|
278
291
|
children: e.path
|
|
279
292
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ b("span", {
|
|
281
294
|
className: "dial-tiny-text text-secondary",
|
|
282
|
-
children:
|
|
295
|
+
children: i(e.file.size)
|
|
283
296
|
}),
|
|
284
|
-
|
|
285
|
-
n && !
|
|
297
|
+
r && t?.error && /* @__PURE__ */ b(p, { text: t.error }),
|
|
298
|
+
n && !r && /* @__PURE__ */ b("span", {
|
|
286
299
|
className: "dial-tiny-text text-secondary",
|
|
287
300
|
children: o.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
|
|
288
301
|
})
|
|
289
302
|
]
|
|
290
303
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
icon: /* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ b(ee, {
|
|
305
|
+
icon: /* @__PURE__ */ b(se, {
|
|
293
306
|
size: 16,
|
|
294
307
|
"aria-hidden": !0,
|
|
295
|
-
stroke:
|
|
308
|
+
stroke: d
|
|
296
309
|
}),
|
|
297
310
|
"aria-label": o.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
|
|
298
|
-
onClick: () =>
|
|
311
|
+
onClick: () => E(e.id)
|
|
299
312
|
})
|
|
300
313
|
]
|
|
301
314
|
}, e.id);
|
|
302
315
|
})
|
|
303
316
|
}),
|
|
304
|
-
|
|
317
|
+
ae && /* @__PURE__ */ b(p, { text: ae })
|
|
305
318
|
]
|
|
306
319
|
})
|
|
307
320
|
});
|
|
308
|
-
},
|
|
309
|
-
title: "
|
|
310
|
-
helperText: "
|
|
311
|
-
|
|
312
|
-
|
|
321
|
+
}, V = {
|
|
322
|
+
title: "_title_1cnn4_1",
|
|
323
|
+
helperText: "_helperText_1cnn4_5",
|
|
324
|
+
refineFeedback: "_refineFeedback_1cnn4_9",
|
|
325
|
+
refineError: "_refineError_1cnn4_13"
|
|
326
|
+
}, xe = T(async () => {
|
|
327
|
+
let { MarkdownEditor: e } = await ue();
|
|
313
328
|
return { default: e };
|
|
314
|
-
}),
|
|
315
|
-
let [
|
|
316
|
-
name:
|
|
317
|
-
description:
|
|
318
|
-
instructions:
|
|
319
|
-
}),
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
329
|
+
}), Se = ({ initialValues: i, files: m, selectedPath: ee, onSelectedPathChange: ne, expandedPaths: re, onExpandedPathsChange: S, isLoading: C = !1, hasLoadError: w = !1, isSubmitting: T = !1, errors: M, submitError: ue, conflict: de, onReloadLatest: N, isNameReadOnly: P = !1, onDirtyChange: L, onValuesChange: he, onRefineDescription: R, onRefineInstructions: z, fileActions: B, supportingFileContent: ve, onSubmit: ye, onCancel: Se, onBack: Ce, backAriaLabel: we, title: Te, onRetry: Ee, onRetrySubmit: De, labels: Oe, styles: ke, dir: Ae, instructionsEditorTheme: je = f.light }) => {
|
|
330
|
+
let [H, Me] = j({
|
|
331
|
+
name: i?.name ?? "",
|
|
332
|
+
description: i?.description ?? "",
|
|
333
|
+
instructions: i?.instructions ?? ""
|
|
334
|
+
}), Ne = O(), Pe = O(), U = A(void 0), Fe = o(), Ie = A(H), W = (e) => {
|
|
335
|
+
let t = {
|
|
336
|
+
...Ie.current,
|
|
337
|
+
...e
|
|
338
|
+
};
|
|
339
|
+
Ie.current = t, Me(t), he?.(t);
|
|
340
|
+
}, Le = (e) => e ? async (t, n) => {
|
|
341
|
+
if (U.current && !U.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
342
|
+
U.current = n;
|
|
343
|
+
try {
|
|
344
|
+
return await e(t, n);
|
|
345
|
+
} finally {
|
|
346
|
+
U.current === n && (U.current = void 0);
|
|
347
|
+
}
|
|
348
|
+
} : void 0, G = s({
|
|
349
|
+
value: H.description,
|
|
350
|
+
onChange: (e) => W({ description: e }),
|
|
351
|
+
onRefine: Le(R),
|
|
352
|
+
disabled: T || C || w,
|
|
353
|
+
resetKey: i
|
|
354
|
+
}), K = s({
|
|
355
|
+
value: H.instructions,
|
|
356
|
+
onChange: (e) => W({ instructions: e }),
|
|
357
|
+
onRefine: Le(z),
|
|
358
|
+
disabled: T || C || w,
|
|
359
|
+
resetKey: i
|
|
360
|
+
}), Re = G.isPending || K.isPending, ze = () => {
|
|
361
|
+
G.reset(), K.reset();
|
|
362
|
+
}, Be = () => {
|
|
363
|
+
ze(), Se();
|
|
364
|
+
}, Ve = () => {
|
|
365
|
+
ze(), Ce();
|
|
366
|
+
}, He = () => {
|
|
367
|
+
T || C || w || U.current && !U.current.aborted || ye(H);
|
|
368
|
+
}, Ue = A(i), We = Ue.current !== i, Ge = A(m);
|
|
369
|
+
D(() => {
|
|
370
|
+
Ue.current = i;
|
|
371
|
+
let e = {
|
|
372
|
+
name: i?.name ?? "",
|
|
373
|
+
description: i?.description ?? "",
|
|
374
|
+
instructions: i?.instructions ?? ""
|
|
375
|
+
};
|
|
376
|
+
Ie.current = e, Me(e), Ge.current = m;
|
|
377
|
+
}, [i]);
|
|
378
|
+
let Ke = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), qe = A(!1);
|
|
379
|
+
D(() => {
|
|
380
|
+
if (We) return;
|
|
330
381
|
let e = {
|
|
331
|
-
name:
|
|
332
|
-
description:
|
|
333
|
-
instructions:
|
|
334
|
-
}, t = JSON.stringify(
|
|
335
|
-
t !==
|
|
382
|
+
name: i?.name ?? "",
|
|
383
|
+
description: i?.description ?? "",
|
|
384
|
+
instructions: i?.instructions ?? ""
|
|
385
|
+
}, t = JSON.stringify(H) !== JSON.stringify(e) || Ke(m) !== Ke(Ge.current);
|
|
386
|
+
t !== qe.current && (qe.current = t, L?.(t));
|
|
336
387
|
}, [
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
388
|
+
H,
|
|
389
|
+
m,
|
|
390
|
+
i,
|
|
391
|
+
We,
|
|
341
392
|
L
|
|
342
393
|
]);
|
|
343
|
-
let [
|
|
344
|
-
|
|
345
|
-
}, [ne]), [
|
|
394
|
+
let [Je, Ye] = j(F), q = ee ?? Je, J = E((e) => {
|
|
395
|
+
Ye(e), ne?.(e);
|
|
396
|
+
}, [ne]), [Xe, Ze] = j([]), Qe = re ?? Xe, $e = k(() => new Set(Qe), [Qe]), et = E((e) => {
|
|
346
397
|
let t = [...e];
|
|
347
|
-
|
|
348
|
-
}, [
|
|
349
|
-
Y || (
|
|
350
|
-
}, [Y])), X =
|
|
398
|
+
Ze(t), S?.(t);
|
|
399
|
+
}, [S]), [Y, tt] = j(!1), [nt, rt] = j(), [it, at] = j(!1), { isDragActive: ot, dropZoneHandlers: st } = me(E((e) => {
|
|
400
|
+
Y || (rt(e), tt(!0));
|
|
401
|
+
}, [Y])), X = Oe ?? {}, Z = ke?.colors, Q = ke?.typography ?? {}, ct = Q.titleClassName ?? "dial-body-semi-text", lt = Q.helperTextClassName ?? "dial-tiny-semi-text", ut = Q.removeIconClassName ?? "text-secondary", dt = r({
|
|
351
402
|
"--se-title-color": Z?.title,
|
|
352
|
-
"--se-helper-text-color": Z?.helperText
|
|
353
|
-
|
|
403
|
+
"--se-helper-text-color": Z?.helperText,
|
|
404
|
+
"--se-refine-action-text": Z?.refineActionText,
|
|
405
|
+
"--se-refine-error-text": Z?.refineErrorText
|
|
406
|
+
}), ft = {
|
|
407
|
+
feedbackClassName: a(V.refineFeedback, Q.refineFeedbackClassName ?? "dial-small-text", pe.refineFeedback),
|
|
408
|
+
errorClassName: V.refineError
|
|
409
|
+
}, pt = Z?.border ? { colors: {
|
|
354
410
|
headerBorderColor: Z.border,
|
|
355
411
|
sidebarBorderColor: Z.border
|
|
356
|
-
} } : void 0,
|
|
412
|
+
} } : void 0, mt = k(() => ge([{
|
|
357
413
|
path: F,
|
|
358
414
|
name: F,
|
|
359
415
|
kind: I.File
|
|
360
|
-
}, ...
|
|
416
|
+
}, ...m]), [m]), $ = k(() => m.find((e) => e.path === q), [m, q]), ht = E((e) => {
|
|
361
417
|
J(e.path);
|
|
362
|
-
}, [J]),
|
|
363
|
-
|
|
418
|
+
}, [J]), gt = E((e) => {
|
|
419
|
+
B.onRemoveNode(e), q === e && J(F);
|
|
364
420
|
}, [
|
|
365
|
-
|
|
421
|
+
B,
|
|
366
422
|
q,
|
|
367
423
|
J
|
|
368
|
-
]),
|
|
424
|
+
]), _t = E((e) => e.path === "SKILL.md" ? [] : [{
|
|
369
425
|
key: "remove",
|
|
370
426
|
label: X.removeLabel ?? "Remove",
|
|
371
|
-
icon: /* @__PURE__ */
|
|
372
|
-
size:
|
|
373
|
-
className:
|
|
427
|
+
icon: /* @__PURE__ */ b(se, {
|
|
428
|
+
size: u.SM,
|
|
429
|
+
className: ut,
|
|
374
430
|
"aria-hidden": !0,
|
|
375
|
-
stroke:
|
|
431
|
+
stroke: d
|
|
376
432
|
}),
|
|
377
|
-
onClick: () =>
|
|
433
|
+
onClick: () => gt(e.path)
|
|
378
434
|
}], [
|
|
379
435
|
X.removeLabel,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
]),
|
|
436
|
+
ut,
|
|
437
|
+
gt
|
|
438
|
+
]), vt = /* @__PURE__ */ x("div", {
|
|
383
439
|
className: "flex flex-col gap-2 desktop:gap-5",
|
|
384
|
-
children: [/* @__PURE__ */
|
|
440
|
+
children: [/* @__PURE__ */ x("div", {
|
|
385
441
|
className: "flex items-center justify-between",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
387
|
-
className:
|
|
442
|
+
children: [/* @__PURE__ */ b("span", {
|
|
443
|
+
className: a(V.title, ct),
|
|
388
444
|
children: X.filesHeading ?? "Files"
|
|
389
|
-
}), /* @__PURE__ */
|
|
445
|
+
}), /* @__PURE__ */ b(_, {
|
|
390
446
|
label: X.addUploadLabel ?? "Upload from device",
|
|
391
|
-
iconBefore: /* @__PURE__ */
|
|
447
|
+
iconBefore: /* @__PURE__ */ b(oe, {
|
|
392
448
|
size: 16,
|
|
393
449
|
"aria-hidden": !0,
|
|
394
|
-
stroke:
|
|
450
|
+
stroke: d
|
|
395
451
|
}),
|
|
396
452
|
onClick: () => {
|
|
397
|
-
|
|
453
|
+
rt(void 0), tt(!0);
|
|
398
454
|
}
|
|
399
455
|
})]
|
|
400
|
-
}), /* @__PURE__ */
|
|
456
|
+
}), /* @__PURE__ */ b("div", {
|
|
401
457
|
role: "tree",
|
|
402
458
|
"aria-label": X.filesTreeAriaLabel ?? "Skill files",
|
|
403
|
-
children: /* @__PURE__ */
|
|
404
|
-
items:
|
|
459
|
+
children: /* @__PURE__ */ b(le, {
|
|
460
|
+
items: mt,
|
|
405
461
|
showFiles: !0,
|
|
406
462
|
selectedPath: q,
|
|
407
|
-
expandedPaths:
|
|
408
|
-
onExpandedPathsChange:
|
|
409
|
-
onItemClick:
|
|
410
|
-
getContextMenuItems:
|
|
463
|
+
expandedPaths: $e,
|
|
464
|
+
onExpandedPathsChange: et,
|
|
465
|
+
onItemClick: ht,
|
|
466
|
+
getContextMenuItems: _t,
|
|
411
467
|
rootItemPath: ""
|
|
412
468
|
})
|
|
413
469
|
})]
|
|
414
|
-
}),
|
|
470
|
+
}), yt = /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(_, {
|
|
415
471
|
label: X.cancelLabel ?? "Cancel",
|
|
416
|
-
onClick:
|
|
417
|
-
disabled:
|
|
418
|
-
}), /* @__PURE__ */
|
|
472
|
+
onClick: Be,
|
|
473
|
+
disabled: T
|
|
474
|
+
}), /* @__PURE__ */ b(ie, {
|
|
419
475
|
label: X.createLabel ?? "Create",
|
|
420
|
-
iconBefore:
|
|
476
|
+
iconBefore: T ? /* @__PURE__ */ b(v, {
|
|
421
477
|
size: 16,
|
|
422
478
|
ariaLabel: ""
|
|
423
479
|
}) : void 0,
|
|
424
|
-
onClick:
|
|
425
|
-
disabled: C
|
|
480
|
+
onClick: He,
|
|
481
|
+
disabled: T || Re || C || w
|
|
426
482
|
})] });
|
|
427
|
-
return
|
|
428
|
-
dir:
|
|
483
|
+
return C ? /* @__PURE__ */ b("div", {
|
|
484
|
+
dir: Ae,
|
|
429
485
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
430
|
-
children: /* @__PURE__ */
|
|
431
|
-
title:
|
|
432
|
-
onBack:
|
|
433
|
-
backAriaLabel:
|
|
434
|
-
actions:
|
|
486
|
+
children: /* @__PURE__ */ b(fe, {
|
|
487
|
+
title: Te,
|
|
488
|
+
onBack: Ve,
|
|
489
|
+
backAriaLabel: we,
|
|
490
|
+
actions: yt,
|
|
435
491
|
isSaving: !1,
|
|
436
492
|
labels: { savingStatusLabel: X.savingStatusLabel },
|
|
437
|
-
styles:
|
|
438
|
-
leftContent: /* @__PURE__ */
|
|
493
|
+
styles: pt,
|
|
494
|
+
leftContent: /* @__PURE__ */ b("div", {
|
|
439
495
|
role: "status",
|
|
440
496
|
"aria-label": X.loadingAriaLabel ?? "Loading skill",
|
|
441
497
|
className: "flex flex-1 items-center justify-center p-8",
|
|
442
|
-
children: /* @__PURE__ */ v
|
|
498
|
+
children: /* @__PURE__ */ b(v, {})
|
|
443
499
|
})
|
|
444
500
|
})
|
|
445
|
-
}) :
|
|
446
|
-
dir:
|
|
501
|
+
}) : w ? /* @__PURE__ */ b("div", {
|
|
502
|
+
dir: Ae,
|
|
447
503
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
448
|
-
children: /* @__PURE__ */
|
|
449
|
-
title:
|
|
450
|
-
onBack:
|
|
451
|
-
backAriaLabel:
|
|
452
|
-
actions:
|
|
504
|
+
children: /* @__PURE__ */ b(fe, {
|
|
505
|
+
title: Te,
|
|
506
|
+
onBack: Ve,
|
|
507
|
+
backAriaLabel: we,
|
|
508
|
+
actions: yt,
|
|
453
509
|
isSaving: !1,
|
|
454
510
|
labels: { savingStatusLabel: X.savingStatusLabel },
|
|
455
|
-
styles:
|
|
456
|
-
leftContent: /* @__PURE__ */
|
|
511
|
+
styles: pt,
|
|
512
|
+
leftContent: /* @__PURE__ */ x("div", {
|
|
457
513
|
role: "alert",
|
|
458
514
|
className: "flex flex-col items-center gap-4 p-8",
|
|
459
|
-
children: [/* @__PURE__ */
|
|
515
|
+
children: [/* @__PURE__ */ b(p, { text: X.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ b(ie, {
|
|
460
516
|
label: X.retryLabel ?? "Retry",
|
|
461
|
-
onClick:
|
|
517
|
+
onClick: Ee
|
|
462
518
|
})]
|
|
463
519
|
})
|
|
464
520
|
})
|
|
465
|
-
}) : /* @__PURE__ */
|
|
466
|
-
dir:
|
|
467
|
-
className: "relative flex min-h-0 flex-1 flex-col",
|
|
468
|
-
style:
|
|
469
|
-
...
|
|
521
|
+
}) : /* @__PURE__ */ x("div", {
|
|
522
|
+
dir: Ae,
|
|
523
|
+
className: a("relative flex min-h-0 flex-1 flex-col", pe.root),
|
|
524
|
+
style: dt,
|
|
525
|
+
...st,
|
|
470
526
|
children: [
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
isVisible:
|
|
473
|
-
labels:
|
|
527
|
+
/* @__PURE__ */ b(_e, {
|
|
528
|
+
isVisible: ot && !Y,
|
|
529
|
+
labels: Oe
|
|
474
530
|
}),
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
title:
|
|
477
|
-
onBack:
|
|
478
|
-
backAriaLabel:
|
|
479
|
-
actions:
|
|
480
|
-
isSaving:
|
|
531
|
+
/* @__PURE__ */ b(fe, {
|
|
532
|
+
title: Te,
|
|
533
|
+
onBack: Ve,
|
|
534
|
+
backAriaLabel: we,
|
|
535
|
+
actions: yt,
|
|
536
|
+
isSaving: T,
|
|
481
537
|
labels: { savingStatusLabel: X.savingStatusLabel },
|
|
482
|
-
styles:
|
|
483
|
-
leftContent: /* @__PURE__ */ y
|
|
538
|
+
styles: pt,
|
|
539
|
+
leftContent: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
|
|
484
540
|
className: "px-4 py-4 desktop:hidden",
|
|
485
|
-
children: /* @__PURE__ */
|
|
541
|
+
children: /* @__PURE__ */ b(c, {
|
|
486
542
|
title: X.editingFileLabel ?? "Editing file",
|
|
487
543
|
description: $?.name ?? "SKILL.md",
|
|
488
|
-
expanded:
|
|
489
|
-
onToggle:
|
|
544
|
+
expanded: it,
|
|
545
|
+
onToggle: at,
|
|
490
546
|
ariaLabel: X.editingFileLabel ?? "Editing file",
|
|
491
|
-
children:
|
|
547
|
+
children: vt
|
|
492
548
|
})
|
|
493
|
-
}), /* @__PURE__ */
|
|
549
|
+
}), /* @__PURE__ */ b("div", {
|
|
494
550
|
className: "hidden px-8 py-6 desktop:block",
|
|
495
|
-
children:
|
|
551
|
+
children: vt
|
|
496
552
|
})] }),
|
|
497
|
-
rightContent: /* @__PURE__ */
|
|
553
|
+
rightContent: /* @__PURE__ */ x("div", {
|
|
498
554
|
className: "flex flex-1 flex-col gap-4 px-4 py-6 desktop:gap-5 desktop:px-8",
|
|
499
555
|
children: [
|
|
500
|
-
|
|
556
|
+
ue != null && /* @__PURE__ */ x("div", {
|
|
501
557
|
role: "alert",
|
|
502
|
-
|
|
558
|
+
className: "flex items-center gap-2",
|
|
559
|
+
children: [/* @__PURE__ */ b(p, { text: ue }), De != null && /* @__PURE__ */ b(h, {
|
|
560
|
+
label: X.retryLabel ?? "Retry",
|
|
561
|
+
onClick: De
|
|
562
|
+
})]
|
|
503
563
|
}),
|
|
504
|
-
|
|
564
|
+
de != null && /* @__PURE__ */ x("div", {
|
|
505
565
|
role: "alert",
|
|
506
566
|
className: "flex items-center gap-2",
|
|
507
|
-
children: [/* @__PURE__ */
|
|
567
|
+
children: [/* @__PURE__ */ b(p, { text: de.message }), /* @__PURE__ */ b(h, {
|
|
508
568
|
label: X.reloadLatestLabel ?? "Reload latest",
|
|
509
|
-
onClick:
|
|
569
|
+
onClick: N
|
|
510
570
|
})]
|
|
511
571
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
className:
|
|
572
|
+
/* @__PURE__ */ b("h2", {
|
|
573
|
+
className: a(V.title, ct),
|
|
514
574
|
children: q === "SKILL.md" ? F : X.selectedFileHeading?.($?.name ?? q) ?? $?.name ?? q
|
|
515
575
|
}),
|
|
516
|
-
q === "SKILL.md" ? /* @__PURE__ */ y
|
|
517
|
-
/* @__PURE__ */
|
|
576
|
+
q === "SKILL.md" ? /* @__PURE__ */ x(y, { children: [
|
|
577
|
+
/* @__PURE__ */ b(g, {
|
|
518
578
|
labelProps: {
|
|
519
579
|
label: X.nameLabel ?? "Name",
|
|
520
580
|
required: !0
|
|
521
581
|
},
|
|
522
|
-
value:
|
|
523
|
-
onChange: (e) =>
|
|
524
|
-
...t,
|
|
525
|
-
name: e ?? ""
|
|
526
|
-
})),
|
|
582
|
+
value: H.name,
|
|
583
|
+
onChange: (e) => W({ name: e ?? "" }),
|
|
527
584
|
placeholder: X.namePlaceholder ?? "good-morning-breakfast",
|
|
528
|
-
caption:
|
|
529
|
-
error:
|
|
530
|
-
invalid: !!
|
|
585
|
+
caption: M?.name ? void 0 : X.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
|
|
586
|
+
error: M?.name,
|
|
587
|
+
invalid: !!M?.name,
|
|
531
588
|
disabled: P
|
|
532
589
|
}),
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
590
|
+
/* @__PURE__ */ b(n, {
|
|
591
|
+
isEnabled: !!R,
|
|
592
|
+
fieldId: Ne,
|
|
593
|
+
required: !0,
|
|
594
|
+
label: X.descriptionLabel ?? "Description",
|
|
595
|
+
labels: X,
|
|
596
|
+
refinement: G,
|
|
597
|
+
disabled: Re || T,
|
|
598
|
+
...ft,
|
|
599
|
+
children: /* @__PURE__ */ b(ae, {
|
|
600
|
+
id: Ne,
|
|
601
|
+
"aria-required": !0,
|
|
602
|
+
labelProps: R ? void 0 : {
|
|
603
|
+
label: X.descriptionLabel ?? "Description",
|
|
604
|
+
required: !0
|
|
605
|
+
},
|
|
606
|
+
value: H.description,
|
|
607
|
+
placeholder: X.descriptionPlaceholder ?? "What this skill does and when to use it",
|
|
608
|
+
onChange: (e) => {
|
|
609
|
+
G.reset(), W({ description: e });
|
|
610
|
+
},
|
|
611
|
+
error: M?.description,
|
|
612
|
+
invalid: !!M?.description
|
|
613
|
+
})
|
|
546
614
|
}),
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
})
|
|
571
|
-
|
|
572
|
-
|
|
615
|
+
/* @__PURE__ */ b(n, {
|
|
616
|
+
isEnabled: !!z,
|
|
617
|
+
fieldId: Pe,
|
|
618
|
+
required: !0,
|
|
619
|
+
labelClassName: a(V.helperText, lt),
|
|
620
|
+
label: X.instructionsLabel ?? "Instructions",
|
|
621
|
+
labels: X,
|
|
622
|
+
refinement: K,
|
|
623
|
+
disabled: Re || T,
|
|
624
|
+
...ft,
|
|
625
|
+
children: /* @__PURE__ */ x("div", {
|
|
626
|
+
className: "flex flex-1 flex-col gap-2",
|
|
627
|
+
children: [
|
|
628
|
+
!z && /* @__PURE__ */ b(te, {
|
|
629
|
+
htmlFor: Pe,
|
|
630
|
+
className: a(V.helperText, lt),
|
|
631
|
+
label: X.instructionsLabel ?? "Instructions",
|
|
632
|
+
required: !0
|
|
633
|
+
}),
|
|
634
|
+
/* @__PURE__ */ b("div", {
|
|
635
|
+
ref: Fe,
|
|
636
|
+
className: a(e, t),
|
|
637
|
+
children: /* @__PURE__ */ b(ce, {
|
|
638
|
+
fallback: /* @__PURE__ */ b(v, { ariaLabel: X.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
639
|
+
children: /* @__PURE__ */ b(xe, {
|
|
640
|
+
id: Pe,
|
|
641
|
+
ariaLabel: X.instructionsLabel ?? "Instructions",
|
|
642
|
+
value: H.instructions,
|
|
643
|
+
onChange: (e) => {
|
|
644
|
+
K.reset(), W({ instructions: e });
|
|
645
|
+
},
|
|
646
|
+
theme: je,
|
|
647
|
+
placeholder: X.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
|
|
648
|
+
})
|
|
573
649
|
})
|
|
574
|
-
})
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
650
|
+
}),
|
|
651
|
+
M?.instructions != null && /* @__PURE__ */ b(p, { text: M.instructions })
|
|
652
|
+
]
|
|
653
|
+
})
|
|
578
654
|
})
|
|
579
|
-
] }) : $?.kind === I.File && (
|
|
655
|
+
] }) : $?.kind === I.File && (ve ?? /* @__PURE__ */ b(l, { text: X.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." }))
|
|
580
656
|
]
|
|
581
657
|
})
|
|
582
658
|
}),
|
|
583
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ b(be, {
|
|
584
660
|
isOpen: Y,
|
|
585
661
|
onClose: () => {
|
|
586
|
-
|
|
662
|
+
tt(!1), rt(void 0);
|
|
587
663
|
},
|
|
588
|
-
fileActions:
|
|
589
|
-
initialFiles:
|
|
590
|
-
labels:
|
|
664
|
+
fileActions: B,
|
|
665
|
+
initialFiles: nt,
|
|
666
|
+
labels: Oe
|
|
591
667
|
})
|
|
592
668
|
]
|
|
593
669
|
});
|
|
594
670
|
};
|
|
595
671
|
//#endregion
|
|
596
|
-
export {
|
|
672
|
+
export { pe as SKILL_EDITOR_CLASS, Se as SkillEditor, R as SkillFileCandidateKind, I as SkillFileNodeKind, z as SkillFileValidationStatus };
|