@epam/ai-dial-skill-editor 1.3.0-dev.290 → 1.3.0-dev.296
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +288 -288
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_MAX_HEIGHT
|
|
|
2
2
|
import { Accordion as p, BottomSheet as m, ButtonAppearance as h, ButtonDropdown as g, ButtonVariant as _, CaptionText as v, DIAL_ICON_SIZE as y, DIAL_KIT_ICON_STROKE as b, DangerIconButton as x, EditorThemes as S, ElementSize as C, ErrorMessageNotification as w, ErrorText as T, FileDropzone as E, FileName as D, GhostButton as O, GhostIconButton as ee, Input as k, Label as A, LinkButton as te, LiveRegion as ne, LiveRegionElement as re, LiveRegionPoliteness as ie, NeutralButton as j, Popup as ae, PopupSize as oe, PrimaryButton as se, RadioGroup as ce, ResizeHandle as M, Select as le, Spinner as ue, TagInput as de, Textarea as fe, TextareaResize as pe } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
4
4
|
import { IconArrowNarrowLeft as me, IconDatabase as he, IconFileZip as ge, IconFolderPlus as _e, IconPhoto as I, IconPlus as ve, IconTrashX as ye, IconUpload as be } from "@tabler/icons-react";
|
|
5
|
-
import { Suspense as xe, lazy as Se, memo as Ce, useCallback as L, useEffect as
|
|
6
|
-
import { DialFileNodeType as
|
|
7
|
-
import { LazyMarkdownEditor as
|
|
5
|
+
import { Suspense as xe, lazy as Se, memo as Ce, useCallback as L, useEffect as we, useId as Te, useMemo as R, useRef as z, useState as B } from "react";
|
|
6
|
+
import { DialFileNodeType as Ee, DialFoldersTree as De } from "@epam/ai-dial-react-file-manager";
|
|
7
|
+
import { LazyMarkdownEditor as Oe } from "@epam/ai-dial-ui-kit/editors";
|
|
8
8
|
c("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", {
|
|
9
9
|
body: "_body_1xd7h_2",
|
|
10
10
|
sideColumn: "_sideColumn_1xd7h_6",
|
|
@@ -12,42 +12,42 @@ c("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", {
|
|
|
12
12
|
}.sideColumn);
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region ../builder-form/src/constants/public-class-names.ts
|
|
15
|
-
var
|
|
15
|
+
var V = {
|
|
16
16
|
layout: "dial-builder-form-layout",
|
|
17
17
|
section: "dial-builder-form-section",
|
|
18
18
|
metadataSection: "dial-builder-form-metadata-section",
|
|
19
19
|
setupSection: "dial-builder-form-setup-section",
|
|
20
20
|
asideSection: "dial-builder-form-aside-section"
|
|
21
|
-
},
|
|
21
|
+
}, ke = {
|
|
22
22
|
section: "_section_l1mnx_1",
|
|
23
23
|
title: "_title_l1mnx_5"
|
|
24
|
-
},
|
|
24
|
+
}, Ae = ({ title: e, children: t, styles: n, className: r }) => {
|
|
25
25
|
let i = o({
|
|
26
26
|
"--es-border-color": n?.colors?.borderColor,
|
|
27
27
|
"--es-title-color": n?.colors?.titleColor
|
|
28
28
|
});
|
|
29
29
|
return /* @__PURE__ */ F("section", {
|
|
30
|
-
className: c("flex h-full flex-col gap-4 rounded border",
|
|
30
|
+
className: c("flex h-full flex-col gap-4 rounded border", ke.section, r, V.section),
|
|
31
31
|
style: i,
|
|
32
32
|
children: [e != null && /* @__PURE__ */ P("h2", {
|
|
33
|
-
className: c(n?.typography?.titleClassName ?? "dial-h3-text",
|
|
33
|
+
className: c(n?.typography?.titleClassName ?? "dial-h3-text", ke.title),
|
|
34
34
|
children: e
|
|
35
35
|
}), t]
|
|
36
36
|
});
|
|
37
|
-
},
|
|
37
|
+
}, H = (e, { min: t = 280, max: n = 640, containerWidth: r } = {}) => {
|
|
38
38
|
let i = r != null && r > 0 ? r - 360 : n;
|
|
39
39
|
return Math.round(Math.min(Math.max(t, Math.min(n, i)), Math.max(t, Number.isFinite(e) ? e : t)));
|
|
40
|
-
},
|
|
40
|
+
}, je = {
|
|
41
41
|
headerBorder: "_headerBorder_1adw2_1",
|
|
42
42
|
footerBorder: "_footerBorder_1adw2_5",
|
|
43
43
|
columnBorder: "_columnBorder_1adw2_10"
|
|
44
|
-
},
|
|
45
|
-
let m =
|
|
44
|
+
}, Me = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: i, centerContent: a, rightContent: s, resizableLeftColumn: l, isSaving: u = !1, labels: d, styles: f, dir: p }) => {
|
|
45
|
+
let m = Te(), h = u ? d?.savingStatusLabel ?? "Saving" : "", g = z(null), [_, v] = B(), x = l != null && a != null, S = l?.minWidth, C = l?.maxWidth, w = {
|
|
46
46
|
min: S,
|
|
47
47
|
max: C,
|
|
48
48
|
containerWidth: _
|
|
49
|
-
}, T = x ?
|
|
50
|
-
|
|
49
|
+
}, T = x ? H(l.width, w) : void 0, E = H(C ?? 640, w);
|
|
50
|
+
we(() => {
|
|
51
51
|
let e = g.current;
|
|
52
52
|
if (!x || e == null || typeof ResizeObserver > "u") return;
|
|
53
53
|
let t = new ResizeObserver(() => v(e.clientWidth));
|
|
@@ -59,7 +59,7 @@ var H = {
|
|
|
59
59
|
});
|
|
60
60
|
return /* @__PURE__ */ F("div", {
|
|
61
61
|
dir: p,
|
|
62
|
-
className: c("flex min-h-0 flex-1 flex-col",
|
|
62
|
+
className: c("flex min-h-0 flex-1 flex-col", V.layout),
|
|
63
63
|
style: D,
|
|
64
64
|
children: [
|
|
65
65
|
/* @__PURE__ */ P(ne, {
|
|
@@ -69,7 +69,7 @@ var H = {
|
|
|
69
69
|
children: h
|
|
70
70
|
}),
|
|
71
71
|
/* @__PURE__ */ F("div", {
|
|
72
|
-
className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3",
|
|
72
|
+
className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3", je.headerBorder),
|
|
73
73
|
children: [/* @__PURE__ */ F("div", {
|
|
74
74
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
75
75
|
children: [/* @__PURE__ */ P(ee, {
|
|
@@ -95,7 +95,7 @@ var H = {
|
|
|
95
95
|
className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
|
|
96
96
|
children: [
|
|
97
97
|
/* @__PURE__ */ P("div", {
|
|
98
|
-
className: c(a == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", a != null && !x && "desktop:w-[400px]", x && "desktop:relative desktop:w-(--el-left-width)", "desktop:overflow-y-auto", a == null ? void 0 :
|
|
98
|
+
className: c(a == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", a != null && !x && "desktop:w-[400px]", x && "desktop:relative desktop:w-(--el-left-width)", "desktop:overflow-y-auto", a == null ? void 0 : je.columnBorder),
|
|
99
99
|
style: T == null ? void 0 : { "--el-left-width": `${T}px` },
|
|
100
100
|
children: i
|
|
101
101
|
}),
|
|
@@ -116,22 +116,22 @@ var H = {
|
|
|
116
116
|
children: a
|
|
117
117
|
}),
|
|
118
118
|
s != null && /* @__PURE__ */ P("div", {
|
|
119
|
-
className: c("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s",
|
|
119
|
+
className: c("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", je.columnBorder),
|
|
120
120
|
children: s
|
|
121
121
|
})
|
|
122
122
|
]
|
|
123
123
|
}),
|
|
124
124
|
r != null && /* @__PURE__ */ P("div", {
|
|
125
|
-
className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 *:flex-1 desktop:hidden",
|
|
125
|
+
className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 *:flex-1 desktop:hidden", je.footerBorder),
|
|
126
126
|
children: r
|
|
127
127
|
})
|
|
128
128
|
]
|
|
129
129
|
});
|
|
130
|
-
},
|
|
130
|
+
}, Ne = {
|
|
131
131
|
box: "_box_c9as8_1",
|
|
132
132
|
icon: "_icon_c9as8_6",
|
|
133
133
|
caption: "_caption_c9as8_10"
|
|
134
|
-
},
|
|
134
|
+
}, Pe = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: i = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: a, captionClassName: s = "dial-tiny-text", styles: l, className: u }) => {
|
|
135
135
|
let d = o({
|
|
136
136
|
"--aa-box-bg": l?.colors?.boxBackgroundColor,
|
|
137
137
|
"--aa-box-border": l?.colors?.boxBorderColor,
|
|
@@ -144,7 +144,7 @@ var H = {
|
|
|
144
144
|
children: [/* @__PURE__ */ P(A, { label: e }), /* @__PURE__ */ F("div", {
|
|
145
145
|
className: "flex items-start gap-3",
|
|
146
146
|
children: [/* @__PURE__ */ P("div", {
|
|
147
|
-
className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border",
|
|
147
|
+
className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", Ne.box),
|
|
148
148
|
children: t ? /* @__PURE__ */ P("img", {
|
|
149
149
|
src: t,
|
|
150
150
|
alt: n,
|
|
@@ -153,7 +153,7 @@ var H = {
|
|
|
153
153
|
size: y.LG,
|
|
154
154
|
stroke: b,
|
|
155
155
|
"aria-hidden": !0,
|
|
156
|
-
className:
|
|
156
|
+
className: Ne.icon
|
|
157
157
|
})
|
|
158
158
|
}), /* @__PURE__ */ F("div", {
|
|
159
159
|
className: "flex flex-col gap-3",
|
|
@@ -168,16 +168,16 @@ var H = {
|
|
|
168
168
|
label: r,
|
|
169
169
|
onClick: a
|
|
170
170
|
}), /* @__PURE__ */ P("span", {
|
|
171
|
-
className: c(s,
|
|
171
|
+
className: c(s, Ne.caption),
|
|
172
172
|
children: i
|
|
173
173
|
})]
|
|
174
174
|
})]
|
|
175
175
|
})]
|
|
176
176
|
});
|
|
177
|
-
},
|
|
177
|
+
}, Fe = {
|
|
178
178
|
confirmText: "_confirmText_19ec1_1",
|
|
179
179
|
confirmItem: "_confirmItem_19ec1_5"
|
|
180
|
-
},
|
|
180
|
+
}, Ie = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: s, labels: l, confirmBodyClassName: u = "dial-small-text", styles: d }) => {
|
|
181
181
|
let f = d?.colors?.confirmText, p = d?.colors?.confirmItemText, m = L((e) => e.length === 1 ? l.deleteConfirmTitleSingle : l.deleteConfirmTitleMultiple, [l.deleteConfirmTitleSingle, l.deleteConfirmTitleMultiple]), h = L((e) => /* @__PURE__ */ P("div", {
|
|
182
182
|
className: c(u, "px-6 py-3"),
|
|
183
183
|
style: o({
|
|
@@ -185,12 +185,12 @@ var H = {
|
|
|
185
185
|
"--apm-confirm-item-text": p
|
|
186
186
|
}),
|
|
187
187
|
children: /* @__PURE__ */ P("p", {
|
|
188
|
-
className: c("mb-3",
|
|
188
|
+
className: c("mb-3", Fe.confirmText),
|
|
189
189
|
children: e.length === 1 ? /* @__PURE__ */ F(N, { children: [
|
|
190
190
|
l.deleteConfirmSingleText,
|
|
191
191
|
" ",
|
|
192
192
|
/* @__PURE__ */ F("span", {
|
|
193
|
-
className: c("wrap-break-word",
|
|
193
|
+
className: c("wrap-break-word", Fe.confirmItem),
|
|
194
194
|
children: [
|
|
195
195
|
"\"",
|
|
196
196
|
e[0].split("/").pop(),
|
|
@@ -201,7 +201,7 @@ var H = {
|
|
|
201
201
|
l.deleteConfirmMultipleText,
|
|
202
202
|
" ",
|
|
203
203
|
/* @__PURE__ */ F("span", {
|
|
204
|
-
className:
|
|
204
|
+
className: Fe.confirmItem,
|
|
205
205
|
children: [
|
|
206
206
|
e.length,
|
|
207
207
|
" ",
|
|
@@ -251,30 +251,30 @@ var H = {
|
|
|
251
251
|
deleteCancelLabel: l.deleteCancelLabel
|
|
252
252
|
})
|
|
253
253
|
});
|
|
254
|
-
},
|
|
254
|
+
}, U = /* @__PURE__ */ function(e) {
|
|
255
255
|
return e.Avatar = "avatar", e.Name = "name", e.Version = "version", e.Description = "description", e.Locales = "locales", e.Tags = "tags", e;
|
|
256
|
-
}({}),
|
|
256
|
+
}({}), Le = [
|
|
257
257
|
"avatar",
|
|
258
258
|
"name",
|
|
259
259
|
"version",
|
|
260
260
|
"description",
|
|
261
261
|
"locales",
|
|
262
262
|
"tags"
|
|
263
|
-
],
|
|
263
|
+
], Re = {
|
|
264
264
|
summary: "_summary_1hlc9_1",
|
|
265
265
|
rowLabel: "_rowLabel_1hlc9_5"
|
|
266
|
-
},
|
|
266
|
+
}, ze = (e, t, n) => ({
|
|
267
267
|
id: e,
|
|
268
268
|
language: n.find((e) => !t.has(e.code))?.code ?? "",
|
|
269
269
|
name: "",
|
|
270
270
|
description: ""
|
|
271
|
-
}),
|
|
271
|
+
}), Be = ({ value: e, onChange: t, availableLocaleOptions: n = [], labels: i, className: a, summaryClassName: s = "dial-body-text", rowLabelClassName: l = "dial-tiny-lead-text", colors: u }) => {
|
|
272
272
|
let d = o({
|
|
273
273
|
"--dlf-summary-text": u?.summaryText,
|
|
274
274
|
"--dlf-row-label-text": u?.rowLabelText
|
|
275
|
-
}), { summaryLabel: f, addLabel: p, editLabel: m, popupTitle: g, addLocaleLabel: v, localeRowLabel: S = "Locale", languageLabel: w, nameLabel: T, namePlaceholder: E, descriptionLabel: D, descriptionPlaceholder: O, deleteAriaLabel: ee, cancelLabel: A = "Cancel", saveLabel: ne = "Save" } = i, [re, ie] =
|
|
276
|
-
|
|
277
|
-
re && oe(e.length > 0 ? e : [
|
|
275
|
+
}), { summaryLabel: f, addLabel: p, editLabel: m, popupTitle: g, addLocaleLabel: v, localeRowLabel: S = "Locale", languageLabel: w, nameLabel: T, namePlaceholder: E, descriptionLabel: D, descriptionPlaceholder: O, deleteAriaLabel: ee, cancelLabel: A = "Cancel", saveLabel: ne = "Save" } = i, [re, ie] = B(!1), [j, oe] = B([]), se = z(0);
|
|
276
|
+
we(() => {
|
|
277
|
+
re && oe(e.length > 0 ? e : [ze(`locale-row-${++se.current}`, /* @__PURE__ */ new Set(), n)]);
|
|
278
278
|
}, [
|
|
279
279
|
re,
|
|
280
280
|
e,
|
|
@@ -284,7 +284,7 @@ var H = {
|
|
|
284
284
|
t(j.filter((e) => e.language && e.name)), ie(!1);
|
|
285
285
|
}, de = () => {
|
|
286
286
|
let e = new Set(j.map((e) => e.language).filter(Boolean));
|
|
287
|
-
oe((t) => [...t,
|
|
287
|
+
oe((t) => [...t, ze(`locale-row-${++se.current}`, e, n)]);
|
|
288
288
|
}, N = (e, t) => {
|
|
289
289
|
oe((n) => n.map((n) => n.id === e ? {
|
|
290
290
|
...n,
|
|
@@ -298,7 +298,7 @@ var H = {
|
|
|
298
298
|
style: d,
|
|
299
299
|
children: [
|
|
300
300
|
e.length > 0 && /* @__PURE__ */ P("span", {
|
|
301
|
-
className: c(
|
|
301
|
+
className: c(Re.summary, s),
|
|
302
302
|
children: `${f}: ${e.map((e) => `[${he(e.language)}]`).join(", ")}`
|
|
303
303
|
}),
|
|
304
304
|
/* @__PURE__ */ P(te, {
|
|
@@ -334,7 +334,7 @@ var H = {
|
|
|
334
334
|
children: [/* @__PURE__ */ F("div", {
|
|
335
335
|
className: "flex items-center justify-between",
|
|
336
336
|
children: [/* @__PURE__ */ F("span", {
|
|
337
|
-
className: c(
|
|
337
|
+
className: c(Re.rowLabel, l),
|
|
338
338
|
children: [
|
|
339
339
|
S,
|
|
340
340
|
" ",
|
|
@@ -409,9 +409,9 @@ var H = {
|
|
|
409
409
|
})
|
|
410
410
|
]
|
|
411
411
|
});
|
|
412
|
-
},
|
|
413
|
-
let x =
|
|
414
|
-
|
|
412
|
+
}, Ve = "Add tags, comma separated", He = "deployment-creation-form-description", Ue = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = Le, isNameReadOnly: m = !1, nameReadOnlyTooltip: h, nameCaption: g, isDescriptionRequired: _ = !1, descriptionCaption: v, renderDescription: y, focusRequestKey: b }) => {
|
|
413
|
+
let x = z(null), S = z(null), C = z(null), w = z(!1), T = (e) => p.includes(e), E = T(U.Name), D = T(U.Version), O = !!(t.name || t.version || t.description), ee = z(b);
|
|
414
|
+
we(() => {
|
|
415
415
|
let e = () => {
|
|
416
416
|
t.name ? x.current?.focus() : t.version ? S.current?.focus() : t.description && C.current?.focus();
|
|
417
417
|
};
|
|
@@ -424,7 +424,7 @@ var H = {
|
|
|
424
424
|
t.description
|
|
425
425
|
]);
|
|
426
426
|
let A = /* @__PURE__ */ P(fe, {
|
|
427
|
-
id:
|
|
427
|
+
id: He,
|
|
428
428
|
ref: C,
|
|
429
429
|
value: e.description,
|
|
430
430
|
onChange: (e) => n({ description: e }),
|
|
@@ -446,7 +446,7 @@ var H = {
|
|
|
446
446
|
"aria-label": u.ariaLabel,
|
|
447
447
|
className: c("flex flex-col gap-4", d?.root),
|
|
448
448
|
children: [
|
|
449
|
-
T(
|
|
449
|
+
T(U.Avatar) && /* @__PURE__ */ P(Pe, {
|
|
450
450
|
label: u.iconUrl.label,
|
|
451
451
|
avatarUrl: s,
|
|
452
452
|
addAvatarLabel: u.iconUrl.addAvatarLabel,
|
|
@@ -486,11 +486,11 @@ var H = {
|
|
|
486
486
|
containerClassName: E ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
|
|
487
487
|
})]
|
|
488
488
|
}),
|
|
489
|
-
T(
|
|
489
|
+
T(U.Description) && (y ? /* @__PURE__ */ P("div", {
|
|
490
490
|
className: d?.field,
|
|
491
|
-
children: y(A,
|
|
491
|
+
children: y(A, He)
|
|
492
492
|
}) : A),
|
|
493
|
-
T(
|
|
493
|
+
T(U.Locales) && /* @__PURE__ */ P(Be, {
|
|
494
494
|
value: e.otherLocales,
|
|
495
495
|
onChange: (e) => n({ otherLocales: e }),
|
|
496
496
|
availableLocaleOptions: f,
|
|
@@ -498,12 +498,12 @@ var H = {
|
|
|
498
498
|
className: d?.field,
|
|
499
499
|
colors: d?.localesColors
|
|
500
500
|
}),
|
|
501
|
-
T(
|
|
501
|
+
T(U.Tags) && /* @__PURE__ */ P("div", {
|
|
502
502
|
className: d?.field,
|
|
503
503
|
children: /* @__PURE__ */ P(de, {
|
|
504
504
|
id: "deployment-creation-form-topics",
|
|
505
505
|
labelProps: { label: u.topics.label },
|
|
506
|
-
placeholder: u.topics.placeholder ??
|
|
506
|
+
placeholder: u.topics.placeholder ?? Ve,
|
|
507
507
|
value: e.topics,
|
|
508
508
|
onChange: (e) => n({ topics: e }),
|
|
509
509
|
tagClassName: i
|
|
@@ -511,13 +511,13 @@ var H = {
|
|
|
511
511
|
})
|
|
512
512
|
]
|
|
513
513
|
});
|
|
514
|
-
},
|
|
514
|
+
}, We = "desktop:flex-1", Ge = "px-4 pt-4 desktop:px-6 desktop:pt-6", Ke = Ce(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: s, hideStandardActions: l = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, asideData: h, asideTitle: g, asideSectionClassName: _, alert: v, resizableLeftColumn: y, metadataSectionClassName: b, setupSectionClassName: x, labels: S, styles: C, dir: w }) => {
|
|
515
515
|
let T = /* @__PURE__ */ P(ne, {
|
|
516
516
|
politeness: ie.Assertive,
|
|
517
|
-
className: v == null ? void 0 :
|
|
517
|
+
className: v == null ? void 0 : Ge,
|
|
518
518
|
children: v
|
|
519
519
|
}), E = p != null;
|
|
520
|
-
return /* @__PURE__ */ P(
|
|
520
|
+
return /* @__PURE__ */ P(Me, {
|
|
521
521
|
title: e,
|
|
522
522
|
onBack: t,
|
|
523
523
|
backAriaLabel: S?.backAriaLabel ?? "Back",
|
|
@@ -528,10 +528,10 @@ var H = {
|
|
|
528
528
|
resizeHandleLabel: S?.resizeHandleLabel,
|
|
529
529
|
resizeHandleTooltip: S?.resizeHandleTooltip
|
|
530
530
|
},
|
|
531
|
-
rightContent: h == null ? void 0 : /* @__PURE__ */ P(
|
|
531
|
+
rightContent: h == null ? void 0 : /* @__PURE__ */ P(Ae, {
|
|
532
532
|
title: g,
|
|
533
533
|
styles: C?.section,
|
|
534
|
-
className: c(
|
|
534
|
+
className: c(_, V.asideSection),
|
|
535
535
|
children: h
|
|
536
536
|
}),
|
|
537
537
|
styles: C?.layout,
|
|
@@ -547,22 +547,22 @@ var H = {
|
|
|
547
547
|
})] })] }),
|
|
548
548
|
leftContent: /* @__PURE__ */ F(N, { children: [
|
|
549
549
|
!E && T,
|
|
550
|
-
/* @__PURE__ */ P(
|
|
550
|
+
/* @__PURE__ */ P(Ae, {
|
|
551
551
|
title: d === null ? void 0 : d ?? S?.metadataTitle ?? "Metadata",
|
|
552
552
|
styles: C?.section,
|
|
553
|
-
className: c(
|
|
553
|
+
className: c(b, V.metadataSection),
|
|
554
554
|
children: u
|
|
555
555
|
}),
|
|
556
556
|
f
|
|
557
557
|
] }),
|
|
558
|
-
centerContent: E ? /* @__PURE__ */ F(N, { children: [T, /* @__PURE__ */ P(
|
|
558
|
+
centerContent: E ? /* @__PURE__ */ F(N, { children: [T, /* @__PURE__ */ P(Ae, {
|
|
559
559
|
title: m === null ? void 0 : m ?? S?.setupTitle ?? "Setup",
|
|
560
560
|
styles: C?.section,
|
|
561
|
-
className: c(
|
|
561
|
+
className: c(We, x, V.setupSection),
|
|
562
562
|
children: p
|
|
563
563
|
})] }) : void 0
|
|
564
564
|
});
|
|
565
|
-
}),
|
|
565
|
+
}), qe = {
|
|
566
566
|
name: {
|
|
567
567
|
label: "Name",
|
|
568
568
|
placeholder: "Enter name"
|
|
@@ -601,7 +601,7 @@ var H = {
|
|
|
601
601
|
saveLabel: "Save"
|
|
602
602
|
},
|
|
603
603
|
ariaLabel: "Metadata"
|
|
604
|
-
},
|
|
604
|
+
}, Je = {
|
|
605
605
|
title: "Add avatar",
|
|
606
606
|
attachLabel: "Attach",
|
|
607
607
|
emptyTitle: "This folder is empty",
|
|
@@ -625,12 +625,12 @@ var H = {
|
|
|
625
625
|
deleteConfirmItemsLabel: "items?",
|
|
626
626
|
deleteConfirmLabel: "Delete",
|
|
627
627
|
deleteCancelLabel: "Cancel"
|
|
628
|
-
},
|
|
629
|
-
let [g, _] =
|
|
628
|
+
}, Ye = Ce(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Le, isNameReadOnly: c, nameReadOnlyTooltip: l, nameCaption: u, isDescriptionRequired: d, descriptionCaption: f, renderDescription: p, focusRequestKey: m, labels: h }) => {
|
|
629
|
+
let [g, _] = B(!1), v = R(() => a ? s : s.filter((e) => e !== U.Avatar), [a, s]), y = e.iconUrl, b = a?.resolveIconUrl, x = R(() => b ? b(y) : void 0, [y, b]), S = L(() => _(!0), []), C = L(() => _(!1), []), w = a?.resolveAttachedIconUrl, T = L((e) => {
|
|
630
630
|
let t = w?.(e);
|
|
631
631
|
t && n({ iconUrl: t }), _(!1);
|
|
632
632
|
}, [n, w]);
|
|
633
|
-
return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(
|
|
633
|
+
return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Ue, {
|
|
634
634
|
values: e,
|
|
635
635
|
errors: t,
|
|
636
636
|
onChange: n,
|
|
@@ -638,7 +638,7 @@ var H = {
|
|
|
638
638
|
onVersionBlur: i,
|
|
639
639
|
iconPreviewUrl: x,
|
|
640
640
|
onAddAvatarClick: S,
|
|
641
|
-
labels: h?.form ??
|
|
641
|
+
labels: h?.form ?? qe,
|
|
642
642
|
availableLocaleOptions: o,
|
|
643
643
|
fields: v,
|
|
644
644
|
isNameReadOnly: c,
|
|
@@ -648,7 +648,7 @@ var H = {
|
|
|
648
648
|
descriptionCaption: f,
|
|
649
649
|
renderDescription: p,
|
|
650
650
|
focusRequestKey: m
|
|
651
|
-
}), a && /* @__PURE__ */ P(
|
|
651
|
+
}), a && /* @__PURE__ */ P(Ie, {
|
|
652
652
|
isOpen: g,
|
|
653
653
|
onClose: C,
|
|
654
654
|
onAttach: T,
|
|
@@ -656,51 +656,51 @@ var H = {
|
|
|
656
656
|
FileManagerModal: a.FileManagerModal,
|
|
657
657
|
allowedMimeTypes: a.allowedMimeTypes,
|
|
658
658
|
maxFileSizeBytes: a.maxFileSizeBytes,
|
|
659
|
-
labels: h?.avatarPicker ??
|
|
659
|
+
labels: h?.avatarPicker ?? Je
|
|
660
660
|
})] });
|
|
661
|
-
}),
|
|
661
|
+
}), Xe = /* @__PURE__ */ function(e) {
|
|
662
662
|
return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
|
|
663
663
|
}({});
|
|
664
|
-
|
|
664
|
+
Xe.TooLong, Xe.ControlCharacters;
|
|
665
665
|
//#endregion
|
|
666
666
|
//#region src/constants/public-class-names.ts
|
|
667
|
-
var
|
|
667
|
+
var Ze = {
|
|
668
668
|
root: "dial-skill-editor-root",
|
|
669
669
|
refineFeedback: "dial-skill-editor-refine-feedback"
|
|
670
|
-
},
|
|
670
|
+
}, W = "SKILL.md", G = /* @__PURE__ */ function(e) {
|
|
671
671
|
return e.File = "file", e.Folder = "folder", e;
|
|
672
|
-
}({}),
|
|
672
|
+
}({}), Qe = /* @__PURE__ */ function(e) {
|
|
673
673
|
return e.Header = "header", e.Child = "child", e;
|
|
674
|
-
}({}),
|
|
674
|
+
}({}), $e = (e) => {
|
|
675
675
|
let t = e.lastIndexOf("/");
|
|
676
676
|
return t === -1 ? null : e.slice(0, t);
|
|
677
|
-
},
|
|
677
|
+
}, et = (e) => {
|
|
678
678
|
let t = e.lastIndexOf("/");
|
|
679
679
|
return t === -1 ? e : e.slice(t + 1);
|
|
680
|
-
},
|
|
680
|
+
}, tt = (e) => {
|
|
681
681
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
682
682
|
let n = t.get(e);
|
|
683
683
|
if (n) return n;
|
|
684
684
|
let r = {
|
|
685
685
|
path: e,
|
|
686
|
-
name:
|
|
687
|
-
nodeType:
|
|
688
|
-
parentPath:
|
|
686
|
+
name: et(e),
|
|
687
|
+
nodeType: Ee.FOLDER,
|
|
688
|
+
parentPath: $e(e),
|
|
689
689
|
folderId: e,
|
|
690
690
|
items: []
|
|
691
691
|
};
|
|
692
692
|
return t.set(e, r), r;
|
|
693
693
|
};
|
|
694
|
-
for (let r of e) r.kind ===
|
|
694
|
+
for (let r of e) r.kind === G.Folder ? n(r.path).name = r.name : t.set(r.path, {
|
|
695
695
|
path: r.path,
|
|
696
696
|
name: r.name,
|
|
697
|
-
nodeType:
|
|
698
|
-
parentPath:
|
|
699
|
-
folderId:
|
|
697
|
+
nodeType: Ee.ITEM,
|
|
698
|
+
parentPath: $e(r.path),
|
|
699
|
+
folderId: $e(r.path) ?? ""
|
|
700
700
|
});
|
|
701
701
|
for (let t of [...e]) {
|
|
702
|
-
let e =
|
|
703
|
-
for (; e != null;) n(e), e =
|
|
702
|
+
let e = $e(t.path);
|
|
703
|
+
for (; e != null;) n(e), e = $e(e);
|
|
704
704
|
}
|
|
705
705
|
let r = [];
|
|
706
706
|
for (let e of t.values()) {
|
|
@@ -712,17 +712,17 @@ var Xe = {
|
|
|
712
712
|
n ? n.items = [...n.items ?? [], e] : r.push(e);
|
|
713
713
|
}
|
|
714
714
|
return r;
|
|
715
|
-
},
|
|
716
|
-
let n = e.lastIndexOf("/"), r = n === -1 ? "" : e.slice(0, n), i = e.slice(n + 1), a = i.lastIndexOf("."), o = a > 0, s = o ? i.slice(0, a) : i, c = o ? i.slice(a) : "", l = 1, u =
|
|
717
|
-
for (; t.has(u);) l += 1, u =
|
|
715
|
+
}, nt = (e, t) => e ? `${e}/${t}` : t, rt = (e, t) => {
|
|
716
|
+
let n = e.lastIndexOf("/"), r = n === -1 ? "" : e.slice(0, n), i = e.slice(n + 1), a = i.lastIndexOf("."), o = a > 0, s = o ? i.slice(0, a) : i, c = o ? i.slice(a) : "", l = 1, u = nt(r, `${s} (${l})${c}`);
|
|
717
|
+
for (; t.has(u);) l += 1, u = nt(r, `${s} (${l})${c}`);
|
|
718
718
|
return u;
|
|
719
|
-
},
|
|
719
|
+
}, it = (e, t) => {
|
|
720
720
|
if (!t) return "";
|
|
721
721
|
switch (e) {
|
|
722
|
-
case
|
|
723
|
-
case
|
|
722
|
+
case Qe.Child: return t.path;
|
|
723
|
+
case Qe.Header: return t.kind === G.Folder ? t.path : "";
|
|
724
724
|
}
|
|
725
|
-
},
|
|
725
|
+
}, at = (e, t) => {
|
|
726
726
|
let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
|
|
727
727
|
for (let { path: i } of e) {
|
|
728
728
|
if (!i.startsWith(n) || i === t) continue;
|
|
@@ -730,19 +730,19 @@ var Xe = {
|
|
|
730
730
|
r.add(e.split("/")[0]);
|
|
731
731
|
}
|
|
732
732
|
return r;
|
|
733
|
-
},
|
|
733
|
+
}, ot = (e, t, n) => {
|
|
734
734
|
let r = e.trim();
|
|
735
735
|
if (!r) return n.required;
|
|
736
736
|
if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
|
|
737
737
|
if (t.has(r)) return n.duplicate;
|
|
738
|
-
},
|
|
739
|
-
let [o, s] =
|
|
738
|
+
}, K = "\\new-folder", st = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
|
|
739
|
+
let [o, s] = B(null), c = o?.parentPath ?? null, l = z([]), u = c == null ? void 0 : nt(c, K), d = R(() => u == null ? void 0 : {
|
|
740
740
|
path: u,
|
|
741
741
|
name: n,
|
|
742
|
-
kind:
|
|
742
|
+
kind: G.Folder
|
|
743
743
|
}, [u, n]), f = L((n, i) => {
|
|
744
|
-
let a =
|
|
745
|
-
return i === "" && a.add(
|
|
744
|
+
let a = at(e, i);
|
|
745
|
+
return i === "" && a.add(W), ot(n, a, r) ?? t.validateFolderPath?.(nt(i, n.trim()));
|
|
746
746
|
}, [
|
|
747
747
|
e,
|
|
748
748
|
r,
|
|
@@ -766,7 +766,7 @@ var Xe = {
|
|
|
766
766
|
]), h = L(() => {
|
|
767
767
|
l.current = [], s(null);
|
|
768
768
|
}, []), g = L((e, n) => {
|
|
769
|
-
let r =
|
|
769
|
+
let r = nt(n, e.trim());
|
|
770
770
|
t.onCreateFolder?.(r), n !== "" && i(n), a(r);
|
|
771
771
|
}, [
|
|
772
772
|
t,
|
|
@@ -793,22 +793,22 @@ var Xe = {
|
|
|
793
793
|
validateNewFolder: f,
|
|
794
794
|
createFolder: g
|
|
795
795
|
};
|
|
796
|
-
},
|
|
797
|
-
let [t, n] =
|
|
796
|
+
}, q = (e) => !!e.dataTransfer?.types.includes("Files"), ct = (e) => {
|
|
797
|
+
let [t, n] = B(!1), r = z(0);
|
|
798
798
|
return {
|
|
799
799
|
isDragActive: t,
|
|
800
800
|
dropZoneHandlers: {
|
|
801
801
|
onDragEnter: L((e) => {
|
|
802
|
-
|
|
802
|
+
q(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
803
803
|
}, []),
|
|
804
804
|
onDragLeave: L((e) => {
|
|
805
|
-
|
|
805
|
+
q(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
806
806
|
}, []),
|
|
807
807
|
onDragOver: L((e) => {
|
|
808
|
-
|
|
808
|
+
q(e) && e.preventDefault();
|
|
809
809
|
}, []),
|
|
810
810
|
onDrop: L((t) => {
|
|
811
|
-
if (!
|
|
811
|
+
if (!q(t)) return;
|
|
812
812
|
t.preventDefault(), r.current = 0, n(!1);
|
|
813
813
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
814
814
|
i.length > 0 && e(i);
|
|
@@ -817,7 +817,7 @@ var Xe = {
|
|
|
817
817
|
};
|
|
818
818
|
}, lt = /* @__PURE__ */ function(e) {
|
|
819
819
|
return e.Files = "files", e.Archive = "archive", e;
|
|
820
|
-
}({}),
|
|
820
|
+
}({}), J = /* @__PURE__ */ function(e) {
|
|
821
821
|
return e.Mobile = "mobile", e.Desktop = "desktop", e;
|
|
822
822
|
}({}), ut = (e, t, n = y.MD, r) => /* @__PURE__ */ P(e, {
|
|
823
823
|
size: n,
|
|
@@ -878,8 +878,8 @@ var Xe = {
|
|
|
878
878
|
children: p
|
|
879
879
|
});
|
|
880
880
|
}, pt = ({ isOpen: e, onClose: t, validateName: n, onCreate: r, title: i, nameLabel: a, namePlaceholder: o, createLabel: s, cancelLabel: c, closeAriaLabel: l, dialogColors: u }) => {
|
|
881
|
-
let d =
|
|
882
|
-
|
|
881
|
+
let d = Te(), [f, p] = B(""), [m, h] = B(!1);
|
|
882
|
+
we(() => {
|
|
883
883
|
e && (p(""), h(!1));
|
|
884
884
|
}, [e]);
|
|
885
885
|
let g = m ? n(f) : void 0, _ = () => {
|
|
@@ -966,29 +966,29 @@ var Xe = {
|
|
|
966
966
|
children: i
|
|
967
967
|
}), vt = /* @__PURE__ */ function(e) {
|
|
968
968
|
return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
|
|
969
|
-
}({}),
|
|
969
|
+
}({}), Y = /* @__PURE__ */ function(e) {
|
|
970
970
|
return e.Valid = "valid", e.Invalid = "invalid", e;
|
|
971
971
|
}({}), X = /* @__PURE__ */ function(e) {
|
|
972
972
|
return e.Replace = "replace", e.Duplicate = "duplicate", e;
|
|
973
|
-
}({}),
|
|
973
|
+
}({}), yt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), bt = {
|
|
974
974
|
invalidDropZone: "_invalidDropZone_j9j9q_1",
|
|
975
975
|
row: "_row_j9j9q_5"
|
|
976
|
-
},
|
|
977
|
-
id:
|
|
976
|
+
}, xt = ".zip,application/zip", St = [], Ct = 0, wt = () => `skill-file-candidate-${++Ct}`, Tt = (e, t, n) => ({
|
|
977
|
+
id: wt(),
|
|
978
978
|
file: e,
|
|
979
|
-
path:
|
|
980
|
-
}), Et = ({ isOpen: e, onClose: t, fileActions: n, mode: r = lt.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: l, existingFilePaths: u =
|
|
981
|
-
let _ = m ?? {}, [y, x] =
|
|
982
|
-
|
|
983
|
-
e && (
|
|
979
|
+
path: nt(n, t.replace(/\\/g, "/"))
|
|
980
|
+
}), Et = ({ isOpen: e, onClose: t, fileActions: n, mode: r = lt.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: l, existingFilePaths: u = St, onCommitted: d, messageClassName: f = "dial-small-text", rowCaptionClassName: p, labels: m, dialogColors: h, colors: g }) => {
|
|
981
|
+
let _ = m ?? {}, [y, x] = B([]), [S, C] = B([]), [w, O] = B(X.Replace), k = R(() => new Set(u), [u]), [A, te] = B(/* @__PURE__ */ new Map()), [j, ae] = B([]), [oe, se] = B(!1), [M, le] = B(), [de, fe] = B(!1), [pe, me] = B(), [he, ge] = B(0), _e = z(0), I = r === lt.Archive, ve = _.uploadArchiveErrorMessage ?? "Couldn't read this archive", be = Te(), xe = Te(), Se = Te(), Ce = z(null), L = z(!1), Ee = S[0]?.id;
|
|
982
|
+
we(() => {
|
|
983
|
+
e && (Ee == null ? L.current && (L.current = !1, document.getElementById(xe)?.focus()) : (L.current = !0, Ce.current?.focus()));
|
|
984
984
|
}, [
|
|
985
|
-
|
|
985
|
+
Ee,
|
|
986
986
|
e,
|
|
987
987
|
xe
|
|
988
988
|
]);
|
|
989
|
-
let
|
|
990
|
-
le(void 0), x((t) => [...t, ...e.filter((e) => !
|
|
991
|
-
},
|
|
989
|
+
let De = (e) => e.path !== "SKILL.md" && k.has(e.path), Oe = (e) => {
|
|
990
|
+
le(void 0), x((t) => [...t, ...e.filter((e) => !De(e))]), C((t) => [...t, ...e.filter(De)]);
|
|
991
|
+
}, V = (e) => {
|
|
992
992
|
let [t, ...n] = S;
|
|
993
993
|
t && (C(n), O(X.Replace), e != null && (le(void 0), x((r) => {
|
|
994
994
|
if (e === X.Replace) return [...r, {
|
|
@@ -1002,10 +1002,10 @@ var Xe = {
|
|
|
1002
1002
|
]);
|
|
1003
1003
|
return [...r, {
|
|
1004
1004
|
...t,
|
|
1005
|
-
path:
|
|
1005
|
+
path: rt(t.path, i)
|
|
1006
1006
|
}];
|
|
1007
1007
|
})));
|
|
1008
|
-
},
|
|
1008
|
+
}, ke = async (e) => {
|
|
1009
1009
|
let { extractArchive: t } = n;
|
|
1010
1010
|
if (!t) return;
|
|
1011
1011
|
let r = _e.current;
|
|
@@ -1018,24 +1018,24 @@ var Xe = {
|
|
|
1018
1018
|
me(_.uploadArchiveEmptyMessage ?? "This archive has no files");
|
|
1019
1019
|
return;
|
|
1020
1020
|
}
|
|
1021
|
-
|
|
1021
|
+
Oe(a.map((e) => Tt(e.file, e.path, i)));
|
|
1022
1022
|
} catch {
|
|
1023
1023
|
if (r !== _e.current) return;
|
|
1024
1024
|
me(ve);
|
|
1025
1025
|
} finally {
|
|
1026
1026
|
r === _e.current && ge((e) => e - 1);
|
|
1027
1027
|
}
|
|
1028
|
-
},
|
|
1029
|
-
I ?
|
|
1030
|
-
},
|
|
1028
|
+
}, Ae = (e) => {
|
|
1029
|
+
I ? ke(e) : Oe(e.map((e) => Tt(e, yt(e), i)));
|
|
1030
|
+
}, H = (e) => {
|
|
1031
1031
|
x((t) => t.filter((t) => t.id !== e));
|
|
1032
1032
|
};
|
|
1033
|
-
|
|
1033
|
+
we(() => {
|
|
1034
1034
|
if (!e) return;
|
|
1035
1035
|
_e.current += 1;
|
|
1036
|
-
let t = [...(a ?? []).map((e) =>
|
|
1037
|
-
x(t.filter((e) => !
|
|
1038
|
-
}, [e]),
|
|
1036
|
+
let t = [...(a ?? []).map((e) => Tt(e, yt(e), i)), ...(l ?? []).map((e) => Tt(e.file, e.path, i))];
|
|
1037
|
+
x(t.filter((e) => !De(e))), C(t.filter(De)), O(X.Replace), te(/* @__PURE__ */ new Map()), ae([]), le(void 0), me(void 0), ge(0);
|
|
1038
|
+
}, [e]), we(() => {
|
|
1039
1039
|
if (!e) return;
|
|
1040
1040
|
let t = !1;
|
|
1041
1041
|
if (y.length === 0) te(/* @__PURE__ */ new Map()), ae([]);
|
|
@@ -1047,14 +1047,14 @@ var Xe = {
|
|
|
1047
1047
|
t = !0;
|
|
1048
1048
|
};
|
|
1049
1049
|
}, [y, e]);
|
|
1050
|
-
let
|
|
1050
|
+
let je = y.some((e) => A.get(e.id)?.status === Y.Invalid), Me = y.length > 0 && y.every((e) => A.get(e.id)?.status === Y.Invalid), Ne = [...j, ...y.flatMap((e) => {
|
|
1051
1051
|
let t = A.get(e.id);
|
|
1052
|
-
return t?.status ===
|
|
1053
|
-
})],
|
|
1052
|
+
return t?.status === Y.Invalid && t.error ? [`${e.path}: ${t.error}`] : [];
|
|
1053
|
+
})], Pe = y.length > 0 && !je && j.length === 0 && !oe && !de && he === 0, Fe = async () => {
|
|
1054
1054
|
fe(!0), le(void 0);
|
|
1055
1055
|
try {
|
|
1056
1056
|
let { results: e, batchErrors: r } = await n.validateBatch(y), i = new Map(e.map((e) => [e.candidateId, e]));
|
|
1057
|
-
if (te(i), ae(r.map((e) => e.message)), y.some((e) => i.get(e.id)?.status ===
|
|
1057
|
+
if (te(i), ae(r.map((e) => e.message)), y.some((e) => i.get(e.id)?.status === Y.Invalid) || r.length > 0) return;
|
|
1058
1058
|
let a = await n.commitBatch(y);
|
|
1059
1059
|
if (a.error) {
|
|
1060
1060
|
le(a.error);
|
|
@@ -1064,18 +1064,18 @@ var Xe = {
|
|
|
1064
1064
|
} finally {
|
|
1065
1065
|
fe(!1);
|
|
1066
1066
|
}
|
|
1067
|
-
},
|
|
1068
|
-
if (
|
|
1067
|
+
}, Ie = _.uploadDialogCloseAriaLabel ?? "Close", U = _.uploadCancelLabel ?? "Cancel", [Le] = S;
|
|
1068
|
+
if (Le) {
|
|
1069
1069
|
let t = _.uploadConflictTitle ?? "Replace or duplicate it?";
|
|
1070
1070
|
return /* @__PURE__ */ P(ft, {
|
|
1071
1071
|
isOpen: e,
|
|
1072
1072
|
title: t,
|
|
1073
|
-
closeAriaLabel:
|
|
1074
|
-
onClose: () =>
|
|
1073
|
+
closeAriaLabel: Ie,
|
|
1074
|
+
onClose: () => V(null),
|
|
1075
1075
|
confirmLabel: _.uploadConflictConfirmLabel ?? "Confirm",
|
|
1076
|
-
onConfirm: () =>
|
|
1077
|
-
cancelLabel:
|
|
1078
|
-
onCancel: () =>
|
|
1076
|
+
onConfirm: () => V(w),
|
|
1077
|
+
cancelLabel: U,
|
|
1078
|
+
onCancel: () => V(null),
|
|
1079
1079
|
colors: h,
|
|
1080
1080
|
children: /* @__PURE__ */ F("div", {
|
|
1081
1081
|
className: "flex flex-col gap-4 px-4 py-4 desktop:px-6",
|
|
@@ -1083,7 +1083,7 @@ var Xe = {
|
|
|
1083
1083
|
ref: Ce,
|
|
1084
1084
|
tabIndex: -1,
|
|
1085
1085
|
className: c("outline-hidden", f),
|
|
1086
|
-
children: _.uploadConflictMessage?.(
|
|
1086
|
+
children: _.uploadConflictMessage?.(Le.path) ?? `Item with the same name "${Le.path}" already exists.`
|
|
1087
1087
|
}), /* @__PURE__ */ P(ce, {
|
|
1088
1088
|
ariaLabel: t,
|
|
1089
1089
|
value: w,
|
|
@@ -1102,13 +1102,13 @@ var Xe = {
|
|
|
1102
1102
|
return /* @__PURE__ */ P(ft, {
|
|
1103
1103
|
isOpen: e,
|
|
1104
1104
|
title: I ? _.uploadArchiveDialogTitle ?? "Upload archive from device" : _.uploadDialogTitle ?? "Upload files from device",
|
|
1105
|
-
closeAriaLabel:
|
|
1105
|
+
closeAriaLabel: Ie,
|
|
1106
1106
|
onClose: t,
|
|
1107
1107
|
confirmLabel: _.uploadConfirmLabel ?? "Add",
|
|
1108
|
-
onConfirm: () => void
|
|
1109
|
-
isConfirmDisabled: !
|
|
1108
|
+
onConfirm: () => void Fe(),
|
|
1109
|
+
isConfirmDisabled: !Pe,
|
|
1110
1110
|
isConfirming: de,
|
|
1111
|
-
cancelLabel:
|
|
1111
|
+
cancelLabel: U,
|
|
1112
1112
|
onCancel: t,
|
|
1113
1113
|
colors: h,
|
|
1114
1114
|
children: /* @__PURE__ */ F("div", {
|
|
@@ -1130,9 +1130,9 @@ var Xe = {
|
|
|
1130
1130
|
id: xe,
|
|
1131
1131
|
ariaLabel: _.uploadDropZoneAriaLabel ?? "Upload files",
|
|
1132
1132
|
multiple: !0,
|
|
1133
|
-
accept: I ?
|
|
1134
|
-
className:
|
|
1135
|
-
onChange:
|
|
1133
|
+
accept: I ? xt : void 0,
|
|
1134
|
+
className: Me ? bt.invalidDropZone : void 0,
|
|
1135
|
+
onChange: Ae,
|
|
1136
1136
|
onReject: I ? () => me(ve) : void 0
|
|
1137
1137
|
}),
|
|
1138
1138
|
he > 0 && /* @__PURE__ */ P(ue, { ariaLabel: _.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
|
|
@@ -1144,15 +1144,15 @@ var Xe = {
|
|
|
1144
1144
|
visuallyHidden: !0,
|
|
1145
1145
|
as: re.Span,
|
|
1146
1146
|
id: be,
|
|
1147
|
-
children:
|
|
1147
|
+
children: Ne.map((e) => `${_.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
|
|
1148
1148
|
}),
|
|
1149
1149
|
j.map((e) => /* @__PURE__ */ P(T, { text: e }, e)),
|
|
1150
1150
|
y.length > 0 && /* @__PURE__ */ P("ul", {
|
|
1151
1151
|
className: "flex flex-col gap-2",
|
|
1152
1152
|
children: y.map((e) => {
|
|
1153
|
-
let t = A.get(e.id), n = t?.kind === vt.Manifest, r = t?.status ===
|
|
1153
|
+
let t = A.get(e.id), n = t?.kind === vt.Manifest, r = t?.status === Y.Invalid, i = r ? t?.error : void 0, a = `${Se}${e.id}`;
|
|
1154
1154
|
return /* @__PURE__ */ F("li", {
|
|
1155
|
-
className: c("flex items-center gap-2 rounded-lg border p-2",
|
|
1155
|
+
className: c("flex items-center gap-2 rounded-lg border p-2", bt.row),
|
|
1156
1156
|
children: [/* @__PURE__ */ P(D, {
|
|
1157
1157
|
name: e.path,
|
|
1158
1158
|
className: "min-w-0 flex-1",
|
|
@@ -1182,7 +1182,7 @@ var Xe = {
|
|
|
1182
1182
|
}),
|
|
1183
1183
|
"aria-label": _.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
|
|
1184
1184
|
"aria-describedby": i ? a : void 0,
|
|
1185
|
-
onClick: () =>
|
|
1185
|
+
onClick: () => H(e.id)
|
|
1186
1186
|
})]
|
|
1187
1187
|
}, e.id);
|
|
1188
1188
|
})
|
|
@@ -1203,93 +1203,93 @@ var Xe = {
|
|
|
1203
1203
|
}, Ot = {
|
|
1204
1204
|
mode: lt.Files,
|
|
1205
1205
|
targetFolderPath: ""
|
|
1206
|
-
}, kt = [
|
|
1207
|
-
let { MarkdownEditor: e } = await
|
|
1206
|
+
}, kt = [U.Name, U.Description], At = 24, jt = 300, Mt = "pb-0 desktop:px-8 desktop:py-6", Nt = "desktop:px-8 desktop:py-6", Pt = "gap-4 px-4 pt-5 pb-6 desktop:gap-5 desktop:px-8 desktop:py-6", Ft = Se(async () => {
|
|
1207
|
+
let { MarkdownEditor: e } = await Oe();
|
|
1208
1208
|
return { default: e };
|
|
1209
|
-
}),
|
|
1210
|
-
let [
|
|
1209
|
+
}), Z = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: d, expandedPaths: p, onExpandedPathsChange: m, isLoading: x = !1, hasLoadError: E = !1, isSubmitting: D = !1, errors: k, submitError: te, conflict: ne, onReloadLatest: re, isNameReadOnly: ie = !1, onDirtyChange: j, onValuesChange: ae, onRefineDescription: oe, onRefineInstructions: ce, fileActions: M, supportingFileContent: le, asideData: de, onSubmit: fe, onCancel: pe, onBack: me, backAriaLabel: I, title: ve, onRetry: Se, onRetrySubmit: Ce, labels: Oe, styles: V, dir: ke, instructionsEditorTheme: Ae = S.light }) => {
|
|
1210
|
+
let [H, je] = B({
|
|
1211
1211
|
name: r?.name ?? "",
|
|
1212
1212
|
description: r?.description ?? "",
|
|
1213
1213
|
instructions: r?.instructions ?? ""
|
|
1214
|
-
}),
|
|
1215
|
-
u(() => document.getElementById(
|
|
1216
|
-
let
|
|
1214
|
+
}), Me = Te(), Ne = Te();
|
|
1215
|
+
u(() => document.getElementById(Me), Ne, !!k?.instructions);
|
|
1216
|
+
let Pe = z(void 0), Fe = l({
|
|
1217
1217
|
bottomGap: At,
|
|
1218
1218
|
minHeight: jt
|
|
1219
|
-
}),
|
|
1219
|
+
}), Ie = z(H), U = (e) => {
|
|
1220
1220
|
let t = {
|
|
1221
|
-
...
|
|
1221
|
+
...Ie.current,
|
|
1222
1222
|
...e
|
|
1223
1223
|
};
|
|
1224
|
-
|
|
1225
|
-
},
|
|
1226
|
-
if (
|
|
1227
|
-
|
|
1224
|
+
Ie.current = t, je(t), ae?.(t);
|
|
1225
|
+
}, Le = (e) => e ? async (t, n) => {
|
|
1226
|
+
if (Pe.current && !Pe.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
1227
|
+
Pe.current = n;
|
|
1228
1228
|
try {
|
|
1229
1229
|
return await e(t, n);
|
|
1230
1230
|
} finally {
|
|
1231
|
-
|
|
1231
|
+
Pe.current === n && (Pe.current = void 0);
|
|
1232
1232
|
}
|
|
1233
|
-
} : void 0,
|
|
1234
|
-
value:
|
|
1235
|
-
onChange: (e) =>
|
|
1236
|
-
onRefine:
|
|
1233
|
+
} : void 0, Re = f({
|
|
1234
|
+
value: H.description,
|
|
1235
|
+
onChange: (e) => U({ description: e }),
|
|
1236
|
+
onRefine: Le(oe),
|
|
1237
1237
|
disabled: D || x || E,
|
|
1238
1238
|
resetKey: r
|
|
1239
|
-
}),
|
|
1240
|
-
value:
|
|
1241
|
-
onChange: (e) =>
|
|
1242
|
-
onRefine:
|
|
1239
|
+
}), ze = f({
|
|
1240
|
+
value: H.instructions,
|
|
1241
|
+
onChange: (e) => U({ instructions: e }),
|
|
1242
|
+
onRefine: Le(ce),
|
|
1243
1243
|
disabled: D || x || E,
|
|
1244
1244
|
resetKey: r
|
|
1245
|
-
}),
|
|
1246
|
-
|
|
1247
|
-
}, Be = () => {
|
|
1248
|
-
ze(), pe();
|
|
1249
|
-
}, Ve = () => {
|
|
1250
|
-
ze(), me();
|
|
1245
|
+
}), Be = Re.isPending || ze.isPending, Ve = () => {
|
|
1246
|
+
Re.reset(), ze.reset();
|
|
1251
1247
|
}, He = () => {
|
|
1252
|
-
|
|
1253
|
-
}, Ue =
|
|
1254
|
-
|
|
1255
|
-
|
|
1248
|
+
Ve(), pe();
|
|
1249
|
+
}, Ue = () => {
|
|
1250
|
+
Ve(), me();
|
|
1251
|
+
}, We = () => {
|
|
1252
|
+
D || x || E || Pe.current && !Pe.current.aborted || fe(H);
|
|
1253
|
+
}, Ge = z(r), Je = Ge.current !== r, Xe = z(i), [$e, et] = B(!1);
|
|
1254
|
+
we(() => {
|
|
1255
|
+
Ge.current = r;
|
|
1256
1256
|
let e = {
|
|
1257
1257
|
name: r?.name ?? "",
|
|
1258
1258
|
description: r?.description ?? "",
|
|
1259
1259
|
instructions: r?.instructions ?? ""
|
|
1260
1260
|
};
|
|
1261
|
-
|
|
1261
|
+
Ie.current = e, je(e), Xe.current = i, et(!1);
|
|
1262
1262
|
}, [r]);
|
|
1263
|
-
let
|
|
1264
|
-
|
|
1265
|
-
if (
|
|
1263
|
+
let nt = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), rt = z(!1);
|
|
1264
|
+
we(() => {
|
|
1265
|
+
if (Je) return;
|
|
1266
1266
|
let e = {
|
|
1267
1267
|
name: r?.name ?? "",
|
|
1268
1268
|
description: r?.description ?? "",
|
|
1269
1269
|
instructions: r?.instructions ?? ""
|
|
1270
|
-
}, t = JSON.stringify(
|
|
1271
|
-
t !==
|
|
1270
|
+
}, t = JSON.stringify(H) !== JSON.stringify(e) || nt(i) !== nt(Xe.current) || $e;
|
|
1271
|
+
t !== rt.current && (rt.current = t, j?.(t));
|
|
1272
1272
|
}, [
|
|
1273
|
-
|
|
1273
|
+
H,
|
|
1274
1274
|
i,
|
|
1275
1275
|
r,
|
|
1276
|
-
|
|
1277
|
-
|
|
1276
|
+
Je,
|
|
1277
|
+
$e,
|
|
1278
1278
|
j
|
|
1279
1279
|
]);
|
|
1280
|
-
let [
|
|
1281
|
-
|
|
1282
|
-
}, [d]), [
|
|
1280
|
+
let [at, ot] = B(W), K = s ?? at, q = L((e) => {
|
|
1281
|
+
ot(e), d?.(e);
|
|
1282
|
+
}, [d]), [dt, ft] = B([]), mt = p ?? dt, gt = R(() => new Set(mt), [mt]), vt = L((e) => {
|
|
1283
1283
|
let t = [...e];
|
|
1284
|
-
|
|
1285
|
-
}, [m]), [
|
|
1286
|
-
bt(e),
|
|
1287
|
-
}, []), [St, Ct] =
|
|
1288
|
-
|
|
1284
|
+
ft(t), m?.(t);
|
|
1285
|
+
}, [m]), [Y, X] = B(!1), [yt, bt] = B(Ot), xt = L((e) => {
|
|
1286
|
+
bt(e), X(!0);
|
|
1287
|
+
}, []), [St, Ct] = B(!1), { isDragActive: wt, dropZoneHandlers: Tt } = ct(L((e) => {
|
|
1288
|
+
Y || xt({
|
|
1289
1289
|
...Ot,
|
|
1290
1290
|
initialFiles: e
|
|
1291
1291
|
});
|
|
1292
|
-
}, [
|
|
1292
|
+
}, [Y, xt])), Z = Oe ?? {}, Q = V?.colors, $ = V?.typography ?? {}, It = $.titleClassName ?? "dial-body-semi-text", Lt = $.helperTextClassName ?? "dial-tiny-semi-text", Rt = $.removeIconClassName, zt = R(() => o({ "--se-menu-icon": Q?.menuIcon }), [Q?.menuIcon]), Bt = o({
|
|
1293
1293
|
"--se-title-color": Q?.title,
|
|
1294
1294
|
"--se-helper-text-color": Q?.helperText,
|
|
1295
1295
|
"--se-refine-action-text": Q?.refineActionText,
|
|
@@ -1301,7 +1301,7 @@ var Xe = {
|
|
|
1301
1301
|
footerBackground: Q?.dialogFooterBackground,
|
|
1302
1302
|
footerBorder: Q?.dialogFooterBorder
|
|
1303
1303
|
}, Ht = {
|
|
1304
|
-
feedbackClassName: c(Q?.refineActionText && Dt.refineFeedback, $.refineFeedbackClassName,
|
|
1304
|
+
feedbackClassName: c(Q?.refineActionText && Dt.refineFeedback, $.refineFeedbackClassName, Ze.refineFeedback),
|
|
1305
1305
|
errorClassName: Dt.refineError
|
|
1306
1306
|
}, Ut = {
|
|
1307
1307
|
layout: Q?.border ? { colors: {
|
|
@@ -1309,7 +1309,7 @@ var Xe = {
|
|
|
1309
1309
|
sidebarBorderColor: Q.border
|
|
1310
1310
|
} } : void 0,
|
|
1311
1311
|
section: Q?.title ? { colors: { titleColor: Q.title } } : void 0
|
|
1312
|
-
}, Wt =
|
|
1312
|
+
}, Wt = R(() => ({
|
|
1313
1313
|
required: Z.folderNameRequiredError ?? "Enter a folder name",
|
|
1314
1314
|
invalid: Z.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
|
|
1315
1315
|
duplicate: Z.folderNameDuplicateError ?? "An item with this name already exists here"
|
|
@@ -1318,8 +1318,8 @@ var Xe = {
|
|
|
1318
1318
|
Z.folderNameInvalidError,
|
|
1319
1319
|
Z.folderNameDuplicateError
|
|
1320
1320
|
]), Gt = L((e) => {
|
|
1321
|
-
|
|
1322
|
-
}, [
|
|
1321
|
+
gt.has(e) || vt(/* @__PURE__ */ new Set([...gt, e]));
|
|
1322
|
+
}, [gt, vt]), Kt = yt.targetFolderPath, qt = R(() => ({
|
|
1323
1323
|
...M,
|
|
1324
1324
|
commitBatch: async (e) => {
|
|
1325
1325
|
let t = await M.commitBatch(e);
|
|
@@ -1329,22 +1329,22 @@ var Xe = {
|
|
|
1329
1329
|
M,
|
|
1330
1330
|
Kt,
|
|
1331
1331
|
Gt
|
|
1332
|
-
]), Jt =
|
|
1332
|
+
]), Jt = st({
|
|
1333
1333
|
files: i,
|
|
1334
1334
|
fileActions: M,
|
|
1335
1335
|
defaultName: Z.newFolderDefaultName ?? "New folder",
|
|
1336
1336
|
messages: Wt,
|
|
1337
1337
|
onRevealFolder: Gt,
|
|
1338
|
-
onCreated:
|
|
1339
|
-
}), { draftNode: Yt, draftPath: Xt, draftPane: Zt } = Jt, Qt =
|
|
1340
|
-
path:
|
|
1341
|
-
name:
|
|
1342
|
-
kind:
|
|
1343
|
-
}, ...i]), [i]), $t =
|
|
1338
|
+
onCreated: q
|
|
1339
|
+
}), { draftNode: Yt, draftPath: Xt, draftPane: Zt } = Jt, Qt = R(() => tt([{
|
|
1340
|
+
path: W,
|
|
1341
|
+
name: W,
|
|
1342
|
+
kind: G.File
|
|
1343
|
+
}, ...i]), [i]), $t = R(() => Yt ? tt([
|
|
1344
1344
|
{
|
|
1345
|
-
path:
|
|
1346
|
-
name:
|
|
1347
|
-
kind:
|
|
1345
|
+
path: W,
|
|
1346
|
+
name: W,
|
|
1347
|
+
kind: G.File
|
|
1348
1348
|
},
|
|
1349
1349
|
...i,
|
|
1350
1350
|
Yt
|
|
@@ -1352,17 +1352,17 @@ var Xe = {
|
|
|
1352
1352
|
i,
|
|
1353
1353
|
Yt,
|
|
1354
1354
|
Qt
|
|
1355
|
-
]), en =
|
|
1356
|
-
e.path !== Xt &&
|
|
1357
|
-
}, [
|
|
1358
|
-
M.onRemoveNode(e),
|
|
1355
|
+
]), en = R(() => i.find((e) => e.path === K), [i, K]), tn = L((e) => {
|
|
1356
|
+
e.path !== Xt && q(e.path);
|
|
1357
|
+
}, [q, Xt]), nn = L((e) => {
|
|
1358
|
+
M.onRemoveNode(e), K === e && q(W);
|
|
1359
1359
|
}, [
|
|
1360
1360
|
M,
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
]), { startDraft: rn } = Jt, { onCreateFolder: an, extractArchive: on, pickFromFileSystem: sn } = M, [cn, ln] =
|
|
1364
|
-
t ===
|
|
1365
|
-
}, [rn]), dn =
|
|
1361
|
+
K,
|
|
1362
|
+
q
|
|
1363
|
+
]), { startDraft: rn } = Jt, { onCreateFolder: an, extractArchive: on, pickFromFileSystem: sn } = M, [cn, ln] = B(null), un = L((e, t) => {
|
|
1364
|
+
t === J.Mobile ? ln(e) : rn(e, t);
|
|
1365
|
+
}, [rn]), dn = R(() => i.filter((e) => e.kind === G.File).map((e) => e.path), [i]), fn = L(async (e) => {
|
|
1366
1366
|
if (!sn) return;
|
|
1367
1367
|
let t = await sn();
|
|
1368
1368
|
t?.length && xt({
|
|
@@ -1411,23 +1411,23 @@ var Xe = {
|
|
|
1411
1411
|
un,
|
|
1412
1412
|
xt,
|
|
1413
1413
|
fn
|
|
1414
|
-
]), mn =
|
|
1415
|
-
let e =
|
|
1414
|
+
]), mn = R(() => {
|
|
1415
|
+
let e = it(Qe.Header, i.find((e) => e.path === K));
|
|
1416
1416
|
return {
|
|
1417
|
-
[
|
|
1418
|
-
[
|
|
1417
|
+
[J.Mobile]: pn(e, J.Mobile),
|
|
1418
|
+
[J.Desktop]: pn(e, J.Desktop)
|
|
1419
1419
|
};
|
|
1420
1420
|
}, [
|
|
1421
1421
|
pn,
|
|
1422
1422
|
i,
|
|
1423
|
-
|
|
1423
|
+
K
|
|
1424
1424
|
]), hn = L((e, t) => {
|
|
1425
|
-
if (e.path === Xt || e.nodeType !==
|
|
1425
|
+
if (e.path === Xt || e.nodeType !== Ee.FOLDER) return [];
|
|
1426
1426
|
let n = {
|
|
1427
1427
|
path: e.path,
|
|
1428
1428
|
name: e.name,
|
|
1429
|
-
kind:
|
|
1430
|
-
}, r = pn(
|
|
1429
|
+
kind: G.Folder
|
|
1430
|
+
}, r = pn(it(Qe.Child, n), t);
|
|
1431
1431
|
return r.push({
|
|
1432
1432
|
key: "delete",
|
|
1433
1433
|
label: Z.deleteLabel ?? "Delete",
|
|
@@ -1441,10 +1441,10 @@ var Xe = {
|
|
|
1441
1441
|
Rt,
|
|
1442
1442
|
pn,
|
|
1443
1443
|
nn
|
|
1444
|
-
]), gn =
|
|
1445
|
-
[
|
|
1446
|
-
[
|
|
1447
|
-
}), [hn]), _n = L((e) => e.nodeType ===
|
|
1444
|
+
]), gn = R(() => ({
|
|
1445
|
+
[J.Mobile]: (e) => hn(e, J.Mobile),
|
|
1446
|
+
[J.Desktop]: (e) => hn(e, J.Desktop)
|
|
1447
|
+
}), [hn]), _n = L((e) => e.nodeType === Ee.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ P(ee, {
|
|
1448
1448
|
size: C.Small,
|
|
1449
1449
|
icon: ut(ye, Rt, y.SM),
|
|
1450
1450
|
"aria-label": Z.deleteLabel ?? "Delete",
|
|
@@ -1470,12 +1470,12 @@ var Xe = {
|
|
|
1470
1470
|
}), /* @__PURE__ */ P("div", {
|
|
1471
1471
|
role: "tree",
|
|
1472
1472
|
"aria-label": Z.filesTreeAriaLabel ?? "Skill files",
|
|
1473
|
-
children: /* @__PURE__ */ P(
|
|
1473
|
+
children: /* @__PURE__ */ P(De, {
|
|
1474
1474
|
items: Zt === e ? $t : Qt,
|
|
1475
1475
|
showFiles: !0,
|
|
1476
|
-
selectedPath:
|
|
1477
|
-
expandedPaths:
|
|
1478
|
-
onExpandedPathsChange:
|
|
1476
|
+
selectedPath: K,
|
|
1477
|
+
expandedPaths: gt,
|
|
1478
|
+
onExpandedPathsChange: vt,
|
|
1479
1479
|
onItemClick: tn,
|
|
1480
1480
|
getContextMenuItems: gn[e],
|
|
1481
1481
|
renderItemActions: _n,
|
|
@@ -1486,18 +1486,18 @@ var Xe = {
|
|
|
1486
1486
|
rootItemPath: ""
|
|
1487
1487
|
})
|
|
1488
1488
|
})]
|
|
1489
|
-
}), yn =
|
|
1490
|
-
name:
|
|
1491
|
-
description:
|
|
1489
|
+
}), yn = R(() => ({
|
|
1490
|
+
name: H.name,
|
|
1491
|
+
description: H.description,
|
|
1492
1492
|
iconUrl: "",
|
|
1493
1493
|
version: "",
|
|
1494
1494
|
topics: [],
|
|
1495
1495
|
otherLocales: []
|
|
1496
|
-
}), [
|
|
1496
|
+
}), [H.name, H.description]), bn = R(() => ({
|
|
1497
1497
|
name: k?.name,
|
|
1498
1498
|
description: k?.description
|
|
1499
|
-
}), [k?.name, k?.description]), xn =
|
|
1500
|
-
...
|
|
1499
|
+
}), [k?.name, k?.description]), xn = R(() => ({ form: {
|
|
1500
|
+
...qe,
|
|
1501
1501
|
name: {
|
|
1502
1502
|
label: Z.nameLabel ?? "Name",
|
|
1503
1503
|
placeholder: Z.namePlaceholder ?? "good-morning-breakfast"
|
|
@@ -1513,24 +1513,24 @@ var Xe = {
|
|
|
1513
1513
|
Z.descriptionLabel,
|
|
1514
1514
|
Z.descriptionPlaceholder
|
|
1515
1515
|
]), Sn = (e) => {
|
|
1516
|
-
e.name !== void 0 &&
|
|
1516
|
+
e.name !== void 0 && U({ name: e.name }), e.description !== void 0 && (Re.reset(), U({ description: e.description }));
|
|
1517
1517
|
}, Cn = oe ? (e, t) => /* @__PURE__ */ P(a, {
|
|
1518
1518
|
isEnabled: !0,
|
|
1519
1519
|
fieldId: t,
|
|
1520
1520
|
required: !0,
|
|
1521
1521
|
label: Z.descriptionLabel ?? "Description",
|
|
1522
1522
|
labels: Z,
|
|
1523
|
-
refinement:
|
|
1524
|
-
disabled:
|
|
1523
|
+
refinement: Re,
|
|
1524
|
+
disabled: Be || D,
|
|
1525
1525
|
...Ht,
|
|
1526
1526
|
children: e
|
|
1527
1527
|
}) : void 0, wn = {
|
|
1528
1528
|
title: ve,
|
|
1529
|
-
onBack:
|
|
1530
|
-
onCancel:
|
|
1531
|
-
onSubmit:
|
|
1529
|
+
onBack: Ue,
|
|
1530
|
+
onCancel: He,
|
|
1531
|
+
onSubmit: We,
|
|
1532
1532
|
submitLabel: Z.createLabel ?? "Create",
|
|
1533
|
-
isSubmitDisabled:
|
|
1533
|
+
isSubmitDisabled: Be || x || E,
|
|
1534
1534
|
labels: {
|
|
1535
1535
|
cancelLabel: Z.cancelLabel ?? "Cancel",
|
|
1536
1536
|
backAriaLabel: I ?? "Back",
|
|
@@ -1540,9 +1540,9 @@ var Xe = {
|
|
|
1540
1540
|
metadataTitle: null
|
|
1541
1541
|
};
|
|
1542
1542
|
if (x) return /* @__PURE__ */ P("div", {
|
|
1543
|
-
dir:
|
|
1543
|
+
dir: ke,
|
|
1544
1544
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1545
|
-
children: /* @__PURE__ */ P(
|
|
1545
|
+
children: /* @__PURE__ */ P(Ke, {
|
|
1546
1546
|
...wn,
|
|
1547
1547
|
metadata: /* @__PURE__ */ P("div", {
|
|
1548
1548
|
className: "flex flex-1 items-center justify-center p-8",
|
|
@@ -1551,9 +1551,9 @@ var Xe = {
|
|
|
1551
1551
|
})
|
|
1552
1552
|
});
|
|
1553
1553
|
if (E) return /* @__PURE__ */ P("div", {
|
|
1554
|
-
dir:
|
|
1554
|
+
dir: ke,
|
|
1555
1555
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1556
|
-
children: /* @__PURE__ */ P(
|
|
1556
|
+
children: /* @__PURE__ */ P(Ke, {
|
|
1557
1557
|
...wn,
|
|
1558
1558
|
metadata: /* @__PURE__ */ P("div", {
|
|
1559
1559
|
className: "p-8",
|
|
@@ -1568,7 +1568,7 @@ var Xe = {
|
|
|
1568
1568
|
})
|
|
1569
1569
|
})
|
|
1570
1570
|
});
|
|
1571
|
-
let Tn =
|
|
1571
|
+
let Tn = K === W, En = Tn ? W : Z.selectedFileHeading?.(en?.name ?? K) ?? en?.name ?? K, Dn = te != null || ne != null ? /* @__PURE__ */ F("div", {
|
|
1572
1572
|
className: "flex flex-col gap-2",
|
|
1573
1573
|
children: [te != null && /* @__PURE__ */ F("div", {
|
|
1574
1574
|
className: "flex items-center gap-2",
|
|
@@ -1585,61 +1585,61 @@ var Xe = {
|
|
|
1585
1585
|
})]
|
|
1586
1586
|
}) : void 0, On = /* @__PURE__ */ P(a, {
|
|
1587
1587
|
isEnabled: !!ce,
|
|
1588
|
-
fieldId:
|
|
1588
|
+
fieldId: Me,
|
|
1589
1589
|
required: !0,
|
|
1590
1590
|
labelClassName: c(Dt.helperText, Lt),
|
|
1591
1591
|
label: Z.instructionsLabel ?? "Instructions",
|
|
1592
1592
|
labels: Z,
|
|
1593
|
-
refinement:
|
|
1594
|
-
disabled:
|
|
1593
|
+
refinement: ze,
|
|
1594
|
+
disabled: Be || D,
|
|
1595
1595
|
...Ht,
|
|
1596
1596
|
children: /* @__PURE__ */ F("div", {
|
|
1597
1597
|
className: "flex flex-1 flex-col gap-2",
|
|
1598
1598
|
children: [
|
|
1599
1599
|
!ce && /* @__PURE__ */ P(A, {
|
|
1600
|
-
htmlFor:
|
|
1600
|
+
htmlFor: Me,
|
|
1601
1601
|
className: c(Dt.helperText, Lt),
|
|
1602
1602
|
label: Z.instructionsLabel ?? "Instructions",
|
|
1603
1603
|
required: !0
|
|
1604
1604
|
}),
|
|
1605
1605
|
/* @__PURE__ */ P("div", {
|
|
1606
|
-
ref:
|
|
1606
|
+
ref: Fe,
|
|
1607
1607
|
className: c(t, e, n),
|
|
1608
1608
|
children: /* @__PURE__ */ P(xe, {
|
|
1609
1609
|
fallback: /* @__PURE__ */ P(ue, { ariaLabel: Z.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
1610
1610
|
children: /* @__PURE__ */ P(Ft, {
|
|
1611
|
-
id:
|
|
1611
|
+
id: Me,
|
|
1612
1612
|
ariaLabel: Z.instructionsLabel ?? "Instructions",
|
|
1613
|
-
value:
|
|
1613
|
+
value: H.instructions,
|
|
1614
1614
|
onChange: (e) => {
|
|
1615
|
-
|
|
1615
|
+
ze.reset(), U({ instructions: e });
|
|
1616
1616
|
},
|
|
1617
|
-
theme:
|
|
1617
|
+
theme: Ae,
|
|
1618
1618
|
showDragbar: !1,
|
|
1619
1619
|
placeholder: Z.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
|
|
1620
1620
|
})
|
|
1621
1621
|
})
|
|
1622
1622
|
}),
|
|
1623
1623
|
k?.instructions != null && /* @__PURE__ */ P(T, {
|
|
1624
|
-
id:
|
|
1624
|
+
id: Ne,
|
|
1625
1625
|
text: k.instructions
|
|
1626
1626
|
})
|
|
1627
1627
|
]
|
|
1628
1628
|
})
|
|
1629
1629
|
});
|
|
1630
1630
|
return /* @__PURE__ */ F("div", {
|
|
1631
|
-
dir:
|
|
1632
|
-
className: c("relative flex min-h-0 min-w-0 flex-1 flex-col",
|
|
1631
|
+
dir: ke,
|
|
1632
|
+
className: c("relative flex min-h-0 min-w-0 flex-1 flex-col", Ze.root),
|
|
1633
1633
|
style: Bt,
|
|
1634
1634
|
...Tt,
|
|
1635
1635
|
children: [
|
|
1636
1636
|
/* @__PURE__ */ P(ht, {
|
|
1637
|
-
isVisible: wt && !
|
|
1638
|
-
labels:
|
|
1637
|
+
isVisible: wt && !Y,
|
|
1638
|
+
labels: Oe,
|
|
1639
1639
|
titleClassName: $.dropOverlayTitleClassName,
|
|
1640
1640
|
subtitleClassName: $.dropOverlaySubtitleClassName
|
|
1641
1641
|
}),
|
|
1642
|
-
/* @__PURE__ */ P(
|
|
1642
|
+
/* @__PURE__ */ P(Ke, {
|
|
1643
1643
|
...wn,
|
|
1644
1644
|
asideData: de,
|
|
1645
1645
|
asideSectionClassName: Nt,
|
|
@@ -1654,16 +1654,16 @@ var Xe = {
|
|
|
1654
1654
|
onToggle: Ct,
|
|
1655
1655
|
labelClassName: $.editingFileLabelClassName,
|
|
1656
1656
|
fileNameClassName: $.editingFileNameClassName,
|
|
1657
|
-
children: vn(
|
|
1657
|
+
children: vn(J.Mobile)
|
|
1658
1658
|
})
|
|
1659
1659
|
}), /* @__PURE__ */ P("div", {
|
|
1660
1660
|
className: "hidden desktop:block",
|
|
1661
|
-
children: vn(
|
|
1661
|
+
children: vn(J.Desktop)
|
|
1662
1662
|
})] }),
|
|
1663
1663
|
alert: Dn,
|
|
1664
1664
|
setupTitle: En,
|
|
1665
1665
|
setupSectionClassName: Pt,
|
|
1666
|
-
setup: Tn ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(
|
|
1666
|
+
setup: Tn ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Ye, {
|
|
1667
1667
|
values: yn,
|
|
1668
1668
|
errors: bn,
|
|
1669
1669
|
onChange: Sn,
|
|
@@ -1674,26 +1674,26 @@ var Xe = {
|
|
|
1674
1674
|
nameCaption: k?.name ? void 0 : Z.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
|
|
1675
1675
|
renderDescription: Cn,
|
|
1676
1676
|
labels: xn
|
|
1677
|
-
}), On] }) : /* @__PURE__ */ P(N, { children: en?.kind ===
|
|
1677
|
+
}), On] }) : /* @__PURE__ */ P(N, { children: en?.kind === G.File && /* @__PURE__ */ P("div", {
|
|
1678
1678
|
className: "flex h-[max(320px,60dvh)] min-h-0 min-w-0 flex-none flex-col desktop:h-auto desktop:flex-1",
|
|
1679
1679
|
children: le ?? /* @__PURE__ */ P(v, { text: Z.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." })
|
|
1680
1680
|
}) })
|
|
1681
1681
|
}),
|
|
1682
1682
|
/* @__PURE__ */ P(Et, {
|
|
1683
|
-
isOpen:
|
|
1684
|
-
onClose: () =>
|
|
1683
|
+
isOpen: Y,
|
|
1684
|
+
onClose: () => X(!1),
|
|
1685
1685
|
fileActions: qt,
|
|
1686
|
-
mode:
|
|
1687
|
-
targetFolderPath:
|
|
1688
|
-
initialFiles:
|
|
1689
|
-
initialEntries:
|
|
1686
|
+
mode: yt.mode,
|
|
1687
|
+
targetFolderPath: yt.targetFolderPath,
|
|
1688
|
+
initialFiles: yt.initialFiles,
|
|
1689
|
+
initialEntries: yt.initialEntries,
|
|
1690
1690
|
existingFilePaths: dn,
|
|
1691
1691
|
onCommitted: (e) => {
|
|
1692
|
-
e.some((e) => e.replacesExisting) &&
|
|
1692
|
+
e.some((e) => e.replacesExisting) && et(!0);
|
|
1693
1693
|
},
|
|
1694
1694
|
messageClassName: $.uploadMessageClassName,
|
|
1695
1695
|
rowCaptionClassName: $.uploadRowCaptionClassName,
|
|
1696
|
-
labels:
|
|
1696
|
+
labels: Oe,
|
|
1697
1697
|
dialogColors: Vt,
|
|
1698
1698
|
colors: {
|
|
1699
1699
|
invalidDropZoneBorder: Q?.uploadInvalidDropZoneBorder,
|
|
@@ -1717,4 +1717,4 @@ var Xe = {
|
|
|
1717
1717
|
});
|
|
1718
1718
|
};
|
|
1719
1719
|
//#endregion
|
|
1720
|
-
export {
|
|
1720
|
+
export { Ze as SKILL_EDITOR_CLASS, Z as SkillEditor, vt as SkillFileCandidateKind, G as SkillFileNodeKind, lt as SkillFileUploadMode, Y as SkillFileValidationStatus };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-skill-editor",
|
|
3
3
|
"description": "Host-agnostic form for authoring a DIAL Skill, with an inline supporting-file tree",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.296",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"@tabler/icons-react": "^3.50.0",
|
|
21
21
|
"@uiw/react-markdown-preview": "^5.2.1",
|
|
22
22
|
"@uiw/react-md-editor": "^4.2.2",
|
|
23
|
-
"@epam/ai-dial-builder-form": "1.3.0-dev.
|
|
23
|
+
"@epam/ai-dial-builder-form": "1.3.0-dev.296"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
26
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.296",
|
|
27
27
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.67",
|
|
28
28
|
"@epam/ai-dial-react-file-manager": "^0.4.0-dev.25",
|
|
29
29
|
"react": "^19.2.8"
|