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