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