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