@epam/ai-dial-skill-editor 1.3.0-dev.13 → 1.3.0-dev.130
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 +287 -304
- 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,35 @@ 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
|
-
|
|
374
|
-
v !== O.current && (O.current = v, e());
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
D && !S.current && e(), S.current = D;
|
|
373
|
+
y === void 0 ? (O && !C.current && e(), C.current = O) : y !== k.current && (k.current = y, e());
|
|
378
374
|
}, [
|
|
379
|
-
|
|
380
|
-
|
|
375
|
+
y,
|
|
376
|
+
O,
|
|
381
377
|
t.name,
|
|
382
378
|
t.version,
|
|
383
379
|
t.description
|
|
384
380
|
]);
|
|
385
|
-
let
|
|
386
|
-
id:
|
|
387
|
-
ref:
|
|
381
|
+
let ee = /* @__PURE__ */ F(M, {
|
|
382
|
+
id: G,
|
|
383
|
+
ref: S,
|
|
388
384
|
value: e.description,
|
|
389
385
|
onChange: (e) => n({ description: e }),
|
|
390
386
|
"aria-required": g || void 0,
|
|
391
|
-
labelProps:
|
|
387
|
+
labelProps: v ? void 0 : {
|
|
392
388
|
label: u.description.label,
|
|
393
389
|
required: g
|
|
394
390
|
},
|
|
395
391
|
placeholder: u.description.placeholder,
|
|
392
|
+
caption: _,
|
|
396
393
|
error: t.description || void 0,
|
|
397
394
|
invalid: !!t.description,
|
|
398
|
-
containerClassName:
|
|
395
|
+
containerClassName: v ? void 0 : d?.field,
|
|
399
396
|
className: r,
|
|
400
397
|
resize: N.Vertical
|
|
401
398
|
});
|
|
@@ -404,7 +401,7 @@ var ve = {
|
|
|
404
401
|
"aria-label": u.ariaLabel,
|
|
405
402
|
className: c("flex flex-col gap-4", d?.root),
|
|
406
403
|
children: [
|
|
407
|
-
|
|
404
|
+
w(U.Avatar) && /* @__PURE__ */ F(we, {
|
|
408
405
|
label: u.iconUrl.label,
|
|
409
406
|
avatarUrl: s,
|
|
410
407
|
addAvatarLabel: u.iconUrl.addAvatarLabel,
|
|
@@ -412,11 +409,11 @@ var ve = {
|
|
|
412
409
|
onAddAvatarClick: l,
|
|
413
410
|
className: d?.field
|
|
414
411
|
}),
|
|
415
|
-
(
|
|
412
|
+
(E || D) && /* @__PURE__ */ I("div", {
|
|
416
413
|
className: c("flex items-start gap-4", d?.field),
|
|
417
|
-
children: [
|
|
414
|
+
children: [E && /* @__PURE__ */ F(T, {
|
|
418
415
|
id: "deployment-creation-form-name",
|
|
419
|
-
inputRef:
|
|
416
|
+
inputRef: b,
|
|
420
417
|
value: e.name,
|
|
421
418
|
onChange: (e) => n({ name: e ?? "" }),
|
|
422
419
|
onBlur: a,
|
|
@@ -429,10 +426,10 @@ var ve = {
|
|
|
429
426
|
caption: h,
|
|
430
427
|
error: t.name || void 0,
|
|
431
428
|
invalid: !!t.name,
|
|
432
|
-
containerClassName:
|
|
433
|
-
}),
|
|
429
|
+
containerClassName: D ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
|
|
430
|
+
}), D && /* @__PURE__ */ F(T, {
|
|
434
431
|
id: "deployment-creation-form-version",
|
|
435
|
-
inputRef:
|
|
432
|
+
inputRef: x,
|
|
436
433
|
value: e.version,
|
|
437
434
|
onChange: (e) => n({ version: e ?? "" }),
|
|
438
435
|
onBlur: o,
|
|
@@ -440,21 +437,21 @@ var ve = {
|
|
|
440
437
|
placeholder: u.version.placeholder,
|
|
441
438
|
error: t.version || void 0,
|
|
442
439
|
invalid: !!t.version,
|
|
443
|
-
containerClassName:
|
|
440
|
+
containerClassName: E ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
|
|
444
441
|
})]
|
|
445
442
|
}),
|
|
446
|
-
|
|
443
|
+
w(U.Description) && (v ? /* @__PURE__ */ F("div", {
|
|
447
444
|
className: d?.field,
|
|
448
|
-
children:
|
|
449
|
-
}) :
|
|
450
|
-
|
|
445
|
+
children: v(ee, G)
|
|
446
|
+
}) : ee),
|
|
447
|
+
w(U.Locales) && /* @__PURE__ */ F(De, {
|
|
451
448
|
value: e.otherLocales,
|
|
452
449
|
onChange: (e) => n({ otherLocales: e }),
|
|
453
450
|
availableLocaleOptions: f,
|
|
454
451
|
labels: u.otherLocales,
|
|
455
452
|
className: d?.field
|
|
456
453
|
}),
|
|
457
|
-
|
|
454
|
+
w(U.Tags) && /* @__PURE__ */ F("div", {
|
|
458
455
|
className: d?.field,
|
|
459
456
|
children: /* @__PURE__ */ F(j, {
|
|
460
457
|
id: "deployment-creation-form-topics",
|
|
@@ -576,41 +573,42 @@ var ve = {
|
|
|
576
573
|
deleteConfirmItemsLabel: "items?",
|
|
577
574
|
deleteConfirmLabel: "Delete",
|
|
578
575
|
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(
|
|
576
|
+
}, 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 }) => {
|
|
577
|
+
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) => {
|
|
578
|
+
let t = C?.(e);
|
|
579
|
+
t && n({ iconUrl: t }), g(!1);
|
|
580
|
+
}, [n, C]);
|
|
581
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(ke, {
|
|
585
582
|
values: e,
|
|
586
583
|
errors: t,
|
|
587
584
|
onChange: n,
|
|
588
585
|
onNameBlur: r,
|
|
589
586
|
onVersionBlur: i,
|
|
590
|
-
iconPreviewUrl:
|
|
591
|
-
onAddAvatarClick:
|
|
592
|
-
labels:
|
|
587
|
+
iconPreviewUrl: b,
|
|
588
|
+
onAddAvatarClick: x,
|
|
589
|
+
labels: m?.form ?? Pe,
|
|
593
590
|
availableLocaleOptions: o,
|
|
594
|
-
fields:
|
|
591
|
+
fields: _,
|
|
595
592
|
isNameReadOnly: c,
|
|
596
593
|
nameCaption: l,
|
|
597
594
|
isDescriptionRequired: u,
|
|
598
|
-
|
|
599
|
-
|
|
595
|
+
descriptionCaption: d,
|
|
596
|
+
renderDescription: f,
|
|
597
|
+
focusRequestKey: p
|
|
600
598
|
}), a && /* @__PURE__ */ F(Te, {
|
|
601
|
-
isOpen:
|
|
602
|
-
onClose:
|
|
603
|
-
onAttach:
|
|
599
|
+
isOpen: h,
|
|
600
|
+
onClose: S,
|
|
601
|
+
onAttach: w,
|
|
604
602
|
bucket: a.bucket,
|
|
605
603
|
FileManagerModal: a.FileManagerModal,
|
|
606
604
|
allowedMimeTypes: a.allowedMimeTypes,
|
|
607
605
|
maxFileSizeBytes: a.maxFileSizeBytes,
|
|
608
|
-
labels:
|
|
606
|
+
labels: m?.avatarPicker ?? Fe
|
|
609
607
|
})] });
|
|
610
608
|
}), Le = /* @__PURE__ */ function(e) {
|
|
611
609
|
return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
|
|
612
610
|
}({});
|
|
613
|
-
|
|
611
|
+
Le.TooLong, Le.ControlCharacters;
|
|
614
612
|
//#endregion
|
|
615
613
|
//#region src/constants/public-class-names.ts
|
|
616
614
|
var Re = {
|
|
@@ -619,7 +617,7 @@ var Re = {
|
|
|
619
617
|
}, K = "SKILL.md", q = /* @__PURE__ */ function(e) {
|
|
620
618
|
return e.File = "file", e.Folder = "folder", e;
|
|
621
619
|
}({}), ze = /* @__PURE__ */ function(e) {
|
|
622
|
-
return e.Header = "header", e.Child = "child", e
|
|
620
|
+
return e.Header = "header", e.Child = "child", e;
|
|
623
621
|
}({}), J = (e) => {
|
|
624
622
|
let t = e.lastIndexOf("/");
|
|
625
623
|
return t === -1 ? null : e.slice(0, t);
|
|
@@ -640,19 +638,13 @@ var Re = {
|
|
|
640
638
|
};
|
|
641
639
|
return t.set(e, r), r;
|
|
642
640
|
};
|
|
643
|
-
for (let r of e) {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
name: r.name,
|
|
651
|
-
nodeType: he.ITEM,
|
|
652
|
-
parentPath: J(r.path),
|
|
653
|
-
folderId: J(r.path) ?? ""
|
|
654
|
-
});
|
|
655
|
-
}
|
|
641
|
+
for (let r of e) r.kind === q.Folder ? n(r.path).name = r.name : t.set(r.path, {
|
|
642
|
+
path: r.path,
|
|
643
|
+
name: r.name,
|
|
644
|
+
nodeType: he.ITEM,
|
|
645
|
+
parentPath: J(r.path),
|
|
646
|
+
folderId: J(r.path) ?? ""
|
|
647
|
+
});
|
|
656
648
|
for (let t of [...e]) {
|
|
657
649
|
let e = J(t.path);
|
|
658
650
|
for (; e != null;) n(e), e = J(e);
|
|
@@ -667,14 +659,13 @@ var Re = {
|
|
|
667
659
|
n ? n.items = [...n.items ?? [], e] : r.push(e);
|
|
668
660
|
}
|
|
669
661
|
return r;
|
|
670
|
-
}, He = (e, t) => e ? `${e}/${t}` : t, Ue = (e
|
|
662
|
+
}, He = (e, t) => e ? `${e}/${t}` : t, Ue = (e, t) => {
|
|
671
663
|
if (!t) return "";
|
|
672
664
|
switch (e) {
|
|
673
665
|
case ze.Child: return t.path;
|
|
674
|
-
case ze.Sibling: return Ue(t.path);
|
|
675
666
|
case ze.Header: return t.kind === q.Folder ? t.path : "";
|
|
676
667
|
}
|
|
677
|
-
},
|
|
668
|
+
}, We = (e, t) => {
|
|
678
669
|
let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
|
|
679
670
|
for (let { path: i } of e) {
|
|
680
671
|
if (!i.startsWith(n) || i === t) continue;
|
|
@@ -682,19 +673,19 @@ var Re = {
|
|
|
682
673
|
r.add(e.split("/")[0]);
|
|
683
674
|
}
|
|
684
675
|
return r;
|
|
685
|
-
},
|
|
676
|
+
}, Ge = (e, t, n) => {
|
|
686
677
|
let r = e.trim();
|
|
687
678
|
if (!r) return n.required;
|
|
688
679
|
if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
|
|
689
680
|
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,
|
|
681
|
+
}, Ke = "\\new-folder", qe = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
|
|
682
|
+
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
683
|
path: u,
|
|
693
684
|
name: n,
|
|
694
685
|
kind: q.Folder
|
|
695
686
|
}, [u, n]), f = z((n, i) => {
|
|
696
|
-
let a =
|
|
697
|
-
return i === "" && a.add(K),
|
|
687
|
+
let a = We(e, i);
|
|
688
|
+
return i === "" && a.add(K), Ge(n, a, r) ?? t.validateFolderPath?.(He(i, n.trim()));
|
|
698
689
|
}, [
|
|
699
690
|
e,
|
|
700
691
|
r,
|
|
@@ -742,38 +733,38 @@ var Re = {
|
|
|
742
733
|
handleSave: g,
|
|
743
734
|
handleCancel: h
|
|
744
735
|
};
|
|
745
|
-
},
|
|
736
|
+
}, Je = (e) => !!e.dataTransfer?.types.includes("Files"), Ye = (e) => {
|
|
746
737
|
let [t, n] = H(!1), r = V(0);
|
|
747
738
|
return {
|
|
748
739
|
isDragActive: t,
|
|
749
740
|
dropZoneHandlers: {
|
|
750
741
|
onDragEnter: z((e) => {
|
|
751
|
-
|
|
742
|
+
Je(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
752
743
|
}, []),
|
|
753
744
|
onDragLeave: z((e) => {
|
|
754
|
-
|
|
745
|
+
Je(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
755
746
|
}, []),
|
|
756
747
|
onDragOver: z((e) => {
|
|
757
|
-
|
|
748
|
+
Je(e) && e.preventDefault();
|
|
758
749
|
}, []),
|
|
759
750
|
onDrop: z((t) => {
|
|
760
|
-
if (!
|
|
751
|
+
if (!Je(t)) return;
|
|
761
752
|
t.preventDefault(), r.current = 0, n(!1);
|
|
762
753
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
763
754
|
i.length > 0 && e(i);
|
|
764
755
|
}, [e])
|
|
765
756
|
}
|
|
766
757
|
};
|
|
767
|
-
},
|
|
758
|
+
}, Xe = /* @__PURE__ */ function(e) {
|
|
768
759
|
return e.Files = "files", e.Archive = "archive", e;
|
|
769
760
|
}({}), Y = /* @__PURE__ */ function(e) {
|
|
770
761
|
return e.Mobile = "mobile", e.Desktop = "desktop", e;
|
|
771
|
-
}({}),
|
|
762
|
+
}({}), Ze = (e, t, n = g.MD) => /* @__PURE__ */ F(e, {
|
|
772
763
|
size: n,
|
|
773
764
|
className: t,
|
|
774
765
|
"aria-hidden": !0,
|
|
775
766
|
stroke: _
|
|
776
|
-
}),
|
|
767
|
+
}), Qe = ({ isVisible: e, labels: t }) => {
|
|
777
768
|
if (!e) return null;
|
|
778
769
|
let n = t ?? {};
|
|
779
770
|
return /* @__PURE__ */ F("div", {
|
|
@@ -783,7 +774,7 @@ var Re = {
|
|
|
783
774
|
children: /* @__PURE__ */ I("div", {
|
|
784
775
|
className: "flex flex-col items-center text-center",
|
|
785
776
|
children: [
|
|
786
|
-
/* @__PURE__ */ F(
|
|
777
|
+
/* @__PURE__ */ F(le, {
|
|
787
778
|
size: 100,
|
|
788
779
|
className: "text-accent-primary",
|
|
789
780
|
"aria-hidden": !0,
|
|
@@ -800,16 +791,16 @@ var Re = {
|
|
|
800
791
|
]
|
|
801
792
|
})
|
|
802
793
|
});
|
|
803
|
-
},
|
|
794
|
+
}, $e = /* @__PURE__ */ function(e) {
|
|
804
795
|
return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
|
|
805
|
-
}({}),
|
|
796
|
+
}({}), et = /* @__PURE__ */ function(e) {
|
|
806
797
|
return e.Valid = "valid", e.Invalid = "invalid", e;
|
|
807
|
-
}({}),
|
|
798
|
+
}({}), tt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), nt = ".zip,application/zip", rt = 0, X = () => `skill-file-candidate-${++rt}`, Z = (e, t, n) => ({
|
|
808
799
|
id: X(),
|
|
809
800
|
file: e,
|
|
810
801
|
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 ===
|
|
802
|
+
}), it = ({ isOpen: e, onClose: t, fileActions: n, mode: r = Xe.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: o, labels: c }) => {
|
|
803
|
+
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
804
|
T(void 0), d((t) => [...t, ...e]);
|
|
814
805
|
}, oe = async (e) => {
|
|
815
806
|
let { extractArchive: t } = n;
|
|
@@ -832,24 +823,17 @@ var Re = {
|
|
|
832
823
|
r === M.current && j((e) => e - 1);
|
|
833
824
|
}
|
|
834
825
|
}, se = (e) => {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
|
-
ae(e.map((e) => Z(e, nt(e), i)));
|
|
840
|
-
}, ce = (e) => {
|
|
826
|
+
N ? oe(e) : ae(e.map((e) => Z(e, tt(e), i)));
|
|
827
|
+
}, R = (e) => {
|
|
841
828
|
d((t) => t.filter((t) => t.id !== e));
|
|
842
829
|
};
|
|
843
830
|
pe(() => {
|
|
844
|
-
e && (M.current += 1, d([...(a ?? []).map((e) => Z(e,
|
|
831
|
+
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
832
|
}, [e]), pe(() => {
|
|
846
833
|
if (!e) return;
|
|
847
834
|
let t = !1;
|
|
848
|
-
if (u.length === 0)
|
|
849
|
-
|
|
850
|
-
return;
|
|
851
|
-
}
|
|
852
|
-
return b(!0), n.validateBatch(u).then(({ results: e, batchErrors: n }) => {
|
|
835
|
+
if (u.length === 0) h(/* @__PURE__ */ new Map()), v([]);
|
|
836
|
+
else return b(!0), n.validateBatch(u).then(({ results: e, batchErrors: n }) => {
|
|
853
837
|
t || (h(new Map(e.map((e) => [e.candidateId, e]))), v(n.map((e) => e.message)));
|
|
854
838
|
}).finally(() => {
|
|
855
839
|
t || b(!1);
|
|
@@ -857,11 +841,11 @@ var Re = {
|
|
|
857
841
|
t = !0;
|
|
858
842
|
};
|
|
859
843
|
}, [u, e]);
|
|
860
|
-
let
|
|
844
|
+
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
845
|
D(!0), T(void 0);
|
|
862
846
|
try {
|
|
863
847
|
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 ===
|
|
848
|
+
if (h(i), v(r.map((e) => e.message)), u.some((e) => i.get(e.id)?.status === et.Invalid) || r.length > 0) return;
|
|
865
849
|
let a = await n.commitBatch(u);
|
|
866
850
|
if (a.error) {
|
|
867
851
|
T(a.error);
|
|
@@ -891,7 +875,7 @@ var Re = {
|
|
|
891
875
|
ariaLabel: ""
|
|
892
876
|
}) : void 0,
|
|
893
877
|
onClick: () => void fe(),
|
|
894
|
-
disabled: !
|
|
878
|
+
disabled: !de
|
|
895
879
|
}],
|
|
896
880
|
children: /* @__PURE__ */ I("div", {
|
|
897
881
|
className: "flex flex-col gap-4 px-6 py-4",
|
|
@@ -906,8 +890,8 @@ var Re = {
|
|
|
906
890
|
})] }),
|
|
907
891
|
ariaLabel: l.uploadDropZoneAriaLabel ?? "Upload files",
|
|
908
892
|
multiple: !0,
|
|
909
|
-
accept: N ?
|
|
910
|
-
className:
|
|
893
|
+
accept: N ? nt : void 0,
|
|
894
|
+
className: ue ? "border-error hover:border-error" : void 0,
|
|
911
895
|
onChange: se,
|
|
912
896
|
onReject: N ? () => A(L) : void 0
|
|
913
897
|
}),
|
|
@@ -927,7 +911,7 @@ var Re = {
|
|
|
927
911
|
u.length > 0 && /* @__PURE__ */ F("ul", {
|
|
928
912
|
className: "flex flex-col gap-2",
|
|
929
913
|
children: u.map((e) => {
|
|
930
|
-
let t = p.get(e.id), n = t?.kind ===
|
|
914
|
+
let t = p.get(e.id), n = t?.kind === $e.Manifest, r = t?.status === et.Invalid;
|
|
931
915
|
return /* @__PURE__ */ I("li", {
|
|
932
916
|
className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
|
|
933
917
|
children: [
|
|
@@ -955,13 +939,13 @@ var Re = {
|
|
|
955
939
|
]
|
|
956
940
|
}),
|
|
957
941
|
/* @__PURE__ */ F(w, {
|
|
958
|
-
icon: /* @__PURE__ */ F(
|
|
942
|
+
icon: /* @__PURE__ */ F(ce, {
|
|
959
943
|
size: 16,
|
|
960
944
|
"aria-hidden": !0,
|
|
961
945
|
stroke: _
|
|
962
946
|
}),
|
|
963
947
|
"aria-label": l.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
|
|
964
|
-
onClick: () =>
|
|
948
|
+
onClick: () => R(e.id)
|
|
965
949
|
})
|
|
966
950
|
]
|
|
967
951
|
}, e.id);
|
|
@@ -971,32 +955,32 @@ var Re = {
|
|
|
971
955
|
]
|
|
972
956
|
})
|
|
973
957
|
});
|
|
974
|
-
},
|
|
958
|
+
}, at = {
|
|
975
959
|
title: "_title_5md1a_1",
|
|
976
960
|
helperText: "_helperText_5md1a_5",
|
|
977
961
|
refineFeedback: "_refineFeedback_5md1a_9",
|
|
978
962
|
refineError: "_refineError_5md1a_13"
|
|
979
|
-
},
|
|
980
|
-
mode:
|
|
963
|
+
}, ot = {
|
|
964
|
+
mode: Xe.Files,
|
|
981
965
|
targetFolderPath: ""
|
|
982
|
-
},
|
|
966
|
+
}, 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
967
|
let { MarkdownEditor: e } = await _e();
|
|
984
968
|
return { default: e };
|
|
985
|
-
}),
|
|
986
|
-
let [W,
|
|
969
|
+
}), 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 }) => {
|
|
970
|
+
let [W, De] = H({
|
|
987
971
|
name: r?.name ?? "",
|
|
988
972
|
description: r?.description ?? "",
|
|
989
973
|
instructions: r?.instructions ?? ""
|
|
990
|
-
}),
|
|
991
|
-
bottomGap:
|
|
992
|
-
minHeight:
|
|
993
|
-
}),
|
|
974
|
+
}), Oe = me(), G = V(void 0), ke = l({
|
|
975
|
+
bottomGap: ct,
|
|
976
|
+
minHeight: lt
|
|
977
|
+
}), Ae = V(W), je = (e) => {
|
|
994
978
|
let t = {
|
|
995
|
-
...
|
|
979
|
+
...Ae.current,
|
|
996
980
|
...e
|
|
997
981
|
};
|
|
998
|
-
|
|
999
|
-
},
|
|
982
|
+
Ae.current = t, De(t), L?.(t);
|
|
983
|
+
}, Me = (e) => e ? async (t, n) => {
|
|
1000
984
|
if (G.current && !G.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
1001
985
|
G.current = n;
|
|
1002
986
|
try {
|
|
@@ -1004,79 +988,79 @@ var Re = {
|
|
|
1004
988
|
} finally {
|
|
1005
989
|
G.current === n && (G.current = void 0);
|
|
1006
990
|
}
|
|
1007
|
-
} : void 0,
|
|
991
|
+
} : void 0, Fe = u({
|
|
1008
992
|
value: W.description,
|
|
1009
|
-
onChange: (e) =>
|
|
1010
|
-
onRefine:
|
|
993
|
+
onChange: (e) => je({ description: e }),
|
|
994
|
+
onRefine: Me(ie),
|
|
1011
995
|
disabled: O || T || D,
|
|
1012
996
|
resetKey: r
|
|
1013
|
-
}),
|
|
997
|
+
}), Le = u({
|
|
1014
998
|
value: W.instructions,
|
|
1015
|
-
onChange: (e) =>
|
|
1016
|
-
onRefine:
|
|
999
|
+
onChange: (e) => je({ instructions: e }),
|
|
1000
|
+
onRefine: Me(se),
|
|
1017
1001
|
disabled: O || T || D,
|
|
1018
1002
|
resetKey: r
|
|
1019
|
-
}),
|
|
1020
|
-
|
|
1021
|
-
},
|
|
1022
|
-
|
|
1003
|
+
}), J = Fe.isPending || Le.isPending, Be = () => {
|
|
1004
|
+
Fe.reset(), Le.reset();
|
|
1005
|
+
}, He = () => {
|
|
1006
|
+
Be(), ve();
|
|
1007
|
+
}, We = () => {
|
|
1008
|
+
Be(), ye();
|
|
1023
1009
|
}, 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);
|
|
1010
|
+
O || T || D || G.current && !G.current.aborted || _e(W);
|
|
1011
|
+
}, Ke = V(r), Je = Ke.current !== r, $e = V(i);
|
|
1028
1012
|
pe(() => {
|
|
1029
|
-
|
|
1013
|
+
Ke.current = r;
|
|
1030
1014
|
let e = {
|
|
1031
1015
|
name: r?.name ?? "",
|
|
1032
1016
|
description: r?.description ?? "",
|
|
1033
1017
|
instructions: r?.instructions ?? ""
|
|
1034
1018
|
};
|
|
1035
|
-
|
|
1019
|
+
Ae.current = e, De(e), $e.current = i;
|
|
1036
1020
|
}, [r]);
|
|
1037
|
-
let
|
|
1021
|
+
let et = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), tt = V(!1);
|
|
1038
1022
|
pe(() => {
|
|
1039
|
-
if (
|
|
1023
|
+
if (Je) return;
|
|
1040
1024
|
let e = {
|
|
1041
1025
|
name: r?.name ?? "",
|
|
1042
1026
|
description: r?.description ?? "",
|
|
1043
1027
|
instructions: r?.instructions ?? ""
|
|
1044
|
-
}, t = JSON.stringify(W) !== JSON.stringify(e) ||
|
|
1045
|
-
t !==
|
|
1028
|
+
}, t = JSON.stringify(W) !== JSON.stringify(e) || et(i) !== et($e.current);
|
|
1029
|
+
t !== tt.current && (tt.current = t, N?.(t));
|
|
1046
1030
|
}, [
|
|
1047
1031
|
W,
|
|
1048
1032
|
i,
|
|
1049
1033
|
r,
|
|
1050
|
-
|
|
1034
|
+
Je,
|
|
1051
1035
|
N
|
|
1052
1036
|
]);
|
|
1053
|
-
let [
|
|
1054
|
-
|
|
1055
|
-
}, [
|
|
1037
|
+
let [nt, rt] = H(K), X = s ?? nt, Z = z((e) => {
|
|
1038
|
+
rt(e), _?.(e);
|
|
1039
|
+
}, [_]), [mt, ht] = H([]), gt = v ?? mt, _t = B(() => new Set(gt), [gt]), vt = z((e) => {
|
|
1056
1040
|
let t = [...e];
|
|
1057
|
-
|
|
1058
|
-
}, [
|
|
1059
|
-
|
|
1060
|
-
}, []), [
|
|
1061
|
-
|
|
1062
|
-
...
|
|
1041
|
+
ht(t), S?.(t);
|
|
1042
|
+
}, [S]), [yt, bt] = H(!1), [xt, St] = H(ot), Ct = z((e) => {
|
|
1043
|
+
St(e), bt(!0);
|
|
1044
|
+
}, []), [wt, Tt] = H(!1), { isDragActive: Et, dropZoneHandlers: Dt } = Ye(z((e) => {
|
|
1045
|
+
yt || Ct({
|
|
1046
|
+
...ot,
|
|
1063
1047
|
initialFiles: e
|
|
1064
1048
|
});
|
|
1065
|
-
}, [
|
|
1049
|
+
}, [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
1050
|
"--se-title-color": $?.title,
|
|
1067
1051
|
"--se-helper-text-color": $?.helperText,
|
|
1068
1052
|
"--se-refine-action-text": $?.refineActionText,
|
|
1069
1053
|
"--se-refine-error-text": $?.refineErrorText
|
|
1070
|
-
}),
|
|
1071
|
-
feedbackClassName: c($?.refineActionText &&
|
|
1072
|
-
errorClassName:
|
|
1073
|
-
},
|
|
1054
|
+
}), Pt = {
|
|
1055
|
+
feedbackClassName: c($?.refineActionText && at.refineFeedback, Ot.refineFeedbackClassName, Re.refineFeedback),
|
|
1056
|
+
errorClassName: at.refineError
|
|
1057
|
+
}, Ft = {
|
|
1074
1058
|
layout: $?.border ? { colors: {
|
|
1075
1059
|
headerBorderColor: $.border,
|
|
1076
1060
|
sidebarBorderColor: $.border
|
|
1077
1061
|
} } : void 0,
|
|
1078
1062
|
section: $?.title ? { colors: { titleColor: $.title } } : void 0
|
|
1079
|
-
},
|
|
1063
|
+
}, It = B(() => ({
|
|
1080
1064
|
required: Q.folderNameRequiredError ?? "Enter a folder name",
|
|
1081
1065
|
invalid: Q.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
|
|
1082
1066
|
duplicate: Q.folderNameDuplicateError ?? "An item with this name already exists here"
|
|
@@ -1084,161 +1068,160 @@ var Re = {
|
|
|
1084
1068
|
Q.folderNameRequiredError,
|
|
1085
1069
|
Q.folderNameInvalidError,
|
|
1086
1070
|
Q.folderNameDuplicateError
|
|
1087
|
-
]),
|
|
1088
|
-
|
|
1089
|
-
}, [
|
|
1071
|
+
]), Lt = z((e) => {
|
|
1072
|
+
_t.has(e) || vt(/* @__PURE__ */ new Set([..._t, e]));
|
|
1073
|
+
}, [_t, vt]), Rt = qe({
|
|
1090
1074
|
files: i,
|
|
1091
1075
|
fileActions: R,
|
|
1092
1076
|
defaultName: Q.newFolderDefaultName ?? "New folder",
|
|
1093
|
-
messages:
|
|
1094
|
-
onRevealFolder:
|
|
1077
|
+
messages: It,
|
|
1078
|
+
onRevealFolder: Lt,
|
|
1095
1079
|
onCreated: Z
|
|
1096
|
-
}), { draftNode:
|
|
1080
|
+
}), { draftNode: zt, draftPath: Bt, draftPane: Vt } = Rt, Ht = B(() => Ve([{
|
|
1097
1081
|
path: K,
|
|
1098
1082
|
name: K,
|
|
1099
1083
|
kind: q.File
|
|
1100
|
-
}, ...i]), [i]),
|
|
1084
|
+
}, ...i]), [i]), Ut = B(() => zt ? Ve([
|
|
1101
1085
|
{
|
|
1102
1086
|
path: K,
|
|
1103
1087
|
name: K,
|
|
1104
1088
|
kind: q.File
|
|
1105
1089
|
},
|
|
1106
1090
|
...i,
|
|
1107
|
-
|
|
1108
|
-
]) :
|
|
1091
|
+
zt
|
|
1092
|
+
]) : Ht, [
|
|
1109
1093
|
i,
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
]),
|
|
1113
|
-
e.path !==
|
|
1114
|
-
}, [Z,
|
|
1094
|
+
zt,
|
|
1095
|
+
Ht
|
|
1096
|
+
]), Wt = B(() => i.find((e) => e.path === X), [i, X]), Gt = z((e) => {
|
|
1097
|
+
e.path !== Bt && Z(e.path);
|
|
1098
|
+
}, [Z, Bt]), Kt = z((e) => {
|
|
1115
1099
|
R.onRemoveNode(e), X === e && Z(K);
|
|
1116
1100
|
}, [
|
|
1117
1101
|
R,
|
|
1118
1102
|
X,
|
|
1119
1103
|
Z
|
|
1120
|
-
]), { startDraft:
|
|
1121
|
-
if (!
|
|
1122
|
-
let t = await
|
|
1123
|
-
t?.length &&
|
|
1124
|
-
mode:
|
|
1104
|
+
]), { startDraft: qt } = Rt, { onCreateFolder: Jt, extractArchive: Yt, pickFromFileSystem: Xt } = R, Zt = z(async (e) => {
|
|
1105
|
+
if (!Xt) return;
|
|
1106
|
+
let t = await Xt();
|
|
1107
|
+
t?.length && Ct({
|
|
1108
|
+
mode: Xe.Files,
|
|
1125
1109
|
targetFolderPath: e,
|
|
1126
1110
|
initialEntries: t
|
|
1127
1111
|
});
|
|
1128
|
-
}, [
|
|
1129
|
-
let n = (e) =>
|
|
1130
|
-
return
|
|
1112
|
+
}, [Xt, Ct]), Qt = z((e, t) => {
|
|
1113
|
+
let n = (e) => Ze(e, Mt), r = [];
|
|
1114
|
+
return Jt && r.push({
|
|
1131
1115
|
key: "create-folder",
|
|
1132
1116
|
label: Q.createFolderLabel ?? "Create folder",
|
|
1133
1117
|
icon: n(oe),
|
|
1134
|
-
onClick: () =>
|
|
1118
|
+
onClick: () => qt(e, t)
|
|
1135
1119
|
}), r.push({
|
|
1136
1120
|
key: "upload-files",
|
|
1137
1121
|
label: Q.uploadFilesLabel ?? "Upload files from device",
|
|
1138
|
-
icon: n(
|
|
1139
|
-
onClick: () =>
|
|
1140
|
-
mode:
|
|
1122
|
+
icon: n(le),
|
|
1123
|
+
onClick: () => Ct({
|
|
1124
|
+
mode: Xe.Files,
|
|
1141
1125
|
targetFolderPath: e
|
|
1142
1126
|
})
|
|
1143
|
-
}),
|
|
1127
|
+
}), Yt && r.push({
|
|
1144
1128
|
key: "upload-archive",
|
|
1145
1129
|
label: Q.uploadArchiveLabel ?? "Upload archive from device",
|
|
1146
1130
|
icon: n(ae),
|
|
1147
|
-
onClick: () =>
|
|
1148
|
-
mode:
|
|
1131
|
+
onClick: () => Ct({
|
|
1132
|
+
mode: Xe.Archive,
|
|
1149
1133
|
targetFolderPath: e
|
|
1150
1134
|
})
|
|
1151
|
-
}),
|
|
1135
|
+
}), Xt && r.push({
|
|
1152
1136
|
key: "open-file-system",
|
|
1153
1137
|
label: Q.openFileSystemLabel ?? "Open DIAL file system",
|
|
1154
1138
|
icon: n(re),
|
|
1155
|
-
onClick: () => void
|
|
1139
|
+
onClick: () => void Zt(e)
|
|
1156
1140
|
}), r;
|
|
1157
1141
|
}, [
|
|
1158
|
-
|
|
1142
|
+
Mt,
|
|
1143
|
+
Jt,
|
|
1159
1144
|
Yt,
|
|
1160
1145
|
Xt,
|
|
1161
|
-
Zt,
|
|
1162
1146
|
Q.createFolderLabel,
|
|
1163
1147
|
Q.uploadFilesLabel,
|
|
1164
1148
|
Q.uploadArchiveLabel,
|
|
1165
1149
|
Q.openFileSystemLabel,
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
]),
|
|
1170
|
-
let e =
|
|
1150
|
+
qt,
|
|
1151
|
+
Ct,
|
|
1152
|
+
Zt
|
|
1153
|
+
]), $t = B(() => {
|
|
1154
|
+
let e = Ue(ze.Header, i.find((e) => e.path === X));
|
|
1171
1155
|
return {
|
|
1172
|
-
[Y.Mobile]:
|
|
1173
|
-
[Y.Desktop]:
|
|
1156
|
+
[Y.Mobile]: Qt(e, Y.Mobile),
|
|
1157
|
+
[Y.Desktop]: Qt(e, Y.Desktop)
|
|
1174
1158
|
};
|
|
1175
1159
|
}, [
|
|
1176
|
-
|
|
1160
|
+
Qt,
|
|
1177
1161
|
i,
|
|
1178
1162
|
X
|
|
1179
|
-
]),
|
|
1180
|
-
if (e.path ===
|
|
1163
|
+
]), en = z((e, t) => {
|
|
1164
|
+
if (e.path === Bt || e.nodeType !== he.FOLDER) return [];
|
|
1181
1165
|
let n = {
|
|
1182
1166
|
path: e.path,
|
|
1183
1167
|
name: e.name,
|
|
1184
|
-
kind:
|
|
1185
|
-
}, r =
|
|
1168
|
+
kind: q.Folder
|
|
1169
|
+
}, r = Qt(Ue(ze.Child, n), t);
|
|
1186
1170
|
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
1171
|
key: "delete",
|
|
1193
1172
|
label: Q.deleteLabel ?? "Delete",
|
|
1194
1173
|
danger: !0,
|
|
1195
|
-
icon:
|
|
1196
|
-
onClick: () =>
|
|
1174
|
+
icon: Ze(ce, jt),
|
|
1175
|
+
onClick: () => Kt(e.path)
|
|
1197
1176
|
}), r;
|
|
1198
1177
|
}, [
|
|
1199
|
-
|
|
1200
|
-
Q.addSiblingLabel,
|
|
1178
|
+
Bt,
|
|
1201
1179
|
Q.deleteLabel,
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
]),
|
|
1206
|
-
[Y.Mobile]: (e) =>
|
|
1207
|
-
[Y.Desktop]: (e) =>
|
|
1208
|
-
}), [
|
|
1180
|
+
jt,
|
|
1181
|
+
Qt,
|
|
1182
|
+
Kt
|
|
1183
|
+
]), tn = B(() => ({
|
|
1184
|
+
[Y.Mobile]: (e) => en(e, Y.Mobile),
|
|
1185
|
+
[Y.Desktop]: (e) => en(e, Y.Desktop)
|
|
1186
|
+
}), [en]), nn = z((e) => e.nodeType === he.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ F(w, {
|
|
1187
|
+
size: b.Small,
|
|
1188
|
+
icon: Ze(ce, jt, g.SM),
|
|
1189
|
+
"aria-label": Q.deleteLabel ?? "Delete",
|
|
1190
|
+
onClick: () => Kt(e.path)
|
|
1191
|
+
}), [
|
|
1192
|
+
Q.deleteLabel,
|
|
1193
|
+
jt,
|
|
1194
|
+
Kt
|
|
1195
|
+
]), rn = (e) => /* @__PURE__ */ I("div", {
|
|
1209
1196
|
className: "flex flex-col gap-2 desktop:gap-5",
|
|
1210
1197
|
children: [/* @__PURE__ */ I("div", {
|
|
1211
1198
|
className: "flex items-center justify-between",
|
|
1212
1199
|
children: [/* @__PURE__ */ F("span", {
|
|
1213
|
-
className: c(
|
|
1200
|
+
className: c(at.title, kt),
|
|
1214
1201
|
children: Q.filesHeading ?? "Files"
|
|
1215
1202
|
}), /* @__PURE__ */ F(p, {
|
|
1216
1203
|
label: Q.addLabel ?? "Add",
|
|
1217
1204
|
variant: m.Neutral,
|
|
1218
1205
|
appearance: f.Solid,
|
|
1219
1206
|
size: b.Small,
|
|
1220
|
-
|
|
1221
|
-
size: g.SM,
|
|
1222
|
-
"aria-hidden": !0,
|
|
1223
|
-
stroke: _
|
|
1224
|
-
}),
|
|
1225
|
-
items: en[e]
|
|
1207
|
+
items: $t[e]
|
|
1226
1208
|
})]
|
|
1227
1209
|
}), /* @__PURE__ */ F("div", {
|
|
1228
1210
|
role: "tree",
|
|
1229
1211
|
"aria-label": Q.filesTreeAriaLabel ?? "Skill files",
|
|
1230
1212
|
children: /* @__PURE__ */ F(ge, {
|
|
1231
|
-
items:
|
|
1213
|
+
items: Vt === e ? Ut : Ht,
|
|
1232
1214
|
showFiles: !0,
|
|
1233
1215
|
selectedPath: X,
|
|
1234
|
-
expandedPaths:
|
|
1235
|
-
onExpandedPathsChange:
|
|
1236
|
-
onItemClick:
|
|
1237
|
-
getContextMenuItems:
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1216
|
+
expandedPaths: _t,
|
|
1217
|
+
onExpandedPathsChange: vt,
|
|
1218
|
+
onItemClick: Gt,
|
|
1219
|
+
getContextMenuItems: tn[e],
|
|
1220
|
+
renderItemActions: nn,
|
|
1221
|
+
renamedPath: Vt === e ? Bt : void 0,
|
|
1222
|
+
onRenameSave: Rt.handleSave,
|
|
1223
|
+
onRenameCancel: Rt.handleCancel,
|
|
1224
|
+
onRenameValidate: Rt.handleValidate,
|
|
1242
1225
|
rootItemPath: ""
|
|
1243
1226
|
})
|
|
1244
1227
|
})]
|
|
@@ -1269,34 +1252,34 @@ var Re = {
|
|
|
1269
1252
|
Q.descriptionLabel,
|
|
1270
1253
|
Q.descriptionPlaceholder
|
|
1271
1254
|
]), cn = (e) => {
|
|
1272
|
-
e.name !== void 0 &&
|
|
1255
|
+
e.name !== void 0 && je({ name: e.name }), e.description !== void 0 && (Fe.reset(), je({ description: e.description }));
|
|
1273
1256
|
}, ln = ie ? (e, t) => /* @__PURE__ */ F(a, {
|
|
1274
1257
|
isEnabled: !0,
|
|
1275
1258
|
fieldId: t,
|
|
1276
1259
|
required: !0,
|
|
1277
1260
|
label: Q.descriptionLabel ?? "Description",
|
|
1278
1261
|
labels: Q,
|
|
1279
|
-
refinement:
|
|
1280
|
-
disabled:
|
|
1281
|
-
...
|
|
1262
|
+
refinement: Fe,
|
|
1263
|
+
disabled: J || O,
|
|
1264
|
+
...Pt,
|
|
1282
1265
|
children: e
|
|
1283
1266
|
}) : void 0, un = {
|
|
1284
|
-
title:
|
|
1285
|
-
onBack:
|
|
1286
|
-
onCancel:
|
|
1287
|
-
onSubmit:
|
|
1267
|
+
title: xe,
|
|
1268
|
+
onBack: We,
|
|
1269
|
+
onCancel: He,
|
|
1270
|
+
onSubmit: Ge,
|
|
1288
1271
|
submitLabel: Q.createLabel ?? "Create",
|
|
1289
|
-
isSubmitDisabled:
|
|
1272
|
+
isSubmitDisabled: J || T || D,
|
|
1290
1273
|
labels: {
|
|
1291
1274
|
cancelLabel: Q.cancelLabel ?? "Cancel",
|
|
1292
|
-
backAriaLabel:
|
|
1275
|
+
backAriaLabel: be ?? "Back",
|
|
1293
1276
|
savingStatusLabel: Q.savingStatusLabel ?? "Saving"
|
|
1294
1277
|
},
|
|
1295
|
-
styles:
|
|
1278
|
+
styles: Ft,
|
|
1296
1279
|
metadataTitle: null
|
|
1297
1280
|
};
|
|
1298
1281
|
if (T) return /* @__PURE__ */ F("div", {
|
|
1299
|
-
dir:
|
|
1282
|
+
dir: U,
|
|
1300
1283
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1301
1284
|
children: /* @__PURE__ */ F(Ne, {
|
|
1302
1285
|
...un,
|
|
@@ -1309,7 +1292,7 @@ var Re = {
|
|
|
1309
1292
|
})
|
|
1310
1293
|
});
|
|
1311
1294
|
if (D) return /* @__PURE__ */ F("div", {
|
|
1312
|
-
dir:
|
|
1295
|
+
dir: U,
|
|
1313
1296
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1314
1297
|
children: /* @__PURE__ */ F(Ne, {
|
|
1315
1298
|
...un,
|
|
@@ -1318,18 +1301,18 @@ var Re = {
|
|
|
1318
1301
|
className: "flex flex-col items-center gap-4 p-8",
|
|
1319
1302
|
children: [/* @__PURE__ */ F(x, { text: Q.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ F(A, {
|
|
1320
1303
|
label: Q.retryLabel ?? "Retry",
|
|
1321
|
-
onClick:
|
|
1304
|
+
onClick: Se
|
|
1322
1305
|
})]
|
|
1323
1306
|
})
|
|
1324
1307
|
})
|
|
1325
1308
|
});
|
|
1326
|
-
let dn = X === K, fn = dn ? K : Q.selectedFileHeading?.(
|
|
1309
|
+
let dn = X === K, fn = dn ? K : Q.selectedFileHeading?.(Wt?.name ?? X) ?? Wt?.name ?? X, pn = ee != null || te != null ? /* @__PURE__ */ I("div", {
|
|
1327
1310
|
className: "flex flex-col gap-2",
|
|
1328
1311
|
children: [ee != null && /* @__PURE__ */ I("div", {
|
|
1329
1312
|
className: "flex items-center gap-2",
|
|
1330
|
-
children: [/* @__PURE__ */ F(x, { text: ee }),
|
|
1313
|
+
children: [/* @__PURE__ */ F(x, { text: ee }), Ce != null && /* @__PURE__ */ F(C, {
|
|
1331
1314
|
label: Q.retryLabel ?? "Retry",
|
|
1332
|
-
onClick:
|
|
1315
|
+
onClick: Ce
|
|
1333
1316
|
})]
|
|
1334
1317
|
}), te != null && /* @__PURE__ */ I("div", {
|
|
1335
1318
|
className: "flex items-center gap-2",
|
|
@@ -1340,36 +1323,36 @@ var Re = {
|
|
|
1340
1323
|
})]
|
|
1341
1324
|
}) : void 0, mn = /* @__PURE__ */ F(a, {
|
|
1342
1325
|
isEnabled: !!se,
|
|
1343
|
-
fieldId:
|
|
1326
|
+
fieldId: Oe,
|
|
1344
1327
|
required: !0,
|
|
1345
|
-
labelClassName: c(
|
|
1328
|
+
labelClassName: c(at.helperText, At),
|
|
1346
1329
|
label: Q.instructionsLabel ?? "Instructions",
|
|
1347
1330
|
labels: Q,
|
|
1348
|
-
refinement:
|
|
1349
|
-
disabled:
|
|
1350
|
-
...
|
|
1331
|
+
refinement: Le,
|
|
1332
|
+
disabled: J || O,
|
|
1333
|
+
...Pt,
|
|
1351
1334
|
children: /* @__PURE__ */ I("div", {
|
|
1352
1335
|
className: "flex flex-1 flex-col gap-2",
|
|
1353
1336
|
children: [
|
|
1354
1337
|
!se && /* @__PURE__ */ F(E, {
|
|
1355
|
-
htmlFor:
|
|
1356
|
-
className: c(
|
|
1338
|
+
htmlFor: Oe,
|
|
1339
|
+
className: c(at.helperText, At),
|
|
1357
1340
|
label: Q.instructionsLabel ?? "Instructions",
|
|
1358
1341
|
required: !0
|
|
1359
1342
|
}),
|
|
1360
1343
|
/* @__PURE__ */ F("div", {
|
|
1361
|
-
ref:
|
|
1344
|
+
ref: ke,
|
|
1362
1345
|
className: c(t, e, n),
|
|
1363
|
-
children: /* @__PURE__ */ F(
|
|
1346
|
+
children: /* @__PURE__ */ F(ue, {
|
|
1364
1347
|
fallback: /* @__PURE__ */ F(ne, { ariaLabel: Q.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
1365
|
-
children: /* @__PURE__ */ F(
|
|
1366
|
-
id:
|
|
1348
|
+
children: /* @__PURE__ */ F(pt, {
|
|
1349
|
+
id: Oe,
|
|
1367
1350
|
ariaLabel: Q.instructionsLabel ?? "Instructions",
|
|
1368
1351
|
value: W.instructions,
|
|
1369
1352
|
onChange: (e) => {
|
|
1370
|
-
|
|
1353
|
+
Le.reset(), je({ instructions: e });
|
|
1371
1354
|
},
|
|
1372
|
-
theme:
|
|
1355
|
+
theme: Ee,
|
|
1373
1356
|
showDragbar: !1,
|
|
1374
1357
|
placeholder: Q.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
|
|
1375
1358
|
})
|
|
@@ -1380,28 +1363,28 @@ var Re = {
|
|
|
1380
1363
|
})
|
|
1381
1364
|
});
|
|
1382
1365
|
return /* @__PURE__ */ I("div", {
|
|
1383
|
-
dir:
|
|
1366
|
+
dir: U,
|
|
1384
1367
|
className: c("relative flex min-h-0 flex-1 flex-col", Re.root),
|
|
1385
|
-
style:
|
|
1386
|
-
...
|
|
1368
|
+
style: Nt,
|
|
1369
|
+
...Dt,
|
|
1387
1370
|
children: [
|
|
1388
|
-
/* @__PURE__ */ F(
|
|
1389
|
-
isVisible:
|
|
1390
|
-
labels:
|
|
1371
|
+
/* @__PURE__ */ F(Qe, {
|
|
1372
|
+
isVisible: Et && !yt,
|
|
1373
|
+
labels: we
|
|
1391
1374
|
}),
|
|
1392
1375
|
/* @__PURE__ */ F(Ne, {
|
|
1393
1376
|
...un,
|
|
1394
|
-
asideData:
|
|
1395
|
-
asideSectionClassName:
|
|
1377
|
+
asideData: fe,
|
|
1378
|
+
asideSectionClassName: dt,
|
|
1396
1379
|
isSubmitting: O,
|
|
1397
|
-
metadataSectionClassName:
|
|
1380
|
+
metadataSectionClassName: ut,
|
|
1398
1381
|
metadata: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
|
|
1399
1382
|
className: "desktop:hidden",
|
|
1400
1383
|
children: /* @__PURE__ */ F(d, {
|
|
1401
1384
|
title: Q.editingFileLabel ?? "Editing file",
|
|
1402
|
-
description:
|
|
1403
|
-
expanded:
|
|
1404
|
-
onToggle:
|
|
1385
|
+
description: Wt?.name ?? "SKILL.md",
|
|
1386
|
+
expanded: wt,
|
|
1387
|
+
onToggle: Tt,
|
|
1405
1388
|
ariaLabel: Q.editingFileLabel ?? "Editing file",
|
|
1406
1389
|
children: rn(Y.Mobile)
|
|
1407
1390
|
})
|
|
@@ -1411,34 +1394,34 @@ var Re = {
|
|
|
1411
1394
|
})] }),
|
|
1412
1395
|
alert: pn,
|
|
1413
1396
|
setupTitle: fn,
|
|
1414
|
-
setupSectionClassName:
|
|
1397
|
+
setupSectionClassName: ft,
|
|
1415
1398
|
setup: dn ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Ie, {
|
|
1416
1399
|
values: an,
|
|
1417
1400
|
errors: on,
|
|
1418
1401
|
onChange: cn,
|
|
1419
|
-
fields:
|
|
1402
|
+
fields: st,
|
|
1420
1403
|
isDescriptionRequired: !0,
|
|
1421
1404
|
isNameReadOnly: M,
|
|
1422
1405
|
nameCaption: k?.name ? void 0 : Q.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
|
|
1423
1406
|
renderDescription: ln,
|
|
1424
1407
|
labels: sn
|
|
1425
|
-
}), mn] }) : /* @__PURE__ */ F(P, { children:
|
|
1408
|
+
}), mn] }) : /* @__PURE__ */ F(P, { children: Wt?.kind === q.File && /* @__PURE__ */ F("div", {
|
|
1426
1409
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1427
|
-
children:
|
|
1410
|
+
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
1411
|
}) })
|
|
1429
1412
|
}),
|
|
1430
|
-
/* @__PURE__ */ F(
|
|
1431
|
-
isOpen:
|
|
1432
|
-
onClose: () =>
|
|
1413
|
+
/* @__PURE__ */ F(it, {
|
|
1414
|
+
isOpen: yt,
|
|
1415
|
+
onClose: () => bt(!1),
|
|
1433
1416
|
fileActions: R,
|
|
1434
|
-
mode:
|
|
1435
|
-
targetFolderPath:
|
|
1436
|
-
initialFiles:
|
|
1437
|
-
initialEntries:
|
|
1438
|
-
labels:
|
|
1417
|
+
mode: xt.mode,
|
|
1418
|
+
targetFolderPath: xt.targetFolderPath,
|
|
1419
|
+
initialFiles: xt.initialFiles,
|
|
1420
|
+
initialEntries: xt.initialEntries,
|
|
1421
|
+
labels: we
|
|
1439
1422
|
})
|
|
1440
1423
|
]
|
|
1441
1424
|
});
|
|
1442
1425
|
};
|
|
1443
1426
|
//#endregion
|
|
1444
|
-
export { Re as SKILL_EDITOR_CLASS,
|
|
1427
|
+
export { Re as SKILL_EDITOR_CLASS, mt as SkillEditor, $e as SkillFileCandidateKind, q as SkillFileNodeKind, Xe as SkillFileUploadMode, et as SkillFileValidationStatus };
|