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