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