@epam/ai-dial-skill-editor 1.3.0-dev.246 → 1.3.0-dev.248
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
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, 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 j,
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { IconArrowNarrowLeft as
|
|
5
|
-
import { Suspense as
|
|
6
|
-
import { DialFileNodeType as
|
|
7
|
-
import { LazyMarkdownEditor as
|
|
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 j, LiveRegion as M, LiveRegionElement as te, LiveRegionPoliteness as ne, NeutralButton as re, Popup as ie, PopupSize as ae, PrimaryButton as oe, RadioGroup as se, ResizeHandle as N, Select as ce, Spinner as le, TagInput as ue, Textarea as de, TextareaResize as fe } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
4
|
+
import { IconArrowNarrowLeft as pe, IconDatabase as me, IconFileZip as he, IconFolderPlus as ge, IconPhoto as _e, 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 R, useId as we, useMemo as z, useRef as B, useState as V } from "react";
|
|
6
|
+
import { DialFileNodeType as Te, DialFoldersTree as Ee } from "@epam/ai-dial-react-file-manager";
|
|
7
|
+
import { LazyMarkdownEditor as De } 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 Oe = {
|
|
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
|
-
return /* @__PURE__ */
|
|
30
|
-
className: c("flex h-full flex-col gap-4 rounded border p-6",
|
|
29
|
+
return /* @__PURE__ */ I("section", {
|
|
30
|
+
className: c("flex h-full flex-col gap-4 rounded border p-6", ke.section, r, Oe.section),
|
|
31
31
|
style: i,
|
|
32
|
-
children: [e != null && /* @__PURE__ */
|
|
33
|
-
className: c("dial-h3-text",
|
|
32
|
+
children: [e != null && /* @__PURE__ */ F("h2", {
|
|
33
|
+
className: c("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 = we(), h = u ? d?.savingStatusLabel ?? "Saving" : "", g = B(null), [_, v] = V(), 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
|
+
R(() => {
|
|
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));
|
|
@@ -57,24 +57,23 @@ var Ce = {
|
|
|
57
57
|
"--el-header-border-color": f?.colors?.headerBorderColor,
|
|
58
58
|
"--el-sidebar-border-color": f?.colors?.sidebarBorderColor
|
|
59
59
|
});
|
|
60
|
-
return /* @__PURE__ */
|
|
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", Oe.layout),
|
|
63
63
|
style: D,
|
|
64
64
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
className: "sr-only",
|
|
65
|
+
/* @__PURE__ */ F(M, {
|
|
66
|
+
visuallyHidden: !0,
|
|
67
|
+
as: te.Span,
|
|
69
68
|
id: m,
|
|
70
69
|
children: h
|
|
71
70
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
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", je.headerBorder),
|
|
73
|
+
children: [/* @__PURE__ */ I("div", {
|
|
75
74
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
76
|
-
children: [/* @__PURE__ */
|
|
77
|
-
icon: /* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ F(ee, {
|
|
76
|
+
icon: /* @__PURE__ */ F(pe, {
|
|
78
77
|
size: y.LG,
|
|
79
78
|
stroke: b,
|
|
80
79
|
"aria-hidden": !0,
|
|
@@ -82,27 +81,27 @@ var Ce = {
|
|
|
82
81
|
}),
|
|
83
82
|
"aria-label": n,
|
|
84
83
|
onClick: t
|
|
85
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ F("h1", {
|
|
86
85
|
className: "dial-h2-text min-w-0 truncate",
|
|
87
86
|
children: e
|
|
88
87
|
})]
|
|
89
|
-
}), r != null && /* @__PURE__ */
|
|
88
|
+
}), r != null && /* @__PURE__ */ F("div", {
|
|
90
89
|
className: "hidden shrink-0 items-center gap-2 desktop:flex",
|
|
91
90
|
children: r
|
|
92
91
|
})]
|
|
93
92
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ I("div", {
|
|
95
94
|
ref: g,
|
|
96
95
|
className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
|
|
97
96
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
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-[var(--el-left-width)]", "desktop:overflow-y-auto", a == null ? void 0 :
|
|
97
|
+
/* @__PURE__ */ F("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-[var(--el-left-width)]", "desktop:overflow-y-auto", a == null ? void 0 : je.columnBorder),
|
|
100
99
|
style: T == null ? void 0 : { "--el-left-width": `${T}px` },
|
|
101
100
|
children: i
|
|
102
101
|
}),
|
|
103
|
-
x && T != null && /* @__PURE__ */
|
|
102
|
+
x && T != null && /* @__PURE__ */ F("div", {
|
|
104
103
|
className: "relative hidden w-0 shrink-0 desktop:block",
|
|
105
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ F(N, {
|
|
106
105
|
width: T,
|
|
107
106
|
minWidth: S ?? 280,
|
|
108
107
|
maxWidth: E,
|
|
@@ -112,55 +111,55 @@ var Ce = {
|
|
|
112
111
|
tooltip: d?.resizeHandleTooltip ?? "Drag to resize"
|
|
113
112
|
})
|
|
114
113
|
}),
|
|
115
|
-
a != null && /* @__PURE__ */
|
|
114
|
+
a != null && /* @__PURE__ */ F("div", {
|
|
116
115
|
className: "desktop:flex desktop:min-h-0 desktop:flex-1 desktop:flex-col desktop:overflow-y-auto",
|
|
117
116
|
children: a
|
|
118
117
|
}),
|
|
119
|
-
s != null && /* @__PURE__ */
|
|
120
|
-
className: c("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s",
|
|
118
|
+
s != null && /* @__PURE__ */ F("div", {
|
|
119
|
+
className: c("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", je.columnBorder),
|
|
121
120
|
children: s
|
|
122
121
|
})
|
|
123
122
|
]
|
|
124
123
|
}),
|
|
125
|
-
r != null && /* @__PURE__ */
|
|
126
|
-
className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1",
|
|
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 desktop:hidden [&>*]:flex-1", je.footerBorder),
|
|
127
126
|
children: r
|
|
128
127
|
})
|
|
129
128
|
]
|
|
130
129
|
});
|
|
131
|
-
},
|
|
130
|
+
}, Ne = {
|
|
132
131
|
box: "_box_c9as8_1",
|
|
133
132
|
icon: "_icon_c9as8_6",
|
|
134
133
|
caption: "_caption_c9as8_10"
|
|
135
|
-
},
|
|
134
|
+
}, U = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: i = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: a, styles: s, className: l }) => {
|
|
136
135
|
let u = o({
|
|
137
136
|
"--aa-box-bg": s?.colors?.boxBackgroundColor,
|
|
138
137
|
"--aa-box-border": s?.colors?.boxBorderColor,
|
|
139
138
|
"--aa-icon": s?.colors?.placeholderIconColor,
|
|
140
139
|
"--aa-caption": s?.colors?.captionColor
|
|
141
140
|
});
|
|
142
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ I("div", {
|
|
143
142
|
className: c("flex flex-col gap-2", l),
|
|
144
143
|
style: u,
|
|
145
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ F(A, { label: e }), /* @__PURE__ */ I("div", {
|
|
146
145
|
className: "flex items-start gap-3",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
148
|
-
className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border",
|
|
149
|
-
children: t ? /* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ F("div", {
|
|
147
|
+
className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", Ne.box),
|
|
148
|
+
children: t ? /* @__PURE__ */ F("img", {
|
|
150
149
|
src: t,
|
|
151
150
|
alt: n,
|
|
152
151
|
className: "h-16 w-16 object-cover"
|
|
153
|
-
}) : /* @__PURE__ */
|
|
152
|
+
}) : /* @__PURE__ */ F(_e, {
|
|
154
153
|
size: y.LG,
|
|
155
154
|
stroke: b,
|
|
156
155
|
"aria-hidden": !0,
|
|
157
|
-
className:
|
|
156
|
+
className: Ne.icon
|
|
158
157
|
})
|
|
159
|
-
}), /* @__PURE__ */
|
|
158
|
+
}), /* @__PURE__ */ I("div", {
|
|
160
159
|
className: "flex flex-col gap-3",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ F(O, {
|
|
162
161
|
size: C.Small,
|
|
163
|
-
iconBefore: /* @__PURE__ */
|
|
162
|
+
iconBefore: /* @__PURE__ */ F(ve, {
|
|
164
163
|
size: y.SM,
|
|
165
164
|
stroke: b,
|
|
166
165
|
"aria-hidden": !0
|
|
@@ -168,22 +167,22 @@ var Ce = {
|
|
|
168
167
|
className: "w-fit",
|
|
169
168
|
label: r,
|
|
170
169
|
onClick: a
|
|
171
|
-
}), /* @__PURE__ */
|
|
172
|
-
className: c("dial-tiny-text",
|
|
170
|
+
}), /* @__PURE__ */ F("span", {
|
|
171
|
+
className: c("dial-tiny-text", Ne.caption),
|
|
173
172
|
children: i
|
|
174
173
|
})]
|
|
175
174
|
})]
|
|
176
175
|
})]
|
|
177
176
|
});
|
|
178
|
-
},
|
|
179
|
-
let c =
|
|
177
|
+
}, Pe = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: o, labels: s }) => {
|
|
178
|
+
let c = L((e) => e.length === 1 ? s.deleteConfirmTitleSingle : s.deleteConfirmTitleMultiple, [s.deleteConfirmTitleSingle, s.deleteConfirmTitleMultiple]), l = L((e) => /* @__PURE__ */ F("div", {
|
|
180
179
|
className: "dial-small-text px-6 py-3",
|
|
181
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ F("p", {
|
|
182
181
|
className: "mb-3 text-secondary",
|
|
183
|
-
children: e.length === 1 ? /* @__PURE__ */
|
|
182
|
+
children: e.length === 1 ? /* @__PURE__ */ I(P, { children: [
|
|
184
183
|
s.deleteConfirmSingleText,
|
|
185
184
|
" ",
|
|
186
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ I("span", {
|
|
187
186
|
className: "wrap-break-word text-primary",
|
|
188
187
|
children: [
|
|
189
188
|
"\"",
|
|
@@ -191,10 +190,10 @@ var Ce = {
|
|
|
191
190
|
"\"?"
|
|
192
191
|
]
|
|
193
192
|
})
|
|
194
|
-
] }) : /* @__PURE__ */
|
|
193
|
+
] }) : /* @__PURE__ */ I(P, { children: [
|
|
195
194
|
s.deleteConfirmMultipleText,
|
|
196
195
|
" ",
|
|
197
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ I("span", {
|
|
198
197
|
className: "text-primary",
|
|
199
198
|
children: [
|
|
200
199
|
e.length,
|
|
@@ -209,9 +208,9 @@ var Ce = {
|
|
|
209
208
|
s.deleteConfirmMultipleText,
|
|
210
209
|
s.deleteConfirmItemsLabel
|
|
211
210
|
]);
|
|
212
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ F(xe, {
|
|
213
212
|
fallback: null,
|
|
214
|
-
children: e && /* @__PURE__ */
|
|
213
|
+
children: e && /* @__PURE__ */ F(i, {
|
|
215
214
|
isOpen: e,
|
|
216
215
|
onClose: t,
|
|
217
216
|
onAttach: n,
|
|
@@ -242,52 +241,52 @@ var Ce = {
|
|
|
242
241
|
deleteCancelLabel: s.deleteCancelLabel
|
|
243
242
|
})
|
|
244
243
|
});
|
|
245
|
-
},
|
|
244
|
+
}, W = /* @__PURE__ */ function(e) {
|
|
246
245
|
return e.Avatar = "avatar", e.Name = "name", e.Version = "version", e.Description = "description", e.Locales = "locales", e.Tags = "tags", e;
|
|
247
|
-
}({}),
|
|
246
|
+
}({}), Fe = [
|
|
248
247
|
"avatar",
|
|
249
248
|
"name",
|
|
250
249
|
"version",
|
|
251
250
|
"description",
|
|
252
251
|
"locales",
|
|
253
252
|
"tags"
|
|
254
|
-
],
|
|
253
|
+
], Ie = (e, t, n) => ({
|
|
255
254
|
id: e,
|
|
256
255
|
language: n.find((e) => !t.has(e.code))?.code ?? "",
|
|
257
256
|
name: "",
|
|
258
257
|
description: ""
|
|
259
|
-
}),
|
|
260
|
-
let { summaryLabel: l, addLabel: u, editLabel: d, popupTitle: f, addLocaleLabel: p, localeRowLabel: m = "Locale", languageLabel: g, nameLabel: v, namePlaceholder: S, descriptionLabel: w, descriptionPlaceholder: T, deleteAriaLabel: E, cancelLabel: D = "Cancel", saveLabel: O = "Save" } = i, [ee, A] =
|
|
261
|
-
|
|
262
|
-
ee &&
|
|
258
|
+
}), Le = ({ value: e, onChange: t, availableLocaleOptions: n = [], labels: i, className: a, summaryClassName: o = "dial-body-text text-secondary", rowLabelClassName: s = "dial-tiny-lead-text text-secondary" }) => {
|
|
259
|
+
let { summaryLabel: l, addLabel: u, editLabel: d, popupTitle: f, addLocaleLabel: p, localeRowLabel: m = "Locale", languageLabel: g, nameLabel: v, namePlaceholder: S, descriptionLabel: w, descriptionPlaceholder: T, deleteAriaLabel: E, cancelLabel: D = "Cancel", saveLabel: O = "Save" } = i, [ee, A] = V(!1), [M, te] = V([]), ne = B(0);
|
|
260
|
+
R(() => {
|
|
261
|
+
ee && te(e.length > 0 ? e : [Ie(`locale-row-${++ne.current}`, /* @__PURE__ */ new Set(), n)]);
|
|
263
262
|
}, [
|
|
264
263
|
ee,
|
|
265
264
|
e,
|
|
266
265
|
n
|
|
267
266
|
]);
|
|
268
|
-
let re = () => A(!0),
|
|
267
|
+
let re = () => A(!0), ae = () => A(!1), oe = () => {
|
|
269
268
|
t(M.filter((e) => e.language && e.name)), A(!1);
|
|
270
269
|
}, se = () => {
|
|
271
270
|
let e = new Set(M.map((e) => e.language).filter(Boolean));
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
|
|
271
|
+
te((t) => [...t, Ie(`locale-row-${++ne.current}`, e, n)]);
|
|
272
|
+
}, N = (e, t) => {
|
|
273
|
+
te((n) => n.map((n) => n.id === e ? {
|
|
275
274
|
...n,
|
|
276
275
|
...t
|
|
277
276
|
} : n));
|
|
278
277
|
}, le = (e) => {
|
|
279
|
-
|
|
280
|
-
}, ue = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(),
|
|
281
|
-
return n.length === 0 ? null : /* @__PURE__ */
|
|
278
|
+
te((t) => t.filter((t) => t.id !== e));
|
|
279
|
+
}, ue = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), P = M.some((e) => !e.language || !e.name);
|
|
280
|
+
return n.length === 0 ? null : /* @__PURE__ */ I("div", {
|
|
282
281
|
className: c("flex items-center gap-2", a),
|
|
283
282
|
children: [
|
|
284
|
-
e.length > 0 && /* @__PURE__ */
|
|
283
|
+
e.length > 0 && /* @__PURE__ */ F("span", {
|
|
285
284
|
className: o,
|
|
286
285
|
children: `${l}: ${e.map((e) => `[${ue(e.language)}]`).join(", ")}`
|
|
287
286
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ F(j, {
|
|
289
288
|
label: e.length > 0 ? d : u,
|
|
290
|
-
iconBefore: /* @__PURE__ */
|
|
289
|
+
iconBefore: /* @__PURE__ */ F(ve, {
|
|
291
290
|
size: y.SM,
|
|
292
291
|
"aria-hidden": !0,
|
|
293
292
|
stroke: b
|
|
@@ -295,38 +294,38 @@ var Ce = {
|
|
|
295
294
|
className: "px-0!",
|
|
296
295
|
onClick: re
|
|
297
296
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ F(ie, {
|
|
299
298
|
open: ee,
|
|
300
299
|
header: f,
|
|
301
|
-
onClose:
|
|
300
|
+
onClose: ae,
|
|
302
301
|
mainButtons: [{
|
|
303
302
|
label: D,
|
|
304
|
-
onClick:
|
|
303
|
+
onClick: ae
|
|
305
304
|
}, {
|
|
306
305
|
label: O,
|
|
307
306
|
variant: _.Primary,
|
|
308
|
-
disabled:
|
|
307
|
+
disabled: P,
|
|
309
308
|
onClick: oe
|
|
310
309
|
}],
|
|
311
|
-
children: /* @__PURE__ */
|
|
310
|
+
children: /* @__PURE__ */ I("div", {
|
|
312
311
|
className: "flex flex-col gap-8 px-6 py-3",
|
|
313
312
|
children: [M.map((e, t) => {
|
|
314
313
|
let i = new Set(M.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
|
|
315
|
-
return /* @__PURE__ */
|
|
314
|
+
return /* @__PURE__ */ I("div", {
|
|
316
315
|
className: "flex flex-col gap-2",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ I("div", {
|
|
318
317
|
className: "flex items-center justify-between",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
318
|
+
children: [/* @__PURE__ */ I("span", {
|
|
320
319
|
className: s,
|
|
321
320
|
children: [
|
|
322
321
|
m,
|
|
323
322
|
" ",
|
|
324
323
|
t + 1
|
|
325
324
|
]
|
|
326
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ F(x, {
|
|
327
326
|
appearance: h.Ghost,
|
|
328
327
|
size: C.Small,
|
|
329
|
-
icon: /* @__PURE__ */
|
|
328
|
+
icon: /* @__PURE__ */ F(ye, {
|
|
330
329
|
size: y.SM,
|
|
331
330
|
"aria-hidden": !0,
|
|
332
331
|
stroke: b
|
|
@@ -334,13 +333,13 @@ var Ce = {
|
|
|
334
333
|
"aria-label": `${E} ${t + 1}`,
|
|
335
334
|
onClick: () => le(e.id)
|
|
336
335
|
})]
|
|
337
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ I("div", {
|
|
338
337
|
role: "group",
|
|
339
338
|
"aria-label": `${m} ${t + 1}`,
|
|
340
339
|
className: "flex flex-col gap-5",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ I("div", {
|
|
342
341
|
className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ F(ce, {
|
|
344
343
|
id: `${e.id}-language`,
|
|
345
344
|
labelProps: {
|
|
346
345
|
label: g,
|
|
@@ -353,33 +352,33 @@ var Ce = {
|
|
|
353
352
|
disabled: i.has(e.code)
|
|
354
353
|
})),
|
|
355
354
|
value: e.language,
|
|
356
|
-
onChange: (t) =>
|
|
357
|
-
}), /* @__PURE__ */
|
|
355
|
+
onChange: (t) => N(e.id, { language: t })
|
|
356
|
+
}), /* @__PURE__ */ F(k, {
|
|
358
357
|
id: `${e.id}-name`,
|
|
359
358
|
containerClassName: "min-w-0 flex-1",
|
|
360
359
|
required: !0,
|
|
361
360
|
value: e.name,
|
|
362
|
-
onChange: (t) =>
|
|
361
|
+
onChange: (t) => N(e.id, { name: t ?? "" }),
|
|
363
362
|
labelProps: {
|
|
364
363
|
label: v,
|
|
365
364
|
required: !0
|
|
366
365
|
},
|
|
367
366
|
placeholder: S
|
|
368
367
|
})]
|
|
369
|
-
}), /* @__PURE__ */
|
|
368
|
+
}), /* @__PURE__ */ F(de, {
|
|
370
369
|
id: `${e.id}-description`,
|
|
371
370
|
className: r,
|
|
372
|
-
resize:
|
|
371
|
+
resize: fe.Vertical,
|
|
373
372
|
value: e.description,
|
|
374
|
-
onChange: (t) =>
|
|
373
|
+
onChange: (t) => N(e.id, { description: t }),
|
|
375
374
|
labelProps: { label: w },
|
|
376
375
|
placeholder: T
|
|
377
376
|
})]
|
|
378
377
|
})]
|
|
379
378
|
}, e.id);
|
|
380
|
-
}), /* @__PURE__ */
|
|
379
|
+
}), /* @__PURE__ */ F(j, {
|
|
381
380
|
label: p,
|
|
382
|
-
iconBefore: /* @__PURE__ */
|
|
381
|
+
iconBefore: /* @__PURE__ */ F(ve, {
|
|
383
382
|
size: y.SM,
|
|
384
383
|
"aria-hidden": !0,
|
|
385
384
|
stroke: b
|
|
@@ -392,9 +391,9 @@ var Ce = {
|
|
|
392
391
|
})
|
|
393
392
|
]
|
|
394
393
|
});
|
|
395
|
-
},
|
|
396
|
-
let x =
|
|
397
|
-
|
|
394
|
+
}, Re = "Add tags, comma separated", ze = "deployment-creation-form-description", Be = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = Fe, isNameReadOnly: m = !1, nameReadOnlyTooltip: h, nameCaption: g, isDescriptionRequired: _ = !1, descriptionCaption: v, renderDescription: y, focusRequestKey: b }) => {
|
|
395
|
+
let x = B(null), S = B(null), C = B(null), w = B(!1), T = (e) => p.includes(e), E = T(W.Name), D = T(W.Version), O = !!(t.name || t.version || t.description), ee = B(b);
|
|
396
|
+
R(() => {
|
|
398
397
|
let e = () => {
|
|
399
398
|
t.name ? x.current?.focus() : t.version ? S.current?.focus() : t.description && C.current?.focus();
|
|
400
399
|
};
|
|
@@ -406,8 +405,8 @@ var Ce = {
|
|
|
406
405
|
t.version,
|
|
407
406
|
t.description
|
|
408
407
|
]);
|
|
409
|
-
let A = /* @__PURE__ */
|
|
410
|
-
id:
|
|
408
|
+
let A = /* @__PURE__ */ F(de, {
|
|
409
|
+
id: ze,
|
|
411
410
|
ref: C,
|
|
412
411
|
value: e.description,
|
|
413
412
|
onChange: (e) => n({ description: e }),
|
|
@@ -422,14 +421,14 @@ var Ce = {
|
|
|
422
421
|
invalid: !!t.description,
|
|
423
422
|
containerClassName: y ? void 0 : d?.field,
|
|
424
423
|
className: r,
|
|
425
|
-
resize:
|
|
424
|
+
resize: fe.Vertical
|
|
426
425
|
});
|
|
427
|
-
return /* @__PURE__ */
|
|
426
|
+
return /* @__PURE__ */ I("div", {
|
|
428
427
|
role: u.ariaLabel ? "group" : void 0,
|
|
429
428
|
"aria-label": u.ariaLabel,
|
|
430
429
|
className: c("flex flex-col gap-4", d?.root),
|
|
431
430
|
children: [
|
|
432
|
-
T(
|
|
431
|
+
T(W.Avatar) && /* @__PURE__ */ F(U, {
|
|
433
432
|
label: u.iconUrl.label,
|
|
434
433
|
avatarUrl: s,
|
|
435
434
|
addAvatarLabel: u.iconUrl.addAvatarLabel,
|
|
@@ -437,9 +436,9 @@ var Ce = {
|
|
|
437
436
|
onAddAvatarClick: l,
|
|
438
437
|
className: d?.field
|
|
439
438
|
}),
|
|
440
|
-
(E || D) && /* @__PURE__ */
|
|
439
|
+
(E || D) && /* @__PURE__ */ I("div", {
|
|
441
440
|
className: c("flex items-start gap-4", d?.field),
|
|
442
|
-
children: [E && /* @__PURE__ */
|
|
441
|
+
children: [E && /* @__PURE__ */ F(k, {
|
|
443
442
|
id: "deployment-creation-form-name",
|
|
444
443
|
inputRef: x,
|
|
445
444
|
value: e.name,
|
|
@@ -456,7 +455,7 @@ var Ce = {
|
|
|
456
455
|
error: t.name || void 0,
|
|
457
456
|
invalid: !!t.name,
|
|
458
457
|
containerClassName: D ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
|
|
459
|
-
}), D && /* @__PURE__ */
|
|
458
|
+
}), D && /* @__PURE__ */ F(k, {
|
|
460
459
|
id: "deployment-creation-form-version",
|
|
461
460
|
inputRef: S,
|
|
462
461
|
value: e.version,
|
|
@@ -469,23 +468,23 @@ var Ce = {
|
|
|
469
468
|
containerClassName: E ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
|
|
470
469
|
})]
|
|
471
470
|
}),
|
|
472
|
-
T(
|
|
471
|
+
T(W.Description) && (y ? /* @__PURE__ */ F("div", {
|
|
473
472
|
className: d?.field,
|
|
474
|
-
children: y(A,
|
|
473
|
+
children: y(A, ze)
|
|
475
474
|
}) : A),
|
|
476
|
-
T(
|
|
475
|
+
T(W.Locales) && /* @__PURE__ */ F(Le, {
|
|
477
476
|
value: e.otherLocales,
|
|
478
477
|
onChange: (e) => n({ otherLocales: e }),
|
|
479
478
|
availableLocaleOptions: f,
|
|
480
479
|
labels: u.otherLocales,
|
|
481
480
|
className: d?.field
|
|
482
481
|
}),
|
|
483
|
-
T(
|
|
482
|
+
T(W.Tags) && /* @__PURE__ */ F("div", {
|
|
484
483
|
className: d?.field,
|
|
485
|
-
children: /* @__PURE__ */
|
|
484
|
+
children: /* @__PURE__ */ F(ue, {
|
|
486
485
|
id: "deployment-creation-form-topics",
|
|
487
486
|
labelProps: { label: u.topics.label },
|
|
488
|
-
placeholder: u.topics.placeholder ??
|
|
487
|
+
placeholder: u.topics.placeholder ?? Re,
|
|
489
488
|
value: e.topics,
|
|
490
489
|
onChange: (e) => n({ topics: e }),
|
|
491
490
|
tagClassName: i
|
|
@@ -493,13 +492,13 @@ var Ce = {
|
|
|
493
492
|
})
|
|
494
493
|
]
|
|
495
494
|
});
|
|
496
|
-
},
|
|
497
|
-
let T = /* @__PURE__ */
|
|
498
|
-
|
|
499
|
-
className: v == null ? void 0 :
|
|
495
|
+
}, Ve = "border-0 p-4 desktop:p-8", He = "desktop:flex-1", Ue = "px-4 pt-4 desktop:px-6 desktop:pt-6", We = 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 }) => {
|
|
496
|
+
let T = /* @__PURE__ */ F(M, {
|
|
497
|
+
politeness: ne.Assertive,
|
|
498
|
+
className: v == null ? void 0 : Ue,
|
|
500
499
|
children: v
|
|
501
500
|
}), E = p != null;
|
|
502
|
-
return /* @__PURE__ */
|
|
501
|
+
return /* @__PURE__ */ F(Me, {
|
|
503
502
|
title: e,
|
|
504
503
|
onBack: t,
|
|
505
504
|
backAriaLabel: S?.backAriaLabel ?? "Back",
|
|
@@ -510,41 +509,41 @@ var Ce = {
|
|
|
510
509
|
resizeHandleLabel: S?.resizeHandleLabel,
|
|
511
510
|
resizeHandleTooltip: S?.resizeHandleTooltip
|
|
512
511
|
},
|
|
513
|
-
rightContent: h == null ? void 0 : /* @__PURE__ */
|
|
512
|
+
rightContent: h == null ? void 0 : /* @__PURE__ */ F(Ae, {
|
|
514
513
|
title: g,
|
|
515
514
|
styles: C?.section,
|
|
516
|
-
className: c(
|
|
515
|
+
className: c(Ve, _, Oe.asideSection),
|
|
517
516
|
children: h
|
|
518
517
|
}),
|
|
519
518
|
styles: C?.layout,
|
|
520
519
|
dir: w,
|
|
521
|
-
actions: /* @__PURE__ */
|
|
520
|
+
actions: /* @__PURE__ */ I(P, { children: [s, !l && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(re, {
|
|
522
521
|
label: S?.cancelLabel ?? "Cancel",
|
|
523
522
|
disabled: a,
|
|
524
523
|
onClick: n
|
|
525
|
-
}), /* @__PURE__ */
|
|
524
|
+
}), /* @__PURE__ */ F(oe, {
|
|
526
525
|
label: i,
|
|
527
526
|
disabled: a || o,
|
|
528
527
|
onClick: r
|
|
529
528
|
})] })] }),
|
|
530
|
-
leftContent: /* @__PURE__ */
|
|
529
|
+
leftContent: /* @__PURE__ */ I(P, { children: [
|
|
531
530
|
!E && T,
|
|
532
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ F(Ae, {
|
|
533
532
|
title: d === null ? void 0 : d ?? S?.metadataTitle ?? "Metadata",
|
|
534
533
|
styles: C?.section,
|
|
535
|
-
className: c(
|
|
534
|
+
className: c(Ve, b, Oe.metadataSection),
|
|
536
535
|
children: u
|
|
537
536
|
}),
|
|
538
537
|
f
|
|
539
538
|
] }),
|
|
540
|
-
centerContent: E ? /* @__PURE__ */
|
|
539
|
+
centerContent: E ? /* @__PURE__ */ I(P, { children: [T, /* @__PURE__ */ F(Ae, {
|
|
541
540
|
title: m === null ? void 0 : m ?? S?.setupTitle ?? "Setup",
|
|
542
541
|
styles: C?.section,
|
|
543
|
-
className: c(
|
|
542
|
+
className: c(Ve, He, x, Oe.setupSection),
|
|
544
543
|
children: p
|
|
545
544
|
})] }) : void 0
|
|
546
545
|
});
|
|
547
|
-
}),
|
|
546
|
+
}), Ge = {
|
|
548
547
|
name: {
|
|
549
548
|
label: "Name",
|
|
550
549
|
placeholder: "Enter name"
|
|
@@ -583,7 +582,7 @@ var Ce = {
|
|
|
583
582
|
saveLabel: "Save"
|
|
584
583
|
},
|
|
585
584
|
ariaLabel: "Metadata"
|
|
586
|
-
},
|
|
585
|
+
}, Ke = {
|
|
587
586
|
title: "Add avatar",
|
|
588
587
|
attachLabel: "Attach",
|
|
589
588
|
emptyTitle: "This folder is empty",
|
|
@@ -607,12 +606,12 @@ var Ce = {
|
|
|
607
606
|
deleteConfirmItemsLabel: "items?",
|
|
608
607
|
deleteConfirmLabel: "Delete",
|
|
609
608
|
deleteCancelLabel: "Cancel"
|
|
610
|
-
},
|
|
611
|
-
let [g, _] =
|
|
609
|
+
}, qe = Ce(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Fe, isNameReadOnly: c, nameReadOnlyTooltip: l, nameCaption: u, isDescriptionRequired: d, descriptionCaption: f, renderDescription: p, focusRequestKey: m, labels: h }) => {
|
|
610
|
+
let [g, _] = V(!1), v = z(() => a ? s : s.filter((e) => e !== W.Avatar), [a, s]), y = e.iconUrl, b = a?.resolveIconUrl, x = z(() => b ? b(y) : void 0, [y, b]), S = L(() => _(!0), []), C = L(() => _(!1), []), w = a?.resolveAttachedIconUrl, T = L((e) => {
|
|
612
611
|
let t = w?.(e);
|
|
613
612
|
t && n({ iconUrl: t }), _(!1);
|
|
614
613
|
}, [n, w]);
|
|
615
|
-
return /* @__PURE__ */
|
|
614
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Be, {
|
|
616
615
|
values: e,
|
|
617
616
|
errors: t,
|
|
618
617
|
onChange: n,
|
|
@@ -620,7 +619,7 @@ var Ce = {
|
|
|
620
619
|
onVersionBlur: i,
|
|
621
620
|
iconPreviewUrl: x,
|
|
622
621
|
onAddAvatarClick: S,
|
|
623
|
-
labels: h?.form ??
|
|
622
|
+
labels: h?.form ?? Ge,
|
|
624
623
|
availableLocaleOptions: o,
|
|
625
624
|
fields: v,
|
|
626
625
|
isNameReadOnly: c,
|
|
@@ -630,7 +629,7 @@ var Ce = {
|
|
|
630
629
|
descriptionCaption: f,
|
|
631
630
|
renderDescription: p,
|
|
632
631
|
focusRequestKey: m
|
|
633
|
-
}), a && /* @__PURE__ */
|
|
632
|
+
}), a && /* @__PURE__ */ F(Pe, {
|
|
634
633
|
isOpen: g,
|
|
635
634
|
onClose: C,
|
|
636
635
|
onAttach: T,
|
|
@@ -638,51 +637,51 @@ var Ce = {
|
|
|
638
637
|
FileManagerModal: a.FileManagerModal,
|
|
639
638
|
allowedMimeTypes: a.allowedMimeTypes,
|
|
640
639
|
maxFileSizeBytes: a.maxFileSizeBytes,
|
|
641
|
-
labels: h?.avatarPicker ??
|
|
640
|
+
labels: h?.avatarPicker ?? Ke
|
|
642
641
|
})] });
|
|
643
|
-
}),
|
|
642
|
+
}), Je = /* @__PURE__ */ function(e) {
|
|
644
643
|
return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
|
|
645
644
|
}({});
|
|
646
|
-
|
|
645
|
+
Je.TooLong, Je.ControlCharacters;
|
|
647
646
|
//#endregion
|
|
648
647
|
//#region src/constants/public-class-names.ts
|
|
649
|
-
var
|
|
648
|
+
var Ye = {
|
|
650
649
|
root: "dial-skill-editor-root",
|
|
651
650
|
refineFeedback: "dial-skill-editor-refine-feedback"
|
|
652
|
-
},
|
|
651
|
+
}, G = "SKILL.md", K = /* @__PURE__ */ function(e) {
|
|
653
652
|
return e.File = "file", e.Folder = "folder", e;
|
|
654
|
-
}({}),
|
|
653
|
+
}({}), Xe = /* @__PURE__ */ function(e) {
|
|
655
654
|
return e.Header = "header", e.Child = "child", e;
|
|
656
|
-
}({}),
|
|
655
|
+
}({}), Ze = (e) => {
|
|
657
656
|
let t = e.lastIndexOf("/");
|
|
658
657
|
return t === -1 ? null : e.slice(0, t);
|
|
659
|
-
},
|
|
658
|
+
}, Qe = (e) => {
|
|
660
659
|
let t = e.lastIndexOf("/");
|
|
661
660
|
return t === -1 ? e : e.slice(t + 1);
|
|
662
|
-
},
|
|
661
|
+
}, $e = (e) => {
|
|
663
662
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
664
663
|
let n = t.get(e);
|
|
665
664
|
if (n) return n;
|
|
666
665
|
let r = {
|
|
667
666
|
path: e,
|
|
668
|
-
name:
|
|
669
|
-
nodeType:
|
|
670
|
-
parentPath:
|
|
667
|
+
name: Qe(e),
|
|
668
|
+
nodeType: Te.FOLDER,
|
|
669
|
+
parentPath: Ze(e),
|
|
671
670
|
folderId: e,
|
|
672
671
|
items: []
|
|
673
672
|
};
|
|
674
673
|
return t.set(e, r), r;
|
|
675
674
|
};
|
|
676
|
-
for (let r of e) r.kind ===
|
|
675
|
+
for (let r of e) r.kind === K.Folder ? n(r.path).name = r.name : t.set(r.path, {
|
|
677
676
|
path: r.path,
|
|
678
677
|
name: r.name,
|
|
679
|
-
nodeType:
|
|
680
|
-
parentPath:
|
|
681
|
-
folderId:
|
|
678
|
+
nodeType: Te.ITEM,
|
|
679
|
+
parentPath: Ze(r.path),
|
|
680
|
+
folderId: Ze(r.path) ?? ""
|
|
682
681
|
});
|
|
683
682
|
for (let t of [...e]) {
|
|
684
|
-
let e =
|
|
685
|
-
for (; e != null;) n(e), e =
|
|
683
|
+
let e = Ze(t.path);
|
|
684
|
+
for (; e != null;) n(e), e = Ze(e);
|
|
686
685
|
}
|
|
687
686
|
let r = [];
|
|
688
687
|
for (let e of t.values()) {
|
|
@@ -694,17 +693,17 @@ var We = {
|
|
|
694
693
|
n ? n.items = [...n.items ?? [], e] : r.push(e);
|
|
695
694
|
}
|
|
696
695
|
return r;
|
|
697
|
-
},
|
|
698
|
-
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 =
|
|
699
|
-
for (; t.has(u);) l += 1, u =
|
|
696
|
+
}, et = (e, t) => e ? `${e}/${t}` : t, tt = (e, t) => {
|
|
697
|
+
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 = et(r, `${s} (${l})${c}`);
|
|
698
|
+
for (; t.has(u);) l += 1, u = et(r, `${s} (${l})${c}`);
|
|
700
699
|
return u;
|
|
701
|
-
},
|
|
700
|
+
}, nt = (e, t) => {
|
|
702
701
|
if (!t) return "";
|
|
703
702
|
switch (e) {
|
|
704
|
-
case
|
|
705
|
-
case
|
|
703
|
+
case Xe.Child: return t.path;
|
|
704
|
+
case Xe.Header: return t.kind === K.Folder ? t.path : "";
|
|
706
705
|
}
|
|
707
|
-
},
|
|
706
|
+
}, rt = (e, t) => {
|
|
708
707
|
let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
|
|
709
708
|
for (let { path: i } of e) {
|
|
710
709
|
if (!i.startsWith(n) || i === t) continue;
|
|
@@ -712,29 +711,29 @@ var We = {
|
|
|
712
711
|
r.add(e.split("/")[0]);
|
|
713
712
|
}
|
|
714
713
|
return r;
|
|
715
|
-
},
|
|
714
|
+
}, it = (e, t, n) => {
|
|
716
715
|
let r = e.trim();
|
|
717
716
|
if (!r) return n.required;
|
|
718
717
|
if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
|
|
719
718
|
if (t.has(r)) return n.duplicate;
|
|
720
|
-
},
|
|
721
|
-
let [o, s] =
|
|
719
|
+
}, at = "\\new-folder", ot = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
|
|
720
|
+
let [o, s] = V(null), c = o?.parentPath ?? null, l = B([]), u = c == null ? void 0 : et(c, at), d = z(() => u == null ? void 0 : {
|
|
722
721
|
path: u,
|
|
723
722
|
name: n,
|
|
724
|
-
kind:
|
|
725
|
-
}, [u, n]), f =
|
|
726
|
-
let a =
|
|
727
|
-
return i === "" && a.add(
|
|
723
|
+
kind: K.Folder
|
|
724
|
+
}, [u, n]), f = L((n, i) => {
|
|
725
|
+
let a = rt(e, i);
|
|
726
|
+
return i === "" && a.add(G), it(n, a, r) ?? t.validateFolderPath?.(et(i, n.trim()));
|
|
728
727
|
}, [
|
|
729
728
|
e,
|
|
730
729
|
r,
|
|
731
730
|
t
|
|
732
|
-
]), p =
|
|
731
|
+
]), p = L((e, t) => {
|
|
733
732
|
l.current = [], s({
|
|
734
733
|
parentPath: e,
|
|
735
734
|
pane: t
|
|
736
735
|
}), e !== "" && i(e);
|
|
737
|
-
}, [i]), m =
|
|
736
|
+
}, [i]), m = L((e, t) => {
|
|
738
737
|
if (c == null || t.path !== u) return null;
|
|
739
738
|
let n = f(e, c);
|
|
740
739
|
return l.current = [...l.current.slice(-1), {
|
|
@@ -745,16 +744,16 @@ var We = {
|
|
|
745
744
|
c,
|
|
746
745
|
u,
|
|
747
746
|
f
|
|
748
|
-
]), h =
|
|
747
|
+
]), h = L(() => {
|
|
749
748
|
l.current = [], s(null);
|
|
750
|
-
}, []), g =
|
|
751
|
-
let r =
|
|
749
|
+
}, []), g = L((e, n) => {
|
|
750
|
+
let r = et(n, e.trim());
|
|
752
751
|
t.onCreateFolder?.(r), n !== "" && i(n), a(r);
|
|
753
752
|
}, [
|
|
754
753
|
t,
|
|
755
754
|
i,
|
|
756
755
|
a
|
|
757
|
-
]), _ =
|
|
756
|
+
]), _ = L((e) => {
|
|
758
757
|
if (c == null) return;
|
|
759
758
|
let [t] = l.current;
|
|
760
759
|
l.current.length === 2 && t != null && !t.isValid && t.value !== e || f(e, c) != null ? h() : (h(), g(e, c));
|
|
@@ -775,39 +774,39 @@ var We = {
|
|
|
775
774
|
validateNewFolder: f,
|
|
776
775
|
createFolder: g
|
|
777
776
|
};
|
|
778
|
-
},
|
|
779
|
-
let [t, n] =
|
|
777
|
+
}, q = (e) => !!e.dataTransfer?.types.includes("Files"), st = (e) => {
|
|
778
|
+
let [t, n] = V(!1), r = B(0);
|
|
780
779
|
return {
|
|
781
780
|
isDragActive: t,
|
|
782
781
|
dropZoneHandlers: {
|
|
783
|
-
onDragEnter:
|
|
784
|
-
|
|
782
|
+
onDragEnter: L((e) => {
|
|
783
|
+
q(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
785
784
|
}, []),
|
|
786
|
-
onDragLeave:
|
|
787
|
-
|
|
785
|
+
onDragLeave: L((e) => {
|
|
786
|
+
q(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
788
787
|
}, []),
|
|
789
|
-
onDragOver:
|
|
790
|
-
|
|
788
|
+
onDragOver: L((e) => {
|
|
789
|
+
q(e) && e.preventDefault();
|
|
791
790
|
}, []),
|
|
792
|
-
onDrop:
|
|
793
|
-
if (!
|
|
791
|
+
onDrop: L((t) => {
|
|
792
|
+
if (!q(t)) return;
|
|
794
793
|
t.preventDefault(), r.current = 0, n(!1);
|
|
795
794
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
796
795
|
i.length > 0 && e(i);
|
|
797
796
|
}, [e])
|
|
798
797
|
}
|
|
799
798
|
};
|
|
800
|
-
},
|
|
799
|
+
}, ct = /* @__PURE__ */ function(e) {
|
|
801
800
|
return e.Files = "files", e.Archive = "archive", e;
|
|
802
|
-
}({}),
|
|
801
|
+
}({}), J = /* @__PURE__ */ function(e) {
|
|
803
802
|
return e.Mobile = "mobile", e.Desktop = "desktop", e;
|
|
804
|
-
}({}),
|
|
803
|
+
}({}), lt = (e, t, n = y.MD) => /* @__PURE__ */ F(e, {
|
|
805
804
|
size: n,
|
|
806
805
|
className: t,
|
|
807
806
|
"aria-hidden": !0,
|
|
808
807
|
stroke: b
|
|
809
|
-
}),
|
|
810
|
-
let v = d(), y = f ? /* @__PURE__ */
|
|
808
|
+
}), ut = { footer: "_footer_hn1ri_7" }, dt = ({ 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: g }) => {
|
|
809
|
+
let v = d(), y = f ? /* @__PURE__ */ F(le, {
|
|
811
810
|
size: 16,
|
|
812
811
|
ariaLabel: ""
|
|
813
812
|
}) : void 0;
|
|
@@ -816,21 +815,21 @@ var We = {
|
|
|
816
815
|
"--se-dialog-footer-bg": g?.footerBackground,
|
|
817
816
|
"--se-dialog-footer-border": g?.footerBorder
|
|
818
817
|
});
|
|
819
|
-
return /* @__PURE__ */
|
|
818
|
+
return /* @__PURE__ */ I(m, {
|
|
820
819
|
open: e,
|
|
821
820
|
title: t,
|
|
822
821
|
closeAriaLabel: n,
|
|
823
822
|
onClose: r,
|
|
824
|
-
children: [p, /* @__PURE__ */
|
|
825
|
-
className: c("sticky bottom-0 flex gap-3 border-t p-4",
|
|
823
|
+
children: [p, /* @__PURE__ */ I("div", {
|
|
824
|
+
className: c("sticky bottom-0 flex gap-3 border-t p-4", ut.footer),
|
|
826
825
|
style: d,
|
|
827
|
-
children: [/* @__PURE__ */
|
|
826
|
+
children: [/* @__PURE__ */ F(oe, {
|
|
828
827
|
className: "flex-1",
|
|
829
828
|
label: i,
|
|
830
829
|
iconBefore: y,
|
|
831
830
|
disabled: u,
|
|
832
831
|
onClick: a
|
|
833
|
-
}), /* @__PURE__ */
|
|
832
|
+
}), /* @__PURE__ */ F(re, {
|
|
834
833
|
className: "flex-1",
|
|
835
834
|
label: s,
|
|
836
835
|
onClick: l
|
|
@@ -838,10 +837,10 @@ var We = {
|
|
|
838
837
|
})]
|
|
839
838
|
});
|
|
840
839
|
}
|
|
841
|
-
return /* @__PURE__ */
|
|
840
|
+
return /* @__PURE__ */ F(ie, {
|
|
842
841
|
open: e,
|
|
843
842
|
header: t,
|
|
844
|
-
size:
|
|
843
|
+
size: ae.Sm,
|
|
845
844
|
closeAriaLabel: n,
|
|
846
845
|
onClose: r,
|
|
847
846
|
mainButtons: [{
|
|
@@ -858,15 +857,15 @@ var We = {
|
|
|
858
857
|
}],
|
|
859
858
|
children: p
|
|
860
859
|
});
|
|
861
|
-
},
|
|
862
|
-
let d =
|
|
863
|
-
|
|
860
|
+
}, ft = ({ isOpen: e, onClose: t, validateName: n, onCreate: r, title: i, nameLabel: a, namePlaceholder: o, createLabel: s, cancelLabel: c, closeAriaLabel: l, dialogColors: u }) => {
|
|
861
|
+
let d = we(), [f, p] = V(""), [m, h] = V(!1);
|
|
862
|
+
R(() => {
|
|
864
863
|
e && (p(""), h(!1));
|
|
865
864
|
}, [e]);
|
|
866
865
|
let g = m ? n(f) : void 0, _ = () => {
|
|
867
866
|
h(!0), n(f) ?? (r(f), t());
|
|
868
867
|
};
|
|
869
|
-
return /* @__PURE__ */
|
|
868
|
+
return /* @__PURE__ */ F(dt, {
|
|
870
869
|
isOpen: e,
|
|
871
870
|
title: i,
|
|
872
871
|
closeAriaLabel: l,
|
|
@@ -876,12 +875,12 @@ var We = {
|
|
|
876
875
|
cancelLabel: c,
|
|
877
876
|
onCancel: t,
|
|
878
877
|
colors: u,
|
|
879
|
-
children: /* @__PURE__ */
|
|
878
|
+
children: /* @__PURE__ */ F("form", {
|
|
880
879
|
className: "px-4 py-4 desktop:px-6",
|
|
881
880
|
onSubmit: (e) => {
|
|
882
881
|
e.preventDefault(), _();
|
|
883
882
|
},
|
|
884
|
-
children: /* @__PURE__ */
|
|
883
|
+
children: /* @__PURE__ */ F(k, {
|
|
885
884
|
id: d,
|
|
886
885
|
labelProps: {
|
|
887
886
|
label: a,
|
|
@@ -896,78 +895,80 @@ var We = {
|
|
|
896
895
|
})
|
|
897
896
|
})
|
|
898
897
|
});
|
|
899
|
-
},
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
898
|
+
}, pt = ({ isVisible: e, labels: t }) => {
|
|
899
|
+
let n = t ?? {}, r = n.dropOverlayTitle ?? "Upload files", i = n.dropOverlaySubtitle ?? "Drop files here to add them to this skill", a = /* @__PURE__ */ F(M, {
|
|
900
|
+
visuallyHidden: !0,
|
|
901
|
+
as: te.Span,
|
|
902
|
+
children: e ? `${r}. ${i}` : ""
|
|
903
|
+
});
|
|
904
|
+
return e ? /* @__PURE__ */ I(P, { children: [a, /* @__PURE__ */ F("div", {
|
|
905
905
|
className: c("pointer-events-none absolute inset-0 z-[100] flex items-center justify-center backdrop-blur-sm"),
|
|
906
|
-
children: /* @__PURE__ */
|
|
906
|
+
children: /* @__PURE__ */ I("div", {
|
|
907
|
+
"aria-hidden": !0,
|
|
907
908
|
className: "flex flex-col items-center text-center",
|
|
908
909
|
children: [
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ F(be, {
|
|
910
911
|
size: 100,
|
|
911
912
|
className: "text-accent-primary",
|
|
912
913
|
"aria-hidden": !0,
|
|
913
914
|
stroke: b
|
|
914
915
|
}),
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ F("span", {
|
|
916
917
|
className: "dial-h3-text mt-5",
|
|
917
|
-
children:
|
|
918
|
+
children: r
|
|
918
919
|
}),
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ F("span", {
|
|
920
921
|
className: "dial-small-text mt-4",
|
|
921
|
-
children:
|
|
922
|
+
children: i
|
|
922
923
|
})
|
|
923
924
|
]
|
|
924
925
|
})
|
|
925
|
-
});
|
|
926
|
-
},
|
|
926
|
+
})] }) : a;
|
|
927
|
+
}, mt = {
|
|
927
928
|
card: "_card_1tr87_2",
|
|
928
929
|
label: "_label_1tr87_7",
|
|
929
930
|
fileName: "_fileName_1tr87_11",
|
|
930
931
|
header: "_header_1tr87_16"
|
|
931
|
-
},
|
|
932
|
+
}, ht = ({ label: e, fileName: t, isExpanded: n, onToggle: r, children: i, labelClassName: a = "dial-tiny-lead-text", fileNameClassName: o = "dial-small-text" }) => /* @__PURE__ */ F(p, {
|
|
932
933
|
expanded: n,
|
|
933
934
|
onToggle: r,
|
|
934
|
-
title: /* @__PURE__ */
|
|
935
|
-
className: c("block",
|
|
935
|
+
title: /* @__PURE__ */ F("span", {
|
|
936
|
+
className: c("block", mt.label, a),
|
|
936
937
|
children: e
|
|
937
938
|
}),
|
|
938
|
-
description: /* @__PURE__ */
|
|
939
|
+
description: /* @__PURE__ */ F(D, {
|
|
939
940
|
name: t,
|
|
940
|
-
nameClassName: c(
|
|
941
|
+
nameClassName: c(mt.fileName, o)
|
|
941
942
|
}),
|
|
942
|
-
className: c("rounded-lg border py-0 shadow-xs",
|
|
943
|
-
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",
|
|
943
|
+
className: c("rounded-lg border py-0 shadow-xs", mt.card),
|
|
944
|
+
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", mt.header),
|
|
944
945
|
contentClassName: "max-h-[416px] overflow-y-auto pt-4 pb-2 ps-3 pe-2",
|
|
945
946
|
children: i
|
|
946
|
-
}),
|
|
947
|
+
}), gt = /* @__PURE__ */ function(e) {
|
|
947
948
|
return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
|
|
948
|
-
}({}),
|
|
949
|
+
}({}), Y = /* @__PURE__ */ function(e) {
|
|
949
950
|
return e.Valid = "valid", e.Invalid = "invalid", e;
|
|
950
|
-
}({}),
|
|
951
|
+
}({}), X = /* @__PURE__ */ function(e) {
|
|
951
952
|
return e.Replace = "replace", e.Duplicate = "duplicate", e;
|
|
952
|
-
}({}),
|
|
953
|
-
id:
|
|
953
|
+
}({}), _t = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), vt = ".zip,application/zip", yt = [], bt = 0, xt = () => `skill-file-candidate-${++bt}`, St = (e, t, n) => ({
|
|
954
|
+
id: xt(),
|
|
954
955
|
file: e,
|
|
955
|
-
path:
|
|
956
|
-
}),
|
|
957
|
-
let h = p ?? {}, [g, _] =
|
|
958
|
-
|
|
959
|
-
e && (
|
|
956
|
+
path: et(n, t.replace(/\\/g, "/"))
|
|
957
|
+
}), Ct = ({ isOpen: e, onClose: t, fileActions: n, mode: r = ct.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: o, existingFilePaths: l = yt, onCommitted: u, messageClassName: d = "dial-small-text", rowCaptionClassName: f, labels: p, dialogColors: m }) => {
|
|
958
|
+
let h = p ?? {}, [g, _] = V([]), [y, x] = V([]), [S, C] = V(X.Replace), w = z(() => new Set(l), [l]), [O, k] = V(/* @__PURE__ */ new Map()), [A, j] = V([]), [re, ie] = V(!1), [ae, oe] = V(), [N, ce] = V(!1), [ue, de] = V(), [fe, pe] = V(0), me = B(0), he = r === ct.Archive, ge = h.uploadArchiveErrorMessage ?? "Couldn't read this archive", _e = we(), ve = we(), be = we(), xe = B(null), Se = B(!1), Ce = y[0]?.id;
|
|
959
|
+
R(() => {
|
|
960
|
+
e && (Ce == null ? Se.current && (Se.current = !1, document.getElementById(ve)?.focus()) : (Se.current = !0, xe.current?.focus()));
|
|
960
961
|
}, [
|
|
961
|
-
|
|
962
|
+
Ce,
|
|
962
963
|
e,
|
|
963
|
-
|
|
964
|
+
ve
|
|
964
965
|
]);
|
|
965
|
-
let
|
|
966
|
-
|
|
967
|
-
},
|
|
966
|
+
let L = (e) => e.path !== "SKILL.md" && w.has(e.path), Te = (e) => {
|
|
967
|
+
oe(void 0), _((t) => [...t, ...e.filter((e) => !L(e))]), x((t) => [...t, ...e.filter(L)]);
|
|
968
|
+
}, Ee = (e) => {
|
|
968
969
|
let [t, ...n] = y;
|
|
969
|
-
t && (x(n), C(
|
|
970
|
-
if (e ===
|
|
970
|
+
t && (x(n), C(X.Replace), e != null && (oe(void 0), _((r) => {
|
|
971
|
+
if (e === X.Replace) return [...r, {
|
|
971
972
|
...t,
|
|
972
973
|
replacesExisting: !0
|
|
973
974
|
}];
|
|
@@ -978,344 +979,343 @@ var We = {
|
|
|
978
979
|
]);
|
|
979
980
|
return [...r, {
|
|
980
981
|
...t,
|
|
981
|
-
path:
|
|
982
|
+
path: tt(t.path, i)
|
|
982
983
|
}];
|
|
983
984
|
})));
|
|
984
|
-
},
|
|
985
|
+
}, De = async (e) => {
|
|
985
986
|
let { extractArchive: t } = n;
|
|
986
987
|
if (!t) return;
|
|
987
|
-
let r =
|
|
988
|
-
|
|
988
|
+
let r = me.current;
|
|
989
|
+
de(void 0), pe((e) => e + 1);
|
|
989
990
|
try {
|
|
990
991
|
let n = await Promise.all(e.map((e) => t(e)));
|
|
991
|
-
if (r !==
|
|
992
|
+
if (r !== me.current) return;
|
|
992
993
|
let a = n.flat();
|
|
993
994
|
if (a.length === 0) {
|
|
994
|
-
|
|
995
|
+
de(h.uploadArchiveEmptyMessage ?? "This archive has no files");
|
|
995
996
|
return;
|
|
996
997
|
}
|
|
997
|
-
|
|
998
|
+
Te(a.map((e) => St(e.file, e.path, i)));
|
|
998
999
|
} catch {
|
|
999
|
-
if (r !==
|
|
1000
|
-
|
|
1000
|
+
if (r !== me.current) return;
|
|
1001
|
+
de(ge);
|
|
1001
1002
|
} finally {
|
|
1002
|
-
r ===
|
|
1003
|
+
r === me.current && pe((e) => e - 1);
|
|
1003
1004
|
}
|
|
1004
|
-
},
|
|
1005
|
-
|
|
1006
|
-
},
|
|
1005
|
+
}, Oe = (e) => {
|
|
1006
|
+
he ? De(e) : Te(e.map((e) => St(e, _t(e), i)));
|
|
1007
|
+
}, ke = (e) => {
|
|
1007
1008
|
_((t) => t.filter((t) => t.id !== e));
|
|
1008
1009
|
};
|
|
1009
|
-
|
|
1010
|
+
R(() => {
|
|
1010
1011
|
if (!e) return;
|
|
1011
|
-
|
|
1012
|
-
let t = [...(a ?? []).map((e) =>
|
|
1013
|
-
_(t.filter((e) => !
|
|
1014
|
-
}, [e]),
|
|
1012
|
+
me.current += 1;
|
|
1013
|
+
let t = [...(a ?? []).map((e) => St(e, _t(e), i)), ...(o ?? []).map((e) => St(e.file, e.path, i))];
|
|
1014
|
+
_(t.filter((e) => !L(e))), x(t.filter(L)), C(X.Replace), k(/* @__PURE__ */ new Map()), j([]), oe(void 0), de(void 0), pe(0);
|
|
1015
|
+
}, [e]), R(() => {
|
|
1015
1016
|
if (!e) return;
|
|
1016
1017
|
let t = !1;
|
|
1017
1018
|
if (g.length === 0) k(/* @__PURE__ */ new Map()), j([]);
|
|
1018
|
-
else return
|
|
1019
|
+
else return ie(!0), n.validateBatch(g).then(({ results: e, batchErrors: n }) => {
|
|
1019
1020
|
t || (k(new Map(e.map((e) => [e.candidateId, e]))), j(n.map((e) => e.message)));
|
|
1020
1021
|
}).finally(() => {
|
|
1021
|
-
t ||
|
|
1022
|
+
t || ie(!1);
|
|
1022
1023
|
}), () => {
|
|
1023
1024
|
t = !0;
|
|
1024
1025
|
};
|
|
1025
1026
|
}, [g, e]);
|
|
1026
|
-
let
|
|
1027
|
+
let Ae = g.some((e) => O.get(e.id)?.status === Y.Invalid), H = g.length > 0 && g.every((e) => O.get(e.id)?.status === Y.Invalid), je = [...A, ...g.flatMap((e) => {
|
|
1027
1028
|
let t = O.get(e.id);
|
|
1028
|
-
return t?.status ===
|
|
1029
|
-
})],
|
|
1030
|
-
|
|
1029
|
+
return t?.status === Y.Invalid && t.error ? [`${e.path}: ${t.error}`] : [];
|
|
1030
|
+
})], Me = g.length > 0 && !Ae && A.length === 0 && !re && !N && fe === 0, Ne = async () => {
|
|
1031
|
+
ce(!0), oe(void 0);
|
|
1031
1032
|
try {
|
|
1032
1033
|
let { results: e, batchErrors: r } = await n.validateBatch(g), i = new Map(e.map((e) => [e.candidateId, e]));
|
|
1033
|
-
if (k(i), j(r.map((e) => e.message)), g.some((e) => i.get(e.id)?.status ===
|
|
1034
|
+
if (k(i), j(r.map((e) => e.message)), g.some((e) => i.get(e.id)?.status === Y.Invalid) || r.length > 0) return;
|
|
1034
1035
|
let a = await n.commitBatch(g);
|
|
1035
1036
|
if (a.error) {
|
|
1036
|
-
|
|
1037
|
+
oe(a.error);
|
|
1037
1038
|
return;
|
|
1038
1039
|
}
|
|
1039
1040
|
u?.(g), t();
|
|
1040
1041
|
} finally {
|
|
1041
|
-
|
|
1042
|
+
ce(!1);
|
|
1042
1043
|
}
|
|
1043
|
-
},
|
|
1044
|
-
if (
|
|
1044
|
+
}, U = h.uploadDialogCloseAriaLabel ?? "Close", Pe = h.uploadCancelLabel ?? "Cancel", [W] = y;
|
|
1045
|
+
if (W) {
|
|
1045
1046
|
let t = h.uploadConflictTitle ?? "Replace or duplicate it?";
|
|
1046
|
-
return /* @__PURE__ */
|
|
1047
|
+
return /* @__PURE__ */ F(dt, {
|
|
1047
1048
|
isOpen: e,
|
|
1048
1049
|
title: t,
|
|
1049
|
-
closeAriaLabel:
|
|
1050
|
-
onClose: () =>
|
|
1050
|
+
closeAriaLabel: U,
|
|
1051
|
+
onClose: () => Ee(null),
|
|
1051
1052
|
confirmLabel: h.uploadConflictConfirmLabel ?? "Confirm",
|
|
1052
|
-
onConfirm: () =>
|
|
1053
|
-
cancelLabel:
|
|
1054
|
-
onCancel: () =>
|
|
1053
|
+
onConfirm: () => Ee(S),
|
|
1054
|
+
cancelLabel: Pe,
|
|
1055
|
+
onCancel: () => Ee(null),
|
|
1055
1056
|
colors: m,
|
|
1056
|
-
children: /* @__PURE__ */
|
|
1057
|
+
children: /* @__PURE__ */ I("div", {
|
|
1057
1058
|
className: "flex flex-col gap-4 px-4 py-4 desktop:px-6",
|
|
1058
|
-
children: [/* @__PURE__ */
|
|
1059
|
-
ref:
|
|
1059
|
+
children: [/* @__PURE__ */ F("p", {
|
|
1060
|
+
ref: xe,
|
|
1060
1061
|
tabIndex: -1,
|
|
1061
1062
|
className: c("outline-hidden", d),
|
|
1062
|
-
children: h.uploadConflictMessage?.(
|
|
1063
|
-
}), /* @__PURE__ */
|
|
1063
|
+
children: h.uploadConflictMessage?.(W.path) ?? `Item with the same name "${W.path}" already exists.`
|
|
1064
|
+
}), /* @__PURE__ */ F(se, {
|
|
1064
1065
|
ariaLabel: t,
|
|
1065
1066
|
value: S,
|
|
1066
|
-
onChange: (e) => C(e ===
|
|
1067
|
+
onChange: (e) => C(e === X.Duplicate ? X.Duplicate : X.Replace),
|
|
1067
1068
|
items: [{
|
|
1068
|
-
value:
|
|
1069
|
+
value: X.Replace,
|
|
1069
1070
|
label: h.uploadConflictReplaceLabel ?? "Replace"
|
|
1070
1071
|
}, {
|
|
1071
|
-
value:
|
|
1072
|
+
value: X.Duplicate,
|
|
1072
1073
|
label: h.uploadConflictDuplicateLabel ?? "Duplicate"
|
|
1073
1074
|
}]
|
|
1074
1075
|
})]
|
|
1075
1076
|
})
|
|
1076
1077
|
});
|
|
1077
1078
|
}
|
|
1078
|
-
return /* @__PURE__ */
|
|
1079
|
+
return /* @__PURE__ */ F(dt, {
|
|
1079
1080
|
isOpen: e,
|
|
1080
|
-
title:
|
|
1081
|
-
closeAriaLabel:
|
|
1081
|
+
title: he ? h.uploadArchiveDialogTitle ?? "Upload archive from device" : h.uploadDialogTitle ?? "Upload files from device",
|
|
1082
|
+
closeAriaLabel: U,
|
|
1082
1083
|
onClose: t,
|
|
1083
1084
|
confirmLabel: h.uploadConfirmLabel ?? "Add",
|
|
1084
|
-
onConfirm: () => void
|
|
1085
|
-
isConfirmDisabled: !
|
|
1086
|
-
isConfirming:
|
|
1087
|
-
cancelLabel:
|
|
1085
|
+
onConfirm: () => void Ne(),
|
|
1086
|
+
isConfirmDisabled: !Me,
|
|
1087
|
+
isConfirming: N,
|
|
1088
|
+
cancelLabel: Pe,
|
|
1088
1089
|
onCancel: t,
|
|
1089
1090
|
colors: m,
|
|
1090
|
-
children: /* @__PURE__ */
|
|
1091
|
+
children: /* @__PURE__ */ I("div", {
|
|
1091
1092
|
className: "flex flex-col gap-4 px-4 py-4 desktop:px-6",
|
|
1092
1093
|
children: [
|
|
1093
|
-
/* @__PURE__ */
|
|
1094
|
-
label: /* @__PURE__ */
|
|
1094
|
+
/* @__PURE__ */ F(E, {
|
|
1095
|
+
label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
|
|
1095
1096
|
className: "desktop:hidden",
|
|
1096
|
-
children:
|
|
1097
|
-
}), /* @__PURE__ */
|
|
1097
|
+
children: he ? h.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : h.uploadDropZoneMobileLabel ?? "Click here to upload"
|
|
1098
|
+
}), /* @__PURE__ */ F("span", {
|
|
1098
1099
|
className: "hidden desktop:inline",
|
|
1099
|
-
children:
|
|
1100
|
+
children: he ? h.uploadArchiveDropZoneLabel ?? "Drag and drop a .zip archive or click here to upload" : h.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
|
|
1100
1101
|
})] }),
|
|
1101
|
-
description:
|
|
1102
|
-
id:
|
|
1102
|
+
description: he ? h.uploadArchiveDropZoneDescription : h.uploadDropZoneDescription,
|
|
1103
|
+
id: ve,
|
|
1103
1104
|
ariaLabel: h.uploadDropZoneAriaLabel ?? "Upload files",
|
|
1104
1105
|
multiple: !0,
|
|
1105
|
-
accept:
|
|
1106
|
-
className:
|
|
1107
|
-
onChange:
|
|
1108
|
-
onReject:
|
|
1106
|
+
accept: he ? vt : void 0,
|
|
1107
|
+
className: H ? "border-error hover:border-error" : void 0,
|
|
1108
|
+
onChange: Oe,
|
|
1109
|
+
onReject: he ? () => de(ge) : void 0
|
|
1109
1110
|
}),
|
|
1110
|
-
|
|
1111
|
-
/* @__PURE__ */
|
|
1112
|
-
|
|
1113
|
-
|
|
1111
|
+
fe > 0 && /* @__PURE__ */ F(le, { ariaLabel: h.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
|
|
1112
|
+
/* @__PURE__ */ F(T, {
|
|
1113
|
+
text: ue,
|
|
1114
|
+
announce: ne.Assertive
|
|
1114
1115
|
}),
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
children: De.map((e) => `${h.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
|
|
1116
|
+
/* @__PURE__ */ F(M, {
|
|
1117
|
+
visuallyHidden: !0,
|
|
1118
|
+
as: te.Span,
|
|
1119
|
+
id: _e,
|
|
1120
|
+
children: je.map((e) => `${h.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
|
|
1121
1121
|
}),
|
|
1122
|
-
A.map((e) => /* @__PURE__ */
|
|
1123
|
-
g.length > 0 && /* @__PURE__ */
|
|
1122
|
+
A.map((e) => /* @__PURE__ */ F(T, { text: e }, e)),
|
|
1123
|
+
g.length > 0 && /* @__PURE__ */ F("ul", {
|
|
1124
1124
|
className: "flex flex-col gap-2",
|
|
1125
1125
|
children: g.map((e) => {
|
|
1126
|
-
let t = O.get(e.id), n = t?.kind ===
|
|
1127
|
-
return /* @__PURE__ */
|
|
1126
|
+
let t = O.get(e.id), n = t?.kind === gt.Manifest, r = t?.status === Y.Invalid, i = r ? t?.error : void 0, a = `${be}${e.id}`;
|
|
1127
|
+
return /* @__PURE__ */ I("li", {
|
|
1128
1128
|
className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
|
|
1129
|
-
children: [/* @__PURE__ */
|
|
1129
|
+
children: [/* @__PURE__ */ F(D, {
|
|
1130
1130
|
name: e.path,
|
|
1131
1131
|
className: "min-w-0 flex-1",
|
|
1132
|
-
details: /* @__PURE__ */
|
|
1133
|
-
/* @__PURE__ */
|
|
1132
|
+
details: /* @__PURE__ */ I(P, { children: [
|
|
1133
|
+
/* @__PURE__ */ F(v, {
|
|
1134
1134
|
className: f,
|
|
1135
1135
|
text: s(e.file.size)
|
|
1136
1136
|
}),
|
|
1137
|
-
/* @__PURE__ */
|
|
1137
|
+
/* @__PURE__ */ F(T, {
|
|
1138
1138
|
id: a,
|
|
1139
1139
|
text: i
|
|
1140
1140
|
}),
|
|
1141
|
-
n && !r && /* @__PURE__ */
|
|
1141
|
+
n && !r && /* @__PURE__ */ F(v, {
|
|
1142
1142
|
className: f,
|
|
1143
1143
|
text: h.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
|
|
1144
1144
|
}),
|
|
1145
|
-
e.replacesExisting && !r && /* @__PURE__ */
|
|
1145
|
+
e.replacesExisting && !r && /* @__PURE__ */ F(v, {
|
|
1146
1146
|
className: f,
|
|
1147
1147
|
text: h.uploadReplaceRowNote ?? "Will replace the existing file"
|
|
1148
1148
|
})
|
|
1149
1149
|
] })
|
|
1150
|
-
}), /* @__PURE__ */
|
|
1151
|
-
icon: /* @__PURE__ */
|
|
1150
|
+
}), /* @__PURE__ */ F(ee, {
|
|
1151
|
+
icon: /* @__PURE__ */ F(ye, {
|
|
1152
1152
|
size: 16,
|
|
1153
1153
|
"aria-hidden": !0,
|
|
1154
1154
|
stroke: b
|
|
1155
1155
|
}),
|
|
1156
1156
|
"aria-label": h.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
|
|
1157
1157
|
"aria-describedby": i ? a : void 0,
|
|
1158
|
-
onClick: () =>
|
|
1158
|
+
onClick: () => ke(e.id)
|
|
1159
1159
|
})]
|
|
1160
1160
|
}, e.id);
|
|
1161
1161
|
})
|
|
1162
1162
|
}),
|
|
1163
|
-
/* @__PURE__ */
|
|
1164
|
-
|
|
1165
|
-
|
|
1163
|
+
/* @__PURE__ */ F(T, {
|
|
1164
|
+
text: ae,
|
|
1165
|
+
announce: ne.Assertive
|
|
1166
1166
|
})
|
|
1167
1167
|
]
|
|
1168
1168
|
})
|
|
1169
1169
|
});
|
|
1170
|
-
},
|
|
1170
|
+
}, wt = {
|
|
1171
1171
|
title: "_title_5md1a_1",
|
|
1172
1172
|
helperText: "_helperText_5md1a_5",
|
|
1173
1173
|
refineFeedback: "_refineFeedback_5md1a_9",
|
|
1174
1174
|
refineError: "_refineError_5md1a_13"
|
|
1175
|
-
},
|
|
1176
|
-
mode:
|
|
1175
|
+
}, Tt = {
|
|
1176
|
+
mode: ct.Files,
|
|
1177
1177
|
targetFolderPath: ""
|
|
1178
|
-
},
|
|
1179
|
-
let { MarkdownEditor: e } = await
|
|
1178
|
+
}, Et = [W.Name, W.Description], Dt = 24, Ot = 300, kt = "pb-0 desktop:px-8 desktop:py-6", At = "desktop:px-8 desktop:py-6", jt = "gap-4 px-4 pt-5 pb-6 desktop:gap-5 desktop:px-8 desktop:py-6", Mt = Se(async () => {
|
|
1179
|
+
let { MarkdownEditor: e } = await De();
|
|
1180
1180
|
return { default: e };
|
|
1181
|
-
}),
|
|
1182
|
-
let [
|
|
1181
|
+
}), Nt = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: d, expandedPaths: p, onExpandedPathsChange: m, isLoading: x = !1, hasLoadError: E = !1, isSubmitting: D = !1, errors: k, submitError: j, conflict: M, onReloadLatest: te, isNameReadOnly: ne = !1, onDirtyChange: re, onValuesChange: ie, onRefineDescription: ae, onRefineInstructions: se, fileActions: N, supportingFileContent: ce, asideData: ue, onSubmit: de, onCancel: fe, onBack: pe, backAriaLabel: _e, title: ve, onRetry: Se, onRetrySubmit: Ce, labels: De, styles: Oe, dir: ke, instructionsEditorTheme: Ae = S.light }) => {
|
|
1182
|
+
let [H, je] = V({
|
|
1183
1183
|
name: r?.name ?? "",
|
|
1184
1184
|
description: r?.description ?? "",
|
|
1185
1185
|
instructions: r?.instructions ?? ""
|
|
1186
|
-
}),
|
|
1187
|
-
u(() => document.getElementById(
|
|
1188
|
-
let
|
|
1189
|
-
bottomGap:
|
|
1190
|
-
minHeight:
|
|
1191
|
-
}),
|
|
1186
|
+
}), Me = we(), Ne = we();
|
|
1187
|
+
u(() => document.getElementById(Me), Ne, !!k?.instructions);
|
|
1188
|
+
let U = B(void 0), Pe = l({
|
|
1189
|
+
bottomGap: Dt,
|
|
1190
|
+
minHeight: Ot
|
|
1191
|
+
}), W = B(H), Fe = (e) => {
|
|
1192
1192
|
let t = {
|
|
1193
|
-
...
|
|
1193
|
+
...W.current,
|
|
1194
1194
|
...e
|
|
1195
1195
|
};
|
|
1196
|
-
|
|
1197
|
-
},
|
|
1198
|
-
if (
|
|
1199
|
-
|
|
1196
|
+
W.current = t, je(t), ie?.(t);
|
|
1197
|
+
}, Ie = (e) => e ? async (t, n) => {
|
|
1198
|
+
if (U.current && !U.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
1199
|
+
U.current = n;
|
|
1200
1200
|
try {
|
|
1201
1201
|
return await e(t, n);
|
|
1202
1202
|
} finally {
|
|
1203
|
-
|
|
1203
|
+
U.current === n && (U.current = void 0);
|
|
1204
1204
|
}
|
|
1205
|
-
} : void 0,
|
|
1206
|
-
value:
|
|
1207
|
-
onChange: (e) =>
|
|
1208
|
-
onRefine:
|
|
1205
|
+
} : void 0, Le = f({
|
|
1206
|
+
value: H.description,
|
|
1207
|
+
onChange: (e) => Fe({ description: e }),
|
|
1208
|
+
onRefine: Ie(ae),
|
|
1209
1209
|
disabled: D || x || E,
|
|
1210
1210
|
resetKey: r
|
|
1211
|
-
}),
|
|
1212
|
-
value:
|
|
1213
|
-
onChange: (e) =>
|
|
1214
|
-
onRefine:
|
|
1211
|
+
}), Re = f({
|
|
1212
|
+
value: H.instructions,
|
|
1213
|
+
onChange: (e) => Fe({ instructions: e }),
|
|
1214
|
+
onRefine: Ie(se),
|
|
1215
1215
|
disabled: D || x || E,
|
|
1216
1216
|
resetKey: r
|
|
1217
|
-
}),
|
|
1218
|
-
|
|
1217
|
+
}), ze = Le.isPending || Re.isPending, Be = () => {
|
|
1218
|
+
Le.reset(), Re.reset();
|
|
1219
1219
|
}, Ve = () => {
|
|
1220
|
-
|
|
1220
|
+
Be(), fe();
|
|
1221
|
+
}, He = () => {
|
|
1222
|
+
Be(), pe();
|
|
1221
1223
|
}, Ue = () => {
|
|
1222
|
-
|
|
1223
|
-
}, Ke = ()
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
B(() => {
|
|
1227
|
-
qe.current = r;
|
|
1224
|
+
D || x || E || U.current && !U.current.aborted || de(H);
|
|
1225
|
+
}, Ke = B(r), Je = Ke.current !== r, Ze = B(i), [Qe, et] = V(!1);
|
|
1226
|
+
R(() => {
|
|
1227
|
+
Ke.current = r;
|
|
1228
1228
|
let e = {
|
|
1229
1229
|
name: r?.name ?? "",
|
|
1230
1230
|
description: r?.description ?? "",
|
|
1231
1231
|
instructions: r?.instructions ?? ""
|
|
1232
1232
|
};
|
|
1233
|
-
|
|
1233
|
+
W.current = e, je(e), Ze.current = i, et(!1);
|
|
1234
1234
|
}, [r]);
|
|
1235
|
-
let
|
|
1236
|
-
|
|
1237
|
-
if (
|
|
1235
|
+
let tt = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), rt = B(!1);
|
|
1236
|
+
R(() => {
|
|
1237
|
+
if (Je) return;
|
|
1238
1238
|
let e = {
|
|
1239
1239
|
name: r?.name ?? "",
|
|
1240
1240
|
description: r?.description ?? "",
|
|
1241
1241
|
instructions: r?.instructions ?? ""
|
|
1242
|
-
}, t = JSON.stringify(
|
|
1243
|
-
t !==
|
|
1242
|
+
}, t = JSON.stringify(H) !== JSON.stringify(e) || tt(i) !== tt(Ze.current) || Qe;
|
|
1243
|
+
t !== rt.current && (rt.current = t, re?.(t));
|
|
1244
1244
|
}, [
|
|
1245
|
-
|
|
1245
|
+
H,
|
|
1246
1246
|
i,
|
|
1247
1247
|
r,
|
|
1248
|
-
|
|
1248
|
+
Je,
|
|
1249
1249
|
Qe,
|
|
1250
1250
|
re
|
|
1251
1251
|
]);
|
|
1252
|
-
let [
|
|
1253
|
-
|
|
1254
|
-
}, [d]), [
|
|
1252
|
+
let [it, at] = V(G), q = s ?? it, ut = L((e) => {
|
|
1253
|
+
at(e), d?.(e);
|
|
1254
|
+
}, [d]), [dt, mt] = V([]), gt = p ?? dt, Y = z(() => new Set(gt), [gt]), X = L((e) => {
|
|
1255
1255
|
let t = [...e];
|
|
1256
|
-
|
|
1257
|
-
}, [m]), [
|
|
1258
|
-
|
|
1259
|
-
}, []), [
|
|
1260
|
-
|
|
1261
|
-
...
|
|
1256
|
+
mt(t), m?.(t);
|
|
1257
|
+
}, [m]), [_t, vt] = V(!1), [yt, bt] = V(Tt), xt = L((e) => {
|
|
1258
|
+
bt(e), vt(!0);
|
|
1259
|
+
}, []), [St, Nt] = V(!1), { isDragActive: Pt, dropZoneHandlers: Ft } = st(L((e) => {
|
|
1260
|
+
_t || xt({
|
|
1261
|
+
...Tt,
|
|
1262
1262
|
initialFiles: e
|
|
1263
1263
|
});
|
|
1264
|
-
}, [
|
|
1265
|
-
"--se-title-color":
|
|
1266
|
-
"--se-helper-text-color":
|
|
1267
|
-
"--se-refine-action-text":
|
|
1268
|
-
"--se-refine-error-text":
|
|
1269
|
-
"--se-files-card-bg":
|
|
1270
|
-
"--se-files-card-border":
|
|
1264
|
+
}, [_t, xt])), Z = De ?? {}, Q = Oe?.colors, $ = Oe?.typography ?? {}, It = $.titleClassName ?? "dial-body-semi-text", Lt = $.helperTextClassName ?? "dial-tiny-semi-text", Rt = $.removeIconClassName, zt = $.menuIconClassName ?? "text-secondary", Bt = o({
|
|
1265
|
+
"--se-title-color": Q?.title,
|
|
1266
|
+
"--se-helper-text-color": Q?.helperText,
|
|
1267
|
+
"--se-refine-action-text": Q?.refineActionText,
|
|
1268
|
+
"--se-refine-error-text": Q?.refineErrorText,
|
|
1269
|
+
"--se-files-card-bg": Q?.filesCardBackground,
|
|
1270
|
+
"--se-files-card-border": Q?.filesCardBorder
|
|
1271
1271
|
}), Vt = {
|
|
1272
|
-
footerBackground:
|
|
1273
|
-
footerBorder:
|
|
1272
|
+
footerBackground: Q?.dialogFooterBackground,
|
|
1273
|
+
footerBorder: Q?.dialogFooterBorder
|
|
1274
1274
|
}, Ht = {
|
|
1275
|
-
feedbackClassName: c(
|
|
1276
|
-
errorClassName:
|
|
1275
|
+
feedbackClassName: c(Q?.refineActionText && wt.refineFeedback, $.refineFeedbackClassName, Ye.refineFeedback),
|
|
1276
|
+
errorClassName: wt.refineError
|
|
1277
1277
|
}, Ut = {
|
|
1278
|
-
layout:
|
|
1279
|
-
headerBorderColor:
|
|
1280
|
-
sidebarBorderColor:
|
|
1278
|
+
layout: Q?.border ? { colors: {
|
|
1279
|
+
headerBorderColor: Q.border,
|
|
1280
|
+
sidebarBorderColor: Q.border
|
|
1281
1281
|
} } : void 0,
|
|
1282
|
-
section:
|
|
1283
|
-
}, Wt =
|
|
1284
|
-
required:
|
|
1285
|
-
invalid:
|
|
1286
|
-
duplicate:
|
|
1282
|
+
section: Q?.title ? { colors: { titleColor: Q.title } } : void 0
|
|
1283
|
+
}, Wt = z(() => ({
|
|
1284
|
+
required: Z.folderNameRequiredError ?? "Enter a folder name",
|
|
1285
|
+
invalid: Z.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
|
|
1286
|
+
duplicate: Z.folderNameDuplicateError ?? "An item with this name already exists here"
|
|
1287
1287
|
}), [
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
]), Gt =
|
|
1292
|
-
|
|
1293
|
-
}, [
|
|
1294
|
-
...
|
|
1288
|
+
Z.folderNameRequiredError,
|
|
1289
|
+
Z.folderNameInvalidError,
|
|
1290
|
+
Z.folderNameDuplicateError
|
|
1291
|
+
]), Gt = L((e) => {
|
|
1292
|
+
Y.has(e) || X(/* @__PURE__ */ new Set([...Y, e]));
|
|
1293
|
+
}, [Y, X]), Kt = yt.targetFolderPath, qt = z(() => ({
|
|
1294
|
+
...N,
|
|
1295
1295
|
commitBatch: async (e) => {
|
|
1296
|
-
let t = await
|
|
1296
|
+
let t = await N.commitBatch(e);
|
|
1297
1297
|
return !t.error && Kt !== "" && Gt(Kt), t;
|
|
1298
1298
|
}
|
|
1299
1299
|
}), [
|
|
1300
|
-
|
|
1300
|
+
N,
|
|
1301
1301
|
Kt,
|
|
1302
1302
|
Gt
|
|
1303
|
-
]), Jt =
|
|
1303
|
+
]), Jt = ot({
|
|
1304
1304
|
files: i,
|
|
1305
|
-
fileActions:
|
|
1306
|
-
defaultName:
|
|
1305
|
+
fileActions: N,
|
|
1306
|
+
defaultName: Z.newFolderDefaultName ?? "New folder",
|
|
1307
1307
|
messages: Wt,
|
|
1308
1308
|
onRevealFolder: Gt,
|
|
1309
|
-
onCreated:
|
|
1310
|
-
}), { draftNode: Yt, draftPath: Xt, draftPane: Zt } = Jt, Qt =
|
|
1311
|
-
path:
|
|
1312
|
-
name:
|
|
1313
|
-
kind:
|
|
1314
|
-
}, ...i]), [i]), $t =
|
|
1309
|
+
onCreated: ut
|
|
1310
|
+
}), { draftNode: Yt, draftPath: Xt, draftPane: Zt } = Jt, Qt = z(() => $e([{
|
|
1311
|
+
path: G,
|
|
1312
|
+
name: G,
|
|
1313
|
+
kind: K.File
|
|
1314
|
+
}, ...i]), [i]), $t = z(() => Yt ? $e([
|
|
1315
1315
|
{
|
|
1316
|
-
path:
|
|
1317
|
-
name:
|
|
1318
|
-
kind:
|
|
1316
|
+
path: G,
|
|
1317
|
+
name: G,
|
|
1318
|
+
kind: K.File
|
|
1319
1319
|
},
|
|
1320
1320
|
...i,
|
|
1321
1321
|
Yt
|
|
@@ -1323,51 +1323,51 @@ var We = {
|
|
|
1323
1323
|
i,
|
|
1324
1324
|
Yt,
|
|
1325
1325
|
Qt
|
|
1326
|
-
]), en =
|
|
1327
|
-
e.path !== Xt &&
|
|
1328
|
-
}, [
|
|
1329
|
-
|
|
1326
|
+
]), en = z(() => i.find((e) => e.path === q), [i, q]), tn = L((e) => {
|
|
1327
|
+
e.path !== Xt && ut(e.path);
|
|
1328
|
+
}, [ut, Xt]), nn = L((e) => {
|
|
1329
|
+
N.onRemoveNode(e), q === e && ut(G);
|
|
1330
1330
|
}, [
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
]), { startDraft: rn } = Jt, { onCreateFolder: an, extractArchive: on, pickFromFileSystem: sn } =
|
|
1335
|
-
t ===
|
|
1336
|
-
}, [rn]), dn =
|
|
1331
|
+
N,
|
|
1332
|
+
q,
|
|
1333
|
+
ut
|
|
1334
|
+
]), { startDraft: rn } = Jt, { onCreateFolder: an, extractArchive: on, pickFromFileSystem: sn } = N, [cn, ln] = V(null), un = L((e, t) => {
|
|
1335
|
+
t === J.Mobile ? ln(e) : rn(e, t);
|
|
1336
|
+
}, [rn]), dn = z(() => i.filter((e) => e.kind === K.File).map((e) => e.path), [i]), fn = L(async (e) => {
|
|
1337
1337
|
if (!sn) return;
|
|
1338
1338
|
let t = await sn();
|
|
1339
|
-
t?.length &&
|
|
1340
|
-
mode:
|
|
1339
|
+
t?.length && xt({
|
|
1340
|
+
mode: ct.Files,
|
|
1341
1341
|
targetFolderPath: e,
|
|
1342
1342
|
initialEntries: t
|
|
1343
1343
|
});
|
|
1344
|
-
}, [sn,
|
|
1345
|
-
let n = (e) =>
|
|
1344
|
+
}, [sn, xt]), pn = L((e, t) => {
|
|
1345
|
+
let n = (e) => lt(e, zt), r = [];
|
|
1346
1346
|
return an && r.push({
|
|
1347
1347
|
key: "create-folder",
|
|
1348
|
-
label:
|
|
1349
|
-
icon: n(
|
|
1348
|
+
label: Z.createFolderLabel ?? "Create folder",
|
|
1349
|
+
icon: n(ge),
|
|
1350
1350
|
onClick: () => un(e, t)
|
|
1351
1351
|
}), r.push({
|
|
1352
1352
|
key: "upload-files",
|
|
1353
|
-
label:
|
|
1354
|
-
icon: n(
|
|
1355
|
-
onClick: () =>
|
|
1356
|
-
mode:
|
|
1353
|
+
label: Z.uploadFilesLabel ?? "Upload files from device",
|
|
1354
|
+
icon: n(be),
|
|
1355
|
+
onClick: () => xt({
|
|
1356
|
+
mode: ct.Files,
|
|
1357
1357
|
targetFolderPath: e
|
|
1358
1358
|
})
|
|
1359
1359
|
}), on && r.push({
|
|
1360
1360
|
key: "upload-archive",
|
|
1361
|
-
label:
|
|
1362
|
-
icon: n(
|
|
1363
|
-
onClick: () =>
|
|
1364
|
-
mode:
|
|
1361
|
+
label: Z.uploadArchiveLabel ?? "Upload archive from device",
|
|
1362
|
+
icon: n(he),
|
|
1363
|
+
onClick: () => xt({
|
|
1364
|
+
mode: ct.Archive,
|
|
1365
1365
|
targetFolderPath: e
|
|
1366
1366
|
})
|
|
1367
1367
|
}), sn && r.push({
|
|
1368
1368
|
key: "open-file-system",
|
|
1369
|
-
label:
|
|
1370
|
-
icon: n(
|
|
1369
|
+
label: Z.openFileSystemLabel ?? "Open DIAL file system",
|
|
1370
|
+
icon: n(me),
|
|
1371
1371
|
onClick: () => void fn(e)
|
|
1372
1372
|
}), r;
|
|
1373
1373
|
}, [
|
|
@@ -1375,78 +1375,78 @@ var We = {
|
|
|
1375
1375
|
an,
|
|
1376
1376
|
on,
|
|
1377
1377
|
sn,
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1378
|
+
Z.createFolderLabel,
|
|
1379
|
+
Z.uploadFilesLabel,
|
|
1380
|
+
Z.uploadArchiveLabel,
|
|
1381
|
+
Z.openFileSystemLabel,
|
|
1382
1382
|
un,
|
|
1383
|
-
|
|
1383
|
+
xt,
|
|
1384
1384
|
fn
|
|
1385
|
-
]), mn =
|
|
1386
|
-
let e =
|
|
1385
|
+
]), mn = z(() => {
|
|
1386
|
+
let e = nt(Xe.Header, i.find((e) => e.path === q));
|
|
1387
1387
|
return {
|
|
1388
|
-
[
|
|
1389
|
-
[
|
|
1388
|
+
[J.Mobile]: pn(e, J.Mobile),
|
|
1389
|
+
[J.Desktop]: pn(e, J.Desktop)
|
|
1390
1390
|
};
|
|
1391
1391
|
}, [
|
|
1392
1392
|
pn,
|
|
1393
1393
|
i,
|
|
1394
|
-
|
|
1395
|
-
]), hn =
|
|
1396
|
-
if (e.path === Xt || e.nodeType !==
|
|
1394
|
+
q
|
|
1395
|
+
]), hn = L((e, t) => {
|
|
1396
|
+
if (e.path === Xt || e.nodeType !== Te.FOLDER) return [];
|
|
1397
1397
|
let n = {
|
|
1398
1398
|
path: e.path,
|
|
1399
1399
|
name: e.name,
|
|
1400
|
-
kind:
|
|
1401
|
-
}, r = pn(
|
|
1400
|
+
kind: K.Folder
|
|
1401
|
+
}, r = pn(nt(Xe.Child, n), t);
|
|
1402
1402
|
return r.push({
|
|
1403
1403
|
key: "delete",
|
|
1404
|
-
label:
|
|
1404
|
+
label: Z.deleteLabel ?? "Delete",
|
|
1405
1405
|
danger: !0,
|
|
1406
|
-
icon:
|
|
1406
|
+
icon: lt(ye, Rt),
|
|
1407
1407
|
onClick: () => nn(e.path)
|
|
1408
1408
|
}), r;
|
|
1409
1409
|
}, [
|
|
1410
1410
|
Xt,
|
|
1411
|
-
|
|
1411
|
+
Z.deleteLabel,
|
|
1412
1412
|
Rt,
|
|
1413
1413
|
pn,
|
|
1414
1414
|
nn
|
|
1415
|
-
]), gn =
|
|
1416
|
-
[
|
|
1417
|
-
[
|
|
1418
|
-
}), [hn]), _n =
|
|
1415
|
+
]), gn = z(() => ({
|
|
1416
|
+
[J.Mobile]: (e) => hn(e, J.Mobile),
|
|
1417
|
+
[J.Desktop]: (e) => hn(e, J.Desktop)
|
|
1418
|
+
}), [hn]), _n = L((e) => e.nodeType === Te.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ F(ee, {
|
|
1419
1419
|
size: C.Small,
|
|
1420
|
-
icon:
|
|
1421
|
-
"aria-label":
|
|
1420
|
+
icon: lt(ye, Rt, y.SM),
|
|
1421
|
+
"aria-label": Z.deleteLabel ?? "Delete",
|
|
1422
1422
|
onClick: () => nn(e.path)
|
|
1423
1423
|
}), [
|
|
1424
|
-
|
|
1424
|
+
Z.deleteLabel,
|
|
1425
1425
|
Rt,
|
|
1426
1426
|
nn
|
|
1427
|
-
]), vn = (e) => /* @__PURE__ */
|
|
1427
|
+
]), vn = (e) => /* @__PURE__ */ I("div", {
|
|
1428
1428
|
className: "flex flex-col gap-2 desktop:gap-5",
|
|
1429
|
-
children: [/* @__PURE__ */
|
|
1429
|
+
children: [/* @__PURE__ */ I("div", {
|
|
1430
1430
|
className: "flex items-center justify-between",
|
|
1431
|
-
children: [/* @__PURE__ */
|
|
1432
|
-
className: c(
|
|
1433
|
-
children:
|
|
1434
|
-
}), /* @__PURE__ */
|
|
1435
|
-
label:
|
|
1431
|
+
children: [/* @__PURE__ */ F("span", {
|
|
1432
|
+
className: c(wt.title, It),
|
|
1433
|
+
children: Z.filesHeading ?? "Files"
|
|
1434
|
+
}), /* @__PURE__ */ F(g, {
|
|
1435
|
+
label: Z.addLabel ?? "Add",
|
|
1436
1436
|
variant: _.Neutral,
|
|
1437
1437
|
appearance: h.Solid,
|
|
1438
1438
|
size: C.Small,
|
|
1439
1439
|
items: mn[e]
|
|
1440
1440
|
})]
|
|
1441
|
-
}), /* @__PURE__ */
|
|
1441
|
+
}), /* @__PURE__ */ F("div", {
|
|
1442
1442
|
role: "tree",
|
|
1443
|
-
"aria-label":
|
|
1444
|
-
children: /* @__PURE__ */
|
|
1443
|
+
"aria-label": Z.filesTreeAriaLabel ?? "Skill files",
|
|
1444
|
+
children: /* @__PURE__ */ F(Ee, {
|
|
1445
1445
|
items: Zt === e ? $t : Qt,
|
|
1446
1446
|
showFiles: !0,
|
|
1447
|
-
selectedPath:
|
|
1448
|
-
expandedPaths:
|
|
1449
|
-
onExpandedPathsChange:
|
|
1447
|
+
selectedPath: q,
|
|
1448
|
+
expandedPaths: Y,
|
|
1449
|
+
onExpandedPathsChange: X,
|
|
1450
1450
|
onItemClick: tn,
|
|
1451
1451
|
getContextMenuItems: gn[e],
|
|
1452
1452
|
renderItemActions: _n,
|
|
@@ -1457,231 +1457,229 @@ var We = {
|
|
|
1457
1457
|
rootItemPath: ""
|
|
1458
1458
|
})
|
|
1459
1459
|
})]
|
|
1460
|
-
}), yn =
|
|
1461
|
-
name:
|
|
1462
|
-
description:
|
|
1460
|
+
}), yn = z(() => ({
|
|
1461
|
+
name: H.name,
|
|
1462
|
+
description: H.description,
|
|
1463
1463
|
iconUrl: "",
|
|
1464
1464
|
version: "",
|
|
1465
1465
|
topics: [],
|
|
1466
1466
|
otherLocales: []
|
|
1467
|
-
}), [
|
|
1467
|
+
}), [H.name, H.description]), bn = z(() => ({
|
|
1468
1468
|
name: k?.name,
|
|
1469
1469
|
description: k?.description
|
|
1470
|
-
}), [k?.name, k?.description]), xn =
|
|
1471
|
-
...
|
|
1470
|
+
}), [k?.name, k?.description]), xn = z(() => ({ form: {
|
|
1471
|
+
...Ge,
|
|
1472
1472
|
name: {
|
|
1473
|
-
label:
|
|
1474
|
-
placeholder:
|
|
1473
|
+
label: Z.nameLabel ?? "Name",
|
|
1474
|
+
placeholder: Z.namePlaceholder ?? "good-morning-breakfast"
|
|
1475
1475
|
},
|
|
1476
1476
|
description: {
|
|
1477
|
-
label:
|
|
1478
|
-
placeholder:
|
|
1477
|
+
label: Z.descriptionLabel ?? "Description",
|
|
1478
|
+
placeholder: Z.descriptionPlaceholder ?? "What this skill does and when to use it"
|
|
1479
1479
|
},
|
|
1480
1480
|
ariaLabel: void 0
|
|
1481
1481
|
} }), [
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1482
|
+
Z.nameLabel,
|
|
1483
|
+
Z.namePlaceholder,
|
|
1484
|
+
Z.descriptionLabel,
|
|
1485
|
+
Z.descriptionPlaceholder
|
|
1486
1486
|
]), Sn = (e) => {
|
|
1487
|
-
e.name !== void 0 &&
|
|
1488
|
-
}, Cn = ae ? (e, t) => /* @__PURE__ */
|
|
1487
|
+
e.name !== void 0 && Fe({ name: e.name }), e.description !== void 0 && (Le.reset(), Fe({ description: e.description }));
|
|
1488
|
+
}, Cn = ae ? (e, t) => /* @__PURE__ */ F(a, {
|
|
1489
1489
|
isEnabled: !0,
|
|
1490
1490
|
fieldId: t,
|
|
1491
1491
|
required: !0,
|
|
1492
|
-
label:
|
|
1493
|
-
labels:
|
|
1494
|
-
refinement:
|
|
1495
|
-
disabled:
|
|
1492
|
+
label: Z.descriptionLabel ?? "Description",
|
|
1493
|
+
labels: Z,
|
|
1494
|
+
refinement: Le,
|
|
1495
|
+
disabled: ze || D,
|
|
1496
1496
|
...Ht,
|
|
1497
1497
|
children: e
|
|
1498
1498
|
}) : void 0, wn = {
|
|
1499
|
-
title:
|
|
1500
|
-
onBack:
|
|
1499
|
+
title: ve,
|
|
1500
|
+
onBack: He,
|
|
1501
1501
|
onCancel: Ve,
|
|
1502
|
-
onSubmit:
|
|
1503
|
-
submitLabel:
|
|
1504
|
-
isSubmitDisabled:
|
|
1502
|
+
onSubmit: Ue,
|
|
1503
|
+
submitLabel: Z.createLabel ?? "Create",
|
|
1504
|
+
isSubmitDisabled: ze || x || E,
|
|
1505
1505
|
labels: {
|
|
1506
|
-
cancelLabel:
|
|
1507
|
-
backAriaLabel:
|
|
1508
|
-
savingStatusLabel:
|
|
1506
|
+
cancelLabel: Z.cancelLabel ?? "Cancel",
|
|
1507
|
+
backAriaLabel: _e ?? "Back",
|
|
1508
|
+
savingStatusLabel: Z.savingStatusLabel ?? "Saving"
|
|
1509
1509
|
},
|
|
1510
1510
|
styles: Ut,
|
|
1511
1511
|
metadataTitle: null
|
|
1512
1512
|
};
|
|
1513
|
-
if (x) return /* @__PURE__ */
|
|
1514
|
-
dir:
|
|
1513
|
+
if (x) return /* @__PURE__ */ F("div", {
|
|
1514
|
+
dir: ke,
|
|
1515
1515
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1516
|
-
children: /* @__PURE__ */
|
|
1516
|
+
children: /* @__PURE__ */ F(We, {
|
|
1517
1517
|
...wn,
|
|
1518
|
-
metadata: /* @__PURE__ */
|
|
1519
|
-
role: "status",
|
|
1520
|
-
"aria-label": Q.loadingAriaLabel ?? "Loading skill",
|
|
1518
|
+
metadata: /* @__PURE__ */ F("div", {
|
|
1521
1519
|
className: "flex flex-1 items-center justify-center p-8",
|
|
1522
|
-
children: /* @__PURE__ */
|
|
1520
|
+
children: /* @__PURE__ */ F(le, { ariaLabel: Z.loadingAriaLabel ?? "Loading skill" })
|
|
1523
1521
|
})
|
|
1524
1522
|
})
|
|
1525
1523
|
});
|
|
1526
|
-
if (E) return /* @__PURE__ */
|
|
1527
|
-
dir:
|
|
1524
|
+
if (E) return /* @__PURE__ */ F("div", {
|
|
1525
|
+
dir: ke,
|
|
1528
1526
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1529
|
-
children: /* @__PURE__ */
|
|
1527
|
+
children: /* @__PURE__ */ F(We, {
|
|
1530
1528
|
...wn,
|
|
1531
|
-
metadata: /* @__PURE__ */
|
|
1529
|
+
metadata: /* @__PURE__ */ F("div", {
|
|
1532
1530
|
className: "p-8",
|
|
1533
|
-
children: /* @__PURE__ */
|
|
1534
|
-
message:
|
|
1531
|
+
children: /* @__PURE__ */ F(w, {
|
|
1532
|
+
message: Z.loadErrorMessage ?? "Couldn't load this skill. Please try again.",
|
|
1535
1533
|
iconStroke: b,
|
|
1536
|
-
action: /* @__PURE__ */
|
|
1537
|
-
label:
|
|
1538
|
-
onClick:
|
|
1534
|
+
action: /* @__PURE__ */ F(oe, {
|
|
1535
|
+
label: Z.retryLabel ?? "Retry",
|
|
1536
|
+
onClick: Se
|
|
1539
1537
|
})
|
|
1540
1538
|
})
|
|
1541
1539
|
})
|
|
1542
1540
|
})
|
|
1543
1541
|
});
|
|
1544
|
-
let Tn =
|
|
1542
|
+
let Tn = q === G, En = Tn ? G : Z.selectedFileHeading?.(en?.name ?? q) ?? en?.name ?? q, Dn = j != null || M != null ? /* @__PURE__ */ I("div", {
|
|
1545
1543
|
className: "flex flex-col gap-2",
|
|
1546
|
-
children: [j != null && /* @__PURE__ */
|
|
1544
|
+
children: [j != null && /* @__PURE__ */ I("div", {
|
|
1547
1545
|
className: "flex items-center gap-2",
|
|
1548
|
-
children: [/* @__PURE__ */
|
|
1549
|
-
label:
|
|
1550
|
-
onClick:
|
|
1546
|
+
children: [/* @__PURE__ */ F(T, { text: j }), Ce != null && /* @__PURE__ */ F(O, {
|
|
1547
|
+
label: Z.retryLabel ?? "Retry",
|
|
1548
|
+
onClick: Ce
|
|
1551
1549
|
})]
|
|
1552
|
-
}), M != null && /* @__PURE__ */
|
|
1550
|
+
}), M != null && /* @__PURE__ */ I("div", {
|
|
1553
1551
|
className: "flex items-center gap-2",
|
|
1554
|
-
children: [/* @__PURE__ */
|
|
1555
|
-
label:
|
|
1552
|
+
children: [/* @__PURE__ */ F(T, { text: M.message }), /* @__PURE__ */ F(O, {
|
|
1553
|
+
label: Z.reloadLatestLabel ?? "Reload latest",
|
|
1556
1554
|
onClick: te
|
|
1557
1555
|
})]
|
|
1558
1556
|
})]
|
|
1559
|
-
}) : void 0, On = /* @__PURE__ */
|
|
1557
|
+
}) : void 0, On = /* @__PURE__ */ F(a, {
|
|
1560
1558
|
isEnabled: !!se,
|
|
1561
|
-
fieldId:
|
|
1559
|
+
fieldId: Me,
|
|
1562
1560
|
required: !0,
|
|
1563
|
-
labelClassName: c(
|
|
1564
|
-
label:
|
|
1565
|
-
labels:
|
|
1566
|
-
refinement:
|
|
1567
|
-
disabled:
|
|
1561
|
+
labelClassName: c(wt.helperText, Lt),
|
|
1562
|
+
label: Z.instructionsLabel ?? "Instructions",
|
|
1563
|
+
labels: Z,
|
|
1564
|
+
refinement: Re,
|
|
1565
|
+
disabled: ze || D,
|
|
1568
1566
|
...Ht,
|
|
1569
|
-
children: /* @__PURE__ */
|
|
1567
|
+
children: /* @__PURE__ */ I("div", {
|
|
1570
1568
|
className: "flex flex-1 flex-col gap-2",
|
|
1571
1569
|
children: [
|
|
1572
|
-
!se && /* @__PURE__ */
|
|
1573
|
-
htmlFor:
|
|
1574
|
-
className: c(
|
|
1575
|
-
label:
|
|
1570
|
+
!se && /* @__PURE__ */ F(A, {
|
|
1571
|
+
htmlFor: Me,
|
|
1572
|
+
className: c(wt.helperText, Lt),
|
|
1573
|
+
label: Z.instructionsLabel ?? "Instructions",
|
|
1576
1574
|
required: !0
|
|
1577
1575
|
}),
|
|
1578
|
-
/* @__PURE__ */
|
|
1579
|
-
ref:
|
|
1576
|
+
/* @__PURE__ */ F("div", {
|
|
1577
|
+
ref: Pe,
|
|
1580
1578
|
className: c(t, e, n),
|
|
1581
|
-
children: /* @__PURE__ */
|
|
1582
|
-
fallback: /* @__PURE__ */
|
|
1583
|
-
children: /* @__PURE__ */
|
|
1584
|
-
id:
|
|
1585
|
-
ariaLabel:
|
|
1586
|
-
value:
|
|
1579
|
+
children: /* @__PURE__ */ F(xe, {
|
|
1580
|
+
fallback: /* @__PURE__ */ F(le, { ariaLabel: Z.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
1581
|
+
children: /* @__PURE__ */ F(Mt, {
|
|
1582
|
+
id: Me,
|
|
1583
|
+
ariaLabel: Z.instructionsLabel ?? "Instructions",
|
|
1584
|
+
value: H.instructions,
|
|
1587
1585
|
onChange: (e) => {
|
|
1588
|
-
|
|
1586
|
+
Re.reset(), Fe({ instructions: e });
|
|
1589
1587
|
},
|
|
1590
|
-
theme:
|
|
1588
|
+
theme: Ae,
|
|
1591
1589
|
showDragbar: !1,
|
|
1592
|
-
placeholder:
|
|
1590
|
+
placeholder: Z.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
|
|
1593
1591
|
})
|
|
1594
1592
|
})
|
|
1595
1593
|
}),
|
|
1596
|
-
k?.instructions != null && /* @__PURE__ */
|
|
1597
|
-
id:
|
|
1594
|
+
k?.instructions != null && /* @__PURE__ */ F(T, {
|
|
1595
|
+
id: Ne,
|
|
1598
1596
|
text: k.instructions
|
|
1599
1597
|
})
|
|
1600
1598
|
]
|
|
1601
1599
|
})
|
|
1602
1600
|
});
|
|
1603
|
-
return /* @__PURE__ */
|
|
1604
|
-
dir:
|
|
1605
|
-
className: c("relative flex min-h-0 min-w-0 flex-1 flex-col",
|
|
1601
|
+
return /* @__PURE__ */ I("div", {
|
|
1602
|
+
dir: ke,
|
|
1603
|
+
className: c("relative flex min-h-0 min-w-0 flex-1 flex-col", Ye.root),
|
|
1606
1604
|
style: Bt,
|
|
1607
|
-
...
|
|
1605
|
+
...Ft,
|
|
1608
1606
|
children: [
|
|
1609
|
-
/* @__PURE__ */
|
|
1610
|
-
isVisible:
|
|
1611
|
-
labels:
|
|
1607
|
+
/* @__PURE__ */ F(pt, {
|
|
1608
|
+
isVisible: Pt && !_t,
|
|
1609
|
+
labels: De
|
|
1612
1610
|
}),
|
|
1613
|
-
/* @__PURE__ */
|
|
1611
|
+
/* @__PURE__ */ F(We, {
|
|
1614
1612
|
...wn,
|
|
1615
|
-
asideData:
|
|
1616
|
-
asideSectionClassName:
|
|
1613
|
+
asideData: ue,
|
|
1614
|
+
asideSectionClassName: At,
|
|
1617
1615
|
isSubmitting: D,
|
|
1618
|
-
metadataSectionClassName:
|
|
1619
|
-
metadata: /* @__PURE__ */
|
|
1616
|
+
metadataSectionClassName: kt,
|
|
1617
|
+
metadata: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
|
|
1620
1618
|
className: "desktop:hidden",
|
|
1621
|
-
children: /* @__PURE__ */
|
|
1622
|
-
label:
|
|
1619
|
+
children: /* @__PURE__ */ F(ht, {
|
|
1620
|
+
label: Z.editingFileLabel ?? "Editing file",
|
|
1623
1621
|
fileName: en?.name ?? "SKILL.md",
|
|
1624
|
-
isExpanded:
|
|
1625
|
-
onToggle:
|
|
1626
|
-
labelClassName:
|
|
1627
|
-
fileNameClassName:
|
|
1628
|
-
children: vn(
|
|
1622
|
+
isExpanded: St,
|
|
1623
|
+
onToggle: Nt,
|
|
1624
|
+
labelClassName: $.editingFileLabelClassName,
|
|
1625
|
+
fileNameClassName: $.editingFileNameClassName,
|
|
1626
|
+
children: vn(J.Mobile)
|
|
1629
1627
|
})
|
|
1630
|
-
}), /* @__PURE__ */
|
|
1628
|
+
}), /* @__PURE__ */ F("div", {
|
|
1631
1629
|
className: "hidden desktop:block",
|
|
1632
|
-
children: vn(
|
|
1630
|
+
children: vn(J.Desktop)
|
|
1633
1631
|
})] }),
|
|
1634
1632
|
alert: Dn,
|
|
1635
1633
|
setupTitle: En,
|
|
1636
|
-
setupSectionClassName:
|
|
1637
|
-
setup: Tn ? /* @__PURE__ */
|
|
1634
|
+
setupSectionClassName: jt,
|
|
1635
|
+
setup: Tn ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(qe, {
|
|
1638
1636
|
values: yn,
|
|
1639
1637
|
errors: bn,
|
|
1640
1638
|
onChange: Sn,
|
|
1641
|
-
fields:
|
|
1639
|
+
fields: Et,
|
|
1642
1640
|
isDescriptionRequired: !0,
|
|
1643
1641
|
isNameReadOnly: ne,
|
|
1644
|
-
nameReadOnlyTooltip:
|
|
1645
|
-
nameCaption: k?.name ? void 0 :
|
|
1642
|
+
nameReadOnlyTooltip: Z.nameReadOnlyTooltip ?? "The skill name can't be changed after creation",
|
|
1643
|
+
nameCaption: k?.name ? void 0 : Z.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
|
|
1646
1644
|
renderDescription: Cn,
|
|
1647
1645
|
labels: xn
|
|
1648
|
-
}), On] }) : /* @__PURE__ */
|
|
1646
|
+
}), On] }) : /* @__PURE__ */ F(P, { children: en?.kind === K.File && /* @__PURE__ */ F("div", {
|
|
1649
1647
|
className: "flex h-[max(320px,60dvh)] min-h-0 min-w-0 flex-none flex-col desktop:h-auto desktop:flex-1",
|
|
1650
|
-
children: ce ?? /* @__PURE__ */
|
|
1648
|
+
children: ce ?? /* @__PURE__ */ F(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." })
|
|
1651
1649
|
}) })
|
|
1652
1650
|
}),
|
|
1653
|
-
/* @__PURE__ */
|
|
1654
|
-
isOpen:
|
|
1655
|
-
onClose: () =>
|
|
1651
|
+
/* @__PURE__ */ F(Ct, {
|
|
1652
|
+
isOpen: _t,
|
|
1653
|
+
onClose: () => vt(!1),
|
|
1656
1654
|
fileActions: qt,
|
|
1657
|
-
mode:
|
|
1658
|
-
targetFolderPath:
|
|
1659
|
-
initialFiles:
|
|
1660
|
-
initialEntries:
|
|
1655
|
+
mode: yt.mode,
|
|
1656
|
+
targetFolderPath: yt.targetFolderPath,
|
|
1657
|
+
initialFiles: yt.initialFiles,
|
|
1658
|
+
initialEntries: yt.initialEntries,
|
|
1661
1659
|
existingFilePaths: dn,
|
|
1662
1660
|
onCommitted: (e) => {
|
|
1663
|
-
e.some((e) => e.replacesExisting) &&
|
|
1661
|
+
e.some((e) => e.replacesExisting) && et(!0);
|
|
1664
1662
|
},
|
|
1665
|
-
messageClassName:
|
|
1666
|
-
rowCaptionClassName:
|
|
1667
|
-
labels:
|
|
1663
|
+
messageClassName: $.uploadMessageClassName,
|
|
1664
|
+
rowCaptionClassName: $.uploadRowCaptionClassName,
|
|
1665
|
+
labels: De,
|
|
1668
1666
|
dialogColors: Vt
|
|
1669
1667
|
}),
|
|
1670
|
-
/* @__PURE__ */
|
|
1668
|
+
/* @__PURE__ */ F(ft, {
|
|
1671
1669
|
isOpen: cn != null,
|
|
1672
1670
|
onClose: () => ln(null),
|
|
1673
1671
|
validateName: (e) => Jt.validateNewFolder(e, cn ?? ""),
|
|
1674
1672
|
onCreate: (e) => Jt.createFolder(e, cn ?? ""),
|
|
1675
|
-
title:
|
|
1676
|
-
nameLabel:
|
|
1677
|
-
namePlaceholder:
|
|
1678
|
-
createLabel:
|
|
1679
|
-
cancelLabel:
|
|
1680
|
-
closeAriaLabel:
|
|
1673
|
+
title: Z.createFolderLabel ?? "Create folder",
|
|
1674
|
+
nameLabel: Z.createFolderNameLabel ?? "Name",
|
|
1675
|
+
namePlaceholder: Z.createFolderNamePlaceholder ?? "Enter folder name",
|
|
1676
|
+
createLabel: Z.createFolderConfirmLabel ?? "Create",
|
|
1677
|
+
cancelLabel: Z.cancelLabel ?? "Cancel",
|
|
1678
|
+
closeAriaLabel: Z.createFolderCloseAriaLabel ?? "Close",
|
|
1681
1679
|
dialogColors: Vt
|
|
1682
1680
|
})
|
|
1683
1681
|
]
|
|
1684
1682
|
});
|
|
1685
1683
|
};
|
|
1686
1684
|
//#endregion
|
|
1687
|
-
export {
|
|
1685
|
+
export { Ye as SKILL_EDITOR_CLASS, Nt as SkillEditor, gt as SkillFileCandidateKind, K as SkillFileNodeKind, ct as SkillFileUploadMode, Y as SkillFileValidationStatus };
|