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