@epam/ai-dial-skill-editor 1.2.0-dev.48 → 1.2.0-dev.58
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkillEditor.d.ts","sourceRoot":"","sources":["../../../src/components/SkillEditor/SkillEditor.tsx"],"names":[],"mappings":"AAiCA,OAAO,0CAA0C,CAAC;AAClD,OAAO,0CAA0C,CAAC;AAClD,OAAO,EAEL,EAAE,EAQH,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SkillEditor.d.ts","sourceRoot":"","sources":["../../../src/components/SkillEditor/SkillEditor.tsx"],"names":[],"mappings":"AAiCA,OAAO,0CAA0C,CAAC;AAClD,OAAO,0CAA0C,CAAC;AAClD,OAAO,EAEL,EAAE,EAQH,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,iCAAiC,CAAC;AAsBzC,qFAAqF;AACrF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA8e5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,kBAAkB;IAC7B,mEAAmE;;CAE3D,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { SkillEditor } from './components/SkillEditor/SkillEditor';
|
|
|
2
2
|
export type { SkillEditorColors, SkillEditorConflict, SkillEditorErrors, SkillEditorFileActions, SkillEditorLabels, SkillEditorProps, SkillEditorStyles, SkillEditorTypography, SkillEditorValues, SkillFileBatchError, SkillFileCommitResult, SkillFileTreeNode, SkillFileUploadCandidate, SkillFileValidationResult, } from './models/skill-editor-props';
|
|
3
3
|
export { SkillFileCandidateKind, SkillFileValidationStatus, } from './models/skill-editor-props';
|
|
4
4
|
export { SkillFileNodeKind } from './types/skill-file-node-kind';
|
|
5
|
+
export { SKILL_EDITOR_CLASS } from './constants/public-class-names';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as t, buildCssVars as n, formatFileSize as r, mergeClasses as i, useAvailableHeightCap as a } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { Accordion as o, CaptionText as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, EditorThemes as u, ErrorText as d, FileDropzone as f, GhostButton as ee, GhostIconButton as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { IconArrowNarrowLeft as
|
|
5
|
-
import { Suspense as
|
|
6
|
-
import { DialFileNodeType as
|
|
7
|
-
import { LazyMarkdownEditor as
|
|
8
|
-
|
|
2
|
+
import { Accordion as o, CaptionText as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, EditorThemes as u, ErrorText as d, FileDropzone as f, GhostButton as ee, GhostIconButton as p, Input as m, NeutralButton as h, Popup as g, PopupSize as te, PrimaryButton as ne, Spinner as _, Textarea as v } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
4
|
+
import { IconArrowNarrowLeft as S, IconFileText as re, IconPlus as ie, IconTrashX as ae, IconUpload as C } from "@tabler/icons-react";
|
|
5
|
+
import { Suspense as w, lazy as T, useCallback as E, useEffect as D, useId as O, useMemo as k, useRef as A, useState as j } from "react";
|
|
6
|
+
import { DialFileNodeType as M, DialFoldersTree as oe } from "@epam/ai-dial-react-file-manager";
|
|
7
|
+
import { LazyMarkdownEditor as N } from "@epam/ai-dial-ui-kit/editors";
|
|
8
|
+
//#region ../builder-form/src/constants/public-class-names.ts
|
|
9
|
+
var se = {
|
|
10
|
+
layout: "dial-builder-form-layout",
|
|
11
|
+
section: "dial-builder-form-section"
|
|
12
|
+
}, P = {
|
|
9
13
|
headerBorder: "_headerBorder_1kidu_1",
|
|
10
14
|
footerBorder: "_footerBorder_1kidu_5",
|
|
11
15
|
sidebarBorder: "_sidebarBorder_1kidu_9"
|
|
12
|
-
},
|
|
13
|
-
let
|
|
14
|
-
|
|
16
|
+
}, ce = ({ title: e, onBack: t, backAriaLabel: r = "Back", actions: a, leftContent: o, rightContent: s, isSaving: u = !1, labels: d, styles: f, dir: ee }) => {
|
|
17
|
+
let m = O(), h = u ? d?.savingStatusLabel ?? "Saving" : "", g = n({
|
|
18
|
+
"--el-header-border-color": f?.colors?.headerBorderColor,
|
|
19
|
+
"--el-sidebar-border-color": f?.colors?.sidebarBorderColor
|
|
20
|
+
});
|
|
21
|
+
return /* @__PURE__ */ x("div", {
|
|
15
22
|
dir: ee,
|
|
16
|
-
className: "flex min-h-0 flex-1 flex-col",
|
|
17
|
-
style:
|
|
18
|
-
"--el-header-border-color": f?.colors?.headerBorderColor,
|
|
19
|
-
"--el-sidebar-border-color": f?.colors?.sidebarBorderColor
|
|
20
|
-
}),
|
|
23
|
+
className: i("flex min-h-0 flex-1 flex-col", se.layout),
|
|
24
|
+
style: g,
|
|
21
25
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ b("span", {
|
|
23
27
|
role: "status",
|
|
24
28
|
"aria-live": "polite",
|
|
25
29
|
className: "sr-only",
|
|
26
|
-
id:
|
|
27
|
-
children:
|
|
30
|
+
id: m,
|
|
31
|
+
children: h
|
|
28
32
|
}),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
className: i("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3",
|
|
31
|
-
children: [/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ x("div", {
|
|
34
|
+
className: i("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", P.headerBorder),
|
|
35
|
+
children: [/* @__PURE__ */ x("div", {
|
|
32
36
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
34
|
-
icon: /* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ b(p, {
|
|
38
|
+
icon: /* @__PURE__ */ b(S, {
|
|
35
39
|
size: c.LG,
|
|
36
40
|
stroke: l,
|
|
37
41
|
"aria-hidden": !0,
|
|
@@ -39,91 +43,91 @@ var M = {
|
|
|
39
43
|
}),
|
|
40
44
|
"aria-label": r,
|
|
41
45
|
onClick: t
|
|
42
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ b("h1", {
|
|
43
47
|
className: "dial-h2-text min-w-0 truncate",
|
|
44
48
|
children: e
|
|
45
49
|
})]
|
|
46
|
-
}), a != null && /* @__PURE__ */
|
|
50
|
+
}), a != null && /* @__PURE__ */ b("div", {
|
|
47
51
|
className: "hidden shrink-0 items-center gap-2 desktop:flex",
|
|
48
52
|
children: a
|
|
49
53
|
})]
|
|
50
54
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ x("div", {
|
|
52
56
|
className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
|
|
53
|
-
children: [/* @__PURE__ */
|
|
54
|
-
className: i(s == null ? "desktop:flex-1" : "desktop:w-[360px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", s == null ? void 0 :
|
|
57
|
+
children: [/* @__PURE__ */ b("div", {
|
|
58
|
+
className: i(s == null ? "desktop:flex-1" : "desktop:w-[360px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", s == null ? void 0 : P.sidebarBorder),
|
|
55
59
|
children: o
|
|
56
|
-
}), s != null && /* @__PURE__ */
|
|
60
|
+
}), s != null && /* @__PURE__ */ b("div", {
|
|
57
61
|
className: "desktop:flex-1 desktop:overflow-y-auto",
|
|
58
62
|
children: s
|
|
59
63
|
})]
|
|
60
64
|
}),
|
|
61
|
-
a != null && /* @__PURE__ */
|
|
62
|
-
className: i("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1",
|
|
65
|
+
a != null && /* @__PURE__ */ b("div", {
|
|
66
|
+
className: i("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", P.footerBorder),
|
|
63
67
|
children: a
|
|
64
68
|
})
|
|
65
69
|
]
|
|
66
70
|
});
|
|
67
|
-
},
|
|
68
|
-
let [t, n] =
|
|
71
|
+
}, le = { root: "dial-skill-editor-root" }, F = (e) => !!e.dataTransfer?.types.includes("Files"), ue = (e) => {
|
|
72
|
+
let [t, n] = j(!1), r = A(0);
|
|
69
73
|
return {
|
|
70
74
|
isDragActive: t,
|
|
71
75
|
dropZoneHandlers: {
|
|
72
|
-
onDragEnter:
|
|
73
|
-
|
|
76
|
+
onDragEnter: E((e) => {
|
|
77
|
+
F(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
74
78
|
}, []),
|
|
75
|
-
onDragLeave:
|
|
76
|
-
|
|
79
|
+
onDragLeave: E((e) => {
|
|
80
|
+
F(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
77
81
|
}, []),
|
|
78
|
-
onDragOver:
|
|
79
|
-
|
|
82
|
+
onDragOver: E((e) => {
|
|
83
|
+
F(e) && e.preventDefault();
|
|
80
84
|
}, []),
|
|
81
|
-
onDrop:
|
|
82
|
-
if (!
|
|
85
|
+
onDrop: E((t) => {
|
|
86
|
+
if (!F(t)) return;
|
|
83
87
|
t.preventDefault(), r.current = 0, n(!1);
|
|
84
88
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
85
89
|
i.length > 0 && e(i);
|
|
86
90
|
}, [e])
|
|
87
91
|
}
|
|
88
92
|
};
|
|
89
|
-
},
|
|
93
|
+
}, I = "SKILL.md", L = /* @__PURE__ */ function(e) {
|
|
90
94
|
return e.File = "file", e.Folder = "folder", e;
|
|
91
|
-
}({}),
|
|
95
|
+
}({}), R = (e) => {
|
|
92
96
|
let t = e.lastIndexOf("/");
|
|
93
97
|
return t === -1 ? null : e.slice(0, t);
|
|
94
|
-
},
|
|
98
|
+
}, de = (e) => {
|
|
95
99
|
let t = e.lastIndexOf("/");
|
|
96
100
|
return t === -1 ? e : e.slice(t + 1);
|
|
97
|
-
},
|
|
101
|
+
}, fe = (e) => {
|
|
98
102
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
99
103
|
let n = t.get(e);
|
|
100
104
|
if (n) return n;
|
|
101
105
|
let r = {
|
|
102
106
|
path: e,
|
|
103
|
-
name:
|
|
104
|
-
nodeType:
|
|
105
|
-
parentPath:
|
|
107
|
+
name: de(e),
|
|
108
|
+
nodeType: M.FOLDER,
|
|
109
|
+
parentPath: R(e),
|
|
106
110
|
folderId: e,
|
|
107
111
|
items: []
|
|
108
112
|
};
|
|
109
113
|
return t.set(e, r), r;
|
|
110
114
|
};
|
|
111
115
|
for (let r of e) {
|
|
112
|
-
if (r.kind ===
|
|
116
|
+
if (r.kind === L.Folder) {
|
|
113
117
|
n(r.path);
|
|
114
118
|
continue;
|
|
115
119
|
}
|
|
116
120
|
t.set(r.path, {
|
|
117
121
|
path: r.path,
|
|
118
122
|
name: r.name,
|
|
119
|
-
nodeType:
|
|
120
|
-
parentPath:
|
|
121
|
-
folderId:
|
|
123
|
+
nodeType: M.ITEM,
|
|
124
|
+
parentPath: R(r.path),
|
|
125
|
+
folderId: R(r.path) ?? ""
|
|
122
126
|
});
|
|
123
127
|
}
|
|
124
128
|
for (let t of [...e]) {
|
|
125
|
-
let e =
|
|
126
|
-
for (; e != null;) n(e), e =
|
|
129
|
+
let e = R(t.path);
|
|
130
|
+
for (; e != null;) n(e), e = R(e);
|
|
127
131
|
}
|
|
128
132
|
let r = [];
|
|
129
133
|
for (let e of t.values()) {
|
|
@@ -135,462 +139,462 @@ var M = {
|
|
|
135
139
|
n ? n.items = [...n.items ?? [], e] : r.push(e);
|
|
136
140
|
}
|
|
137
141
|
return r;
|
|
138
|
-
},
|
|
142
|
+
}, pe = ({ isVisible: e, labels: t }) => {
|
|
139
143
|
if (!e) return null;
|
|
140
144
|
let n = t ?? {};
|
|
141
|
-
return /* @__PURE__ */
|
|
145
|
+
return /* @__PURE__ */ b("div", {
|
|
142
146
|
role: "status",
|
|
143
147
|
"aria-live": "polite",
|
|
144
148
|
className: i("pointer-events-none absolute inset-0 z-[100] flex items-center justify-center backdrop-blur-sm"),
|
|
145
|
-
children: /* @__PURE__ */
|
|
149
|
+
children: /* @__PURE__ */ x("div", {
|
|
146
150
|
className: "flex flex-col items-center text-center",
|
|
147
151
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ b(C, {
|
|
149
153
|
size: 100,
|
|
150
154
|
className: "text-accent-primary",
|
|
151
155
|
"aria-hidden": !0,
|
|
152
156
|
stroke: l
|
|
153
157
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ b("span", {
|
|
155
159
|
className: "dial-h3-text mt-5",
|
|
156
160
|
children: n.dropOverlayTitle ?? "Upload files"
|
|
157
161
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ b("span", {
|
|
159
163
|
className: "dial-small-text mt-4",
|
|
160
164
|
children: n.dropOverlaySubtitle ?? "Drop files here to add them to this skill"
|
|
161
165
|
})
|
|
162
166
|
]
|
|
163
167
|
})
|
|
164
168
|
});
|
|
165
|
-
},
|
|
169
|
+
}, z = /* @__PURE__ */ function(e) {
|
|
166
170
|
return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
|
|
167
|
-
}({}),
|
|
171
|
+
}({}), B = /* @__PURE__ */ function(e) {
|
|
168
172
|
return e.Valid = "valid", e.Invalid = "invalid", e;
|
|
169
|
-
}({}),
|
|
170
|
-
let o = a ?? {}, [s, c] =
|
|
173
|
+
}({}), V = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), H = 0, U = () => `skill-file-candidate-${++H}`, me = ({ isOpen: e, onClose: t, fileActions: n, initialFiles: i, labels: a }) => {
|
|
174
|
+
let o = a ?? {}, [s, c] = j([]), [u, m] = j(/* @__PURE__ */ new Map()), [h, v] = j([]), [S, ie] = j(!1), [C, w] = j(), [T, E] = j(!1), k = O(), A = (e) => {
|
|
171
175
|
let t = e.map((e) => ({
|
|
172
|
-
id:
|
|
176
|
+
id: U(),
|
|
173
177
|
file: e,
|
|
174
|
-
path:
|
|
178
|
+
path: V(e)
|
|
175
179
|
}));
|
|
176
|
-
|
|
177
|
-
},
|
|
180
|
+
w(void 0), c((e) => [...e, ...t]);
|
|
181
|
+
}, M = (e) => {
|
|
178
182
|
c((t) => t.filter((t) => t.id !== e));
|
|
179
183
|
};
|
|
180
|
-
|
|
184
|
+
D(() => {
|
|
181
185
|
e && (c((i ?? []).map((e) => ({
|
|
182
|
-
id:
|
|
186
|
+
id: U(),
|
|
183
187
|
file: e,
|
|
184
|
-
path:
|
|
185
|
-
}))),
|
|
186
|
-
}, [e]),
|
|
188
|
+
path: V(e)
|
|
189
|
+
}))), m(/* @__PURE__ */ new Map()), v([]), w(void 0));
|
|
190
|
+
}, [e]), D(() => {
|
|
187
191
|
if (!e) return;
|
|
188
192
|
let t = !1;
|
|
189
193
|
if (s.length === 0) {
|
|
190
|
-
|
|
194
|
+
m(/* @__PURE__ */ new Map()), v([]);
|
|
191
195
|
return;
|
|
192
196
|
}
|
|
193
|
-
return
|
|
194
|
-
t || (
|
|
197
|
+
return ie(!0), n.validateBatch(s).then(({ results: e, batchErrors: n }) => {
|
|
198
|
+
t || (m(new Map(e.map((e) => [e.candidateId, e]))), v(n.map((e) => e.message)));
|
|
195
199
|
}).finally(() => {
|
|
196
|
-
t ||
|
|
200
|
+
t || ie(!1);
|
|
197
201
|
}), () => {
|
|
198
202
|
t = !0;
|
|
199
203
|
};
|
|
200
204
|
}, [s, e]);
|
|
201
|
-
let
|
|
202
|
-
|
|
205
|
+
let oe = s.some((e) => u.get(e.id)?.status === B.Invalid), N = s.length > 0 && s.every((e) => u.get(e.id)?.status === B.Invalid), se = s.length > 0 && !oe && h.length === 0 && !S && !T, P = async () => {
|
|
206
|
+
E(!0), w(void 0);
|
|
203
207
|
try {
|
|
204
208
|
let { results: e, batchErrors: r } = await n.validateBatch(s), i = new Map(e.map((e) => [e.candidateId, e]));
|
|
205
|
-
if (
|
|
209
|
+
if (m(i), v(r.map((e) => e.message)), s.some((e) => i.get(e.id)?.status === B.Invalid) || r.length > 0) return;
|
|
206
210
|
let a = await n.commitBatch(s);
|
|
207
211
|
if (a.error) {
|
|
208
|
-
|
|
212
|
+
w(a.error);
|
|
209
213
|
return;
|
|
210
214
|
}
|
|
211
215
|
t();
|
|
212
216
|
} finally {
|
|
213
|
-
|
|
217
|
+
E(!1);
|
|
214
218
|
}
|
|
215
219
|
};
|
|
216
|
-
return /* @__PURE__ */
|
|
220
|
+
return /* @__PURE__ */ b(g, {
|
|
217
221
|
open: e,
|
|
218
222
|
header: o.uploadDialogTitle ?? "Upload files from device",
|
|
219
|
-
size:
|
|
223
|
+
size: te.Sm,
|
|
220
224
|
closeAriaLabel: o.uploadDialogCloseAriaLabel ?? "Close",
|
|
221
225
|
onClose: t,
|
|
222
|
-
footer: /* @__PURE__ */
|
|
226
|
+
footer: /* @__PURE__ */ x("div", {
|
|
223
227
|
className: "flex min-h-[44px] items-center justify-end gap-2 px-6 py-4",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ b(ee, {
|
|
225
229
|
label: o.uploadCancelLabel ?? "Cancel",
|
|
226
230
|
onClick: t
|
|
227
|
-
}), /* @__PURE__ */
|
|
231
|
+
}), /* @__PURE__ */ b(ne, {
|
|
228
232
|
label: o.uploadConfirmLabel ?? "Add",
|
|
229
|
-
iconBefore:
|
|
233
|
+
iconBefore: T ? /* @__PURE__ */ b(_, {
|
|
230
234
|
size: 16,
|
|
231
235
|
ariaLabel: ""
|
|
232
236
|
}) : void 0,
|
|
233
|
-
onClick: () => void
|
|
234
|
-
disabled: !
|
|
237
|
+
onClick: () => void P(),
|
|
238
|
+
disabled: !se
|
|
235
239
|
})]
|
|
236
240
|
}),
|
|
237
|
-
children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ x("div", {
|
|
238
242
|
className: "flex flex-col gap-4 px-6 py-4",
|
|
239
243
|
children: [
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
label: /* @__PURE__ */ y
|
|
244
|
+
/* @__PURE__ */ b(f, {
|
|
245
|
+
label: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
|
|
242
246
|
className: "desktop:hidden",
|
|
243
247
|
children: o.uploadDropZoneMobileLabel ?? "Click here to upload"
|
|
244
|
-
}), /* @__PURE__ */
|
|
248
|
+
}), /* @__PURE__ */ b("span", {
|
|
245
249
|
className: "hidden desktop:inline",
|
|
246
250
|
children: o.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
|
|
247
251
|
})] }),
|
|
248
252
|
ariaLabel: o.uploadDropZoneAriaLabel ?? "Upload files",
|
|
249
253
|
multiple: !0,
|
|
250
|
-
className:
|
|
251
|
-
onChange:
|
|
254
|
+
className: N ? "border-error hover:border-error" : void 0,
|
|
255
|
+
onChange: A
|
|
252
256
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ b("span", {
|
|
254
258
|
role: "status",
|
|
255
259
|
"aria-live": "polite",
|
|
256
260
|
className: "sr-only",
|
|
257
|
-
id:
|
|
258
|
-
children:
|
|
261
|
+
id: k,
|
|
262
|
+
children: h.map((e) => `${o.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
|
|
259
263
|
}),
|
|
260
|
-
|
|
261
|
-
s.length > 0 && /* @__PURE__ */
|
|
264
|
+
h.map((e) => /* @__PURE__ */ b(d, { text: e }, e)),
|
|
265
|
+
s.length > 0 && /* @__PURE__ */ b("ul", {
|
|
262
266
|
className: "flex flex-col gap-2",
|
|
263
267
|
children: s.map((e) => {
|
|
264
|
-
let t = u.get(e.id), n = t?.kind ===
|
|
265
|
-
return /* @__PURE__ */
|
|
268
|
+
let t = u.get(e.id), n = t?.kind === z.Manifest, i = t?.status === B.Invalid;
|
|
269
|
+
return /* @__PURE__ */ x("li", {
|
|
266
270
|
className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
|
|
267
271
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ b(re, {
|
|
269
273
|
size: 20,
|
|
270
274
|
"aria-hidden": !0,
|
|
271
275
|
stroke: l
|
|
272
276
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ x("div", {
|
|
274
278
|
className: "flex min-w-0 flex-1 flex-col",
|
|
275
279
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ b("span", {
|
|
277
281
|
className: "dial-small-text truncate",
|
|
278
282
|
children: e.path
|
|
279
283
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ b("span", {
|
|
281
285
|
className: "dial-tiny-text text-secondary",
|
|
282
286
|
children: r(e.file.size)
|
|
283
287
|
}),
|
|
284
|
-
i && t?.error && /* @__PURE__ */
|
|
285
|
-
n && !i && /* @__PURE__ */
|
|
288
|
+
i && t?.error && /* @__PURE__ */ b(d, { text: t.error }),
|
|
289
|
+
n && !i && /* @__PURE__ */ b("span", {
|
|
286
290
|
className: "dial-tiny-text text-secondary",
|
|
287
291
|
children: o.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
|
|
288
292
|
})
|
|
289
293
|
]
|
|
290
294
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
icon: /* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ b(p, {
|
|
296
|
+
icon: /* @__PURE__ */ b(ae, {
|
|
293
297
|
size: 16,
|
|
294
298
|
"aria-hidden": !0,
|
|
295
299
|
stroke: l
|
|
296
300
|
}),
|
|
297
301
|
"aria-label": o.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
|
|
298
|
-
onClick: () =>
|
|
302
|
+
onClick: () => M(e.id)
|
|
299
303
|
})
|
|
300
304
|
]
|
|
301
305
|
}, e.id);
|
|
302
306
|
})
|
|
303
307
|
}),
|
|
304
|
-
|
|
308
|
+
C && /* @__PURE__ */ b(d, { text: C })
|
|
305
309
|
]
|
|
306
310
|
})
|
|
307
311
|
});
|
|
308
|
-
},
|
|
312
|
+
}, he = {
|
|
309
313
|
title: "_title_65glc_1",
|
|
310
314
|
helperText: "_helperText_65glc_5"
|
|
311
|
-
},
|
|
312
|
-
let { MarkdownEditor: e } = await
|
|
315
|
+
}, ge = T(async () => {
|
|
316
|
+
let { MarkdownEditor: e } = await N();
|
|
313
317
|
return { default: e };
|
|
314
|
-
}),
|
|
315
|
-
let [
|
|
318
|
+
}), _e = ({ initialValues: r, files: f, selectedPath: p, onSelectedPathChange: g, expandedPaths: te, onExpandedPathsChange: S, isLoading: re = !1, hasLoadError: C = !1, isSubmitting: T = !1, errors: O, submitError: M, conflict: N, onReloadLatest: se, isNameReadOnly: P = !1, onDirtyChange: F, fileActions: R, supportingFileContent: de, onSubmit: z, onCancel: B, onBack: V, backAriaLabel: H, title: U, onRetry: _e, labels: ve, styles: ye, dir: be, instructionsEditorTheme: xe = u.light }) => {
|
|
319
|
+
let [W, G] = j({
|
|
316
320
|
name: r?.name ?? "",
|
|
317
321
|
description: r?.description ?? "",
|
|
318
322
|
instructions: r?.instructions ?? ""
|
|
319
|
-
}),
|
|
320
|
-
|
|
321
|
-
|
|
323
|
+
}), Se = a(), Ce = A(r), we = Ce.current !== r, Te = A(f);
|
|
324
|
+
D(() => {
|
|
325
|
+
Ce.current = r, G({
|
|
322
326
|
name: r?.name ?? "",
|
|
323
327
|
description: r?.description ?? "",
|
|
324
328
|
instructions: r?.instructions ?? ""
|
|
325
|
-
}),
|
|
329
|
+
}), Te.current = f;
|
|
326
330
|
}, [r]);
|
|
327
|
-
let
|
|
328
|
-
|
|
329
|
-
if (
|
|
331
|
+
let Ee = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), De = A(!1);
|
|
332
|
+
D(() => {
|
|
333
|
+
if (we) return;
|
|
330
334
|
let e = {
|
|
331
335
|
name: r?.name ?? "",
|
|
332
336
|
description: r?.description ?? "",
|
|
333
337
|
instructions: r?.instructions ?? ""
|
|
334
|
-
}, t = JSON.stringify(
|
|
335
|
-
t !==
|
|
338
|
+
}, t = JSON.stringify(W) !== JSON.stringify(e) || Ee(f) !== Ee(Te.current);
|
|
339
|
+
t !== De.current && (De.current = t, F?.(t));
|
|
336
340
|
}, [
|
|
337
|
-
|
|
341
|
+
W,
|
|
338
342
|
f,
|
|
339
343
|
r,
|
|
340
|
-
|
|
341
|
-
|
|
344
|
+
we,
|
|
345
|
+
F
|
|
342
346
|
]);
|
|
343
|
-
let [
|
|
344
|
-
|
|
345
|
-
}, [
|
|
347
|
+
let [Oe, ke] = j(I), K = p ?? Oe, q = E((e) => {
|
|
348
|
+
ke(e), g?.(e);
|
|
349
|
+
}, [g]), [Ae, je] = j([]), Me = te ?? Ae, Ne = k(() => new Set(Me), [Me]), Pe = E((e) => {
|
|
346
350
|
let t = [...e];
|
|
347
|
-
|
|
348
|
-
}, [
|
|
349
|
-
|
|
350
|
-
}, [
|
|
351
|
-
"--se-title-color":
|
|
352
|
-
"--se-helper-text-color":
|
|
353
|
-
}),
|
|
354
|
-
headerBorderColor:
|
|
355
|
-
sidebarBorderColor:
|
|
356
|
-
} } : void 0,
|
|
357
|
-
path:
|
|
358
|
-
name:
|
|
359
|
-
kind:
|
|
360
|
-
}, ...f]), [f]),
|
|
361
|
-
|
|
362
|
-
}, [
|
|
363
|
-
R.onRemoveNode(e),
|
|
351
|
+
je(t), S?.(t);
|
|
352
|
+
}, [S]), [J, Fe] = j(!1), [Ie, Le] = j(), [Re, ze] = j(!1), { isDragActive: Be, dropZoneHandlers: Ve } = ue(E((e) => {
|
|
353
|
+
J || (Le(e), Fe(!0));
|
|
354
|
+
}, [J])), Y = ve ?? {}, X = ye?.colors, He = ye?.typography ?? {}, Ue = He.titleClassName ?? "dial-body-semi-text", We = He.helperTextClassName ?? "dial-tiny-semi-text", Ge = He.removeIconClassName ?? "text-secondary", Ke = n({
|
|
355
|
+
"--se-title-color": X?.title,
|
|
356
|
+
"--se-helper-text-color": X?.helperText
|
|
357
|
+
}), Z = X?.border ? { colors: {
|
|
358
|
+
headerBorderColor: X.border,
|
|
359
|
+
sidebarBorderColor: X.border
|
|
360
|
+
} } : void 0, qe = k(() => fe([{
|
|
361
|
+
path: I,
|
|
362
|
+
name: I,
|
|
363
|
+
kind: L.File
|
|
364
|
+
}, ...f]), [f]), Q = k(() => f.find((e) => e.path === K), [f, K]), Je = E((e) => {
|
|
365
|
+
q(e.path);
|
|
366
|
+
}, [q]), Ye = E((e) => {
|
|
367
|
+
R.onRemoveNode(e), K === e && q(I);
|
|
364
368
|
}, [
|
|
365
369
|
R,
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
]),
|
|
370
|
+
K,
|
|
371
|
+
q
|
|
372
|
+
]), Xe = E((e) => e.path === "SKILL.md" ? [] : [{
|
|
369
373
|
key: "remove",
|
|
370
|
-
label:
|
|
371
|
-
icon: /* @__PURE__ */
|
|
374
|
+
label: Y.removeLabel ?? "Remove",
|
|
375
|
+
icon: /* @__PURE__ */ b(ae, {
|
|
372
376
|
size: c.SM,
|
|
373
|
-
className:
|
|
377
|
+
className: Ge,
|
|
374
378
|
"aria-hidden": !0,
|
|
375
379
|
stroke: l
|
|
376
380
|
}),
|
|
377
|
-
onClick: () =>
|
|
381
|
+
onClick: () => Ye(e.path)
|
|
378
382
|
}], [
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
]),
|
|
383
|
+
Y.removeLabel,
|
|
384
|
+
Ge,
|
|
385
|
+
Ye
|
|
386
|
+
]), Ze = /* @__PURE__ */ x("div", {
|
|
383
387
|
className: "flex flex-col gap-2 desktop:gap-5",
|
|
384
|
-
children: [/* @__PURE__ */
|
|
388
|
+
children: [/* @__PURE__ */ x("div", {
|
|
385
389
|
className: "flex items-center justify-between",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
387
|
-
className: i(
|
|
388
|
-
children:
|
|
389
|
-
}), /* @__PURE__ */
|
|
390
|
-
label:
|
|
391
|
-
iconBefore: /* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ b("span", {
|
|
391
|
+
className: i(he.title, Ue),
|
|
392
|
+
children: Y.filesHeading ?? "Files"
|
|
393
|
+
}), /* @__PURE__ */ b(h, {
|
|
394
|
+
label: Y.addUploadLabel ?? "Upload from device",
|
|
395
|
+
iconBefore: /* @__PURE__ */ b(ie, {
|
|
392
396
|
size: 16,
|
|
393
397
|
"aria-hidden": !0,
|
|
394
398
|
stroke: l
|
|
395
399
|
}),
|
|
396
400
|
onClick: () => {
|
|
397
|
-
|
|
401
|
+
Le(void 0), Fe(!0);
|
|
398
402
|
}
|
|
399
403
|
})]
|
|
400
|
-
}), /* @__PURE__ */
|
|
404
|
+
}), /* @__PURE__ */ b("div", {
|
|
401
405
|
role: "tree",
|
|
402
|
-
"aria-label":
|
|
403
|
-
children: /* @__PURE__ */
|
|
404
|
-
items:
|
|
406
|
+
"aria-label": Y.filesTreeAriaLabel ?? "Skill files",
|
|
407
|
+
children: /* @__PURE__ */ b(oe, {
|
|
408
|
+
items: qe,
|
|
405
409
|
showFiles: !0,
|
|
406
|
-
selectedPath:
|
|
407
|
-
expandedPaths:
|
|
408
|
-
onExpandedPathsChange:
|
|
409
|
-
onItemClick:
|
|
410
|
-
getContextMenuItems:
|
|
410
|
+
selectedPath: K,
|
|
411
|
+
expandedPaths: Ne,
|
|
412
|
+
onExpandedPathsChange: Pe,
|
|
413
|
+
onItemClick: Je,
|
|
414
|
+
getContextMenuItems: Xe,
|
|
411
415
|
rootItemPath: ""
|
|
412
416
|
})
|
|
413
417
|
})]
|
|
414
|
-
}),
|
|
415
|
-
label:
|
|
418
|
+
}), $ = /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(h, {
|
|
419
|
+
label: Y.cancelLabel ?? "Cancel",
|
|
416
420
|
onClick: B,
|
|
417
|
-
disabled:
|
|
418
|
-
}), /* @__PURE__ */
|
|
419
|
-
label:
|
|
420
|
-
iconBefore:
|
|
421
|
+
disabled: T
|
|
422
|
+
}), /* @__PURE__ */ b(ne, {
|
|
423
|
+
label: Y.createLabel ?? "Create",
|
|
424
|
+
iconBefore: T ? /* @__PURE__ */ b(_, {
|
|
421
425
|
size: 16,
|
|
422
426
|
ariaLabel: ""
|
|
423
427
|
}) : void 0,
|
|
424
|
-
onClick: () => z(
|
|
425
|
-
disabled:
|
|
428
|
+
onClick: () => z(W),
|
|
429
|
+
disabled: T
|
|
426
430
|
})] });
|
|
427
|
-
return
|
|
428
|
-
dir:
|
|
431
|
+
return re ? /* @__PURE__ */ b("div", {
|
|
432
|
+
dir: be,
|
|
429
433
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
430
|
-
children: /* @__PURE__ */
|
|
431
|
-
title:
|
|
434
|
+
children: /* @__PURE__ */ b(ce, {
|
|
435
|
+
title: U,
|
|
432
436
|
onBack: V,
|
|
433
437
|
backAriaLabel: H,
|
|
434
|
-
actions:
|
|
438
|
+
actions: $,
|
|
435
439
|
isSaving: !1,
|
|
436
|
-
labels: { savingStatusLabel:
|
|
437
|
-
styles:
|
|
438
|
-
leftContent: /* @__PURE__ */
|
|
440
|
+
labels: { savingStatusLabel: Y.savingStatusLabel },
|
|
441
|
+
styles: Z,
|
|
442
|
+
leftContent: /* @__PURE__ */ b("div", {
|
|
439
443
|
role: "status",
|
|
440
|
-
"aria-label":
|
|
444
|
+
"aria-label": Y.loadingAriaLabel ?? "Loading skill",
|
|
441
445
|
className: "flex flex-1 items-center justify-center p-8",
|
|
442
|
-
children: /* @__PURE__ */
|
|
446
|
+
children: /* @__PURE__ */ b(_, {})
|
|
443
447
|
})
|
|
444
448
|
})
|
|
445
|
-
}) :
|
|
446
|
-
dir:
|
|
449
|
+
}) : C ? /* @__PURE__ */ b("div", {
|
|
450
|
+
dir: be,
|
|
447
451
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
448
|
-
children: /* @__PURE__ */
|
|
449
|
-
title:
|
|
452
|
+
children: /* @__PURE__ */ b(ce, {
|
|
453
|
+
title: U,
|
|
450
454
|
onBack: V,
|
|
451
455
|
backAriaLabel: H,
|
|
452
|
-
actions:
|
|
456
|
+
actions: $,
|
|
453
457
|
isSaving: !1,
|
|
454
|
-
labels: { savingStatusLabel:
|
|
455
|
-
styles:
|
|
456
|
-
leftContent: /* @__PURE__ */
|
|
458
|
+
labels: { savingStatusLabel: Y.savingStatusLabel },
|
|
459
|
+
styles: Z,
|
|
460
|
+
leftContent: /* @__PURE__ */ x("div", {
|
|
457
461
|
role: "alert",
|
|
458
462
|
className: "flex flex-col items-center gap-4 p-8",
|
|
459
|
-
children: [/* @__PURE__ */
|
|
460
|
-
label:
|
|
461
|
-
onClick:
|
|
463
|
+
children: [/* @__PURE__ */ b(d, { text: Y.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ b(ne, {
|
|
464
|
+
label: Y.retryLabel ?? "Retry",
|
|
465
|
+
onClick: _e
|
|
462
466
|
})]
|
|
463
467
|
})
|
|
464
468
|
})
|
|
465
|
-
}) : /* @__PURE__ */
|
|
466
|
-
dir:
|
|
467
|
-
className: "relative flex min-h-0 flex-1 flex-col",
|
|
468
|
-
style:
|
|
469
|
-
...
|
|
469
|
+
}) : /* @__PURE__ */ x("div", {
|
|
470
|
+
dir: be,
|
|
471
|
+
className: i("relative flex min-h-0 flex-1 flex-col", le.root),
|
|
472
|
+
style: Ke,
|
|
473
|
+
...Ve,
|
|
470
474
|
children: [
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
isVisible:
|
|
473
|
-
labels:
|
|
475
|
+
/* @__PURE__ */ b(pe, {
|
|
476
|
+
isVisible: Be && !J,
|
|
477
|
+
labels: ve
|
|
474
478
|
}),
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
title:
|
|
479
|
+
/* @__PURE__ */ b(ce, {
|
|
480
|
+
title: U,
|
|
477
481
|
onBack: V,
|
|
478
482
|
backAriaLabel: H,
|
|
479
|
-
actions:
|
|
480
|
-
isSaving:
|
|
481
|
-
labels: { savingStatusLabel:
|
|
482
|
-
styles:
|
|
483
|
-
leftContent: /* @__PURE__ */ y
|
|
483
|
+
actions: $,
|
|
484
|
+
isSaving: T,
|
|
485
|
+
labels: { savingStatusLabel: Y.savingStatusLabel },
|
|
486
|
+
styles: Z,
|
|
487
|
+
leftContent: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
|
|
484
488
|
className: "px-4 py-4 desktop:hidden",
|
|
485
|
-
children: /* @__PURE__ */
|
|
486
|
-
title:
|
|
487
|
-
description:
|
|
488
|
-
expanded:
|
|
489
|
-
onToggle:
|
|
490
|
-
ariaLabel:
|
|
491
|
-
children:
|
|
489
|
+
children: /* @__PURE__ */ b(o, {
|
|
490
|
+
title: Y.editingFileLabel ?? "Editing file",
|
|
491
|
+
description: Q?.name ?? "SKILL.md",
|
|
492
|
+
expanded: Re,
|
|
493
|
+
onToggle: ze,
|
|
494
|
+
ariaLabel: Y.editingFileLabel ?? "Editing file",
|
|
495
|
+
children: Ze
|
|
492
496
|
})
|
|
493
|
-
}), /* @__PURE__ */
|
|
497
|
+
}), /* @__PURE__ */ b("div", {
|
|
494
498
|
className: "hidden px-8 py-6 desktop:block",
|
|
495
|
-
children:
|
|
499
|
+
children: Ze
|
|
496
500
|
})] }),
|
|
497
|
-
rightContent: /* @__PURE__ */
|
|
501
|
+
rightContent: /* @__PURE__ */ x("div", {
|
|
498
502
|
className: "flex flex-1 flex-col gap-4 px-4 py-6 desktop:gap-5 desktop:px-8",
|
|
499
503
|
children: [
|
|
500
|
-
|
|
504
|
+
M != null && /* @__PURE__ */ b("div", {
|
|
501
505
|
role: "alert",
|
|
502
|
-
children: /* @__PURE__ */
|
|
506
|
+
children: /* @__PURE__ */ b(d, { text: M })
|
|
503
507
|
}),
|
|
504
|
-
|
|
508
|
+
N != null && /* @__PURE__ */ x("div", {
|
|
505
509
|
role: "alert",
|
|
506
510
|
className: "flex items-center gap-2",
|
|
507
|
-
children: [/* @__PURE__ */
|
|
508
|
-
label:
|
|
509
|
-
onClick:
|
|
511
|
+
children: [/* @__PURE__ */ b(d, { text: N.message }), /* @__PURE__ */ b(ee, {
|
|
512
|
+
label: Y.reloadLatestLabel ?? "Reload latest",
|
|
513
|
+
onClick: se
|
|
510
514
|
})]
|
|
511
515
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
className: i(
|
|
514
|
-
children:
|
|
516
|
+
/* @__PURE__ */ b("h2", {
|
|
517
|
+
className: i(he.title, Ue),
|
|
518
|
+
children: K === "SKILL.md" ? I : Y.selectedFileHeading?.(Q?.name ?? K) ?? Q?.name ?? K
|
|
515
519
|
}),
|
|
516
|
-
|
|
517
|
-
/* @__PURE__ */
|
|
520
|
+
K === "SKILL.md" ? /* @__PURE__ */ x(y, { children: [
|
|
521
|
+
/* @__PURE__ */ b(m, {
|
|
518
522
|
labelProps: {
|
|
519
|
-
label:
|
|
523
|
+
label: Y.nameLabel ?? "Name",
|
|
520
524
|
required: !0
|
|
521
525
|
},
|
|
522
|
-
value:
|
|
523
|
-
onChange: (e) =>
|
|
526
|
+
value: W.name,
|
|
527
|
+
onChange: (e) => G((t) => ({
|
|
524
528
|
...t,
|
|
525
529
|
name: e ?? ""
|
|
526
530
|
})),
|
|
527
|
-
placeholder:
|
|
528
|
-
caption:
|
|
529
|
-
error:
|
|
530
|
-
invalid: !!
|
|
531
|
+
placeholder: Y.namePlaceholder ?? "good-morning-breakfast",
|
|
532
|
+
caption: O?.name ? void 0 : Y.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
|
|
533
|
+
error: O?.name,
|
|
534
|
+
invalid: !!O?.name,
|
|
531
535
|
disabled: P
|
|
532
536
|
}),
|
|
533
|
-
/* @__PURE__ */ v
|
|
537
|
+
/* @__PURE__ */ b(v, {
|
|
534
538
|
labelProps: {
|
|
535
|
-
label:
|
|
539
|
+
label: Y.descriptionLabel ?? "Description",
|
|
536
540
|
required: !0
|
|
537
541
|
},
|
|
538
|
-
value:
|
|
539
|
-
placeholder:
|
|
540
|
-
onChange: (e) =>
|
|
542
|
+
value: W.description,
|
|
543
|
+
placeholder: Y.descriptionPlaceholder ?? "What this skill does and when to use it",
|
|
544
|
+
onChange: (e) => G((t) => ({
|
|
541
545
|
...t,
|
|
542
546
|
description: e
|
|
543
547
|
})),
|
|
544
|
-
error:
|
|
545
|
-
invalid: !!
|
|
548
|
+
error: O?.description,
|
|
549
|
+
invalid: !!O?.description
|
|
546
550
|
}),
|
|
547
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ x("div", {
|
|
548
552
|
className: "flex flex-1 flex-col gap-2",
|
|
549
553
|
children: [
|
|
550
|
-
/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ x("span", {
|
|
551
555
|
className: "flex items-center gap-0.5",
|
|
552
|
-
children: [/* @__PURE__ */
|
|
553
|
-
className: i(
|
|
554
|
-
children:
|
|
555
|
-
}), /* @__PURE__ */
|
|
556
|
+
children: [/* @__PURE__ */ b("span", {
|
|
557
|
+
className: i(he.helperText, We),
|
|
558
|
+
children: Y.instructionsLabel ?? "Instructions"
|
|
559
|
+
}), /* @__PURE__ */ b("span", {
|
|
556
560
|
className: "dial-tiny-text text-error",
|
|
557
561
|
children: "*"
|
|
558
562
|
})]
|
|
559
563
|
}),
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
ref:
|
|
564
|
+
/* @__PURE__ */ b("div", {
|
|
565
|
+
ref: Se,
|
|
562
566
|
className: i(e, t),
|
|
563
|
-
children: /* @__PURE__ */
|
|
564
|
-
fallback: /* @__PURE__ */
|
|
565
|
-
children: /* @__PURE__ */
|
|
566
|
-
value:
|
|
567
|
-
onChange: (e) =>
|
|
567
|
+
children: /* @__PURE__ */ b(w, {
|
|
568
|
+
fallback: /* @__PURE__ */ b(_, { ariaLabel: Y.instructionsLoadingAriaLabel ?? "Loading" }),
|
|
569
|
+
children: /* @__PURE__ */ b(ge, {
|
|
570
|
+
value: W.instructions,
|
|
571
|
+
onChange: (e) => G((t) => ({
|
|
568
572
|
...t,
|
|
569
573
|
instructions: e
|
|
570
574
|
})),
|
|
571
|
-
theme:
|
|
572
|
-
placeholder:
|
|
575
|
+
theme: xe,
|
|
576
|
+
placeholder: Y.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
|
|
573
577
|
})
|
|
574
578
|
})
|
|
575
579
|
}),
|
|
576
|
-
|
|
580
|
+
O?.instructions != null && /* @__PURE__ */ b(d, { text: O.instructions })
|
|
577
581
|
]
|
|
578
582
|
})
|
|
579
|
-
] }) :
|
|
583
|
+
] }) : Q?.kind === L.File && (de ?? /* @__PURE__ */ b(s, { text: Y.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." }))
|
|
580
584
|
]
|
|
581
585
|
})
|
|
582
586
|
}),
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
-
isOpen:
|
|
587
|
+
/* @__PURE__ */ b(me, {
|
|
588
|
+
isOpen: J,
|
|
585
589
|
onClose: () => {
|
|
586
|
-
|
|
590
|
+
Fe(!1), Le(void 0);
|
|
587
591
|
},
|
|
588
592
|
fileActions: R,
|
|
589
|
-
initialFiles:
|
|
590
|
-
labels:
|
|
593
|
+
initialFiles: Ie,
|
|
594
|
+
labels: ve
|
|
591
595
|
})
|
|
592
596
|
]
|
|
593
597
|
});
|
|
594
598
|
};
|
|
595
599
|
//#endregion
|
|
596
|
-
export {
|
|
600
|
+
export { le as SKILL_EDITOR_CLASS, _e as SkillEditor, z as SkillFileCandidateKind, L as SkillFileNodeKind, B as SkillFileValidationStatus };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-skill-editor",
|
|
3
3
|
"description": "Host-agnostic form for authoring a DIAL Skill, with an inline supporting-file tree",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.58",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
21
|
"@uiw/react-markdown-preview": "^5.2.1",
|
|
22
22
|
"@uiw/react-md-editor": "^4.1.1",
|
|
23
|
-
"@epam/ai-dial-builder-form": "1.2.0-dev.
|
|
23
|
+
"@epam/ai-dial-builder-form": "1.2.0-dev.58"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
27
|
-
"@epam/ai-dial-ui-kit": "^0.15.0-dev.
|
|
26
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.58",
|
|
27
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.9",
|
|
28
28
|
"@epam/ai-dial-react-file-manager": "^0.3.0-dev.2",
|
|
29
29
|
"react": "^19.2.8"
|
|
30
30
|
},
|