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