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