@epam/ai-dial-skill-editor 1.3.0-dev.10 → 1.3.0-dev.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/SkillEditor/SkillEditor.d.ts.map +1 -1
- package/index.css +3 -2
- package/index.js +279 -279
- package/models/skill-editor-props.d.ts +0 -2
- package/models/skill-editor-props.d.ts.map +1 -1
- package/package.json +5 -5
- package/types/skill-add-source.d.ts +1 -3
- package/types/skill-add-source.d.ts.map +1 -1
- package/utils/file-tree.d.ts +1 -4
- package/utils/file-tree.d.ts.map +1 -1
- package/utils/icon.d.ts +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as t, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as n, RESIZABLE_TEXTAREA_CLASS_NAME as r, TAG_INPUT_TAG_CLASS_NAME as i, TextRefinementField as a, buildCssVars as o, formatFileSize as s, mergeClasses as c, useAvailableHeightCap as l, useTextRefinement as u } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { Accordion as d, ButtonAppearance as f, ButtonDropdown as p, ButtonVariant as m, CaptionText as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, DangerIconButton as v, EditorThemes as y, ElementSize as b, ErrorText as x, FileDropzone as S, GhostButton as C, GhostIconButton as w, Input as T, Label as E, LinkButton as D, NeutralButton as O, Popup as k, PopupSize as ee, PrimaryButton as A, Select as te, Spinner as ne, TagInput as j, Textarea as M, TextareaResize as N } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
4
|
-
import { IconArrowNarrowLeft as L, IconDatabase as re, IconFileText as ie, IconFileZip as ae, IconFolderPlus as oe, IconPhoto as se, IconPlus as
|
|
5
|
-
import { Suspense as
|
|
4
|
+
import { IconArrowNarrowLeft as L, IconDatabase as re, IconFileText as ie, IconFileZip as ae, IconFolderPlus as oe, IconPhoto as se, IconPlus as R, IconTrashX as ce, IconUpload as le } from "@tabler/icons-react";
|
|
5
|
+
import { Suspense as ue, lazy as de, memo as fe, useCallback as z, useEffect as pe, useId as me, useMemo as B, useRef as V, useState as H } from "react";
|
|
6
6
|
import { DialFileNodeType as he, DialFoldersTree as ge } from "@epam/ai-dial-react-file-manager";
|
|
7
7
|
import { LazyMarkdownEditor as _e } from "@epam/ai-dial-ui-kit/editors";
|
|
8
8
|
c("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", {
|
|
@@ -56,7 +56,7 @@ var ve = {
|
|
|
56
56
|
children: m
|
|
57
57
|
}),
|
|
58
58
|
/* @__PURE__ */ I("div", {
|
|
59
|
-
className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:
|
|
59
|
+
className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3", xe.headerBorder),
|
|
60
60
|
children: [/* @__PURE__ */ I("div", {
|
|
61
61
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
62
62
|
children: [/* @__PURE__ */ F(w, {
|
|
@@ -132,7 +132,7 @@ var ve = {
|
|
|
132
132
|
className: "flex flex-col gap-3",
|
|
133
133
|
children: [/* @__PURE__ */ F(C, {
|
|
134
134
|
size: b.Small,
|
|
135
|
-
iconBefore: /* @__PURE__ */ F(
|
|
135
|
+
iconBefore: /* @__PURE__ */ F(R, {
|
|
136
136
|
size: g.SM,
|
|
137
137
|
stroke: _,
|
|
138
138
|
"aria-hidden": !0
|
|
@@ -156,7 +156,7 @@ var ve = {
|
|
|
156
156
|
s.deleteConfirmSingleText,
|
|
157
157
|
" ",
|
|
158
158
|
/* @__PURE__ */ I("span", {
|
|
159
|
-
className: "break-
|
|
159
|
+
className: "wrap-break-word text-primary",
|
|
160
160
|
children: [
|
|
161
161
|
"\"",
|
|
162
162
|
e[0].split("/").pop(),
|
|
@@ -181,7 +181,7 @@ var ve = {
|
|
|
181
181
|
s.deleteConfirmMultipleText,
|
|
182
182
|
s.deleteConfirmItemsLabel
|
|
183
183
|
]);
|
|
184
|
-
return /* @__PURE__ */ F(
|
|
184
|
+
return /* @__PURE__ */ F(ue, {
|
|
185
185
|
fallback: null,
|
|
186
186
|
children: e && /* @__PURE__ */ F(i, {
|
|
187
187
|
isOpen: e,
|
|
@@ -223,15 +223,15 @@ var ve = {
|
|
|
223
223
|
"description",
|
|
224
224
|
"locales",
|
|
225
225
|
"tags"
|
|
226
|
-
],
|
|
226
|
+
], W = (e, t, n) => ({
|
|
227
227
|
id: e,
|
|
228
228
|
language: n.find((e) => !t.has(e.code))?.code ?? "",
|
|
229
229
|
name: "",
|
|
230
230
|
description: ""
|
|
231
|
-
}),
|
|
231
|
+
}), De = ({ value: e, onChange: t, availableLocaleOptions: n = [], labels: i, className: a, summaryClassName: o = "dial-body-text text-secondary", rowLabelClassName: s = "dial-tiny-lead-text text-secondary" }) => {
|
|
232
232
|
let { summaryLabel: l, addLabel: u, editLabel: d, popupTitle: p, addLocaleLabel: h, localeRowLabel: y = "Locale", languageLabel: x, nameLabel: S, namePlaceholder: C, descriptionLabel: w, descriptionPlaceholder: E, deleteAriaLabel: O, cancelLabel: ee = "Cancel", saveLabel: A = "Save" } = i, [ne, j] = H(!1), [P, L] = H([]), re = V(0);
|
|
233
233
|
pe(() => {
|
|
234
|
-
ne && L(e.length > 0 ? e : [
|
|
234
|
+
ne && L(e.length > 0 ? e : [W(`locale-row-${++re.current}`, /* @__PURE__ */ new Set(), n)]);
|
|
235
235
|
}, [
|
|
236
236
|
ne,
|
|
237
237
|
e,
|
|
@@ -241,30 +241,30 @@ var ve = {
|
|
|
241
241
|
t(P.filter((e) => e.language && e.name)), j(!1);
|
|
242
242
|
}, se = () => {
|
|
243
243
|
let e = new Set(P.map((e) => e.language).filter(Boolean));
|
|
244
|
-
L((t) => [...t,
|
|
245
|
-
},
|
|
244
|
+
L((t) => [...t, W(`locale-row-${++re.current}`, e, n)]);
|
|
245
|
+
}, le = (e, t) => {
|
|
246
246
|
L((n) => n.map((n) => n.id === e ? {
|
|
247
247
|
...n,
|
|
248
248
|
...t
|
|
249
249
|
} : n));
|
|
250
|
-
},
|
|
250
|
+
}, ue = (e) => {
|
|
251
251
|
L((t) => t.filter((t) => t.id !== e));
|
|
252
|
-
},
|
|
252
|
+
}, de = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), fe = P.some((e) => !e.language || !e.name);
|
|
253
253
|
return n.length === 0 ? null : /* @__PURE__ */ I("div", {
|
|
254
254
|
className: c("flex items-center gap-2", a),
|
|
255
255
|
children: [
|
|
256
256
|
e.length > 0 && /* @__PURE__ */ F("span", {
|
|
257
257
|
className: o,
|
|
258
|
-
children: `${l}: ${e.map((e) => `[${
|
|
258
|
+
children: `${l}: ${e.map((e) => `[${de(e.language)}]`).join(", ")}`
|
|
259
259
|
}),
|
|
260
260
|
/* @__PURE__ */ F(D, {
|
|
261
261
|
label: e.length > 0 ? d : u,
|
|
262
|
-
iconBefore: /* @__PURE__ */ F(
|
|
262
|
+
iconBefore: /* @__PURE__ */ F(R, {
|
|
263
263
|
size: g.SM,
|
|
264
264
|
"aria-hidden": !0,
|
|
265
265
|
stroke: _
|
|
266
266
|
}),
|
|
267
|
-
className: "
|
|
267
|
+
className: "px-0!",
|
|
268
268
|
onClick: ie
|
|
269
269
|
}),
|
|
270
270
|
/* @__PURE__ */ F(k, {
|
|
@@ -298,13 +298,13 @@ var ve = {
|
|
|
298
298
|
}), /* @__PURE__ */ F(v, {
|
|
299
299
|
appearance: f.Ghost,
|
|
300
300
|
size: b.Small,
|
|
301
|
-
icon: /* @__PURE__ */ F(
|
|
301
|
+
icon: /* @__PURE__ */ F(ce, {
|
|
302
302
|
size: g.SM,
|
|
303
303
|
"aria-hidden": !0,
|
|
304
304
|
stroke: _
|
|
305
305
|
}),
|
|
306
306
|
"aria-label": `${O} ${t + 1}`,
|
|
307
|
-
onClick: () =>
|
|
307
|
+
onClick: () => ue(e.id)
|
|
308
308
|
})]
|
|
309
309
|
}), /* @__PURE__ */ I("div", {
|
|
310
310
|
role: "group",
|
|
@@ -325,13 +325,13 @@ var ve = {
|
|
|
325
325
|
disabled: i.has(e.code)
|
|
326
326
|
})),
|
|
327
327
|
value: e.language,
|
|
328
|
-
onChange: (t) =>
|
|
328
|
+
onChange: (t) => le(e.id, { language: t })
|
|
329
329
|
}), /* @__PURE__ */ F(T, {
|
|
330
330
|
id: `${e.id}-name`,
|
|
331
331
|
containerClassName: "min-w-0 flex-1",
|
|
332
332
|
required: !0,
|
|
333
333
|
value: e.name,
|
|
334
|
-
onChange: (t) =>
|
|
334
|
+
onChange: (t) => le(e.id, { name: t ?? "" }),
|
|
335
335
|
labelProps: {
|
|
336
336
|
label: S,
|
|
337
337
|
required: !0
|
|
@@ -343,7 +343,7 @@ var ve = {
|
|
|
343
343
|
className: r,
|
|
344
344
|
resize: N.Vertical,
|
|
345
345
|
value: e.description,
|
|
346
|
-
onChange: (t) =>
|
|
346
|
+
onChange: (t) => le(e.id, { description: t }),
|
|
347
347
|
labelProps: { label: w },
|
|
348
348
|
placeholder: E
|
|
349
349
|
})]
|
|
@@ -351,7 +351,7 @@ var ve = {
|
|
|
351
351
|
}, e.id);
|
|
352
352
|
}), /* @__PURE__ */ F(D, {
|
|
353
353
|
label: h,
|
|
354
|
-
iconBefore: /* @__PURE__ */ F(
|
|
354
|
+
iconBefore: /* @__PURE__ */ F(R, {
|
|
355
355
|
size: g.SM,
|
|
356
356
|
"aria-hidden": !0,
|
|
357
357
|
stroke: _
|
|
@@ -364,38 +364,39 @@ var ve = {
|
|
|
364
364
|
})
|
|
365
365
|
]
|
|
366
366
|
});
|
|
367
|
-
}, Oe = "Add tags, comma separated",
|
|
368
|
-
let
|
|
367
|
+
}, Oe = "Add tags, comma separated", G = "deployment-creation-form-description", ke = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = Ee, isNameReadOnly: m = !1, nameCaption: h, isDescriptionRequired: g = !1, descriptionCaption: _, renderDescription: v, focusRequestKey: y }) => {
|
|
368
|
+
let b = V(null), x = V(null), S = V(null), C = V(!1), w = (e) => p.includes(e), E = w(U.Name), D = w(U.Version), O = !!(t.name || t.version || t.description), k = V(y);
|
|
369
369
|
pe(() => {
|
|
370
370
|
let e = () => {
|
|
371
|
-
t.name ?
|
|
371
|
+
t.name ? b.current?.focus() : t.version ? x.current?.focus() : t.description && S.current?.focus();
|
|
372
372
|
};
|
|
373
|
-
if (
|
|
374
|
-
|
|
373
|
+
if (y !== void 0) {
|
|
374
|
+
y !== k.current && (k.current = y, e());
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
377
|
-
|
|
377
|
+
O && !C.current && e(), C.current = O;
|
|
378
378
|
}, [
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
y,
|
|
380
|
+
O,
|
|
381
381
|
t.name,
|
|
382
382
|
t.version,
|
|
383
383
|
t.description
|
|
384
384
|
]);
|
|
385
|
-
let
|
|
386
|
-
id:
|
|
387
|
-
ref:
|
|
385
|
+
let ee = /* @__PURE__ */ F(M, {
|
|
386
|
+
id: G,
|
|
387
|
+
ref: S,
|
|
388
388
|
value: e.description,
|
|
389
389
|
onChange: (e) => n({ description: e }),
|
|
390
390
|
"aria-required": g || void 0,
|
|
391
|
-
labelProps:
|
|
391
|
+
labelProps: v ? void 0 : {
|
|
392
392
|
label: u.description.label,
|
|
393
393
|
required: g
|
|
394
394
|
},
|
|
395
395
|
placeholder: u.description.placeholder,
|
|
396
|
+
caption: _,
|
|
396
397
|
error: t.description || void 0,
|
|
397
398
|
invalid: !!t.description,
|
|
398
|
-
containerClassName:
|
|
399
|
+
containerClassName: v ? void 0 : d?.field,
|
|
399
400
|
className: r,
|
|
400
401
|
resize: N.Vertical
|
|
401
402
|
});
|
|
@@ -404,7 +405,7 @@ var ve = {
|
|
|
404
405
|
"aria-label": u.ariaLabel,
|
|
405
406
|
className: c("flex flex-col gap-4", d?.root),
|
|
406
407
|
children: [
|
|
407
|
-
|
|
408
|
+
w(U.Avatar) && /* @__PURE__ */ F(we, {
|
|
408
409
|
label: u.iconUrl.label,
|
|
409
410
|
avatarUrl: s,
|
|
410
411
|
addAvatarLabel: u.iconUrl.addAvatarLabel,
|
|
@@ -412,11 +413,11 @@ var ve = {
|
|
|
412
413
|
onAddAvatarClick: l,
|
|
413
414
|
className: d?.field
|
|
414
415
|
}),
|
|
415
|
-
(
|
|
416
|
+
(E || D) && /* @__PURE__ */ I("div", {
|
|
416
417
|
className: c("flex items-start gap-4", d?.field),
|
|
417
|
-
children: [
|
|
418
|
+
children: [E && /* @__PURE__ */ F(T, {
|
|
418
419
|
id: "deployment-creation-form-name",
|
|
419
|
-
inputRef:
|
|
420
|
+
inputRef: b,
|
|
420
421
|
value: e.name,
|
|
421
422
|
onChange: (e) => n({ name: e ?? "" }),
|
|
422
423
|
onBlur: a,
|
|
@@ -429,10 +430,10 @@ var ve = {
|
|
|
429
430
|
caption: h,
|
|
430
431
|
error: t.name || void 0,
|
|
431
432
|
invalid: !!t.name,
|
|
432
|
-
containerClassName:
|
|
433
|
-
}),
|
|
433
|
+
containerClassName: D ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
|
|
434
|
+
}), D && /* @__PURE__ */ F(T, {
|
|
434
435
|
id: "deployment-creation-form-version",
|
|
435
|
-
inputRef:
|
|
436
|
+
inputRef: x,
|
|
436
437
|
value: e.version,
|
|
437
438
|
onChange: (e) => n({ version: e ?? "" }),
|
|
438
439
|
onBlur: o,
|
|
@@ -440,21 +441,21 @@ var ve = {
|
|
|
440
441
|
placeholder: u.version.placeholder,
|
|
441
442
|
error: t.version || void 0,
|
|
442
443
|
invalid: !!t.version,
|
|
443
|
-
containerClassName:
|
|
444
|
+
containerClassName: E ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
|
|
444
445
|
})]
|
|
445
446
|
}),
|
|
446
|
-
|
|
447
|
+
w(U.Description) && (v ? /* @__PURE__ */ F("div", {
|
|
447
448
|
className: d?.field,
|
|
448
|
-
children:
|
|
449
|
-
}) :
|
|
450
|
-
|
|
449
|
+
children: v(ee, G)
|
|
450
|
+
}) : ee),
|
|
451
|
+
w(U.Locales) && /* @__PURE__ */ F(De, {
|
|
451
452
|
value: e.otherLocales,
|
|
452
453
|
onChange: (e) => n({ otherLocales: e }),
|
|
453
454
|
availableLocaleOptions: f,
|
|
454
455
|
labels: u.otherLocales,
|
|
455
456
|
className: d?.field
|
|
456
457
|
}),
|
|
457
|
-
|
|
458
|
+
w(U.Tags) && /* @__PURE__ */ F("div", {
|
|
458
459
|
className: d?.field,
|
|
459
460
|
children: /* @__PURE__ */ F(j, {
|
|
460
461
|
id: "deployment-creation-form-topics",
|
|
@@ -576,36 +577,37 @@ var ve = {
|
|
|
576
577
|
deleteConfirmItemsLabel: "items?",
|
|
577
578
|
deleteConfirmLabel: "Delete",
|
|
578
579
|
deleteCancelLabel: "Cancel"
|
|
579
|
-
}, Ie = fe(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Ee, isNameReadOnly: c, nameCaption: l, isDescriptionRequired: u,
|
|
580
|
-
let [
|
|
581
|
-
let t =
|
|
582
|
-
t && n({ iconUrl: t }),
|
|
583
|
-
}, [n,
|
|
584
|
-
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
580
|
+
}, Ie = fe(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Ee, isNameReadOnly: c, nameCaption: l, isDescriptionRequired: u, descriptionCaption: d, renderDescription: f, focusRequestKey: p, labels: m }) => {
|
|
581
|
+
let [h, g] = H(!1), _ = B(() => a ? s : s.filter((e) => e !== U.Avatar), [a, s]), v = e.iconUrl, y = a?.resolveIconUrl, b = B(() => y ? y(v) : void 0, [v, y]), x = z(() => g(!0), []), S = z(() => g(!1), []), C = a?.resolveAttachedIconUrl, w = z((e) => {
|
|
582
|
+
let t = C?.(e);
|
|
583
|
+
t && n({ iconUrl: t }), g(!1);
|
|
584
|
+
}, [n, C]);
|
|
585
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(ke, {
|
|
585
586
|
values: e,
|
|
586
587
|
errors: t,
|
|
587
588
|
onChange: n,
|
|
588
589
|
onNameBlur: r,
|
|
589
590
|
onVersionBlur: i,
|
|
590
|
-
iconPreviewUrl:
|
|
591
|
-
onAddAvatarClick:
|
|
592
|
-
labels:
|
|
591
|
+
iconPreviewUrl: b,
|
|
592
|
+
onAddAvatarClick: x,
|
|
593
|
+
labels: m?.form ?? Pe,
|
|
593
594
|
availableLocaleOptions: o,
|
|
594
|
-
fields:
|
|
595
|
+
fields: _,
|
|
595
596
|
isNameReadOnly: c,
|
|
596
597
|
nameCaption: l,
|
|
597
598
|
isDescriptionRequired: u,
|
|
598
|
-
|
|
599
|
-
|
|
599
|
+
descriptionCaption: d,
|
|
600
|
+
renderDescription: f,
|
|
601
|
+
focusRequestKey: p
|
|
600
602
|
}), a && /* @__PURE__ */ F(Te, {
|
|
601
|
-
isOpen:
|
|
602
|
-
onClose:
|
|
603
|
-
onAttach:
|
|
603
|
+
isOpen: h,
|
|
604
|
+
onClose: S,
|
|
605
|
+
onAttach: w,
|
|
604
606
|
bucket: a.bucket,
|
|
605
607
|
FileManagerModal: a.FileManagerModal,
|
|
606
608
|
allowedMimeTypes: a.allowedMimeTypes,
|
|
607
609
|
maxFileSizeBytes: a.maxFileSizeBytes,
|
|
608
|
-
labels:
|
|
610
|
+
labels: m?.avatarPicker ?? Fe
|
|
609
611
|
})] });
|
|
610
612
|
}), Le = /* @__PURE__ */ function(e) {
|
|
611
613
|
return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
|
|
@@ -619,7 +621,7 @@ var Re = {
|
|
|
619
621
|
}, K = "SKILL.md", q = /* @__PURE__ */ function(e) {
|
|
620
622
|
return e.File = "file", e.Folder = "folder", e;
|
|
621
623
|
}({}), ze = /* @__PURE__ */ function(e) {
|
|
622
|
-
return e.Header = "header", e.Child = "child", e
|
|
624
|
+
return e.Header = "header", e.Child = "child", e;
|
|
623
625
|
}({}), J = (e) => {
|
|
624
626
|
let t = e.lastIndexOf("/");
|
|
625
627
|
return t === -1 ? null : e.slice(0, t);
|
|
@@ -667,14 +669,13 @@ var Re = {
|
|
|
667
669
|
n ? n.items = [...n.items ?? [], e] : r.push(e);
|
|
668
670
|
}
|
|
669
671
|
return r;
|
|
670
|
-
}, He = (e, t) => e ? `${e}/${t}` : t, Ue = (e
|
|
672
|
+
}, He = (e, t) => e ? `${e}/${t}` : t, Ue = (e, t) => {
|
|
671
673
|
if (!t) return "";
|
|
672
674
|
switch (e) {
|
|
673
675
|
case ze.Child: return t.path;
|
|
674
|
-
case ze.Sibling: return Ue(t.path);
|
|
675
676
|
case ze.Header: return t.kind === q.Folder ? t.path : "";
|
|
676
677
|
}
|
|
677
|
-
},
|
|
678
|
+
}, We = (e, t) => {
|
|
678
679
|
let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
|
|
679
680
|
for (let { path: i } of e) {
|
|
680
681
|
if (!i.startsWith(n) || i === t) continue;
|
|
@@ -682,19 +683,19 @@ var Re = {
|
|
|
682
683
|
r.add(e.split("/")[0]);
|
|
683
684
|
}
|
|
684
685
|
return r;
|
|
685
|
-
},
|
|
686
|
+
}, Ge = (e, t, n) => {
|
|
686
687
|
let r = e.trim();
|
|
687
688
|
if (!r) return n.required;
|
|
688
689
|
if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
|
|
689
690
|
if (t.has(r)) return n.duplicate;
|
|
690
|
-
},
|
|
691
|
-
let [o, s] = H(null), c = o?.parentPath ?? null, l = V([]), u = c == null ? void 0 : He(c,
|
|
691
|
+
}, Ke = "\\new-folder", qe = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
|
|
692
|
+
let [o, s] = H(null), c = o?.parentPath ?? null, l = V([]), u = c == null ? void 0 : He(c, Ke), d = B(() => u == null ? void 0 : {
|
|
692
693
|
path: u,
|
|
693
694
|
name: n,
|
|
694
695
|
kind: q.Folder
|
|
695
696
|
}, [u, n]), f = z((n, i) => {
|
|
696
|
-
let a =
|
|
697
|
-
return i === "" && a.add(K),
|
|
697
|
+
let a = We(e, i);
|
|
698
|
+
return i === "" && a.add(K), Ge(n, a, r) ?? t.validateFolderPath?.(He(i, n.trim()));
|
|
698
699
|
}, [
|
|
699
700
|
e,
|
|
700
701
|
r,
|
|
@@ -742,38 +743,38 @@ var Re = {
|
|
|
742
743
|
handleSave: g,
|
|
743
744
|
handleCancel: h
|
|
744
745
|
};
|
|
745
|
-
},
|
|
746
|
+
}, Je = (e) => !!e.dataTransfer?.types.includes("Files"), Ye = (e) => {
|
|
746
747
|
let [t, n] = H(!1), r = V(0);
|
|
747
748
|
return {
|
|
748
749
|
isDragActive: t,
|
|
749
750
|
dropZoneHandlers: {
|
|
750
751
|
onDragEnter: z((e) => {
|
|
751
|
-
|
|
752
|
+
Je(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
752
753
|
}, []),
|
|
753
754
|
onDragLeave: z((e) => {
|
|
754
|
-
|
|
755
|
+
Je(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
755
756
|
}, []),
|
|
756
757
|
onDragOver: z((e) => {
|
|
757
|
-
|
|
758
|
+
Je(e) && e.preventDefault();
|
|
758
759
|
}, []),
|
|
759
760
|
onDrop: z((t) => {
|
|
760
|
-
if (!
|
|
761
|
+
if (!Je(t)) return;
|
|
761
762
|
t.preventDefault(), r.current = 0, n(!1);
|
|
762
763
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
763
764
|
i.length > 0 && e(i);
|
|
764
765
|
}, [e])
|
|
765
766
|
}
|
|
766
767
|
};
|
|
767
|
-
},
|
|
768
|
+
}, Xe = /* @__PURE__ */ function(e) {
|
|
768
769
|
return e.Files = "files", e.Archive = "archive", e;
|
|
769
770
|
}({}), Y = /* @__PURE__ */ function(e) {
|
|
770
771
|
return e.Mobile = "mobile", e.Desktop = "desktop", e;
|
|
771
|
-
}({}),
|
|
772
|
+
}({}), Ze = (e, t, n = g.MD) => /* @__PURE__ */ F(e, {
|
|
772
773
|
size: n,
|
|
773
774
|
className: t,
|
|
774
775
|
"aria-hidden": !0,
|
|
775
776
|
stroke: _
|
|
776
|
-
}),
|
|
777
|
+
}), Qe = ({ isVisible: e, labels: t }) => {
|
|
777
778
|
if (!e) return null;
|
|
778
779
|
let n = t ?? {};
|
|
779
780
|
return /* @__PURE__ */ F("div", {
|
|
@@ -783,7 +784,7 @@ var Re = {
|
|
|
783
784
|
children: /* @__PURE__ */ I("div", {
|
|
784
785
|
className: "flex flex-col items-center text-center",
|
|
785
786
|
children: [
|
|
786
|
-
/* @__PURE__ */ F(
|
|
787
|
+
/* @__PURE__ */ F(le, {
|
|
787
788
|
size: 100,
|
|
788
789
|
className: "text-accent-primary",
|
|
789
790
|
"aria-hidden": !0,
|
|
@@ -800,16 +801,16 @@ var Re = {
|
|
|
800
801
|
]
|
|
801
802
|
})
|
|
802
803
|
});
|
|
803
|
-
},
|
|
804
|
+
}, $e = /* @__PURE__ */ function(e) {
|
|
804
805
|
return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
|
|
805
|
-
}({}),
|
|
806
|
+
}({}), et = /* @__PURE__ */ function(e) {
|
|
806
807
|
return e.Valid = "valid", e.Invalid = "invalid", e;
|
|
807
|
-
}({}),
|
|
808
|
+
}({}), tt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), nt = ".zip,application/zip", rt = 0, X = () => `skill-file-candidate-${++rt}`, Z = (e, t, n) => ({
|
|
808
809
|
id: X(),
|
|
809
810
|
file: e,
|
|
810
811
|
path: He(n, t.replace(/\\/g, "/"))
|
|
811
|
-
}),
|
|
812
|
-
let l = c ?? {}, [u, d] = H([]), [p, h] = H(/* @__PURE__ */ new Map()), [g, v] = H([]), [y, b] = H(!1), [C, T] = H(), [E, D] = H(!1), [O, A] = H(), [te, j] = H(0), M = V(0), N = r ===
|
|
812
|
+
}), it = ({ isOpen: e, onClose: t, fileActions: n, mode: r = Xe.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: o, labels: c }) => {
|
|
813
|
+
let l = c ?? {}, [u, d] = H([]), [p, h] = H(/* @__PURE__ */ new Map()), [g, v] = H([]), [y, b] = H(!1), [C, T] = H(), [E, D] = H(!1), [O, A] = H(), [te, j] = H(0), M = V(0), N = r === Xe.Archive, L = l.uploadArchiveErrorMessage ?? "Couldn't read this archive", re = me(), ae = (e) => {
|
|
813
814
|
T(void 0), d((t) => [...t, ...e]);
|
|
814
815
|
}, oe = async (e) => {
|
|
815
816
|
let { extractArchive: t } = n;
|
|
@@ -836,12 +837,12 @@ var Re = {
|
|
|
836
837
|
oe(e);
|
|
837
838
|
return;
|
|
838
839
|
}
|
|
839
|
-
ae(e.map((e) => Z(e,
|
|
840
|
-
},
|
|
840
|
+
ae(e.map((e) => Z(e, tt(e), i)));
|
|
841
|
+
}, R = (e) => {
|
|
841
842
|
d((t) => t.filter((t) => t.id !== e));
|
|
842
843
|
};
|
|
843
844
|
pe(() => {
|
|
844
|
-
e && (M.current += 1, d([...(a ?? []).map((e) => Z(e,
|
|
845
|
+
e && (M.current += 1, d([...(a ?? []).map((e) => Z(e, tt(e), i)), ...(o ?? []).map((e) => Z(e.file, e.path, i))]), h(/* @__PURE__ */ new Map()), v([]), T(void 0), A(void 0), j(0));
|
|
845
846
|
}, [e]), pe(() => {
|
|
846
847
|
if (!e) return;
|
|
847
848
|
let t = !1;
|
|
@@ -857,11 +858,11 @@ var Re = {
|
|
|
857
858
|
t = !0;
|
|
858
859
|
};
|
|
859
860
|
}, [u, e]);
|
|
860
|
-
let
|
|
861
|
+
let le = u.some((e) => p.get(e.id)?.status === et.Invalid), ue = u.length > 0 && u.every((e) => p.get(e.id)?.status === et.Invalid), de = u.length > 0 && !le && g.length === 0 && !y && !E && te === 0, fe = async () => {
|
|
861
862
|
D(!0), T(void 0);
|
|
862
863
|
try {
|
|
863
864
|
let { results: e, batchErrors: r } = await n.validateBatch(u), i = new Map(e.map((e) => [e.candidateId, e]));
|
|
864
|
-
if (h(i), v(r.map((e) => e.message)), u.some((e) => i.get(e.id)?.status ===
|
|
865
|
+
if (h(i), v(r.map((e) => e.message)), u.some((e) => i.get(e.id)?.status === et.Invalid) || r.length > 0) return;
|
|
865
866
|
let a = await n.commitBatch(u);
|
|
866
867
|
if (a.error) {
|
|
867
868
|
T(a.error);
|
|
@@ -891,7 +892,7 @@ var Re = {
|
|
|
891
892
|
ariaLabel: ""
|
|
892
893
|
}) : void 0,
|
|
893
894
|
onClick: () => void fe(),
|
|
894
|
-
disabled: !
|
|
895
|
+
disabled: !de
|
|
895
896
|
}],
|
|
896
897
|
children: /* @__PURE__ */ I("div", {
|
|
897
898
|
className: "flex flex-col gap-4 px-6 py-4",
|
|
@@ -906,8 +907,8 @@ var Re = {
|
|
|
906
907
|
})] }),
|
|
907
908
|
ariaLabel: l.uploadDropZoneAriaLabel ?? "Upload files",
|
|
908
909
|
multiple: !0,
|
|
909
|
-
accept: N ?
|
|
910
|
-
className:
|
|
910
|
+
accept: N ? nt : void 0,
|
|
911
|
+
className: ue ? "border-error hover:border-error" : void 0,
|
|
911
912
|
onChange: se,
|
|
912
913
|
onReject: N ? () => A(L) : void 0
|
|
913
914
|
}),
|
|
@@ -927,7 +928,7 @@ var Re = {
|
|
|
927
928
|
u.length > 0 && /* @__PURE__ */ F("ul", {
|
|
928
929
|
className: "flex flex-col gap-2",
|
|
929
930
|
children: u.map((e) => {
|
|
930
|
-
let t = p.get(e.id), n = t?.kind ===
|
|
931
|
+
let t = p.get(e.id), n = t?.kind === $e.Manifest, r = t?.status === et.Invalid;
|
|
931
932
|
return /* @__PURE__ */ I("li", {
|
|
932
933
|
className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
|
|
933
934
|
children: [
|
|
@@ -955,13 +956,13 @@ var Re = {
|
|
|
955
956
|
]
|
|
956
957
|
}),
|
|
957
958
|
/* @__PURE__ */ F(w, {
|
|
958
|
-
icon: /* @__PURE__ */ F(
|
|
959
|
+
icon: /* @__PURE__ */ F(ce, {
|
|
959
960
|
size: 16,
|
|
960
961
|
"aria-hidden": !0,
|
|
961
962
|
stroke: _
|
|
962
963
|
}),
|
|
963
964
|
"aria-label": l.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
|
|
964
|
-
onClick: () =>
|
|
965
|
+
onClick: () => R(e.id)
|
|
965
966
|
})
|
|
966
967
|
]
|
|
967
968
|
}, e.id);
|
|
@@ -971,32 +972,32 @@ var Re = {
|
|
|
971
972
|
]
|
|
972
973
|
})
|
|
973
974
|
});
|
|
974
|
-
},
|
|
975
|
+
}, at = {
|
|
975
976
|
title: "_title_5md1a_1",
|
|
976
977
|
helperText: "_helperText_5md1a_5",
|
|
977
978
|
refineFeedback: "_refineFeedback_5md1a_9",
|
|
978
979
|
refineError: "_refineError_5md1a_13"
|
|
979
|
-
},
|
|
980
|
-
mode:
|
|
980
|
+
}, ot = {
|
|
981
|
+
mode: Xe.Files,
|
|
981
982
|
targetFolderPath: ""
|
|
982
|
-
},
|
|
983
|
+
}, st = [U.Name, U.Description], ct = 24, lt = 300, ut = "desktop:px-8 desktop:py-6", dt = "desktop:px-8 desktop:py-6", ft = "gap-4 px-4 py-6 desktop:gap-5 desktop:px-8 desktop:py-6", pt = de(async () => {
|
|
983
984
|
let { MarkdownEditor: e } = await _e();
|
|
984
985
|
return { default: e };
|
|
985
|
-
}),
|
|
986
|
-
let [W,
|
|
986
|
+
}), mt = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: _, expandedPaths: v, onExpandedPathsChange: S, isLoading: T = !1, hasLoadError: D = !1, isSubmitting: O = !1, errors: k, submitError: ee, conflict: te, onReloadLatest: j, isNameReadOnly: M = !1, onDirtyChange: N, onValuesChange: L, onRefineDescription: ie, onRefineInstructions: se, fileActions: R, supportingFileContent: de, asideData: fe, onSubmit: _e, onCancel: ve, onBack: ye, backAriaLabel: be, title: xe, onRetry: Se, onRetrySubmit: Ce, labels: we, styles: Te, dir: U, instructionsEditorTheme: Ee = y.light }) => {
|
|
987
|
+
let [W, De] = H({
|
|
987
988
|
name: r?.name ?? "",
|
|
988
989
|
description: r?.description ?? "",
|
|
989
990
|
instructions: r?.instructions ?? ""
|
|
990
|
-
}),
|
|
991
|
-
bottomGap:
|
|
992
|
-
minHeight:
|
|
993
|
-
}),
|
|
991
|
+
}), Oe = me(), G = V(void 0), ke = l({
|
|
992
|
+
bottomGap: ct,
|
|
993
|
+
minHeight: lt
|
|
994
|
+
}), Ae = V(W), je = (e) => {
|
|
994
995
|
let t = {
|
|
995
|
-
...
|
|
996
|
+
...Ae.current,
|
|
996
997
|
...e
|
|
997
998
|
};
|
|
998
|
-
|
|
999
|
-
},
|
|
999
|
+
Ae.current = t, De(t), L?.(t);
|
|
1000
|
+
}, Me = (e) => e ? async (t, n) => {
|
|
1000
1001
|
if (G.current && !G.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
1001
1002
|
G.current = n;
|
|
1002
1003
|
try {
|
|
@@ -1004,79 +1005,79 @@ var Re = {
|
|
|
1004
1005
|
} finally {
|
|
1005
1006
|
G.current === n && (G.current = void 0);
|
|
1006
1007
|
}
|
|
1007
|
-
} : void 0,
|
|
1008
|
+
} : void 0, Fe = u({
|
|
1008
1009
|
value: W.description,
|
|
1009
|
-
onChange: (e) =>
|
|
1010
|
-
onRefine:
|
|
1010
|
+
onChange: (e) => je({ description: e }),
|
|
1011
|
+
onRefine: Me(ie),
|
|
1011
1012
|
disabled: O || T || D,
|
|
1012
1013
|
resetKey: r
|
|
1013
|
-
}),
|
|
1014
|
+
}), Le = u({
|
|
1014
1015
|
value: W.instructions,
|
|
1015
|
-
onChange: (e) =>
|
|
1016
|
-
onRefine:
|
|
1016
|
+
onChange: (e) => je({ instructions: e }),
|
|
1017
|
+
onRefine: Me(se),
|
|
1017
1018
|
disabled: O || T || D,
|
|
1018
1019
|
resetKey: r
|
|
1019
|
-
}),
|
|
1020
|
-
|
|
1021
|
-
},
|
|
1022
|
-
|
|
1020
|
+
}), J = Fe.isPending || Le.isPending, Be = () => {
|
|
1021
|
+
Fe.reset(), Le.reset();
|
|
1022
|
+
}, He = () => {
|
|
1023
|
+
Be(), ve();
|
|
1024
|
+
}, We = () => {
|
|
1025
|
+
Be(), ye();
|
|
1023
1026
|
}, Ge = () => {
|
|
1024
|
-
|
|
1025
|
-
}, Ke = ()
|
|
1026
|
-
O || T || D || G.current && !G.current.aborted || ve(W);
|
|
1027
|
-
}, qe = V(r), Ye = qe.current !== r, et = V(i);
|
|
1027
|
+
O || T || D || G.current && !G.current.aborted || _e(W);
|
|
1028
|
+
}, Ke = V(r), Je = Ke.current !== r, $e = V(i);
|
|
1028
1029
|
pe(() => {
|
|
1029
|
-
|
|
1030
|
+
Ke.current = r;
|
|
1030
1031
|
let e = {
|
|
1031
1032
|
name: r?.name ?? "",
|
|
1032
1033
|
description: r?.description ?? "",
|
|
1033
1034
|
instructions: r?.instructions ?? ""
|
|
1034
1035
|
};
|
|
1035
|
-
|
|
1036
|
+
Ae.current = e, De(e), $e.current = i;
|
|
1036
1037
|
}, [r]);
|
|
1037
|
-
let
|
|
1038
|
+
let et = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), tt = V(!1);
|
|
1038
1039
|
pe(() => {
|
|
1039
|
-
if (
|
|
1040
|
+
if (Je) return;
|
|
1040
1041
|
let e = {
|
|
1041
1042
|
name: r?.name ?? "",
|
|
1042
1043
|
description: r?.description ?? "",
|
|
1043
1044
|
instructions: r?.instructions ?? ""
|
|
1044
|
-
}, t = JSON.stringify(W) !== JSON.stringify(e) ||
|
|
1045
|
-
t !==
|
|
1045
|
+
}, t = JSON.stringify(W) !== JSON.stringify(e) || et(i) !== et($e.current);
|
|
1046
|
+
t !== tt.current && (tt.current = t, N?.(t));
|
|
1046
1047
|
}, [
|
|
1047
1048
|
W,
|
|
1048
1049
|
i,
|
|
1049
1050
|
r,
|
|
1050
|
-
|
|
1051
|
+
Je,
|
|
1051
1052
|
N
|
|
1052
1053
|
]);
|
|
1053
|
-
let [
|
|
1054
|
-
|
|
1055
|
-
}, [
|
|
1054
|
+
let [nt, rt] = H(K), X = s ?? nt, Z = z((e) => {
|
|
1055
|
+
rt(e), _?.(e);
|
|
1056
|
+
}, [_]), [mt, ht] = H([]), gt = v ?? mt, _t = B(() => new Set(gt), [gt]), vt = z((e) => {
|
|
1056
1057
|
let t = [...e];
|
|
1057
|
-
|
|
1058
|
-
}, [
|
|
1059
|
-
|
|
1060
|
-
}, []), [
|
|
1061
|
-
|
|
1062
|
-
...
|
|
1058
|
+
ht(t), S?.(t);
|
|
1059
|
+
}, [S]), [yt, bt] = H(!1), [xt, St] = H(ot), Ct = z((e) => {
|
|
1060
|
+
St(e), bt(!0);
|
|
1061
|
+
}, []), [wt, Tt] = H(!1), { isDragActive: Et, dropZoneHandlers: Dt } = Ye(z((e) => {
|
|
1062
|
+
yt || Ct({
|
|
1063
|
+
...ot,
|
|
1063
1064
|
initialFiles: e
|
|
1064
1065
|
});
|
|
1065
|
-
}, [
|
|
1066
|
+
}, [yt, Ct])), Q = we ?? {}, $ = Te?.colors, Ot = Te?.typography ?? {}, kt = Ot.titleClassName ?? "dial-body-semi-text", At = Ot.helperTextClassName ?? "dial-tiny-semi-text", jt = Ot.removeIconClassName, Mt = Ot.menuIconClassName ?? "text-secondary", Nt = o({
|
|
1066
1067
|
"--se-title-color": $?.title,
|
|
1067
1068
|
"--se-helper-text-color": $?.helperText,
|
|
1068
1069
|
"--se-refine-action-text": $?.refineActionText,
|
|
1069
1070
|
"--se-refine-error-text": $?.refineErrorText
|
|
1070
|
-
}),
|
|
1071
|
-
feedbackClassName: c($?.refineActionText &&
|
|
1072
|
-
errorClassName:
|
|
1073
|
-
},
|
|
1071
|
+
}), Pt = {
|
|
1072
|
+
feedbackClassName: c($?.refineActionText && at.refineFeedback, Ot.refineFeedbackClassName, Re.refineFeedback),
|
|
1073
|
+
errorClassName: at.refineError
|
|
1074
|
+
}, Ft = {
|
|
1074
1075
|
layout: $?.border ? { colors: {
|
|
1075
1076
|
headerBorderColor: $.border,
|
|
1076
1077
|
sidebarBorderColor: $.border
|
|
1077
1078
|
} } : void 0,
|
|
1078
1079
|
section: $?.title ? { colors: { titleColor: $.title } } : void 0
|
|
1079
|
-
},
|
|
1080
|
+
}, It = B(() => ({
|
|
1080
1081
|
required: Q.folderNameRequiredError ?? "Enter a folder name",
|
|
1081
1082
|
invalid: Q.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
|
|
1082
1083
|
duplicate: Q.folderNameDuplicateError ?? "An item with this name already exists here"
|
|
@@ -1084,161 +1085,160 @@ var Re = {
|
|
|
1084
1085
|
Q.folderNameRequiredError,
|
|
1085
1086
|
Q.folderNameInvalidError,
|
|
1086
1087
|
Q.folderNameDuplicateError
|
|
1087
|
-
]),
|
|
1088
|
-
|
|
1089
|
-
}, [
|
|
1088
|
+
]), Lt = z((e) => {
|
|
1089
|
+
_t.has(e) || vt(new Set([..._t, e]));
|
|
1090
|
+
}, [_t, vt]), Rt = qe({
|
|
1090
1091
|
files: i,
|
|
1091
1092
|
fileActions: R,
|
|
1092
1093
|
defaultName: Q.newFolderDefaultName ?? "New folder",
|
|
1093
|
-
messages:
|
|
1094
|
-
onRevealFolder:
|
|
1094
|
+
messages: It,
|
|
1095
|
+
onRevealFolder: Lt,
|
|
1095
1096
|
onCreated: Z
|
|
1096
|
-
}), { draftNode:
|
|
1097
|
+
}), { draftNode: zt, draftPath: Bt, draftPane: Vt } = Rt, Ht = B(() => Ve([{
|
|
1097
1098
|
path: K,
|
|
1098
1099
|
name: K,
|
|
1099
1100
|
kind: q.File
|
|
1100
|
-
}, ...i]), [i]),
|
|
1101
|
+
}, ...i]), [i]), Ut = B(() => zt ? Ve([
|
|
1101
1102
|
{
|
|
1102
1103
|
path: K,
|
|
1103
1104
|
name: K,
|
|
1104
1105
|
kind: q.File
|
|
1105
1106
|
},
|
|
1106
1107
|
...i,
|
|
1107
|
-
|
|
1108
|
-
]) :
|
|
1108
|
+
zt
|
|
1109
|
+
]) : Ht, [
|
|
1109
1110
|
i,
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
]),
|
|
1113
|
-
e.path !==
|
|
1114
|
-
}, [Z,
|
|
1111
|
+
zt,
|
|
1112
|
+
Ht
|
|
1113
|
+
]), Wt = B(() => i.find((e) => e.path === X), [i, X]), Gt = z((e) => {
|
|
1114
|
+
e.path !== Bt && Z(e.path);
|
|
1115
|
+
}, [Z, Bt]), Kt = z((e) => {
|
|
1115
1116
|
R.onRemoveNode(e), X === e && Z(K);
|
|
1116
1117
|
}, [
|
|
1117
1118
|
R,
|
|
1118
1119
|
X,
|
|
1119
1120
|
Z
|
|
1120
|
-
]), { startDraft:
|
|
1121
|
-
if (!
|
|
1122
|
-
let t = await
|
|
1123
|
-
t?.length &&
|
|
1124
|
-
mode:
|
|
1121
|
+
]), { startDraft: qt } = Rt, { onCreateFolder: Jt, extractArchive: Yt, pickFromFileSystem: Xt } = R, Zt = z(async (e) => {
|
|
1122
|
+
if (!Xt) return;
|
|
1123
|
+
let t = await Xt();
|
|
1124
|
+
t?.length && Ct({
|
|
1125
|
+
mode: Xe.Files,
|
|
1125
1126
|
targetFolderPath: e,
|
|
1126
1127
|
initialEntries: t
|
|
1127
1128
|
});
|
|
1128
|
-
}, [
|
|
1129
|
-
let n = (e) =>
|
|
1130
|
-
return
|
|
1129
|
+
}, [Xt, Ct]), Qt = z((e, t) => {
|
|
1130
|
+
let n = (e) => Ze(e, Mt), r = [];
|
|
1131
|
+
return Jt && r.push({
|
|
1131
1132
|
key: "create-folder",
|
|
1132
1133
|
label: Q.createFolderLabel ?? "Create folder",
|
|
1133
1134
|
icon: n(oe),
|
|
1134
|
-
onClick: () =>
|
|
1135
|
+
onClick: () => qt(e, t)
|
|
1135
1136
|
}), r.push({
|
|
1136
1137
|
key: "upload-files",
|
|
1137
1138
|
label: Q.uploadFilesLabel ?? "Upload files from device",
|
|
1138
|
-
icon: n(
|
|
1139
|
-
onClick: () =>
|
|
1140
|
-
mode:
|
|
1139
|
+
icon: n(le),
|
|
1140
|
+
onClick: () => Ct({
|
|
1141
|
+
mode: Xe.Files,
|
|
1141
1142
|
targetFolderPath: e
|
|
1142
1143
|
})
|
|
1143
|
-
}),
|
|
1144
|
+
}), Yt && r.push({
|
|
1144
1145
|
key: "upload-archive",
|
|
1145
1146
|
label: Q.uploadArchiveLabel ?? "Upload archive from device",
|
|
1146
1147
|
icon: n(ae),
|
|
1147
|
-
onClick: () =>
|
|
1148
|
-
mode:
|
|
1148
|
+
onClick: () => Ct({
|
|
1149
|
+
mode: Xe.Archive,
|
|
1149
1150
|
targetFolderPath: e
|
|
1150
1151
|
})
|
|
1151
|
-
}),
|
|
1152
|
+
}), Xt && r.push({
|
|
1152
1153
|
key: "open-file-system",
|
|
1153
1154
|
label: Q.openFileSystemLabel ?? "Open DIAL file system",
|
|
1154
1155
|
icon: n(re),
|
|
1155
|
-
onClick: () => void
|
|
1156
|
+
onClick: () => void Zt(e)
|
|
1156
1157
|
}), r;
|
|
1157
1158
|
}, [
|
|
1158
|
-
|
|
1159
|
+
Mt,
|
|
1160
|
+
Jt,
|
|
1159
1161
|
Yt,
|
|
1160
1162
|
Xt,
|
|
1161
|
-
Zt,
|
|
1162
1163
|
Q.createFolderLabel,
|
|
1163
1164
|
Q.uploadFilesLabel,
|
|
1164
1165
|
Q.uploadArchiveLabel,
|
|
1165
1166
|
Q.openFileSystemLabel,
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
]),
|
|
1170
|
-
let e =
|
|
1167
|
+
qt,
|
|
1168
|
+
Ct,
|
|
1169
|
+
Zt
|
|
1170
|
+
]), $t = B(() => {
|
|
1171
|
+
let e = Ue(ze.Header, i.find((e) => e.path === X));
|
|
1171
1172
|
return {
|
|
1172
|
-
[Y.Mobile]:
|
|
1173
|
-
[Y.Desktop]:
|
|
1173
|
+
[Y.Mobile]: Qt(e, Y.Mobile),
|
|
1174
|
+
[Y.Desktop]: Qt(e, Y.Desktop)
|
|
1174
1175
|
};
|
|
1175
1176
|
}, [
|
|
1176
|
-
|
|
1177
|
+
Qt,
|
|
1177
1178
|
i,
|
|
1178
1179
|
X
|
|
1179
|
-
]),
|
|
1180
|
-
if (e.path ===
|
|
1180
|
+
]), en = z((e, t) => {
|
|
1181
|
+
if (e.path === Bt || e.nodeType !== he.FOLDER) return [];
|
|
1181
1182
|
let n = {
|
|
1182
1183
|
path: e.path,
|
|
1183
1184
|
name: e.name,
|
|
1184
|
-
kind:
|
|
1185
|
-
}, r =
|
|
1185
|
+
kind: q.Folder
|
|
1186
|
+
}, r = Qt(Ue(ze.Child, n), t);
|
|
1186
1187
|
return r.push({
|
|
1187
|
-
key: "add-sibling",
|
|
1188
|
-
icon: Qe(ce),
|
|
1189
|
-
label: Q.addSiblingLabel ?? "Add sibling",
|
|
1190
|
-
children: $t(We(ze.Sibling, n), t)
|
|
1191
|
-
}, {
|
|
1192
1188
|
key: "delete",
|
|
1193
1189
|
label: Q.deleteLabel ?? "Delete",
|
|
1194
1190
|
danger: !0,
|
|
1195
|
-
icon:
|
|
1196
|
-
onClick: () =>
|
|
1191
|
+
icon: Ze(ce, jt),
|
|
1192
|
+
onClick: () => Kt(e.path)
|
|
1197
1193
|
}), r;
|
|
1198
1194
|
}, [
|
|
1199
|
-
|
|
1200
|
-
Q.addSiblingLabel,
|
|
1195
|
+
Bt,
|
|
1201
1196
|
Q.deleteLabel,
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
]),
|
|
1206
|
-
[Y.Mobile]: (e) =>
|
|
1207
|
-
[Y.Desktop]: (e) =>
|
|
1208
|
-
}), [
|
|
1197
|
+
jt,
|
|
1198
|
+
Qt,
|
|
1199
|
+
Kt
|
|
1200
|
+
]), tn = B(() => ({
|
|
1201
|
+
[Y.Mobile]: (e) => en(e, Y.Mobile),
|
|
1202
|
+
[Y.Desktop]: (e) => en(e, Y.Desktop)
|
|
1203
|
+
}), [en]), nn = z((e) => e.nodeType === he.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ F(w, {
|
|
1204
|
+
size: b.Small,
|
|
1205
|
+
icon: Ze(ce, jt, g.SM),
|
|
1206
|
+
"aria-label": Q.deleteLabel ?? "Delete",
|
|
1207
|
+
onClick: () => Kt(e.path)
|
|
1208
|
+
}), [
|
|
1209
|
+
Q.deleteLabel,
|
|
1210
|
+
jt,
|
|
1211
|
+
Kt
|
|
1212
|
+
]), rn = (e) => /* @__PURE__ */ I("div", {
|
|
1209
1213
|
className: "flex flex-col gap-2 desktop:gap-5",
|
|
1210
1214
|
children: [/* @__PURE__ */ I("div", {
|
|
1211
1215
|
className: "flex items-center justify-between",
|
|
1212
1216
|
children: [/* @__PURE__ */ F("span", {
|
|
1213
|
-
className: c(
|
|
1217
|
+
className: c(at.title, kt),
|
|
1214
1218
|
children: Q.filesHeading ?? "Files"
|
|
1215
1219
|
}), /* @__PURE__ */ F(p, {
|
|
1216
1220
|
label: Q.addLabel ?? "Add",
|
|
1217
1221
|
variant: m.Neutral,
|
|
1218
1222
|
appearance: f.Solid,
|
|
1219
1223
|
size: b.Small,
|
|
1220
|
-
|
|
1221
|
-
size: g.SM,
|
|
1222
|
-
"aria-hidden": !0,
|
|
1223
|
-
stroke: _
|
|
1224
|
-
}),
|
|
1225
|
-
items: en[e]
|
|
1224
|
+
items: $t[e]
|
|
1226
1225
|
})]
|
|
1227
1226
|
}), /* @__PURE__ */ F("div", {
|
|
1228
1227
|
role: "tree",
|
|
1229
1228
|
"aria-label": Q.filesTreeAriaLabel ?? "Skill files",
|
|
1230
1229
|
children: /* @__PURE__ */ F(ge, {
|
|
1231
|
-
items:
|
|
1230
|
+
items: Vt === e ? Ut : Ht,
|
|
1232
1231
|
showFiles: !0,
|
|
1233
1232
|
selectedPath: X,
|
|
1234
|
-
expandedPaths:
|
|
1235
|
-
onExpandedPathsChange:
|
|
1236
|
-
onItemClick:
|
|
1237
|
-
getContextMenuItems:
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1233
|
+
expandedPaths: _t,
|
|
1234
|
+
onExpandedPathsChange: vt,
|
|
1235
|
+
onItemClick: Gt,
|
|
1236
|
+
getContextMenuItems: tn[e],
|
|
1237
|
+
renderItemActions: nn,
|
|
1238
|
+
renamedPath: Vt === e ? Bt : void 0,
|
|
1239
|
+
onRenameSave: Rt.handleSave,
|
|
1240
|
+
onRenameCancel: Rt.handleCancel,
|
|
1241
|
+
onRenameValidate: Rt.handleValidate,
|
|
1242
1242
|
rootItemPath: ""
|
|
1243
1243
|
})
|
|
1244
1244
|
})]
|
|
@@ -1269,34 +1269,34 @@ var Re = {
|
|
|
1269
1269
|
Q.descriptionLabel,
|
|
1270
1270
|
Q.descriptionPlaceholder
|
|
1271
1271
|
]), cn = (e) => {
|
|
1272
|
-
e.name !== void 0 &&
|
|
1272
|
+
e.name !== void 0 && je({ name: e.name }), e.description !== void 0 && (Fe.reset(), je({ description: e.description }));
|
|
1273
1273
|
}, ln = ie ? (e, t) => /* @__PURE__ */ F(a, {
|
|
1274
1274
|
isEnabled: !0,
|
|
1275
1275
|
fieldId: t,
|
|
1276
1276
|
required: !0,
|
|
1277
1277
|
label: Q.descriptionLabel ?? "Description",
|
|
1278
1278
|
labels: Q,
|
|
1279
|
-
refinement:
|
|
1280
|
-
disabled:
|
|
1281
|
-
...
|
|
1279
|
+
refinement: Fe,
|
|
1280
|
+
disabled: J || O,
|
|
1281
|
+
...Pt,
|
|
1282
1282
|
children: e
|
|
1283
1283
|
}) : void 0, un = {
|
|
1284
|
-
title:
|
|
1285
|
-
onBack:
|
|
1286
|
-
onCancel:
|
|
1287
|
-
onSubmit:
|
|
1284
|
+
title: xe,
|
|
1285
|
+
onBack: We,
|
|
1286
|
+
onCancel: He,
|
|
1287
|
+
onSubmit: Ge,
|
|
1288
1288
|
submitLabel: Q.createLabel ?? "Create",
|
|
1289
|
-
isSubmitDisabled:
|
|
1289
|
+
isSubmitDisabled: J || T || D,
|
|
1290
1290
|
labels: {
|
|
1291
1291
|
cancelLabel: Q.cancelLabel ?? "Cancel",
|
|
1292
|
-
backAriaLabel:
|
|
1292
|
+
backAriaLabel: be ?? "Back",
|
|
1293
1293
|
savingStatusLabel: Q.savingStatusLabel ?? "Saving"
|
|
1294
1294
|
},
|
|
1295
|
-
styles:
|
|
1295
|
+
styles: Ft,
|
|
1296
1296
|
metadataTitle: null
|
|
1297
1297
|
};
|
|
1298
1298
|
if (T) return /* @__PURE__ */ F("div", {
|
|
1299
|
-
dir:
|
|
1299
|
+
dir: U,
|
|
1300
1300
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1301
1301
|
children: /* @__PURE__ */ F(Ne, {
|
|
1302
1302
|
...un,
|
|
@@ -1309,7 +1309,7 @@ var Re = {
|
|
|
1309
1309
|
})
|
|
1310
1310
|
});
|
|
1311
1311
|
if (D) return /* @__PURE__ */ F("div", {
|
|
1312
|
-
dir:
|
|
1312
|
+
dir: U,
|
|
1313
1313
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1314
1314
|
children: /* @__PURE__ */ F(Ne, {
|
|
1315
1315
|
...un,
|
|
@@ -1318,18 +1318,18 @@ var Re = {
|
|
|
1318
1318
|
className: "flex flex-col items-center gap-4 p-8",
|
|
1319
1319
|
children: [/* @__PURE__ */ F(x, { text: Q.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ F(A, {
|
|
1320
1320
|
label: Q.retryLabel ?? "Retry",
|
|
1321
|
-
onClick:
|
|
1321
|
+
onClick: Se
|
|
1322
1322
|
})]
|
|
1323
1323
|
})
|
|
1324
1324
|
})
|
|
1325
1325
|
});
|
|
1326
|
-
let dn = X === K, fn = dn ? K : Q.selectedFileHeading?.(
|
|
1326
|
+
let dn = X === K, fn = dn ? K : Q.selectedFileHeading?.(Wt?.name ?? X) ?? Wt?.name ?? X, pn = ee != null || te != null ? /* @__PURE__ */ I("div", {
|
|
1327
1327
|
className: "flex flex-col gap-2",
|
|
1328
1328
|
children: [ee != null && /* @__PURE__ */ I("div", {
|
|
1329
1329
|
className: "flex items-center gap-2",
|
|
1330
|
-
children: [/* @__PURE__ */ F(x, { text: ee }),
|
|
1330
|
+
children: [/* @__PURE__ */ F(x, { text: ee }), Ce != null && /* @__PURE__ */ F(C, {
|
|
1331
1331
|
label: Q.retryLabel ?? "Retry",
|
|
1332
|
-
onClick:
|
|
1332
|
+
onClick: Ce
|
|
1333
1333
|
})]
|
|
1334
1334
|
}), te != null && /* @__PURE__ */ I("div", {
|
|
1335
1335
|
className: "flex items-center gap-2",
|
|
@@ -1340,36 +1340,36 @@ var Re = {
|
|
|
1340
1340
|
})]
|
|
1341
1341
|
}) : void 0, mn = /* @__PURE__ */ F(a, {
|
|
1342
1342
|
isEnabled: !!se,
|
|
1343
|
-
fieldId:
|
|
1343
|
+
fieldId: Oe,
|
|
1344
1344
|
required: !0,
|
|
1345
|
-
labelClassName: c(
|
|
1345
|
+
labelClassName: c(at.helperText, At),
|
|
1346
1346
|
label: Q.instructionsLabel ?? "Instructions",
|
|
1347
1347
|
labels: Q,
|
|
1348
|
-
refinement:
|
|
1349
|
-
disabled:
|
|
1350
|
-
...
|
|
1348
|
+
refinement: Le,
|
|
1349
|
+
disabled: J || O,
|
|
1350
|
+
...Pt,
|
|
1351
1351
|
children: /* @__PURE__ */ I("div", {
|
|
1352
1352
|
className: "flex flex-1 flex-col gap-2",
|
|
1353
1353
|
children: [
|
|
1354
1354
|
!se && /* @__PURE__ */ F(E, {
|
|
1355
|
-
htmlFor:
|
|
1356
|
-
className: c(
|
|
1355
|
+
htmlFor: Oe,
|
|
1356
|
+
className: c(at.helperText, At),
|
|
1357
1357
|
label: Q.instructionsLabel ?? "Instructions",
|
|
1358
1358
|
required: !0
|
|
1359
1359
|
}),
|
|
1360
1360
|
/* @__PURE__ */ F("div", {
|
|
1361
|
-
ref:
|
|
1361
|
+
ref: ke,
|
|
1362
1362
|
className: c(t, e, n),
|
|
1363
|
-
children: /* @__PURE__ */ F(
|
|
1363
|
+
children: /* @__PURE__ */ F(ue, {
|
|
1364
1364
|
fallback: /* @__PURE__ */ F(ne, { ariaLabel: Q.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
1365
|
-
children: /* @__PURE__ */ F(
|
|
1366
|
-
id:
|
|
1365
|
+
children: /* @__PURE__ */ F(pt, {
|
|
1366
|
+
id: Oe,
|
|
1367
1367
|
ariaLabel: Q.instructionsLabel ?? "Instructions",
|
|
1368
1368
|
value: W.instructions,
|
|
1369
1369
|
onChange: (e) => {
|
|
1370
|
-
|
|
1370
|
+
Le.reset(), je({ instructions: e });
|
|
1371
1371
|
},
|
|
1372
|
-
theme:
|
|
1372
|
+
theme: Ee,
|
|
1373
1373
|
showDragbar: !1,
|
|
1374
1374
|
placeholder: Q.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
|
|
1375
1375
|
})
|
|
@@ -1380,28 +1380,28 @@ var Re = {
|
|
|
1380
1380
|
})
|
|
1381
1381
|
});
|
|
1382
1382
|
return /* @__PURE__ */ I("div", {
|
|
1383
|
-
dir:
|
|
1383
|
+
dir: U,
|
|
1384
1384
|
className: c("relative flex min-h-0 flex-1 flex-col", Re.root),
|
|
1385
|
-
style:
|
|
1386
|
-
...
|
|
1385
|
+
style: Nt,
|
|
1386
|
+
...Dt,
|
|
1387
1387
|
children: [
|
|
1388
|
-
/* @__PURE__ */ F(
|
|
1389
|
-
isVisible:
|
|
1390
|
-
labels:
|
|
1388
|
+
/* @__PURE__ */ F(Qe, {
|
|
1389
|
+
isVisible: Et && !yt,
|
|
1390
|
+
labels: we
|
|
1391
1391
|
}),
|
|
1392
1392
|
/* @__PURE__ */ F(Ne, {
|
|
1393
1393
|
...un,
|
|
1394
|
-
asideData:
|
|
1395
|
-
asideSectionClassName:
|
|
1394
|
+
asideData: fe,
|
|
1395
|
+
asideSectionClassName: dt,
|
|
1396
1396
|
isSubmitting: O,
|
|
1397
|
-
metadataSectionClassName:
|
|
1397
|
+
metadataSectionClassName: ut,
|
|
1398
1398
|
metadata: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
|
|
1399
1399
|
className: "desktop:hidden",
|
|
1400
1400
|
children: /* @__PURE__ */ F(d, {
|
|
1401
1401
|
title: Q.editingFileLabel ?? "Editing file",
|
|
1402
|
-
description:
|
|
1403
|
-
expanded:
|
|
1404
|
-
onToggle:
|
|
1402
|
+
description: Wt?.name ?? "SKILL.md",
|
|
1403
|
+
expanded: wt,
|
|
1404
|
+
onToggle: Tt,
|
|
1405
1405
|
ariaLabel: Q.editingFileLabel ?? "Editing file",
|
|
1406
1406
|
children: rn(Y.Mobile)
|
|
1407
1407
|
})
|
|
@@ -1411,34 +1411,34 @@ var Re = {
|
|
|
1411
1411
|
})] }),
|
|
1412
1412
|
alert: pn,
|
|
1413
1413
|
setupTitle: fn,
|
|
1414
|
-
setupSectionClassName:
|
|
1414
|
+
setupSectionClassName: ft,
|
|
1415
1415
|
setup: dn ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Ie, {
|
|
1416
1416
|
values: an,
|
|
1417
1417
|
errors: on,
|
|
1418
1418
|
onChange: cn,
|
|
1419
|
-
fields:
|
|
1419
|
+
fields: st,
|
|
1420
1420
|
isDescriptionRequired: !0,
|
|
1421
1421
|
isNameReadOnly: M,
|
|
1422
1422
|
nameCaption: k?.name ? void 0 : Q.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
|
|
1423
1423
|
renderDescription: ln,
|
|
1424
1424
|
labels: sn
|
|
1425
|
-
}), mn] }) : /* @__PURE__ */ F(P, { children:
|
|
1425
|
+
}), mn] }) : /* @__PURE__ */ F(P, { children: Wt?.kind === q.File && /* @__PURE__ */ F("div", {
|
|
1426
1426
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1427
|
-
children:
|
|
1427
|
+
children: de ?? /* @__PURE__ */ F(h, { text: Q.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." })
|
|
1428
1428
|
}) })
|
|
1429
1429
|
}),
|
|
1430
|
-
/* @__PURE__ */ F(
|
|
1431
|
-
isOpen:
|
|
1432
|
-
onClose: () =>
|
|
1430
|
+
/* @__PURE__ */ F(it, {
|
|
1431
|
+
isOpen: yt,
|
|
1432
|
+
onClose: () => bt(!1),
|
|
1433
1433
|
fileActions: R,
|
|
1434
|
-
mode:
|
|
1435
|
-
targetFolderPath:
|
|
1436
|
-
initialFiles:
|
|
1437
|
-
initialEntries:
|
|
1438
|
-
labels:
|
|
1434
|
+
mode: xt.mode,
|
|
1435
|
+
targetFolderPath: xt.targetFolderPath,
|
|
1436
|
+
initialFiles: xt.initialFiles,
|
|
1437
|
+
initialEntries: xt.initialEntries,
|
|
1438
|
+
labels: we
|
|
1439
1439
|
})
|
|
1440
1440
|
]
|
|
1441
1441
|
});
|
|
1442
1442
|
};
|
|
1443
1443
|
//#endregion
|
|
1444
|
-
export { Re as SKILL_EDITOR_CLASS,
|
|
1444
|
+
export { Re as SKILL_EDITOR_CLASS, mt as SkillEditor, $e as SkillFileCandidateKind, q as SkillFileNodeKind, Xe as SkillFileUploadMode, et as SkillFileValidationStatus };
|