@epam/ai-dial-skill-editor 1.3.0-dev.321 → 1.3.0-dev.325
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/components/SkillFolderPreview/SkillFolderPreview.d.ts +5 -0
- package/components/SkillFolderPreview/SkillFolderPreview.d.ts.map +1 -0
- package/index.css +2 -2
- package/index.js +746 -649
- package/models/skill-editor-props.d.ts +20 -0
- package/models/skill-editor-props.d.ts.map +1 -1
- package/models/skill-folder-preview-props.d.ts +28 -0
- package/models/skill-folder-preview-props.d.ts.map +1 -0
- package/package.json +3 -3
- package/utils/file-tree.d.ts +16 -0
- package/utils/file-tree.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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, useControlErrorAssociation as u, useIsMobile as d, useTextRefinement as f } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { Accordion as p, BottomSheet as m,
|
|
2
|
+
import { Accordion as p, BottomSheet as m, Breadcrumbs as h, ButtonAppearance as g, ButtonDropdown as _, ButtonVariant as v, CaptionText as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE as x, DangerIconButton as S, DialItemType as C, EditorThemes as w, ElementSize as T, ErrorMessageNotification as E, ErrorText as D, FileDropzone as O, FileName as k, GhostButton as A, GhostIconButton as ee, Input as j, Label as te, LinkButton as ne, LiveRegion as re, LiveRegionElement as ie, LiveRegionPoliteness as M, NeutralButton as ae, NoDataContent as oe, Popup as N, PopupSize as se, PrimaryButton as ce, RadioGroup as le, ResizeHandle as ue, Select as de, Spinner as fe, TagInput as pe, Textarea as me, TextareaResize as he } 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
|
|
5
|
-
import { Suspense as
|
|
6
|
-
import { DialFileNodeType as
|
|
7
|
-
import { LazyMarkdownEditor as
|
|
4
|
+
import { IconArrowNarrowLeft as ge, IconDatabase as _e, IconFileZip as ve, IconFolderPlus as ye, IconPhoto as be, IconPlus as xe, IconTrashX as Se, IconUpload as Ce } from "@tabler/icons-react";
|
|
5
|
+
import { Suspense as we, lazy as Te, memo as Ee, useCallback as L, useEffect as De, useId as Oe, useMemo as R, useRef as z, useState as B } from "react";
|
|
6
|
+
import { DialFileNodeType as ke, DialFoldersTree as Ae } from "@epam/ai-dial-react-file-manager";
|
|
7
|
+
import { LazyMarkdownEditor as je } 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,70 +12,70 @@ 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
|
+
}, Me = {
|
|
22
22
|
section: "_section_l1mnx_1",
|
|
23
23
|
title: "_title_l1mnx_5"
|
|
24
|
-
},
|
|
24
|
+
}, Ne = ({ 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__ */ I("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", Me.section, r, V.section),
|
|
31
31
|
style: i,
|
|
32
32
|
children: [e != null && /* @__PURE__ */ F("h2", {
|
|
33
|
-
className: c(n?.typography?.titleClassName ?? "dial-h3-text",
|
|
33
|
+
className: c(n?.typography?.titleClassName ?? "dial-h3-text", Me.title),
|
|
34
34
|
children: e
|
|
35
35
|
}), t]
|
|
36
36
|
});
|
|
37
|
-
},
|
|
37
|
+
}, Pe = (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
|
+
}, H = {
|
|
41
41
|
headerBorder: "_headerBorder_1adw2_1",
|
|
42
42
|
footerBorder: "_footerBorder_1adw2_5",
|
|
43
43
|
columnBorder: "_columnBorder_1adw2_10"
|
|
44
|
-
},
|
|
45
|
-
let m =
|
|
44
|
+
}, Fe = ({ 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 = Oe(), h = u ? d?.savingStatusLabel ?? "Saving" : "", g = z(null), [_, v] = B(), y = l != null && a != null, S = l?.minWidth, C = l?.maxWidth, w = {
|
|
46
46
|
min: S,
|
|
47
47
|
max: C,
|
|
48
48
|
containerWidth: _
|
|
49
|
-
}, T =
|
|
50
|
-
|
|
49
|
+
}, T = y ? Pe(l.width, w) : void 0, E = Pe(C ?? 640, w);
|
|
50
|
+
De(() => {
|
|
51
51
|
let e = g.current;
|
|
52
|
-
if (!
|
|
52
|
+
if (!y || e == null || typeof ResizeObserver > "u") return;
|
|
53
53
|
let t = new ResizeObserver(() => v(e.clientWidth));
|
|
54
54
|
return t.observe(e), () => t.disconnect();
|
|
55
|
-
}, [
|
|
55
|
+
}, [y]);
|
|
56
56
|
let D = o({
|
|
57
57
|
"--el-header-border-color": f?.colors?.headerBorderColor,
|
|
58
58
|
"--el-sidebar-border-color": f?.colors?.sidebarBorderColor
|
|
59
59
|
});
|
|
60
60
|
return /* @__PURE__ */ I("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
|
-
/* @__PURE__ */ F(
|
|
65
|
+
/* @__PURE__ */ F(re, {
|
|
66
66
|
visuallyHidden: !0,
|
|
67
|
-
as:
|
|
67
|
+
as: ie.Span,
|
|
68
68
|
id: m,
|
|
69
69
|
children: h
|
|
70
70
|
}),
|
|
71
71
|
/* @__PURE__ */ I("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", H.headerBorder),
|
|
73
73
|
children: [/* @__PURE__ */ I("div", {
|
|
74
74
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
75
75
|
children: [/* @__PURE__ */ F(ee, {
|
|
76
|
-
icon: /* @__PURE__ */ F(
|
|
77
|
-
size:
|
|
78
|
-
stroke:
|
|
76
|
+
icon: /* @__PURE__ */ F(ge, {
|
|
77
|
+
size: b.LG,
|
|
78
|
+
stroke: x,
|
|
79
79
|
"aria-hidden": !0,
|
|
80
80
|
className: "rtl:scale-x-[-1]"
|
|
81
81
|
}),
|
|
@@ -95,13 +95,13 @@ var U = {
|
|
|
95
95
|
className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
|
|
96
96
|
children: [
|
|
97
97
|
/* @__PURE__ */ F("div", {
|
|
98
|
-
className: c(a == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", a != null && !
|
|
98
|
+
className: c(a == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", a != null && !y && "desktop:w-[400px]", y && "desktop:relative desktop:w-(--el-left-width)", "desktop:overflow-y-auto", a == null ? void 0 : H.columnBorder),
|
|
99
99
|
style: T == null ? void 0 : { "--el-left-width": `${T}px` },
|
|
100
100
|
children: i
|
|
101
101
|
}),
|
|
102
|
-
|
|
102
|
+
y && T != null && /* @__PURE__ */ F("div", {
|
|
103
103
|
className: "relative hidden w-0 shrink-0 desktop:block",
|
|
104
|
-
children: /* @__PURE__ */ F(
|
|
104
|
+
children: /* @__PURE__ */ F(ue, {
|
|
105
105
|
width: T,
|
|
106
106
|
minWidth: S ?? 280,
|
|
107
107
|
maxWidth: E,
|
|
@@ -116,22 +116,22 @@ var U = {
|
|
|
116
116
|
children: a
|
|
117
117
|
}),
|
|
118
118
|
s != null && /* @__PURE__ */ F("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", H.columnBorder),
|
|
120
120
|
children: s
|
|
121
121
|
})
|
|
122
122
|
]
|
|
123
123
|
}),
|
|
124
124
|
r != null && /* @__PURE__ */ F("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", H.footerBorder),
|
|
126
126
|
children: r
|
|
127
127
|
})
|
|
128
128
|
]
|
|
129
129
|
});
|
|
130
|
-
},
|
|
130
|
+
}, Ie = {
|
|
131
131
|
box: "_box_c9as8_1",
|
|
132
132
|
icon: "_icon_c9as8_6",
|
|
133
133
|
caption: "_caption_c9as8_10"
|
|
134
|
-
},
|
|
134
|
+
}, Le = ({ 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,
|
|
@@ -141,56 +141,56 @@ var U = {
|
|
|
141
141
|
return /* @__PURE__ */ I("div", {
|
|
142
142
|
className: c("flex flex-col gap-2", u),
|
|
143
143
|
style: d,
|
|
144
|
-
children: [/* @__PURE__ */ F(
|
|
144
|
+
children: [/* @__PURE__ */ F(te, { label: e }), /* @__PURE__ */ I("div", {
|
|
145
145
|
className: "flex items-start gap-3",
|
|
146
146
|
children: [/* @__PURE__ */ F("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", Ie.box),
|
|
148
148
|
children: t ? /* @__PURE__ */ F("img", {
|
|
149
149
|
src: t,
|
|
150
150
|
alt: n,
|
|
151
151
|
className: "h-16 w-16 object-cover"
|
|
152
|
-
}) : /* @__PURE__ */ F(
|
|
153
|
-
size:
|
|
154
|
-
stroke:
|
|
152
|
+
}) : /* @__PURE__ */ F(be, {
|
|
153
|
+
size: b.LG,
|
|
154
|
+
stroke: x,
|
|
155
155
|
"aria-hidden": !0,
|
|
156
|
-
className:
|
|
156
|
+
className: Ie.icon
|
|
157
157
|
})
|
|
158
158
|
}), /* @__PURE__ */ I("div", {
|
|
159
159
|
className: "flex flex-col gap-3",
|
|
160
|
-
children: [/* @__PURE__ */ F(
|
|
161
|
-
size:
|
|
162
|
-
iconBefore: /* @__PURE__ */ F(
|
|
163
|
-
size:
|
|
164
|
-
stroke:
|
|
160
|
+
children: [/* @__PURE__ */ F(A, {
|
|
161
|
+
size: T.Small,
|
|
162
|
+
iconBefore: /* @__PURE__ */ F(xe, {
|
|
163
|
+
size: b.SM,
|
|
164
|
+
stroke: x,
|
|
165
165
|
"aria-hidden": !0
|
|
166
166
|
}),
|
|
167
167
|
className: "w-fit",
|
|
168
168
|
label: r,
|
|
169
169
|
onClick: a
|
|
170
170
|
}), /* @__PURE__ */ F("span", {
|
|
171
|
-
className: c(s,
|
|
171
|
+
className: c(s, Ie.caption),
|
|
172
172
|
children: i
|
|
173
173
|
})]
|
|
174
174
|
})]
|
|
175
175
|
})]
|
|
176
176
|
});
|
|
177
|
-
},
|
|
177
|
+
}, Re = {
|
|
178
178
|
confirmText: "_confirmText_19ec1_1",
|
|
179
179
|
confirmItem: "_confirmItem_19ec1_5"
|
|
180
|
-
},
|
|
181
|
-
let f = d?.colors?.confirmText, p = d?.colors?.confirmItemText, m =
|
|
180
|
+
}, ze = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: s, labels: l, confirmBodyClassName: u = "dial-small-text", styles: d }) => {
|
|
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__ */ F("div", {
|
|
182
182
|
className: c(u, "px-6 py-3"),
|
|
183
183
|
style: o({
|
|
184
184
|
"--apm-confirm-text": f,
|
|
185
185
|
"--apm-confirm-item-text": p
|
|
186
186
|
}),
|
|
187
187
|
children: /* @__PURE__ */ F("p", {
|
|
188
|
-
className: c("mb-3",
|
|
188
|
+
className: c("mb-3", Re.confirmText),
|
|
189
189
|
children: e.length === 1 ? /* @__PURE__ */ I(P, { children: [
|
|
190
190
|
l.deleteConfirmSingleText,
|
|
191
191
|
" ",
|
|
192
192
|
/* @__PURE__ */ I("span", {
|
|
193
|
-
className: c("wrap-break-word",
|
|
193
|
+
className: c("wrap-break-word", Re.confirmItem),
|
|
194
194
|
children: [
|
|
195
195
|
"\"",
|
|
196
196
|
e[0].split("/").pop(),
|
|
@@ -201,7 +201,7 @@ var U = {
|
|
|
201
201
|
l.deleteConfirmMultipleText,
|
|
202
202
|
" ",
|
|
203
203
|
/* @__PURE__ */ I("span", {
|
|
204
|
-
className:
|
|
204
|
+
className: Re.confirmItem,
|
|
205
205
|
children: [
|
|
206
206
|
e.length,
|
|
207
207
|
" ",
|
|
@@ -218,7 +218,7 @@ var U = {
|
|
|
218
218
|
p,
|
|
219
219
|
u
|
|
220
220
|
]);
|
|
221
|
-
return /* @__PURE__ */ F(
|
|
221
|
+
return /* @__PURE__ */ F(we, {
|
|
222
222
|
fallback: null,
|
|
223
223
|
children: e && /* @__PURE__ */ F(i, {
|
|
224
224
|
isOpen: e,
|
|
@@ -251,202 +251,209 @@ var U = {
|
|
|
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
|
+
}({}), Be = [
|
|
257
257
|
"avatar",
|
|
258
258
|
"name",
|
|
259
259
|
"version",
|
|
260
260
|
"description",
|
|
261
261
|
"locales",
|
|
262
262
|
"tags"
|
|
263
|
-
],
|
|
263
|
+
], Ve = {
|
|
264
264
|
summary: "_summary_1hlc9_1",
|
|
265
265
|
rowLabel: "_rowLabel_1hlc9_5"
|
|
266
|
-
},
|
|
266
|
+
}, He = (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
|
-
}),
|
|
272
|
-
let
|
|
273
|
-
"--dlf-summary-text":
|
|
274
|
-
"--dlf-row-label-text":
|
|
275
|
-
}), { summaryLabel:
|
|
276
|
-
|
|
277
|
-
|
|
271
|
+
}), Ue = (e) => e.toUpperCase(), We = ({ value: e, onChange: t, availableLocaleOptions: n = [], formatLocaleLabel: i = Ue, labels: a, className: s, summaryClassName: l = "dial-body-text", rowLabelClassName: u = "dial-tiny-lead-text", colors: d }) => {
|
|
272
|
+
let f = o({
|
|
273
|
+
"--dlf-summary-text": d?.summaryText,
|
|
274
|
+
"--dlf-row-label-text": d?.rowLabelText
|
|
275
|
+
}), { summaryLabel: p, addLabel: m, editLabel: h, popupTitle: _, addLocaleLabel: y, localeRowLabel: C = "Locale", languageLabel: w, nameLabel: E, namePlaceholder: D, descriptionLabel: O, descriptionPlaceholder: k, deleteAriaLabel: A, cancelLabel: ee = "Cancel", saveLabel: te = "Save" } = a, [re, ie] = B(!1), [M, ae] = B([]), oe = z(0);
|
|
276
|
+
De(() => {
|
|
277
|
+
re && ae(e.length > 0 ? e : [He(`locale-row-${++oe.current}`, /* @__PURE__ */ new Set(), n)]);
|
|
278
278
|
}, [
|
|
279
|
-
|
|
279
|
+
re,
|
|
280
280
|
e,
|
|
281
281
|
n
|
|
282
282
|
]);
|
|
283
|
-
let se = () =>
|
|
284
|
-
t(M.filter((e) => e.language && e.name)),
|
|
283
|
+
let se = () => ie(!0), ce = () => ie(!1), le = () => {
|
|
284
|
+
t(M.filter((e) => e.language && e.name)), ie(!1);
|
|
285
285
|
}, ue = () => {
|
|
286
286
|
let e = new Set(M.map((e) => e.language).filter(Boolean));
|
|
287
|
-
ae((t) => [...t,
|
|
288
|
-
},
|
|
287
|
+
ae((t) => [...t, He(`locale-row-${++oe.current}`, e, n)]);
|
|
288
|
+
}, fe = (e, t) => {
|
|
289
289
|
ae((n) => n.map((n) => n.id === e ? {
|
|
290
290
|
...n,
|
|
291
291
|
...t
|
|
292
292
|
} : n));
|
|
293
293
|
}, pe = (e) => {
|
|
294
294
|
ae((t) => t.filter((t) => t.id !== e));
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
295
|
+
}, P = new Set(n.map((e) => e.code)), ge = (e) => e !== "" && !P.has(e), _e = e.some((e) => ge(e.language)), ve = new Set(M.map((e) => e.language).filter((e) => P.has(e))).size, ye = (t, r) => {
|
|
296
|
+
let a = e.find((e) => e.id === t.id)?.language, o = [...new Set([a ?? "", t.language].filter(ge))];
|
|
297
|
+
return [...n.map((e) => ({
|
|
298
|
+
value: e.code,
|
|
299
|
+
label: e.label,
|
|
300
|
+
disabled: r.has(e.code)
|
|
301
|
+
})), ...o.map((e) => ({
|
|
302
|
+
value: e,
|
|
303
|
+
label: i(e),
|
|
304
|
+
disabled: r.has(e)
|
|
305
|
+
}))];
|
|
306
|
+
}, be = M.some((e) => !e.language || !e.name);
|
|
307
|
+
return n.length === 0 && !_e ? null : /* @__PURE__ */ I("div", {
|
|
308
|
+
className: c("flex items-center gap-2", s),
|
|
309
|
+
style: f,
|
|
299
310
|
children: [
|
|
300
311
|
e.length > 0 && /* @__PURE__ */ F("span", {
|
|
301
|
-
className: c(
|
|
302
|
-
children: `${
|
|
312
|
+
className: c(Ve.summary, l),
|
|
313
|
+
children: `${p}: ${e.map((e) => `[${e.language.toUpperCase()}]`).join(", ")}`
|
|
303
314
|
}),
|
|
304
|
-
/* @__PURE__ */ F(
|
|
305
|
-
label: e.length > 0 ?
|
|
306
|
-
iconBefore: /* @__PURE__ */ F(
|
|
307
|
-
size:
|
|
315
|
+
/* @__PURE__ */ F(ne, {
|
|
316
|
+
label: e.length > 0 ? h : m,
|
|
317
|
+
iconBefore: /* @__PURE__ */ F(xe, {
|
|
318
|
+
size: b.SM,
|
|
308
319
|
"aria-hidden": !0,
|
|
309
|
-
stroke:
|
|
320
|
+
stroke: x
|
|
310
321
|
}),
|
|
311
322
|
className: "px-0!",
|
|
312
323
|
onClick: se
|
|
313
324
|
}),
|
|
314
|
-
/* @__PURE__ */ F(
|
|
315
|
-
open:
|
|
316
|
-
header:
|
|
317
|
-
onClose:
|
|
325
|
+
/* @__PURE__ */ F(N, {
|
|
326
|
+
open: re,
|
|
327
|
+
header: _,
|
|
328
|
+
onClose: ce,
|
|
318
329
|
mainButtons: [{
|
|
319
|
-
label:
|
|
320
|
-
onClick:
|
|
330
|
+
label: ee,
|
|
331
|
+
onClick: ce
|
|
321
332
|
}, {
|
|
322
333
|
label: te,
|
|
323
|
-
variant:
|
|
324
|
-
disabled:
|
|
334
|
+
variant: v.Primary,
|
|
335
|
+
disabled: be,
|
|
325
336
|
onClick: le
|
|
326
337
|
}],
|
|
327
338
|
children: /* @__PURE__ */ I("div", {
|
|
328
339
|
className: "flex flex-col gap-8 px-6 py-3",
|
|
329
|
-
style:
|
|
340
|
+
style: f,
|
|
330
341
|
children: [M.map((e, t) => {
|
|
331
|
-
let
|
|
342
|
+
let n = new Set(M.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
|
|
332
343
|
return /* @__PURE__ */ I("div", {
|
|
333
344
|
className: "flex flex-col gap-2",
|
|
334
345
|
children: [/* @__PURE__ */ I("div", {
|
|
335
346
|
className: "flex items-center justify-between",
|
|
336
347
|
children: [/* @__PURE__ */ I("span", {
|
|
337
|
-
className: c(
|
|
348
|
+
className: c(Ve.rowLabel, u),
|
|
338
349
|
children: [
|
|
339
|
-
|
|
350
|
+
C,
|
|
340
351
|
" ",
|
|
341
352
|
t + 1
|
|
342
353
|
]
|
|
343
|
-
}), /* @__PURE__ */ F(
|
|
344
|
-
appearance:
|
|
345
|
-
size:
|
|
346
|
-
icon: /* @__PURE__ */ F(
|
|
347
|
-
size:
|
|
354
|
+
}), /* @__PURE__ */ F(S, {
|
|
355
|
+
appearance: g.Ghost,
|
|
356
|
+
size: T.Small,
|
|
357
|
+
icon: /* @__PURE__ */ F(Se, {
|
|
358
|
+
size: b.SM,
|
|
348
359
|
"aria-hidden": !0,
|
|
349
|
-
stroke:
|
|
360
|
+
stroke: x
|
|
350
361
|
}),
|
|
351
|
-
"aria-label": `${
|
|
362
|
+
"aria-label": `${A} ${t + 1}`,
|
|
352
363
|
onClick: () => pe(e.id)
|
|
353
364
|
})]
|
|
354
365
|
}), /* @__PURE__ */ I("div", {
|
|
355
366
|
role: "group",
|
|
356
|
-
"aria-label": `${
|
|
367
|
+
"aria-label": `${C} ${t + 1}`,
|
|
357
368
|
className: "flex flex-col gap-5",
|
|
358
369
|
children: [/* @__PURE__ */ I("div", {
|
|
359
370
|
className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
|
|
360
|
-
children: [/* @__PURE__ */ F(
|
|
371
|
+
children: [/* @__PURE__ */ F(de, {
|
|
361
372
|
id: `${e.id}-language`,
|
|
362
373
|
labelProps: {
|
|
363
374
|
label: w,
|
|
364
375
|
required: !0
|
|
365
376
|
},
|
|
366
377
|
className: "desktop:shrink-0 desktop:basis-40",
|
|
367
|
-
options:
|
|
368
|
-
value: e.code,
|
|
369
|
-
label: e.label,
|
|
370
|
-
disabled: i.has(e.code)
|
|
371
|
-
})),
|
|
378
|
+
options: ye(e, n),
|
|
372
379
|
value: e.language,
|
|
373
|
-
onChange: (t) =>
|
|
374
|
-
}), /* @__PURE__ */ F(
|
|
380
|
+
onChange: (t) => fe(e.id, { language: t })
|
|
381
|
+
}), /* @__PURE__ */ F(j, {
|
|
375
382
|
id: `${e.id}-name`,
|
|
376
383
|
containerClassName: "min-w-0 flex-1",
|
|
377
384
|
required: !0,
|
|
378
385
|
value: e.name,
|
|
379
|
-
onChange: (t) =>
|
|
386
|
+
onChange: (t) => fe(e.id, { name: t ?? "" }),
|
|
380
387
|
labelProps: {
|
|
381
|
-
label:
|
|
388
|
+
label: E,
|
|
382
389
|
required: !0
|
|
383
390
|
},
|
|
384
|
-
placeholder:
|
|
391
|
+
placeholder: D
|
|
385
392
|
})]
|
|
386
|
-
}), /* @__PURE__ */ F(
|
|
393
|
+
}), /* @__PURE__ */ F(me, {
|
|
387
394
|
id: `${e.id}-description`,
|
|
388
395
|
className: r,
|
|
389
|
-
resize:
|
|
396
|
+
resize: he.Vertical,
|
|
390
397
|
value: e.description,
|
|
391
|
-
onChange: (t) =>
|
|
392
|
-
labelProps: { label:
|
|
393
|
-
placeholder:
|
|
398
|
+
onChange: (t) => fe(e.id, { description: t }),
|
|
399
|
+
labelProps: { label: O },
|
|
400
|
+
placeholder: k
|
|
394
401
|
})]
|
|
395
402
|
})]
|
|
396
403
|
}, e.id);
|
|
397
|
-
}), /* @__PURE__ */ F(
|
|
398
|
-
label:
|
|
399
|
-
iconBefore: /* @__PURE__ */ F(
|
|
400
|
-
size:
|
|
404
|
+
}), /* @__PURE__ */ F(ne, {
|
|
405
|
+
label: y,
|
|
406
|
+
iconBefore: /* @__PURE__ */ F(xe, {
|
|
407
|
+
size: b.SM,
|
|
401
408
|
"aria-hidden": !0,
|
|
402
|
-
stroke:
|
|
409
|
+
stroke: x
|
|
403
410
|
}),
|
|
404
411
|
className: "self-start",
|
|
405
412
|
onClick: ue,
|
|
406
|
-
disabled:
|
|
413
|
+
disabled: ve >= n.length
|
|
407
414
|
})]
|
|
408
415
|
})
|
|
409
416
|
})
|
|
410
417
|
]
|
|
411
418
|
});
|
|
412
|
-
},
|
|
413
|
-
let
|
|
414
|
-
|
|
419
|
+
}, Ge = "Add tags, comma separated", Ke = "deployment-creation-form-description", qe = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], formatLocaleLabel: p, fields: m = Be, isNameReadOnly: h = !1, nameReadOnlyTooltip: g, nameCaption: _, isDescriptionRequired: v = !1, descriptionCaption: y, renderDescription: b, focusRequestKey: x }) => {
|
|
420
|
+
let S = z(null), C = z(null), w = z(null), T = z(!1), E = (e) => m.includes(e), D = E(U.Name), O = E(U.Version), k = !!(t.name || t.version || t.description), A = z(x);
|
|
421
|
+
De(() => {
|
|
415
422
|
let e = () => {
|
|
416
|
-
t.name ?
|
|
423
|
+
t.name ? S.current?.focus() : t.version ? C.current?.focus() : t.description && w.current?.focus();
|
|
417
424
|
};
|
|
418
|
-
|
|
425
|
+
x === void 0 ? (k && !T.current && e(), T.current = k) : x !== A.current && (A.current = x, e());
|
|
419
426
|
}, [
|
|
420
|
-
|
|
421
|
-
|
|
427
|
+
x,
|
|
428
|
+
k,
|
|
422
429
|
t.name,
|
|
423
430
|
t.version,
|
|
424
431
|
t.description
|
|
425
432
|
]);
|
|
426
|
-
let
|
|
427
|
-
id:
|
|
428
|
-
ref:
|
|
433
|
+
let ee = /* @__PURE__ */ F(me, {
|
|
434
|
+
id: Ke,
|
|
435
|
+
ref: w,
|
|
429
436
|
value: e.description,
|
|
430
437
|
onChange: (e) => n({ description: e }),
|
|
431
|
-
"aria-required":
|
|
432
|
-
labelProps:
|
|
438
|
+
"aria-required": v || void 0,
|
|
439
|
+
labelProps: b ? void 0 : {
|
|
433
440
|
label: u.description.label,
|
|
434
|
-
required:
|
|
441
|
+
required: v
|
|
435
442
|
},
|
|
436
443
|
placeholder: u.description.placeholder,
|
|
437
|
-
caption:
|
|
444
|
+
caption: y,
|
|
438
445
|
error: t.description || void 0,
|
|
439
446
|
invalid: !!t.description,
|
|
440
|
-
containerClassName:
|
|
447
|
+
containerClassName: b ? void 0 : d?.field,
|
|
441
448
|
className: r,
|
|
442
|
-
resize:
|
|
449
|
+
resize: he.Vertical
|
|
443
450
|
});
|
|
444
451
|
return /* @__PURE__ */ I("div", {
|
|
445
452
|
role: u.ariaLabel ? "group" : void 0,
|
|
446
453
|
"aria-label": u.ariaLabel,
|
|
447
454
|
className: c("flex flex-col gap-4", d?.root),
|
|
448
455
|
children: [
|
|
449
|
-
|
|
456
|
+
E(U.Avatar) && /* @__PURE__ */ F(Le, {
|
|
450
457
|
label: u.iconUrl.label,
|
|
451
458
|
avatarUrl: s,
|
|
452
459
|
addAvatarLabel: u.iconUrl.addAvatarLabel,
|
|
@@ -454,28 +461,28 @@ var U = {
|
|
|
454
461
|
onAddAvatarClick: l,
|
|
455
462
|
className: d?.field
|
|
456
463
|
}),
|
|
457
|
-
(
|
|
464
|
+
(D || O) && /* @__PURE__ */ I("div", {
|
|
458
465
|
className: c("flex items-start gap-4", d?.field),
|
|
459
|
-
children: [
|
|
466
|
+
children: [D && /* @__PURE__ */ F(j, {
|
|
460
467
|
id: "deployment-creation-form-name",
|
|
461
|
-
inputRef:
|
|
468
|
+
inputRef: S,
|
|
462
469
|
value: e.name,
|
|
463
470
|
onChange: (e) => n({ name: e ?? "" }),
|
|
464
471
|
onBlur: a,
|
|
465
|
-
disabled:
|
|
466
|
-
tooltipText:
|
|
472
|
+
disabled: h,
|
|
473
|
+
tooltipText: h ? g : void 0,
|
|
467
474
|
labelProps: {
|
|
468
475
|
label: u.name.label,
|
|
469
476
|
required: !0
|
|
470
477
|
},
|
|
471
478
|
placeholder: u.name.placeholder,
|
|
472
|
-
caption:
|
|
479
|
+
caption: _,
|
|
473
480
|
error: t.name || void 0,
|
|
474
481
|
invalid: !!t.name,
|
|
475
|
-
containerClassName:
|
|
476
|
-
}),
|
|
482
|
+
containerClassName: O ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
|
|
483
|
+
}), O && /* @__PURE__ */ F(j, {
|
|
477
484
|
id: "deployment-creation-form-version",
|
|
478
|
-
inputRef:
|
|
485
|
+
inputRef: C,
|
|
479
486
|
value: e.version,
|
|
480
487
|
onChange: (e) => n({ version: e ?? "" }),
|
|
481
488
|
onBlur: o,
|
|
@@ -483,27 +490,28 @@ var U = {
|
|
|
483
490
|
placeholder: u.version.placeholder,
|
|
484
491
|
error: t.version || void 0,
|
|
485
492
|
invalid: !!t.version,
|
|
486
|
-
containerClassName:
|
|
493
|
+
containerClassName: D ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
|
|
487
494
|
})]
|
|
488
495
|
}),
|
|
489
|
-
|
|
496
|
+
E(U.Description) && (b ? /* @__PURE__ */ F("div", {
|
|
490
497
|
className: d?.field,
|
|
491
|
-
children:
|
|
492
|
-
}) :
|
|
493
|
-
|
|
498
|
+
children: b(ee, Ke)
|
|
499
|
+
}) : ee),
|
|
500
|
+
E(U.Locales) && /* @__PURE__ */ F(We, {
|
|
494
501
|
value: e.otherLocales,
|
|
495
502
|
onChange: (e) => n({ otherLocales: e }),
|
|
496
503
|
availableLocaleOptions: f,
|
|
504
|
+
formatLocaleLabel: p,
|
|
497
505
|
labels: u.otherLocales,
|
|
498
506
|
className: d?.field,
|
|
499
507
|
colors: d?.localesColors
|
|
500
508
|
}),
|
|
501
|
-
|
|
509
|
+
E(U.Tags) && /* @__PURE__ */ F("div", {
|
|
502
510
|
className: d?.field,
|
|
503
|
-
children: /* @__PURE__ */ F(
|
|
511
|
+
children: /* @__PURE__ */ F(pe, {
|
|
504
512
|
id: "deployment-creation-form-topics",
|
|
505
513
|
labelProps: { label: u.topics.label },
|
|
506
|
-
placeholder: u.topics.placeholder ??
|
|
514
|
+
placeholder: u.topics.placeholder ?? Ge,
|
|
507
515
|
value: e.topics,
|
|
508
516
|
onChange: (e) => n({ topics: e }),
|
|
509
517
|
tagClassName: i
|
|
@@ -511,13 +519,13 @@ var U = {
|
|
|
511
519
|
})
|
|
512
520
|
]
|
|
513
521
|
});
|
|
514
|
-
},
|
|
515
|
-
let E = /* @__PURE__ */ F(
|
|
516
|
-
politeness:
|
|
517
|
-
className: v == null ? void 0 :
|
|
522
|
+
}, Je = "border-0 p-4 desktop:p-8", Ye = "border-0", Xe = "desktop:flex-1", Ze = "px-4 pt-4 desktop:px-6 desktop:pt-6", Qe = Ee(({ 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, hasSetupSectionPadding: S = !0, labels: C, styles: w, dir: T }) => {
|
|
523
|
+
let E = /* @__PURE__ */ F(re, {
|
|
524
|
+
politeness: M.Assertive,
|
|
525
|
+
className: v == null ? void 0 : Ze,
|
|
518
526
|
children: v
|
|
519
527
|
}), D = p != null;
|
|
520
|
-
return /* @__PURE__ */ F(
|
|
528
|
+
return /* @__PURE__ */ F(Fe, {
|
|
521
529
|
title: e,
|
|
522
530
|
onBack: t,
|
|
523
531
|
backAriaLabel: C?.backAriaLabel ?? "Back",
|
|
@@ -528,41 +536,41 @@ var U = {
|
|
|
528
536
|
resizeHandleLabel: C?.resizeHandleLabel,
|
|
529
537
|
resizeHandleTooltip: C?.resizeHandleTooltip
|
|
530
538
|
},
|
|
531
|
-
rightContent: h == null ? void 0 : /* @__PURE__ */ F(
|
|
539
|
+
rightContent: h == null ? void 0 : /* @__PURE__ */ F(Ne, {
|
|
532
540
|
title: g,
|
|
533
541
|
styles: w?.section,
|
|
534
|
-
className: c(
|
|
542
|
+
className: c(Je, _, V.asideSection),
|
|
535
543
|
children: h
|
|
536
544
|
}),
|
|
537
545
|
styles: w?.layout,
|
|
538
546
|
dir: T,
|
|
539
|
-
actions: /* @__PURE__ */ I(P, { children: [s, !l && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
547
|
+
actions: /* @__PURE__ */ I(P, { children: [s, !l && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(ae, {
|
|
540
548
|
label: C?.cancelLabel ?? "Cancel",
|
|
541
549
|
disabled: a,
|
|
542
550
|
onClick: n
|
|
543
|
-
}), /* @__PURE__ */ F(
|
|
551
|
+
}), /* @__PURE__ */ F(ce, {
|
|
544
552
|
label: i,
|
|
545
553
|
disabled: a || o,
|
|
546
554
|
onClick: r
|
|
547
555
|
})] })] }),
|
|
548
556
|
leftContent: /* @__PURE__ */ I(P, { children: [
|
|
549
557
|
!D && E,
|
|
550
|
-
/* @__PURE__ */ F(
|
|
558
|
+
/* @__PURE__ */ F(Ne, {
|
|
551
559
|
title: d === null ? void 0 : d ?? C?.metadataTitle ?? "Metadata",
|
|
552
560
|
styles: w?.section,
|
|
553
|
-
className: c(
|
|
561
|
+
className: c(Je, b, V.metadataSection),
|
|
554
562
|
children: u
|
|
555
563
|
}),
|
|
556
564
|
f
|
|
557
565
|
] }),
|
|
558
|
-
centerContent: D ? /* @__PURE__ */ I(P, { children: [E, /* @__PURE__ */ F(
|
|
566
|
+
centerContent: D ? /* @__PURE__ */ I(P, { children: [E, /* @__PURE__ */ F(Ne, {
|
|
559
567
|
title: m === null ? void 0 : m ?? C?.setupTitle ?? "Setup",
|
|
560
568
|
styles: w?.section,
|
|
561
|
-
className: c(S ?
|
|
569
|
+
className: c(S ? Je : Ye, Xe, x, V.setupSection),
|
|
562
570
|
children: p
|
|
563
571
|
})] }) : void 0
|
|
564
572
|
});
|
|
565
|
-
}),
|
|
573
|
+
}), $e = {
|
|
566
574
|
name: {
|
|
567
575
|
label: "Name",
|
|
568
576
|
placeholder: "Enter name"
|
|
@@ -601,7 +609,7 @@ var U = {
|
|
|
601
609
|
saveLabel: "Save"
|
|
602
610
|
},
|
|
603
611
|
ariaLabel: "Metadata"
|
|
604
|
-
},
|
|
612
|
+
}, et = {
|
|
605
613
|
title: "Add avatar",
|
|
606
614
|
attachLabel: "Attach",
|
|
607
615
|
emptyTitle: "This folder is empty",
|
|
@@ -625,82 +633,83 @@ var U = {
|
|
|
625
633
|
deleteConfirmItemsLabel: "items?",
|
|
626
634
|
deleteConfirmLabel: "Delete",
|
|
627
635
|
deleteCancelLabel: "Cancel"
|
|
628
|
-
},
|
|
629
|
-
let [
|
|
630
|
-
let t =
|
|
631
|
-
t && n({ iconUrl: t }),
|
|
632
|
-
}, [n,
|
|
633
|
-
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
636
|
+
}, tt = Ee(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, formatLocaleLabel: s, fields: c = Be, isNameReadOnly: l, nameReadOnlyTooltip: u, nameCaption: d, isDescriptionRequired: f, descriptionCaption: p, renderDescription: m, focusRequestKey: h, labels: g }) => {
|
|
637
|
+
let [_, v] = B(!1), y = R(() => a ? c : c.filter((e) => e !== U.Avatar), [a, c]), b = e.iconUrl, x = a?.resolveIconUrl, S = R(() => x ? x(b) : void 0, [b, x]), C = L(() => v(!0), []), w = L(() => v(!1), []), T = a?.resolveAttachedIconUrl, E = L((e) => {
|
|
638
|
+
let t = T?.(e);
|
|
639
|
+
t && n({ iconUrl: t }), v(!1);
|
|
640
|
+
}, [n, T]);
|
|
641
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(qe, {
|
|
634
642
|
values: e,
|
|
635
643
|
errors: t,
|
|
636
644
|
onChange: n,
|
|
637
645
|
onNameBlur: r,
|
|
638
646
|
onVersionBlur: i,
|
|
639
|
-
iconPreviewUrl:
|
|
640
|
-
onAddAvatarClick:
|
|
641
|
-
labels:
|
|
647
|
+
iconPreviewUrl: S,
|
|
648
|
+
onAddAvatarClick: C,
|
|
649
|
+
labels: g?.form ?? $e,
|
|
642
650
|
availableLocaleOptions: o,
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
651
|
+
formatLocaleLabel: s,
|
|
652
|
+
fields: y,
|
|
653
|
+
isNameReadOnly: l,
|
|
654
|
+
nameReadOnlyTooltip: u,
|
|
655
|
+
nameCaption: d,
|
|
656
|
+
isDescriptionRequired: f,
|
|
657
|
+
descriptionCaption: p,
|
|
658
|
+
renderDescription: m,
|
|
659
|
+
focusRequestKey: h
|
|
660
|
+
}), a && /* @__PURE__ */ F(ze, {
|
|
661
|
+
isOpen: _,
|
|
662
|
+
onClose: w,
|
|
663
|
+
onAttach: E,
|
|
655
664
|
bucket: a.bucket,
|
|
656
665
|
FileManagerModal: a.FileManagerModal,
|
|
657
666
|
allowedMimeTypes: a.allowedMimeTypes,
|
|
658
667
|
maxFileSizeBytes: a.maxFileSizeBytes,
|
|
659
|
-
labels:
|
|
668
|
+
labels: g?.avatarPicker ?? et
|
|
660
669
|
})] });
|
|
661
|
-
}),
|
|
670
|
+
}), nt = /* @__PURE__ */ function(e) {
|
|
662
671
|
return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
|
|
663
672
|
}({});
|
|
664
|
-
|
|
673
|
+
nt.TooLong, nt.ControlCharacters;
|
|
665
674
|
//#endregion
|
|
666
675
|
//#region src/constants/public-class-names.ts
|
|
667
|
-
var
|
|
676
|
+
var rt = {
|
|
668
677
|
root: "dial-skill-editor-root",
|
|
669
678
|
refineFeedback: "dial-skill-editor-refine-feedback"
|
|
670
|
-
},
|
|
679
|
+
}, W = "SKILL.md", G = /* @__PURE__ */ function(e) {
|
|
671
680
|
return e.File = "file", e.Folder = "folder", e;
|
|
672
|
-
}({}),
|
|
681
|
+
}({}), it = /* @__PURE__ */ function(e) {
|
|
673
682
|
return e.Header = "header", e.Child = "child", e;
|
|
674
|
-
}({}),
|
|
683
|
+
}({}), K = (e) => {
|
|
675
684
|
let t = e.lastIndexOf("/");
|
|
676
685
|
return t === -1 ? null : e.slice(0, t);
|
|
677
|
-
},
|
|
686
|
+
}, q = (e) => {
|
|
678
687
|
let t = e.lastIndexOf("/");
|
|
679
688
|
return t === -1 ? e : e.slice(t + 1);
|
|
680
|
-
},
|
|
689
|
+
}, at = (e) => {
|
|
681
690
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
682
691
|
let n = t.get(e);
|
|
683
692
|
if (n) return n;
|
|
684
693
|
let r = {
|
|
685
694
|
path: e,
|
|
686
|
-
name:
|
|
687
|
-
nodeType:
|
|
688
|
-
parentPath:
|
|
695
|
+
name: q(e),
|
|
696
|
+
nodeType: ke.FOLDER,
|
|
697
|
+
parentPath: K(e),
|
|
689
698
|
folderId: e,
|
|
690
699
|
items: []
|
|
691
700
|
};
|
|
692
701
|
return t.set(e, r), r;
|
|
693
702
|
};
|
|
694
|
-
for (let r of e) r.kind ===
|
|
703
|
+
for (let r of e) r.kind === G.Folder ? n(r.path).name = r.name : t.set(r.path, {
|
|
695
704
|
path: r.path,
|
|
696
705
|
name: r.name,
|
|
697
|
-
nodeType:
|
|
698
|
-
parentPath:
|
|
699
|
-
folderId:
|
|
706
|
+
nodeType: ke.ITEM,
|
|
707
|
+
parentPath: K(r.path),
|
|
708
|
+
folderId: K(r.path) ?? ""
|
|
700
709
|
});
|
|
701
710
|
for (let t of [...e]) {
|
|
702
|
-
let e =
|
|
703
|
-
for (; e != null;) n(e), e =
|
|
711
|
+
let e = K(t.path);
|
|
712
|
+
for (; e != null;) n(e), e = K(e);
|
|
704
713
|
}
|
|
705
714
|
let r = [];
|
|
706
715
|
for (let e of t.values()) {
|
|
@@ -712,47 +721,61 @@ var Xe = {
|
|
|
712
721
|
n ? n.items = [...n.items ?? [], e] : r.push(e);
|
|
713
722
|
}
|
|
714
723
|
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 =
|
|
724
|
+
}, ot = (e, t) => e ? `${e}/${t}` : t, st = (e, t) => {
|
|
725
|
+
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 = ot(r, `${s} (${l})${c}`);
|
|
726
|
+
for (; t.has(u);) l += 1, u = ot(r, `${s} (${l})${c}`);
|
|
718
727
|
return u;
|
|
719
|
-
},
|
|
728
|
+
}, ct = (e, t) => {
|
|
720
729
|
if (!t) return "";
|
|
721
730
|
switch (e) {
|
|
722
|
-
case
|
|
723
|
-
case
|
|
724
|
-
}
|
|
725
|
-
}, q = (e, t) => {
|
|
726
|
-
let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
|
|
727
|
-
for (let { path: i } of e) {
|
|
728
|
-
if (!i.startsWith(n) || i === t) continue;
|
|
729
|
-
let e = i.slice(n.length);
|
|
730
|
-
r.add(e.split("/")[0]);
|
|
731
|
+
case it.Child: return t.path;
|
|
732
|
+
case it.Header: return t.kind === G.Folder ? t.path : "";
|
|
731
733
|
}
|
|
732
|
-
|
|
733
|
-
}, ot = (e, t, n) => {
|
|
734
|
+
}, lt = (e, t) => new Set(dt(e, t).map((e) => e.name)), ut = (e, t, n) => {
|
|
734
735
|
let r = e.trim();
|
|
735
736
|
if (!r) return n.required;
|
|
736
737
|
if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
|
|
737
738
|
if (t.has(r)) return n.duplicate;
|
|
738
|
-
},
|
|
739
|
-
let
|
|
739
|
+
}, dt = (e, t) => {
|
|
740
|
+
let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
741
|
+
for (let a of e) {
|
|
742
|
+
if (!a.path.startsWith(n) || a.path === t) continue;
|
|
743
|
+
let e = a.path.slice(n.length), o = e.indexOf("/"), s = o === -1, c = s ? e : e.slice(0, o), l = `${n}${c}`, u = s && a.kind === G.File ? G.File : G.Folder;
|
|
744
|
+
if (r.has(l) || r.set(l, {
|
|
745
|
+
path: l,
|
|
746
|
+
name: c,
|
|
747
|
+
kind: u,
|
|
748
|
+
childCount: 0
|
|
749
|
+
}), !s) {
|
|
750
|
+
let t = o + 1, n = e.indexOf("/", t), r = e.slice(t, n === -1 ? void 0 : n);
|
|
751
|
+
i.set(l, (i.get(l) ?? /* @__PURE__ */ new Set()).add(r));
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
return [...r.values()].map((e) => ({
|
|
755
|
+
...e,
|
|
756
|
+
childCount: i.get(e.path)?.size ?? 0
|
|
757
|
+
})).sort((e, t) => e.kind === t.kind ? e.name.localeCompare(t.name) : e.kind === G.Folder ? -1 : 1);
|
|
758
|
+
}, ft = (e) => {
|
|
759
|
+
let t = e.split("/").slice(0, -1);
|
|
760
|
+
return t.map((e, n) => t.slice(0, n + 1).join("/"));
|
|
761
|
+
}, pt = "\\new-folder", mt = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
|
|
762
|
+
let [o, s] = B(null), c = o?.parentPath ?? null, l = z([]), u = c == null ? void 0 : ot(c, pt), d = R(() => u == null ? void 0 : {
|
|
740
763
|
path: u,
|
|
741
764
|
name: n,
|
|
742
|
-
kind:
|
|
743
|
-
}, [u, n]), f =
|
|
744
|
-
let a =
|
|
745
|
-
return i === "" && a.add(
|
|
765
|
+
kind: G.Folder
|
|
766
|
+
}, [u, n]), f = L((n, i) => {
|
|
767
|
+
let a = lt(e, i);
|
|
768
|
+
return i === "" && a.add(W), ut(n, a, r) ?? t.validateFolderPath?.(ot(i, n.trim()));
|
|
746
769
|
}, [
|
|
747
770
|
e,
|
|
748
771
|
r,
|
|
749
772
|
t
|
|
750
|
-
]), p =
|
|
773
|
+
]), p = L((e, t) => {
|
|
751
774
|
l.current = [], s({
|
|
752
775
|
parentPath: e,
|
|
753
776
|
pane: t
|
|
754
777
|
}), e !== "" && i(e);
|
|
755
|
-
}, [i]), m =
|
|
778
|
+
}, [i]), m = L((e, t) => {
|
|
756
779
|
if (c == null || t.path !== u) return null;
|
|
757
780
|
let n = f(e, c);
|
|
758
781
|
return l.current = [...l.current.slice(-1), {
|
|
@@ -763,16 +786,16 @@ var Xe = {
|
|
|
763
786
|
c,
|
|
764
787
|
u,
|
|
765
788
|
f
|
|
766
|
-
]), h =
|
|
789
|
+
]), h = L(() => {
|
|
767
790
|
l.current = [], s(null);
|
|
768
|
-
}, []), g =
|
|
769
|
-
let r =
|
|
791
|
+
}, []), g = L((e, n) => {
|
|
792
|
+
let r = ot(n, e.trim());
|
|
770
793
|
t.onCreateFolder?.(r), n !== "" && i(n), a(r);
|
|
771
794
|
}, [
|
|
772
795
|
t,
|
|
773
796
|
i,
|
|
774
797
|
a
|
|
775
|
-
]), _ =
|
|
798
|
+
]), _ = L((e) => {
|
|
776
799
|
if (c == null) return;
|
|
777
800
|
let [t] = l.current;
|
|
778
801
|
l.current.length === 2 && t != null && !t.isValid && t.value !== e || f(e, c) != null ? h() : (h(), g(e, c));
|
|
@@ -793,47 +816,47 @@ var Xe = {
|
|
|
793
816
|
validateNewFolder: f,
|
|
794
817
|
createFolder: g
|
|
795
818
|
};
|
|
796
|
-
},
|
|
797
|
-
let [t, n] =
|
|
819
|
+
}, ht = (e) => !!e.dataTransfer?.types.includes("Files"), gt = (e) => {
|
|
820
|
+
let [t, n] = B(!1), r = z(0);
|
|
798
821
|
return {
|
|
799
822
|
isDragActive: t,
|
|
800
823
|
dropZoneHandlers: {
|
|
801
|
-
onDragEnter:
|
|
802
|
-
|
|
824
|
+
onDragEnter: L((e) => {
|
|
825
|
+
ht(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
803
826
|
}, []),
|
|
804
|
-
onDragLeave:
|
|
805
|
-
|
|
827
|
+
onDragLeave: L((e) => {
|
|
828
|
+
ht(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
806
829
|
}, []),
|
|
807
|
-
onDragOver:
|
|
808
|
-
|
|
830
|
+
onDragOver: L((e) => {
|
|
831
|
+
ht(e) && e.preventDefault();
|
|
809
832
|
}, []),
|
|
810
|
-
onDrop:
|
|
811
|
-
if (!
|
|
833
|
+
onDrop: L((t) => {
|
|
834
|
+
if (!ht(t)) return;
|
|
812
835
|
t.preventDefault(), r.current = 0, n(!1);
|
|
813
836
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
814
837
|
i.length > 0 && e(i);
|
|
815
838
|
}, [e])
|
|
816
839
|
}
|
|
817
840
|
};
|
|
818
|
-
},
|
|
841
|
+
}, _t = /* @__PURE__ */ function(e) {
|
|
819
842
|
return e.Files = "files", e.Archive = "archive", e;
|
|
820
843
|
}({}), J = /* @__PURE__ */ function(e) {
|
|
821
844
|
return e.Mobile = "mobile", e.Desktop = "desktop", e;
|
|
822
|
-
}({}),
|
|
845
|
+
}({}), vt = (e, t, n = b.MD, r) => /* @__PURE__ */ F(e, {
|
|
823
846
|
size: n,
|
|
824
847
|
className: t,
|
|
825
848
|
style: r,
|
|
826
849
|
"aria-hidden": !0,
|
|
827
|
-
stroke:
|
|
828
|
-
}),
|
|
829
|
-
let
|
|
850
|
+
stroke: x
|
|
851
|
+
}), yt = { footer: "_footer_hn1ri_7" }, bt = ({ isOpen: e, title: t, closeAriaLabel: n, onClose: r, confirmLabel: i, onConfirm: a, cancelLabel: s, onCancel: l, isConfirmDisabled: u = !1, isConfirming: f = !1, children: p, colors: h }) => {
|
|
852
|
+
let _ = d(), y = f ? /* @__PURE__ */ F(fe, {
|
|
830
853
|
size: 16,
|
|
831
854
|
ariaLabel: ""
|
|
832
855
|
}) : void 0;
|
|
833
|
-
if (
|
|
856
|
+
if (_) {
|
|
834
857
|
let d = o({
|
|
835
|
-
"--se-dialog-footer-bg":
|
|
836
|
-
"--se-dialog-footer-border":
|
|
858
|
+
"--se-dialog-footer-bg": h?.footerBackground,
|
|
859
|
+
"--se-dialog-footer-border": h?.footerBorder
|
|
837
860
|
});
|
|
838
861
|
return /* @__PURE__ */ I(m, {
|
|
839
862
|
open: e,
|
|
@@ -841,15 +864,15 @@ var Xe = {
|
|
|
841
864
|
closeAriaLabel: n,
|
|
842
865
|
onClose: r,
|
|
843
866
|
children: [p, /* @__PURE__ */ I("div", {
|
|
844
|
-
className: c("sticky bottom-0 flex gap-3 border-t p-4",
|
|
867
|
+
className: c("sticky bottom-0 flex gap-3 border-t p-4", yt.footer),
|
|
845
868
|
style: d,
|
|
846
|
-
children: [/* @__PURE__ */ F(
|
|
869
|
+
children: [/* @__PURE__ */ F(ce, {
|
|
847
870
|
className: "flex-1",
|
|
848
871
|
label: i,
|
|
849
872
|
iconBefore: y,
|
|
850
873
|
disabled: u,
|
|
851
874
|
onClick: a
|
|
852
|
-
}), /* @__PURE__ */ F(
|
|
875
|
+
}), /* @__PURE__ */ F(ae, {
|
|
853
876
|
className: "flex-1",
|
|
854
877
|
label: s,
|
|
855
878
|
onClick: l
|
|
@@ -857,35 +880,35 @@ var Xe = {
|
|
|
857
880
|
})]
|
|
858
881
|
});
|
|
859
882
|
}
|
|
860
|
-
return /* @__PURE__ */ F(
|
|
883
|
+
return /* @__PURE__ */ F(N, {
|
|
861
884
|
open: e,
|
|
862
885
|
header: t,
|
|
863
|
-
size:
|
|
886
|
+
size: se.Sm,
|
|
864
887
|
closeAriaLabel: n,
|
|
865
888
|
onClose: r,
|
|
866
889
|
mainButtons: [{
|
|
867
890
|
label: s,
|
|
868
|
-
variant:
|
|
869
|
-
appearance:
|
|
891
|
+
variant: v.Primary,
|
|
892
|
+
appearance: g.Ghost,
|
|
870
893
|
onClick: l
|
|
871
894
|
}, {
|
|
872
895
|
label: i,
|
|
873
|
-
variant:
|
|
896
|
+
variant: v.Primary,
|
|
874
897
|
iconBefore: y,
|
|
875
898
|
onClick: a,
|
|
876
899
|
disabled: u
|
|
877
900
|
}],
|
|
878
901
|
children: p
|
|
879
902
|
});
|
|
880
|
-
},
|
|
881
|
-
let d =
|
|
882
|
-
|
|
903
|
+
}, xt = ({ isOpen: e, onClose: t, validateName: n, onCreate: r, title: i, nameLabel: a, namePlaceholder: o, createLabel: s, cancelLabel: c, closeAriaLabel: l, dialogColors: u }) => {
|
|
904
|
+
let d = Oe(), [f, p] = B(""), [m, h] = B(!1);
|
|
905
|
+
De(() => {
|
|
883
906
|
e && (p(""), h(!1));
|
|
884
907
|
}, [e]);
|
|
885
908
|
let g = m ? n(f) : void 0, _ = () => {
|
|
886
909
|
h(!0), n(f) ?? (r(f), t());
|
|
887
910
|
};
|
|
888
|
-
return /* @__PURE__ */ F(
|
|
911
|
+
return /* @__PURE__ */ F(bt, {
|
|
889
912
|
isOpen: e,
|
|
890
913
|
title: i,
|
|
891
914
|
closeAriaLabel: l,
|
|
@@ -900,7 +923,7 @@ var Xe = {
|
|
|
900
923
|
onSubmit: (e) => {
|
|
901
924
|
e.preventDefault(), _();
|
|
902
925
|
},
|
|
903
|
-
children: /* @__PURE__ */ F(
|
|
926
|
+
children: /* @__PURE__ */ F(j, {
|
|
904
927
|
id: d,
|
|
905
928
|
labelProps: {
|
|
906
929
|
label: a,
|
|
@@ -915,10 +938,10 @@ var Xe = {
|
|
|
915
938
|
})
|
|
916
939
|
})
|
|
917
940
|
});
|
|
918
|
-
},
|
|
919
|
-
let i = t ?? {}, a = i.dropOverlayTitle ?? "Upload files", o = i.dropOverlaySubtitle ?? "Drop files here to add them to this skill", s = /* @__PURE__ */ F(
|
|
941
|
+
}, St = { icon: "_icon_1p1f5_1" }, Ct = ({ isVisible: e, labels: t, titleClassName: n = "dial-h3-text", subtitleClassName: r = "dial-small-text" }) => {
|
|
942
|
+
let i = t ?? {}, a = i.dropOverlayTitle ?? "Upload files", o = i.dropOverlaySubtitle ?? "Drop files here to add them to this skill", s = /* @__PURE__ */ F(re, {
|
|
920
943
|
visuallyHidden: !0,
|
|
921
|
-
as:
|
|
944
|
+
as: ie.Span,
|
|
922
945
|
children: e ? `${a}. ${o}` : ""
|
|
923
946
|
});
|
|
924
947
|
return e ? /* @__PURE__ */ I(P, { children: [s, /* @__PURE__ */ F("div", {
|
|
@@ -927,11 +950,11 @@ var Xe = {
|
|
|
927
950
|
"aria-hidden": !0,
|
|
928
951
|
className: "flex flex-col items-center text-center",
|
|
929
952
|
children: [
|
|
930
|
-
/* @__PURE__ */ F(
|
|
953
|
+
/* @__PURE__ */ F(Ce, {
|
|
931
954
|
size: 100,
|
|
932
|
-
className:
|
|
955
|
+
className: St.icon,
|
|
933
956
|
"aria-hidden": !0,
|
|
934
|
-
stroke:
|
|
957
|
+
stroke: x
|
|
935
958
|
}),
|
|
936
959
|
/* @__PURE__ */ F("span", {
|
|
937
960
|
className: c("mt-5", n),
|
|
@@ -944,53 +967,53 @@ var Xe = {
|
|
|
944
967
|
]
|
|
945
968
|
})
|
|
946
969
|
})] }) : s;
|
|
947
|
-
},
|
|
970
|
+
}, Y = {
|
|
948
971
|
card: "_card_1tr87_2",
|
|
949
972
|
label: "_label_1tr87_7",
|
|
950
973
|
fileName: "_fileName_1tr87_11",
|
|
951
974
|
header: "_header_1tr87_16"
|
|
952
|
-
},
|
|
975
|
+
}, wt = ({ label: e, fileName: t, isExpanded: n, onToggle: r, children: i, labelClassName: a = "dial-tiny-lead-text", fileNameClassName: o = "dial-small-text" }) => /* @__PURE__ */ F(p, {
|
|
953
976
|
expanded: n,
|
|
954
977
|
onToggle: r,
|
|
955
978
|
title: /* @__PURE__ */ F("span", {
|
|
956
|
-
className: c("block",
|
|
979
|
+
className: c("block", Y.label, a),
|
|
957
980
|
children: e
|
|
958
981
|
}),
|
|
959
|
-
description: /* @__PURE__ */ F(
|
|
982
|
+
description: /* @__PURE__ */ F(k, {
|
|
960
983
|
name: t,
|
|
961
|
-
nameClassName: c(
|
|
984
|
+
nameClassName: c(Y.fileName, o)
|
|
962
985
|
}),
|
|
963
|
-
className: c("rounded-lg border py-0 shadow-xs",
|
|
964
|
-
headerClassName: c("gap-4 rounded-lg py-2 ps-3 pe-2 text-start [&>span]:flex-1 [&>span]:gap-1 [&>svg]:size-6", n ? "[&>svg]:-rotate-90" : "[&>svg]:rotate-90",
|
|
986
|
+
className: c("rounded-lg border py-0 shadow-xs", Y.card),
|
|
987
|
+
headerClassName: c("gap-4 rounded-lg py-2 ps-3 pe-2 text-start [&>span]:flex-1 [&>span]:gap-1 [&>svg]:size-6", n ? "[&>svg]:-rotate-90" : "[&>svg]:rotate-90", Y.header),
|
|
965
988
|
contentClassName: "max-h-[416px] overflow-y-auto pt-4 pb-2 ps-3 pe-2",
|
|
966
989
|
children: i
|
|
967
|
-
}),
|
|
990
|
+
}), Tt = /* @__PURE__ */ function(e) {
|
|
968
991
|
return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
|
|
969
|
-
}({}),
|
|
992
|
+
}({}), Et = /* @__PURE__ */ function(e) {
|
|
970
993
|
return e.Valid = "valid", e.Invalid = "invalid", e;
|
|
971
994
|
}({}), X = /* @__PURE__ */ function(e) {
|
|
972
995
|
return e.Replace = "replace", e.Duplicate = "duplicate", e;
|
|
973
|
-
}({}),
|
|
996
|
+
}({}), Dt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), Z = {
|
|
974
997
|
invalidDropZone: "_invalidDropZone_j9j9q_1",
|
|
975
998
|
row: "_row_j9j9q_5"
|
|
976
|
-
},
|
|
977
|
-
id:
|
|
999
|
+
}, Q = ".zip,application/zip", $ = [], Ot = 0, kt = () => `skill-file-candidate-${++Ot}`, At = (e, t, n) => ({
|
|
1000
|
+
id: kt(),
|
|
978
1001
|
file: e,
|
|
979
|
-
path:
|
|
980
|
-
}),
|
|
981
|
-
let _ = m ?? {}, [
|
|
982
|
-
|
|
983
|
-
e && (
|
|
1002
|
+
path: ot(n, t.replace(/\\/g, "/"))
|
|
1003
|
+
}), jt = ({ isOpen: e, onClose: t, fileActions: n, mode: r = _t.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: l, existingFilePaths: u = $, onCommitted: d, messageClassName: f = "dial-small-text", rowCaptionClassName: p, labels: m, dialogColors: h, colors: g }) => {
|
|
1004
|
+
let _ = m ?? {}, [v, b] = B([]), [S, C] = B([]), [w, T] = B(X.Replace), E = R(() => new Set(u), [u]), [A, j] = B(/* @__PURE__ */ new Map()), [te, ne] = B([]), [ae, oe] = B(!1), [N, se] = B(), [ce, ue] = B(!1), [de, pe] = B(), [me, he] = B(0), ge = z(0), _e = r === _t.Archive, ve = _.uploadArchiveErrorMessage ?? "Couldn't read this archive", ye = Oe(), be = Oe(), xe = Oe(), Ce = z(null), we = z(!1), Te = S[0]?.id;
|
|
1005
|
+
De(() => {
|
|
1006
|
+
e && (Te == null ? we.current && (we.current = !1, document.getElementById(be)?.focus()) : (we.current = !0, Ce.current?.focus()));
|
|
984
1007
|
}, [
|
|
985
|
-
|
|
1008
|
+
Te,
|
|
986
1009
|
e,
|
|
987
1010
|
be
|
|
988
1011
|
]);
|
|
989
|
-
let
|
|
990
|
-
|
|
991
|
-
},
|
|
1012
|
+
let Ee = (e) => e.path !== "SKILL.md" && E.has(e.path), L = (e) => {
|
|
1013
|
+
se(void 0), b((t) => [...t, ...e.filter((e) => !Ee(e))]), C((t) => [...t, ...e.filter(Ee)]);
|
|
1014
|
+
}, ke = (e) => {
|
|
992
1015
|
let [t, ...n] = S;
|
|
993
|
-
t && (C(n),
|
|
1016
|
+
t && (C(n), T(X.Replace), e != null && (se(void 0), b((r) => {
|
|
994
1017
|
if (e === X.Replace) return [...r, {
|
|
995
1018
|
...t,
|
|
996
1019
|
replacesExisting: !0
|
|
@@ -1002,10 +1025,10 @@ var Xe = {
|
|
|
1002
1025
|
]);
|
|
1003
1026
|
return [...r, {
|
|
1004
1027
|
...t,
|
|
1005
|
-
path:
|
|
1028
|
+
path: st(t.path, i)
|
|
1006
1029
|
}];
|
|
1007
1030
|
})));
|
|
1008
|
-
},
|
|
1031
|
+
}, Ae = async (e) => {
|
|
1009
1032
|
let { extractArchive: t } = n;
|
|
1010
1033
|
if (!t) return;
|
|
1011
1034
|
let r = ge.current;
|
|
@@ -1018,76 +1041,76 @@ var Xe = {
|
|
|
1018
1041
|
pe(_.uploadArchiveEmptyMessage ?? "This archive has no files");
|
|
1019
1042
|
return;
|
|
1020
1043
|
}
|
|
1021
|
-
|
|
1044
|
+
L(a.map((e) => At(e.file, e.path, i)));
|
|
1022
1045
|
} catch {
|
|
1023
1046
|
if (r !== ge.current) return;
|
|
1024
|
-
pe(
|
|
1047
|
+
pe(ve);
|
|
1025
1048
|
} finally {
|
|
1026
1049
|
r === ge.current && he((e) => e - 1);
|
|
1027
1050
|
}
|
|
1028
|
-
},
|
|
1029
|
-
|
|
1030
|
-
},
|
|
1031
|
-
|
|
1051
|
+
}, je = (e) => {
|
|
1052
|
+
_e ? Ae(e) : L(e.map((e) => At(e, Dt(e), i)));
|
|
1053
|
+
}, V = (e) => {
|
|
1054
|
+
b((t) => t.filter((t) => t.id !== e));
|
|
1032
1055
|
};
|
|
1033
|
-
|
|
1056
|
+
De(() => {
|
|
1034
1057
|
if (!e) return;
|
|
1035
1058
|
ge.current += 1;
|
|
1036
|
-
let t = [...(a ?? []).map((e) =>
|
|
1037
|
-
|
|
1038
|
-
}, [e]),
|
|
1059
|
+
let t = [...(a ?? []).map((e) => At(e, Dt(e), i)), ...(l ?? []).map((e) => At(e.file, e.path, i))];
|
|
1060
|
+
b(t.filter((e) => !Ee(e))), C(t.filter(Ee)), T(X.Replace), j(/* @__PURE__ */ new Map()), ne([]), se(void 0), pe(void 0), he(0);
|
|
1061
|
+
}, [e]), De(() => {
|
|
1039
1062
|
if (!e) return;
|
|
1040
1063
|
let t = !1;
|
|
1041
|
-
if (
|
|
1042
|
-
else return oe(!0), n.validateBatch(
|
|
1043
|
-
t || (j(new Map(e.map((e) => [e.candidateId, e]))),
|
|
1064
|
+
if (v.length === 0) j(/* @__PURE__ */ new Map()), ne([]);
|
|
1065
|
+
else return oe(!0), n.validateBatch(v).then(({ results: e, batchErrors: n }) => {
|
|
1066
|
+
t || (j(new Map(e.map((e) => [e.candidateId, e]))), ne(n.map((e) => e.message)));
|
|
1044
1067
|
}).finally(() => {
|
|
1045
1068
|
t || oe(!1);
|
|
1046
1069
|
}), () => {
|
|
1047
1070
|
t = !0;
|
|
1048
1071
|
};
|
|
1049
|
-
}, [
|
|
1050
|
-
let
|
|
1072
|
+
}, [v, e]);
|
|
1073
|
+
let Me = v.some((e) => A.get(e.id)?.status === Et.Invalid), Ne = v.length > 0 && v.every((e) => A.get(e.id)?.status === Et.Invalid), Pe = [...te, ...v.flatMap((e) => {
|
|
1051
1074
|
let t = A.get(e.id);
|
|
1052
|
-
return t?.status ===
|
|
1053
|
-
})],
|
|
1054
|
-
|
|
1075
|
+
return t?.status === Et.Invalid && t.error ? [`${e.path}: ${t.error}`] : [];
|
|
1076
|
+
})], H = v.length > 0 && !Me && te.length === 0 && !ae && !ce && me === 0, Fe = async () => {
|
|
1077
|
+
ue(!0), se(void 0);
|
|
1055
1078
|
try {
|
|
1056
|
-
let { results: e, batchErrors: r } = await n.validateBatch(
|
|
1057
|
-
if (j(i),
|
|
1058
|
-
let a = await n.commitBatch(
|
|
1079
|
+
let { results: e, batchErrors: r } = await n.validateBatch(v), i = new Map(e.map((e) => [e.candidateId, e]));
|
|
1080
|
+
if (j(i), ne(r.map((e) => e.message)), v.some((e) => i.get(e.id)?.status === Et.Invalid) || r.length > 0) return;
|
|
1081
|
+
let a = await n.commitBatch(v);
|
|
1059
1082
|
if (a.error) {
|
|
1060
|
-
|
|
1083
|
+
se(a.error);
|
|
1061
1084
|
return;
|
|
1062
1085
|
}
|
|
1063
|
-
d?.(
|
|
1086
|
+
d?.(v), t();
|
|
1064
1087
|
} finally {
|
|
1065
|
-
|
|
1088
|
+
ue(!1);
|
|
1066
1089
|
}
|
|
1067
|
-
},
|
|
1068
|
-
if (
|
|
1090
|
+
}, Ie = _.uploadDialogCloseAriaLabel ?? "Close", Le = _.uploadCancelLabel ?? "Cancel", [Re] = S;
|
|
1091
|
+
if (Re) {
|
|
1069
1092
|
let t = _.uploadConflictTitle ?? "Replace or duplicate it?";
|
|
1070
|
-
return /* @__PURE__ */ F(
|
|
1093
|
+
return /* @__PURE__ */ F(bt, {
|
|
1071
1094
|
isOpen: e,
|
|
1072
1095
|
title: t,
|
|
1073
|
-
closeAriaLabel:
|
|
1074
|
-
onClose: () =>
|
|
1096
|
+
closeAriaLabel: Ie,
|
|
1097
|
+
onClose: () => ke(null),
|
|
1075
1098
|
confirmLabel: _.uploadConflictConfirmLabel ?? "Confirm",
|
|
1076
|
-
onConfirm: () =>
|
|
1077
|
-
cancelLabel:
|
|
1078
|
-
onCancel: () =>
|
|
1099
|
+
onConfirm: () => ke(w),
|
|
1100
|
+
cancelLabel: Le,
|
|
1101
|
+
onCancel: () => ke(null),
|
|
1079
1102
|
colors: h,
|
|
1080
1103
|
children: /* @__PURE__ */ I("div", {
|
|
1081
1104
|
className: "flex flex-col gap-4 px-4 py-4 desktop:px-6",
|
|
1082
1105
|
children: [/* @__PURE__ */ F("p", {
|
|
1083
|
-
ref:
|
|
1106
|
+
ref: Ce,
|
|
1084
1107
|
tabIndex: -1,
|
|
1085
1108
|
className: c("outline-hidden", f),
|
|
1086
|
-
children: _.uploadConflictMessage?.(
|
|
1087
|
-
}), /* @__PURE__ */ F(
|
|
1109
|
+
children: _.uploadConflictMessage?.(Re.path) ?? `Item with the same name "${Re.path}" already exists.`
|
|
1110
|
+
}), /* @__PURE__ */ F(le, {
|
|
1088
1111
|
ariaLabel: t,
|
|
1089
1112
|
value: w,
|
|
1090
|
-
onChange: (e) =>
|
|
1113
|
+
onChange: (e) => T(e === X.Duplicate ? X.Duplicate : X.Replace),
|
|
1091
1114
|
items: [{
|
|
1092
1115
|
value: X.Replace,
|
|
1093
1116
|
label: _.uploadConflictReplaceLabel ?? "Replace"
|
|
@@ -1099,16 +1122,16 @@ var Xe = {
|
|
|
1099
1122
|
})
|
|
1100
1123
|
});
|
|
1101
1124
|
}
|
|
1102
|
-
return /* @__PURE__ */ F(
|
|
1125
|
+
return /* @__PURE__ */ F(bt, {
|
|
1103
1126
|
isOpen: e,
|
|
1104
|
-
title:
|
|
1105
|
-
closeAriaLabel:
|
|
1127
|
+
title: _e ? _.uploadArchiveDialogTitle ?? "Upload archive from device" : _.uploadDialogTitle ?? "Upload files from device",
|
|
1128
|
+
closeAriaLabel: Ie,
|
|
1106
1129
|
onClose: t,
|
|
1107
1130
|
confirmLabel: _.uploadConfirmLabel ?? "Add",
|
|
1108
|
-
onConfirm: () => void
|
|
1109
|
-
isConfirmDisabled: !
|
|
1110
|
-
isConfirming:
|
|
1111
|
-
cancelLabel:
|
|
1131
|
+
onConfirm: () => void Fe(),
|
|
1132
|
+
isConfirmDisabled: !H,
|
|
1133
|
+
isConfirming: ce,
|
|
1134
|
+
cancelLabel: Le,
|
|
1112
1135
|
onCancel: t,
|
|
1113
1136
|
colors: h,
|
|
1114
1137
|
children: /* @__PURE__ */ I("div", {
|
|
@@ -1118,198 +1141,249 @@ var Xe = {
|
|
|
1118
1141
|
"--se-upload-row-border": g?.rowBorder
|
|
1119
1142
|
}),
|
|
1120
1143
|
children: [
|
|
1121
|
-
/* @__PURE__ */ F(
|
|
1144
|
+
/* @__PURE__ */ F(O, {
|
|
1122
1145
|
label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
|
|
1123
1146
|
className: "desktop:hidden",
|
|
1124
|
-
children:
|
|
1147
|
+
children: _e ? _.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : _.uploadDropZoneMobileLabel ?? "Click here to upload"
|
|
1125
1148
|
}), /* @__PURE__ */ F("span", {
|
|
1126
1149
|
className: "hidden desktop:inline",
|
|
1127
|
-
children:
|
|
1150
|
+
children: _e ? _.uploadArchiveDropZoneLabel ?? "Drag and drop a .zip archive or click here to upload" : _.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
|
|
1128
1151
|
})] }),
|
|
1129
|
-
description:
|
|
1152
|
+
description: _e ? _.uploadArchiveDropZoneDescription : _.uploadDropZoneDescription,
|
|
1130
1153
|
id: be,
|
|
1131
1154
|
ariaLabel: _.uploadDropZoneAriaLabel ?? "Upload files",
|
|
1132
1155
|
multiple: !0,
|
|
1133
|
-
accept:
|
|
1134
|
-
className:
|
|
1135
|
-
onChange:
|
|
1136
|
-
onReject:
|
|
1156
|
+
accept: _e ? Q : void 0,
|
|
1157
|
+
className: Ne ? Z.invalidDropZone : void 0,
|
|
1158
|
+
onChange: je,
|
|
1159
|
+
onReject: _e ? () => pe(ve) : void 0
|
|
1137
1160
|
}),
|
|
1138
|
-
me > 0 && /* @__PURE__ */ F(
|
|
1139
|
-
/* @__PURE__ */ F(
|
|
1140
|
-
text:
|
|
1141
|
-
announce:
|
|
1161
|
+
me > 0 && /* @__PURE__ */ F(fe, { ariaLabel: _.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
|
|
1162
|
+
/* @__PURE__ */ F(D, {
|
|
1163
|
+
text: de,
|
|
1164
|
+
announce: M.Assertive
|
|
1142
1165
|
}),
|
|
1143
|
-
/* @__PURE__ */ F(
|
|
1166
|
+
/* @__PURE__ */ F(re, {
|
|
1144
1167
|
visuallyHidden: !0,
|
|
1145
|
-
as:
|
|
1168
|
+
as: ie.Span,
|
|
1146
1169
|
id: ye,
|
|
1147
|
-
children:
|
|
1170
|
+
children: Pe.map((e) => `${_.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
|
|
1148
1171
|
}),
|
|
1149
|
-
|
|
1150
|
-
|
|
1172
|
+
te.map((e) => /* @__PURE__ */ F(D, { text: e }, e)),
|
|
1173
|
+
v.length > 0 && /* @__PURE__ */ F("ul", {
|
|
1151
1174
|
className: "flex flex-col gap-2",
|
|
1152
|
-
children:
|
|
1153
|
-
let t = A.get(e.id), n = t?.kind ===
|
|
1175
|
+
children: v.map((e) => {
|
|
1176
|
+
let t = A.get(e.id), n = t?.kind === Tt.Manifest, r = t?.status === Et.Invalid, i = r ? t?.error : void 0, a = `${xe}${e.id}`;
|
|
1154
1177
|
return /* @__PURE__ */ I("li", {
|
|
1155
|
-
className: c("flex items-center gap-2 rounded-lg border p-2",
|
|
1156
|
-
children: [/* @__PURE__ */ F(
|
|
1178
|
+
className: c("flex items-center gap-2 rounded-lg border p-2", Z.row),
|
|
1179
|
+
children: [/* @__PURE__ */ F(k, {
|
|
1157
1180
|
name: e.path,
|
|
1158
1181
|
className: "min-w-0 flex-1",
|
|
1159
1182
|
details: /* @__PURE__ */ I(P, { children: [
|
|
1160
|
-
/* @__PURE__ */ F(
|
|
1183
|
+
/* @__PURE__ */ F(y, {
|
|
1161
1184
|
className: p,
|
|
1162
1185
|
text: s(e.file.size)
|
|
1163
1186
|
}),
|
|
1164
|
-
/* @__PURE__ */ F(
|
|
1187
|
+
/* @__PURE__ */ F(D, {
|
|
1165
1188
|
id: a,
|
|
1166
1189
|
text: i
|
|
1167
1190
|
}),
|
|
1168
|
-
n && !r && /* @__PURE__ */ F(
|
|
1191
|
+
n && !r && /* @__PURE__ */ F(y, {
|
|
1169
1192
|
className: p,
|
|
1170
1193
|
text: _.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
|
|
1171
1194
|
}),
|
|
1172
|
-
e.replacesExisting && !r && /* @__PURE__ */ F(
|
|
1195
|
+
e.replacesExisting && !r && /* @__PURE__ */ F(y, {
|
|
1173
1196
|
className: p,
|
|
1174
1197
|
text: _.uploadReplaceRowNote ?? "Will replace the existing file"
|
|
1175
1198
|
})
|
|
1176
1199
|
] })
|
|
1177
1200
|
}), /* @__PURE__ */ F(ee, {
|
|
1178
|
-
icon: /* @__PURE__ */ F(
|
|
1201
|
+
icon: /* @__PURE__ */ F(Se, {
|
|
1179
1202
|
size: 16,
|
|
1180
1203
|
"aria-hidden": !0,
|
|
1181
|
-
stroke:
|
|
1204
|
+
stroke: x
|
|
1182
1205
|
}),
|
|
1183
1206
|
"aria-label": _.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
|
|
1184
1207
|
"aria-describedby": i ? a : void 0,
|
|
1185
|
-
onClick: () =>
|
|
1208
|
+
onClick: () => V(e.id)
|
|
1186
1209
|
})]
|
|
1187
1210
|
}, e.id);
|
|
1188
1211
|
})
|
|
1189
1212
|
}),
|
|
1190
|
-
/* @__PURE__ */ F(
|
|
1213
|
+
/* @__PURE__ */ F(D, {
|
|
1191
1214
|
text: N,
|
|
1192
|
-
announce:
|
|
1215
|
+
announce: M.Assertive
|
|
1193
1216
|
})
|
|
1194
1217
|
]
|
|
1195
1218
|
})
|
|
1196
1219
|
});
|
|
1197
|
-
},
|
|
1220
|
+
}, Mt = {
|
|
1221
|
+
list: "_list_1hpyi_1",
|
|
1222
|
+
row: "_row_1hpyi_5",
|
|
1223
|
+
count: "_count_1hpyi_14"
|
|
1224
|
+
}, Nt = (e) => e === 1 ? "1 item" : `${e} items`, Pt = ({ folderPath: e, entries: t, onOpen: n, rootLabel: r = "Skill", breadcrumbAriaLabel: i = "Folder path", overflowAriaLabel: a = "Show hidden path segments", listAriaLabel: o = "Folder content", emptyTitle: s = "This folder is empty", emptyDescription: l = "Use Add to upload files or create a subfolder.", itemCountLabel: u = Nt, itemCountClassName: d = "dial-tiny-text" }) => {
|
|
1225
|
+
let f = e.split("/"), p = [{
|
|
1226
|
+
label: r,
|
|
1227
|
+
onClick: () => n("", G.Folder)
|
|
1228
|
+
}, ...f.map((e, t) => {
|
|
1229
|
+
let r = f.slice(0, t + 1).join("/");
|
|
1230
|
+
return t === f.length - 1 ? { label: e } : {
|
|
1231
|
+
label: e,
|
|
1232
|
+
onClick: () => n(r, G.Folder)
|
|
1233
|
+
};
|
|
1234
|
+
})];
|
|
1235
|
+
return /* @__PURE__ */ I("div", {
|
|
1236
|
+
className: "flex min-h-0 flex-1 flex-col gap-4",
|
|
1237
|
+
children: [/* @__PURE__ */ F(h, {
|
|
1238
|
+
items: p,
|
|
1239
|
+
ariaLabel: i,
|
|
1240
|
+
overflowAriaLabel: a
|
|
1241
|
+
}), t.length === 0 ? /* @__PURE__ */ F(oe, {
|
|
1242
|
+
title: s,
|
|
1243
|
+
description: l,
|
|
1244
|
+
live: !0
|
|
1245
|
+
}) : /* @__PURE__ */ F("ul", {
|
|
1246
|
+
"aria-label": o,
|
|
1247
|
+
className: c("m-0 flex list-none flex-col overflow-hidden rounded-lg border p-0", Mt.list),
|
|
1248
|
+
children: t.map((e) => {
|
|
1249
|
+
let t = e.kind === G.Folder;
|
|
1250
|
+
return /* @__PURE__ */ F("li", {
|
|
1251
|
+
className: "m-0 p-0",
|
|
1252
|
+
children: /* @__PURE__ */ I("button", {
|
|
1253
|
+
type: "button",
|
|
1254
|
+
onClick: () => n(e.path, e.kind),
|
|
1255
|
+
className: c("flex w-full cursor-pointer items-center justify-between gap-4 border-b bg-transparent px-3 py-2 text-start last:border-b-0", Mt.row),
|
|
1256
|
+
children: [/* @__PURE__ */ F(k, {
|
|
1257
|
+
name: e.name,
|
|
1258
|
+
type: t ? C.Folder : C.File,
|
|
1259
|
+
className: "min-w-0 flex-1"
|
|
1260
|
+
}), t && /* @__PURE__ */ F("span", {
|
|
1261
|
+
className: c("shrink-0", Mt.count, d),
|
|
1262
|
+
children: u(e.childCount)
|
|
1263
|
+
})]
|
|
1264
|
+
})
|
|
1265
|
+
}, e.path);
|
|
1266
|
+
})
|
|
1267
|
+
})]
|
|
1268
|
+
});
|
|
1269
|
+
}, Ft = {
|
|
1198
1270
|
title: "_title_lgmx6_1",
|
|
1199
1271
|
helperText: "_helperText_lgmx6_5",
|
|
1200
1272
|
refineFeedback: "_refineFeedback_lgmx6_9",
|
|
1201
1273
|
refineError: "_refineError_lgmx6_13",
|
|
1202
1274
|
menuIcon: "_menuIcon_lgmx6_17"
|
|
1203
|
-
},
|
|
1204
|
-
mode:
|
|
1275
|
+
}, It = {
|
|
1276
|
+
mode: _t.Files,
|
|
1205
1277
|
targetFolderPath: ""
|
|
1206
|
-
},
|
|
1207
|
-
let { MarkdownEditor: e } = await
|
|
1278
|
+
}, Lt = [U.Name, U.Description], Rt = 24, zt = 300, Bt = "pb-0 desktop:px-8 desktop:py-6", Vt = "desktop:px-8 desktop:py-6", Ht = "gap-4 px-4 pt-5 pb-6 desktop:gap-5 desktop:px-8 desktop:py-6", Ut = Te(async () => {
|
|
1279
|
+
let { MarkdownEditor: e } = await je();
|
|
1208
1280
|
return { default: e };
|
|
1209
|
-
}),
|
|
1210
|
-
let [
|
|
1281
|
+
}), Wt = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: d, expandedPaths: p, onExpandedPathsChange: m, isLoading: h = !1, hasLoadError: S = !1, isSubmitting: C = !1, errors: O, submitError: k, conflict: j, onReloadLatest: ne, isNameReadOnly: re = !1, onDirtyChange: ie, onValuesChange: M, onRefineDescription: ae, onRefineInstructions: oe, fileActions: N, supportingFileContent: se, asideData: le, onSubmit: ue, onCancel: de, onBack: pe, backAriaLabel: me, title: he, onRetry: ge, onRetrySubmit: be, labels: xe, styles: Te, dir: Ee, instructionsEditorTheme: je = w.light }) => {
|
|
1282
|
+
let [V, Me] = B({
|
|
1211
1283
|
name: r?.name ?? "",
|
|
1212
1284
|
description: r?.description ?? "",
|
|
1213
1285
|
instructions: r?.instructions ?? ""
|
|
1214
|
-
}),
|
|
1215
|
-
u(() => document.getElementById(
|
|
1216
|
-
let
|
|
1217
|
-
bottomGap:
|
|
1218
|
-
minHeight:
|
|
1219
|
-
}),
|
|
1286
|
+
}), Ne = Oe(), Pe = Oe();
|
|
1287
|
+
u(() => document.getElementById(Ne), Pe, !!O?.instructions);
|
|
1288
|
+
let H = z(void 0), Fe = l({
|
|
1289
|
+
bottomGap: Rt,
|
|
1290
|
+
minHeight: zt
|
|
1291
|
+
}), Ie = z(V), Le = (e) => {
|
|
1220
1292
|
let t = {
|
|
1221
|
-
...
|
|
1293
|
+
...Ie.current,
|
|
1222
1294
|
...e
|
|
1223
1295
|
};
|
|
1224
|
-
|
|
1225
|
-
},
|
|
1226
|
-
if (
|
|
1227
|
-
|
|
1296
|
+
Ie.current = t, Me(t), M?.(t);
|
|
1297
|
+
}, Re = (e) => e ? async (t, n) => {
|
|
1298
|
+
if (H.current && !H.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
1299
|
+
H.current = n;
|
|
1228
1300
|
try {
|
|
1229
1301
|
return await e(t, n);
|
|
1230
1302
|
} finally {
|
|
1231
|
-
|
|
1303
|
+
H.current === n && (H.current = void 0);
|
|
1232
1304
|
}
|
|
1233
|
-
} : void 0,
|
|
1234
|
-
value:
|
|
1235
|
-
onChange: (e) =>
|
|
1236
|
-
onRefine:
|
|
1237
|
-
disabled:
|
|
1305
|
+
} : void 0, ze = f({
|
|
1306
|
+
value: V.description,
|
|
1307
|
+
onChange: (e) => Le({ description: e }),
|
|
1308
|
+
onRefine: Re(ae),
|
|
1309
|
+
disabled: C || h || S,
|
|
1238
1310
|
resetKey: r
|
|
1239
|
-
}),
|
|
1240
|
-
value:
|
|
1241
|
-
onChange: (e) =>
|
|
1242
|
-
onRefine:
|
|
1243
|
-
disabled:
|
|
1311
|
+
}), U = f({
|
|
1312
|
+
value: V.instructions,
|
|
1313
|
+
onChange: (e) => Le({ instructions: e }),
|
|
1314
|
+
onRefine: Re(oe),
|
|
1315
|
+
disabled: C || h || S,
|
|
1244
1316
|
resetKey: r
|
|
1245
|
-
}),
|
|
1246
|
-
|
|
1247
|
-
},
|
|
1248
|
-
|
|
1249
|
-
},
|
|
1250
|
-
|
|
1251
|
-
},
|
|
1252
|
-
|
|
1253
|
-
},
|
|
1254
|
-
|
|
1255
|
-
|
|
1317
|
+
}), Be = ze.isPending || U.isPending, Ve = () => {
|
|
1318
|
+
ze.reset(), U.reset();
|
|
1319
|
+
}, He = () => {
|
|
1320
|
+
Ve(), de();
|
|
1321
|
+
}, Ue = () => {
|
|
1322
|
+
Ve(), pe();
|
|
1323
|
+
}, We = () => {
|
|
1324
|
+
C || h || S || H.current && !H.current.aborted || ue(V);
|
|
1325
|
+
}, Ge = z(r), Ke = Ge.current !== r, qe = z(i), [Je, Ye] = B(!1);
|
|
1326
|
+
De(() => {
|
|
1327
|
+
Ge.current = r;
|
|
1256
1328
|
let e = {
|
|
1257
1329
|
name: r?.name ?? "",
|
|
1258
1330
|
description: r?.description ?? "",
|
|
1259
1331
|
instructions: r?.instructions ?? ""
|
|
1260
1332
|
};
|
|
1261
|
-
|
|
1333
|
+
Ie.current = e, Me(e), qe.current = i, Ye(!1);
|
|
1262
1334
|
}, [r]);
|
|
1263
|
-
let
|
|
1264
|
-
|
|
1265
|
-
if (
|
|
1335
|
+
let Xe = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), Ze = z(!1);
|
|
1336
|
+
De(() => {
|
|
1337
|
+
if (Ke) return;
|
|
1266
1338
|
let e = {
|
|
1267
1339
|
name: r?.name ?? "",
|
|
1268
1340
|
description: r?.description ?? "",
|
|
1269
1341
|
instructions: r?.instructions ?? ""
|
|
1270
|
-
}, t = JSON.stringify(
|
|
1271
|
-
t !==
|
|
1342
|
+
}, t = JSON.stringify(V) !== JSON.stringify(e) || Xe(i) !== Xe(qe.current) || Je;
|
|
1343
|
+
t !== Ze.current && (Ze.current = t, ie?.(t));
|
|
1272
1344
|
}, [
|
|
1273
|
-
|
|
1345
|
+
V,
|
|
1274
1346
|
i,
|
|
1275
1347
|
r,
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1348
|
+
Ke,
|
|
1349
|
+
Je,
|
|
1350
|
+
ie
|
|
1279
1351
|
]);
|
|
1280
|
-
let [
|
|
1281
|
-
|
|
1282
|
-
}, [d]), [
|
|
1352
|
+
let [et, nt] = B(W), K = s ?? et, q = L((e) => {
|
|
1353
|
+
nt(e), d?.(e);
|
|
1354
|
+
}, [d]), [ot, st] = B([]), lt = p ?? ot, ut = R(() => new Set(lt), [lt]), pt = L((e) => {
|
|
1283
1355
|
let t = [...e];
|
|
1284
|
-
|
|
1285
|
-
}, [m]), [
|
|
1286
|
-
|
|
1287
|
-
}, []), [
|
|
1288
|
-
|
|
1289
|
-
...
|
|
1356
|
+
st(t), m?.(t);
|
|
1357
|
+
}, [m]), [ht, yt] = B(!1), [bt, St] = B(It), Y = L((e) => {
|
|
1358
|
+
St(e), yt(!0);
|
|
1359
|
+
}, []), [Tt, Et] = B(!1), { isDragActive: X, dropZoneHandlers: Dt } = gt(L((e) => {
|
|
1360
|
+
ht || Y({
|
|
1361
|
+
...It,
|
|
1290
1362
|
initialFiles: e
|
|
1291
1363
|
});
|
|
1292
|
-
}, [
|
|
1364
|
+
}, [ht, Y])), Z = xe ?? {}, Q = Te?.colors, $ = Te?.typography ?? {}, Ot = $.titleClassName ?? "dial-body-semi-text", kt = $.helperTextClassName ?? "dial-tiny-semi-text", At = $.removeIconClassName, Mt = R(() => o({ "--se-menu-icon": Q?.menuIcon }), [Q?.menuIcon]), Nt = o({
|
|
1293
1365
|
"--se-title-color": Q?.title,
|
|
1294
1366
|
"--se-helper-text-color": Q?.helperText,
|
|
1295
1367
|
"--se-refine-action-text": Q?.refineActionText,
|
|
1296
1368
|
"--se-refine-error-text": Q?.refineErrorText,
|
|
1297
1369
|
"--se-files-card-bg": Q?.filesCardBackground,
|
|
1298
1370
|
"--se-files-card-border": Q?.filesCardBorder,
|
|
1371
|
+
"--se-folder-row-border": Q?.folderRowBorder,
|
|
1372
|
+
"--se-folder-row-hover-bg": Q?.folderRowHoverBackground,
|
|
1299
1373
|
"--se-drop-overlay-icon": Q?.dropOverlayIcon
|
|
1300
|
-
}),
|
|
1374
|
+
}), Wt = {
|
|
1301
1375
|
footerBackground: Q?.dialogFooterBackground,
|
|
1302
1376
|
footerBorder: Q?.dialogFooterBorder
|
|
1303
|
-
},
|
|
1304
|
-
feedbackClassName: c(Q?.refineActionText &&
|
|
1305
|
-
errorClassName:
|
|
1306
|
-
},
|
|
1377
|
+
}, Gt = {
|
|
1378
|
+
feedbackClassName: c(Q?.refineActionText && Ft.refineFeedback, $.refineFeedbackClassName, rt.refineFeedback),
|
|
1379
|
+
errorClassName: Ft.refineError
|
|
1380
|
+
}, Kt = {
|
|
1307
1381
|
layout: Q?.border ? { colors: {
|
|
1308
1382
|
headerBorderColor: Q.border,
|
|
1309
1383
|
sidebarBorderColor: Q.border
|
|
1310
1384
|
} } : void 0,
|
|
1311
1385
|
section: Q?.title ? { colors: { titleColor: Q.title } } : void 0
|
|
1312
|
-
},
|
|
1386
|
+
}, qt = R(() => ({
|
|
1313
1387
|
required: Z.folderNameRequiredError ?? "Enter a folder name",
|
|
1314
1388
|
invalid: Z.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
|
|
1315
1389
|
duplicate: Z.folderNameDuplicateError ?? "An item with this name already exists here"
|
|
@@ -1317,187 +1391,198 @@ var Xe = {
|
|
|
1317
1391
|
Z.folderNameRequiredError,
|
|
1318
1392
|
Z.folderNameInvalidError,
|
|
1319
1393
|
Z.folderNameDuplicateError
|
|
1320
|
-
]),
|
|
1321
|
-
|
|
1322
|
-
}, [
|
|
1394
|
+
]), Jt = L((e) => {
|
|
1395
|
+
ut.has(e) || pt(/* @__PURE__ */ new Set([...ut, e]));
|
|
1396
|
+
}, [ut, pt]), Yt = bt.targetFolderPath, Xt = R(() => ({
|
|
1323
1397
|
...N,
|
|
1324
1398
|
commitBatch: async (e) => {
|
|
1325
1399
|
let t = await N.commitBatch(e);
|
|
1326
|
-
return !t.error &&
|
|
1400
|
+
return !t.error && Yt !== "" && Jt(Yt), t;
|
|
1327
1401
|
}
|
|
1328
1402
|
}), [
|
|
1329
1403
|
N,
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
]),
|
|
1404
|
+
Yt,
|
|
1405
|
+
Jt
|
|
1406
|
+
]), Zt = mt({
|
|
1333
1407
|
files: i,
|
|
1334
1408
|
fileActions: N,
|
|
1335
1409
|
defaultName: Z.newFolderDefaultName ?? "New folder",
|
|
1336
|
-
messages:
|
|
1337
|
-
onRevealFolder:
|
|
1338
|
-
onCreated:
|
|
1339
|
-
}), { draftNode:
|
|
1340
|
-
path:
|
|
1341
|
-
name:
|
|
1342
|
-
kind:
|
|
1343
|
-
}, ...i]), [i]),
|
|
1410
|
+
messages: qt,
|
|
1411
|
+
onRevealFolder: Jt,
|
|
1412
|
+
onCreated: q
|
|
1413
|
+
}), { draftNode: Qt, draftPath: $t, draftPane: en } = Zt, tn = R(() => at([{
|
|
1414
|
+
path: W,
|
|
1415
|
+
name: W,
|
|
1416
|
+
kind: G.File
|
|
1417
|
+
}, ...i]), [i]), nn = R(() => Qt ? at([
|
|
1344
1418
|
{
|
|
1345
|
-
path:
|
|
1346
|
-
name:
|
|
1347
|
-
kind:
|
|
1419
|
+
path: W,
|
|
1420
|
+
name: W,
|
|
1421
|
+
kind: G.File
|
|
1348
1422
|
},
|
|
1349
1423
|
...i,
|
|
1350
|
-
Yt
|
|
1351
|
-
]) : Qt, [
|
|
1352
|
-
i,
|
|
1353
|
-
Yt,
|
|
1354
1424
|
Qt
|
|
1355
|
-
])
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1425
|
+
]) : tn, [
|
|
1426
|
+
i,
|
|
1427
|
+
Qt,
|
|
1428
|
+
tn
|
|
1429
|
+
]), rn = R(() => i.find((e) => e.path === K), [i, K]), an = R(() => dt(i, K), [i, K]), on = rn?.kind === G.Folder || an.length > 0, sn = L((e) => {
|
|
1430
|
+
e.path !== $t && q(e.path);
|
|
1431
|
+
}, [q, $t]), cn = L((e, t) => {
|
|
1432
|
+
if (e === "") {
|
|
1433
|
+
q(W);
|
|
1434
|
+
return;
|
|
1435
|
+
}
|
|
1436
|
+
let n = [...ft(e), ...t === G.Folder ? [e] : []].filter((e) => !ut.has(e));
|
|
1437
|
+
n.length > 0 && pt(/* @__PURE__ */ new Set([...ut, ...n])), q(e);
|
|
1438
|
+
}, [
|
|
1439
|
+
ut,
|
|
1440
|
+
pt,
|
|
1441
|
+
q
|
|
1442
|
+
]), ln = L((e) => {
|
|
1443
|
+
N.onRemoveNode(e), (K === e || K.startsWith(`${e}/`)) && q(W);
|
|
1359
1444
|
}, [
|
|
1360
1445
|
N,
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
]), { startDraft:
|
|
1364
|
-
t === J.Mobile ?
|
|
1365
|
-
}, [
|
|
1366
|
-
if (!
|
|
1367
|
-
let t = await
|
|
1368
|
-
t?.length &&
|
|
1369
|
-
mode:
|
|
1446
|
+
K,
|
|
1447
|
+
q
|
|
1448
|
+
]), { startDraft: un } = Zt, { onCreateFolder: dn, extractArchive: fn, pickFromFileSystem: pn } = N, [mn, hn] = B(null), gn = L((e, t) => {
|
|
1449
|
+
t === J.Mobile ? hn(e) : un(e, t);
|
|
1450
|
+
}, [un]), _n = R(() => i.filter((e) => e.kind === G.File).map((e) => e.path), [i]), vn = L(async (e) => {
|
|
1451
|
+
if (!pn) return;
|
|
1452
|
+
let t = await pn();
|
|
1453
|
+
t?.length && Y({
|
|
1454
|
+
mode: _t.Files,
|
|
1370
1455
|
targetFolderPath: e,
|
|
1371
1456
|
initialEntries: t
|
|
1372
1457
|
});
|
|
1373
|
-
}, [
|
|
1374
|
-
let n = (e) =>
|
|
1375
|
-
return
|
|
1458
|
+
}, [pn, Y]), yn = L((e, t) => {
|
|
1459
|
+
let n = (e) => vt(e, Ft.menuIcon, void 0, Mt), r = [];
|
|
1460
|
+
return dn && r.push({
|
|
1376
1461
|
key: "create-folder",
|
|
1377
1462
|
label: Z.createFolderLabel ?? "Create folder",
|
|
1378
|
-
icon: n(
|
|
1379
|
-
onClick: () =>
|
|
1463
|
+
icon: n(ye),
|
|
1464
|
+
onClick: () => gn(e, t)
|
|
1380
1465
|
}), r.push({
|
|
1381
1466
|
key: "upload-files",
|
|
1382
1467
|
label: Z.uploadFilesLabel ?? "Upload files from device",
|
|
1383
|
-
icon: n(
|
|
1384
|
-
onClick: () =>
|
|
1385
|
-
mode:
|
|
1468
|
+
icon: n(Ce),
|
|
1469
|
+
onClick: () => Y({
|
|
1470
|
+
mode: _t.Files,
|
|
1386
1471
|
targetFolderPath: e
|
|
1387
1472
|
})
|
|
1388
|
-
}),
|
|
1473
|
+
}), fn && r.push({
|
|
1389
1474
|
key: "upload-archive",
|
|
1390
1475
|
label: Z.uploadArchiveLabel ?? "Upload archive from device",
|
|
1391
|
-
icon: n(
|
|
1392
|
-
onClick: () =>
|
|
1393
|
-
mode:
|
|
1476
|
+
icon: n(ve),
|
|
1477
|
+
onClick: () => Y({
|
|
1478
|
+
mode: _t.Archive,
|
|
1394
1479
|
targetFolderPath: e
|
|
1395
1480
|
})
|
|
1396
|
-
}),
|
|
1481
|
+
}), pn && r.push({
|
|
1397
1482
|
key: "open-file-system",
|
|
1398
1483
|
label: Z.openFileSystemLabel ?? "Open DIAL file system",
|
|
1399
|
-
icon: n(
|
|
1400
|
-
onClick: () => void
|
|
1484
|
+
icon: n(_e),
|
|
1485
|
+
onClick: () => void vn(e)
|
|
1401
1486
|
}), r;
|
|
1402
1487
|
}, [
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1488
|
+
Mt,
|
|
1489
|
+
dn,
|
|
1490
|
+
fn,
|
|
1491
|
+
pn,
|
|
1407
1492
|
Z.createFolderLabel,
|
|
1408
1493
|
Z.uploadFilesLabel,
|
|
1409
1494
|
Z.uploadArchiveLabel,
|
|
1410
1495
|
Z.openFileSystemLabel,
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
]),
|
|
1415
|
-
let e =
|
|
1496
|
+
gn,
|
|
1497
|
+
Y,
|
|
1498
|
+
vn
|
|
1499
|
+
]), bn = R(() => {
|
|
1500
|
+
let e = ct(it.Header, i.find((e) => e.path === K));
|
|
1416
1501
|
return {
|
|
1417
|
-
[J.Mobile]:
|
|
1418
|
-
[J.Desktop]:
|
|
1502
|
+
[J.Mobile]: yn(e, J.Mobile),
|
|
1503
|
+
[J.Desktop]: yn(e, J.Desktop)
|
|
1419
1504
|
};
|
|
1420
1505
|
}, [
|
|
1421
|
-
|
|
1506
|
+
yn,
|
|
1422
1507
|
i,
|
|
1423
|
-
|
|
1424
|
-
]),
|
|
1425
|
-
if (e.path ===
|
|
1508
|
+
K
|
|
1509
|
+
]), xn = L((e, t) => {
|
|
1510
|
+
if (e.path === $t || e.nodeType !== ke.FOLDER) return [];
|
|
1426
1511
|
let n = {
|
|
1427
1512
|
path: e.path,
|
|
1428
1513
|
name: e.name,
|
|
1429
|
-
kind:
|
|
1430
|
-
}, r =
|
|
1514
|
+
kind: G.Folder
|
|
1515
|
+
}, r = yn(ct(it.Child, n), t);
|
|
1431
1516
|
return r.push({
|
|
1432
1517
|
key: "delete",
|
|
1433
1518
|
label: Z.deleteLabel ?? "Delete",
|
|
1434
1519
|
danger: !0,
|
|
1435
|
-
icon:
|
|
1436
|
-
onClick: () =>
|
|
1520
|
+
icon: vt(Se, At),
|
|
1521
|
+
onClick: () => ln(e.path)
|
|
1437
1522
|
}), r;
|
|
1438
1523
|
}, [
|
|
1439
|
-
|
|
1524
|
+
$t,
|
|
1440
1525
|
Z.deleteLabel,
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
]),
|
|
1445
|
-
[J.Mobile]: (e) =>
|
|
1446
|
-
[J.Desktop]: (e) =>
|
|
1447
|
-
}), [
|
|
1448
|
-
size:
|
|
1449
|
-
icon:
|
|
1526
|
+
At,
|
|
1527
|
+
yn,
|
|
1528
|
+
ln
|
|
1529
|
+
]), Sn = R(() => ({
|
|
1530
|
+
[J.Mobile]: (e) => xn(e, J.Mobile),
|
|
1531
|
+
[J.Desktop]: (e) => xn(e, J.Desktop)
|
|
1532
|
+
}), [xn]), Cn = L((e) => e.nodeType === ke.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ F(ee, {
|
|
1533
|
+
size: T.Small,
|
|
1534
|
+
icon: vt(Se, At, b.SM),
|
|
1450
1535
|
"aria-label": Z.deleteLabel ?? "Delete",
|
|
1451
|
-
onClick: () =>
|
|
1536
|
+
onClick: () => ln(e.path)
|
|
1452
1537
|
}), [
|
|
1453
1538
|
Z.deleteLabel,
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
]),
|
|
1539
|
+
At,
|
|
1540
|
+
ln
|
|
1541
|
+
]), wn = (e) => /* @__PURE__ */ I("div", {
|
|
1457
1542
|
className: "flex flex-col gap-2 desktop:gap-5",
|
|
1458
1543
|
children: [/* @__PURE__ */ I("div", {
|
|
1459
1544
|
className: "flex items-center justify-between",
|
|
1460
1545
|
children: [/* @__PURE__ */ F("span", {
|
|
1461
|
-
className: c(
|
|
1546
|
+
className: c(Ft.title, Ot),
|
|
1462
1547
|
children: Z.filesHeading ?? "Files"
|
|
1463
|
-
}), /* @__PURE__ */ F(
|
|
1548
|
+
}), /* @__PURE__ */ F(_, {
|
|
1464
1549
|
label: Z.addLabel ?? "Add",
|
|
1465
|
-
variant:
|
|
1466
|
-
appearance:
|
|
1467
|
-
size:
|
|
1468
|
-
items:
|
|
1550
|
+
variant: v.Neutral,
|
|
1551
|
+
appearance: g.Solid,
|
|
1552
|
+
size: T.Small,
|
|
1553
|
+
items: bn[e]
|
|
1469
1554
|
})]
|
|
1470
1555
|
}), /* @__PURE__ */ F("div", {
|
|
1471
1556
|
role: "tree",
|
|
1472
1557
|
"aria-label": Z.filesTreeAriaLabel ?? "Skill files",
|
|
1473
|
-
children: /* @__PURE__ */ F(
|
|
1474
|
-
items:
|
|
1558
|
+
children: /* @__PURE__ */ F(Ae, {
|
|
1559
|
+
items: en === e ? nn : tn,
|
|
1475
1560
|
showFiles: !0,
|
|
1476
|
-
selectedPath:
|
|
1477
|
-
expandedPaths:
|
|
1478
|
-
onExpandedPathsChange:
|
|
1479
|
-
onItemClick:
|
|
1480
|
-
getContextMenuItems:
|
|
1481
|
-
renderItemActions:
|
|
1482
|
-
renamedPath:
|
|
1483
|
-
onRenameSave:
|
|
1484
|
-
onRenameCancel:
|
|
1485
|
-
onRenameValidate:
|
|
1561
|
+
selectedPath: K,
|
|
1562
|
+
expandedPaths: ut,
|
|
1563
|
+
onExpandedPathsChange: pt,
|
|
1564
|
+
onItemClick: sn,
|
|
1565
|
+
getContextMenuItems: Sn[e],
|
|
1566
|
+
renderItemActions: Cn,
|
|
1567
|
+
renamedPath: en === e ? $t : void 0,
|
|
1568
|
+
onRenameSave: Zt.handleSave,
|
|
1569
|
+
onRenameCancel: Zt.handleCancel,
|
|
1570
|
+
onRenameValidate: Zt.handleValidate,
|
|
1486
1571
|
rootItemPath: ""
|
|
1487
1572
|
})
|
|
1488
1573
|
})]
|
|
1489
|
-
}),
|
|
1490
|
-
name:
|
|
1491
|
-
description:
|
|
1574
|
+
}), Tn = R(() => ({
|
|
1575
|
+
name: V.name,
|
|
1576
|
+
description: V.description,
|
|
1492
1577
|
iconUrl: "",
|
|
1493
1578
|
version: "",
|
|
1494
1579
|
topics: [],
|
|
1495
1580
|
otherLocales: []
|
|
1496
|
-
}), [
|
|
1497
|
-
name:
|
|
1498
|
-
description:
|
|
1499
|
-
}), [
|
|
1500
|
-
|
|
1581
|
+
}), [V.name, V.description]), En = R(() => ({
|
|
1582
|
+
name: O?.name,
|
|
1583
|
+
description: O?.description
|
|
1584
|
+
}), [O?.name, O?.description]), Dn = R(() => ({ form: {
|
|
1585
|
+
...$e,
|
|
1501
1586
|
name: {
|
|
1502
1587
|
label: Z.nameLabel ?? "Name",
|
|
1503
1588
|
placeholder: Z.namePlaceholder ?? "good-morning-breakfast"
|
|
@@ -1512,209 +1597,221 @@ var Xe = {
|
|
|
1512
1597
|
Z.namePlaceholder,
|
|
1513
1598
|
Z.descriptionLabel,
|
|
1514
1599
|
Z.descriptionPlaceholder
|
|
1515
|
-
]),
|
|
1516
|
-
e.name !== void 0 &&
|
|
1517
|
-
},
|
|
1600
|
+
]), On = (e) => {
|
|
1601
|
+
e.name !== void 0 && Le({ name: e.name }), e.description !== void 0 && (ze.reset(), Le({ description: e.description }));
|
|
1602
|
+
}, kn = ae ? (e, t) => /* @__PURE__ */ F(a, {
|
|
1518
1603
|
isEnabled: !0,
|
|
1519
1604
|
fieldId: t,
|
|
1520
1605
|
required: !0,
|
|
1521
1606
|
label: Z.descriptionLabel ?? "Description",
|
|
1522
1607
|
labels: Z,
|
|
1523
|
-
refinement:
|
|
1524
|
-
disabled:
|
|
1525
|
-
...
|
|
1608
|
+
refinement: ze,
|
|
1609
|
+
disabled: Be || C,
|
|
1610
|
+
...Gt,
|
|
1526
1611
|
children: e
|
|
1527
|
-
}) : void 0,
|
|
1528
|
-
title:
|
|
1529
|
-
onBack:
|
|
1530
|
-
onCancel:
|
|
1531
|
-
onSubmit:
|
|
1612
|
+
}) : void 0, An = {
|
|
1613
|
+
title: he,
|
|
1614
|
+
onBack: Ue,
|
|
1615
|
+
onCancel: He,
|
|
1616
|
+
onSubmit: We,
|
|
1532
1617
|
submitLabel: Z.createLabel ?? "Create",
|
|
1533
|
-
isSubmitDisabled:
|
|
1618
|
+
isSubmitDisabled: Be || h || S,
|
|
1534
1619
|
labels: {
|
|
1535
1620
|
cancelLabel: Z.cancelLabel ?? "Cancel",
|
|
1536
|
-
backAriaLabel:
|
|
1621
|
+
backAriaLabel: me ?? "Back",
|
|
1537
1622
|
savingStatusLabel: Z.savingStatusLabel ?? "Saving"
|
|
1538
1623
|
},
|
|
1539
|
-
styles:
|
|
1624
|
+
styles: Kt,
|
|
1540
1625
|
metadataTitle: null
|
|
1541
1626
|
};
|
|
1542
|
-
if (
|
|
1543
|
-
dir:
|
|
1627
|
+
if (h) return /* @__PURE__ */ F("div", {
|
|
1628
|
+
dir: Ee,
|
|
1544
1629
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1545
|
-
children: /* @__PURE__ */ F(
|
|
1546
|
-
...
|
|
1630
|
+
children: /* @__PURE__ */ F(Qe, {
|
|
1631
|
+
...An,
|
|
1547
1632
|
metadata: /* @__PURE__ */ F("div", {
|
|
1548
1633
|
className: "flex flex-1 items-center justify-center p-8",
|
|
1549
|
-
children: /* @__PURE__ */ F(
|
|
1634
|
+
children: /* @__PURE__ */ F(fe, { ariaLabel: Z.loadingAriaLabel ?? "Loading skill" })
|
|
1550
1635
|
})
|
|
1551
1636
|
})
|
|
1552
1637
|
});
|
|
1553
|
-
if (
|
|
1554
|
-
dir:
|
|
1638
|
+
if (S) return /* @__PURE__ */ F("div", {
|
|
1639
|
+
dir: Ee,
|
|
1555
1640
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1556
|
-
children: /* @__PURE__ */ F(
|
|
1557
|
-
...
|
|
1641
|
+
children: /* @__PURE__ */ F(Qe, {
|
|
1642
|
+
...An,
|
|
1558
1643
|
metadata: /* @__PURE__ */ F("div", {
|
|
1559
1644
|
className: "p-8",
|
|
1560
|
-
children: /* @__PURE__ */ F(
|
|
1645
|
+
children: /* @__PURE__ */ F(E, {
|
|
1561
1646
|
message: Z.loadErrorMessage ?? "Couldn't load this skill. Please try again.",
|
|
1562
|
-
iconStroke:
|
|
1563
|
-
action: /* @__PURE__ */ F(
|
|
1647
|
+
iconStroke: x,
|
|
1648
|
+
action: /* @__PURE__ */ F(ce, {
|
|
1564
1649
|
label: Z.retryLabel ?? "Retry",
|
|
1565
|
-
onClick:
|
|
1650
|
+
onClick: ge
|
|
1566
1651
|
})
|
|
1567
1652
|
})
|
|
1568
1653
|
})
|
|
1569
1654
|
})
|
|
1570
1655
|
});
|
|
1571
|
-
let
|
|
1656
|
+
let jn = K === W, Mn = rn?.name ?? K.slice(K.lastIndexOf("/") + 1), Nn = jn ? W : Z.selectedFileHeading?.(Mn) ?? Mn, Pn = k != null || j != null ? /* @__PURE__ */ I("div", {
|
|
1572
1657
|
className: "flex flex-col gap-2",
|
|
1573
|
-
children: [
|
|
1658
|
+
children: [k != null && /* @__PURE__ */ I("div", {
|
|
1574
1659
|
className: "flex items-center gap-2",
|
|
1575
|
-
children: [/* @__PURE__ */ F(
|
|
1660
|
+
children: [/* @__PURE__ */ F(D, { text: k }), be != null && /* @__PURE__ */ F(A, {
|
|
1576
1661
|
label: Z.retryLabel ?? "Retry",
|
|
1577
|
-
onClick:
|
|
1662
|
+
onClick: be
|
|
1578
1663
|
})]
|
|
1579
|
-
}),
|
|
1664
|
+
}), j != null && /* @__PURE__ */ I("div", {
|
|
1580
1665
|
className: "flex items-center gap-2",
|
|
1581
|
-
children: [/* @__PURE__ */ F(
|
|
1666
|
+
children: [/* @__PURE__ */ F(D, { text: j.message }), /* @__PURE__ */ F(A, {
|
|
1582
1667
|
label: Z.reloadLatestLabel ?? "Reload latest",
|
|
1583
1668
|
onClick: ne
|
|
1584
1669
|
})]
|
|
1585
1670
|
})]
|
|
1586
|
-
}) : void 0,
|
|
1587
|
-
isEnabled: !!
|
|
1588
|
-
fieldId:
|
|
1671
|
+
}) : void 0, Fn = /* @__PURE__ */ F(a, {
|
|
1672
|
+
isEnabled: !!oe,
|
|
1673
|
+
fieldId: Ne,
|
|
1589
1674
|
required: !0,
|
|
1590
|
-
labelClassName: c(
|
|
1675
|
+
labelClassName: c(Ft.helperText, kt),
|
|
1591
1676
|
label: Z.instructionsLabel ?? "Instructions",
|
|
1592
1677
|
labels: Z,
|
|
1593
|
-
refinement:
|
|
1594
|
-
disabled:
|
|
1595
|
-
...
|
|
1678
|
+
refinement: U,
|
|
1679
|
+
disabled: Be || C,
|
|
1680
|
+
...Gt,
|
|
1596
1681
|
children: /* @__PURE__ */ I("div", {
|
|
1597
1682
|
className: "flex flex-1 flex-col gap-2",
|
|
1598
1683
|
children: [
|
|
1599
|
-
!
|
|
1600
|
-
htmlFor:
|
|
1601
|
-
className: c(
|
|
1684
|
+
!oe && /* @__PURE__ */ F(te, {
|
|
1685
|
+
htmlFor: Ne,
|
|
1686
|
+
className: c(Ft.helperText, kt),
|
|
1602
1687
|
label: Z.instructionsLabel ?? "Instructions",
|
|
1603
1688
|
required: !0
|
|
1604
1689
|
}),
|
|
1605
1690
|
/* @__PURE__ */ F("div", {
|
|
1606
|
-
ref:
|
|
1691
|
+
ref: Fe,
|
|
1607
1692
|
className: c(t, e, n),
|
|
1608
|
-
children: /* @__PURE__ */ F(
|
|
1609
|
-
fallback: /* @__PURE__ */ F(
|
|
1610
|
-
children: /* @__PURE__ */ F(
|
|
1611
|
-
id:
|
|
1693
|
+
children: /* @__PURE__ */ F(we, {
|
|
1694
|
+
fallback: /* @__PURE__ */ F(fe, { ariaLabel: Z.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
1695
|
+
children: /* @__PURE__ */ F(Ut, {
|
|
1696
|
+
id: Ne,
|
|
1612
1697
|
ariaLabel: Z.instructionsLabel ?? "Instructions",
|
|
1613
|
-
value:
|
|
1698
|
+
value: V.instructions,
|
|
1614
1699
|
onChange: (e) => {
|
|
1615
|
-
|
|
1700
|
+
U.reset(), Le({ instructions: e });
|
|
1616
1701
|
},
|
|
1617
|
-
theme:
|
|
1702
|
+
theme: je,
|
|
1618
1703
|
showDragbar: !1,
|
|
1619
1704
|
placeholder: Z.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
|
|
1620
1705
|
})
|
|
1621
1706
|
})
|
|
1622
1707
|
}),
|
|
1623
|
-
|
|
1624
|
-
id:
|
|
1625
|
-
text:
|
|
1708
|
+
O?.instructions != null && /* @__PURE__ */ F(D, {
|
|
1709
|
+
id: Pe,
|
|
1710
|
+
text: O.instructions
|
|
1626
1711
|
})
|
|
1627
1712
|
]
|
|
1628
1713
|
})
|
|
1629
1714
|
});
|
|
1630
1715
|
return /* @__PURE__ */ I("div", {
|
|
1631
|
-
dir:
|
|
1632
|
-
className: c("relative flex min-h-0 min-w-0 flex-1 flex-col",
|
|
1633
|
-
style:
|
|
1634
|
-
...
|
|
1716
|
+
dir: Ee,
|
|
1717
|
+
className: c("relative flex min-h-0 min-w-0 flex-1 flex-col", rt.root),
|
|
1718
|
+
style: Nt,
|
|
1719
|
+
...Dt,
|
|
1635
1720
|
children: [
|
|
1636
|
-
/* @__PURE__ */ F(
|
|
1637
|
-
isVisible:
|
|
1638
|
-
labels:
|
|
1721
|
+
/* @__PURE__ */ F(Ct, {
|
|
1722
|
+
isVisible: X && !ht,
|
|
1723
|
+
labels: xe,
|
|
1639
1724
|
titleClassName: $.dropOverlayTitleClassName,
|
|
1640
1725
|
subtitleClassName: $.dropOverlaySubtitleClassName
|
|
1641
1726
|
}),
|
|
1642
|
-
/* @__PURE__ */ F(
|
|
1643
|
-
...
|
|
1644
|
-
asideData:
|
|
1645
|
-
asideSectionClassName:
|
|
1646
|
-
isSubmitting:
|
|
1647
|
-
metadataSectionClassName:
|
|
1727
|
+
/* @__PURE__ */ F(Qe, {
|
|
1728
|
+
...An,
|
|
1729
|
+
asideData: le,
|
|
1730
|
+
asideSectionClassName: Vt,
|
|
1731
|
+
isSubmitting: C,
|
|
1732
|
+
metadataSectionClassName: Bt,
|
|
1648
1733
|
metadata: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
|
|
1649
1734
|
className: "desktop:hidden",
|
|
1650
|
-
children: /* @__PURE__ */ F(
|
|
1735
|
+
children: /* @__PURE__ */ F(wt, {
|
|
1651
1736
|
label: Z.editingFileLabel ?? "Editing file",
|
|
1652
|
-
fileName:
|
|
1653
|
-
isExpanded:
|
|
1654
|
-
onToggle:
|
|
1737
|
+
fileName: jn ? W : Mn,
|
|
1738
|
+
isExpanded: Tt,
|
|
1739
|
+
onToggle: Et,
|
|
1655
1740
|
labelClassName: $.editingFileLabelClassName,
|
|
1656
1741
|
fileNameClassName: $.editingFileNameClassName,
|
|
1657
|
-
children:
|
|
1742
|
+
children: wn(J.Mobile)
|
|
1658
1743
|
})
|
|
1659
1744
|
}), /* @__PURE__ */ F("div", {
|
|
1660
1745
|
className: "hidden desktop:block",
|
|
1661
|
-
children:
|
|
1746
|
+
children: wn(J.Desktop)
|
|
1662
1747
|
})] }),
|
|
1663
|
-
alert:
|
|
1664
|
-
setupTitle:
|
|
1665
|
-
setupSectionClassName:
|
|
1666
|
-
setup:
|
|
1667
|
-
values:
|
|
1668
|
-
errors:
|
|
1669
|
-
onChange:
|
|
1670
|
-
fields:
|
|
1748
|
+
alert: Pn,
|
|
1749
|
+
setupTitle: Nn,
|
|
1750
|
+
setupSectionClassName: Ht,
|
|
1751
|
+
setup: jn ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(tt, {
|
|
1752
|
+
values: Tn,
|
|
1753
|
+
errors: En,
|
|
1754
|
+
onChange: On,
|
|
1755
|
+
fields: Lt,
|
|
1671
1756
|
isDescriptionRequired: !0,
|
|
1672
1757
|
isNameReadOnly: re,
|
|
1673
1758
|
nameReadOnlyTooltip: Z.nameReadOnlyTooltip ?? "The skill name can't be changed after creation",
|
|
1674
|
-
nameCaption:
|
|
1675
|
-
renderDescription:
|
|
1676
|
-
labels:
|
|
1677
|
-
}),
|
|
1759
|
+
nameCaption: O?.name ? void 0 : Z.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
|
|
1760
|
+
renderDescription: kn,
|
|
1761
|
+
labels: Dn
|
|
1762
|
+
}), Fn] }) : /* @__PURE__ */ I(P, { children: [on && K !== $t && /* @__PURE__ */ F(Pt, {
|
|
1763
|
+
folderPath: K,
|
|
1764
|
+
entries: an,
|
|
1765
|
+
onOpen: cn,
|
|
1766
|
+
rootLabel: Z.folderPreviewRootLabel,
|
|
1767
|
+
breadcrumbAriaLabel: Z.folderPreviewBreadcrumbAriaLabel,
|
|
1768
|
+
overflowAriaLabel: Z.folderPreviewOverflowAriaLabel,
|
|
1769
|
+
listAriaLabel: Z.folderPreviewListAriaLabel,
|
|
1770
|
+
emptyTitle: Z.folderEmptyTitle,
|
|
1771
|
+
emptyDescription: Z.folderEmptyDescription,
|
|
1772
|
+
itemCountLabel: Z.folderItemCountLabel,
|
|
1773
|
+
itemCountClassName: $.folderItemCountClassName
|
|
1774
|
+
}), rn?.kind === G.File && /* @__PURE__ */ F("div", {
|
|
1678
1775
|
className: "flex h-[max(320px,60dvh)] min-h-0 min-w-0 flex-none flex-col desktop:h-auto desktop:flex-1",
|
|
1679
|
-
children:
|
|
1680
|
-
}) })
|
|
1776
|
+
children: se ?? /* @__PURE__ */ F(y, { text: Z.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." })
|
|
1777
|
+
})] })
|
|
1681
1778
|
}),
|
|
1682
|
-
/* @__PURE__ */ F(
|
|
1683
|
-
isOpen:
|
|
1684
|
-
onClose: () =>
|
|
1685
|
-
fileActions:
|
|
1686
|
-
mode:
|
|
1687
|
-
targetFolderPath:
|
|
1688
|
-
initialFiles:
|
|
1689
|
-
initialEntries:
|
|
1690
|
-
existingFilePaths:
|
|
1779
|
+
/* @__PURE__ */ F(jt, {
|
|
1780
|
+
isOpen: ht,
|
|
1781
|
+
onClose: () => yt(!1),
|
|
1782
|
+
fileActions: Xt,
|
|
1783
|
+
mode: bt.mode,
|
|
1784
|
+
targetFolderPath: bt.targetFolderPath,
|
|
1785
|
+
initialFiles: bt.initialFiles,
|
|
1786
|
+
initialEntries: bt.initialEntries,
|
|
1787
|
+
existingFilePaths: _n,
|
|
1691
1788
|
onCommitted: (e) => {
|
|
1692
1789
|
e.some((e) => e.replacesExisting) && Ye(!0);
|
|
1693
1790
|
},
|
|
1694
1791
|
messageClassName: $.uploadMessageClassName,
|
|
1695
1792
|
rowCaptionClassName: $.uploadRowCaptionClassName,
|
|
1696
|
-
labels:
|
|
1697
|
-
dialogColors:
|
|
1793
|
+
labels: xe,
|
|
1794
|
+
dialogColors: Wt,
|
|
1698
1795
|
colors: {
|
|
1699
1796
|
invalidDropZoneBorder: Q?.uploadInvalidDropZoneBorder,
|
|
1700
1797
|
rowBorder: Q?.uploadRowBorder
|
|
1701
1798
|
}
|
|
1702
1799
|
}),
|
|
1703
|
-
/* @__PURE__ */ F(
|
|
1704
|
-
isOpen:
|
|
1705
|
-
onClose: () =>
|
|
1706
|
-
validateName: (e) =>
|
|
1707
|
-
onCreate: (e) =>
|
|
1800
|
+
/* @__PURE__ */ F(xt, {
|
|
1801
|
+
isOpen: mn != null,
|
|
1802
|
+
onClose: () => hn(null),
|
|
1803
|
+
validateName: (e) => Zt.validateNewFolder(e, mn ?? ""),
|
|
1804
|
+
onCreate: (e) => Zt.createFolder(e, mn ?? ""),
|
|
1708
1805
|
title: Z.createFolderLabel ?? "Create folder",
|
|
1709
1806
|
nameLabel: Z.createFolderNameLabel ?? "Name",
|
|
1710
1807
|
namePlaceholder: Z.createFolderNamePlaceholder ?? "Enter folder name",
|
|
1711
1808
|
createLabel: Z.createFolderConfirmLabel ?? "Create",
|
|
1712
1809
|
cancelLabel: Z.cancelLabel ?? "Cancel",
|
|
1713
1810
|
closeAriaLabel: Z.createFolderCloseAriaLabel ?? "Close",
|
|
1714
|
-
dialogColors:
|
|
1811
|
+
dialogColors: Wt
|
|
1715
1812
|
})
|
|
1716
1813
|
]
|
|
1717
1814
|
});
|
|
1718
1815
|
};
|
|
1719
1816
|
//#endregion
|
|
1720
|
-
export {
|
|
1817
|
+
export { rt as SKILL_EDITOR_CLASS, Wt as SkillEditor, Tt as SkillFileCandidateKind, G as SkillFileNodeKind, _t as SkillFileUploadMode, Et as SkillFileValidationStatus };
|