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