@epam/ai-dial-skill-editor 1.3.0-dev.32 → 1.3.0-dev.321
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 +1032 -761
- 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
|
|
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 j, LiveRegion as te, LiveRegionElement as ne, LiveRegionPoliteness as re, NeutralButton as M, Popup as ie, PopupSize as ae, PrimaryButton as oe, RadioGroup as se, ResizeHandle as N, Select as ce, Spinner as le, TagInput as ue, Textarea as de, TextareaResize as fe } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
4
|
-
import { IconArrowNarrowLeft as
|
|
5
|
-
import { Suspense as
|
|
6
|
-
import { DialFileNodeType as
|
|
7
|
-
import { LazyMarkdownEditor as
|
|
4
|
+
import { IconArrowNarrowLeft as pe, IconDatabase as me, IconFileZip as he, IconFolderPlus as ge, IconPhoto as L, IconPlus as _e, IconTrashX as ve, IconUpload as ye } from "@tabler/icons-react";
|
|
5
|
+
import { Suspense as be, lazy as xe, memo as Se, useCallback as R, useEffect as z, useId as Ce, useMemo as B, useRef as V, useState as H } from "react";
|
|
6
|
+
import { DialFileNodeType as we, DialFoldersTree as Te } from "@epam/ai-dial-react-file-manager";
|
|
7
|
+
import { LazyMarkdownEditor as Ee } 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,64 +12,77 @@ 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 U = {
|
|
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
|
+
}, De = {
|
|
22
22
|
section: "_section_l1mnx_1",
|
|
23
23
|
title: "_title_l1mnx_5"
|
|
24
|
-
},
|
|
24
|
+
}, Oe = ({ 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
29
|
return /* @__PURE__ */ I("section", {
|
|
30
|
-
className: c("flex h-full flex-col gap-4 rounded border
|
|
30
|
+
className: c("flex h-full flex-col gap-4 rounded border", De.section, r, U.section),
|
|
31
31
|
style: i,
|
|
32
32
|
children: [e != null && /* @__PURE__ */ F("h2", {
|
|
33
|
-
className: c("dial-h3-text",
|
|
33
|
+
className: c(n?.typography?.titleClassName ?? "dial-h3-text", De.title),
|
|
34
34
|
children: e
|
|
35
35
|
}), t]
|
|
36
36
|
});
|
|
37
|
-
},
|
|
37
|
+
}, W = (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
|
+
}, ke = {
|
|
38
41
|
headerBorder: "_headerBorder_1adw2_1",
|
|
39
42
|
footerBorder: "_footerBorder_1adw2_5",
|
|
40
43
|
columnBorder: "_columnBorder_1adw2_10"
|
|
41
|
-
},
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
}, Ae = ({ 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 = Ce(), h = u ? d?.savingStatusLabel ?? "Saving" : "", g = V(null), [_, v] = H(), x = l != null && a != null, S = l?.minWidth, C = l?.maxWidth, w = {
|
|
46
|
+
min: S,
|
|
47
|
+
max: C,
|
|
48
|
+
containerWidth: _
|
|
49
|
+
}, T = x ? W(l.width, w) : void 0, E = W(C ?? 640, w);
|
|
50
|
+
z(() => {
|
|
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
60
|
return /* @__PURE__ */ I("div", {
|
|
47
|
-
dir:
|
|
48
|
-
className: c("flex min-h-0 flex-1 flex-col",
|
|
49
|
-
style:
|
|
61
|
+
dir: p,
|
|
62
|
+
className: c("flex min-h-0 flex-1 flex-col", U.layout),
|
|
63
|
+
style: D,
|
|
50
64
|
children: [
|
|
51
|
-
/* @__PURE__ */ F(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
children: m
|
|
65
|
+
/* @__PURE__ */ F(te, {
|
|
66
|
+
visuallyHidden: !0,
|
|
67
|
+
as: ne.Span,
|
|
68
|
+
id: m,
|
|
69
|
+
children: h
|
|
57
70
|
}),
|
|
58
71
|
/* @__PURE__ */ I("div", {
|
|
59
|
-
className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:
|
|
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", ke.headerBorder),
|
|
60
73
|
children: [/* @__PURE__ */ I("div", {
|
|
61
74
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
62
|
-
children: [/* @__PURE__ */ F(
|
|
63
|
-
icon: /* @__PURE__ */ F(
|
|
64
|
-
size:
|
|
65
|
-
stroke:
|
|
75
|
+
children: [/* @__PURE__ */ F(ee, {
|
|
76
|
+
icon: /* @__PURE__ */ F(pe, {
|
|
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
84
|
}), /* @__PURE__ */ F("h1", {
|
|
72
|
-
className: "dial-h2-text min-w-0 truncate",
|
|
85
|
+
className: c(f?.typography?.titleClassName ?? "dial-h2-text", "min-w-0 truncate"),
|
|
73
86
|
children: e
|
|
74
87
|
})]
|
|
75
88
|
}), r != null && /* @__PURE__ */ F("div", {
|
|
@@ -78,85 +91,106 @@ var ve = {
|
|
|
78
91
|
})]
|
|
79
92
|
}),
|
|
80
93
|
/* @__PURE__ */ I("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
97
|
/* @__PURE__ */ F("div", {
|
|
84
|
-
className: c(a == null ? "desktop:flex-1" : "desktop:
|
|
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 : ke.columnBorder),
|
|
99
|
+
style: T == null ? void 0 : { "--el-left-width": `${T}px` },
|
|
85
100
|
children: i
|
|
86
101
|
}),
|
|
102
|
+
x && T != null && /* @__PURE__ */ F("div", {
|
|
103
|
+
className: "relative hidden w-0 shrink-0 desktop:block",
|
|
104
|
+
children: /* @__PURE__ */ F(N, {
|
|
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
|
+
}),
|
|
87
114
|
a != null && /* @__PURE__ */ F("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
118
|
s != null && /* @__PURE__ */ F("div", {
|
|
92
|
-
className: c("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s",
|
|
119
|
+
className: c("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", ke.columnBorder),
|
|
93
120
|
children: s
|
|
94
121
|
})
|
|
95
122
|
]
|
|
96
123
|
}),
|
|
97
124
|
r != null && /* @__PURE__ */ F("div", {
|
|
98
|
-
className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden
|
|
125
|
+
className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 *:flex-1 desktop:hidden", ke.footerBorder),
|
|
99
126
|
children: r
|
|
100
127
|
})
|
|
101
128
|
]
|
|
102
129
|
});
|
|
103
|
-
},
|
|
130
|
+
}, je = {
|
|
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
|
+
}, G = ({ 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
141
|
return /* @__PURE__ */ I("div", {
|
|
115
|
-
className: c("flex flex-col gap-2",
|
|
116
|
-
style:
|
|
117
|
-
children: [/* @__PURE__ */ F(
|
|
142
|
+
className: c("flex flex-col gap-2", u),
|
|
143
|
+
style: d,
|
|
144
|
+
children: [/* @__PURE__ */ F(A, { label: e }), /* @__PURE__ */ I("div", {
|
|
118
145
|
className: "flex items-start gap-3",
|
|
119
146
|
children: [/* @__PURE__ */ F("div", {
|
|
120
|
-
className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border",
|
|
147
|
+
className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", je.box),
|
|
121
148
|
children: t ? /* @__PURE__ */ F("img", {
|
|
122
149
|
src: t,
|
|
123
150
|
alt: n,
|
|
124
151
|
className: "h-16 w-16 object-cover"
|
|
125
|
-
}) : /* @__PURE__ */ F(
|
|
126
|
-
size:
|
|
127
|
-
stroke:
|
|
152
|
+
}) : /* @__PURE__ */ F(L, {
|
|
153
|
+
size: y.LG,
|
|
154
|
+
stroke: b,
|
|
128
155
|
"aria-hidden": !0,
|
|
129
|
-
className:
|
|
156
|
+
className: je.icon
|
|
130
157
|
})
|
|
131
158
|
}), /* @__PURE__ */ I("div", {
|
|
132
159
|
className: "flex flex-col gap-3",
|
|
133
|
-
children: [/* @__PURE__ */ F(
|
|
134
|
-
size:
|
|
135
|
-
iconBefore: /* @__PURE__ */ F(
|
|
136
|
-
size:
|
|
137
|
-
stroke:
|
|
160
|
+
children: [/* @__PURE__ */ F(O, {
|
|
161
|
+
size: C.Small,
|
|
162
|
+
iconBefore: /* @__PURE__ */ F(_e, {
|
|
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
170
|
}), /* @__PURE__ */ F("span", {
|
|
144
|
-
className: c(
|
|
171
|
+
className: c(s, je.caption),
|
|
145
172
|
children: i
|
|
146
173
|
})]
|
|
147
174
|
})]
|
|
148
175
|
})]
|
|
149
176
|
});
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
|
|
177
|
+
}, Me = {
|
|
178
|
+
confirmText: "_confirmText_19ec1_1",
|
|
179
|
+
confirmItem: "_confirmItem_19ec1_5"
|
|
180
|
+
}, Ne = ({ 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 = R((e) => e.length === 1 ? l.deleteConfirmTitleSingle : l.deleteConfirmTitleMultiple, [l.deleteConfirmTitleSingle, l.deleteConfirmTitleMultiple]), h = R((e) => /* @__PURE__ */ F("div", {
|
|
182
|
+
className: c(u, "px-6 py-3"),
|
|
183
|
+
style: o({
|
|
184
|
+
"--apm-confirm-text": f,
|
|
185
|
+
"--apm-confirm-item-text": p
|
|
186
|
+
}),
|
|
153
187
|
children: /* @__PURE__ */ F("p", {
|
|
154
|
-
className: "mb-3
|
|
188
|
+
className: c("mb-3", Me.confirmText),
|
|
155
189
|
children: e.length === 1 ? /* @__PURE__ */ I(P, { children: [
|
|
156
|
-
|
|
190
|
+
l.deleteConfirmSingleText,
|
|
157
191
|
" ",
|
|
158
192
|
/* @__PURE__ */ I("span", {
|
|
159
|
-
className: "break-
|
|
193
|
+
className: c("wrap-break-word", Me.confirmItem),
|
|
160
194
|
children: [
|
|
161
195
|
"\"",
|
|
162
196
|
e[0].split("/").pop(),
|
|
@@ -164,24 +198,27 @@ var ve = {
|
|
|
164
198
|
]
|
|
165
199
|
})
|
|
166
200
|
] }) : /* @__PURE__ */ I(P, { children: [
|
|
167
|
-
|
|
201
|
+
l.deleteConfirmMultipleText,
|
|
168
202
|
" ",
|
|
169
203
|
/* @__PURE__ */ I("span", {
|
|
170
|
-
className:
|
|
204
|
+
className: Me.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__ */ F(
|
|
221
|
+
return /* @__PURE__ */ F(be, {
|
|
185
222
|
fallback: null,
|
|
186
223
|
children: e && /* @__PURE__ */ F(i, {
|
|
187
224
|
isOpen: e,
|
|
@@ -189,133 +226,141 @@ var ve = {
|
|
|
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
|
+
}, K = /* @__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
|
+
}({}), Pe = [
|
|
220
257
|
"avatar",
|
|
221
258
|
"name",
|
|
222
259
|
"version",
|
|
223
260
|
"description",
|
|
224
261
|
"locales",
|
|
225
262
|
"tags"
|
|
226
|
-
],
|
|
263
|
+
], Fe = {
|
|
264
|
+
summary: "_summary_1hlc9_1",
|
|
265
|
+
rowLabel: "_rowLabel_1hlc9_5"
|
|
266
|
+
}, Ie = (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
|
+
}), Le = ({ 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: te = "Save" } = i, [ne, re] = H(!1), [M, ae] = H([]), oe = V(0);
|
|
276
|
+
z(() => {
|
|
277
|
+
ne && ae(e.length > 0 ? e : [Ie(`locale-row-${++oe.current}`, /* @__PURE__ */ new Set(), n)]);
|
|
235
278
|
}, [
|
|
236
279
|
ne,
|
|
237
280
|
e,
|
|
238
281
|
n
|
|
239
282
|
]);
|
|
240
|
-
let
|
|
241
|
-
t(
|
|
242
|
-
},
|
|
243
|
-
let e = new Set(
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
|
|
283
|
+
let se = () => re(!0), N = () => re(!1), le = () => {
|
|
284
|
+
t(M.filter((e) => e.language && e.name)), re(!1);
|
|
285
|
+
}, ue = () => {
|
|
286
|
+
let e = new Set(M.map((e) => e.language).filter(Boolean));
|
|
287
|
+
ae((t) => [...t, Ie(`locale-row-${++oe.current}`, e, n)]);
|
|
288
|
+
}, P = (e, t) => {
|
|
289
|
+
ae((n) => n.map((n) => n.id === e ? {
|
|
247
290
|
...n,
|
|
248
291
|
...t
|
|
249
292
|
} : n));
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
},
|
|
293
|
+
}, pe = (e) => {
|
|
294
|
+
ae((t) => t.filter((t) => t.id !== e));
|
|
295
|
+
}, me = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), he = M.some((e) => !e.language || !e.name);
|
|
253
296
|
return n.length === 0 ? null : /* @__PURE__ */ I("div", {
|
|
254
297
|
className: c("flex items-center gap-2", a),
|
|
298
|
+
style: d,
|
|
255
299
|
children: [
|
|
256
300
|
e.length > 0 && /* @__PURE__ */ F("span", {
|
|
257
|
-
className:
|
|
258
|
-
children: `${
|
|
301
|
+
className: c(Fe.summary, s),
|
|
302
|
+
children: `${f}: ${e.map((e) => `[${me(e.language)}]`).join(", ")}`
|
|
259
303
|
}),
|
|
260
|
-
/* @__PURE__ */ F(
|
|
261
|
-
label: e.length > 0 ?
|
|
262
|
-
iconBefore: /* @__PURE__ */ F(
|
|
263
|
-
size:
|
|
304
|
+
/* @__PURE__ */ F(j, {
|
|
305
|
+
label: e.length > 0 ? m : p,
|
|
306
|
+
iconBefore: /* @__PURE__ */ F(_e, {
|
|
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: se
|
|
269
313
|
}),
|
|
270
|
-
/* @__PURE__ */ F(
|
|
314
|
+
/* @__PURE__ */ F(ie, {
|
|
271
315
|
open: ne,
|
|
272
|
-
header:
|
|
273
|
-
onClose:
|
|
316
|
+
header: g,
|
|
317
|
+
onClose: N,
|
|
274
318
|
mainButtons: [{
|
|
275
|
-
label: ee,
|
|
276
|
-
onClick: ae
|
|
277
|
-
}, {
|
|
278
319
|
label: A,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
320
|
+
onClick: N
|
|
321
|
+
}, {
|
|
322
|
+
label: te,
|
|
323
|
+
variant: _.Primary,
|
|
324
|
+
disabled: he,
|
|
325
|
+
onClick: le
|
|
282
326
|
}],
|
|
283
327
|
children: /* @__PURE__ */ I("div", {
|
|
284
328
|
className: "flex flex-col gap-8 px-6 py-3",
|
|
285
|
-
|
|
286
|
-
|
|
329
|
+
style: d,
|
|
330
|
+
children: [M.map((e, t) => {
|
|
331
|
+
let i = new Set(M.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
|
|
287
332
|
return /* @__PURE__ */ I("div", {
|
|
288
333
|
className: "flex flex-col gap-2",
|
|
289
334
|
children: [/* @__PURE__ */ I("div", {
|
|
290
335
|
className: "flex items-center justify-between",
|
|
291
336
|
children: [/* @__PURE__ */ I("span", {
|
|
292
|
-
className:
|
|
337
|
+
className: c(Fe.rowLabel, l),
|
|
293
338
|
children: [
|
|
294
|
-
|
|
339
|
+
S,
|
|
295
340
|
" ",
|
|
296
341
|
t + 1
|
|
297
342
|
]
|
|
298
|
-
}), /* @__PURE__ */ F(
|
|
299
|
-
appearance:
|
|
300
|
-
size:
|
|
301
|
-
icon: /* @__PURE__ */ F(
|
|
302
|
-
size:
|
|
343
|
+
}), /* @__PURE__ */ F(x, {
|
|
344
|
+
appearance: h.Ghost,
|
|
345
|
+
size: C.Small,
|
|
346
|
+
icon: /* @__PURE__ */ F(ve, {
|
|
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: () => pe(e.id)
|
|
308
353
|
})]
|
|
309
354
|
}), /* @__PURE__ */ I("div", {
|
|
310
355
|
role: "group",
|
|
311
|
-
"aria-label": `${
|
|
356
|
+
"aria-label": `${S} ${t + 1}`,
|
|
312
357
|
className: "flex flex-col gap-5",
|
|
313
358
|
children: [/* @__PURE__ */ I("div", {
|
|
314
359
|
className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
|
|
315
|
-
children: [/* @__PURE__ */ F(
|
|
360
|
+
children: [/* @__PURE__ */ F(ce, {
|
|
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__ */ F(
|
|
373
|
+
onChange: (t) => P(e.id, { language: t })
|
|
374
|
+
}), /* @__PURE__ */ F(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) => P(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__ */ F(
|
|
386
|
+
}), /* @__PURE__ */ F(de, {
|
|
342
387
|
id: `${e.id}-description`,
|
|
343
388
|
className: r,
|
|
344
|
-
resize:
|
|
389
|
+
resize: fe.Vertical,
|
|
345
390
|
value: e.description,
|
|
346
|
-
onChange: (t) =>
|
|
347
|
-
labelProps: { label:
|
|
348
|
-
placeholder:
|
|
391
|
+
onChange: (t) => P(e.id, { description: t }),
|
|
392
|
+
labelProps: { label: D },
|
|
393
|
+
placeholder: O
|
|
349
394
|
})]
|
|
350
395
|
})]
|
|
351
396
|
}, e.id);
|
|
352
|
-
}), /* @__PURE__ */ F(
|
|
353
|
-
label:
|
|
354
|
-
iconBefore: /* @__PURE__ */ F(
|
|
355
|
-
size:
|
|
397
|
+
}), /* @__PURE__ */ F(j, {
|
|
398
|
+
label: v,
|
|
399
|
+
iconBefore: /* @__PURE__ */ F(_e, {
|
|
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: ue,
|
|
406
|
+
disabled: M.length >= n.length
|
|
362
407
|
})]
|
|
363
408
|
})
|
|
364
409
|
})
|
|
365
410
|
]
|
|
366
411
|
});
|
|
367
|
-
},
|
|
368
|
-
let
|
|
369
|
-
|
|
412
|
+
}, Re = "Add tags, comma separated", ze = "deployment-creation-form-description", Be = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = Pe, isNameReadOnly: m = !1, nameReadOnlyTooltip: h, nameCaption: g, isDescriptionRequired: _ = !1, descriptionCaption: v, renderDescription: y, focusRequestKey: b }) => {
|
|
413
|
+
let x = V(null), S = V(null), C = V(null), w = V(!1), T = (e) => p.includes(e), E = T(K.Name), D = T(K.Version), O = !!(t.name || t.version || t.description), ee = V(b);
|
|
414
|
+
z(() => {
|
|
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__ */ F(de, {
|
|
427
|
+
id: ze,
|
|
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: fe.Vertical
|
|
401
443
|
});
|
|
402
444
|
return /* @__PURE__ */ I("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(K.Avatar) && /* @__PURE__ */ F(G, {
|
|
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__ */ I("div", {
|
|
416
458
|
className: c("flex items-start gap-4", d?.field),
|
|
417
|
-
children: [
|
|
459
|
+
children: [E && /* @__PURE__ */ F(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__ */ F(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(K.Description) && (y ? /* @__PURE__ */ F("div", {
|
|
447
490
|
className: d?.field,
|
|
448
|
-
children:
|
|
449
|
-
}) :
|
|
450
|
-
|
|
491
|
+
children: y(A, ze)
|
|
492
|
+
}) : A),
|
|
493
|
+
T(K.Locales) && /* @__PURE__ */ F(Le, {
|
|
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(K.Tags) && /* @__PURE__ */ F("div", {
|
|
458
502
|
className: d?.field,
|
|
459
|
-
children: /* @__PURE__ */ F(
|
|
503
|
+
children: /* @__PURE__ */ F(ue, {
|
|
460
504
|
id: "deployment-creation-form-topics",
|
|
461
505
|
labelProps: { label: u.topics.label },
|
|
462
|
-
placeholder: u.topics.placeholder ??
|
|
506
|
+
placeholder: u.topics.placeholder ?? Re,
|
|
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
|
+
}, Ve = "border-0 p-4 desktop:p-8", He = "border-0", Ue = "desktop:flex-1", We = "px-4 pt-4 desktop:px-6 desktop:pt-6", Ge = Se(({ 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, hasSetupSectionPadding: S = !0, labels: C, styles: w, dir: T }) => {
|
|
515
|
+
let E = /* @__PURE__ */ F(te, {
|
|
516
|
+
politeness: re.Assertive,
|
|
517
|
+
className: v == null ? void 0 : We,
|
|
474
518
|
children: v
|
|
475
|
-
}),
|
|
476
|
-
return /* @__PURE__ */ F(
|
|
519
|
+
}), D = p != null;
|
|
520
|
+
return /* @__PURE__ */ F(Ae, {
|
|
477
521
|
title: e,
|
|
478
522
|
onBack: t,
|
|
479
|
-
backAriaLabel:
|
|
523
|
+
backAriaLabel: C?.backAriaLabel ?? "Back",
|
|
480
524
|
isSaving: a,
|
|
481
|
-
|
|
482
|
-
|
|
525
|
+
resizableLeftColumn: y,
|
|
526
|
+
labels: {
|
|
527
|
+
savingStatusLabel: C?.savingStatusLabel ?? "Saving",
|
|
528
|
+
resizeHandleLabel: C?.resizeHandleLabel,
|
|
529
|
+
resizeHandleTooltip: C?.resizeHandleTooltip
|
|
530
|
+
},
|
|
531
|
+
rightContent: h == null ? void 0 : /* @__PURE__ */ F(Oe, {
|
|
483
532
|
title: g,
|
|
484
|
-
styles:
|
|
485
|
-
className: c(
|
|
533
|
+
styles: w?.section,
|
|
534
|
+
className: c(Ve, _, U.asideSection),
|
|
486
535
|
children: h
|
|
487
536
|
}),
|
|
488
|
-
styles:
|
|
489
|
-
dir:
|
|
490
|
-
actions: /* @__PURE__ */ I(P, { children: [s, !l && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
491
|
-
label:
|
|
537
|
+
styles: w?.layout,
|
|
538
|
+
dir: T,
|
|
539
|
+
actions: /* @__PURE__ */ I(P, { children: [s, !l && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(M, {
|
|
540
|
+
label: C?.cancelLabel ?? "Cancel",
|
|
492
541
|
disabled: a,
|
|
493
542
|
onClick: n
|
|
494
|
-
}), /* @__PURE__ */ F(
|
|
543
|
+
}), /* @__PURE__ */ F(oe, {
|
|
495
544
|
label: i,
|
|
496
545
|
disabled: a || o,
|
|
497
546
|
onClick: r
|
|
498
547
|
})] })] }),
|
|
499
548
|
leftContent: /* @__PURE__ */ I(P, { children: [
|
|
500
|
-
!
|
|
501
|
-
/* @__PURE__ */ F(
|
|
502
|
-
title: d === null ? void 0 : d ??
|
|
503
|
-
styles:
|
|
504
|
-
className: c(
|
|
549
|
+
!D && E,
|
|
550
|
+
/* @__PURE__ */ F(Oe, {
|
|
551
|
+
title: d === null ? void 0 : d ?? C?.metadataTitle ?? "Metadata",
|
|
552
|
+
styles: w?.section,
|
|
553
|
+
className: c(Ve, b, U.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: D ? /* @__PURE__ */ I(P, { children: [E, /* @__PURE__ */ F(Oe, {
|
|
559
|
+
title: m === null ? void 0 : m ?? C?.setupTitle ?? "Setup",
|
|
560
|
+
styles: w?.section,
|
|
561
|
+
className: c(S ? Ve : He, Ue, x, U.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__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
628
|
+
}, Je = Se(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Pe, isNameReadOnly: c, nameReadOnlyTooltip: l, nameCaption: u, isDescriptionRequired: d, descriptionCaption: f, renderDescription: p, focusRequestKey: m, labels: h }) => {
|
|
629
|
+
let [g, _] = H(!1), v = B(() => a ? s : s.filter((e) => e !== K.Avatar), [a, s]), y = e.iconUrl, b = a?.resolveIconUrl, x = B(() => b ? b(y) : void 0, [y, b]), S = R(() => _(!0), []), C = R(() => _(!1), []), w = a?.resolveAttachedIconUrl, T = R((e) => {
|
|
630
|
+
let t = w?.(e);
|
|
631
|
+
t && n({ iconUrl: t }), _(!1);
|
|
632
|
+
}, [n, w]);
|
|
633
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Be, {
|
|
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__ */ F(Ne, {
|
|
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
|
+
}, Ze = "SKILL.md", Qe = /* @__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
|
+
}({}), $e = /* @__PURE__ */ function(e) {
|
|
673
|
+
return e.Header = "header", e.Child = "child", e;
|
|
674
|
+
}({}), et = (e) => {
|
|
624
675
|
let t = e.lastIndexOf("/");
|
|
625
676
|
return t === -1 ? null : e.slice(0, t);
|
|
626
|
-
},
|
|
677
|
+
}, tt = (e) => {
|
|
627
678
|
let t = e.lastIndexOf("/");
|
|
628
679
|
return t === -1 ? e : e.slice(t + 1);
|
|
629
|
-
},
|
|
680
|
+
}, nt = (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: tt(e),
|
|
687
|
+
nodeType: we.FOLDER,
|
|
688
|
+
parentPath: et(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 === Qe.Folder ? n(r.path).name = r.name : t.set(r.path, {
|
|
695
|
+
path: r.path,
|
|
696
|
+
name: r.name,
|
|
697
|
+
nodeType: we.ITEM,
|
|
698
|
+
parentPath: et(r.path),
|
|
699
|
+
folderId: et(r.path) ?? ""
|
|
700
|
+
});
|
|
656
701
|
for (let t of [...e]) {
|
|
657
|
-
let e =
|
|
658
|
-
for (; e != null;) n(e), e =
|
|
702
|
+
let e = et(t.path);
|
|
703
|
+
for (; e != null;) n(e), e = et(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
|
+
}, rt = (e, t) => e ? `${e}/${t}` : t, it = (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 = rt(r, `${s} (${l})${c}`);
|
|
717
|
+
for (; t.has(u);) l += 1, u = rt(r, `${s} (${l})${c}`);
|
|
718
|
+
return u;
|
|
719
|
+
}, at = (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 $e.Child: return t.path;
|
|
723
|
+
case $e.Header: return t.kind === Qe.Folder ? t.path : "";
|
|
676
724
|
}
|
|
677
|
-
},
|
|
725
|
+
}, q = (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
|
+
}, ot = (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] = H(null), c = o?.parentPath ?? null, l = V([]), u = c == null ? void 0 :
|
|
738
|
+
}, st = "\\new-folder", ct = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
|
|
739
|
+
let [o, s] = H(null), c = o?.parentPath ?? null, l = V([]), u = c == null ? void 0 : rt(c, st), d = B(() => u == null ? void 0 : {
|
|
692
740
|
path: u,
|
|
693
741
|
name: n,
|
|
694
|
-
kind:
|
|
695
|
-
}, [u, n]), f =
|
|
696
|
-
let a =
|
|
697
|
-
return i === "" && a.add(
|
|
742
|
+
kind: Qe.Folder
|
|
743
|
+
}, [u, n]), f = R((n, i) => {
|
|
744
|
+
let a = q(e, i);
|
|
745
|
+
return i === "" && a.add(Ze), ot(n, a, r) ?? t.validateFolderPath?.(rt(i, n.trim()));
|
|
698
746
|
}, [
|
|
699
747
|
e,
|
|
700
748
|
r,
|
|
701
749
|
t
|
|
702
|
-
]), p =
|
|
750
|
+
]), p = R((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 = R((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 = R(() => {
|
|
719
767
|
l.current = [], s(null);
|
|
720
|
-
}, []), g =
|
|
768
|
+
}, []), g = R((e, n) => {
|
|
769
|
+
let r = rt(n, e.trim());
|
|
770
|
+
t.onCreateFolder?.(r), n !== "" && i(n), a(r);
|
|
771
|
+
}, [
|
|
772
|
+
t,
|
|
773
|
+
i,
|
|
774
|
+
a
|
|
775
|
+
]), _ = R((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,264 +788,441 @@ 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
|
-
},
|
|
796
|
+
}, lt = (e) => !!e.dataTransfer?.types.includes("Files"), ut = (e) => {
|
|
746
797
|
let [t, n] = H(!1), r = V(0);
|
|
747
798
|
return {
|
|
748
799
|
isDragActive: t,
|
|
749
800
|
dropZoneHandlers: {
|
|
750
|
-
onDragEnter:
|
|
751
|
-
|
|
801
|
+
onDragEnter: R((e) => {
|
|
802
|
+
lt(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
752
803
|
}, []),
|
|
753
|
-
onDragLeave:
|
|
754
|
-
|
|
804
|
+
onDragLeave: R((e) => {
|
|
805
|
+
lt(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
755
806
|
}, []),
|
|
756
|
-
onDragOver:
|
|
757
|
-
|
|
807
|
+
onDragOver: R((e) => {
|
|
808
|
+
lt(e) && e.preventDefault();
|
|
758
809
|
}, []),
|
|
759
|
-
onDrop:
|
|
760
|
-
if (!
|
|
810
|
+
onDrop: R((t) => {
|
|
811
|
+
if (!lt(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
|
+
}, dt = /* @__PURE__ */ function(e) {
|
|
768
819
|
return e.Files = "files", e.Archive = "archive", e;
|
|
769
|
-
}({}),
|
|
820
|
+
}({}), J = /* @__PURE__ */ function(e) {
|
|
770
821
|
return e.Mobile = "mobile", e.Desktop = "desktop", e;
|
|
771
|
-
}({}),
|
|
822
|
+
}({}), ft = (e, t, n = y.MD, r) => /* @__PURE__ */ F(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
|
-
|
|
827
|
+
stroke: b
|
|
828
|
+
}), pt = { footer: "_footer_hn1ri_7" }, mt = ({ 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__ */ F(le, {
|
|
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__ */ I(m, {
|
|
839
|
+
open: e,
|
|
840
|
+
title: t,
|
|
841
|
+
closeAriaLabel: n,
|
|
842
|
+
onClose: r,
|
|
843
|
+
children: [p, /* @__PURE__ */ I("div", {
|
|
844
|
+
className: c("sticky bottom-0 flex gap-3 border-t p-4", pt.footer),
|
|
845
|
+
style: d,
|
|
846
|
+
children: [/* @__PURE__ */ F(oe, {
|
|
847
|
+
className: "flex-1",
|
|
848
|
+
label: i,
|
|
849
|
+
iconBefore: y,
|
|
850
|
+
disabled: u,
|
|
851
|
+
onClick: a
|
|
852
|
+
}), /* @__PURE__ */ F(M, {
|
|
853
|
+
className: "flex-1",
|
|
854
|
+
label: s,
|
|
855
|
+
onClick: l
|
|
856
|
+
})]
|
|
857
|
+
})]
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
return /* @__PURE__ */ F(ie, {
|
|
861
|
+
open: e,
|
|
862
|
+
header: t,
|
|
863
|
+
size: ae.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
|
+
}, ht = ({ 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 = Ce(), [f, p] = H(""), [m, h] = H(!1);
|
|
882
|
+
z(() => {
|
|
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__ */ F(mt, {
|
|
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__ */ F("form", {
|
|
899
|
+
className: "px-4 py-4 desktop:px-6",
|
|
900
|
+
onSubmit: (e) => {
|
|
901
|
+
e.preventDefault(), _();
|
|
902
|
+
},
|
|
903
|
+
children: /* @__PURE__ */ F(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
|
+
}, gt = { icon: "_icon_1p1f5_1" }, _t = ({ 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__ */ F(te, {
|
|
920
|
+
visuallyHidden: !0,
|
|
921
|
+
as: ne.Span,
|
|
922
|
+
children: e ? `${a}. ${o}` : ""
|
|
923
|
+
});
|
|
924
|
+
return e ? /* @__PURE__ */ I(P, { children: [s, /* @__PURE__ */ F("div", {
|
|
925
|
+
className: c("pointer-events-none absolute inset-0 z-100 flex items-center justify-center backdrop-blur-sm"),
|
|
783
926
|
children: /* @__PURE__ */ I("div", {
|
|
927
|
+
"aria-hidden": !0,
|
|
784
928
|
className: "flex flex-col items-center text-center",
|
|
785
929
|
children: [
|
|
786
|
-
/* @__PURE__ */ F(
|
|
930
|
+
/* @__PURE__ */ F(ye, {
|
|
787
931
|
size: 100,
|
|
788
|
-
className:
|
|
932
|
+
className: gt.icon,
|
|
789
933
|
"aria-hidden": !0,
|
|
790
|
-
stroke:
|
|
934
|
+
stroke: b
|
|
791
935
|
}),
|
|
792
936
|
/* @__PURE__ */ F("span", {
|
|
793
|
-
className: "
|
|
794
|
-
children:
|
|
937
|
+
className: c("mt-5", n),
|
|
938
|
+
children: a
|
|
795
939
|
}),
|
|
796
940
|
/* @__PURE__ */ F("span", {
|
|
797
|
-
className: "
|
|
798
|
-
children:
|
|
941
|
+
className: c("mt-4", r),
|
|
942
|
+
children: o
|
|
799
943
|
})
|
|
800
944
|
]
|
|
801
945
|
})
|
|
802
|
-
});
|
|
803
|
-
},
|
|
946
|
+
})] }) : s;
|
|
947
|
+
}, vt = {
|
|
948
|
+
card: "_card_1tr87_2",
|
|
949
|
+
label: "_label_1tr87_7",
|
|
950
|
+
fileName: "_fileName_1tr87_11",
|
|
951
|
+
header: "_header_1tr87_16"
|
|
952
|
+
}, yt = ({ label: e, fileName: t, isExpanded: n, onToggle: r, children: i, labelClassName: a = "dial-tiny-lead-text", fileNameClassName: o = "dial-small-text" }) => /* @__PURE__ */ F(p, {
|
|
953
|
+
expanded: n,
|
|
954
|
+
onToggle: r,
|
|
955
|
+
title: /* @__PURE__ */ F("span", {
|
|
956
|
+
className: c("block", vt.label, a),
|
|
957
|
+
children: e
|
|
958
|
+
}),
|
|
959
|
+
description: /* @__PURE__ */ F(D, {
|
|
960
|
+
name: t,
|
|
961
|
+
nameClassName: c(vt.fileName, o)
|
|
962
|
+
}),
|
|
963
|
+
className: c("rounded-lg border py-0 shadow-xs", vt.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", vt.header),
|
|
965
|
+
contentClassName: "max-h-[416px] overflow-y-auto pt-4 pb-2 ps-3 pe-2",
|
|
966
|
+
children: i
|
|
967
|
+
}), bt = /* @__PURE__ */ function(e) {
|
|
804
968
|
return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
|
|
805
|
-
}({}),
|
|
969
|
+
}({}), Y = /* @__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
|
+
}({}), xt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), St = {
|
|
974
|
+
invalidDropZone: "_invalidDropZone_j9j9q_1",
|
|
975
|
+
row: "_row_j9j9q_5"
|
|
976
|
+
}, Ct = ".zip,application/zip", wt = [], Tt = 0, Z = () => `skill-file-candidate-${++Tt}`, Q = (e, t, n) => ({
|
|
977
|
+
id: Z(),
|
|
809
978
|
file: e,
|
|
810
|
-
path:
|
|
811
|
-
}),
|
|
812
|
-
let
|
|
813
|
-
|
|
814
|
-
|
|
979
|
+
path: rt(n, t.replace(/\\/g, "/"))
|
|
980
|
+
}), Et = ({ isOpen: e, onClose: t, fileActions: n, mode: r = dt.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: l, existingFilePaths: u = wt, onCommitted: d, messageClassName: f = "dial-small-text", rowCaptionClassName: p, labels: m, dialogColors: h, colors: g }) => {
|
|
981
|
+
let _ = m ?? {}, [y, x] = H([]), [S, C] = H([]), [w, O] = H(X.Replace), k = B(() => new Set(u), [u]), [A, j] = H(/* @__PURE__ */ new Map()), [M, ie] = H([]), [ae, oe] = H(!1), [N, ce] = H(), [ue, de] = H(!1), [fe, pe] = H(), [me, he] = H(0), ge = V(0), L = r === dt.Archive, _e = _.uploadArchiveErrorMessage ?? "Couldn't read this archive", ye = Ce(), be = Ce(), xe = Ce(), Se = V(null), R = V(!1), we = S[0]?.id;
|
|
982
|
+
z(() => {
|
|
983
|
+
e && (we == null ? R.current && (R.current = !1, document.getElementById(be)?.focus()) : (R.current = !0, Se.current?.focus()));
|
|
984
|
+
}, [
|
|
985
|
+
we,
|
|
986
|
+
e,
|
|
987
|
+
be
|
|
988
|
+
]);
|
|
989
|
+
let Te = (e) => e.path !== "SKILL.md" && k.has(e.path), Ee = (e) => {
|
|
990
|
+
ce(void 0), x((t) => [...t, ...e.filter((e) => !Te(e))]), C((t) => [...t, ...e.filter(Te)]);
|
|
991
|
+
}, U = (e) => {
|
|
992
|
+
let [t, ...n] = S;
|
|
993
|
+
t && (C(n), O(X.Replace), e != null && (ce(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: it(t.path, i)
|
|
1006
|
+
}];
|
|
1007
|
+
})));
|
|
1008
|
+
}, De = async (e) => {
|
|
815
1009
|
let { extractArchive: t } = n;
|
|
816
1010
|
if (!t) return;
|
|
817
|
-
let r =
|
|
818
|
-
|
|
1011
|
+
let r = ge.current;
|
|
1012
|
+
pe(void 0), he((e) => e + 1);
|
|
819
1013
|
try {
|
|
820
1014
|
let n = await Promise.all(e.map((e) => t(e)));
|
|
821
|
-
if (r !==
|
|
1015
|
+
if (r !== ge.current) return;
|
|
822
1016
|
let a = n.flat();
|
|
823
1017
|
if (a.length === 0) {
|
|
824
|
-
|
|
1018
|
+
pe(_.uploadArchiveEmptyMessage ?? "This archive has no files");
|
|
825
1019
|
return;
|
|
826
1020
|
}
|
|
827
|
-
|
|
1021
|
+
Ee(a.map((e) => Q(e.file, e.path, i)));
|
|
828
1022
|
} catch {
|
|
829
|
-
if (r !==
|
|
830
|
-
|
|
1023
|
+
if (r !== ge.current) return;
|
|
1024
|
+
pe(_e);
|
|
831
1025
|
} finally {
|
|
832
|
-
r ===
|
|
833
|
-
}
|
|
834
|
-
}, se = (e) => {
|
|
835
|
-
if (N) {
|
|
836
|
-
oe(e);
|
|
837
|
-
return;
|
|
1026
|
+
r === ge.current && he((e) => e - 1);
|
|
838
1027
|
}
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
1028
|
+
}, Oe = (e) => {
|
|
1029
|
+
L ? De(e) : Ee(e.map((e) => Q(e, xt(e), i)));
|
|
1030
|
+
}, W = (e) => {
|
|
1031
|
+
x((t) => t.filter((t) => t.id !== e));
|
|
842
1032
|
};
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
1033
|
+
z(() => {
|
|
1034
|
+
if (!e) return;
|
|
1035
|
+
ge.current += 1;
|
|
1036
|
+
let t = [...(a ?? []).map((e) => Q(e, xt(e), i)), ...(l ?? []).map((e) => Q(e.file, e.path, i))];
|
|
1037
|
+
x(t.filter((e) => !Te(e))), C(t.filter(Te)), O(X.Replace), j(/* @__PURE__ */ new Map()), ie([]), ce(void 0), pe(void 0), he(0);
|
|
1038
|
+
}, [e]), z(() => {
|
|
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) j(/* @__PURE__ */ new Map()), ie([]);
|
|
1042
|
+
else return oe(!0), n.validateBatch(y).then(({ results: e, batchErrors: n }) => {
|
|
1043
|
+
t || (j(new Map(e.map((e) => [e.candidateId, e]))), ie(n.map((e) => e.message)));
|
|
854
1044
|
}).finally(() => {
|
|
855
|
-
t ||
|
|
1045
|
+
t || oe(!1);
|
|
856
1046
|
}), () => {
|
|
857
1047
|
t = !0;
|
|
858
1048
|
};
|
|
859
|
-
}, [
|
|
860
|
-
let
|
|
861
|
-
|
|
1049
|
+
}, [y, e]);
|
|
1050
|
+
let ke = y.some((e) => A.get(e.id)?.status === Y.Invalid), Ae = y.length > 0 && y.every((e) => A.get(e.id)?.status === Y.Invalid), je = [...M, ...y.flatMap((e) => {
|
|
1051
|
+
let t = A.get(e.id);
|
|
1052
|
+
return t?.status === Y.Invalid && t.error ? [`${e.path}: ${t.error}`] : [];
|
|
1053
|
+
})], G = y.length > 0 && !ke && M.length === 0 && !ae && !ue && me === 0, Me = async () => {
|
|
1054
|
+
de(!0), ce(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 (j(i), ie(r.map((e) => e.message)), y.some((e) => i.get(e.id)?.status === Y.Invalid) || r.length > 0) return;
|
|
1058
|
+
let a = await n.commitBatch(y);
|
|
866
1059
|
if (a.error) {
|
|
867
|
-
|
|
1060
|
+
ce(a.error);
|
|
868
1061
|
return;
|
|
869
1062
|
}
|
|
870
|
-
t();
|
|
1063
|
+
d?.(y), t();
|
|
871
1064
|
} finally {
|
|
872
|
-
|
|
1065
|
+
de(!1);
|
|
873
1066
|
}
|
|
874
|
-
};
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1067
|
+
}, Ne = _.uploadDialogCloseAriaLabel ?? "Close", K = _.uploadCancelLabel ?? "Cancel", [Pe] = S;
|
|
1068
|
+
if (Pe) {
|
|
1069
|
+
let t = _.uploadConflictTitle ?? "Replace or duplicate it?";
|
|
1070
|
+
return /* @__PURE__ */ F(mt, {
|
|
1071
|
+
isOpen: e,
|
|
1072
|
+
title: t,
|
|
1073
|
+
closeAriaLabel: Ne,
|
|
1074
|
+
onClose: () => U(null),
|
|
1075
|
+
confirmLabel: _.uploadConflictConfirmLabel ?? "Confirm",
|
|
1076
|
+
onConfirm: () => U(w),
|
|
1077
|
+
cancelLabel: K,
|
|
1078
|
+
onCancel: () => U(null),
|
|
1079
|
+
colors: h,
|
|
1080
|
+
children: /* @__PURE__ */ I("div", {
|
|
1081
|
+
className: "flex flex-col gap-4 px-4 py-4 desktop:px-6",
|
|
1082
|
+
children: [/* @__PURE__ */ F("p", {
|
|
1083
|
+
ref: Se,
|
|
1084
|
+
tabIndex: -1,
|
|
1085
|
+
className: c("outline-hidden", f),
|
|
1086
|
+
children: _.uploadConflictMessage?.(Pe.path) ?? `Item with the same name "${Pe.path}" already exists.`
|
|
1087
|
+
}), /* @__PURE__ */ F(se, {
|
|
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__ */ F(mt, {
|
|
1103
|
+
isOpen: e,
|
|
1104
|
+
title: L ? _.uploadArchiveDialogTitle ?? "Upload archive from device" : _.uploadDialogTitle ?? "Upload files from device",
|
|
1105
|
+
closeAriaLabel: Ne,
|
|
880
1106
|
onClose: t,
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
variant: m.Primary,
|
|
889
|
-
iconBefore: E ? /* @__PURE__ */ F(ne, {
|
|
890
|
-
size: 16,
|
|
891
|
-
ariaLabel: ""
|
|
892
|
-
}) : void 0,
|
|
893
|
-
onClick: () => void fe(),
|
|
894
|
-
disabled: !R
|
|
895
|
-
}],
|
|
1107
|
+
confirmLabel: _.uploadConfirmLabel ?? "Add",
|
|
1108
|
+
onConfirm: () => void Me(),
|
|
1109
|
+
isConfirmDisabled: !G,
|
|
1110
|
+
isConfirming: ue,
|
|
1111
|
+
cancelLabel: K,
|
|
1112
|
+
onCancel: t,
|
|
1113
|
+
colors: h,
|
|
896
1114
|
children: /* @__PURE__ */ I("div", {
|
|
897
|
-
className: "flex flex-col gap-4 px-
|
|
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__ */ F(
|
|
1121
|
+
/* @__PURE__ */ F(E, {
|
|
900
1122
|
label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
|
|
901
1123
|
className: "desktop:hidden",
|
|
902
|
-
children:
|
|
1124
|
+
children: L ? _.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : _.uploadDropZoneMobileLabel ?? "Click here to upload"
|
|
903
1125
|
}), /* @__PURE__ */ F("span", {
|
|
904
1126
|
className: "hidden desktop:inline",
|
|
905
|
-
children:
|
|
1127
|
+
children: L ? _.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: L ? _.uploadArchiveDropZoneDescription : _.uploadDropZoneDescription,
|
|
1130
|
+
id: be,
|
|
1131
|
+
ariaLabel: _.uploadDropZoneAriaLabel ?? "Upload files",
|
|
908
1132
|
multiple: !0,
|
|
909
|
-
accept:
|
|
910
|
-
className:
|
|
911
|
-
onChange:
|
|
912
|
-
onReject:
|
|
1133
|
+
accept: L ? Ct : void 0,
|
|
1134
|
+
className: Ae ? St.invalidDropZone : void 0,
|
|
1135
|
+
onChange: Oe,
|
|
1136
|
+
onReject: L ? () => pe(_e) : void 0
|
|
913
1137
|
}),
|
|
914
|
-
|
|
915
|
-
/* @__PURE__ */ F(
|
|
916
|
-
|
|
917
|
-
|
|
1138
|
+
me > 0 && /* @__PURE__ */ F(le, { ariaLabel: _.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
|
|
1139
|
+
/* @__PURE__ */ F(T, {
|
|
1140
|
+
text: fe,
|
|
1141
|
+
announce: re.Assertive
|
|
918
1142
|
}),
|
|
919
|
-
/* @__PURE__ */ F(
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
children: g.map((e) => `${l.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
|
|
1143
|
+
/* @__PURE__ */ F(te, {
|
|
1144
|
+
visuallyHidden: !0,
|
|
1145
|
+
as: ne.Span,
|
|
1146
|
+
id: ye,
|
|
1147
|
+
children: je.map((e) => `${_.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
|
|
925
1148
|
}),
|
|
926
|
-
|
|
927
|
-
|
|
1149
|
+
M.map((e) => /* @__PURE__ */ F(T, { text: e }, e)),
|
|
1150
|
+
y.length > 0 && /* @__PURE__ */ F("ul", {
|
|
928
1151
|
className: "flex flex-col gap-2",
|
|
929
|
-
children:
|
|
930
|
-
let t =
|
|
1152
|
+
children: y.map((e) => {
|
|
1153
|
+
let t = A.get(e.id), n = t?.kind === bt.Manifest, r = t?.status === Y.Invalid, i = r ? t?.error : void 0, a = `${xe}${e.id}`;
|
|
931
1154
|
return /* @__PURE__ */ I("li", {
|
|
932
|
-
className: "flex items-center gap-2 rounded-lg border
|
|
933
|
-
children: [
|
|
934
|
-
|
|
935
|
-
|
|
1155
|
+
className: c("flex items-center gap-2 rounded-lg border p-2", St.row),
|
|
1156
|
+
children: [/* @__PURE__ */ F(D, {
|
|
1157
|
+
name: e.path,
|
|
1158
|
+
className: "min-w-0 flex-1",
|
|
1159
|
+
details: /* @__PURE__ */ I(P, { children: [
|
|
1160
|
+
/* @__PURE__ */ F(v, {
|
|
1161
|
+
className: p,
|
|
1162
|
+
text: s(e.file.size)
|
|
1163
|
+
}),
|
|
1164
|
+
/* @__PURE__ */ F(T, {
|
|
1165
|
+
id: a,
|
|
1166
|
+
text: i
|
|
1167
|
+
}),
|
|
1168
|
+
n && !r && /* @__PURE__ */ F(v, {
|
|
1169
|
+
className: p,
|
|
1170
|
+
text: _.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
|
|
1171
|
+
}),
|
|
1172
|
+
e.replacesExisting && !r && /* @__PURE__ */ F(v, {
|
|
1173
|
+
className: p,
|
|
1174
|
+
text: _.uploadReplaceRowNote ?? "Will replace the existing file"
|
|
1175
|
+
})
|
|
1176
|
+
] })
|
|
1177
|
+
}), /* @__PURE__ */ F(ee, {
|
|
1178
|
+
icon: /* @__PURE__ */ F(ve, {
|
|
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: () => W(e.id)
|
|
1186
|
+
})]
|
|
967
1187
|
}, e.id);
|
|
968
1188
|
})
|
|
969
1189
|
}),
|
|
970
|
-
|
|
1190
|
+
/* @__PURE__ */ F(T, {
|
|
1191
|
+
text: N,
|
|
1192
|
+
announce: re.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: dt.Files,
|
|
981
1205
|
targetFolderPath: ""
|
|
982
|
-
},
|
|
983
|
-
let { MarkdownEditor: e } = await
|
|
1206
|
+
}, kt = [K.Name, K.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 = xe(async () => {
|
|
1207
|
+
let { MarkdownEditor: e } = await Ee();
|
|
984
1208
|
return { default: e };
|
|
985
|
-
}),
|
|
986
|
-
let [W,
|
|
1209
|
+
}), $ = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: d, expandedPaths: p, onExpandedPathsChange: m, isLoading: x = !1, hasLoadError: E = !1, isSubmitting: D = !1, errors: k, submitError: j, conflict: te, onReloadLatest: ne, isNameReadOnly: re = !1, onDirtyChange: M, onValuesChange: ie, onRefineDescription: ae, onRefineInstructions: se, fileActions: N, supportingFileContent: ce, asideData: ue, onSubmit: de, onCancel: fe, onBack: pe, backAriaLabel: L, title: _e, onRetry: xe, onRetrySubmit: Se, labels: Ee, styles: U, dir: De, instructionsEditorTheme: Oe = S.light }) => {
|
|
1210
|
+
let [W, ke] = H({
|
|
987
1211
|
name: r?.name ?? "",
|
|
988
1212
|
description: r?.description ?? "",
|
|
989
1213
|
instructions: r?.instructions ?? ""
|
|
990
|
-
}),
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1214
|
+
}), Ae = Ce(), je = Ce();
|
|
1215
|
+
u(() => document.getElementById(Ae), je, !!k?.instructions);
|
|
1216
|
+
let G = V(void 0), Me = l({
|
|
1217
|
+
bottomGap: At,
|
|
1218
|
+
minHeight: jt
|
|
1219
|
+
}), Ne = V(W), K = (e) => {
|
|
994
1220
|
let t = {
|
|
995
|
-
...
|
|
1221
|
+
...Ne.current,
|
|
996
1222
|
...e
|
|
997
1223
|
};
|
|
998
|
-
|
|
999
|
-
},
|
|
1224
|
+
Ne.current = t, ke(t), ie?.(t);
|
|
1225
|
+
}, Pe = (e) => e ? async (t, n) => {
|
|
1000
1226
|
if (G.current && !G.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
1001
1227
|
G.current = n;
|
|
1002
1228
|
try {
|
|
@@ -1004,446 +1230,491 @@ var Re = {
|
|
|
1004
1230
|
} finally {
|
|
1005
1231
|
G.current === n && (G.current = void 0);
|
|
1006
1232
|
}
|
|
1007
|
-
} : void 0,
|
|
1233
|
+
} : void 0, Fe = f({
|
|
1008
1234
|
value: W.description,
|
|
1009
|
-
onChange: (e) =>
|
|
1010
|
-
onRefine:
|
|
1011
|
-
disabled:
|
|
1235
|
+
onChange: (e) => K({ description: e }),
|
|
1236
|
+
onRefine: Pe(ae),
|
|
1237
|
+
disabled: D || x || E,
|
|
1012
1238
|
resetKey: r
|
|
1013
|
-
}),
|
|
1239
|
+
}), Ie = f({
|
|
1014
1240
|
value: W.instructions,
|
|
1015
|
-
onChange: (e) =>
|
|
1016
|
-
onRefine:
|
|
1017
|
-
disabled:
|
|
1241
|
+
onChange: (e) => K({ instructions: e }),
|
|
1242
|
+
onRefine: Pe(se),
|
|
1243
|
+
disabled: D || x || E,
|
|
1018
1244
|
resetKey: r
|
|
1019
|
-
}),
|
|
1020
|
-
|
|
1021
|
-
},
|
|
1022
|
-
|
|
1023
|
-
},
|
|
1024
|
-
|
|
1025
|
-
},
|
|
1026
|
-
|
|
1027
|
-
},
|
|
1028
|
-
|
|
1029
|
-
|
|
1245
|
+
}), Le = Fe.isPending || Ie.isPending, Re = () => {
|
|
1246
|
+
Fe.reset(), Ie.reset();
|
|
1247
|
+
}, ze = () => {
|
|
1248
|
+
Re(), fe();
|
|
1249
|
+
}, Be = () => {
|
|
1250
|
+
Re(), pe();
|
|
1251
|
+
}, Ve = () => {
|
|
1252
|
+
D || x || E || G.current && !G.current.aborted || de(W);
|
|
1253
|
+
}, He = V(r), Ue = He.current !== r, We = V(i), [qe, Ye] = H(!1);
|
|
1254
|
+
z(() => {
|
|
1255
|
+
He.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
|
+
Ne.current = e, ke(e), We.current = i, Ye(!1);
|
|
1036
1262
|
}, [r]);
|
|
1037
|
-
let
|
|
1038
|
-
|
|
1039
|
-
if (
|
|
1263
|
+
let et = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), tt = V(!1);
|
|
1264
|
+
z(() => {
|
|
1265
|
+
if (Ue) return;
|
|
1040
1266
|
let e = {
|
|
1041
1267
|
name: r?.name ?? "",
|
|
1042
1268
|
description: r?.description ?? "",
|
|
1043
1269
|
instructions: r?.instructions ?? ""
|
|
1044
|
-
}, t = JSON.stringify(W) !== JSON.stringify(e) ||
|
|
1045
|
-
t !==
|
|
1270
|
+
}, t = JSON.stringify(W) !== JSON.stringify(e) || et(i) !== et(We.current) || qe;
|
|
1271
|
+
t !== tt.current && (tt.current = t, M?.(t));
|
|
1046
1272
|
}, [
|
|
1047
1273
|
W,
|
|
1048
1274
|
i,
|
|
1049
1275
|
r,
|
|
1050
|
-
|
|
1051
|
-
|
|
1276
|
+
Ue,
|
|
1277
|
+
qe,
|
|
1278
|
+
M
|
|
1052
1279
|
]);
|
|
1053
|
-
let [rt, it] = H(
|
|
1054
|
-
it(e),
|
|
1055
|
-
}, [
|
|
1280
|
+
let [rt, it] = H(Ze), q = s ?? rt, ot = R((e) => {
|
|
1281
|
+
it(e), d?.(e);
|
|
1282
|
+
}, [d]), [st, lt] = H([]), pt = p ?? st, mt = B(() => new Set(pt), [pt]), gt = R((e) => {
|
|
1056
1283
|
let t = [...e];
|
|
1057
|
-
|
|
1058
|
-
}, [
|
|
1059
|
-
|
|
1060
|
-
}, []), [
|
|
1061
|
-
|
|
1062
|
-
...
|
|
1284
|
+
lt(t), m?.(t);
|
|
1285
|
+
}, [m]), [vt, bt] = H(!1), [Y, X] = H(Ot), xt = R((e) => {
|
|
1286
|
+
X(e), bt(!0);
|
|
1287
|
+
}, []), [St, Ct] = H(!1), { isDragActive: wt, dropZoneHandlers: Tt } = ut(R((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 = Ee ?? {}, Q = U?.colors, $ = U?.typography ?? {}, It = $.titleClassName ?? "dial-body-semi-text", Lt = $.helperTextClassName ?? "dial-tiny-semi-text", Rt = $.removeIconClassName, zt = B(() => 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 = B(() => ({
|
|
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 = R((e) => {
|
|
1321
|
+
mt.has(e) || gt(/* @__PURE__ */ new Set([...mt, e]));
|
|
1322
|
+
}, [mt, gt]), Kt = Y.targetFolderPath, qt = B(() => ({
|
|
1323
|
+
...N,
|
|
1324
|
+
commitBatch: async (e) => {
|
|
1325
|
+
let t = await N.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
|
+
N,
|
|
1330
|
+
Kt,
|
|
1331
|
+
Gt
|
|
1332
|
+
]), Jt = ct({
|
|
1090
1333
|
files: i,
|
|
1091
|
-
fileActions:
|
|
1092
|
-
defaultName:
|
|
1093
|
-
messages:
|
|
1094
|
-
onRevealFolder:
|
|
1095
|
-
onCreated:
|
|
1096
|
-
}), { draftNode:
|
|
1097
|
-
path:
|
|
1098
|
-
name:
|
|
1099
|
-
kind:
|
|
1100
|
-
}, ...i]), [i]),
|
|
1334
|
+
fileActions: N,
|
|
1335
|
+
defaultName: Z.newFolderDefaultName ?? "New folder",
|
|
1336
|
+
messages: Wt,
|
|
1337
|
+
onRevealFolder: Gt,
|
|
1338
|
+
onCreated: ot
|
|
1339
|
+
}), { draftNode: Yt, draftPath: Xt, draftPane: Zt } = Jt, Qt = B(() => nt([{
|
|
1340
|
+
path: Ze,
|
|
1341
|
+
name: Ze,
|
|
1342
|
+
kind: Qe.File
|
|
1343
|
+
}, ...i]), [i]), $t = B(() => Yt ? nt([
|
|
1101
1344
|
{
|
|
1102
|
-
path:
|
|
1103
|
-
name:
|
|
1104
|
-
kind:
|
|
1345
|
+
path: Ze,
|
|
1346
|
+
name: Ze,
|
|
1347
|
+
kind: Qe.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 = B(() => i.find((e) => e.path === q), [i, q]), tn = R((e) => {
|
|
1356
|
+
e.path !== Xt && ot(e.path);
|
|
1357
|
+
}, [ot, Xt]), nn = R((e) => {
|
|
1358
|
+
N.onRemoveNode(e), q === e && ot(Ze);
|
|
1116
1359
|
}, [
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
]), { startDraft:
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1360
|
+
N,
|
|
1361
|
+
q,
|
|
1362
|
+
ot
|
|
1363
|
+
]), { startDraft: rn } = Jt, { onCreateFolder: an, extractArchive: on, pickFromFileSystem: sn } = N, [cn, ln] = H(null), un = R((e, t) => {
|
|
1364
|
+
t === J.Mobile ? ln(e) : rn(e, t);
|
|
1365
|
+
}, [rn]), dn = B(() => i.filter((e) => e.kind === Qe.File).map((e) => e.path), [i]), fn = R(async (e) => {
|
|
1366
|
+
if (!sn) return;
|
|
1367
|
+
let t = await sn();
|
|
1368
|
+
t?.length && xt({
|
|
1369
|
+
mode: dt.Files,
|
|
1125
1370
|
targetFolderPath: e,
|
|
1126
1371
|
initialEntries: t
|
|
1127
1372
|
});
|
|
1128
|
-
}, [
|
|
1129
|
-
let n = (e) =>
|
|
1130
|
-
return
|
|
1373
|
+
}, [sn, xt]), pn = R((e, t) => {
|
|
1374
|
+
let n = (e) => ft(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(ge),
|
|
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(ye),
|
|
1384
|
+
onClick: () => xt({
|
|
1385
|
+
mode: dt.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(he),
|
|
1392
|
+
onClick: () => xt({
|
|
1393
|
+
mode: dt.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(me),
|
|
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 = B(() => {
|
|
1415
|
+
let e = at($e.Header, i.find((e) => e.path === q));
|
|
1171
1416
|
return {
|
|
1172
|
-
[
|
|
1173
|
-
[
|
|
1417
|
+
[J.Mobile]: pn(e, J.Mobile),
|
|
1418
|
+
[J.Desktop]: pn(e, J.Desktop)
|
|
1174
1419
|
};
|
|
1175
1420
|
}, [
|
|
1176
|
-
|
|
1421
|
+
pn,
|
|
1177
1422
|
i,
|
|
1178
|
-
|
|
1179
|
-
]),
|
|
1180
|
-
if (e.path ===
|
|
1423
|
+
q
|
|
1424
|
+
]), hn = R((e, t) => {
|
|
1425
|
+
if (e.path === Xt || e.nodeType !== we.FOLDER) return [];
|
|
1181
1426
|
let n = {
|
|
1182
1427
|
path: e.path,
|
|
1183
1428
|
name: e.name,
|
|
1184
|
-
kind:
|
|
1185
|
-
}, r =
|
|
1429
|
+
kind: Qe.Folder
|
|
1430
|
+
}, r = pn(at($e.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: ft(ve, Rt),
|
|
1436
|
+
onClick: () => nn(e.path)
|
|
1197
1437
|
}), r;
|
|
1198
1438
|
}, [
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
[
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
onClick: () => qt(e.path)
|
|
1439
|
+
Xt,
|
|
1440
|
+
Z.deleteLabel,
|
|
1441
|
+
Rt,
|
|
1442
|
+
pn,
|
|
1443
|
+
nn
|
|
1444
|
+
]), gn = B(() => ({
|
|
1445
|
+
[J.Mobile]: (e) => hn(e, J.Mobile),
|
|
1446
|
+
[J.Desktop]: (e) => hn(e, J.Desktop)
|
|
1447
|
+
}), [hn]), _n = R((e) => e.nodeType === we.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ F(ee, {
|
|
1448
|
+
size: C.Small,
|
|
1449
|
+
icon: ft(ve, 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__ */ I("div", {
|
|
1218
1457
|
className: "flex flex-col gap-2 desktop:gap-5",
|
|
1219
1458
|
children: [/* @__PURE__ */ I("div", {
|
|
1220
1459
|
className: "flex items-center justify-between",
|
|
1221
1460
|
children: [/* @__PURE__ */ F("span", {
|
|
1222
|
-
className: c(
|
|
1223
|
-
children:
|
|
1224
|
-
}), /* @__PURE__ */ F(
|
|
1225
|
-
label:
|
|
1226
|
-
variant:
|
|
1227
|
-
appearance:
|
|
1228
|
-
size:
|
|
1229
|
-
items:
|
|
1461
|
+
className: c(Dt.title, It),
|
|
1462
|
+
children: Z.filesHeading ?? "Files"
|
|
1463
|
+
}), /* @__PURE__ */ F(g, {
|
|
1464
|
+
label: Z.addLabel ?? "Add",
|
|
1465
|
+
variant: _.Neutral,
|
|
1466
|
+
appearance: h.Solid,
|
|
1467
|
+
size: C.Small,
|
|
1468
|
+
items: mn[e]
|
|
1230
1469
|
})]
|
|
1231
1470
|
}), /* @__PURE__ */ F("div", {
|
|
1232
1471
|
role: "tree",
|
|
1233
|
-
"aria-label":
|
|
1234
|
-
children: /* @__PURE__ */ F(
|
|
1235
|
-
items:
|
|
1472
|
+
"aria-label": Z.filesTreeAriaLabel ?? "Skill files",
|
|
1473
|
+
children: /* @__PURE__ */ F(Te, {
|
|
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: q,
|
|
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
|
-
}),
|
|
1489
|
+
}), yn = B(() => ({
|
|
1251
1490
|
name: W.name,
|
|
1252
1491
|
description: W.description,
|
|
1253
1492
|
iconUrl: "",
|
|
1254
1493
|
version: "",
|
|
1255
1494
|
topics: [],
|
|
1256
1495
|
otherLocales: []
|
|
1257
|
-
}), [W.name, W.description]),
|
|
1496
|
+
}), [W.name, W.description]), bn = B(() => ({
|
|
1258
1497
|
name: k?.name,
|
|
1259
1498
|
description: k?.description
|
|
1260
|
-
}), [k?.name, k?.description]),
|
|
1261
|
-
...
|
|
1499
|
+
}), [k?.name, k?.description]), xn = B(() => ({ 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 && K({ name: e.name }), e.description !== void 0 && (Fe.reset(), K({ description: e.description }));
|
|
1517
|
+
}, Cn = ae ? (e, t) => /* @__PURE__ */ F(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: Fe,
|
|
1524
|
+
disabled: Le || 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: _e,
|
|
1529
|
+
onBack: Be,
|
|
1530
|
+
onCancel: ze,
|
|
1531
|
+
onSubmit: Ve,
|
|
1532
|
+
submitLabel: Z.createLabel ?? "Create",
|
|
1533
|
+
isSubmitDisabled: Le || x || E,
|
|
1295
1534
|
labels: {
|
|
1296
|
-
cancelLabel:
|
|
1297
|
-
backAriaLabel:
|
|
1298
|
-
savingStatusLabel:
|
|
1535
|
+
cancelLabel: Z.cancelLabel ?? "Cancel",
|
|
1536
|
+
backAriaLabel: L ?? "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__ */ F("div", {
|
|
1543
|
+
dir: De,
|
|
1305
1544
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1306
|
-
children: /* @__PURE__ */ F(
|
|
1307
|
-
...
|
|
1545
|
+
children: /* @__PURE__ */ F(Ge, {
|
|
1546
|
+
...wn,
|
|
1308
1547
|
metadata: /* @__PURE__ */ F("div", {
|
|
1309
|
-
role: "status",
|
|
1310
|
-
"aria-label": Q.loadingAriaLabel ?? "Loading skill",
|
|
1311
1548
|
className: "flex flex-1 items-center justify-center p-8",
|
|
1312
|
-
children: /* @__PURE__ */ F(
|
|
1549
|
+
children: /* @__PURE__ */ F(le, { ariaLabel: Z.loadingAriaLabel ?? "Loading skill" })
|
|
1313
1550
|
})
|
|
1314
1551
|
})
|
|
1315
1552
|
});
|
|
1316
|
-
if (
|
|
1317
|
-
dir:
|
|
1553
|
+
if (E) return /* @__PURE__ */ F("div", {
|
|
1554
|
+
dir: De,
|
|
1318
1555
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1319
|
-
children: /* @__PURE__ */ F(
|
|
1320
|
-
...
|
|
1321
|
-
metadata: /* @__PURE__ */
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1556
|
+
children: /* @__PURE__ */ F(Ge, {
|
|
1557
|
+
...wn,
|
|
1558
|
+
metadata: /* @__PURE__ */ F("div", {
|
|
1559
|
+
className: "p-8",
|
|
1560
|
+
children: /* @__PURE__ */ F(w, {
|
|
1561
|
+
message: Z.loadErrorMessage ?? "Couldn't load this skill. Please try again.",
|
|
1562
|
+
iconStroke: b,
|
|
1563
|
+
action: /* @__PURE__ */ F(oe, {
|
|
1564
|
+
label: Z.retryLabel ?? "Retry",
|
|
1565
|
+
onClick: xe
|
|
1566
|
+
})
|
|
1567
|
+
})
|
|
1328
1568
|
})
|
|
1329
1569
|
})
|
|
1330
1570
|
});
|
|
1331
|
-
let
|
|
1571
|
+
let Tn = q === Ze, En = Tn ? Ze : Z.selectedFileHeading?.(en?.name ?? q) ?? en?.name ?? q, Dn = j != null || te != null ? /* @__PURE__ */ I("div", {
|
|
1332
1572
|
className: "flex flex-col gap-2",
|
|
1333
|
-
children: [
|
|
1573
|
+
children: [j != null && /* @__PURE__ */ I("div", {
|
|
1334
1574
|
className: "flex items-center gap-2",
|
|
1335
|
-
children: [/* @__PURE__ */ F(
|
|
1336
|
-
label:
|
|
1337
|
-
onClick:
|
|
1575
|
+
children: [/* @__PURE__ */ F(T, { text: j }), Se != null && /* @__PURE__ */ F(O, {
|
|
1576
|
+
label: Z.retryLabel ?? "Retry",
|
|
1577
|
+
onClick: Se
|
|
1338
1578
|
})]
|
|
1339
1579
|
}), te != null && /* @__PURE__ */ I("div", {
|
|
1340
1580
|
className: "flex items-center gap-2",
|
|
1341
|
-
children: [/* @__PURE__ */ F(
|
|
1342
|
-
label:
|
|
1343
|
-
onClick:
|
|
1581
|
+
children: [/* @__PURE__ */ F(T, { text: te.message }), /* @__PURE__ */ F(O, {
|
|
1582
|
+
label: Z.reloadLatestLabel ?? "Reload latest",
|
|
1583
|
+
onClick: ne
|
|
1344
1584
|
})]
|
|
1345
1585
|
})]
|
|
1346
|
-
}) : void 0,
|
|
1586
|
+
}) : void 0, On = /* @__PURE__ */ F(a, {
|
|
1347
1587
|
isEnabled: !!se,
|
|
1348
|
-
fieldId:
|
|
1588
|
+
fieldId: Ae,
|
|
1349
1589
|
required: !0,
|
|
1350
|
-
labelClassName: c(
|
|
1351
|
-
label:
|
|
1352
|
-
labels:
|
|
1353
|
-
refinement:
|
|
1354
|
-
disabled:
|
|
1355
|
-
...
|
|
1590
|
+
labelClassName: c(Dt.helperText, Lt),
|
|
1591
|
+
label: Z.instructionsLabel ?? "Instructions",
|
|
1592
|
+
labels: Z,
|
|
1593
|
+
refinement: Ie,
|
|
1594
|
+
disabled: Le || D,
|
|
1595
|
+
...Ht,
|
|
1356
1596
|
children: /* @__PURE__ */ I("div", {
|
|
1357
1597
|
className: "flex flex-1 flex-col gap-2",
|
|
1358
1598
|
children: [
|
|
1359
|
-
!se && /* @__PURE__ */ F(
|
|
1360
|
-
htmlFor:
|
|
1361
|
-
className: c(
|
|
1362
|
-
label:
|
|
1599
|
+
!se && /* @__PURE__ */ F(A, {
|
|
1600
|
+
htmlFor: Ae,
|
|
1601
|
+
className: c(Dt.helperText, Lt),
|
|
1602
|
+
label: Z.instructionsLabel ?? "Instructions",
|
|
1363
1603
|
required: !0
|
|
1364
1604
|
}),
|
|
1365
1605
|
/* @__PURE__ */ F("div", {
|
|
1366
|
-
ref:
|
|
1606
|
+
ref: Me,
|
|
1367
1607
|
className: c(t, e, n),
|
|
1368
|
-
children: /* @__PURE__ */ F(
|
|
1369
|
-
fallback: /* @__PURE__ */ F(
|
|
1370
|
-
children: /* @__PURE__ */ F(
|
|
1371
|
-
id:
|
|
1372
|
-
ariaLabel:
|
|
1608
|
+
children: /* @__PURE__ */ F(be, {
|
|
1609
|
+
fallback: /* @__PURE__ */ F(le, { ariaLabel: Z.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
1610
|
+
children: /* @__PURE__ */ F(Ft, {
|
|
1611
|
+
id: Ae,
|
|
1612
|
+
ariaLabel: Z.instructionsLabel ?? "Instructions",
|
|
1373
1613
|
value: W.instructions,
|
|
1374
1614
|
onChange: (e) => {
|
|
1375
|
-
|
|
1615
|
+
Ie.reset(), K({ instructions: e });
|
|
1376
1616
|
},
|
|
1377
|
-
theme:
|
|
1617
|
+
theme: Oe,
|
|
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__ */ F(
|
|
1623
|
+
k?.instructions != null && /* @__PURE__ */ F(T, {
|
|
1624
|
+
id: je,
|
|
1625
|
+
text: k.instructions
|
|
1626
|
+
})
|
|
1384
1627
|
]
|
|
1385
1628
|
})
|
|
1386
1629
|
});
|
|
1387
1630
|
return /* @__PURE__ */ I("div", {
|
|
1388
|
-
dir:
|
|
1389
|
-
className: c("relative flex min-h-0 flex-1 flex-col",
|
|
1390
|
-
style:
|
|
1391
|
-
...
|
|
1631
|
+
dir: De,
|
|
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__ */ F(
|
|
1394
|
-
isVisible:
|
|
1395
|
-
labels:
|
|
1636
|
+
/* @__PURE__ */ F(_t, {
|
|
1637
|
+
isVisible: wt && !vt,
|
|
1638
|
+
labels: Ee,
|
|
1639
|
+
titleClassName: $.dropOverlayTitleClassName,
|
|
1640
|
+
subtitleClassName: $.dropOverlaySubtitleClassName
|
|
1396
1641
|
}),
|
|
1397
|
-
/* @__PURE__ */ F(
|
|
1398
|
-
...
|
|
1399
|
-
asideData:
|
|
1400
|
-
asideSectionClassName:
|
|
1401
|
-
isSubmitting:
|
|
1402
|
-
metadataSectionClassName:
|
|
1642
|
+
/* @__PURE__ */ F(Ge, {
|
|
1643
|
+
...wn,
|
|
1644
|
+
asideData: ue,
|
|
1645
|
+
asideSectionClassName: Nt,
|
|
1646
|
+
isSubmitting: D,
|
|
1647
|
+
metadataSectionClassName: Mt,
|
|
1403
1648
|
metadata: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
|
|
1404
1649
|
className: "desktop:hidden",
|
|
1405
|
-
children: /* @__PURE__ */ F(
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
onToggle:
|
|
1410
|
-
|
|
1411
|
-
|
|
1650
|
+
children: /* @__PURE__ */ F(yt, {
|
|
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(J.Mobile)
|
|
1412
1658
|
})
|
|
1413
1659
|
}), /* @__PURE__ */ F("div", {
|
|
1414
1660
|
className: "hidden desktop:block",
|
|
1415
|
-
children:
|
|
1661
|
+
children: vn(J.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__ */ I(P, { children: [/* @__PURE__ */ F(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: re,
|
|
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__ */ F(P, { children: en?.kind === Qe.File && /* @__PURE__ */ F("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: ce ?? /* @__PURE__ */ F(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__ */ F(
|
|
1436
|
-
isOpen:
|
|
1437
|
-
onClose: () =>
|
|
1438
|
-
fileActions:
|
|
1439
|
-
mode:
|
|
1440
|
-
targetFolderPath:
|
|
1441
|
-
initialFiles:
|
|
1442
|
-
initialEntries:
|
|
1443
|
-
|
|
1682
|
+
/* @__PURE__ */ F(Et, {
|
|
1683
|
+
isOpen: vt,
|
|
1684
|
+
onClose: () => bt(!1),
|
|
1685
|
+
fileActions: qt,
|
|
1686
|
+
mode: Y.mode,
|
|
1687
|
+
targetFolderPath: Y.targetFolderPath,
|
|
1688
|
+
initialFiles: Y.initialFiles,
|
|
1689
|
+
initialEntries: Y.initialEntries,
|
|
1690
|
+
existingFilePaths: dn,
|
|
1691
|
+
onCommitted: (e) => {
|
|
1692
|
+
e.some((e) => e.replacesExisting) && Ye(!0);
|
|
1693
|
+
},
|
|
1694
|
+
messageClassName: $.uploadMessageClassName,
|
|
1695
|
+
rowCaptionClassName: $.uploadRowCaptionClassName,
|
|
1696
|
+
labels: Ee,
|
|
1697
|
+
dialogColors: Vt,
|
|
1698
|
+
colors: {
|
|
1699
|
+
invalidDropZoneBorder: Q?.uploadInvalidDropZoneBorder,
|
|
1700
|
+
rowBorder: Q?.uploadRowBorder
|
|
1701
|
+
}
|
|
1702
|
+
}),
|
|
1703
|
+
/* @__PURE__ */ F(ht, {
|
|
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, $ as SkillEditor, bt as SkillFileCandidateKind, Qe as SkillFileNodeKind, dt as SkillFileUploadMode, Y as SkillFileValidationStatus };
|