@epam/ai-dial-skill-editor 1.3.0-dev.14 → 1.3.0-dev.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/SkillEditor/SkillEditor.d.ts.map +1 -1
- package/index.css +3 -2
- package/index.js +570 -554
- package/models/skill-editor-props.d.ts +0 -2
- package/models/skill-editor-props.d.ts.map +1 -1
- package/package.json +5 -5
- package/types/skill-add-source.d.ts +1 -3
- package/types/skill-add-source.d.ts.map +1 -1
- package/utils/file-tree.d.ts +1 -4
- package/utils/file-tree.d.ts.map +1 -1
- package/utils/icon.d.ts +1 -1
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
|
|
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__ */
|
|
59
|
-
className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:
|
|
60
|
-
children: [/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ R("div", {
|
|
73
|
+
className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3", xe.headerBorder),
|
|
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,25 +176,25 @@ 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__ */
|
|
159
|
-
className: "break-
|
|
186
|
+
/* @__PURE__ */ R("span", {
|
|
187
|
+
className: "wrap-break-word text-primary",
|
|
160
188
|
children: [
|
|
161
189
|
"\"",
|
|
162
190
|
e[0].split("/").pop(),
|
|
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",
|
|
@@ -228,91 +256,91 @@ var ve = {
|
|
|
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
|
-
className: "
|
|
268
|
-
onClick:
|
|
295
|
+
className: "px-0!",
|
|
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,86 +353,83 @@ 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", ke = "deployment-creation-form-description",
|
|
368
|
-
let
|
|
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
|
-
t.name ?
|
|
399
|
+
t.name ? b.current?.focus() : t.version ? x.current?.focus() : t.description && S.current?.focus();
|
|
372
400
|
};
|
|
373
|
-
|
|
374
|
-
v !== O.current && (O.current = v, e());
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
D && !S.current && e(), S.current = D;
|
|
401
|
+
y === void 0 ? (O && !C.current && e(), C.current = O) : y !== k.current && (k.current = y, e());
|
|
378
402
|
}, [
|
|
379
|
-
|
|
380
|
-
|
|
403
|
+
y,
|
|
404
|
+
O,
|
|
381
405
|
t.name,
|
|
382
406
|
t.version,
|
|
383
407
|
t.description
|
|
384
408
|
]);
|
|
385
|
-
let
|
|
409
|
+
let A = /* @__PURE__ */ L(F, {
|
|
386
410
|
id: ke,
|
|
387
|
-
ref:
|
|
411
|
+
ref: S,
|
|
388
412
|
value: e.description,
|
|
389
413
|
onChange: (e) => n({ description: e }),
|
|
390
414
|
"aria-required": g || void 0,
|
|
391
|
-
labelProps:
|
|
415
|
+
labelProps: v ? void 0 : {
|
|
392
416
|
label: u.description.label,
|
|
393
417
|
required: g
|
|
394
418
|
},
|
|
395
419
|
placeholder: u.description.placeholder,
|
|
420
|
+
caption: _,
|
|
396
421
|
error: t.description || void 0,
|
|
397
422
|
invalid: !!t.description,
|
|
398
|
-
containerClassName:
|
|
423
|
+
containerClassName: v ? void 0 : d?.field,
|
|
399
424
|
className: r,
|
|
400
|
-
resize:
|
|
425
|
+
resize: te.Vertical
|
|
401
426
|
});
|
|
402
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ R("div", {
|
|
403
428
|
role: u.ariaLabel ? "group" : void 0,
|
|
404
429
|
"aria-label": u.ariaLabel,
|
|
405
430
|
className: c("flex flex-col gap-4", d?.root),
|
|
406
431
|
children: [
|
|
407
|
-
|
|
432
|
+
w(G.Avatar) && /* @__PURE__ */ L(we, {
|
|
408
433
|
label: u.iconUrl.label,
|
|
409
434
|
avatarUrl: s,
|
|
410
435
|
addAvatarLabel: u.iconUrl.addAvatarLabel,
|
|
@@ -412,11 +437,11 @@ var ve = {
|
|
|
412
437
|
onAddAvatarClick: l,
|
|
413
438
|
className: d?.field
|
|
414
439
|
}),
|
|
415
|
-
(
|
|
440
|
+
(E || D) && /* @__PURE__ */ R("div", {
|
|
416
441
|
className: c("flex items-start gap-4", d?.field),
|
|
417
|
-
children: [
|
|
442
|
+
children: [E && /* @__PURE__ */ L(T, {
|
|
418
443
|
id: "deployment-creation-form-name",
|
|
419
|
-
inputRef:
|
|
444
|
+
inputRef: b,
|
|
420
445
|
value: e.name,
|
|
421
446
|
onChange: (e) => n({ name: e ?? "" }),
|
|
422
447
|
onBlur: a,
|
|
@@ -429,10 +454,10 @@ var ve = {
|
|
|
429
454
|
caption: h,
|
|
430
455
|
error: t.name || void 0,
|
|
431
456
|
invalid: !!t.name,
|
|
432
|
-
containerClassName:
|
|
433
|
-
}),
|
|
457
|
+
containerClassName: D ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
|
|
458
|
+
}), D && /* @__PURE__ */ L(T, {
|
|
434
459
|
id: "deployment-creation-form-version",
|
|
435
|
-
inputRef:
|
|
460
|
+
inputRef: x,
|
|
436
461
|
value: e.version,
|
|
437
462
|
onChange: (e) => n({ version: e ?? "" }),
|
|
438
463
|
onBlur: o,
|
|
@@ -440,23 +465,23 @@ var ve = {
|
|
|
440
465
|
placeholder: u.version.placeholder,
|
|
441
466
|
error: t.version || void 0,
|
|
442
467
|
invalid: !!t.version,
|
|
443
|
-
containerClassName:
|
|
468
|
+
containerClassName: E ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
|
|
444
469
|
})]
|
|
445
470
|
}),
|
|
446
|
-
|
|
471
|
+
w(G.Description) && (v ? /* @__PURE__ */ L("div", {
|
|
447
472
|
className: d?.field,
|
|
448
|
-
children:
|
|
449
|
-
}) :
|
|
450
|
-
|
|
473
|
+
children: v(A, ke)
|
|
474
|
+
}) : A),
|
|
475
|
+
w(G.Locales) && /* @__PURE__ */ L(K, {
|
|
451
476
|
value: e.otherLocales,
|
|
452
477
|
onChange: (e) => n({ otherLocales: e }),
|
|
453
478
|
availableLocaleOptions: f,
|
|
454
479
|
labels: u.otherLocales,
|
|
455
480
|
className: d?.field
|
|
456
481
|
}),
|
|
457
|
-
|
|
482
|
+
w(G.Tags) && /* @__PURE__ */ L("div", {
|
|
458
483
|
className: d?.field,
|
|
459
|
-
children: /* @__PURE__ */
|
|
484
|
+
children: /* @__PURE__ */ L(P, {
|
|
460
485
|
id: "deployment-creation-form-topics",
|
|
461
486
|
labelProps: { label: u.topics.label },
|
|
462
487
|
placeholder: u.topics.placeholder ?? Oe,
|
|
@@ -467,53 +492,58 @@ var ve = {
|
|
|
467
492
|
})
|
|
468
493
|
]
|
|
469
494
|
});
|
|
470
|
-
},
|
|
471
|
-
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", {
|
|
472
497
|
role: "alert",
|
|
473
|
-
className:
|
|
498
|
+
className: Ne,
|
|
474
499
|
children: v
|
|
475
|
-
}),
|
|
476
|
-
return /* @__PURE__ */
|
|
500
|
+
}), E = p != null;
|
|
501
|
+
return /* @__PURE__ */ L(Se, {
|
|
477
502
|
title: e,
|
|
478
503
|
onBack: t,
|
|
479
|
-
backAriaLabel:
|
|
504
|
+
backAriaLabel: S?.backAriaLabel ?? "Back",
|
|
480
505
|
isSaving: a,
|
|
481
|
-
|
|
482
|
-
|
|
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, {
|
|
483
513
|
title: g,
|
|
484
|
-
styles:
|
|
485
|
-
className: c(
|
|
514
|
+
styles: C?.section,
|
|
515
|
+
className: c(je, _, _e.asideSection),
|
|
486
516
|
children: h
|
|
487
517
|
}),
|
|
488
|
-
styles:
|
|
489
|
-
dir:
|
|
490
|
-
actions: /* @__PURE__ */ I
|
|
491
|
-
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",
|
|
492
522
|
disabled: a,
|
|
493
523
|
onClick: n
|
|
494
|
-
}), /* @__PURE__ */
|
|
524
|
+
}), /* @__PURE__ */ L(j, {
|
|
495
525
|
label: i,
|
|
496
526
|
disabled: a || o,
|
|
497
527
|
onClick: r
|
|
498
528
|
})] })] }),
|
|
499
|
-
leftContent: /* @__PURE__ */ I
|
|
500
|
-
!
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
title: d === null ? void 0 : d ??
|
|
503
|
-
styles:
|
|
504
|
-
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),
|
|
505
535
|
children: u
|
|
506
536
|
}),
|
|
507
537
|
f
|
|
508
538
|
] }),
|
|
509
|
-
centerContent:
|
|
510
|
-
title: m === null ? void 0 : m ??
|
|
511
|
-
styles:
|
|
512
|
-
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),
|
|
513
543
|
children: p
|
|
514
544
|
})] }) : void 0
|
|
515
545
|
});
|
|
516
|
-
}),
|
|
546
|
+
}), Fe = {
|
|
517
547
|
name: {
|
|
518
548
|
label: "Name",
|
|
519
549
|
placeholder: "Enter name"
|
|
@@ -552,7 +582,7 @@ var ve = {
|
|
|
552
582
|
saveLabel: "Save"
|
|
553
583
|
},
|
|
554
584
|
ariaLabel: "Metadata"
|
|
555
|
-
},
|
|
585
|
+
}, Ie = {
|
|
556
586
|
title: "Add avatar",
|
|
557
587
|
attachLabel: "Attach",
|
|
558
588
|
emptyTitle: "This folder is empty",
|
|
@@ -576,86 +606,81 @@ var ve = {
|
|
|
576
606
|
deleteConfirmItemsLabel: "items?",
|
|
577
607
|
deleteConfirmLabel: "Delete",
|
|
578
608
|
deleteCancelLabel: "Cancel"
|
|
579
|
-
},
|
|
580
|
-
let [
|
|
581
|
-
let t =
|
|
582
|
-
t && n({ iconUrl: t }),
|
|
583
|
-
}, [n,
|
|
584
|
-
return /* @__PURE__ */ I
|
|
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) => {
|
|
611
|
+
let t = C?.(e);
|
|
612
|
+
t && n({ iconUrl: t }), g(!1);
|
|
613
|
+
}, [n, C]);
|
|
614
|
+
return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(Ae, {
|
|
585
615
|
values: e,
|
|
586
616
|
errors: t,
|
|
587
617
|
onChange: n,
|
|
588
618
|
onNameBlur: r,
|
|
589
619
|
onVersionBlur: i,
|
|
590
|
-
iconPreviewUrl:
|
|
591
|
-
onAddAvatarClick:
|
|
592
|
-
labels:
|
|
620
|
+
iconPreviewUrl: b,
|
|
621
|
+
onAddAvatarClick: x,
|
|
622
|
+
labels: m?.form ?? Fe,
|
|
593
623
|
availableLocaleOptions: o,
|
|
594
|
-
fields:
|
|
624
|
+
fields: _,
|
|
595
625
|
isNameReadOnly: c,
|
|
596
626
|
nameCaption: l,
|
|
597
627
|
isDescriptionRequired: u,
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
628
|
+
descriptionCaption: d,
|
|
629
|
+
renderDescription: f,
|
|
630
|
+
focusRequestKey: p
|
|
631
|
+
}), a && /* @__PURE__ */ L(Te, {
|
|
632
|
+
isOpen: h,
|
|
633
|
+
onClose: S,
|
|
634
|
+
onAttach: w,
|
|
604
635
|
bucket: a.bucket,
|
|
605
636
|
FileManagerModal: a.FileManagerModal,
|
|
606
637
|
allowedMimeTypes: a.allowedMimeTypes,
|
|
607
638
|
maxFileSizeBytes: a.maxFileSizeBytes,
|
|
608
|
-
labels:
|
|
639
|
+
labels: m?.avatarPicker ?? Ie
|
|
609
640
|
})] });
|
|
610
|
-
}),
|
|
641
|
+
}), Re = /* @__PURE__ */ function(e) {
|
|
611
642
|
return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
|
|
612
643
|
}({});
|
|
613
|
-
|
|
644
|
+
Re.TooLong, Re.ControlCharacters;
|
|
614
645
|
//#endregion
|
|
615
646
|
//#region src/constants/public-class-names.ts
|
|
616
|
-
var
|
|
647
|
+
var ze = {
|
|
617
648
|
root: "dial-skill-editor-root",
|
|
618
649
|
refineFeedback: "dial-skill-editor-refine-feedback"
|
|
619
|
-
},
|
|
650
|
+
}, q = "SKILL.md", J = /* @__PURE__ */ function(e) {
|
|
620
651
|
return e.File = "file", e.Folder = "folder", e;
|
|
621
|
-
}({}),
|
|
622
|
-
return e.Header = "header", e.Child = "child", e
|
|
623
|
-
}({}),
|
|
652
|
+
}({}), Be = /* @__PURE__ */ function(e) {
|
|
653
|
+
return e.Header = "header", e.Child = "child", e;
|
|
654
|
+
}({}), Ve = (e) => {
|
|
624
655
|
let t = e.lastIndexOf("/");
|
|
625
656
|
return t === -1 ? null : e.slice(0, t);
|
|
626
|
-
},
|
|
657
|
+
}, He = (e) => {
|
|
627
658
|
let t = e.lastIndexOf("/");
|
|
628
659
|
return t === -1 ? e : e.slice(t + 1);
|
|
629
|
-
},
|
|
660
|
+
}, Ue = (e) => {
|
|
630
661
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
631
662
|
let n = t.get(e);
|
|
632
663
|
if (n) return n;
|
|
633
664
|
let r = {
|
|
634
665
|
path: e,
|
|
635
|
-
name:
|
|
636
|
-
nodeType:
|
|
637
|
-
parentPath:
|
|
666
|
+
name: He(e),
|
|
667
|
+
nodeType: me.FOLDER,
|
|
668
|
+
parentPath: Ve(e),
|
|
638
669
|
folderId: e,
|
|
639
670
|
items: []
|
|
640
671
|
};
|
|
641
672
|
return t.set(e, r), r;
|
|
642
673
|
};
|
|
643
|
-
for (let r of e) {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
name: r.name,
|
|
651
|
-
nodeType: he.ITEM,
|
|
652
|
-
parentPath: J(r.path),
|
|
653
|
-
folderId: J(r.path) ?? ""
|
|
654
|
-
});
|
|
655
|
-
}
|
|
674
|
+
for (let r of e) r.kind === J.Folder ? n(r.path).name = r.name : t.set(r.path, {
|
|
675
|
+
path: r.path,
|
|
676
|
+
name: r.name,
|
|
677
|
+
nodeType: me.ITEM,
|
|
678
|
+
parentPath: Ve(r.path),
|
|
679
|
+
folderId: Ve(r.path) ?? ""
|
|
680
|
+
});
|
|
656
681
|
for (let t of [...e]) {
|
|
657
|
-
let e =
|
|
658
|
-
for (; e != null;) n(e), e =
|
|
682
|
+
let e = Ve(t.path);
|
|
683
|
+
for (; e != null;) n(e), e = Ve(e);
|
|
659
684
|
}
|
|
660
685
|
let r = [];
|
|
661
686
|
for (let e of t.values()) {
|
|
@@ -667,14 +692,13 @@ var Re = {
|
|
|
667
692
|
n ? n.items = [...n.items ?? [], e] : r.push(e);
|
|
668
693
|
}
|
|
669
694
|
return r;
|
|
670
|
-
},
|
|
695
|
+
}, We = (e, t) => e ? `${e}/${t}` : t, Ge = (e, t) => {
|
|
671
696
|
if (!t) return "";
|
|
672
697
|
switch (e) {
|
|
673
|
-
case
|
|
674
|
-
case
|
|
675
|
-
case ze.Header: return t.kind === q.Folder ? t.path : "";
|
|
698
|
+
case Be.Child: return t.path;
|
|
699
|
+
case Be.Header: return t.kind === J.Folder ? t.path : "";
|
|
676
700
|
}
|
|
677
|
-
},
|
|
701
|
+
}, Ke = (e, t) => {
|
|
678
702
|
let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
|
|
679
703
|
for (let { path: i } of e) {
|
|
680
704
|
if (!i.startsWith(n) || i === t) continue;
|
|
@@ -682,29 +706,29 @@ var Re = {
|
|
|
682
706
|
r.add(e.split("/")[0]);
|
|
683
707
|
}
|
|
684
708
|
return r;
|
|
685
|
-
},
|
|
709
|
+
}, qe = (e, t, n) => {
|
|
686
710
|
let r = e.trim();
|
|
687
711
|
if (!r) return n.required;
|
|
688
712
|
if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
|
|
689
713
|
if (t.has(r)) return n.duplicate;
|
|
690
|
-
},
|
|
691
|
-
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 : {
|
|
692
716
|
path: u,
|
|
693
717
|
name: n,
|
|
694
|
-
kind:
|
|
695
|
-
}, [u, n]), f =
|
|
696
|
-
let a =
|
|
697
|
-
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()));
|
|
698
722
|
}, [
|
|
699
723
|
e,
|
|
700
724
|
r,
|
|
701
725
|
t
|
|
702
|
-
]), p =
|
|
726
|
+
]), p = B((e, t) => {
|
|
703
727
|
l.current = [], s({
|
|
704
728
|
parentPath: e,
|
|
705
729
|
pane: t
|
|
706
730
|
}), e !== "" && i(e);
|
|
707
|
-
}, [i]), m =
|
|
731
|
+
}, [i]), m = B((e, t) => {
|
|
708
732
|
if (c == null || t.path !== u) return null;
|
|
709
733
|
let n = f(e, c);
|
|
710
734
|
return l.current = [...l.current.slice(-1), {
|
|
@@ -715,16 +739,16 @@ var Re = {
|
|
|
715
739
|
c,
|
|
716
740
|
u,
|
|
717
741
|
f
|
|
718
|
-
]), h =
|
|
742
|
+
]), h = B(() => {
|
|
719
743
|
l.current = [], s(null);
|
|
720
|
-
}, []), g =
|
|
744
|
+
}, []), g = B((e) => {
|
|
721
745
|
if (c == null) return;
|
|
722
746
|
let [n] = l.current;
|
|
723
747
|
if (l.current.length === 2 && n != null && !n.isValid && n.value !== e || f(e, c) != null) {
|
|
724
748
|
h();
|
|
725
749
|
return;
|
|
726
750
|
}
|
|
727
|
-
let r =
|
|
751
|
+
let r = We(c, e.trim());
|
|
728
752
|
h(), t.onCreateFolder?.(r), a(r);
|
|
729
753
|
}, [
|
|
730
754
|
c,
|
|
@@ -742,33 +766,33 @@ var Re = {
|
|
|
742
766
|
handleSave: g,
|
|
743
767
|
handleCancel: h
|
|
744
768
|
};
|
|
745
|
-
},
|
|
746
|
-
let [t, n] =
|
|
769
|
+
}, Xe = (e) => !!e.dataTransfer?.types.includes("Files"), Ze = (e) => {
|
|
770
|
+
let [t, n] = W(!1), r = U(0);
|
|
747
771
|
return {
|
|
748
772
|
isDragActive: t,
|
|
749
773
|
dropZoneHandlers: {
|
|
750
|
-
onDragEnter:
|
|
751
|
-
|
|
774
|
+
onDragEnter: B((e) => {
|
|
775
|
+
Xe(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
752
776
|
}, []),
|
|
753
|
-
onDragLeave:
|
|
754
|
-
|
|
777
|
+
onDragLeave: B((e) => {
|
|
778
|
+
Xe(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
755
779
|
}, []),
|
|
756
|
-
onDragOver:
|
|
757
|
-
|
|
780
|
+
onDragOver: B((e) => {
|
|
781
|
+
Xe(e) && e.preventDefault();
|
|
758
782
|
}, []),
|
|
759
|
-
onDrop:
|
|
760
|
-
if (!
|
|
783
|
+
onDrop: B((t) => {
|
|
784
|
+
if (!Xe(t)) return;
|
|
761
785
|
t.preventDefault(), r.current = 0, n(!1);
|
|
762
786
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
763
787
|
i.length > 0 && e(i);
|
|
764
788
|
}, [e])
|
|
765
789
|
}
|
|
766
790
|
};
|
|
767
|
-
},
|
|
791
|
+
}, Y = /* @__PURE__ */ function(e) {
|
|
768
792
|
return e.Files = "files", e.Archive = "archive", e;
|
|
769
|
-
}({}),
|
|
793
|
+
}({}), X = /* @__PURE__ */ function(e) {
|
|
770
794
|
return e.Mobile = "mobile", e.Desktop = "desktop", e;
|
|
771
|
-
}({}), Qe = (e, t, n = g.MD) => /* @__PURE__ */
|
|
795
|
+
}({}), Qe = (e, t, n = g.MD) => /* @__PURE__ */ L(e, {
|
|
772
796
|
size: n,
|
|
773
797
|
className: t,
|
|
774
798
|
"aria-hidden": !0,
|
|
@@ -776,24 +800,24 @@ var Re = {
|
|
|
776
800
|
}), $e = ({ isVisible: e, labels: t }) => {
|
|
777
801
|
if (!e) return null;
|
|
778
802
|
let n = t ?? {};
|
|
779
|
-
return /* @__PURE__ */
|
|
803
|
+
return /* @__PURE__ */ L("div", {
|
|
780
804
|
role: "status",
|
|
781
805
|
"aria-live": "polite",
|
|
782
806
|
className: c("pointer-events-none absolute inset-0 z-[100] flex items-center justify-center backdrop-blur-sm"),
|
|
783
|
-
children: /* @__PURE__ */
|
|
807
|
+
children: /* @__PURE__ */ R("div", {
|
|
784
808
|
className: "flex flex-col items-center text-center",
|
|
785
809
|
children: [
|
|
786
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ L(le, {
|
|
787
811
|
size: 100,
|
|
788
812
|
className: "text-accent-primary",
|
|
789
813
|
"aria-hidden": !0,
|
|
790
814
|
stroke: _
|
|
791
815
|
}),
|
|
792
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ L("span", {
|
|
793
817
|
className: "dial-h3-text mt-5",
|
|
794
818
|
children: n.dropOverlayTitle ?? "Upload files"
|
|
795
819
|
}),
|
|
796
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ L("span", {
|
|
797
821
|
className: "dial-small-text mt-4",
|
|
798
822
|
children: n.dropOverlaySubtitle ?? "Drop files here to add them to this skill"
|
|
799
823
|
})
|
|
@@ -804,52 +828,45 @@ var Re = {
|
|
|
804
828
|
return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
|
|
805
829
|
}({}), tt = /* @__PURE__ */ function(e) {
|
|
806
830
|
return e.Valid = "valid", e.Invalid = "invalid", e;
|
|
807
|
-
}({}), nt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"),
|
|
808
|
-
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(),
|
|
809
833
|
file: e,
|
|
810
|
-
path:
|
|
811
|
-
}),
|
|
812
|
-
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) => {
|
|
813
837
|
T(void 0), d((t) => [...t, ...e]);
|
|
814
|
-
},
|
|
838
|
+
}, ae = async (e) => {
|
|
815
839
|
let { extractArchive: t } = n;
|
|
816
840
|
if (!t) return;
|
|
817
|
-
let r =
|
|
818
|
-
|
|
841
|
+
let r = P.current;
|
|
842
|
+
j(void 0), ee((e) => e + 1);
|
|
819
843
|
try {
|
|
820
844
|
let n = await Promise.all(e.map((e) => t(e)));
|
|
821
|
-
if (r !==
|
|
845
|
+
if (r !== P.current) return;
|
|
822
846
|
let a = n.flat();
|
|
823
847
|
if (a.length === 0) {
|
|
824
|
-
|
|
848
|
+
j(l.uploadArchiveEmptyMessage ?? "This archive has no files");
|
|
825
849
|
return;
|
|
826
850
|
}
|
|
827
|
-
|
|
851
|
+
re(a.map((e) => at(e.file, e.path, i)));
|
|
828
852
|
} catch {
|
|
829
|
-
if (r !==
|
|
830
|
-
|
|
853
|
+
if (r !== P.current) return;
|
|
854
|
+
j(te);
|
|
831
855
|
} finally {
|
|
832
|
-
r ===
|
|
856
|
+
r === P.current && ee((e) => e - 1);
|
|
833
857
|
}
|
|
834
|
-
},
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
|
-
ae(e.map((e) => Z(e, nt(e), i)));
|
|
840
|
-
}, ce = (e) => {
|
|
858
|
+
}, oe = (e) => {
|
|
859
|
+
F ? ae(e) : re(e.map((e) => at(e, nt(e), i)));
|
|
860
|
+
}, z = (e) => {
|
|
841
861
|
d((t) => t.filter((t) => t.id !== e));
|
|
842
862
|
};
|
|
843
|
-
|
|
844
|
-
e && (
|
|
845
|
-
}, [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(() => {
|
|
846
866
|
if (!e) return;
|
|
847
867
|
let t = !1;
|
|
848
|
-
if (u.length === 0)
|
|
849
|
-
|
|
850
|
-
return;
|
|
851
|
-
}
|
|
852
|
-
return b(!0), n.validateBatch(u).then(({ results: e, batchErrors: n }) => {
|
|
868
|
+
if (u.length === 0) h(/* @__PURE__ */ new Map()), v([]);
|
|
869
|
+
else return b(!0), n.validateBatch(u).then(({ results: e, batchErrors: n }) => {
|
|
853
870
|
t || (h(new Map(e.map((e) => [e.candidateId, e]))), v(n.map((e) => e.message)));
|
|
854
871
|
}).finally(() => {
|
|
855
872
|
t || b(!1);
|
|
@@ -857,7 +874,7 @@ var Re = {
|
|
|
857
874
|
t = !0;
|
|
858
875
|
};
|
|
859
876
|
}, [u, e]);
|
|
860
|
-
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 () => {
|
|
861
878
|
D(!0), T(void 0);
|
|
862
879
|
try {
|
|
863
880
|
let { results: e, batchErrors: r } = await n.validateBatch(u), i = new Map(e.map((e) => [e.candidateId, e]));
|
|
@@ -872,10 +889,10 @@ var Re = {
|
|
|
872
889
|
D(!1);
|
|
873
890
|
}
|
|
874
891
|
};
|
|
875
|
-
return /* @__PURE__ */
|
|
892
|
+
return /* @__PURE__ */ L(k, {
|
|
876
893
|
open: e,
|
|
877
|
-
header:
|
|
878
|
-
size:
|
|
894
|
+
header: F ? l.uploadArchiveDialogTitle ?? "Upload archive from device" : l.uploadDialogTitle ?? "Upload files from device",
|
|
895
|
+
size: A.Sm,
|
|
879
896
|
closeAriaLabel: l.uploadDialogCloseAriaLabel ?? "Close",
|
|
880
897
|
onClose: t,
|
|
881
898
|
mainButtons: [{
|
|
@@ -886,197 +903,197 @@ var Re = {
|
|
|
886
903
|
}, {
|
|
887
904
|
label: l.uploadConfirmLabel ?? "Add",
|
|
888
905
|
variant: m.Primary,
|
|
889
|
-
iconBefore: E ? /* @__PURE__ */
|
|
906
|
+
iconBefore: E ? /* @__PURE__ */ L(N, {
|
|
890
907
|
size: 16,
|
|
891
908
|
ariaLabel: ""
|
|
892
909
|
}) : void 0,
|
|
893
|
-
onClick: () => void
|
|
894
|
-
disabled: !
|
|
910
|
+
onClick: () => void de(),
|
|
911
|
+
disabled: !ue
|
|
895
912
|
}],
|
|
896
|
-
children: /* @__PURE__ */
|
|
913
|
+
children: /* @__PURE__ */ R("div", {
|
|
897
914
|
className: "flex flex-col gap-4 px-6 py-4",
|
|
898
915
|
children: [
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
label: /* @__PURE__ */ I
|
|
916
|
+
/* @__PURE__ */ L(S, {
|
|
917
|
+
label: /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("span", {
|
|
901
918
|
className: "desktop:hidden",
|
|
902
|
-
children:
|
|
903
|
-
}), /* @__PURE__ */
|
|
919
|
+
children: F ? l.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : l.uploadDropZoneMobileLabel ?? "Click here to upload"
|
|
920
|
+
}), /* @__PURE__ */ L("span", {
|
|
904
921
|
className: "hidden desktop:inline",
|
|
905
|
-
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"
|
|
906
923
|
})] }),
|
|
907
924
|
ariaLabel: l.uploadDropZoneAriaLabel ?? "Upload files",
|
|
908
925
|
multiple: !0,
|
|
909
|
-
accept:
|
|
910
|
-
className:
|
|
911
|
-
onChange:
|
|
912
|
-
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
|
|
913
930
|
}),
|
|
914
|
-
|
|
915
|
-
/* @__PURE__ */
|
|
931
|
+
M > 0 && /* @__PURE__ */ L(N, { ariaLabel: l.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
|
|
932
|
+
/* @__PURE__ */ L("div", {
|
|
916
933
|
role: "alert",
|
|
917
|
-
children: O && /* @__PURE__ */
|
|
934
|
+
children: O && /* @__PURE__ */ L(x, { text: O })
|
|
918
935
|
}),
|
|
919
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ L("span", {
|
|
920
937
|
role: "status",
|
|
921
938
|
"aria-live": "polite",
|
|
922
939
|
className: "sr-only",
|
|
923
|
-
id:
|
|
940
|
+
id: ne,
|
|
924
941
|
children: g.map((e) => `${l.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
|
|
925
942
|
}),
|
|
926
|
-
g.map((e) => /* @__PURE__ */
|
|
927
|
-
u.length > 0 && /* @__PURE__ */
|
|
943
|
+
g.map((e) => /* @__PURE__ */ L(x, { text: e }, e)),
|
|
944
|
+
u.length > 0 && /* @__PURE__ */ L("ul", {
|
|
928
945
|
className: "flex flex-col gap-2",
|
|
929
946
|
children: u.map((e) => {
|
|
930
947
|
let t = p.get(e.id), n = t?.kind === et.Manifest, r = t?.status === tt.Invalid;
|
|
931
|
-
return /* @__PURE__ */
|
|
948
|
+
return /* @__PURE__ */ R("li", {
|
|
932
949
|
className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
|
|
933
950
|
children: [
|
|
934
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ L(ie, {
|
|
935
952
|
size: 20,
|
|
936
953
|
"aria-hidden": !0,
|
|
937
954
|
stroke: _
|
|
938
955
|
}),
|
|
939
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ R("div", {
|
|
940
957
|
className: "flex min-w-0 flex-1 flex-col",
|
|
941
958
|
children: [
|
|
942
|
-
/* @__PURE__ */
|
|
959
|
+
/* @__PURE__ */ L("span", {
|
|
943
960
|
className: "dial-small-text truncate",
|
|
944
961
|
children: e.path
|
|
945
962
|
}),
|
|
946
|
-
/* @__PURE__ */
|
|
963
|
+
/* @__PURE__ */ L("span", {
|
|
947
964
|
className: "dial-tiny-text text-secondary",
|
|
948
965
|
children: s(e.file.size)
|
|
949
966
|
}),
|
|
950
|
-
r && t?.error && /* @__PURE__ */
|
|
951
|
-
n && !r && /* @__PURE__ */
|
|
967
|
+
r && t?.error && /* @__PURE__ */ L(x, { text: t.error }),
|
|
968
|
+
n && !r && /* @__PURE__ */ L("span", {
|
|
952
969
|
className: "dial-tiny-text text-secondary",
|
|
953
970
|
children: l.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
|
|
954
971
|
})
|
|
955
972
|
]
|
|
956
973
|
}),
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
-
icon: /* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ L(w, {
|
|
975
|
+
icon: /* @__PURE__ */ L(ce, {
|
|
959
976
|
size: 16,
|
|
960
977
|
"aria-hidden": !0,
|
|
961
978
|
stroke: _
|
|
962
979
|
}),
|
|
963
980
|
"aria-label": l.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
|
|
964
|
-
onClick: () =>
|
|
981
|
+
onClick: () => z(e.id)
|
|
965
982
|
})
|
|
966
983
|
]
|
|
967
984
|
}, e.id);
|
|
968
985
|
})
|
|
969
986
|
}),
|
|
970
|
-
C && /* @__PURE__ */
|
|
987
|
+
C && /* @__PURE__ */ L(x, { text: C })
|
|
971
988
|
]
|
|
972
989
|
})
|
|
973
990
|
});
|
|
974
|
-
},
|
|
991
|
+
}, st = {
|
|
975
992
|
title: "_title_5md1a_1",
|
|
976
993
|
helperText: "_helperText_5md1a_5",
|
|
977
994
|
refineFeedback: "_refineFeedback_5md1a_9",
|
|
978
995
|
refineError: "_refineError_5md1a_13"
|
|
979
|
-
},
|
|
980
|
-
mode:
|
|
996
|
+
}, ct = {
|
|
997
|
+
mode: Y.Files,
|
|
981
998
|
targetFolderPath: ""
|
|
982
|
-
},
|
|
983
|
-
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();
|
|
984
1001
|
return { default: e };
|
|
985
|
-
}),
|
|
986
|
-
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({
|
|
987
1004
|
name: r?.name ?? "",
|
|
988
1005
|
description: r?.description ?? "",
|
|
989
1006
|
instructions: r?.instructions ?? ""
|
|
990
|
-
}),
|
|
991
|
-
bottomGap:
|
|
992
|
-
minHeight:
|
|
993
|
-
}),
|
|
1007
|
+
}), De = pe(), K = U(void 0), Oe = l({
|
|
1008
|
+
bottomGap: ut,
|
|
1009
|
+
minHeight: dt
|
|
1010
|
+
}), ke = U(G), Ae = (e) => {
|
|
994
1011
|
let t = {
|
|
995
|
-
...
|
|
1012
|
+
...ke.current,
|
|
996
1013
|
...e
|
|
997
1014
|
};
|
|
998
|
-
|
|
999
|
-
},
|
|
1000
|
-
if (
|
|
1001
|
-
|
|
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;
|
|
1002
1019
|
try {
|
|
1003
1020
|
return await e(t, n);
|
|
1004
1021
|
} finally {
|
|
1005
|
-
|
|
1022
|
+
K.current === n && (K.current = void 0);
|
|
1006
1023
|
}
|
|
1007
|
-
} : void 0,
|
|
1008
|
-
value:
|
|
1009
|
-
onChange: (e) =>
|
|
1010
|
-
onRefine:
|
|
1024
|
+
} : void 0, Me = u({
|
|
1025
|
+
value: G.description,
|
|
1026
|
+
onChange: (e) => Ae({ description: e }),
|
|
1027
|
+
onRefine: je(ne),
|
|
1011
1028
|
disabled: O || T || D,
|
|
1012
1029
|
resetKey: r
|
|
1013
|
-
}),
|
|
1014
|
-
value:
|
|
1015
|
-
onChange: (e) =>
|
|
1016
|
-
onRefine:
|
|
1030
|
+
}), Ne = u({
|
|
1031
|
+
value: G.instructions,
|
|
1032
|
+
onChange: (e) => Ae({ instructions: e }),
|
|
1033
|
+
onRefine: je(ie),
|
|
1017
1034
|
disabled: O || T || D,
|
|
1018
1035
|
resetKey: r
|
|
1019
|
-
}),
|
|
1020
|
-
|
|
1021
|
-
},
|
|
1022
|
-
|
|
1023
|
-
},
|
|
1024
|
-
|
|
1025
|
-
},
|
|
1026
|
-
O || T || D ||
|
|
1027
|
-
},
|
|
1028
|
-
|
|
1029
|
-
|
|
1036
|
+
}), Ie = Me.isPending || Ne.isPending, Re = () => {
|
|
1037
|
+
Me.reset(), Ne.reset();
|
|
1038
|
+
}, Ve = () => {
|
|
1039
|
+
Re(), ge();
|
|
1040
|
+
}, He = () => {
|
|
1041
|
+
Re(), _e();
|
|
1042
|
+
}, We = () => {
|
|
1043
|
+
O || T || D || K.current && !K.current.aborted || fe(G);
|
|
1044
|
+
}, Ke = U(r), qe = Ke.current !== r, Je = U(i);
|
|
1045
|
+
V(() => {
|
|
1046
|
+
Ke.current = r;
|
|
1030
1047
|
let e = {
|
|
1031
1048
|
name: r?.name ?? "",
|
|
1032
1049
|
description: r?.description ?? "",
|
|
1033
1050
|
instructions: r?.instructions ?? ""
|
|
1034
1051
|
};
|
|
1035
|
-
|
|
1052
|
+
ke.current = e, Ee(e), Je.current = i;
|
|
1036
1053
|
}, [r]);
|
|
1037
|
-
let
|
|
1038
|
-
|
|
1039
|
-
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;
|
|
1040
1057
|
let e = {
|
|
1041
1058
|
name: r?.name ?? "",
|
|
1042
1059
|
description: r?.description ?? "",
|
|
1043
1060
|
instructions: r?.instructions ?? ""
|
|
1044
|
-
}, t = JSON.stringify(
|
|
1045
|
-
t !==
|
|
1061
|
+
}, t = JSON.stringify(G) !== JSON.stringify(e) || Xe(i) !== Xe(Je.current);
|
|
1062
|
+
t !== et.current && (et.current = t, F?.(t));
|
|
1046
1063
|
}, [
|
|
1047
|
-
|
|
1064
|
+
G,
|
|
1048
1065
|
i,
|
|
1049
1066
|
r,
|
|
1050
|
-
|
|
1051
|
-
|
|
1067
|
+
qe,
|
|
1068
|
+
F
|
|
1052
1069
|
]);
|
|
1053
|
-
let [
|
|
1054
|
-
|
|
1055
|
-
}, [
|
|
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) => {
|
|
1056
1073
|
let t = [...e];
|
|
1057
|
-
|
|
1058
|
-
}, [
|
|
1059
|
-
|
|
1060
|
-
}, []), [
|
|
1061
|
-
|
|
1062
|
-
...
|
|
1074
|
+
at(t), S?.(t);
|
|
1075
|
+
}, [S]), [yt, bt] = W(!1), [xt, St] = W(ct), Ct = B((e) => {
|
|
1076
|
+
St(e), bt(!0);
|
|
1077
|
+
}, []), [wt, Tt] = W(!1), { isDragActive: Et, dropZoneHandlers: Dt } = Ze(B((e) => {
|
|
1078
|
+
yt || Ct({
|
|
1079
|
+
...ct,
|
|
1063
1080
|
initialFiles: e
|
|
1064
1081
|
});
|
|
1065
|
-
}, [
|
|
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({
|
|
1066
1083
|
"--se-title-color": $?.title,
|
|
1067
1084
|
"--se-helper-text-color": $?.helperText,
|
|
1068
1085
|
"--se-refine-action-text": $?.refineActionText,
|
|
1069
1086
|
"--se-refine-error-text": $?.refineErrorText
|
|
1070
|
-
}),
|
|
1071
|
-
feedbackClassName: c($?.refineActionText &&
|
|
1072
|
-
errorClassName:
|
|
1073
|
-
},
|
|
1087
|
+
}), Pt = {
|
|
1088
|
+
feedbackClassName: c($?.refineActionText && st.refineFeedback, Ot.refineFeedbackClassName, ze.refineFeedback),
|
|
1089
|
+
errorClassName: st.refineError
|
|
1090
|
+
}, Ft = {
|
|
1074
1091
|
layout: $?.border ? { colors: {
|
|
1075
1092
|
headerBorderColor: $.border,
|
|
1076
1093
|
sidebarBorderColor: $.border
|
|
1077
1094
|
} } : void 0,
|
|
1078
1095
|
section: $?.title ? { colors: { titleColor: $.title } } : void 0
|
|
1079
|
-
},
|
|
1096
|
+
}, It = H(() => ({
|
|
1080
1097
|
required: Q.folderNameRequiredError ?? "Enter a folder name",
|
|
1081
1098
|
invalid: Q.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
|
|
1082
1099
|
duplicate: Q.folderNameDuplicateError ?? "An item with this name already exists here"
|
|
@@ -1084,176 +1101,175 @@ var Re = {
|
|
|
1084
1101
|
Q.folderNameRequiredError,
|
|
1085
1102
|
Q.folderNameInvalidError,
|
|
1086
1103
|
Q.folderNameDuplicateError
|
|
1087
|
-
]),
|
|
1088
|
-
|
|
1089
|
-
}, [
|
|
1104
|
+
]), Lt = B((e) => {
|
|
1105
|
+
_t.has(e) || vt(/* @__PURE__ */ new Set([..._t, e]));
|
|
1106
|
+
}, [_t, vt]), Rt = Ye({
|
|
1090
1107
|
files: i,
|
|
1091
|
-
fileActions:
|
|
1108
|
+
fileActions: z,
|
|
1092
1109
|
defaultName: Q.newFolderDefaultName ?? "New folder",
|
|
1093
|
-
messages:
|
|
1094
|
-
onRevealFolder:
|
|
1095
|
-
onCreated:
|
|
1096
|
-
}), { draftNode:
|
|
1097
|
-
path:
|
|
1098
|
-
name:
|
|
1099
|
-
kind:
|
|
1100
|
-
}, ...i]), [i]),
|
|
1110
|
+
messages: It,
|
|
1111
|
+
onRevealFolder: Lt,
|
|
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([
|
|
1101
1118
|
{
|
|
1102
|
-
path:
|
|
1103
|
-
name:
|
|
1104
|
-
kind:
|
|
1119
|
+
path: q,
|
|
1120
|
+
name: q,
|
|
1121
|
+
kind: J.File
|
|
1105
1122
|
},
|
|
1106
1123
|
...i,
|
|
1107
|
-
|
|
1108
|
-
]) :
|
|
1124
|
+
zt
|
|
1125
|
+
]) : Ht, [
|
|
1109
1126
|
i,
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
]),
|
|
1113
|
-
e.path !==
|
|
1114
|
-
}, [
|
|
1115
|
-
|
|
1127
|
+
zt,
|
|
1128
|
+
Ht
|
|
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);
|
|
1116
1133
|
}, [
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
]), { startDraft:
|
|
1121
|
-
if (!
|
|
1122
|
-
let t = await
|
|
1123
|
-
t?.length &&
|
|
1124
|
-
mode:
|
|
1134
|
+
z,
|
|
1135
|
+
Z,
|
|
1136
|
+
rt
|
|
1137
|
+
]), { startDraft: qt } = Rt, { onCreateFolder: Jt, extractArchive: Yt, pickFromFileSystem: Xt } = z, Zt = B(async (e) => {
|
|
1138
|
+
if (!Xt) return;
|
|
1139
|
+
let t = await Xt();
|
|
1140
|
+
t?.length && Ct({
|
|
1141
|
+
mode: Y.Files,
|
|
1125
1142
|
targetFolderPath: e,
|
|
1126
1143
|
initialEntries: t
|
|
1127
1144
|
});
|
|
1128
|
-
}, [
|
|
1129
|
-
let n = (e) => Qe(e,
|
|
1130
|
-
return
|
|
1145
|
+
}, [Xt, Ct]), Qt = B((e, t) => {
|
|
1146
|
+
let n = (e) => Qe(e, Mt), r = [];
|
|
1147
|
+
return Jt && r.push({
|
|
1131
1148
|
key: "create-folder",
|
|
1132
1149
|
label: Q.createFolderLabel ?? "Create folder",
|
|
1133
1150
|
icon: n(oe),
|
|
1134
|
-
onClick: () =>
|
|
1151
|
+
onClick: () => qt(e, t)
|
|
1135
1152
|
}), r.push({
|
|
1136
1153
|
key: "upload-files",
|
|
1137
1154
|
label: Q.uploadFilesLabel ?? "Upload files from device",
|
|
1138
|
-
icon: n(
|
|
1139
|
-
onClick: () =>
|
|
1140
|
-
mode:
|
|
1155
|
+
icon: n(le),
|
|
1156
|
+
onClick: () => Ct({
|
|
1157
|
+
mode: Y.Files,
|
|
1141
1158
|
targetFolderPath: e
|
|
1142
1159
|
})
|
|
1143
|
-
}),
|
|
1160
|
+
}), Yt && r.push({
|
|
1144
1161
|
key: "upload-archive",
|
|
1145
1162
|
label: Q.uploadArchiveLabel ?? "Upload archive from device",
|
|
1146
1163
|
icon: n(ae),
|
|
1147
|
-
onClick: () =>
|
|
1148
|
-
mode:
|
|
1164
|
+
onClick: () => Ct({
|
|
1165
|
+
mode: Y.Archive,
|
|
1149
1166
|
targetFolderPath: e
|
|
1150
1167
|
})
|
|
1151
|
-
}),
|
|
1168
|
+
}), Xt && r.push({
|
|
1152
1169
|
key: "open-file-system",
|
|
1153
1170
|
label: Q.openFileSystemLabel ?? "Open DIAL file system",
|
|
1154
1171
|
icon: n(re),
|
|
1155
|
-
onClick: () => void
|
|
1172
|
+
onClick: () => void Zt(e)
|
|
1156
1173
|
}), r;
|
|
1157
1174
|
}, [
|
|
1158
|
-
|
|
1175
|
+
Mt,
|
|
1176
|
+
Jt,
|
|
1159
1177
|
Yt,
|
|
1160
1178
|
Xt,
|
|
1161
|
-
Zt,
|
|
1162
1179
|
Q.createFolderLabel,
|
|
1163
1180
|
Q.uploadFilesLabel,
|
|
1164
1181
|
Q.uploadArchiveLabel,
|
|
1165
1182
|
Q.openFileSystemLabel,
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
]),
|
|
1170
|
-
let e =
|
|
1183
|
+
qt,
|
|
1184
|
+
Ct,
|
|
1185
|
+
Zt
|
|
1186
|
+
]), $t = H(() => {
|
|
1187
|
+
let e = Ge(Be.Header, i.find((e) => e.path === Z));
|
|
1171
1188
|
return {
|
|
1172
|
-
[
|
|
1173
|
-
[
|
|
1189
|
+
[X.Mobile]: Qt(e, X.Mobile),
|
|
1190
|
+
[X.Desktop]: Qt(e, X.Desktop)
|
|
1174
1191
|
};
|
|
1175
1192
|
}, [
|
|
1176
|
-
|
|
1193
|
+
Qt,
|
|
1177
1194
|
i,
|
|
1178
|
-
|
|
1179
|
-
]),
|
|
1180
|
-
if (e.path ===
|
|
1195
|
+
Z
|
|
1196
|
+
]), en = B((e, t) => {
|
|
1197
|
+
if (e.path === Bt || e.nodeType !== me.FOLDER) return [];
|
|
1181
1198
|
let n = {
|
|
1182
1199
|
path: e.path,
|
|
1183
1200
|
name: e.name,
|
|
1184
|
-
kind:
|
|
1185
|
-
}, r =
|
|
1201
|
+
kind: J.Folder
|
|
1202
|
+
}, r = Qt(Ge(Be.Child, n), t);
|
|
1186
1203
|
return r.push({
|
|
1187
|
-
key: "add-sibling",
|
|
1188
|
-
icon: Qe(ce),
|
|
1189
|
-
label: Q.addSiblingLabel ?? "Add sibling",
|
|
1190
|
-
children: $t(We(ze.Sibling, n), t)
|
|
1191
|
-
}, {
|
|
1192
1204
|
key: "delete",
|
|
1193
1205
|
label: Q.deleteLabel ?? "Delete",
|
|
1194
1206
|
danger: !0,
|
|
1195
|
-
icon: Qe(
|
|
1196
|
-
onClick: () =>
|
|
1207
|
+
icon: Qe(ce, jt),
|
|
1208
|
+
onClick: () => Kt(e.path)
|
|
1197
1209
|
}), r;
|
|
1198
1210
|
}, [
|
|
1199
|
-
|
|
1200
|
-
Q.addSiblingLabel,
|
|
1211
|
+
Bt,
|
|
1201
1212
|
Q.deleteLabel,
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
]),
|
|
1206
|
-
[
|
|
1207
|
-
[
|
|
1208
|
-
}), [
|
|
1213
|
+
jt,
|
|
1214
|
+
Qt,
|
|
1215
|
+
Kt
|
|
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, {
|
|
1220
|
+
size: b.Small,
|
|
1221
|
+
icon: Qe(ce, jt, g.SM),
|
|
1222
|
+
"aria-label": Q.deleteLabel ?? "Delete",
|
|
1223
|
+
onClick: () => Kt(e.path)
|
|
1224
|
+
}), [
|
|
1225
|
+
Q.deleteLabel,
|
|
1226
|
+
jt,
|
|
1227
|
+
Kt
|
|
1228
|
+
]), rn = (e) => /* @__PURE__ */ R("div", {
|
|
1209
1229
|
className: "flex flex-col gap-2 desktop:gap-5",
|
|
1210
|
-
children: [/* @__PURE__ */
|
|
1230
|
+
children: [/* @__PURE__ */ R("div", {
|
|
1211
1231
|
className: "flex items-center justify-between",
|
|
1212
|
-
children: [/* @__PURE__ */
|
|
1213
|
-
className: c(
|
|
1232
|
+
children: [/* @__PURE__ */ L("span", {
|
|
1233
|
+
className: c(st.title, kt),
|
|
1214
1234
|
children: Q.filesHeading ?? "Files"
|
|
1215
|
-
}), /* @__PURE__ */
|
|
1235
|
+
}), /* @__PURE__ */ L(p, {
|
|
1216
1236
|
label: Q.addLabel ?? "Add",
|
|
1217
1237
|
variant: m.Neutral,
|
|
1218
1238
|
appearance: f.Solid,
|
|
1219
1239
|
size: b.Small,
|
|
1220
|
-
|
|
1221
|
-
size: g.SM,
|
|
1222
|
-
"aria-hidden": !0,
|
|
1223
|
-
stroke: _
|
|
1224
|
-
}),
|
|
1225
|
-
items: en[e]
|
|
1240
|
+
items: $t[e]
|
|
1226
1241
|
})]
|
|
1227
|
-
}), /* @__PURE__ */
|
|
1242
|
+
}), /* @__PURE__ */ L("div", {
|
|
1228
1243
|
role: "tree",
|
|
1229
1244
|
"aria-label": Q.filesTreeAriaLabel ?? "Skill files",
|
|
1230
|
-
children: /* @__PURE__ */
|
|
1231
|
-
items:
|
|
1245
|
+
children: /* @__PURE__ */ L(he, {
|
|
1246
|
+
items: Vt === e ? Ut : Ht,
|
|
1232
1247
|
showFiles: !0,
|
|
1233
|
-
selectedPath:
|
|
1234
|
-
expandedPaths:
|
|
1235
|
-
onExpandedPathsChange:
|
|
1236
|
-
onItemClick:
|
|
1237
|
-
getContextMenuItems:
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1248
|
+
selectedPath: Z,
|
|
1249
|
+
expandedPaths: _t,
|
|
1250
|
+
onExpandedPathsChange: vt,
|
|
1251
|
+
onItemClick: Gt,
|
|
1252
|
+
getContextMenuItems: tn[e],
|
|
1253
|
+
renderItemActions: nn,
|
|
1254
|
+
renamedPath: Vt === e ? Bt : void 0,
|
|
1255
|
+
onRenameSave: Rt.handleSave,
|
|
1256
|
+
onRenameCancel: Rt.handleCancel,
|
|
1257
|
+
onRenameValidate: Rt.handleValidate,
|
|
1242
1258
|
rootItemPath: ""
|
|
1243
1259
|
})
|
|
1244
1260
|
})]
|
|
1245
|
-
}), an =
|
|
1246
|
-
name:
|
|
1247
|
-
description:
|
|
1261
|
+
}), an = H(() => ({
|
|
1262
|
+
name: G.name,
|
|
1263
|
+
description: G.description,
|
|
1248
1264
|
iconUrl: "",
|
|
1249
1265
|
version: "",
|
|
1250
1266
|
topics: [],
|
|
1251
1267
|
otherLocales: []
|
|
1252
|
-
}), [
|
|
1268
|
+
}), [G.name, G.description]), on = H(() => ({
|
|
1253
1269
|
name: k?.name,
|
|
1254
1270
|
description: k?.description
|
|
1255
|
-
}), [k?.name, k?.description]), sn =
|
|
1256
|
-
...
|
|
1271
|
+
}), [k?.name, k?.description]), sn = H(() => ({ form: {
|
|
1272
|
+
...Fe,
|
|
1257
1273
|
name: {
|
|
1258
1274
|
label: Q.nameLabel ?? "Name",
|
|
1259
1275
|
placeholder: Q.namePlaceholder ?? "good-morning-breakfast"
|
|
@@ -1269,176 +1285,176 @@ var Re = {
|
|
|
1269
1285
|
Q.descriptionLabel,
|
|
1270
1286
|
Q.descriptionPlaceholder
|
|
1271
1287
|
]), cn = (e) => {
|
|
1272
|
-
e.name !== void 0 &&
|
|
1273
|
-
}, 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, {
|
|
1274
1290
|
isEnabled: !0,
|
|
1275
1291
|
fieldId: t,
|
|
1276
1292
|
required: !0,
|
|
1277
1293
|
label: Q.descriptionLabel ?? "Description",
|
|
1278
1294
|
labels: Q,
|
|
1279
|
-
refinement:
|
|
1280
|
-
disabled:
|
|
1281
|
-
...
|
|
1295
|
+
refinement: Me,
|
|
1296
|
+
disabled: Ie || O,
|
|
1297
|
+
...Pt,
|
|
1282
1298
|
children: e
|
|
1283
1299
|
}) : void 0, un = {
|
|
1284
|
-
title:
|
|
1285
|
-
onBack:
|
|
1286
|
-
onCancel:
|
|
1287
|
-
onSubmit:
|
|
1300
|
+
title: ye,
|
|
1301
|
+
onBack: He,
|
|
1302
|
+
onCancel: Ve,
|
|
1303
|
+
onSubmit: We,
|
|
1288
1304
|
submitLabel: Q.createLabel ?? "Create",
|
|
1289
|
-
isSubmitDisabled:
|
|
1305
|
+
isSubmitDisabled: Ie || T || D,
|
|
1290
1306
|
labels: {
|
|
1291
1307
|
cancelLabel: Q.cancelLabel ?? "Cancel",
|
|
1292
|
-
backAriaLabel:
|
|
1308
|
+
backAriaLabel: ve ?? "Back",
|
|
1293
1309
|
savingStatusLabel: Q.savingStatusLabel ?? "Saving"
|
|
1294
1310
|
},
|
|
1295
|
-
styles:
|
|
1311
|
+
styles: Ft,
|
|
1296
1312
|
metadataTitle: null
|
|
1297
1313
|
};
|
|
1298
|
-
if (T) return /* @__PURE__ */
|
|
1299
|
-
dir:
|
|
1314
|
+
if (T) return /* @__PURE__ */ L("div", {
|
|
1315
|
+
dir: we,
|
|
1300
1316
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1301
|
-
children: /* @__PURE__ */
|
|
1317
|
+
children: /* @__PURE__ */ L(Pe, {
|
|
1302
1318
|
...un,
|
|
1303
|
-
metadata: /* @__PURE__ */
|
|
1319
|
+
metadata: /* @__PURE__ */ L("div", {
|
|
1304
1320
|
role: "status",
|
|
1305
1321
|
"aria-label": Q.loadingAriaLabel ?? "Loading skill",
|
|
1306
1322
|
className: "flex flex-1 items-center justify-center p-8",
|
|
1307
|
-
children: /* @__PURE__ */
|
|
1323
|
+
children: /* @__PURE__ */ L(N, {})
|
|
1308
1324
|
})
|
|
1309
1325
|
})
|
|
1310
1326
|
});
|
|
1311
|
-
if (D) return /* @__PURE__ */
|
|
1312
|
-
dir:
|
|
1327
|
+
if (D) return /* @__PURE__ */ L("div", {
|
|
1328
|
+
dir: we,
|
|
1313
1329
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1314
|
-
children: /* @__PURE__ */
|
|
1330
|
+
children: /* @__PURE__ */ L(Pe, {
|
|
1315
1331
|
...un,
|
|
1316
|
-
metadata: /* @__PURE__ */
|
|
1332
|
+
metadata: /* @__PURE__ */ R("div", {
|
|
1317
1333
|
role: "alert",
|
|
1318
1334
|
className: "flex flex-col items-center gap-4 p-8",
|
|
1319
|
-
children: [/* @__PURE__ */
|
|
1335
|
+
children: [/* @__PURE__ */ L(x, { text: Q.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ L(j, {
|
|
1320
1336
|
label: Q.retryLabel ?? "Retry",
|
|
1321
|
-
onClick:
|
|
1337
|
+
onClick: be
|
|
1322
1338
|
})]
|
|
1323
1339
|
})
|
|
1324
1340
|
})
|
|
1325
1341
|
});
|
|
1326
|
-
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", {
|
|
1327
1343
|
className: "flex flex-col gap-2",
|
|
1328
|
-
children: [
|
|
1344
|
+
children: [A != null && /* @__PURE__ */ R("div", {
|
|
1329
1345
|
className: "flex items-center gap-2",
|
|
1330
|
-
children: [/* @__PURE__ */
|
|
1346
|
+
children: [/* @__PURE__ */ L(x, { text: A }), xe != null && /* @__PURE__ */ L(C, {
|
|
1331
1347
|
label: Q.retryLabel ?? "Retry",
|
|
1332
|
-
onClick:
|
|
1348
|
+
onClick: xe
|
|
1333
1349
|
})]
|
|
1334
|
-
}),
|
|
1350
|
+
}), M != null && /* @__PURE__ */ R("div", {
|
|
1335
1351
|
className: "flex items-center gap-2",
|
|
1336
|
-
children: [/* @__PURE__ */
|
|
1352
|
+
children: [/* @__PURE__ */ L(x, { text: M.message }), /* @__PURE__ */ L(C, {
|
|
1337
1353
|
label: Q.reloadLatestLabel ?? "Reload latest",
|
|
1338
|
-
onClick:
|
|
1354
|
+
onClick: ee
|
|
1339
1355
|
})]
|
|
1340
1356
|
})]
|
|
1341
|
-
}) : void 0, mn = /* @__PURE__ */
|
|
1342
|
-
isEnabled: !!
|
|
1343
|
-
fieldId:
|
|
1357
|
+
}) : void 0, mn = /* @__PURE__ */ L(a, {
|
|
1358
|
+
isEnabled: !!ie,
|
|
1359
|
+
fieldId: De,
|
|
1344
1360
|
required: !0,
|
|
1345
|
-
labelClassName: c(
|
|
1361
|
+
labelClassName: c(st.helperText, At),
|
|
1346
1362
|
label: Q.instructionsLabel ?? "Instructions",
|
|
1347
1363
|
labels: Q,
|
|
1348
|
-
refinement:
|
|
1349
|
-
disabled:
|
|
1350
|
-
...
|
|
1351
|
-
children: /* @__PURE__ */
|
|
1364
|
+
refinement: Ne,
|
|
1365
|
+
disabled: Ie || O,
|
|
1366
|
+
...Pt,
|
|
1367
|
+
children: /* @__PURE__ */ R("div", {
|
|
1352
1368
|
className: "flex flex-1 flex-col gap-2",
|
|
1353
1369
|
children: [
|
|
1354
|
-
!
|
|
1355
|
-
htmlFor:
|
|
1356
|
-
className: c(
|
|
1370
|
+
!ie && /* @__PURE__ */ L(E, {
|
|
1371
|
+
htmlFor: De,
|
|
1372
|
+
className: c(st.helperText, At),
|
|
1357
1373
|
label: Q.instructionsLabel ?? "Instructions",
|
|
1358
1374
|
required: !0
|
|
1359
1375
|
}),
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
ref:
|
|
1376
|
+
/* @__PURE__ */ L("div", {
|
|
1377
|
+
ref: Oe,
|
|
1362
1378
|
className: c(t, e, n),
|
|
1363
|
-
children: /* @__PURE__ */
|
|
1364
|
-
fallback: /* @__PURE__ */
|
|
1365
|
-
children: /* @__PURE__ */
|
|
1366
|
-
id:
|
|
1379
|
+
children: /* @__PURE__ */ L(ue, {
|
|
1380
|
+
fallback: /* @__PURE__ */ L(N, { ariaLabel: Q.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
1381
|
+
children: /* @__PURE__ */ L(ht, {
|
|
1382
|
+
id: De,
|
|
1367
1383
|
ariaLabel: Q.instructionsLabel ?? "Instructions",
|
|
1368
|
-
value:
|
|
1384
|
+
value: G.instructions,
|
|
1369
1385
|
onChange: (e) => {
|
|
1370
|
-
|
|
1386
|
+
Ne.reset(), Ae({ instructions: e });
|
|
1371
1387
|
},
|
|
1372
|
-
theme:
|
|
1388
|
+
theme: Te,
|
|
1373
1389
|
showDragbar: !1,
|
|
1374
1390
|
placeholder: Q.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
|
|
1375
1391
|
})
|
|
1376
1392
|
})
|
|
1377
1393
|
}),
|
|
1378
|
-
k?.instructions != null && /* @__PURE__ */
|
|
1394
|
+
k?.instructions != null && /* @__PURE__ */ L(x, { text: k.instructions })
|
|
1379
1395
|
]
|
|
1380
1396
|
})
|
|
1381
1397
|
});
|
|
1382
|
-
return /* @__PURE__ */
|
|
1383
|
-
dir:
|
|
1384
|
-
className: c("relative flex min-h-0 flex-1 flex-col",
|
|
1385
|
-
style:
|
|
1386
|
-
...
|
|
1398
|
+
return /* @__PURE__ */ R("div", {
|
|
1399
|
+
dir: we,
|
|
1400
|
+
className: c("relative flex min-h-0 flex-1 flex-col", ze.root),
|
|
1401
|
+
style: Nt,
|
|
1402
|
+
...Dt,
|
|
1387
1403
|
children: [
|
|
1388
|
-
/* @__PURE__ */
|
|
1389
|
-
isVisible:
|
|
1390
|
-
labels:
|
|
1404
|
+
/* @__PURE__ */ L($e, {
|
|
1405
|
+
isVisible: Et && !yt,
|
|
1406
|
+
labels: Se
|
|
1391
1407
|
}),
|
|
1392
|
-
/* @__PURE__ */
|
|
1408
|
+
/* @__PURE__ */ L(Pe, {
|
|
1393
1409
|
...un,
|
|
1394
|
-
asideData:
|
|
1395
|
-
asideSectionClassName:
|
|
1410
|
+
asideData: de,
|
|
1411
|
+
asideSectionClassName: pt,
|
|
1396
1412
|
isSubmitting: O,
|
|
1397
|
-
metadataSectionClassName:
|
|
1398
|
-
metadata: /* @__PURE__ */ I
|
|
1413
|
+
metadataSectionClassName: ft,
|
|
1414
|
+
metadata: /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("div", {
|
|
1399
1415
|
className: "desktop:hidden",
|
|
1400
|
-
children: /* @__PURE__ */
|
|
1416
|
+
children: /* @__PURE__ */ L(d, {
|
|
1401
1417
|
title: Q.editingFileLabel ?? "Editing file",
|
|
1402
|
-
description:
|
|
1403
|
-
expanded:
|
|
1404
|
-
onToggle:
|
|
1418
|
+
description: Wt?.name ?? "SKILL.md",
|
|
1419
|
+
expanded: wt,
|
|
1420
|
+
onToggle: Tt,
|
|
1405
1421
|
ariaLabel: Q.editingFileLabel ?? "Editing file",
|
|
1406
|
-
children: rn(
|
|
1422
|
+
children: rn(X.Mobile)
|
|
1407
1423
|
})
|
|
1408
|
-
}), /* @__PURE__ */
|
|
1424
|
+
}), /* @__PURE__ */ L("div", {
|
|
1409
1425
|
className: "hidden desktop:block",
|
|
1410
|
-
children: rn(
|
|
1426
|
+
children: rn(X.Desktop)
|
|
1411
1427
|
})] }),
|
|
1412
1428
|
alert: pn,
|
|
1413
1429
|
setupTitle: fn,
|
|
1414
|
-
setupSectionClassName:
|
|
1415
|
-
setup: dn ? /* @__PURE__ */ I
|
|
1430
|
+
setupSectionClassName: mt,
|
|
1431
|
+
setup: dn ? /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(Le, {
|
|
1416
1432
|
values: an,
|
|
1417
1433
|
errors: on,
|
|
1418
1434
|
onChange: cn,
|
|
1419
|
-
fields:
|
|
1435
|
+
fields: lt,
|
|
1420
1436
|
isDescriptionRequired: !0,
|
|
1421
|
-
isNameReadOnly:
|
|
1437
|
+
isNameReadOnly: P,
|
|
1422
1438
|
nameCaption: k?.name ? void 0 : Q.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
|
|
1423
1439
|
renderDescription: ln,
|
|
1424
1440
|
labels: sn
|
|
1425
|
-
}), mn] }) : /* @__PURE__ */
|
|
1441
|
+
}), mn] }) : /* @__PURE__ */ L(I, { children: Wt?.kind === J.File && /* @__PURE__ */ L("div", {
|
|
1426
1442
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1427
|
-
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." })
|
|
1428
1444
|
}) })
|
|
1429
1445
|
}),
|
|
1430
|
-
/* @__PURE__ */
|
|
1431
|
-
isOpen:
|
|
1432
|
-
onClose: () =>
|
|
1433
|
-
fileActions:
|
|
1434
|
-
mode:
|
|
1435
|
-
targetFolderPath:
|
|
1436
|
-
initialFiles:
|
|
1437
|
-
initialEntries:
|
|
1438
|
-
labels:
|
|
1446
|
+
/* @__PURE__ */ L(ot, {
|
|
1447
|
+
isOpen: yt,
|
|
1448
|
+
onClose: () => bt(!1),
|
|
1449
|
+
fileActions: z,
|
|
1450
|
+
mode: xt.mode,
|
|
1451
|
+
targetFolderPath: xt.targetFolderPath,
|
|
1452
|
+
initialFiles: xt.initialFiles,
|
|
1453
|
+
initialEntries: xt.initialEntries,
|
|
1454
|
+
labels: Se
|
|
1439
1455
|
})
|
|
1440
1456
|
]
|
|
1441
1457
|
});
|
|
1442
1458
|
};
|
|
1443
1459
|
//#endregion
|
|
1444
|
-
export {
|
|
1460
|
+
export { ze as SKILL_EDITOR_CLASS, gt as SkillEditor, et as SkillFileCandidateKind, J as SkillFileNodeKind, Y as SkillFileUploadMode, tt as SkillFileValidationStatus };
|