@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/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, 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";
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 le = {
15
+ var de = {
16
16
  layout: "dial-builder-form-layout",
17
17
  section: "dial-builder-form-section"
18
- }, F = {
18
+ }, N = {
19
19
  headerBorder: "_headerBorder_1kidu_1",
20
20
  footerBorder: "_footerBorder_1kidu_5",
21
21
  sidebarBorder: "_sidebarBorder_1kidu_9"
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({
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__ */ S("div", {
27
+ return /* @__PURE__ */ x("div", {
28
28
  dir: p,
29
- className: a("flex min-h-0 flex-1 flex-col", le.layout),
30
- style: _,
29
+ className: a("flex min-h-0 flex-1 flex-col", de.layout),
30
+ style: g,
31
31
  children: [
32
- /* @__PURE__ */ x("span", {
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__ */ 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", {
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__ */ x(g, {
44
- icon: /* @__PURE__ */ x(C, {
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__ */ x("h1", {
52
+ }), /* @__PURE__ */ b("h1", {
53
53
  className: "dial-h2-text min-w-0 truncate",
54
54
  children: e
55
55
  })]
56
- }), i != null && /* @__PURE__ */ x("div", {
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__ */ S("div", {
61
+ /* @__PURE__ */ x("div", {
62
62
  className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
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),
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__ */ x("div", {
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__ */ 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),
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
- }, de = {
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
- }, I = (e) => !!e.dataTransfer?.types.includes("Files"), fe = (e) => {
82
- let [t, n] = N(!1), r = M(0);
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: k((e) => {
87
- I(e) && (e.preventDefault(), r.current += 1, n(!0));
85
+ onDragEnter: E((e) => {
86
+ P(e) && (e.preventDefault(), r.current += 1, n(!0));
88
87
  }, []),
89
- onDragLeave: k((e) => {
90
- I(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
88
+ onDragLeave: E((e) => {
89
+ P(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
91
90
  }, []),
92
- onDragOver: k((e) => {
93
- I(e) && e.preventDefault();
91
+ onDragOver: E((e) => {
92
+ P(e) && e.preventDefault();
94
93
  }, []),
95
- onDrop: k((t) => {
96
- if (!I(t)) return;
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
- }, L = "SKILL.md", R = /* @__PURE__ */ function(e) {
102
+ }, F = "SKILL.md", I = /* @__PURE__ */ function(e) {
104
103
  return e.File = "file", e.Folder = "folder", e;
105
- }({}), z = (e) => {
104
+ }({}), L = (e) => {
106
105
  let t = e.lastIndexOf("/");
107
106
  return t === -1 ? null : e.slice(0, t);
108
- }, B = (e) => {
107
+ }, he = (e) => {
109
108
  let t = e.lastIndexOf("/");
110
109
  return t === -1 ? e : e.slice(t + 1);
111
- }, pe = (e) => {
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: B(e),
118
- nodeType: P.FOLDER,
119
- parentPath: z(e),
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 === R.Folder) {
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: P.ITEM,
134
- parentPath: z(r.path),
135
- folderId: z(r.path) ?? ""
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 = z(t.path);
140
- for (; e != null;) n(e), e = z(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
- }, 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 }) => {
151
+ }, _e = ({ isVisible: e, labels: t }) => {
233
152
  if (!e) return null;
234
153
  let n = t ?? {};
235
- return /* @__PURE__ */ x("div", {
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__ */ S("div", {
158
+ children: /* @__PURE__ */ x("div", {
240
159
  className: "flex flex-col items-center text-center",
241
160
  children: [
242
- /* @__PURE__ */ x(D, {
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__ */ x("span", {
167
+ /* @__PURE__ */ b("span", {
249
168
  className: "dial-h3-text mt-5",
250
169
  children: n.dropOverlayTitle ?? "Upload files"
251
170
  }),
252
- /* @__PURE__ */ x("span", {
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
- }, V = /* @__PURE__ */ function(e) {
178
+ }, R = /* @__PURE__ */ function(e) {
260
179
  return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
261
- }({}), H = /* @__PURE__ */ function(e) {
180
+ }({}), z = /* @__PURE__ */ function(e) {
262
181
  return e.Valid = "valid", e.Invalid = "invalid", 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) => {
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: ve(),
185
+ id: ye(),
267
186
  file: e,
268
- path: ge(e)
187
+ path: B(e)
269
188
  }));
270
- T(void 0), c((e) => [...e, ...t]);
271
- }, k = (e) => {
189
+ S(void 0), c((e) => [...e, ...t]);
190
+ }, E = (e) => {
272
191
  c((t) => t.filter((t) => t.id !== e));
273
192
  };
274
- A(() => {
193
+ D(() => {
275
194
  e && (c((r ?? []).map((e) => ({
276
- id: ve(),
195
+ id: ye(),
277
196
  file: e,
278
- path: ge(e)
279
- }))), u(/* @__PURE__ */ new Map()), _([]), T(void 0));
280
- }, [e]), A(() => {
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 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)));
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 || re(!1);
209
+ t || _(!1);
291
210
  }), () => {
292
211
  t = !0;
293
212
  };
294
213
  }, [s, e]);
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);
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), _(r.map((e) => e.message)), s.some((e) => i.get(e.id)?.status === H.Invalid) || r.length > 0) return;
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
- T(a.error);
221
+ S(a.error);
303
222
  return;
304
223
  }
305
224
  t();
306
225
  } finally {
307
- D(!1);
226
+ w(!1);
308
227
  }
309
228
  };
310
- return /* @__PURE__ */ x(ee, {
229
+ return /* @__PURE__ */ b(ne, {
311
230
  open: e,
312
231
  header: o.uploadDialogTitle ?? "Upload files from device",
313
- size: te.Sm,
232
+ size: re.Sm,
314
233
  closeAriaLabel: o.uploadDialogCloseAriaLabel ?? "Close",
315
234
  onClose: t,
316
- footer: /* @__PURE__ */ S("div", {
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__ */ x(h, {
237
+ children: [/* @__PURE__ */ b(h, {
319
238
  label: o.uploadCancelLabel ?? "Cancel",
320
239
  onClick: t
321
- }), /* @__PURE__ */ x(ne, {
240
+ }), /* @__PURE__ */ b(ie, {
322
241
  label: o.uploadConfirmLabel ?? "Add",
323
- iconBefore: E ? /* @__PURE__ */ x(y, {
242
+ iconBefore: oe ? /* @__PURE__ */ b(v, {
324
243
  size: 16,
325
244
  ariaLabel: ""
326
245
  }) : void 0,
327
- onClick: () => void se(),
328
- disabled: !P
246
+ onClick: () => void le(),
247
+ disabled: !M
329
248
  })]
330
249
  }),
331
- children: /* @__PURE__ */ S("div", {
250
+ children: /* @__PURE__ */ x("div", {
332
251
  className: "flex flex-col gap-4 px-6 py-4",
333
252
  children: [
334
- /* @__PURE__ */ x(m, {
335
- label: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("span", {
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__ */ x("span", {
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: M ? "border-error hover:border-error" : void 0,
345
- onChange: O
263
+ className: A ? "border-error hover:border-error" : void 0,
264
+ onChange: T
346
265
  }),
347
- /* @__PURE__ */ x("span", {
266
+ /* @__PURE__ */ b("span", {
348
267
  role: "status",
349
268
  "aria-live": "polite",
350
269
  className: "sr-only",
351
- id: ae,
270
+ id: ce,
352
271
  children: f.map((e) => `${o.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
353
272
  }),
354
- f.map((e) => /* @__PURE__ */ x(p, { text: e }, e)),
355
- s.length > 0 && /* @__PURE__ */ x("ul", {
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 === V.Manifest, r = t?.status === H.Invalid;
359
- return /* @__PURE__ */ S("li", {
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__ */ x(w, {
281
+ /* @__PURE__ */ b(C, {
363
282
  size: 20,
364
283
  "aria-hidden": !0,
365
284
  stroke: d
366
285
  }),
367
- /* @__PURE__ */ S("div", {
286
+ /* @__PURE__ */ x("div", {
368
287
  className: "flex min-w-0 flex-1 flex-col",
369
288
  children: [
370
- /* @__PURE__ */ x("span", {
289
+ /* @__PURE__ */ b("span", {
371
290
  className: "dial-small-text truncate",
372
291
  children: e.path
373
292
  }),
374
- /* @__PURE__ */ x("span", {
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__ */ x(p, { text: t.error }),
379
- n && !r && /* @__PURE__ */ x("span", {
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__ */ x(g, {
386
- icon: /* @__PURE__ */ x(ie, {
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: () => k(e.id)
311
+ onClick: () => E(e.id)
393
312
  })
394
313
  ]
395
314
  }, e.id);
396
315
  })
397
316
  }),
398
- C && /* @__PURE__ */ x(p, { text: C })
317
+ ae && /* @__PURE__ */ b(p, { text: ae })
399
318
  ]
400
319
  })
401
320
  });
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();
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
- }), 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) => {
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
- ...Me.current,
336
+ ...Ie.current,
419
337
  ...e
420
338
  };
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;
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
- K.current === n && (K.current = void 0);
346
+ U.current === n && (U.current = void 0);
429
347
  }
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();
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
- 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;
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: n?.name ?? "",
455
- description: n?.description ?? "",
456
- instructions: n?.instructions ?? ""
372
+ name: i?.name ?? "",
373
+ description: i?.description ?? "",
374
+ instructions: i?.instructions ?? ""
457
375
  };
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;
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: 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));
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
- G,
388
+ H,
389
+ m,
471
390
  i,
472
- n,
473
- He,
474
- F
391
+ We,
392
+ L
475
393
  ]);
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) => {
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
- 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({
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
- }), 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: {
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, 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);
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
- V,
505
- J,
506
- Y
507
- ]), gt = k((e) => e.path === "SKILL.md" ? [] : [{
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__ */ x(ie, {
427
+ icon: /* @__PURE__ */ b(se, {
511
428
  size: u.SM,
512
- className: lt,
429
+ className: ut,
513
430
  "aria-hidden": !0,
514
431
  stroke: d
515
432
  }),
516
- onClick: () => ht(e.path)
433
+ onClick: () => gt(e.path)
517
434
  }], [
518
435
  X.removeLabel,
519
- lt,
520
- ht
521
- ]), _t = /* @__PURE__ */ S("div", {
436
+ ut,
437
+ gt
438
+ ]), vt = /* @__PURE__ */ x("div", {
522
439
  className: "flex flex-col gap-2 desktop:gap-5",
523
- children: [/* @__PURE__ */ S("div", {
440
+ children: [/* @__PURE__ */ x("div", {
524
441
  className: "flex items-center justify-between",
525
- children: [/* @__PURE__ */ x("span", {
526
- className: a(U.title, st),
442
+ children: [/* @__PURE__ */ b("span", {
443
+ className: a(V.title, ct),
527
444
  children: X.filesHeading ?? "Files"
528
- }), /* @__PURE__ */ x(v, {
445
+ }), /* @__PURE__ */ b(_, {
529
446
  label: X.addUploadLabel ?? "Upload from device",
530
- iconBefore: /* @__PURE__ */ x(T, {
447
+ iconBefore: /* @__PURE__ */ b(oe, {
531
448
  size: 16,
532
449
  "aria-hidden": !0,
533
450
  stroke: d
534
451
  }),
535
452
  onClick: () => {
536
- nt(void 0), et(!0);
453
+ rt(void 0), tt(!0);
537
454
  }
538
455
  })]
539
- }), /* @__PURE__ */ x("div", {
456
+ }), /* @__PURE__ */ b("div", {
540
457
  role: "tree",
541
458
  "aria-label": X.filesTreeAriaLabel ?? "Skill files",
542
- children: /* @__PURE__ */ x(se, {
543
- items: pt,
459
+ children: /* @__PURE__ */ b(le, {
460
+ items: mt,
544
461
  showFiles: !0,
545
- selectedPath: J,
546
- expandedPaths: Ze,
547
- onExpandedPathsChange: Qe,
548
- onItemClick: mt,
549
- getContextMenuItems: gt,
462
+ selectedPath: q,
463
+ expandedPaths: $e,
464
+ onExpandedPathsChange: et,
465
+ onItemClick: ht,
466
+ getContextMenuItems: _t,
550
467
  rootItemPath: ""
551
468
  })
552
469
  })]
553
- }), vt = /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(v, {
470
+ }), yt = /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(_, {
554
471
  label: X.cancelLabel ?? "Cancel",
555
- onClick: Re,
556
- disabled: E
557
- }), /* @__PURE__ */ x(ne, {
472
+ onClick: Be,
473
+ disabled: T
474
+ }), /* @__PURE__ */ b(ie, {
558
475
  label: X.createLabel ?? "Create",
559
- iconBefore: E ? /* @__PURE__ */ x(y, {
476
+ iconBefore: T ? /* @__PURE__ */ b(v, {
560
477
  size: 16,
561
478
  ariaLabel: ""
562
479
  }) : void 0,
563
- onClick: Be,
564
- disabled: E || Ie || C || w
480
+ onClick: He,
481
+ disabled: T || Re || C || w
565
482
  })] });
566
- return C ? /* @__PURE__ */ x("div", {
567
- dir: Ee,
483
+ return C ? /* @__PURE__ */ b("div", {
484
+ dir: Ae,
568
485
  className: "relative flex min-h-0 flex-1 flex-col",
569
- children: /* @__PURE__ */ x(ue, {
570
- title: xe,
571
- onBack: ze,
572
- backAriaLabel: W,
573
- actions: vt,
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: ft,
577
- leftContent: /* @__PURE__ */ x("div", {
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__ */ x(y, {})
498
+ children: /* @__PURE__ */ b(v, {})
582
499
  })
583
500
  })
584
- }) : w ? /* @__PURE__ */ x("div", {
585
- dir: Ee,
501
+ }) : w ? /* @__PURE__ */ b("div", {
502
+ dir: Ae,
586
503
  className: "relative flex min-h-0 flex-1 flex-col",
587
- children: /* @__PURE__ */ x(ue, {
588
- title: xe,
589
- onBack: ze,
590
- backAriaLabel: W,
591
- actions: vt,
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: ft,
595
- leftContent: /* @__PURE__ */ S("div", {
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__ */ x(p, { text: X.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ x(ne, {
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: Se
517
+ onClick: Ee
601
518
  })]
602
519
  })
603
520
  })
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,
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__ */ x(he, {
611
- isVisible: at && !$e,
612
- labels: we
527
+ /* @__PURE__ */ b(_e, {
528
+ isVisible: ot && !Y,
529
+ labels: Oe
613
530
  }),
614
- /* @__PURE__ */ x(ue, {
615
- title: xe,
616
- onBack: ze,
617
- backAriaLabel: W,
618
- actions: vt,
619
- isSaving: E,
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: ft,
622
- leftContent: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("div", {
538
+ styles: pt,
539
+ leftContent: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
623
540
  className: "px-4 py-4 desktop:hidden",
624
- children: /* @__PURE__ */ x(c, {
541
+ children: /* @__PURE__ */ b(c, {
625
542
  title: X.editingFileLabel ?? "Editing file",
626
543
  description: $?.name ?? "SKILL.md",
627
- expanded: rt,
628
- onToggle: it,
544
+ expanded: it,
545
+ onToggle: at,
629
546
  ariaLabel: X.editingFileLabel ?? "Editing file",
630
- children: _t
547
+ children: vt
631
548
  })
632
- }), /* @__PURE__ */ x("div", {
549
+ }), /* @__PURE__ */ b("div", {
633
550
  className: "hidden px-8 py-6 desktop:block",
634
- children: _t
551
+ children: vt
635
552
  })] }),
636
- rightContent: /* @__PURE__ */ S("div", {
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
- O != null && /* @__PURE__ */ S("div", {
556
+ ue != null && /* @__PURE__ */ x("div", {
640
557
  role: "alert",
641
558
  className: "flex items-center gap-2",
642
- children: [/* @__PURE__ */ x(p, { text: O }), Ce != null && /* @__PURE__ */ x(h, {
559
+ children: [/* @__PURE__ */ b(p, { text: ue }), De != null && /* @__PURE__ */ b(h, {
643
560
  label: X.retryLabel ?? "Retry",
644
- onClick: Ce
561
+ onClick: De
645
562
  })]
646
563
  }),
647
- P != null && /* @__PURE__ */ S("div", {
564
+ de != null && /* @__PURE__ */ x("div", {
648
565
  role: "alert",
649
566
  className: "flex items-center gap-2",
650
- children: [/* @__PURE__ */ x(p, { text: P.message }), /* @__PURE__ */ x(h, {
567
+ children: [/* @__PURE__ */ b(p, { text: de.message }), /* @__PURE__ */ b(h, {
651
568
  label: X.reloadLatestLabel ?? "Reload latest",
652
- onClick: ce
569
+ onClick: N
653
570
  })]
654
571
  }),
655
- /* @__PURE__ */ x("h2", {
656
- className: a(U.title, st),
657
- children: J === "SKILL.md" ? L : X.selectedFileHeading?.($?.name ?? J) ?? $?.name ?? J
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
- J === "SKILL.md" ? /* @__PURE__ */ S(b, { children: [
660
- /* @__PURE__ */ x(_, {
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: G.name,
666
- onChange: (e) => q({ name: e ?? "" }),
582
+ value: H.name,
583
+ onChange: (e) => W({ name: e ?? "" }),
667
584
  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
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__ */ x(me, {
674
- enabled: !!z,
675
- fieldId: ke,
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: Pe,
680
- disabled: Ie || E,
681
- ...dt,
682
- children: /* @__PURE__ */ x(re, {
683
- id: ke,
596
+ refinement: G,
597
+ disabled: Re || T,
598
+ ...ft,
599
+ children: /* @__PURE__ */ b(ae, {
600
+ id: Ne,
684
601
  "aria-required": !0,
685
- labelProps: z ? void 0 : {
602
+ labelProps: R ? void 0 : {
686
603
  label: X.descriptionLabel ?? "Description",
687
604
  required: !0
688
605
  },
689
- value: G.description,
606
+ value: H.description,
690
607
  placeholder: X.descriptionPlaceholder ?? "What this skill does and when to use it",
691
608
  onChange: (e) => {
692
- Pe.reset(), q({ description: e });
609
+ G.reset(), W({ description: e });
693
610
  },
694
- error: D?.description,
695
- invalid: !!D?.description
611
+ error: M?.description,
612
+ invalid: !!M?.description
696
613
  })
697
614
  }),
698
- /* @__PURE__ */ x(me, {
699
- enabled: !!B,
700
- fieldId: Ae,
615
+ /* @__PURE__ */ b(n, {
616
+ isEnabled: !!z,
617
+ fieldId: Pe,
701
618
  required: !0,
702
- labelClassName: a(U.helperText, ct),
619
+ labelClassName: a(V.helperText, lt),
703
620
  label: X.instructionsLabel ?? "Instructions",
704
621
  labels: X,
705
- refinement: Fe,
706
- disabled: Ie || E,
707
- ...dt,
708
- children: /* @__PURE__ */ S("div", {
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
- !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
- })]
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__ */ x("div", {
723
- ref: je,
634
+ /* @__PURE__ */ b("div", {
635
+ ref: Fe,
724
636
  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,
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: G.instructions,
642
+ value: H.instructions,
731
643
  onChange: (e) => {
732
- Fe.reset(), q({ instructions: e });
644
+ K.reset(), W({ instructions: e });
733
645
  },
734
- theme: De,
646
+ theme: je,
735
647
  placeholder: X.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
736
648
  })
737
649
  })
738
650
  }),
739
- D?.instructions != null && /* @__PURE__ */ x(p, { text: D.instructions })
651
+ M?.instructions != null && /* @__PURE__ */ b(p, { text: M.instructions })
740
652
  ]
741
653
  })
742
654
  })
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." }))
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__ */ x(ye, {
748
- isOpen: $e,
659
+ /* @__PURE__ */ b(be, {
660
+ isOpen: Y,
749
661
  onClose: () => {
750
- et(!1), nt(void 0);
662
+ tt(!1), rt(void 0);
751
663
  },
752
- fileActions: V,
753
- initialFiles: tt,
754
- labels: we
664
+ fileActions: B,
665
+ initialFiles: nt,
666
+ labels: Oe
755
667
  })
756
668
  ]
757
669
  });
758
670
  };
759
671
  //#endregion
760
- export { de as SKILL_EDITOR_CLASS, W as SkillEditor, V as SkillFileCandidateKind, R as SkillFileNodeKind, H as SkillFileValidationStatus };
672
+ export { pe as SKILL_EDITOR_CLASS, Se as SkillEditor, R as SkillFileCandidateKind, I as SkillFileNodeKind, z as SkillFileValidationStatus };