@epam/ai-dial-skill-editor 1.2.0-dev.176 → 1.2.0-dev.181
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/index.css +2 -2
- package/index.js +1087 -566
- package/models/skill-editor-props.d.ts +6 -6
- package/models/skill-editor-props.d.ts.map +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,108 +1,633 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Accordion as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { IconArrowNarrowLeft as
|
|
5
|
-
import { Suspense 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, useTextRefinement as u } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { Accordion as d, ButtonAppearance as f, ButtonDropdown as p, ButtonVariant as m, CaptionText as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, DangerIconButton as v, EditorThemes as y, ElementSize as b, ErrorText as x, FileDropzone as S, GhostButton as C, GhostIconButton as w, Input as T, Label as E, LinkButton as D, NeutralButton as O, Popup as k, PopupSize as ee, PrimaryButton as A, Select as te, Spinner as ne, TagInput as j, Textarea as M, TextareaResize as N } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
4
|
+
import { IconArrowNarrowLeft as L, IconDatabase as re, IconFileText as ie, IconFileZip as ae, IconFolderPlus as oe, IconPhoto as se, IconPlus as ce, IconTrashX as le, IconUpload as ue } from "@tabler/icons-react";
|
|
5
|
+
import { Suspense as de, lazy as R, memo as fe, useCallback as z, useEffect as pe, useId as me, useMemo as B, useRef as V, useState as H } from "react";
|
|
6
6
|
import { DialFileNodeType as he, DialFoldersTree as ge } from "@epam/ai-dial-react-file-manager";
|
|
7
|
-
import { LazyMarkdownEditor as
|
|
8
|
-
|
|
7
|
+
import { LazyMarkdownEditor as _e } from "@epam/ai-dial-ui-kit/editors";
|
|
8
|
+
c("flex flex-col", {
|
|
9
9
|
body: "_body_m2y60_2",
|
|
10
10
|
sideColumn: "_sideColumn_m2y60_6",
|
|
11
11
|
reservedColumn: "_reservedColumn_m2y60_10"
|
|
12
12
|
}.sideColumn);
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region ../builder-form/src/constants/public-class-names.ts
|
|
15
|
-
var
|
|
15
|
+
var ve = {
|
|
16
16
|
layout: "dial-builder-form-layout",
|
|
17
|
-
section: "dial-builder-form-section"
|
|
18
|
-
|
|
17
|
+
section: "dial-builder-form-section",
|
|
18
|
+
metadataSection: "dial-builder-form-metadata-section",
|
|
19
|
+
setupSection: "dial-builder-form-setup-section"
|
|
20
|
+
}, ye = {
|
|
21
|
+
section: "_section_l1mnx_1",
|
|
22
|
+
title: "_title_l1mnx_5"
|
|
23
|
+
}, be = ({ title: e, children: t, styles: n, className: r }) => {
|
|
24
|
+
let i = o({
|
|
25
|
+
"--es-border-color": n?.colors?.borderColor,
|
|
26
|
+
"--es-title-color": n?.colors?.titleColor
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ I("section", {
|
|
29
|
+
className: c("flex h-full flex-col gap-4 rounded border p-6", ye.section, r, ve.section),
|
|
30
|
+
style: i,
|
|
31
|
+
children: [e != null && /* @__PURE__ */ F("h2", {
|
|
32
|
+
className: c("dial-h3-text", ye.title),
|
|
33
|
+
children: e
|
|
34
|
+
}), t]
|
|
35
|
+
});
|
|
36
|
+
}, xe = {
|
|
19
37
|
headerBorder: "_headerBorder_1kidu_1",
|
|
20
38
|
footerBorder: "_footerBorder_1kidu_5",
|
|
21
39
|
sidebarBorder: "_sidebarBorder_1kidu_9"
|
|
22
|
-
},
|
|
23
|
-
let f = me(),
|
|
40
|
+
}, Se = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: i, rightContent: a, isSaving: s = !1, labels: l, styles: u, dir: d }) => {
|
|
41
|
+
let f = me(), p = s ? l?.savingStatusLabel ?? "Saving" : "", m = o({
|
|
24
42
|
"--el-header-border-color": u?.colors?.headerBorderColor,
|
|
25
43
|
"--el-sidebar-border-color": u?.colors?.sidebarBorderColor
|
|
26
44
|
});
|
|
27
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ I("div", {
|
|
28
46
|
dir: d,
|
|
29
|
-
className:
|
|
30
|
-
style:
|
|
47
|
+
className: c("flex min-h-0 flex-1 flex-col", ve.layout),
|
|
48
|
+
style: m,
|
|
31
49
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ F("span", {
|
|
33
51
|
role: "status",
|
|
34
52
|
"aria-live": "polite",
|
|
35
53
|
className: "sr-only",
|
|
36
54
|
id: f,
|
|
37
|
-
children:
|
|
55
|
+
children: p
|
|
38
56
|
}),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
className:
|
|
41
|
-
children: [/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ I("div", {
|
|
58
|
+
className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", xe.headerBorder),
|
|
59
|
+
children: [/* @__PURE__ */ I("div", {
|
|
42
60
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
-
icon: /* @__PURE__ */
|
|
45
|
-
size:
|
|
46
|
-
stroke:
|
|
61
|
+
children: [/* @__PURE__ */ F(w, {
|
|
62
|
+
icon: /* @__PURE__ */ F(L, {
|
|
63
|
+
size: g.LG,
|
|
64
|
+
stroke: _,
|
|
47
65
|
"aria-hidden": !0,
|
|
48
66
|
className: "rtl:scale-x-[-1]"
|
|
49
67
|
}),
|
|
50
68
|
"aria-label": n,
|
|
51
69
|
onClick: t
|
|
52
|
-
}), /* @__PURE__ */
|
|
70
|
+
}), /* @__PURE__ */ F("h1", {
|
|
53
71
|
className: "dial-h2-text min-w-0 truncate",
|
|
54
72
|
children: e
|
|
55
73
|
})]
|
|
56
|
-
}),
|
|
74
|
+
}), r != null && /* @__PURE__ */ F("div", {
|
|
57
75
|
className: "hidden shrink-0 items-center gap-2 desktop:flex",
|
|
58
|
-
children:
|
|
76
|
+
children: r
|
|
59
77
|
})]
|
|
60
78
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ I("div", {
|
|
62
80
|
className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
-
className: a
|
|
65
|
-
children:
|
|
66
|
-
}),
|
|
67
|
-
className: "desktop:flex-1 desktop:overflow-y-auto",
|
|
68
|
-
children:
|
|
81
|
+
children: [/* @__PURE__ */ F("div", {
|
|
82
|
+
className: c(a == null ? "desktop:flex-1" : "desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", a == null ? void 0 : xe.sidebarBorder),
|
|
83
|
+
children: i
|
|
84
|
+
}), a != null && /* @__PURE__ */ F("div", {
|
|
85
|
+
className: "desktop:flex desktop:flex-1 desktop:flex-col desktop:overflow-y-auto",
|
|
86
|
+
children: a
|
|
87
|
+
})]
|
|
88
|
+
}),
|
|
89
|
+
r != null && /* @__PURE__ */ F("div", {
|
|
90
|
+
className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", xe.footerBorder),
|
|
91
|
+
children: r
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
}, Ce = {
|
|
96
|
+
box: "_box_c9as8_1",
|
|
97
|
+
icon: "_icon_c9as8_6",
|
|
98
|
+
caption: "_caption_c9as8_10"
|
|
99
|
+
}, we = ({ 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 }) => {
|
|
100
|
+
let u = o({
|
|
101
|
+
"--aa-box-bg": s?.colors?.boxBackgroundColor,
|
|
102
|
+
"--aa-box-border": s?.colors?.boxBorderColor,
|
|
103
|
+
"--aa-icon": s?.colors?.placeholderIconColor,
|
|
104
|
+
"--aa-caption": s?.colors?.captionColor
|
|
105
|
+
});
|
|
106
|
+
return /* @__PURE__ */ I("div", {
|
|
107
|
+
className: c("flex flex-col gap-2", l),
|
|
108
|
+
style: u,
|
|
109
|
+
children: [/* @__PURE__ */ F(E, { label: e }), /* @__PURE__ */ I("div", {
|
|
110
|
+
className: "flex items-start gap-3",
|
|
111
|
+
children: [/* @__PURE__ */ F("div", {
|
|
112
|
+
className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", Ce.box),
|
|
113
|
+
children: t ? /* @__PURE__ */ F("img", {
|
|
114
|
+
src: t,
|
|
115
|
+
alt: n,
|
|
116
|
+
className: "h-16 w-16 object-cover"
|
|
117
|
+
}) : /* @__PURE__ */ F(se, {
|
|
118
|
+
size: g.LG,
|
|
119
|
+
stroke: _,
|
|
120
|
+
"aria-hidden": !0,
|
|
121
|
+
className: Ce.icon
|
|
122
|
+
})
|
|
123
|
+
}), /* @__PURE__ */ I("div", {
|
|
124
|
+
className: "flex flex-col gap-3",
|
|
125
|
+
children: [/* @__PURE__ */ F(D, {
|
|
126
|
+
size: b.Small,
|
|
127
|
+
iconBefore: /* @__PURE__ */ F(ce, {
|
|
128
|
+
size: g.SM,
|
|
129
|
+
stroke: _,
|
|
130
|
+
"aria-hidden": !0
|
|
131
|
+
}),
|
|
132
|
+
className: "w-fit",
|
|
133
|
+
label: r,
|
|
134
|
+
onClick: a
|
|
135
|
+
}), /* @__PURE__ */ F("span", {
|
|
136
|
+
className: c("dial-tiny-text", Ce.caption),
|
|
137
|
+
children: i
|
|
69
138
|
})]
|
|
139
|
+
})]
|
|
140
|
+
})]
|
|
141
|
+
});
|
|
142
|
+
}, Te = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: o, labels: s }) => {
|
|
143
|
+
let c = z((e) => e.length === 1 ? s.deleteConfirmTitleSingle : s.deleteConfirmTitleMultiple, [s.deleteConfirmTitleSingle, s.deleteConfirmTitleMultiple]), l = z((e) => /* @__PURE__ */ F("div", {
|
|
144
|
+
className: "dial-small-text px-6 py-3",
|
|
145
|
+
children: /* @__PURE__ */ F("p", {
|
|
146
|
+
className: "mb-3 text-secondary",
|
|
147
|
+
children: e.length === 1 ? /* @__PURE__ */ I(P, { children: [
|
|
148
|
+
s.deleteConfirmSingleText,
|
|
149
|
+
" ",
|
|
150
|
+
/* @__PURE__ */ I("span", {
|
|
151
|
+
className: "break-words text-primary",
|
|
152
|
+
children: [
|
|
153
|
+
"\"",
|
|
154
|
+
e[0].split("/").pop(),
|
|
155
|
+
"\"?"
|
|
156
|
+
]
|
|
157
|
+
})
|
|
158
|
+
] }) : /* @__PURE__ */ I(P, { children: [
|
|
159
|
+
s.deleteConfirmMultipleText,
|
|
160
|
+
" ",
|
|
161
|
+
/* @__PURE__ */ I("span", {
|
|
162
|
+
className: "text-primary",
|
|
163
|
+
children: [
|
|
164
|
+
e.length,
|
|
165
|
+
" ",
|
|
166
|
+
s.deleteConfirmItemsLabel
|
|
167
|
+
]
|
|
168
|
+
})
|
|
169
|
+
] })
|
|
170
|
+
})
|
|
171
|
+
}), [
|
|
172
|
+
s.deleteConfirmSingleText,
|
|
173
|
+
s.deleteConfirmMultipleText,
|
|
174
|
+
s.deleteConfirmItemsLabel
|
|
175
|
+
]);
|
|
176
|
+
return /* @__PURE__ */ F(de, {
|
|
177
|
+
fallback: null,
|
|
178
|
+
children: e && /* @__PURE__ */ F(i, {
|
|
179
|
+
isOpen: e,
|
|
180
|
+
onClose: t,
|
|
181
|
+
onAttach: n,
|
|
182
|
+
bucket: r,
|
|
183
|
+
allowedTypes: a,
|
|
184
|
+
maxSelectableFileSize: o,
|
|
185
|
+
maximumAttachmentsAmount: 1,
|
|
186
|
+
canAttachFolders: !1,
|
|
187
|
+
title: s.title,
|
|
188
|
+
attachLabel: s.attachLabel,
|
|
189
|
+
emptyTitle: s.emptyTitle,
|
|
190
|
+
emptyDescription: s.emptyDescription,
|
|
191
|
+
errorMessage: s.errorMessage,
|
|
192
|
+
retryLabel: s.retryLabel,
|
|
193
|
+
hiddenFilesLabel: s.hiddenFilesLabel,
|
|
194
|
+
showHiddenFilesLabel: s.showHiddenFilesLabel,
|
|
195
|
+
hideHiddenFilesLabel: s.hideHiddenFilesLabel,
|
|
196
|
+
getSelectionLabel: s.getSelectionLabel,
|
|
197
|
+
uploadFilesLabel: s.uploadFilesLabel,
|
|
198
|
+
newFolderLabel: s.newFolderLabel,
|
|
199
|
+
downloadLabel: s.downloadLabel,
|
|
200
|
+
downloadingLabel: s.downloadingLabel,
|
|
201
|
+
deleteLabel: s.deleteLabel,
|
|
202
|
+
deletingLabel: s.deletingLabel,
|
|
203
|
+
deleteConfirmTitle: c,
|
|
204
|
+
deleteConfirmBody: l,
|
|
205
|
+
deleteConfirmLabel: s.deleteConfirmLabel,
|
|
206
|
+
deleteCancelLabel: s.deleteCancelLabel
|
|
207
|
+
})
|
|
208
|
+
});
|
|
209
|
+
}, U = /* @__PURE__ */ function(e) {
|
|
210
|
+
return e.Avatar = "avatar", e.Name = "name", e.Version = "version", e.Description = "description", e.Locales = "locales", e.Tags = "tags", e;
|
|
211
|
+
}({}), Ee = [
|
|
212
|
+
"avatar",
|
|
213
|
+
"name",
|
|
214
|
+
"version",
|
|
215
|
+
"description",
|
|
216
|
+
"locales",
|
|
217
|
+
"tags"
|
|
218
|
+
], W = (e, t, n) => ({
|
|
219
|
+
id: e,
|
|
220
|
+
language: n.find((e) => !t.has(e.code))?.code ?? "",
|
|
221
|
+
name: "",
|
|
222
|
+
description: ""
|
|
223
|
+
}), De = ({ 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" }) => {
|
|
224
|
+
let { summaryLabel: l, addLabel: u, editLabel: d, popupTitle: p, addLocaleLabel: h, localeRowLabel: y = "Locale", languageLabel: x, nameLabel: S, namePlaceholder: C, descriptionLabel: w, descriptionPlaceholder: E, deleteAriaLabel: O, cancelLabel: ee = "Cancel", saveLabel: A = "Save" } = i, [ne, j] = H(!1), [P, L] = H([]), re = V(0);
|
|
225
|
+
pe(() => {
|
|
226
|
+
ne && L(e.length > 0 ? e : [W(`locale-row-${++re.current}`, /* @__PURE__ */ new Set(), n)]);
|
|
227
|
+
}, [
|
|
228
|
+
ne,
|
|
229
|
+
e,
|
|
230
|
+
n
|
|
231
|
+
]);
|
|
232
|
+
let ie = () => j(!0), ae = () => j(!1), oe = () => {
|
|
233
|
+
t(P.filter((e) => e.language && e.name)), j(!1);
|
|
234
|
+
}, se = () => {
|
|
235
|
+
let e = new Set(P.map((e) => e.language).filter(Boolean));
|
|
236
|
+
L((t) => [...t, W(`locale-row-${++re.current}`, e, n)]);
|
|
237
|
+
}, ue = (e, t) => {
|
|
238
|
+
L((n) => n.map((n) => n.id === e ? {
|
|
239
|
+
...n,
|
|
240
|
+
...t
|
|
241
|
+
} : n));
|
|
242
|
+
}, de = (e) => {
|
|
243
|
+
L((t) => t.filter((t) => t.id !== e));
|
|
244
|
+
}, R = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), fe = P.some((e) => !e.language || !e.name);
|
|
245
|
+
return n.length === 0 ? null : /* @__PURE__ */ I("div", {
|
|
246
|
+
className: c("flex items-center gap-2", a),
|
|
247
|
+
children: [
|
|
248
|
+
e.length > 0 && /* @__PURE__ */ F("span", {
|
|
249
|
+
className: o,
|
|
250
|
+
children: `${l}: ${e.map((e) => `[${R(e.language)}]`).join(", ")}`
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ F(D, {
|
|
253
|
+
label: e.length > 0 ? d : u,
|
|
254
|
+
iconBefore: /* @__PURE__ */ F(ce, {
|
|
255
|
+
size: g.SM,
|
|
256
|
+
"aria-hidden": !0,
|
|
257
|
+
stroke: _
|
|
258
|
+
}),
|
|
259
|
+
className: "!px-0",
|
|
260
|
+
onClick: ie
|
|
70
261
|
}),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
262
|
+
/* @__PURE__ */ F(k, {
|
|
263
|
+
open: ne,
|
|
264
|
+
header: p,
|
|
265
|
+
onClose: ae,
|
|
266
|
+
mainButtons: [{
|
|
267
|
+
label: ee,
|
|
268
|
+
onClick: ae
|
|
269
|
+
}, {
|
|
270
|
+
label: A,
|
|
271
|
+
variant: m.Primary,
|
|
272
|
+
disabled: fe,
|
|
273
|
+
onClick: oe
|
|
274
|
+
}],
|
|
275
|
+
children: /* @__PURE__ */ I("div", {
|
|
276
|
+
className: "flex flex-col gap-8 px-6 py-3",
|
|
277
|
+
children: [P.map((e, t) => {
|
|
278
|
+
let i = new Set(P.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
|
|
279
|
+
return /* @__PURE__ */ I("div", {
|
|
280
|
+
className: "flex flex-col gap-2",
|
|
281
|
+
children: [/* @__PURE__ */ I("div", {
|
|
282
|
+
className: "flex items-center justify-between",
|
|
283
|
+
children: [/* @__PURE__ */ I("span", {
|
|
284
|
+
className: s,
|
|
285
|
+
children: [
|
|
286
|
+
y,
|
|
287
|
+
" ",
|
|
288
|
+
t + 1
|
|
289
|
+
]
|
|
290
|
+
}), /* @__PURE__ */ F(v, {
|
|
291
|
+
appearance: f.Ghost,
|
|
292
|
+
size: b.Small,
|
|
293
|
+
icon: /* @__PURE__ */ F(le, {
|
|
294
|
+
size: g.SM,
|
|
295
|
+
"aria-hidden": !0,
|
|
296
|
+
stroke: _
|
|
297
|
+
}),
|
|
298
|
+
"aria-label": `${O} ${t + 1}`,
|
|
299
|
+
onClick: () => de(e.id)
|
|
300
|
+
})]
|
|
301
|
+
}), /* @__PURE__ */ I("div", {
|
|
302
|
+
role: "group",
|
|
303
|
+
"aria-label": `${y} ${t + 1}`,
|
|
304
|
+
className: "flex flex-col gap-5",
|
|
305
|
+
children: [/* @__PURE__ */ I("div", {
|
|
306
|
+
className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
|
|
307
|
+
children: [/* @__PURE__ */ F(te, {
|
|
308
|
+
id: `${e.id}-language`,
|
|
309
|
+
labelProps: {
|
|
310
|
+
label: x,
|
|
311
|
+
required: !0
|
|
312
|
+
},
|
|
313
|
+
className: "desktop:shrink-0 desktop:basis-40",
|
|
314
|
+
options: n.map((e) => ({
|
|
315
|
+
value: e.code,
|
|
316
|
+
label: e.label,
|
|
317
|
+
disabled: i.has(e.code)
|
|
318
|
+
})),
|
|
319
|
+
value: e.language,
|
|
320
|
+
onChange: (t) => ue(e.id, { language: t })
|
|
321
|
+
}), /* @__PURE__ */ F(T, {
|
|
322
|
+
id: `${e.id}-name`,
|
|
323
|
+
containerClassName: "min-w-0 flex-1",
|
|
324
|
+
required: !0,
|
|
325
|
+
value: e.name,
|
|
326
|
+
onChange: (t) => ue(e.id, { name: t ?? "" }),
|
|
327
|
+
labelProps: {
|
|
328
|
+
label: S,
|
|
329
|
+
required: !0
|
|
330
|
+
},
|
|
331
|
+
placeholder: C
|
|
332
|
+
})]
|
|
333
|
+
}), /* @__PURE__ */ F(M, {
|
|
334
|
+
id: `${e.id}-description`,
|
|
335
|
+
className: r,
|
|
336
|
+
resize: N.Vertical,
|
|
337
|
+
value: e.description,
|
|
338
|
+
onChange: (t) => ue(e.id, { description: t }),
|
|
339
|
+
labelProps: { label: w },
|
|
340
|
+
placeholder: E
|
|
341
|
+
})]
|
|
342
|
+
})]
|
|
343
|
+
}, e.id);
|
|
344
|
+
}), /* @__PURE__ */ F(D, {
|
|
345
|
+
label: h,
|
|
346
|
+
iconBefore: /* @__PURE__ */ F(ce, {
|
|
347
|
+
size: g.SM,
|
|
348
|
+
"aria-hidden": !0,
|
|
349
|
+
stroke: _
|
|
350
|
+
}),
|
|
351
|
+
className: "self-start",
|
|
352
|
+
onClick: se,
|
|
353
|
+
disabled: P.length >= n.length
|
|
354
|
+
})]
|
|
355
|
+
})
|
|
74
356
|
})
|
|
75
357
|
]
|
|
76
358
|
});
|
|
77
|
-
},
|
|
359
|
+
}, Oe = "Add tags, comma separated", G = "deployment-creation-form-description", ke = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = Ee, isNameReadOnly: m = !1, nameCaption: h, isDescriptionRequired: g = !1, renderDescription: _, focusRequestKey: v }) => {
|
|
360
|
+
let y = V(null), b = V(null), x = V(null), S = V(!1), C = (e) => p.includes(e), w = C(U.Name), E = C(U.Version), D = !!(t.name || t.version || t.description), O = V(v);
|
|
361
|
+
pe(() => {
|
|
362
|
+
let e = () => {
|
|
363
|
+
t.name ? y.current?.focus() : t.version ? b.current?.focus() : t.description && x.current?.focus();
|
|
364
|
+
};
|
|
365
|
+
if (v !== void 0) {
|
|
366
|
+
v !== O.current && (O.current = v, e());
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
D && !S.current && e(), S.current = D;
|
|
370
|
+
}, [
|
|
371
|
+
v,
|
|
372
|
+
D,
|
|
373
|
+
t.name,
|
|
374
|
+
t.version,
|
|
375
|
+
t.description
|
|
376
|
+
]);
|
|
377
|
+
let k = /* @__PURE__ */ F(M, {
|
|
378
|
+
id: G,
|
|
379
|
+
ref: x,
|
|
380
|
+
value: e.description,
|
|
381
|
+
onChange: (e) => n({ description: e }),
|
|
382
|
+
"aria-required": g || void 0,
|
|
383
|
+
labelProps: _ ? void 0 : {
|
|
384
|
+
label: u.description.label,
|
|
385
|
+
required: g
|
|
386
|
+
},
|
|
387
|
+
placeholder: u.description.placeholder,
|
|
388
|
+
error: t.description || void 0,
|
|
389
|
+
invalid: !!t.description,
|
|
390
|
+
containerClassName: _ ? void 0 : d?.field,
|
|
391
|
+
className: r,
|
|
392
|
+
resize: N.Vertical
|
|
393
|
+
});
|
|
394
|
+
return /* @__PURE__ */ I("div", {
|
|
395
|
+
role: u.ariaLabel ? "group" : void 0,
|
|
396
|
+
"aria-label": u.ariaLabel,
|
|
397
|
+
className: c("flex flex-col gap-4", d?.root),
|
|
398
|
+
children: [
|
|
399
|
+
C(U.Avatar) && /* @__PURE__ */ F(we, {
|
|
400
|
+
label: u.iconUrl.label,
|
|
401
|
+
avatarUrl: s,
|
|
402
|
+
addAvatarLabel: u.iconUrl.addAvatarLabel,
|
|
403
|
+
captionText: u.iconUrl.captionText,
|
|
404
|
+
onAddAvatarClick: l,
|
|
405
|
+
className: d?.field
|
|
406
|
+
}),
|
|
407
|
+
(w || E) && /* @__PURE__ */ I("div", {
|
|
408
|
+
className: c("flex items-start gap-4", d?.field),
|
|
409
|
+
children: [w && /* @__PURE__ */ F(T, {
|
|
410
|
+
id: "deployment-creation-form-name",
|
|
411
|
+
inputRef: y,
|
|
412
|
+
value: e.name,
|
|
413
|
+
onChange: (e) => n({ name: e ?? "" }),
|
|
414
|
+
onBlur: a,
|
|
415
|
+
readOnly: m,
|
|
416
|
+
labelProps: {
|
|
417
|
+
label: u.name.label,
|
|
418
|
+
required: !0
|
|
419
|
+
},
|
|
420
|
+
placeholder: u.name.placeholder,
|
|
421
|
+
caption: h,
|
|
422
|
+
error: t.name || void 0,
|
|
423
|
+
invalid: !!t.name,
|
|
424
|
+
containerClassName: E ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
|
|
425
|
+
}), E && /* @__PURE__ */ F(T, {
|
|
426
|
+
id: "deployment-creation-form-version",
|
|
427
|
+
inputRef: b,
|
|
428
|
+
value: e.version,
|
|
429
|
+
onChange: (e) => n({ version: e ?? "" }),
|
|
430
|
+
onBlur: o,
|
|
431
|
+
labelProps: { label: u.version.label },
|
|
432
|
+
placeholder: u.version.placeholder,
|
|
433
|
+
error: t.version || void 0,
|
|
434
|
+
invalid: !!t.version,
|
|
435
|
+
containerClassName: w ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
|
|
436
|
+
})]
|
|
437
|
+
}),
|
|
438
|
+
C(U.Description) && (_ ? /* @__PURE__ */ F("div", {
|
|
439
|
+
className: d?.field,
|
|
440
|
+
children: _(k, G)
|
|
441
|
+
}) : k),
|
|
442
|
+
C(U.Locales) && /* @__PURE__ */ F(De, {
|
|
443
|
+
value: e.otherLocales,
|
|
444
|
+
onChange: (e) => n({ otherLocales: e }),
|
|
445
|
+
availableLocaleOptions: f,
|
|
446
|
+
labels: u.otherLocales,
|
|
447
|
+
className: d?.field
|
|
448
|
+
}),
|
|
449
|
+
C(U.Tags) && /* @__PURE__ */ F("div", {
|
|
450
|
+
className: d?.field,
|
|
451
|
+
children: /* @__PURE__ */ F(j, {
|
|
452
|
+
id: "deployment-creation-form-topics",
|
|
453
|
+
labelProps: { label: u.topics.label },
|
|
454
|
+
placeholder: u.topics.placeholder ?? Oe,
|
|
455
|
+
value: e.topics,
|
|
456
|
+
onChange: (e) => n({ topics: e }),
|
|
457
|
+
tagClassName: i
|
|
458
|
+
})
|
|
459
|
+
})
|
|
460
|
+
]
|
|
461
|
+
});
|
|
462
|
+
}, Ae = "border-0 p-4 desktop:p-6", je = "desktop:flex-1", Me = "px-4 pt-4 desktop:px-6 desktop:pt-6", Ne = fe(({ 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, alert: h, metadataSectionClassName: g, setupSectionClassName: _, labels: v, styles: y, dir: b }) => {
|
|
463
|
+
let x = h == null ? null : /* @__PURE__ */ F("div", {
|
|
464
|
+
role: "alert",
|
|
465
|
+
className: Me,
|
|
466
|
+
children: h
|
|
467
|
+
}), S = p != null;
|
|
468
|
+
return /* @__PURE__ */ F(Se, {
|
|
469
|
+
title: e,
|
|
470
|
+
onBack: t,
|
|
471
|
+
backAriaLabel: v?.backAriaLabel ?? "Back",
|
|
472
|
+
isSaving: a,
|
|
473
|
+
labels: { savingStatusLabel: v?.savingStatusLabel ?? "Saving" },
|
|
474
|
+
styles: y?.layout,
|
|
475
|
+
dir: b,
|
|
476
|
+
actions: /* @__PURE__ */ I(P, { children: [s, !l && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(O, {
|
|
477
|
+
label: v?.cancelLabel ?? "Cancel",
|
|
478
|
+
disabled: a,
|
|
479
|
+
onClick: n
|
|
480
|
+
}), /* @__PURE__ */ F(A, {
|
|
481
|
+
label: i,
|
|
482
|
+
disabled: a || o,
|
|
483
|
+
onClick: r
|
|
484
|
+
})] })] }),
|
|
485
|
+
leftContent: /* @__PURE__ */ I(P, { children: [
|
|
486
|
+
!S && x,
|
|
487
|
+
/* @__PURE__ */ F(be, {
|
|
488
|
+
title: d === null ? void 0 : d ?? v?.metadataTitle ?? "Metadata",
|
|
489
|
+
styles: y?.section,
|
|
490
|
+
className: c(Ae, g, ve.metadataSection),
|
|
491
|
+
children: u
|
|
492
|
+
}),
|
|
493
|
+
f
|
|
494
|
+
] }),
|
|
495
|
+
rightContent: S ? /* @__PURE__ */ I(P, { children: [x, /* @__PURE__ */ F(be, {
|
|
496
|
+
title: m ?? v?.setupTitle ?? "Setup",
|
|
497
|
+
styles: y?.section,
|
|
498
|
+
className: c(Ae, je, _, ve.setupSection),
|
|
499
|
+
children: p
|
|
500
|
+
})] }) : void 0
|
|
501
|
+
});
|
|
502
|
+
}), Pe = {
|
|
503
|
+
name: {
|
|
504
|
+
label: "Name",
|
|
505
|
+
placeholder: "Enter name"
|
|
506
|
+
},
|
|
507
|
+
description: {
|
|
508
|
+
label: "Description",
|
|
509
|
+
placeholder: "Enter description"
|
|
510
|
+
},
|
|
511
|
+
iconUrl: {
|
|
512
|
+
label: "Avatar",
|
|
513
|
+
addAvatarLabel: "Add avatar",
|
|
514
|
+
captionText: "PNG, JPG or SVG (max 1 MB)"
|
|
515
|
+
},
|
|
516
|
+
version: {
|
|
517
|
+
label: "Version",
|
|
518
|
+
placeholder: "e.g. 1.0.0"
|
|
519
|
+
},
|
|
520
|
+
topics: {
|
|
521
|
+
label: "Tags",
|
|
522
|
+
placeholder: "Add tags, comma separated"
|
|
523
|
+
},
|
|
524
|
+
otherLocales: {
|
|
525
|
+
summaryLabel: "Locales",
|
|
526
|
+
addLabel: "Add locales",
|
|
527
|
+
editLabel: "Edit locales",
|
|
528
|
+
popupTitle: "Add locale",
|
|
529
|
+
addLocaleLabel: "Add locale",
|
|
530
|
+
localeRowLabel: "Locale",
|
|
531
|
+
languageLabel: "Language",
|
|
532
|
+
nameLabel: "Name",
|
|
533
|
+
namePlaceholder: "Enter name",
|
|
534
|
+
descriptionLabel: "About",
|
|
535
|
+
descriptionPlaceholder: "Enter brief description",
|
|
536
|
+
deleteAriaLabel: "Delete locale",
|
|
537
|
+
cancelLabel: "Cancel",
|
|
538
|
+
saveLabel: "Save"
|
|
539
|
+
},
|
|
540
|
+
ariaLabel: "Metadata"
|
|
541
|
+
}, Fe = {
|
|
542
|
+
title: "Add avatar",
|
|
543
|
+
attachLabel: "Attach",
|
|
544
|
+
emptyTitle: "This folder is empty",
|
|
545
|
+
emptyDescription: "",
|
|
546
|
+
errorMessage: "Failed to load files",
|
|
547
|
+
retryLabel: "Retry",
|
|
548
|
+
hiddenFilesLabel: "Hidden files",
|
|
549
|
+
showHiddenFilesLabel: "Show hidden files",
|
|
550
|
+
hideHiddenFilesLabel: "Hide hidden files",
|
|
551
|
+
getSelectionLabel: (e) => e === 1 ? "item selected" : "items selected",
|
|
552
|
+
uploadFilesLabel: "Files",
|
|
553
|
+
newFolderLabel: "Folder",
|
|
554
|
+
downloadLabel: "Download",
|
|
555
|
+
downloadingLabel: "Preparing download…",
|
|
556
|
+
deleteLabel: "Delete",
|
|
557
|
+
deletingLabel: "Deleting…",
|
|
558
|
+
deleteConfirmTitleSingle: "Confirm deleting",
|
|
559
|
+
deleteConfirmTitleMultiple: "Confirm deleting items",
|
|
560
|
+
deleteConfirmSingleText: "Are you sure you want to delete",
|
|
561
|
+
deleteConfirmMultipleText: "Do you want to delete following",
|
|
562
|
+
deleteConfirmItemsLabel: "items?",
|
|
563
|
+
deleteConfirmLabel: "Delete",
|
|
564
|
+
deleteCancelLabel: "Cancel"
|
|
565
|
+
}, Ie = fe(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Ee, isNameReadOnly: c, nameCaption: l, isDescriptionRequired: u, renderDescription: d, focusRequestKey: f, labels: p }) => {
|
|
566
|
+
let [m, h] = H(!1), g = B(() => a ? s : s.filter((e) => e !== U.Avatar), [a, s]), _ = e.iconUrl, v = a?.resolveIconUrl, y = B(() => v ? v(_) : void 0, [_, v]), b = z(() => h(!0), []), x = z(() => h(!1), []), S = a?.resolveAttachedIconUrl, C = z((e) => {
|
|
567
|
+
let t = S?.(e);
|
|
568
|
+
t && n({ iconUrl: t }), h(!1);
|
|
569
|
+
}, [n, S]);
|
|
570
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(ke, {
|
|
571
|
+
values: e,
|
|
572
|
+
errors: t,
|
|
573
|
+
onChange: n,
|
|
574
|
+
onNameBlur: r,
|
|
575
|
+
onVersionBlur: i,
|
|
576
|
+
iconPreviewUrl: y,
|
|
577
|
+
onAddAvatarClick: b,
|
|
578
|
+
labels: p?.form ?? Pe,
|
|
579
|
+
availableLocaleOptions: o,
|
|
580
|
+
fields: g,
|
|
581
|
+
isNameReadOnly: c,
|
|
582
|
+
nameCaption: l,
|
|
583
|
+
isDescriptionRequired: u,
|
|
584
|
+
renderDescription: d,
|
|
585
|
+
focusRequestKey: f
|
|
586
|
+
}), a && /* @__PURE__ */ F(Te, {
|
|
587
|
+
isOpen: m,
|
|
588
|
+
onClose: x,
|
|
589
|
+
onAttach: C,
|
|
590
|
+
bucket: a.bucket,
|
|
591
|
+
FileManagerModal: a.FileManagerModal,
|
|
592
|
+
allowedMimeTypes: a.allowedMimeTypes,
|
|
593
|
+
maxFileSizeBytes: a.maxFileSizeBytes,
|
|
594
|
+
labels: p?.avatarPicker ?? Fe
|
|
595
|
+
})] });
|
|
596
|
+
}), Le = /* @__PURE__ */ function(e) {
|
|
597
|
+
return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
|
|
598
|
+
}({});
|
|
599
|
+
new Set([Le.TooLong, Le.ControlCharacters]);
|
|
600
|
+
//#endregion
|
|
601
|
+
//#region src/constants/public-class-names.ts
|
|
602
|
+
var Re = {
|
|
78
603
|
root: "dial-skill-editor-root",
|
|
79
604
|
refineFeedback: "dial-skill-editor-refine-feedback"
|
|
80
|
-
},
|
|
605
|
+
}, K = "SKILL.md", q = /* @__PURE__ */ function(e) {
|
|
81
606
|
return e.File = "file", e.Folder = "folder", e;
|
|
82
|
-
}({}),
|
|
607
|
+
}({}), ze = /* @__PURE__ */ function(e) {
|
|
83
608
|
return e.Header = "header", e.Child = "child", e.Sibling = "sibling", e;
|
|
84
|
-
}({}),
|
|
609
|
+
}({}), J = (e) => {
|
|
85
610
|
let t = e.lastIndexOf("/");
|
|
86
611
|
return t === -1 ? null : e.slice(0, t);
|
|
87
|
-
},
|
|
612
|
+
}, Be = (e) => {
|
|
88
613
|
let t = e.lastIndexOf("/");
|
|
89
614
|
return t === -1 ? e : e.slice(t + 1);
|
|
90
|
-
},
|
|
615
|
+
}, Ve = (e) => {
|
|
91
616
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
92
617
|
let n = t.get(e);
|
|
93
618
|
if (n) return n;
|
|
94
619
|
let r = {
|
|
95
620
|
path: e,
|
|
96
|
-
name:
|
|
621
|
+
name: Be(e),
|
|
97
622
|
nodeType: he.FOLDER,
|
|
98
|
-
parentPath:
|
|
623
|
+
parentPath: J(e),
|
|
99
624
|
folderId: e,
|
|
100
625
|
items: []
|
|
101
626
|
};
|
|
102
627
|
return t.set(e, r), r;
|
|
103
628
|
};
|
|
104
629
|
for (let r of e) {
|
|
105
|
-
if (r.kind ===
|
|
630
|
+
if (r.kind === q.Folder) {
|
|
106
631
|
n(r.path).name = r.name;
|
|
107
632
|
continue;
|
|
108
633
|
}
|
|
@@ -110,13 +635,13 @@ var P = {
|
|
|
110
635
|
path: r.path,
|
|
111
636
|
name: r.name,
|
|
112
637
|
nodeType: he.ITEM,
|
|
113
|
-
parentPath:
|
|
114
|
-
folderId:
|
|
638
|
+
parentPath: J(r.path),
|
|
639
|
+
folderId: J(r.path) ?? ""
|
|
115
640
|
});
|
|
116
641
|
}
|
|
117
642
|
for (let t of [...e]) {
|
|
118
|
-
let e =
|
|
119
|
-
for (; e != null;) n(e), e =
|
|
643
|
+
let e = J(t.path);
|
|
644
|
+
for (; e != null;) n(e), e = J(e);
|
|
120
645
|
}
|
|
121
646
|
let r = [];
|
|
122
647
|
for (let e of t.values()) {
|
|
@@ -128,14 +653,14 @@ var P = {
|
|
|
128
653
|
n ? n.items = [...n.items ?? [], e] : r.push(e);
|
|
129
654
|
}
|
|
130
655
|
return r;
|
|
131
|
-
},
|
|
656
|
+
}, He = (e, t) => e ? `${e}/${t}` : t, Ue = (e) => J(e) ?? "", We = (e, t) => {
|
|
132
657
|
if (!t) return "";
|
|
133
658
|
switch (e) {
|
|
134
|
-
case
|
|
135
|
-
case
|
|
136
|
-
case
|
|
659
|
+
case ze.Child: return t.path;
|
|
660
|
+
case ze.Sibling: return Ue(t.path);
|
|
661
|
+
case ze.Header: return t.kind === q.Folder ? t.path : "";
|
|
137
662
|
}
|
|
138
|
-
},
|
|
663
|
+
}, Ge = (e, t) => {
|
|
139
664
|
let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
|
|
140
665
|
for (let { path: i } of e) {
|
|
141
666
|
if (!i.startsWith(n) || i === t) continue;
|
|
@@ -143,29 +668,29 @@ var P = {
|
|
|
143
668
|
r.add(e.split("/")[0]);
|
|
144
669
|
}
|
|
145
670
|
return r;
|
|
146
|
-
},
|
|
671
|
+
}, Ke = (e, t, n) => {
|
|
147
672
|
let r = e.trim();
|
|
148
673
|
if (!r) return n.required;
|
|
149
674
|
if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
|
|
150
675
|
if (t.has(r)) return n.duplicate;
|
|
151
|
-
},
|
|
152
|
-
let [o, s] =
|
|
676
|
+
}, qe = "\\new-folder", Je = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
|
|
677
|
+
let [o, s] = H(null), c = o?.parentPath ?? null, l = V([]), u = c == null ? void 0 : He(c, qe), d = B(() => u == null ? void 0 : {
|
|
153
678
|
path: u,
|
|
154
679
|
name: n,
|
|
155
|
-
kind:
|
|
156
|
-
}, [u, n]), f =
|
|
157
|
-
let a =
|
|
158
|
-
return i === "" && a.add(
|
|
680
|
+
kind: q.Folder
|
|
681
|
+
}, [u, n]), f = z((n, i) => {
|
|
682
|
+
let a = Ge(e, i);
|
|
683
|
+
return i === "" && a.add(K), Ke(n, a, r) ?? t.validateFolderPath?.(He(i, n.trim()));
|
|
159
684
|
}, [
|
|
160
685
|
e,
|
|
161
686
|
r,
|
|
162
687
|
t
|
|
163
|
-
]), p =
|
|
688
|
+
]), p = z((e, t) => {
|
|
164
689
|
l.current = [], s({
|
|
165
690
|
parentPath: e,
|
|
166
691
|
pane: t
|
|
167
692
|
}), e !== "" && i(e);
|
|
168
|
-
}, [i]), m =
|
|
693
|
+
}, [i]), m = z((e, t) => {
|
|
169
694
|
if (c == null || t.path !== u) return null;
|
|
170
695
|
let n = f(e, c);
|
|
171
696
|
return l.current = [...l.current.slice(-1), {
|
|
@@ -176,16 +701,16 @@ var P = {
|
|
|
176
701
|
c,
|
|
177
702
|
u,
|
|
178
703
|
f
|
|
179
|
-
]), h =
|
|
704
|
+
]), h = z(() => {
|
|
180
705
|
l.current = [], s(null);
|
|
181
|
-
}, []), g =
|
|
706
|
+
}, []), g = z((e) => {
|
|
182
707
|
if (c == null) return;
|
|
183
708
|
let [n] = l.current;
|
|
184
709
|
if (l.current.length === 2 && n != null && !n.isValid && n.value !== e || f(e, c) != null) {
|
|
185
710
|
h();
|
|
186
711
|
return;
|
|
187
712
|
}
|
|
188
|
-
let r =
|
|
713
|
+
let r = He(c, e.trim());
|
|
189
714
|
h(), t.onCreateFolder?.(r), a(r);
|
|
190
715
|
}, [
|
|
191
716
|
c,
|
|
@@ -203,711 +728,707 @@ var P = {
|
|
|
203
728
|
handleSave: g,
|
|
204
729
|
handleCancel: h
|
|
205
730
|
};
|
|
206
|
-
},
|
|
207
|
-
let [t, n] =
|
|
731
|
+
}, Ye = (e) => !!e.dataTransfer?.types.includes("Files"), Xe = (e) => {
|
|
732
|
+
let [t, n] = H(!1), r = V(0);
|
|
208
733
|
return {
|
|
209
734
|
isDragActive: t,
|
|
210
735
|
dropZoneHandlers: {
|
|
211
|
-
onDragEnter:
|
|
212
|
-
|
|
736
|
+
onDragEnter: z((e) => {
|
|
737
|
+
Ye(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
213
738
|
}, []),
|
|
214
|
-
onDragLeave:
|
|
215
|
-
|
|
739
|
+
onDragLeave: z((e) => {
|
|
740
|
+
Ye(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
216
741
|
}, []),
|
|
217
|
-
onDragOver:
|
|
218
|
-
|
|
742
|
+
onDragOver: z((e) => {
|
|
743
|
+
Ye(e) && e.preventDefault();
|
|
219
744
|
}, []),
|
|
220
|
-
onDrop:
|
|
221
|
-
if (!
|
|
745
|
+
onDrop: z((t) => {
|
|
746
|
+
if (!Ye(t)) return;
|
|
222
747
|
t.preventDefault(), r.current = 0, n(!1);
|
|
223
748
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
224
749
|
i.length > 0 && e(i);
|
|
225
750
|
}, [e])
|
|
226
751
|
}
|
|
227
752
|
};
|
|
228
|
-
},
|
|
753
|
+
}, Ze = /* @__PURE__ */ function(e) {
|
|
229
754
|
return e.Files = "files", e.Archive = "archive", e;
|
|
230
|
-
}({}),
|
|
755
|
+
}({}), Y = /* @__PURE__ */ function(e) {
|
|
231
756
|
return e.Mobile = "mobile", e.Desktop = "desktop", e;
|
|
232
|
-
}({}),
|
|
757
|
+
}({}), Qe = ({ isVisible: e, labels: t }) => {
|
|
233
758
|
if (!e) return null;
|
|
234
759
|
let n = t ?? {};
|
|
235
|
-
return /* @__PURE__ */
|
|
760
|
+
return /* @__PURE__ */ F("div", {
|
|
236
761
|
role: "status",
|
|
237
762
|
"aria-live": "polite",
|
|
238
|
-
className:
|
|
239
|
-
children: /* @__PURE__ */
|
|
763
|
+
className: c("pointer-events-none absolute inset-0 z-[100] flex items-center justify-center backdrop-blur-sm"),
|
|
764
|
+
children: /* @__PURE__ */ I("div", {
|
|
240
765
|
className: "flex flex-col items-center text-center",
|
|
241
766
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ F(ue, {
|
|
243
768
|
size: 100,
|
|
244
769
|
className: "text-accent-primary",
|
|
245
770
|
"aria-hidden": !0,
|
|
246
|
-
stroke:
|
|
771
|
+
stroke: _
|
|
247
772
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ F("span", {
|
|
249
774
|
className: "dial-h3-text mt-5",
|
|
250
775
|
children: n.dropOverlayTitle ?? "Upload files"
|
|
251
776
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ F("span", {
|
|
253
778
|
className: "dial-small-text mt-4",
|
|
254
779
|
children: n.dropOverlaySubtitle ?? "Drop files here to add them to this skill"
|
|
255
780
|
})
|
|
256
781
|
]
|
|
257
782
|
})
|
|
258
783
|
});
|
|
259
|
-
},
|
|
784
|
+
}, $e = /* @__PURE__ */ function(e) {
|
|
260
785
|
return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
|
|
261
|
-
}({}),
|
|
786
|
+
}({}), et = /* @__PURE__ */ function(e) {
|
|
262
787
|
return e.Valid = "valid", e.Invalid = "invalid", e;
|
|
263
|
-
}({}),
|
|
264
|
-
id:
|
|
788
|
+
}({}), tt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), nt = ".zip,application/zip", X = 0, rt = () => `skill-file-candidate-${++X}`, it = (e, t, n) => ({
|
|
789
|
+
id: rt(),
|
|
265
790
|
file: e,
|
|
266
|
-
path:
|
|
267
|
-
}),
|
|
268
|
-
let
|
|
269
|
-
|
|
270
|
-
},
|
|
791
|
+
path: He(n, t.replace(/\\/g, "/"))
|
|
792
|
+
}), at = ({ isOpen: e, onClose: t, fileActions: n, mode: r = Ze.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: o, labels: c }) => {
|
|
793
|
+
let l = c ?? {}, [u, d] = H([]), [p, h] = H(/* @__PURE__ */ new Map()), [g, v] = H([]), [y, b] = H(!1), [C, T] = H(), [E, D] = H(!1), [O, A] = H(), [te, j] = H(0), M = V(0), N = r === Ze.Archive, L = l.uploadArchiveErrorMessage ?? "Couldn't read this archive", re = me(), ae = (e) => {
|
|
794
|
+
T(void 0), d((t) => [...t, ...e]);
|
|
795
|
+
}, oe = async (e) => {
|
|
271
796
|
let { extractArchive: t } = n;
|
|
272
797
|
if (!t) return;
|
|
273
|
-
let r =
|
|
274
|
-
|
|
798
|
+
let r = M.current;
|
|
799
|
+
A(void 0), j((e) => e + 1);
|
|
275
800
|
try {
|
|
276
801
|
let n = await Promise.all(e.map((e) => t(e)));
|
|
277
|
-
if (r !==
|
|
278
|
-
let
|
|
279
|
-
if (
|
|
280
|
-
|
|
802
|
+
if (r !== M.current) return;
|
|
803
|
+
let a = n.flat();
|
|
804
|
+
if (a.length === 0) {
|
|
805
|
+
A(l.uploadArchiveEmptyMessage ?? "This archive has no files");
|
|
281
806
|
return;
|
|
282
807
|
}
|
|
283
|
-
|
|
808
|
+
ae(a.map((e) => it(e.file, e.path, i)));
|
|
284
809
|
} catch {
|
|
285
|
-
if (r !==
|
|
286
|
-
|
|
810
|
+
if (r !== M.current) return;
|
|
811
|
+
A(L);
|
|
287
812
|
} finally {
|
|
288
|
-
r ===
|
|
813
|
+
r === M.current && j((e) => e - 1);
|
|
289
814
|
}
|
|
290
|
-
},
|
|
291
|
-
if (
|
|
292
|
-
|
|
815
|
+
}, se = (e) => {
|
|
816
|
+
if (N) {
|
|
817
|
+
oe(e);
|
|
293
818
|
return;
|
|
294
819
|
}
|
|
295
|
-
|
|
296
|
-
},
|
|
297
|
-
|
|
820
|
+
ae(e.map((e) => it(e, tt(e), i)));
|
|
821
|
+
}, ce = (e) => {
|
|
822
|
+
d((t) => t.filter((t) => t.id !== e));
|
|
298
823
|
};
|
|
299
824
|
pe(() => {
|
|
300
|
-
e && (
|
|
825
|
+
e && (M.current += 1, d([...(a ?? []).map((e) => it(e, tt(e), i)), ...(o ?? []).map((e) => it(e.file, e.path, i))]), h(/* @__PURE__ */ new Map()), v([]), T(void 0), A(void 0), j(0));
|
|
301
826
|
}, [e]), pe(() => {
|
|
302
827
|
if (!e) return;
|
|
303
828
|
let t = !1;
|
|
304
|
-
if (
|
|
305
|
-
|
|
829
|
+
if (u.length === 0) {
|
|
830
|
+
h(/* @__PURE__ */ new Map()), v([]);
|
|
306
831
|
return;
|
|
307
832
|
}
|
|
308
|
-
return
|
|
309
|
-
t || (
|
|
833
|
+
return b(!0), n.validateBatch(u).then(({ results: e, batchErrors: n }) => {
|
|
834
|
+
t || (h(new Map(e.map((e) => [e.candidateId, e]))), v(n.map((e) => e.message)));
|
|
310
835
|
}).finally(() => {
|
|
311
|
-
t ||
|
|
836
|
+
t || b(!1);
|
|
312
837
|
}), () => {
|
|
313
838
|
t = !0;
|
|
314
839
|
};
|
|
315
|
-
}, [
|
|
316
|
-
let
|
|
317
|
-
|
|
840
|
+
}, [u, e]);
|
|
841
|
+
let ue = u.some((e) => p.get(e.id)?.status === et.Invalid), de = u.length > 0 && u.every((e) => p.get(e.id)?.status === et.Invalid), R = u.length > 0 && !ue && g.length === 0 && !y && !E && te === 0, fe = async () => {
|
|
842
|
+
D(!0), T(void 0);
|
|
318
843
|
try {
|
|
319
|
-
let { results: e, batchErrors: r } = await n.validateBatch(
|
|
320
|
-
if (
|
|
321
|
-
let a = await n.commitBatch(
|
|
844
|
+
let { results: e, batchErrors: r } = await n.validateBatch(u), i = new Map(e.map((e) => [e.candidateId, e]));
|
|
845
|
+
if (h(i), v(r.map((e) => e.message)), u.some((e) => i.get(e.id)?.status === et.Invalid) || r.length > 0) return;
|
|
846
|
+
let a = await n.commitBatch(u);
|
|
322
847
|
if (a.error) {
|
|
323
|
-
|
|
848
|
+
T(a.error);
|
|
324
849
|
return;
|
|
325
850
|
}
|
|
326
851
|
t();
|
|
327
852
|
} finally {
|
|
328
|
-
|
|
853
|
+
D(!1);
|
|
329
854
|
}
|
|
330
855
|
};
|
|
331
|
-
return /* @__PURE__ */
|
|
856
|
+
return /* @__PURE__ */ F(k, {
|
|
332
857
|
open: e,
|
|
333
|
-
header:
|
|
334
|
-
size:
|
|
335
|
-
closeAriaLabel:
|
|
858
|
+
header: N ? l.uploadArchiveDialogTitle ?? "Upload archive from device" : l.uploadDialogTitle ?? "Upload files from device",
|
|
859
|
+
size: ee.Sm,
|
|
860
|
+
closeAriaLabel: l.uploadDialogCloseAriaLabel ?? "Close",
|
|
336
861
|
onClose: t,
|
|
337
862
|
mainButtons: [{
|
|
338
|
-
label:
|
|
339
|
-
variant:
|
|
340
|
-
appearance:
|
|
863
|
+
label: l.uploadCancelLabel ?? "Cancel",
|
|
864
|
+
variant: m.Primary,
|
|
865
|
+
appearance: f.Ghost,
|
|
341
866
|
onClick: t
|
|
342
867
|
}, {
|
|
343
|
-
label:
|
|
344
|
-
variant:
|
|
345
|
-
iconBefore:
|
|
868
|
+
label: l.uploadConfirmLabel ?? "Add",
|
|
869
|
+
variant: m.Primary,
|
|
870
|
+
iconBefore: E ? /* @__PURE__ */ F(ne, {
|
|
346
871
|
size: 16,
|
|
347
872
|
ariaLabel: ""
|
|
348
873
|
}) : void 0,
|
|
349
|
-
onClick: () => void
|
|
350
|
-
disabled: !
|
|
874
|
+
onClick: () => void fe(),
|
|
875
|
+
disabled: !R
|
|
351
876
|
}],
|
|
352
|
-
children: /* @__PURE__ */
|
|
877
|
+
children: /* @__PURE__ */ I("div", {
|
|
353
878
|
className: "flex flex-col gap-4 px-6 py-4",
|
|
354
879
|
children: [
|
|
355
|
-
/* @__PURE__ */ S
|
|
356
|
-
label: /* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ F(S, {
|
|
881
|
+
label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
|
|
357
882
|
className: "desktop:hidden",
|
|
358
|
-
children:
|
|
359
|
-
}), /* @__PURE__ */
|
|
883
|
+
children: N ? l.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : l.uploadDropZoneMobileLabel ?? "Click here to upload"
|
|
884
|
+
}), /* @__PURE__ */ F("span", {
|
|
360
885
|
className: "hidden desktop:inline",
|
|
361
|
-
children:
|
|
886
|
+
children: N ? l.uploadArchiveDropZoneLabel ?? "Drag and drop a .zip archive or click here to upload" : l.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
|
|
362
887
|
})] }),
|
|
363
|
-
ariaLabel:
|
|
888
|
+
ariaLabel: l.uploadDropZoneAriaLabel ?? "Upload files",
|
|
364
889
|
multiple: !0,
|
|
365
|
-
accept:
|
|
366
|
-
className:
|
|
367
|
-
onChange:
|
|
368
|
-
onReject:
|
|
890
|
+
accept: N ? nt : void 0,
|
|
891
|
+
className: de ? "border-error hover:border-error" : void 0,
|
|
892
|
+
onChange: se,
|
|
893
|
+
onReject: N ? () => A(L) : void 0
|
|
369
894
|
}),
|
|
370
|
-
|
|
371
|
-
/* @__PURE__ */
|
|
895
|
+
te > 0 && /* @__PURE__ */ F(ne, { ariaLabel: l.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
|
|
896
|
+
/* @__PURE__ */ F("div", {
|
|
372
897
|
role: "alert",
|
|
373
|
-
children:
|
|
898
|
+
children: O && /* @__PURE__ */ F(x, { text: O })
|
|
374
899
|
}),
|
|
375
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ F("span", {
|
|
376
901
|
role: "status",
|
|
377
902
|
"aria-live": "polite",
|
|
378
903
|
className: "sr-only",
|
|
379
|
-
id:
|
|
380
|
-
children:
|
|
904
|
+
id: re,
|
|
905
|
+
children: g.map((e) => `${l.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
|
|
381
906
|
}),
|
|
382
|
-
|
|
383
|
-
|
|
907
|
+
g.map((e) => /* @__PURE__ */ F(x, { text: e }, e)),
|
|
908
|
+
u.length > 0 && /* @__PURE__ */ F("ul", {
|
|
384
909
|
className: "flex flex-col gap-2",
|
|
385
|
-
children:
|
|
386
|
-
let t =
|
|
387
|
-
return /* @__PURE__ */
|
|
910
|
+
children: u.map((e) => {
|
|
911
|
+
let t = p.get(e.id), n = t?.kind === $e.Manifest, r = t?.status === et.Invalid;
|
|
912
|
+
return /* @__PURE__ */ I("li", {
|
|
388
913
|
className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
|
|
389
914
|
children: [
|
|
390
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ F(ie, {
|
|
391
916
|
size: 20,
|
|
392
917
|
"aria-hidden": !0,
|
|
393
|
-
stroke:
|
|
918
|
+
stroke: _
|
|
394
919
|
}),
|
|
395
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ I("div", {
|
|
396
921
|
className: "flex min-w-0 flex-1 flex-col",
|
|
397
922
|
children: [
|
|
398
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ F("span", {
|
|
399
924
|
className: "dial-small-text truncate",
|
|
400
925
|
children: e.path
|
|
401
926
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ F("span", {
|
|
403
928
|
className: "dial-tiny-text text-secondary",
|
|
404
|
-
children:
|
|
929
|
+
children: s(e.file.size)
|
|
405
930
|
}),
|
|
406
|
-
r && t?.error && /* @__PURE__ */
|
|
407
|
-
n && !r && /* @__PURE__ */
|
|
931
|
+
r && t?.error && /* @__PURE__ */ F(x, { text: t.error }),
|
|
932
|
+
n && !r && /* @__PURE__ */ F("span", {
|
|
408
933
|
className: "dial-tiny-text text-secondary",
|
|
409
|
-
children:
|
|
934
|
+
children: l.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
|
|
410
935
|
})
|
|
411
936
|
]
|
|
412
937
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
icon: /* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ F(w, {
|
|
939
|
+
icon: /* @__PURE__ */ F(le, {
|
|
415
940
|
size: 16,
|
|
416
941
|
"aria-hidden": !0,
|
|
417
|
-
stroke:
|
|
942
|
+
stroke: _
|
|
418
943
|
}),
|
|
419
|
-
"aria-label":
|
|
420
|
-
onClick: () =>
|
|
944
|
+
"aria-label": l.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
|
|
945
|
+
onClick: () => ce(e.id)
|
|
421
946
|
})
|
|
422
947
|
]
|
|
423
948
|
}, e.id);
|
|
424
949
|
})
|
|
425
950
|
}),
|
|
426
|
-
|
|
951
|
+
C && /* @__PURE__ */ F(x, { text: C })
|
|
427
952
|
]
|
|
428
953
|
})
|
|
429
954
|
});
|
|
430
|
-
},
|
|
955
|
+
}, ot = {
|
|
431
956
|
title: "_title_1cnn4_1",
|
|
432
957
|
helperText: "_helperText_1cnn4_5",
|
|
433
958
|
refineFeedback: "_refineFeedback_1cnn4_9",
|
|
434
959
|
refineError: "_refineError_1cnn4_13"
|
|
435
|
-
},
|
|
436
|
-
mode:
|
|
960
|
+
}, st = {
|
|
961
|
+
mode: Ze.Files,
|
|
437
962
|
targetFolderPath: ""
|
|
438
|
-
},
|
|
439
|
-
let { MarkdownEditor: e } = await
|
|
963
|
+
}, ct = [U.Name, U.Description], lt = 24, ut = 300, dt = "desktop:px-8 desktop:py-6", ft = "gap-4 px-4 py-6 desktop:gap-5 desktop:px-8 desktop:py-6", pt = R(async () => {
|
|
964
|
+
let { MarkdownEditor: e } = await _e();
|
|
440
965
|
return { default: e };
|
|
441
|
-
}),
|
|
442
|
-
let [
|
|
443
|
-
name:
|
|
444
|
-
description:
|
|
445
|
-
instructions:
|
|
446
|
-
}),
|
|
966
|
+
}), mt = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: v, expandedPaths: S, onExpandedPathsChange: w, isLoading: T = !1, hasLoadError: D = !1, isSubmitting: O = !1, errors: k, submitError: ee, conflict: te, onReloadLatest: j, isNameReadOnly: M = !1, onDirtyChange: N, onValuesChange: L, onRefineDescription: ie, onRefineInstructions: se, fileActions: R, supportingFileContent: fe, onSubmit: _e, onCancel: ve, onBack: ye, backAriaLabel: be, title: xe, onRetry: Se, onRetrySubmit: Ce, labels: we, styles: Te, dir: U, instructionsEditorTheme: Ee = y.light }) => {
|
|
967
|
+
let [W, De] = H({
|
|
968
|
+
name: r?.name ?? "",
|
|
969
|
+
description: r?.description ?? "",
|
|
970
|
+
instructions: r?.instructions ?? ""
|
|
971
|
+
}), Oe = me(), G = V(void 0), ke = l({
|
|
972
|
+
bottomGap: lt,
|
|
973
|
+
minHeight: ut
|
|
974
|
+
}), Ae = V(W), je = (e) => {
|
|
447
975
|
let t = {
|
|
448
|
-
...
|
|
976
|
+
...Ae.current,
|
|
449
977
|
...e
|
|
450
978
|
};
|
|
451
|
-
|
|
452
|
-
},
|
|
453
|
-
if (
|
|
454
|
-
|
|
979
|
+
Ae.current = t, De(t), L?.(t);
|
|
980
|
+
}, Me = (e) => e ? async (t, n) => {
|
|
981
|
+
if (G.current && !G.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
982
|
+
G.current = n;
|
|
455
983
|
try {
|
|
456
984
|
return await e(t, n);
|
|
457
985
|
} finally {
|
|
458
|
-
|
|
986
|
+
G.current === n && (G.current = void 0);
|
|
459
987
|
}
|
|
460
|
-
} : void 0,
|
|
461
|
-
value:
|
|
462
|
-
onChange: (e) =>
|
|
463
|
-
onRefine:
|
|
464
|
-
disabled:
|
|
465
|
-
resetKey:
|
|
466
|
-
}),
|
|
467
|
-
value:
|
|
468
|
-
onChange: (e) =>
|
|
469
|
-
onRefine:
|
|
470
|
-
disabled:
|
|
471
|
-
resetKey:
|
|
472
|
-
}),
|
|
473
|
-
|
|
474
|
-
},
|
|
475
|
-
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
},
|
|
479
|
-
|
|
480
|
-
},
|
|
988
|
+
} : void 0, Fe = u({
|
|
989
|
+
value: W.description,
|
|
990
|
+
onChange: (e) => je({ description: e }),
|
|
991
|
+
onRefine: Me(ie),
|
|
992
|
+
disabled: O || T || D,
|
|
993
|
+
resetKey: r
|
|
994
|
+
}), Le = u({
|
|
995
|
+
value: W.instructions,
|
|
996
|
+
onChange: (e) => je({ instructions: e }),
|
|
997
|
+
onRefine: Me(se),
|
|
998
|
+
disabled: O || T || D,
|
|
999
|
+
resetKey: r
|
|
1000
|
+
}), J = Fe.isPending || Le.isPending, Be = () => {
|
|
1001
|
+
Fe.reset(), Le.reset();
|
|
1002
|
+
}, He = () => {
|
|
1003
|
+
Be(), ve();
|
|
1004
|
+
}, Ue = () => {
|
|
1005
|
+
Be(), ye();
|
|
1006
|
+
}, Ge = () => {
|
|
1007
|
+
O || T || D || G.current && !G.current.aborted || _e(W);
|
|
1008
|
+
}, Ke = V(r), qe = Ke.current !== r, Ye = V(i);
|
|
481
1009
|
pe(() => {
|
|
482
|
-
|
|
1010
|
+
Ke.current = r;
|
|
483
1011
|
let e = {
|
|
484
|
-
name:
|
|
485
|
-
description:
|
|
486
|
-
instructions:
|
|
1012
|
+
name: r?.name ?? "",
|
|
1013
|
+
description: r?.description ?? "",
|
|
1014
|
+
instructions: r?.instructions ?? ""
|
|
487
1015
|
};
|
|
488
|
-
|
|
489
|
-
}, [
|
|
490
|
-
let
|
|
1016
|
+
Ae.current = e, De(e), Ye.current = i;
|
|
1017
|
+
}, [r]);
|
|
1018
|
+
let $e = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), et = V(!1);
|
|
491
1019
|
pe(() => {
|
|
492
|
-
if (
|
|
1020
|
+
if (qe) return;
|
|
493
1021
|
let e = {
|
|
494
|
-
name:
|
|
495
|
-
description:
|
|
496
|
-
instructions:
|
|
497
|
-
}, t = JSON.stringify(
|
|
498
|
-
t !==
|
|
1022
|
+
name: r?.name ?? "",
|
|
1023
|
+
description: r?.description ?? "",
|
|
1024
|
+
instructions: r?.instructions ?? ""
|
|
1025
|
+
}, t = JSON.stringify(W) !== JSON.stringify(e) || $e(i) !== $e(Ye.current);
|
|
1026
|
+
t !== et.current && (et.current = t, N?.(t));
|
|
499
1027
|
}, [
|
|
500
|
-
|
|
501
|
-
v,
|
|
1028
|
+
W,
|
|
502
1029
|
i,
|
|
503
|
-
|
|
504
|
-
|
|
1030
|
+
r,
|
|
1031
|
+
qe,
|
|
1032
|
+
N
|
|
505
1033
|
]);
|
|
506
|
-
let [
|
|
507
|
-
|
|
508
|
-
}, [
|
|
1034
|
+
let [tt, nt] = H(K), X = s ?? tt, rt = z((e) => {
|
|
1035
|
+
nt(e), v?.(e);
|
|
1036
|
+
}, [v]), [it, mt] = H([]), ht = S ?? it, gt = B(() => new Set(ht), [ht]), _t = z((e) => {
|
|
509
1037
|
let t = [...e];
|
|
510
|
-
|
|
511
|
-
}, [w]), [
|
|
512
|
-
|
|
513
|
-
}, []), [
|
|
514
|
-
|
|
515
|
-
...
|
|
1038
|
+
mt(t), w?.(t);
|
|
1039
|
+
}, [w]), [vt, yt] = H(!1), [bt, xt] = H(st), Z = z((e) => {
|
|
1040
|
+
xt(e), yt(!0);
|
|
1041
|
+
}, []), [St, Ct] = H(!1), { isDragActive: wt, dropZoneHandlers: Tt } = Xe(z((e) => {
|
|
1042
|
+
vt || Z({
|
|
1043
|
+
...st,
|
|
516
1044
|
initialFiles: e
|
|
517
1045
|
});
|
|
518
|
-
}, [
|
|
519
|
-
"--se-title-color":
|
|
520
|
-
"--se-helper-text-color":
|
|
521
|
-
"--se-refine-action-text":
|
|
522
|
-
"--se-refine-error-text":
|
|
523
|
-
}),
|
|
524
|
-
feedbackClassName:
|
|
525
|
-
errorClassName:
|
|
526
|
-
},
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
1046
|
+
}, [vt, Z])), Q = we ?? {}, $ = Te?.colors, Et = Te?.typography ?? {}, Dt = Et.titleClassName ?? "dial-body-semi-text", Ot = Et.helperTextClassName ?? "dial-tiny-semi-text", kt = Et.removeIconClassName ?? "text-secondary", At = Et.menuIconClassName ?? "text-secondary", jt = o({
|
|
1047
|
+
"--se-title-color": $?.title,
|
|
1048
|
+
"--se-helper-text-color": $?.helperText,
|
|
1049
|
+
"--se-refine-action-text": $?.refineActionText,
|
|
1050
|
+
"--se-refine-error-text": $?.refineErrorText
|
|
1051
|
+
}), Mt = {
|
|
1052
|
+
feedbackClassName: c(ot.refineFeedback, Et.refineFeedbackClassName ?? "dial-small-text", Re.refineFeedback),
|
|
1053
|
+
errorClassName: ot.refineError
|
|
1054
|
+
}, Nt = {
|
|
1055
|
+
layout: $?.border ? { colors: {
|
|
1056
|
+
headerBorderColor: $.border,
|
|
1057
|
+
sidebarBorderColor: $.border
|
|
1058
|
+
} } : void 0,
|
|
1059
|
+
section: $?.title ? { colors: { titleColor: $.title } } : void 0
|
|
1060
|
+
}, Pt = B(() => ({
|
|
1061
|
+
required: Q.folderNameRequiredError ?? "Enter a folder name",
|
|
1062
|
+
invalid: Q.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
|
|
1063
|
+
duplicate: Q.folderNameDuplicateError ?? "An item with this name already exists here"
|
|
533
1064
|
}), [
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
]),
|
|
538
|
-
|
|
539
|
-
}, [
|
|
540
|
-
files:
|
|
541
|
-
fileActions:
|
|
542
|
-
defaultName:
|
|
543
|
-
messages:
|
|
544
|
-
onRevealFolder:
|
|
545
|
-
onCreated:
|
|
546
|
-
}), { draftNode:
|
|
547
|
-
path:
|
|
548
|
-
name:
|
|
549
|
-
kind:
|
|
550
|
-
}, ...
|
|
1065
|
+
Q.folderNameRequiredError,
|
|
1066
|
+
Q.folderNameInvalidError,
|
|
1067
|
+
Q.folderNameDuplicateError
|
|
1068
|
+
]), Ft = z((e) => {
|
|
1069
|
+
gt.has(e) || _t(new Set([...gt, e]));
|
|
1070
|
+
}, [gt, _t]), It = Je({
|
|
1071
|
+
files: i,
|
|
1072
|
+
fileActions: R,
|
|
1073
|
+
defaultName: Q.newFolderDefaultName ?? "New folder",
|
|
1074
|
+
messages: Pt,
|
|
1075
|
+
onRevealFolder: Ft,
|
|
1076
|
+
onCreated: rt
|
|
1077
|
+
}), { draftNode: Lt, draftPath: Rt, draftPane: zt } = It, Bt = B(() => Ve([{
|
|
1078
|
+
path: K,
|
|
1079
|
+
name: K,
|
|
1080
|
+
kind: q.File
|
|
1081
|
+
}, ...i]), [i]), Vt = B(() => Lt ? Ve([
|
|
551
1082
|
{
|
|
552
|
-
path:
|
|
553
|
-
name:
|
|
554
|
-
kind:
|
|
1083
|
+
path: K,
|
|
1084
|
+
name: K,
|
|
1085
|
+
kind: q.File
|
|
555
1086
|
},
|
|
556
|
-
...
|
|
557
|
-
Pt
|
|
558
|
-
]) : Lt, [
|
|
559
|
-
v,
|
|
560
|
-
Pt,
|
|
1087
|
+
...i,
|
|
561
1088
|
Lt
|
|
562
|
-
])
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
1089
|
+
]) : Bt, [
|
|
1090
|
+
i,
|
|
1091
|
+
Lt,
|
|
1092
|
+
Bt
|
|
1093
|
+
]), Ht = B(() => i.find((e) => e.path === X), [i, X]), Ut = z((e) => {
|
|
1094
|
+
e.path !== Rt && rt(e.path);
|
|
1095
|
+
}, [rt, Rt]), Wt = z((e) => {
|
|
1096
|
+
R.onRemoveNode(e), X === e && rt(K);
|
|
566
1097
|
}, [
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
]), { startDraft:
|
|
571
|
-
if (!
|
|
572
|
-
let t = await
|
|
573
|
-
t?.length &&
|
|
574
|
-
mode:
|
|
1098
|
+
R,
|
|
1099
|
+
X,
|
|
1100
|
+
rt
|
|
1101
|
+
]), { startDraft: Gt } = It, { onCreateFolder: Kt, extractArchive: qt, pickFromFileSystem: Jt } = R, Yt = z(async (e) => {
|
|
1102
|
+
if (!Jt) return;
|
|
1103
|
+
let t = await Jt();
|
|
1104
|
+
t?.length && Z({
|
|
1105
|
+
mode: Ze.Files,
|
|
575
1106
|
targetFolderPath: e,
|
|
576
1107
|
initialEntries: t
|
|
577
1108
|
});
|
|
578
|
-
}, [
|
|
579
|
-
let n = (e) => /* @__PURE__ */
|
|
580
|
-
size:
|
|
581
|
-
className:
|
|
1109
|
+
}, [Jt, Z]), Xt = z((e, t) => {
|
|
1110
|
+
let n = (e) => /* @__PURE__ */ F(e, {
|
|
1111
|
+
size: g.SM,
|
|
1112
|
+
className: At,
|
|
582
1113
|
"aria-hidden": !0,
|
|
583
|
-
stroke:
|
|
1114
|
+
stroke: _
|
|
584
1115
|
}), r = [];
|
|
585
|
-
return
|
|
1116
|
+
return Kt && r.push({
|
|
586
1117
|
key: "create-folder",
|
|
587
|
-
label:
|
|
588
|
-
icon: n(
|
|
589
|
-
onClick: () =>
|
|
1118
|
+
label: Q.createFolderLabel ?? "Create folder",
|
|
1119
|
+
icon: n(oe),
|
|
1120
|
+
onClick: () => Gt(e, t)
|
|
590
1121
|
}), r.push({
|
|
591
1122
|
key: "upload-files",
|
|
592
|
-
label:
|
|
593
|
-
icon: n(
|
|
594
|
-
onClick: () =>
|
|
595
|
-
mode:
|
|
1123
|
+
label: Q.uploadFilesLabel ?? Q.addUploadLabel ?? "Upload files from device",
|
|
1124
|
+
icon: n(ue),
|
|
1125
|
+
onClick: () => Z({
|
|
1126
|
+
mode: Ze.Files,
|
|
596
1127
|
targetFolderPath: e
|
|
597
1128
|
})
|
|
598
|
-
}),
|
|
1129
|
+
}), qt && r.push({
|
|
599
1130
|
key: "upload-archive",
|
|
600
|
-
label:
|
|
601
|
-
icon: n(
|
|
602
|
-
onClick: () =>
|
|
603
|
-
mode:
|
|
1131
|
+
label: Q.uploadArchiveLabel ?? "Upload archive from device",
|
|
1132
|
+
icon: n(ae),
|
|
1133
|
+
onClick: () => Z({
|
|
1134
|
+
mode: Ze.Archive,
|
|
604
1135
|
targetFolderPath: e
|
|
605
1136
|
})
|
|
606
|
-
}),
|
|
1137
|
+
}), Jt && r.push({
|
|
607
1138
|
key: "open-file-system",
|
|
608
|
-
label:
|
|
609
|
-
icon: n(
|
|
610
|
-
onClick: () => void
|
|
1139
|
+
label: Q.openFileSystemLabel ?? "Open DIAL file system",
|
|
1140
|
+
icon: n(re),
|
|
1141
|
+
onClick: () => void Yt(e)
|
|
611
1142
|
}), r;
|
|
612
1143
|
}, [
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
1144
|
+
At,
|
|
1145
|
+
Kt,
|
|
1146
|
+
qt,
|
|
1147
|
+
Jt,
|
|
1148
|
+
Q.createFolderLabel,
|
|
1149
|
+
Q.uploadFilesLabel,
|
|
1150
|
+
Q.addUploadLabel,
|
|
1151
|
+
Q.uploadArchiveLabel,
|
|
1152
|
+
Q.openFileSystemLabel,
|
|
616
1153
|
Gt,
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
X.openFileSystemLabel,
|
|
622
|
-
Ht,
|
|
623
|
-
Y,
|
|
624
|
-
Kt
|
|
625
|
-
]), qt = A(() => {
|
|
626
|
-
let e = Se(R.Header, v.find((e) => e.path === J));
|
|
1154
|
+
Z,
|
|
1155
|
+
Yt
|
|
1156
|
+
]), Zt = B(() => {
|
|
1157
|
+
let e = We(ze.Header, i.find((e) => e.path === X));
|
|
627
1158
|
return {
|
|
628
|
-
[
|
|
629
|
-
[
|
|
1159
|
+
[Y.Mobile]: Xt(e, Y.Mobile),
|
|
1160
|
+
[Y.Desktop]: Xt(e, Y.Desktop)
|
|
630
1161
|
};
|
|
631
1162
|
}, [
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
]),
|
|
636
|
-
if (e.path === "SKILL.md" || e.path ===
|
|
1163
|
+
Xt,
|
|
1164
|
+
i,
|
|
1165
|
+
X
|
|
1166
|
+
]), Qt = z((e, t) => {
|
|
1167
|
+
if (e.path === "SKILL.md" || e.path === Rt) return [];
|
|
637
1168
|
let n = {
|
|
638
1169
|
path: e.path,
|
|
639
1170
|
name: e.name,
|
|
640
|
-
kind: e.nodeType === he.FOLDER ?
|
|
1171
|
+
kind: e.nodeType === he.FOLDER ? q.Folder : q.File
|
|
641
1172
|
}, r = [];
|
|
642
|
-
return n.kind ===
|
|
1173
|
+
return n.kind === q.Folder && r.push({
|
|
643
1174
|
key: "add-child",
|
|
644
|
-
label:
|
|
645
|
-
children:
|
|
1175
|
+
label: Q.addChildLabel ?? "Add child",
|
|
1176
|
+
children: Xt(We(ze.Child, n), t)
|
|
646
1177
|
}), r.push({
|
|
647
1178
|
key: "add-sibling",
|
|
648
|
-
label:
|
|
649
|
-
children:
|
|
1179
|
+
label: Q.addSiblingLabel ?? "Add sibling",
|
|
1180
|
+
children: Xt(We(ze.Sibling, n), t)
|
|
650
1181
|
}, {
|
|
651
1182
|
key: "delete",
|
|
652
|
-
label:
|
|
653
|
-
icon: /* @__PURE__ */
|
|
654
|
-
size:
|
|
655
|
-
className:
|
|
1183
|
+
label: Q.deleteLabel ?? Q.removeLabel ?? "Delete",
|
|
1184
|
+
icon: /* @__PURE__ */ F(le, {
|
|
1185
|
+
size: g.SM,
|
|
1186
|
+
className: kt,
|
|
656
1187
|
"aria-hidden": !0,
|
|
657
|
-
stroke:
|
|
1188
|
+
stroke: _
|
|
658
1189
|
}),
|
|
659
|
-
onClick: () =>
|
|
1190
|
+
onClick: () => Wt(e.path)
|
|
660
1191
|
}), r;
|
|
661
1192
|
}, [
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
]),
|
|
671
|
-
[
|
|
672
|
-
[
|
|
673
|
-
}), [
|
|
1193
|
+
Rt,
|
|
1194
|
+
Q.addChildLabel,
|
|
1195
|
+
Q.addSiblingLabel,
|
|
1196
|
+
Q.deleteLabel,
|
|
1197
|
+
Q.removeLabel,
|
|
1198
|
+
kt,
|
|
1199
|
+
Xt,
|
|
1200
|
+
Wt
|
|
1201
|
+
]), $t = B(() => ({
|
|
1202
|
+
[Y.Mobile]: (e) => Qt(e, Y.Mobile),
|
|
1203
|
+
[Y.Desktop]: (e) => Qt(e, Y.Desktop)
|
|
1204
|
+
}), [Qt]), en = (e) => /* @__PURE__ */ I("div", {
|
|
674
1205
|
className: "flex flex-col gap-2 desktop:gap-5",
|
|
675
|
-
children: [/* @__PURE__ */
|
|
1206
|
+
children: [/* @__PURE__ */ I("div", {
|
|
676
1207
|
className: "flex items-center justify-between",
|
|
677
|
-
children: [/* @__PURE__ */
|
|
678
|
-
className:
|
|
679
|
-
children:
|
|
680
|
-
}), /* @__PURE__ */
|
|
681
|
-
label:
|
|
682
|
-
variant:
|
|
683
|
-
appearance:
|
|
684
|
-
size:
|
|
685
|
-
iconBefore: /* @__PURE__ */
|
|
686
|
-
size:
|
|
1208
|
+
children: [/* @__PURE__ */ F("span", {
|
|
1209
|
+
className: c(ot.title, Dt),
|
|
1210
|
+
children: Q.filesHeading ?? "Files"
|
|
1211
|
+
}), /* @__PURE__ */ F(p, {
|
|
1212
|
+
label: Q.addLabel ?? "Add",
|
|
1213
|
+
variant: m.Neutral,
|
|
1214
|
+
appearance: f.Solid,
|
|
1215
|
+
size: b.Small,
|
|
1216
|
+
iconBefore: /* @__PURE__ */ F(ce, {
|
|
1217
|
+
size: g.SM,
|
|
687
1218
|
"aria-hidden": !0,
|
|
688
|
-
stroke:
|
|
1219
|
+
stroke: _
|
|
689
1220
|
}),
|
|
690
|
-
items:
|
|
1221
|
+
items: Zt[e]
|
|
691
1222
|
})]
|
|
692
|
-
}), /* @__PURE__ */
|
|
1223
|
+
}), /* @__PURE__ */ F("div", {
|
|
693
1224
|
role: "tree",
|
|
694
|
-
"aria-label":
|
|
695
|
-
children: /* @__PURE__ */
|
|
696
|
-
items:
|
|
1225
|
+
"aria-label": Q.filesTreeAriaLabel ?? "Skill files",
|
|
1226
|
+
children: /* @__PURE__ */ F(ge, {
|
|
1227
|
+
items: zt === e ? Vt : Bt,
|
|
697
1228
|
showFiles: !0,
|
|
698
|
-
selectedPath:
|
|
699
|
-
expandedPaths:
|
|
700
|
-
onExpandedPathsChange:
|
|
701
|
-
onItemClick:
|
|
702
|
-
getContextMenuItems:
|
|
703
|
-
renamedPath:
|
|
704
|
-
onRenameSave:
|
|
705
|
-
onRenameCancel:
|
|
706
|
-
onRenameValidate:
|
|
1229
|
+
selectedPath: X,
|
|
1230
|
+
expandedPaths: gt,
|
|
1231
|
+
onExpandedPathsChange: _t,
|
|
1232
|
+
onItemClick: Ut,
|
|
1233
|
+
getContextMenuItems: $t[e],
|
|
1234
|
+
renamedPath: zt === e ? Rt : void 0,
|
|
1235
|
+
onRenameSave: It.handleSave,
|
|
1236
|
+
onRenameCancel: It.handleCancel,
|
|
1237
|
+
onRenameValidate: It.handleValidate,
|
|
707
1238
|
rootItemPath: ""
|
|
708
1239
|
})
|
|
709
1240
|
})]
|
|
710
|
-
}),
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
1241
|
+
}), tn = B(() => ({
|
|
1242
|
+
name: W.name,
|
|
1243
|
+
description: W.description,
|
|
1244
|
+
iconUrl: "",
|
|
1245
|
+
version: "",
|
|
1246
|
+
topics: [],
|
|
1247
|
+
otherLocales: []
|
|
1248
|
+
}), [W.name, W.description]), nn = B(() => ({
|
|
1249
|
+
name: k?.name,
|
|
1250
|
+
description: k?.description
|
|
1251
|
+
}), [k?.name, k?.description]), rn = B(() => ({ form: {
|
|
1252
|
+
...Pe,
|
|
1253
|
+
name: {
|
|
1254
|
+
label: Q.nameLabel ?? "Name",
|
|
1255
|
+
placeholder: Q.namePlaceholder ?? "good-morning-breakfast"
|
|
1256
|
+
},
|
|
1257
|
+
description: {
|
|
1258
|
+
label: Q.descriptionLabel ?? "Description",
|
|
1259
|
+
placeholder: Q.descriptionPlaceholder ?? "What this skill does and when to use it"
|
|
1260
|
+
},
|
|
1261
|
+
ariaLabel: void 0
|
|
1262
|
+
} }), [
|
|
1263
|
+
Q.nameLabel,
|
|
1264
|
+
Q.namePlaceholder,
|
|
1265
|
+
Q.descriptionLabel,
|
|
1266
|
+
Q.descriptionPlaceholder
|
|
1267
|
+
]), an = (e) => {
|
|
1268
|
+
e.name !== void 0 && je({ name: e.name }), e.description !== void 0 && (Fe.reset(), je({ description: e.description }));
|
|
1269
|
+
}, on = ie ? (e, t) => /* @__PURE__ */ F(a, {
|
|
1270
|
+
isEnabled: !0,
|
|
1271
|
+
fieldId: t,
|
|
1272
|
+
required: !0,
|
|
1273
|
+
label: Q.descriptionLabel ?? "Description",
|
|
1274
|
+
labels: Q,
|
|
1275
|
+
refinement: Fe,
|
|
1276
|
+
disabled: J || O,
|
|
1277
|
+
...Mt,
|
|
1278
|
+
children: e
|
|
1279
|
+
}) : void 0, sn = {
|
|
1280
|
+
title: xe,
|
|
1281
|
+
onBack: Ue,
|
|
1282
|
+
onCancel: He,
|
|
1283
|
+
onSubmit: Ge,
|
|
1284
|
+
submitLabel: Q.createLabel ?? "Create",
|
|
1285
|
+
isSubmitDisabled: J || T || D,
|
|
1286
|
+
labels: {
|
|
1287
|
+
cancelLabel: Q.cancelLabel ?? "Cancel",
|
|
1288
|
+
backAriaLabel: be ?? "Back",
|
|
1289
|
+
savingStatusLabel: Q.savingStatusLabel ?? "Saving"
|
|
1290
|
+
},
|
|
1291
|
+
styles: Nt,
|
|
1292
|
+
metadataTitle: null
|
|
1293
|
+
};
|
|
1294
|
+
if (T) return /* @__PURE__ */ F("div", {
|
|
1295
|
+
dir: U,
|
|
725
1296
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
726
|
-
children: /* @__PURE__ */
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
backAriaLabel: Me,
|
|
730
|
-
actions: Zt,
|
|
731
|
-
isSaving: !1,
|
|
732
|
-
labels: { savingStatusLabel: X.savingStatusLabel },
|
|
733
|
-
styles: jt,
|
|
734
|
-
leftContent: /* @__PURE__ */ S("div", {
|
|
1297
|
+
children: /* @__PURE__ */ F(Ne, {
|
|
1298
|
+
...sn,
|
|
1299
|
+
metadata: /* @__PURE__ */ F("div", {
|
|
735
1300
|
role: "status",
|
|
736
|
-
"aria-label":
|
|
1301
|
+
"aria-label": Q.loadingAriaLabel ?? "Loading skill",
|
|
737
1302
|
className: "flex flex-1 items-center justify-center p-8",
|
|
738
|
-
children: /* @__PURE__ */
|
|
1303
|
+
children: /* @__PURE__ */ F(ne, {})
|
|
739
1304
|
})
|
|
740
1305
|
})
|
|
741
|
-
})
|
|
742
|
-
|
|
1306
|
+
});
|
|
1307
|
+
if (D) return /* @__PURE__ */ F("div", {
|
|
1308
|
+
dir: U,
|
|
743
1309
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
744
|
-
children: /* @__PURE__ */
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
backAriaLabel: Me,
|
|
748
|
-
actions: Zt,
|
|
749
|
-
isSaving: !1,
|
|
750
|
-
labels: { savingStatusLabel: X.savingStatusLabel },
|
|
751
|
-
styles: jt,
|
|
752
|
-
leftContent: /* @__PURE__ */ C("div", {
|
|
1310
|
+
children: /* @__PURE__ */ F(Ne, {
|
|
1311
|
+
...sn,
|
|
1312
|
+
metadata: /* @__PURE__ */ I("div", {
|
|
753
1313
|
role: "alert",
|
|
754
1314
|
className: "flex flex-col items-center gap-4 p-8",
|
|
755
|
-
children: [/* @__PURE__ */
|
|
756
|
-
label:
|
|
757
|
-
onClick:
|
|
1315
|
+
children: [/* @__PURE__ */ F(x, { text: Q.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ F(A, {
|
|
1316
|
+
label: Q.retryLabel ?? "Retry",
|
|
1317
|
+
onClick: Se
|
|
758
1318
|
})]
|
|
759
1319
|
})
|
|
760
1320
|
})
|
|
761
|
-
})
|
|
762
|
-
|
|
763
|
-
className:
|
|
764
|
-
|
|
765
|
-
|
|
1321
|
+
});
|
|
1322
|
+
let cn = X === K, ln = cn ? K : Q.selectedFileHeading?.(Ht?.name ?? X) ?? Ht?.name ?? X, un = ee != null || te != null ? /* @__PURE__ */ I("div", {
|
|
1323
|
+
className: "flex flex-col gap-2",
|
|
1324
|
+
children: [ee != null && /* @__PURE__ */ I("div", {
|
|
1325
|
+
className: "flex items-center gap-2",
|
|
1326
|
+
children: [/* @__PURE__ */ F(x, { text: ee }), Ce != null && /* @__PURE__ */ F(C, {
|
|
1327
|
+
label: Q.retryLabel ?? "Retry",
|
|
1328
|
+
onClick: Ce
|
|
1329
|
+
})]
|
|
1330
|
+
}), te != null && /* @__PURE__ */ I("div", {
|
|
1331
|
+
className: "flex items-center gap-2",
|
|
1332
|
+
children: [/* @__PURE__ */ F(x, { text: te.message }), /* @__PURE__ */ F(C, {
|
|
1333
|
+
label: Q.reloadLatestLabel ?? "Reload latest",
|
|
1334
|
+
onClick: j
|
|
1335
|
+
})]
|
|
1336
|
+
})]
|
|
1337
|
+
}) : void 0, dn = /* @__PURE__ */ F(a, {
|
|
1338
|
+
isEnabled: !!se,
|
|
1339
|
+
fieldId: Oe,
|
|
1340
|
+
required: !0,
|
|
1341
|
+
labelClassName: c(ot.helperText, Ot),
|
|
1342
|
+
label: Q.instructionsLabel ?? "Instructions",
|
|
1343
|
+
labels: Q,
|
|
1344
|
+
refinement: Le,
|
|
1345
|
+
disabled: J || O,
|
|
1346
|
+
...Mt,
|
|
1347
|
+
children: /* @__PURE__ */ I("div", {
|
|
1348
|
+
className: "flex flex-1 flex-col gap-2",
|
|
1349
|
+
children: [
|
|
1350
|
+
!se && /* @__PURE__ */ F(E, {
|
|
1351
|
+
htmlFor: Oe,
|
|
1352
|
+
className: c(ot.helperText, Ot),
|
|
1353
|
+
label: Q.instructionsLabel ?? "Instructions",
|
|
1354
|
+
required: !0
|
|
1355
|
+
}),
|
|
1356
|
+
/* @__PURE__ */ F("div", {
|
|
1357
|
+
ref: ke,
|
|
1358
|
+
className: c(t, e, n),
|
|
1359
|
+
children: /* @__PURE__ */ F(de, {
|
|
1360
|
+
fallback: /* @__PURE__ */ F(ne, { ariaLabel: Q.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
1361
|
+
children: /* @__PURE__ */ F(pt, {
|
|
1362
|
+
id: Oe,
|
|
1363
|
+
ariaLabel: Q.instructionsLabel ?? "Instructions",
|
|
1364
|
+
value: W.instructions,
|
|
1365
|
+
onChange: (e) => {
|
|
1366
|
+
Le.reset(), je({ instructions: e });
|
|
1367
|
+
},
|
|
1368
|
+
theme: Ee,
|
|
1369
|
+
placeholder: Q.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
|
|
1370
|
+
})
|
|
1371
|
+
})
|
|
1372
|
+
}),
|
|
1373
|
+
k?.instructions != null && /* @__PURE__ */ F(x, { text: k.instructions })
|
|
1374
|
+
]
|
|
1375
|
+
})
|
|
1376
|
+
});
|
|
1377
|
+
return /* @__PURE__ */ I("div", {
|
|
1378
|
+
dir: U,
|
|
1379
|
+
className: c("relative flex min-h-0 flex-1 flex-col", Re.root),
|
|
1380
|
+
style: jt,
|
|
1381
|
+
...Tt,
|
|
766
1382
|
children: [
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
isVisible:
|
|
769
|
-
labels:
|
|
1383
|
+
/* @__PURE__ */ F(Qe, {
|
|
1384
|
+
isVisible: wt && !vt,
|
|
1385
|
+
labels: we
|
|
770
1386
|
}),
|
|
771
|
-
/* @__PURE__ */
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
expanded: bt,
|
|
785
|
-
onToggle: xt,
|
|
786
|
-
ariaLabel: X.editingFileLabel ?? "Editing file",
|
|
787
|
-
children: Xt(U.Mobile)
|
|
1387
|
+
/* @__PURE__ */ F(Ne, {
|
|
1388
|
+
...sn,
|
|
1389
|
+
isSubmitting: O,
|
|
1390
|
+
metadataSectionClassName: dt,
|
|
1391
|
+
metadata: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
|
|
1392
|
+
className: "desktop:hidden",
|
|
1393
|
+
children: /* @__PURE__ */ F(d, {
|
|
1394
|
+
title: Q.editingFileLabel ?? "Editing file",
|
|
1395
|
+
description: Ht?.name ?? "SKILL.md",
|
|
1396
|
+
expanded: St,
|
|
1397
|
+
onToggle: Ct,
|
|
1398
|
+
ariaLabel: Q.editingFileLabel ?? "Editing file",
|
|
1399
|
+
children: en(Y.Mobile)
|
|
788
1400
|
})
|
|
789
|
-
}), /* @__PURE__ */
|
|
790
|
-
className: "hidden
|
|
791
|
-
children:
|
|
1401
|
+
}), /* @__PURE__ */ F("div", {
|
|
1402
|
+
className: "hidden desktop:block",
|
|
1403
|
+
children: en(Y.Desktop)
|
|
792
1404
|
})] }),
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
children: [/* @__PURE__ */ S(_, { text: z.message }), /* @__PURE__ */ S(y, {
|
|
808
|
-
label: X.reloadLatestLabel ?? "Reload latest",
|
|
809
|
-
onClick: ye
|
|
810
|
-
})]
|
|
811
|
-
}),
|
|
812
|
-
/* @__PURE__ */ S("h2", {
|
|
813
|
-
className: a(G.title, Tt),
|
|
814
|
-
children: J === "SKILL.md" ? I : X.selectedFileHeading?.(zt?.name ?? J) ?? zt?.name ?? J
|
|
815
|
-
}),
|
|
816
|
-
J === "SKILL.md" ? /* @__PURE__ */ C(se, { children: [
|
|
817
|
-
/* @__PURE__ */ S(te, {
|
|
818
|
-
labelProps: {
|
|
819
|
-
label: X.nameLabel ?? "Name",
|
|
820
|
-
required: !0
|
|
821
|
-
},
|
|
822
|
-
value: K.name,
|
|
823
|
-
onChange: (e) => Je({ name: e ?? "" }),
|
|
824
|
-
placeholder: X.namePlaceholder ?? "good-morning-breakfast",
|
|
825
|
-
caption: P?.name ? void 0 : X.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
|
|
826
|
-
error: P?.name,
|
|
827
|
-
invalid: !!P?.name,
|
|
828
|
-
disabled: B
|
|
829
|
-
}),
|
|
830
|
-
/* @__PURE__ */ S(n, {
|
|
831
|
-
isEnabled: !!we,
|
|
832
|
-
fieldId: We,
|
|
833
|
-
required: !0,
|
|
834
|
-
label: X.descriptionLabel ?? "Description",
|
|
835
|
-
labels: X,
|
|
836
|
-
refinement: Xe,
|
|
837
|
-
disabled: Qe || N,
|
|
838
|
-
...At,
|
|
839
|
-
children: /* @__PURE__ */ S(x, {
|
|
840
|
-
id: We,
|
|
841
|
-
"aria-required": !0,
|
|
842
|
-
labelProps: we ? void 0 : {
|
|
843
|
-
label: X.descriptionLabel ?? "Description",
|
|
844
|
-
required: !0
|
|
845
|
-
},
|
|
846
|
-
value: K.description,
|
|
847
|
-
placeholder: X.descriptionPlaceholder ?? "What this skill does and when to use it",
|
|
848
|
-
onChange: (e) => {
|
|
849
|
-
Xe.reset(), Je({ description: e });
|
|
850
|
-
},
|
|
851
|
-
error: P?.description,
|
|
852
|
-
invalid: !!P?.description
|
|
853
|
-
})
|
|
854
|
-
}),
|
|
855
|
-
/* @__PURE__ */ S(n, {
|
|
856
|
-
isEnabled: !!Te,
|
|
857
|
-
fieldId: Ge,
|
|
858
|
-
required: !0,
|
|
859
|
-
labelClassName: a(G.helperText, Et),
|
|
860
|
-
label: X.instructionsLabel ?? "Instructions",
|
|
861
|
-
labels: X,
|
|
862
|
-
refinement: Ze,
|
|
863
|
-
disabled: Qe || N,
|
|
864
|
-
...At,
|
|
865
|
-
children: /* @__PURE__ */ C("div", {
|
|
866
|
-
className: "flex flex-1 flex-col gap-2",
|
|
867
|
-
children: [
|
|
868
|
-
!Te && /* @__PURE__ */ S(ne, {
|
|
869
|
-
htmlFor: Ge,
|
|
870
|
-
className: a(G.helperText, Et),
|
|
871
|
-
label: X.instructionsLabel ?? "Instructions",
|
|
872
|
-
required: !0
|
|
873
|
-
}),
|
|
874
|
-
/* @__PURE__ */ S("div", {
|
|
875
|
-
ref: Ke,
|
|
876
|
-
className: a(e, t),
|
|
877
|
-
children: /* @__PURE__ */ S(D, {
|
|
878
|
-
fallback: /* @__PURE__ */ S(b, { ariaLabel: X.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
879
|
-
children: /* @__PURE__ */ S(Le, {
|
|
880
|
-
id: Ge,
|
|
881
|
-
ariaLabel: X.instructionsLabel ?? "Instructions",
|
|
882
|
-
value: K.instructions,
|
|
883
|
-
onChange: (e) => {
|
|
884
|
-
Ze.reset(), Je({ instructions: e });
|
|
885
|
-
},
|
|
886
|
-
theme: He,
|
|
887
|
-
placeholder: X.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
|
|
888
|
-
})
|
|
889
|
-
})
|
|
890
|
-
}),
|
|
891
|
-
P?.instructions != null && /* @__PURE__ */ S(_, { text: P.instructions })
|
|
892
|
-
]
|
|
893
|
-
})
|
|
894
|
-
})
|
|
895
|
-
] }) : zt?.kind === L.File && (ke ?? /* @__PURE__ */ S(f, { text: X.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." }))
|
|
896
|
-
]
|
|
897
|
-
})
|
|
1405
|
+
alert: un,
|
|
1406
|
+
setupTitle: ln,
|
|
1407
|
+
setupSectionClassName: ft,
|
|
1408
|
+
setup: cn ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Ie, {
|
|
1409
|
+
values: tn,
|
|
1410
|
+
errors: nn,
|
|
1411
|
+
onChange: an,
|
|
1412
|
+
fields: ct,
|
|
1413
|
+
isDescriptionRequired: !0,
|
|
1414
|
+
isNameReadOnly: M,
|
|
1415
|
+
nameCaption: k?.name ? void 0 : Q.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
|
|
1416
|
+
renderDescription: on,
|
|
1417
|
+
labels: rn
|
|
1418
|
+
}), dn] }) : /* @__PURE__ */ F(P, { children: Ht?.kind === q.File && (fe ?? /* @__PURE__ */ F(h, { text: Q.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." })) })
|
|
898
1419
|
}),
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
isOpen:
|
|
901
|
-
onClose: () =>
|
|
902
|
-
fileActions:
|
|
903
|
-
mode:
|
|
904
|
-
targetFolderPath:
|
|
905
|
-
initialFiles:
|
|
906
|
-
initialEntries:
|
|
907
|
-
labels:
|
|
1420
|
+
/* @__PURE__ */ F(at, {
|
|
1421
|
+
isOpen: vt,
|
|
1422
|
+
onClose: () => yt(!1),
|
|
1423
|
+
fileActions: R,
|
|
1424
|
+
mode: bt.mode,
|
|
1425
|
+
targetFolderPath: bt.targetFolderPath,
|
|
1426
|
+
initialFiles: bt.initialFiles,
|
|
1427
|
+
initialEntries: bt.initialEntries,
|
|
1428
|
+
labels: we
|
|
908
1429
|
})
|
|
909
1430
|
]
|
|
910
1431
|
});
|
|
911
1432
|
};
|
|
912
1433
|
//#endregion
|
|
913
|
-
export {
|
|
1434
|
+
export { Re as SKILL_EDITOR_CLASS, mt as SkillEditor, $e as SkillFileCandidateKind, q as SkillFileNodeKind, Ze as SkillFileUploadMode, et as SkillFileValidationStatus };
|