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