@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/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, buildCssVars as n, formatFileSize as r, mergeClasses as i, useAvailableHeightCap as a } from "@epam/ai-dial-chat-shared";
2
- import { Accordion as o, CaptionText as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, EditorThemes as u, ErrorText as d, FileDropzone as f, GhostButton as p, GhostIconButton as ee, Input as m, NeutralButton as h, Popup as g, PopupSize as te, PrimaryButton as ne, Spinner as _, Textarea as v } 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 re, IconPlus as C, IconTrashX as ie, IconUpload as w } from "@tabler/icons-react";
5
- import { Suspense as T, lazy as E, useCallback as D, useEffect as O, useId as k, useMemo as A, useRef as j, useState as M } from "react";
6
- import { DialFileNodeType as N, DialFoldersTree as ae } from "@epam/ai-dial-react-file-manager";
7
- import { LazyMarkdownEditor as P } from "@epam/ai-dial-ui-kit/editors";
8
- i("flex flex-col", {
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 oe = {
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
- }, se = ({ title: e, onBack: t, backAriaLabel: r = "Back", actions: a, leftContent: o, rightContent: s, isSaving: u = !1, labels: d, styles: f, dir: p }) => {
23
- let m = k(), h = u ? d?.savingStatusLabel ?? "Saving" : "", g = n({
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__ */ x("div", {
27
+ return /* @__PURE__ */ S("div", {
28
28
  dir: p,
29
- className: i("flex min-h-0 flex-1 flex-col", oe.layout),
30
- style: g,
29
+ className: a("flex min-h-0 flex-1 flex-col", le.layout),
30
+ style: _,
31
31
  children: [
32
- /* @__PURE__ */ b("span", {
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__ */ x("div", {
40
- className: i("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__ */ x("div", {
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__ */ b(ee, {
44
- icon: /* @__PURE__ */ b(S, {
45
- size: c.LG,
46
- stroke: l,
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": r,
50
+ "aria-label": n,
51
51
  onClick: t
52
- }), /* @__PURE__ */ b("h1", {
52
+ }), /* @__PURE__ */ x("h1", {
53
53
  className: "dial-h2-text min-w-0 truncate",
54
54
  children: e
55
55
  })]
56
- }), a != null && /* @__PURE__ */ b("div", {
56
+ }), i != null && /* @__PURE__ */ x("div", {
57
57
  className: "hidden shrink-0 items-center gap-2 desktop:flex",
58
- children: a
58
+ children: i
59
59
  })]
60
60
  }),
61
- /* @__PURE__ */ x("div", {
61
+ /* @__PURE__ */ S("div", {
62
62
  className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
63
- children: [/* @__PURE__ */ b("div", {
64
- className: i(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),
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__ */ b("div", {
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
- a != null && /* @__PURE__ */ b("div", {
72
- className: i("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", F.footerBorder),
73
- children: a
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
- }, ce = { root: "dial-skill-editor-root" }, I = (e) => !!e.dataTransfer?.types.includes("Files"), le = (e) => {
78
- let [t, n] = M(!1), r = j(0);
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: D((e) => {
86
+ onDragEnter: k((e) => {
83
87
  I(e) && (e.preventDefault(), r.current += 1, n(!0));
84
88
  }, []),
85
- onDragLeave: D((e) => {
89
+ onDragLeave: k((e) => {
86
90
  I(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
87
91
  }, []),
88
- onDragOver: D((e) => {
92
+ onDragOver: k((e) => {
89
93
  I(e) && e.preventDefault();
90
94
  }, []),
91
- onDrop: D((t) => {
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
- }, ue = (e) => {
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: N.FOLDER,
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: N.ITEM,
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
- }, de = ({ isVisible: e, labels: t }) => {
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__ */ b("div", {
235
+ return /* @__PURE__ */ x("div", {
152
236
  role: "status",
153
237
  "aria-live": "polite",
154
- className: i("pointer-events-none absolute inset-0 z-[100] flex items-center justify-center backdrop-blur-sm"),
155
- children: /* @__PURE__ */ x("div", {
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__ */ b(w, {
242
+ /* @__PURE__ */ x(D, {
159
243
  size: 100,
160
244
  className: "text-accent-primary",
161
245
  "aria-hidden": !0,
162
- stroke: l
246
+ stroke: d
163
247
  }),
164
- /* @__PURE__ */ b("span", {
248
+ /* @__PURE__ */ x("span", {
165
249
  className: "dial-h3-text mt-5",
166
250
  children: n.dropOverlayTitle ?? "Upload files"
167
251
  }),
168
- /* @__PURE__ */ b("span", {
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
- }({}), fe = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), U = 0, W = () => `skill-file-candidate-${++U}`, pe = ({ isOpen: e, onClose: t, fileActions: n, initialFiles: i, labels: a }) => {
180
- let o = a ?? {}, [s, c] = M([]), [u, m] = M(/* @__PURE__ */ new Map()), [h, v] = M([]), [S, C] = M(!1), [w, T] = M(), [E, D] = M(!1), A = k(), j = (e) => {
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: W(),
266
+ id: ve(),
183
267
  file: e,
184
- path: fe(e)
268
+ path: ge(e)
185
269
  }));
186
270
  T(void 0), c((e) => [...e, ...t]);
187
- }, N = (e) => {
271
+ }, k = (e) => {
188
272
  c((t) => t.filter((t) => t.id !== e));
189
273
  };
190
- O(() => {
191
- e && (c((i ?? []).map((e) => ({
192
- id: W(),
274
+ A(() => {
275
+ e && (c((r ?? []).map((e) => ({
276
+ id: ve(),
193
277
  file: e,
194
- path: fe(e)
195
- }))), m(/* @__PURE__ */ new Map()), v([]), T(void 0));
196
- }, [e]), O(() => {
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
- m(/* @__PURE__ */ new Map()), v([]);
284
+ u(/* @__PURE__ */ new Map()), _([]);
201
285
  return;
202
286
  }
203
- return C(!0), n.validateBatch(s).then(({ results: e, batchErrors: n }) => {
204
- t || (m(new Map(e.map((e) => [e.candidateId, e]))), v(n.map((e) => e.message)));
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 || C(!1);
290
+ t || re(!1);
207
291
  }), () => {
208
292
  t = !0;
209
293
  };
210
294
  }, [s, e]);
211
- let ae = s.some((e) => u.get(e.id)?.status === H.Invalid), P = s.length > 0 && s.every((e) => u.get(e.id)?.status === H.Invalid), oe = s.length > 0 && !ae && h.length === 0 && !S && !E, F = async () => {
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 (m(i), v(r.map((e) => e.message)), s.some((e) => i.get(e.id)?.status === H.Invalid) || r.length > 0) return;
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__ */ b(g, {
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__ */ x("div", {
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__ */ b(p, {
318
+ children: [/* @__PURE__ */ x(h, {
235
319
  label: o.uploadCancelLabel ?? "Cancel",
236
320
  onClick: t
237
- }), /* @__PURE__ */ b(ne, {
321
+ }), /* @__PURE__ */ x(ne, {
238
322
  label: o.uploadConfirmLabel ?? "Add",
239
- iconBefore: E ? /* @__PURE__ */ b(_, {
323
+ iconBefore: E ? /* @__PURE__ */ x(y, {
240
324
  size: 16,
241
325
  ariaLabel: ""
242
326
  }) : void 0,
243
- onClick: () => void F(),
244
- disabled: !oe
327
+ onClick: () => void se(),
328
+ disabled: !P
245
329
  })]
246
330
  }),
247
- children: /* @__PURE__ */ x("div", {
331
+ children: /* @__PURE__ */ S("div", {
248
332
  className: "flex flex-col gap-4 px-6 py-4",
249
333
  children: [
250
- /* @__PURE__ */ b(f, {
251
- label: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
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__ */ b("span", {
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: P ? "border-error hover:border-error" : void 0,
261
- onChange: j
344
+ className: M ? "border-error hover:border-error" : void 0,
345
+ onChange: O
262
346
  }),
263
- /* @__PURE__ */ b("span", {
347
+ /* @__PURE__ */ x("span", {
264
348
  role: "status",
265
349
  "aria-live": "polite",
266
350
  className: "sr-only",
267
- id: A,
268
- children: h.map((e) => `${o.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
351
+ id: ae,
352
+ children: f.map((e) => `${o.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
269
353
  }),
270
- h.map((e) => /* @__PURE__ */ b(d, { text: e }, e)),
271
- s.length > 0 && /* @__PURE__ */ b("ul", {
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 = u.get(e.id), n = t?.kind === V.Manifest, i = t?.status === H.Invalid;
275
- return /* @__PURE__ */ x("li", {
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__ */ b(re, {
362
+ /* @__PURE__ */ x(w, {
279
363
  size: 20,
280
364
  "aria-hidden": !0,
281
- stroke: l
365
+ stroke: d
282
366
  }),
283
- /* @__PURE__ */ x("div", {
367
+ /* @__PURE__ */ S("div", {
284
368
  className: "flex min-w-0 flex-1 flex-col",
285
369
  children: [
286
- /* @__PURE__ */ b("span", {
370
+ /* @__PURE__ */ x("span", {
287
371
  className: "dial-small-text truncate",
288
372
  children: e.path
289
373
  }),
290
- /* @__PURE__ */ b("span", {
374
+ /* @__PURE__ */ x("span", {
291
375
  className: "dial-tiny-text text-secondary",
292
- children: r(e.file.size)
376
+ children: i(e.file.size)
293
377
  }),
294
- i && t?.error && /* @__PURE__ */ b(d, { text: t.error }),
295
- n && !i && /* @__PURE__ */ b("span", {
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__ */ b(ee, {
302
- icon: /* @__PURE__ */ b(ie, {
385
+ /* @__PURE__ */ x(g, {
386
+ icon: /* @__PURE__ */ x(ie, {
303
387
  size: 16,
304
388
  "aria-hidden": !0,
305
- stroke: l
389
+ stroke: d
306
390
  }),
307
391
  "aria-label": o.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
308
- onClick: () => N(e.id)
392
+ onClick: () => k(e.id)
309
393
  })
310
394
  ]
311
395
  }, e.id);
312
396
  })
313
397
  }),
314
- w && /* @__PURE__ */ b(d, { text: w })
398
+ C && /* @__PURE__ */ x(p, { text: C })
315
399
  ]
316
400
  })
317
401
  });
318
- }, G = {
319
- title: "_title_65glc_1",
320
- helperText: "_helperText_65glc_5"
321
- }, me = E(async () => {
322
- let { MarkdownEditor: e } = await P();
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
- }), K = ({ initialValues: r, files: f, selectedPath: ee, onSelectedPathChange: g, expandedPaths: te, onExpandedPathsChange: S, isLoading: re = !1, hasLoadError: w = !1, isSubmitting: E = !1, errors: k, submitError: N, conflict: P, onReloadLatest: oe, isNameReadOnly: F = !1, onDirtyChange: I, onValuesChange: z, fileActions: B, supportingFileContent: V, onSubmit: H, onCancel: fe, onBack: U, backAriaLabel: W, title: K, onRetry: he, onRetrySubmit: ge, labels: _e, styles: ve, dir: ye, instructionsEditorTheme: be = u.light }) => {
325
- let [q, xe] = M({
326
- name: r?.name ?? "",
327
- description: r?.description ?? "",
328
- instructions: r?.instructions ?? ""
329
- }), Se = a(), Ce = (e) => {
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
- ...q,
418
+ ...Me.current,
332
419
  ...e
333
420
  };
334
- xe(t), z?.(t);
335
- }, we = j(r), Te = we.current !== r, Ee = j(f);
336
- O(() => {
337
- we.current = r, xe({
338
- name: r?.name ?? "",
339
- description: r?.description ?? "",
340
- instructions: r?.instructions ?? ""
341
- }), Ee.current = f;
342
- }, [r]);
343
- let De = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), Oe = j(!1);
344
- O(() => {
345
- if (Te) return;
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: r?.name ?? "",
348
- description: r?.description ?? "",
349
- instructions: r?.instructions ?? ""
350
- }, t = JSON.stringify(q) !== JSON.stringify(e) || De(f) !== De(Ee.current);
351
- t !== Oe.current && (Oe.current = t, I?.(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
- q,
354
- f,
355
- r,
356
- Te,
357
- I
470
+ G,
471
+ i,
472
+ n,
473
+ He,
474
+ F
358
475
  ]);
359
- let [ke, Ae] = M(L), J = ee ?? ke, Y = D((e) => {
360
- Ae(e), g?.(e);
361
- }, [g]), [je, Me] = M([]), Ne = te ?? je, Pe = A(() => new Set(Ne), [Ne]), Fe = D((e) => {
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
- Me(t), S?.(t);
364
- }, [S]), [X, Ie] = M(!1), [Le, Re] = M(), [ze, Be] = M(!1), { isDragActive: Ve, dropZoneHandlers: He } = le(D((e) => {
365
- X || (Re(e), Ie(!0));
366
- }, [X])), Z = _e ?? {}, Q = ve?.colors, Ue = ve?.typography ?? {}, We = Ue.titleClassName ?? "dial-body-semi-text", Ge = Ue.helperTextClassName ?? "dial-tiny-semi-text", Ke = Ue.removeIconClassName ?? "text-secondary", qe = n({
367
- "--se-title-color": Q?.title,
368
- "--se-helper-text-color": Q?.helperText
369
- }), Je = Q?.border ? { colors: {
370
- headerBorderColor: Q.border,
371
- sidebarBorderColor: Q.border
372
- } } : void 0, Ye = A(() => ue([{
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
- }, ...f]), [f]), $ = A(() => f.find((e) => e.path === J), [f, J]), Xe = D((e) => {
499
+ }, ...i]), [i]), $ = oe(() => i.find((e) => e.path === J), [i, J]), mt = k((e) => {
377
500
  Y(e.path);
378
- }, [Y]), Ze = D((e) => {
379
- B.onRemoveNode(e), J === e && Y(L);
501
+ }, [Y]), ht = k((e) => {
502
+ V.onRemoveNode(e), J === e && Y(L);
380
503
  }, [
381
- B,
504
+ V,
382
505
  J,
383
506
  Y
384
- ]), Qe = D((e) => e.path === "SKILL.md" ? [] : [{
507
+ ]), gt = k((e) => e.path === "SKILL.md" ? [] : [{
385
508
  key: "remove",
386
- label: Z.removeLabel ?? "Remove",
387
- icon: /* @__PURE__ */ b(ie, {
388
- size: c.SM,
389
- className: Ke,
509
+ label: X.removeLabel ?? "Remove",
510
+ icon: /* @__PURE__ */ x(ie, {
511
+ size: u.SM,
512
+ className: lt,
390
513
  "aria-hidden": !0,
391
- stroke: l
514
+ stroke: d
392
515
  }),
393
- onClick: () => Ze(e.path)
516
+ onClick: () => ht(e.path)
394
517
  }], [
395
- Z.removeLabel,
396
- Ke,
397
- Ze
398
- ]), $e = /* @__PURE__ */ x("div", {
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__ */ x("div", {
523
+ children: [/* @__PURE__ */ S("div", {
401
524
  className: "flex items-center justify-between",
402
- children: [/* @__PURE__ */ b("span", {
403
- className: i(G.title, We),
404
- children: Z.filesHeading ?? "Files"
405
- }), /* @__PURE__ */ b(h, {
406
- label: Z.addUploadLabel ?? "Upload from device",
407
- iconBefore: /* @__PURE__ */ b(C, {
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: l
533
+ stroke: d
411
534
  }),
412
535
  onClick: () => {
413
- Re(void 0), Ie(!0);
536
+ nt(void 0), et(!0);
414
537
  }
415
538
  })]
416
- }), /* @__PURE__ */ b("div", {
539
+ }), /* @__PURE__ */ x("div", {
417
540
  role: "tree",
418
- "aria-label": Z.filesTreeAriaLabel ?? "Skill files",
419
- children: /* @__PURE__ */ b(ae, {
420
- items: Ye,
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: Pe,
424
- onExpandedPathsChange: Fe,
425
- onItemClick: Xe,
426
- getContextMenuItems: Qe,
546
+ expandedPaths: Ze,
547
+ onExpandedPathsChange: Qe,
548
+ onItemClick: mt,
549
+ getContextMenuItems: gt,
427
550
  rootItemPath: ""
428
551
  })
429
552
  })]
430
- }), et = /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(h, {
431
- label: Z.cancelLabel ?? "Cancel",
432
- onClick: fe,
553
+ }), vt = /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(v, {
554
+ label: X.cancelLabel ?? "Cancel",
555
+ onClick: Re,
433
556
  disabled: E
434
- }), /* @__PURE__ */ b(ne, {
435
- label: Z.createLabel ?? "Create",
436
- iconBefore: E ? /* @__PURE__ */ b(_, {
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: () => H(q),
441
- disabled: E
563
+ onClick: Be,
564
+ disabled: E || Ie || C || w
442
565
  })] });
443
- return re ? /* @__PURE__ */ b("div", {
444
- dir: ye,
566
+ return C ? /* @__PURE__ */ x("div", {
567
+ dir: Ee,
445
568
  className: "relative flex min-h-0 flex-1 flex-col",
446
- children: /* @__PURE__ */ b(se, {
447
- title: K,
448
- onBack: U,
569
+ children: /* @__PURE__ */ x(ue, {
570
+ title: xe,
571
+ onBack: ze,
449
572
  backAriaLabel: W,
450
- actions: et,
573
+ actions: vt,
451
574
  isSaving: !1,
452
- labels: { savingStatusLabel: Z.savingStatusLabel },
453
- styles: Je,
454
- leftContent: /* @__PURE__ */ b("div", {
575
+ labels: { savingStatusLabel: X.savingStatusLabel },
576
+ styles: ft,
577
+ leftContent: /* @__PURE__ */ x("div", {
455
578
  role: "status",
456
- "aria-label": Z.loadingAriaLabel ?? "Loading skill",
579
+ "aria-label": X.loadingAriaLabel ?? "Loading skill",
457
580
  className: "flex flex-1 items-center justify-center p-8",
458
- children: /* @__PURE__ */ b(_, {})
581
+ children: /* @__PURE__ */ x(y, {})
459
582
  })
460
583
  })
461
- }) : w ? /* @__PURE__ */ b("div", {
462
- dir: ye,
584
+ }) : w ? /* @__PURE__ */ x("div", {
585
+ dir: Ee,
463
586
  className: "relative flex min-h-0 flex-1 flex-col",
464
- children: /* @__PURE__ */ b(se, {
465
- title: K,
466
- onBack: U,
587
+ children: /* @__PURE__ */ x(ue, {
588
+ title: xe,
589
+ onBack: ze,
467
590
  backAriaLabel: W,
468
- actions: et,
591
+ actions: vt,
469
592
  isSaving: !1,
470
- labels: { savingStatusLabel: Z.savingStatusLabel },
471
- styles: Je,
472
- leftContent: /* @__PURE__ */ x("div", {
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__ */ b(d, { text: Z.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ b(ne, {
476
- label: Z.retryLabel ?? "Retry",
477
- onClick: he
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__ */ x("div", {
482
- dir: ye,
483
- className: i("relative flex min-h-0 flex-1 flex-col", ce.root),
484
- style: qe,
485
- ...He,
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__ */ b(de, {
488
- isVisible: Ve && !X,
489
- labels: _e
610
+ /* @__PURE__ */ x(he, {
611
+ isVisible: at && !$e,
612
+ labels: we
490
613
  }),
491
- /* @__PURE__ */ b(se, {
492
- title: K,
493
- onBack: U,
614
+ /* @__PURE__ */ x(ue, {
615
+ title: xe,
616
+ onBack: ze,
494
617
  backAriaLabel: W,
495
- actions: et,
618
+ actions: vt,
496
619
  isSaving: E,
497
- labels: { savingStatusLabel: Z.savingStatusLabel },
498
- styles: Je,
499
- leftContent: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
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__ */ b(o, {
502
- title: Z.editingFileLabel ?? "Editing file",
624
+ children: /* @__PURE__ */ x(c, {
625
+ title: X.editingFileLabel ?? "Editing file",
503
626
  description: $?.name ?? "SKILL.md",
504
- expanded: ze,
505
- onToggle: Be,
506
- ariaLabel: Z.editingFileLabel ?? "Editing file",
507
- children: $e
627
+ expanded: rt,
628
+ onToggle: it,
629
+ ariaLabel: X.editingFileLabel ?? "Editing file",
630
+ children: _t
508
631
  })
509
- }), /* @__PURE__ */ b("div", {
632
+ }), /* @__PURE__ */ x("div", {
510
633
  className: "hidden px-8 py-6 desktop:block",
511
- children: $e
634
+ children: _t
512
635
  })] }),
513
- rightContent: /* @__PURE__ */ x("div", {
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
- N != null && /* @__PURE__ */ x("div", {
639
+ O != null && /* @__PURE__ */ S("div", {
517
640
  role: "alert",
518
641
  className: "flex items-center gap-2",
519
- children: [/* @__PURE__ */ b(d, { text: N }), ge != null && /* @__PURE__ */ b(p, {
520
- label: Z.retryLabel ?? "Retry",
521
- onClick: ge
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__ */ x("div", {
647
+ P != null && /* @__PURE__ */ S("div", {
525
648
  role: "alert",
526
649
  className: "flex items-center gap-2",
527
- children: [/* @__PURE__ */ b(d, { text: P.message }), /* @__PURE__ */ b(p, {
528
- label: Z.reloadLatestLabel ?? "Reload latest",
529
- onClick: oe
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__ */ b("h2", {
533
- className: i(G.title, We),
534
- children: J === "SKILL.md" ? L : Z.selectedFileHeading?.($?.name ?? J) ?? $?.name ?? J
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__ */ x(y, { children: [
537
- /* @__PURE__ */ b(m, {
659
+ J === "SKILL.md" ? /* @__PURE__ */ S(b, { children: [
660
+ /* @__PURE__ */ x(_, {
538
661
  labelProps: {
539
- label: Z.nameLabel ?? "Name",
662
+ label: X.nameLabel ?? "Name",
540
663
  required: !0
541
664
  },
542
- value: q.name,
543
- onChange: (e) => Ce({ name: e ?? "" }),
544
- placeholder: Z.namePlaceholder ?? "good-morning-breakfast",
545
- caption: k?.name ? void 0 : Z.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
546
- error: k?.name,
547
- invalid: !!k?.name,
548
- disabled: F
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__ */ b(v, {
551
- labelProps: {
552
- label: Z.descriptionLabel ?? "Description",
553
- required: !0
554
- },
555
- value: q.description,
556
- placeholder: Z.descriptionPlaceholder ?? "What this skill does and when to use it",
557
- onChange: (e) => Ce({ description: e }),
558
- error: k?.description,
559
- invalid: !!k?.description
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("div", {
562
- className: "flex flex-1 flex-col gap-2",
563
- children: [
564
- /* @__PURE__ */ x("span", {
565
- className: "flex items-center gap-0.5",
566
- children: [/* @__PURE__ */ b("span", {
567
- className: i(G.helperText, Ge),
568
- children: Z.instructionsLabel ?? "Instructions"
569
- }), /* @__PURE__ */ b("span", {
570
- className: "dial-tiny-text text-error",
571
- children: "*"
572
- })]
573
- }),
574
- /* @__PURE__ */ b("div", {
575
- ref: Se,
576
- className: i(e, t),
577
- children: /* @__PURE__ */ b(T, {
578
- fallback: /* @__PURE__ */ b(_, { ariaLabel: Z.instructionsLoadingAriaLabel ?? "Loading" }),
579
- children: /* @__PURE__ */ b(me, {
580
- value: q.instructions,
581
- onChange: (e) => Ce({ instructions: e }),
582
- theme: be,
583
- placeholder: Z.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
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
- k?.instructions != null && /* @__PURE__ */ b(d, { text: k.instructions })
588
- ]
738
+ }),
739
+ D?.instructions != null && /* @__PURE__ */ x(p, { text: D.instructions })
740
+ ]
741
+ })
589
742
  })
590
- ] }) : $?.kind === R.File && (V ?? /* @__PURE__ */ b(s, { text: Z.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." }))
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__ */ b(pe, {
595
- isOpen: X,
747
+ /* @__PURE__ */ x(ye, {
748
+ isOpen: $e,
596
749
  onClose: () => {
597
- Ie(!1), Re(void 0);
750
+ et(!1), nt(void 0);
598
751
  },
599
- fileActions: B,
600
- initialFiles: Le,
601
- labels: _e
752
+ fileActions: V,
753
+ initialFiles: tt,
754
+ labels: we
602
755
  })
603
756
  ]
604
757
  });
605
758
  };
606
759
  //#endregion
607
- export { ce as SKILL_EDITOR_CLASS, K as SkillEditor, V as SkillFileCandidateKind, R as SkillFileNodeKind, H as SkillFileValidationStatus };
760
+ export { de as SKILL_EDITOR_CLASS, W as SkillEditor, V as SkillFileCandidateKind, R as SkillFileNodeKind, H as SkillFileValidationStatus };