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