@epam/ai-dial-skills 1.3.0-dev.159 → 1.3.0-dev.160
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":"SkillSelectorField.d.ts","sourceRoot":"","sources":["../../../src/components/SkillSelectorField/SkillSelectorField.tsx"],"names":[],"mappings":"AAYA,OAAO,
|
|
1
|
+
{"version":3,"file":"SkillSelectorField.d.ts","sourceRoot":"","sources":["../../../src/components/SkillSelectorField/SkillSelectorField.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAmB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EACV,uBAAuB,EAExB,MAAM,yCAAyC,CAAC;AAQjD,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAqH1D,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { DeploymentIcon as e, buildCssVars as t, isSkillSelectionUnsupported as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { BASE_ICON_SIZE as i, Button as a, ButtonAppearance as o, ButtonVariant as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, ElementSize as u, FileDropzone as d, GhostButton as f, Highlight as p, InteractiveTooltip as m, InteractiveTooltipTrigger as h, Popup as g, PopupSize as _, Select as v, Spinner as y, ToggleIconButton as b, Tooltip as x, TooltipPlacement as S } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { Suspense as C, useCallback as w, useEffect as T, useId as E, useLayoutEffect as
|
|
4
|
-
import { IconBlocks as
|
|
5
|
-
import { Fragment as
|
|
3
|
+
import { Suspense as C, useCallback as w, useEffect as T, useId as E, useLayoutEffect as D, useMemo as O, useRef as k, useState as A } from "react";
|
|
4
|
+
import { IconBlocks as ee, IconEye as j, IconLock as M, IconStarFilled as N, IconTrash as te } from "@tabler/icons-react";
|
|
5
|
+
import { Fragment as ne, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
6
6
|
import { DialFileNodeType as I, DialFoldersTree as L } from "@epam/ai-dial-react-file-manager";
|
|
7
|
-
import { CatalogContentNodeType as
|
|
7
|
+
import { CatalogContentNodeType as re, DetailsPanel as R } from "@epam/ai-dial-catalog";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
|
-
var
|
|
9
|
+
var z = {
|
|
10
10
|
selectorField: "dial-skills-selector-field",
|
|
11
11
|
favoritesPanel: "dial-skills-favorites-panel",
|
|
12
12
|
chip: "dial-skills-chip"
|
|
13
|
-
},
|
|
13
|
+
}, B = "max-h-[280px] max-w-[min(420px,calc(100vw-10px))] overflow-y-auto", V = /* @__PURE__ */ function(e) {
|
|
14
14
|
return e.Deleted = "deleted", e.NotShared = "not-shared", e;
|
|
15
|
-
}({}),
|
|
15
|
+
}({}), H = ({ description: e, unsupportedMessage: t, unresolvedReason: n, deletedMessage: i, notSharedMessage: d, viewDetailsLabel: f = "View details", onViewDetails: p, viewDetailsTabIndex: m, textClassName: h = "dial-tiny-text" }) => {
|
|
16
16
|
if (n != null) {
|
|
17
|
-
let e = n ===
|
|
17
|
+
let e = n === V.Deleted, t = e ? te : M, a = e ? i : d;
|
|
18
18
|
return /* @__PURE__ */ F("div", {
|
|
19
19
|
className: "flex flex-row items-center gap-2",
|
|
20
20
|
children: [/* @__PURE__ */ P(t, {
|
|
@@ -39,7 +39,7 @@ var B = {
|
|
|
39
39
|
size: u.Small,
|
|
40
40
|
className: "self-start",
|
|
41
41
|
label: f,
|
|
42
|
-
iconBefore: /* @__PURE__ */ P(
|
|
42
|
+
iconBefore: /* @__PURE__ */ P(j, {
|
|
43
43
|
size: c.SM,
|
|
44
44
|
stroke: l,
|
|
45
45
|
"aria-hidden": !0
|
|
@@ -51,11 +51,11 @@ var B = {
|
|
|
51
51
|
className: r(h, "text-start"),
|
|
52
52
|
children: t
|
|
53
53
|
});
|
|
54
|
-
},
|
|
55
|
-
let { viewDetailsLabel: f = "View details", unsupportedTooltipLabel: p = "Selected model does not support skills. Remove the skill or select different model to proceed.", deletedTooltipLabel: g = "This skill has been deleted. Its details are no longer available.", notSharedTooltipLabel: _ = "You don't have access to this skill, so its details aren't shown. Ask the chat owner to share it with you." } = d, [v, y] =
|
|
54
|
+
}, U = ({ name: e, path: t, description: n, isUnsupported: i = !1, unresolvedReason: a, labelClassName: o = "dial-body-paragraph-text text-accent", unsupportedLabelClassName: s = "text-error", unsupportedClassName: c = "bg-error", detailsTrigger: l = "hover", onViewDetails: u, labels: d = {} }) => {
|
|
55
|
+
let { viewDetailsLabel: f = "View details", unsupportedTooltipLabel: p = "Selected model does not support skills. Remove the skill or select different model to proceed.", deletedTooltipLabel: g = "This skill has been deleted. Its details are no longer available.", notSharedTooltipLabel: _ = "You don't have access to this skill, so its details aren't shown. Ask the chat owner to share it with you." } = d, [v, y] = A(0), b = l === "click", x = () => {
|
|
56
56
|
y((e) => e + 1), u(t);
|
|
57
|
-
}, [C, w] =
|
|
58
|
-
return
|
|
57
|
+
}, [C, w] = A(null), [T, E] = A(null);
|
|
58
|
+
return D(() => {
|
|
59
59
|
if (!C) return;
|
|
60
60
|
let e = () => {
|
|
61
61
|
C.isConnected && E(C.getBoundingClientRect().width);
|
|
@@ -67,19 +67,19 @@ var B = {
|
|
|
67
67
|
asChild: !0,
|
|
68
68
|
placement: S.Top,
|
|
69
69
|
trigger: b ? h.Click : h.Hover,
|
|
70
|
-
contentClassName:
|
|
71
|
-
content: a == null ? i ? /* @__PURE__ */ P(
|
|
70
|
+
contentClassName: B,
|
|
71
|
+
content: a == null ? i ? /* @__PURE__ */ P(H, { unsupportedMessage: p }) : /* @__PURE__ */ P(H, {
|
|
72
72
|
description: n,
|
|
73
73
|
viewDetailsLabel: f,
|
|
74
74
|
onViewDetails: x
|
|
75
|
-
}) : /* @__PURE__ */ P(
|
|
75
|
+
}) : /* @__PURE__ */ P(H, {
|
|
76
76
|
unresolvedReason: a,
|
|
77
77
|
deletedMessage: g,
|
|
78
78
|
notSharedMessage: _
|
|
79
79
|
}),
|
|
80
80
|
children: /* @__PURE__ */ F("span", {
|
|
81
81
|
tabIndex: 0,
|
|
82
|
-
className: r("relative -ms-1 -me-1 inline cursor-pointer rounded-full ps-1 pe-1 select-text", i ? c : "hover:bg-info focus-visible:bg-info active:bg-info", i ? r(o, s) : o,
|
|
82
|
+
className: r("relative -ms-1 -me-1 inline cursor-pointer rounded-full ps-1 pe-1 select-text", i ? c : "hover:bg-info focus-visible:bg-info active:bg-info", i ? r(o, s) : o, z.chip),
|
|
83
83
|
"aria-label": `/${e}`,
|
|
84
84
|
children: [/* @__PURE__ */ P("span", {
|
|
85
85
|
ref: w,
|
|
@@ -94,7 +94,7 @@ var B = {
|
|
|
94
94
|
})]
|
|
95
95
|
})
|
|
96
96
|
}, v);
|
|
97
|
-
},
|
|
97
|
+
}, W = {
|
|
98
98
|
row: "_row_1v431_1",
|
|
99
99
|
header: "_header_1v431_8",
|
|
100
100
|
emptyHint: "_emptyHint_1v431_12",
|
|
@@ -105,67 +105,67 @@ var B = {
|
|
|
105
105
|
rowLeaving: "_rowLeaving_1v431_32",
|
|
106
106
|
rowFadeOut: "_rowFadeOut_1v431_1",
|
|
107
107
|
listContent: "_listContent_1v431_60"
|
|
108
|
-
},
|
|
109
|
-
let { myCollectionLabel:
|
|
108
|
+
}, ie = "px-3 pb-0.5 pt-2", ae = 180, G = 288, K = ({ favorites: n, onSelect: i, onToggleFavorite: a, onBrowse: o, onViewDetails: s, isRowTooltipHidden: l = !1, className: u, rowClassName: d, searchQuery: h, listboxId: g, activeOptionId: _, isMenu: v = !1, labels: y = {}, colors: x, nameClassName: S = "dial-small-text", headerClassName: C = "dial-tiny-lead-semi-text", emptyHintClassName: w = "dial-small-text" }) => {
|
|
109
|
+
let { myCollectionLabel: O = "My Collection", emptyHintLabel: ee = "Star a skill to pin it here", browseLabel: j = "Browse", removeFromFavoritesLabel: M = "Remove from favorites", viewDetailsLabel: te = "View details", noMatchingSkillsLabel: ne = "No matching skills" } = y, I = t({
|
|
110
110
|
"--fs-row-hover-bg": x?.rowHoverBackground,
|
|
111
111
|
"--fs-header-text": x?.headerText,
|
|
112
112
|
"--fs-empty-hint-text": x?.emptyHintText,
|
|
113
113
|
"--fs-star-color": x?.starColor,
|
|
114
114
|
"--fs-footer-border": x?.footerBorder
|
|
115
|
-
}), [L,
|
|
115
|
+
}), [L, re] = A(/* @__PURE__ */ new Set()), R = k(/* @__PURE__ */ new Map());
|
|
116
116
|
T(() => {
|
|
117
|
-
let e =
|
|
117
|
+
let e = R.current;
|
|
118
118
|
return () => {
|
|
119
119
|
e.forEach((e) => clearTimeout(e)), e.clear();
|
|
120
120
|
};
|
|
121
121
|
}, []);
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
let V = g != null, U = v && !V, K = V || U ? "none" : void 0, q = "button";
|
|
123
|
+
V ? q = "option" : U && (q = "menuitem");
|
|
124
|
+
let J = E(), oe = h != null, Y = h?.toLowerCase() ?? "", X = oe ? n.filter((e) => e.name.toLowerCase().includes(Y)) : n, Z = k(null), [se, ce] = A();
|
|
125
|
+
D(() => {
|
|
126
|
+
Z.current && ce(Math.min(Z.current.scrollHeight, G));
|
|
127
127
|
}, [n, h]);
|
|
128
|
-
let
|
|
128
|
+
let le = (e, t) => {
|
|
129
129
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i(t));
|
|
130
|
-
},
|
|
131
|
-
|
|
130
|
+
}, ue = (e) => {
|
|
131
|
+
re((t) => new Set(t).add(e));
|
|
132
132
|
let t = setTimeout(() => {
|
|
133
|
-
a?.(e),
|
|
133
|
+
a?.(e), re((t) => {
|
|
134
134
|
let n = new Set(t);
|
|
135
135
|
return n.delete(e), n;
|
|
136
|
-
}),
|
|
137
|
-
},
|
|
138
|
-
|
|
136
|
+
}), R.current.delete(e);
|
|
137
|
+
}, ae);
|
|
138
|
+
R.current.set(e, t);
|
|
139
139
|
};
|
|
140
140
|
return /* @__PURE__ */ F("div", {
|
|
141
|
-
className: r("flex w-full flex-col desktop:w-[280px]", u,
|
|
141
|
+
className: r("flex w-full flex-col desktop:w-[280px]", u, z.favoritesPanel),
|
|
142
142
|
style: I,
|
|
143
143
|
children: [
|
|
144
144
|
/* @__PURE__ */ P("p", {
|
|
145
|
-
id:
|
|
146
|
-
className: r(C,
|
|
147
|
-
children:
|
|
145
|
+
id: J,
|
|
146
|
+
className: r(C, ie, W.header),
|
|
147
|
+
children: O
|
|
148
148
|
}),
|
|
149
149
|
/* @__PURE__ */ P("div", {
|
|
150
|
-
className: r("max-h-72 min-h-0 flex-1 overflow-y-auto",
|
|
151
|
-
style: { maxHeight:
|
|
150
|
+
className: r("max-h-72 min-h-0 flex-1 overflow-y-auto", W.listContent),
|
|
151
|
+
style: { maxHeight: se },
|
|
152
152
|
children: /* @__PURE__ */ P("div", {
|
|
153
|
-
ref:
|
|
154
|
-
children:
|
|
153
|
+
ref: Z,
|
|
154
|
+
children: X.length > 0 ? /* @__PURE__ */ P("ul", {
|
|
155
155
|
id: g,
|
|
156
|
-
role:
|
|
157
|
-
"aria-labelledby":
|
|
156
|
+
role: V ? "listbox" : K,
|
|
157
|
+
"aria-labelledby": V ? J : void 0,
|
|
158
158
|
className: "flex flex-col gap-1 px-1 pb-1",
|
|
159
|
-
children:
|
|
160
|
-
let n =
|
|
161
|
-
role:
|
|
159
|
+
children: X.map((t) => {
|
|
160
|
+
let n = V ? `${g}-${encodeURIComponent(t.id)}` : void 0, o = V ? -1 : void 0, u = /* @__PURE__ */ F("div", {
|
|
161
|
+
role: q,
|
|
162
162
|
id: n,
|
|
163
|
-
"aria-selected":
|
|
163
|
+
"aria-selected": V ? n === _ : void 0,
|
|
164
164
|
"aria-label": t.name,
|
|
165
165
|
tabIndex: 0,
|
|
166
|
-
className: r("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors",
|
|
166
|
+
className: r("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors", W.row, d),
|
|
167
167
|
onClick: () => i(t),
|
|
168
|
-
onKeyDown: (e) =>
|
|
168
|
+
onKeyDown: (e) => le(e, t),
|
|
169
169
|
children: [
|
|
170
170
|
/* @__PURE__ */ P(e, {
|
|
171
171
|
size: c.MD,
|
|
@@ -181,29 +181,29 @@ var B = {
|
|
|
181
181
|
className: r(S, "min-w-0 flex-1 text-start")
|
|
182
182
|
}),
|
|
183
183
|
a && /* @__PURE__ */ P(b, {
|
|
184
|
-
icon: /* @__PURE__ */ P(
|
|
184
|
+
icon: /* @__PURE__ */ P(N, {
|
|
185
185
|
size: c.SM,
|
|
186
|
-
className:
|
|
186
|
+
className: W.star,
|
|
187
187
|
"aria-hidden": !0
|
|
188
188
|
}),
|
|
189
|
-
"aria-label":
|
|
189
|
+
"aria-label": M,
|
|
190
190
|
isSelected: !0,
|
|
191
191
|
tabIndex: o,
|
|
192
192
|
onClick: (e) => {
|
|
193
|
-
e.stopPropagation(),
|
|
193
|
+
e.stopPropagation(), ue(t.id);
|
|
194
194
|
}
|
|
195
195
|
})
|
|
196
196
|
]
|
|
197
197
|
});
|
|
198
198
|
return /* @__PURE__ */ P("li", {
|
|
199
|
-
role:
|
|
200
|
-
className: L.has(t.id) ?
|
|
199
|
+
role: K,
|
|
200
|
+
className: L.has(t.id) ? W.rowLeaving : W.rowEnter,
|
|
201
201
|
children: s && !l ? /* @__PURE__ */ P(m, {
|
|
202
202
|
asChild: !0,
|
|
203
|
-
contentClassName:
|
|
204
|
-
content: /* @__PURE__ */ P(
|
|
203
|
+
contentClassName: B,
|
|
204
|
+
content: /* @__PURE__ */ P(H, {
|
|
205
205
|
description: t.description,
|
|
206
|
-
viewDetailsLabel:
|
|
206
|
+
viewDetailsLabel: te,
|
|
207
207
|
onViewDetails: () => s(t),
|
|
208
208
|
viewDetailsTabIndex: o
|
|
209
209
|
}),
|
|
@@ -211,29 +211,29 @@ var B = {
|
|
|
211
211
|
}) : u
|
|
212
212
|
}, t.id);
|
|
213
213
|
})
|
|
214
|
-
}) :
|
|
214
|
+
}) : oe && Y !== "" ? /* @__PURE__ */ P("p", {
|
|
215
215
|
role: "status",
|
|
216
216
|
"aria-live": "polite",
|
|
217
|
-
className: r(w, "px-4 py-4 text-start",
|
|
218
|
-
children:
|
|
217
|
+
className: r(w, "px-4 py-4 text-start", W.emptyHint),
|
|
218
|
+
children: ne
|
|
219
219
|
}) : /* @__PURE__ */ P("p", {
|
|
220
|
-
className: r(w, "px-4 py-4 text-start",
|
|
221
|
-
children:
|
|
220
|
+
className: r(w, "px-4 py-4 text-start", W.emptyHint),
|
|
221
|
+
children: ee
|
|
222
222
|
})
|
|
223
223
|
})
|
|
224
224
|
}),
|
|
225
225
|
/* @__PURE__ */ P("div", {
|
|
226
|
-
className: r("border-t px-2 py-3",
|
|
226
|
+
className: r("border-t px-2 py-3", W.footer),
|
|
227
227
|
children: /* @__PURE__ */ P(f, {
|
|
228
|
-
role:
|
|
229
|
-
label:
|
|
228
|
+
role: U ? "menuitem" : void 0,
|
|
229
|
+
label: j,
|
|
230
230
|
className: "w-full justify-center",
|
|
231
231
|
onClick: o
|
|
232
232
|
})
|
|
233
233
|
})
|
|
234
234
|
]
|
|
235
235
|
});
|
|
236
|
-
},
|
|
236
|
+
}, q = ".zip,.md", J = ({ isOpen: e, errorText: t, isUploading: n = !1, accept: r = q, labels: i, onClose: a, onFilesSelected: o, onFilesRejected: s }) => {
|
|
237
237
|
let { dialogTitle: c = "Upload skill", dropZoneLabel: l = "Drag and drop it or click here to upload", dropZoneMobileLabel: u = "Click here to upload", formatsLabel: f = "File formats .zip and SKILL.md", fileInputAriaLabel: p = "Upload a skill ZIP archive or a SKILL.md file", closeAriaLabel: m = "Close", uploadingAriaLabel: h = "Uploading skill" } = i ?? {};
|
|
238
238
|
return /* @__PURE__ */ P(g, {
|
|
239
239
|
open: e,
|
|
@@ -244,7 +244,7 @@ var B = {
|
|
|
244
244
|
children: /* @__PURE__ */ F("div", {
|
|
245
245
|
className: "flex flex-col gap-4 px-6 py-4",
|
|
246
246
|
children: [/* @__PURE__ */ P(d, {
|
|
247
|
-
label: /* @__PURE__ */ F(
|
|
247
|
+
label: /* @__PURE__ */ F(ne, { children: [/* @__PURE__ */ P("span", {
|
|
248
248
|
className: "desktop:hidden",
|
|
249
249
|
children: u
|
|
250
250
|
}), /* @__PURE__ */ P("span", {
|
|
@@ -261,7 +261,7 @@ var B = {
|
|
|
261
261
|
}), n && /* @__PURE__ */ P(y, { ariaLabel: h })]
|
|
262
262
|
})
|
|
263
263
|
});
|
|
264
|
-
},
|
|
264
|
+
}, oe = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ P(g, {
|
|
265
265
|
open: e,
|
|
266
266
|
header: r,
|
|
267
267
|
size: _.Lg,
|
|
@@ -275,21 +275,21 @@ var B = {
|
|
|
275
275
|
children: e && i(n, t)
|
|
276
276
|
})
|
|
277
277
|
})
|
|
278
|
-
}),
|
|
278
|
+
}), Y = (e, t = null) => e.map((e) => e.type === re.Folder ? {
|
|
279
279
|
path: e.id,
|
|
280
280
|
name: e.name,
|
|
281
281
|
nodeType: I.FOLDER,
|
|
282
282
|
parentPath: t,
|
|
283
283
|
folderId: e.id,
|
|
284
|
-
items:
|
|
284
|
+
items: Y(e.items, e.id)
|
|
285
285
|
} : {
|
|
286
286
|
path: e.id,
|
|
287
287
|
name: e.name,
|
|
288
288
|
nodeType: I.ITEM,
|
|
289
289
|
parentPath: t,
|
|
290
290
|
folderId: t ?? ""
|
|
291
|
-
}),
|
|
292
|
-
let s =
|
|
291
|
+
}), X = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => {
|
|
292
|
+
let s = O(() => Y(e), [e]), c = O(() => new Set(n), [n]);
|
|
293
293
|
return /* @__PURE__ */ P(L, {
|
|
294
294
|
items: s,
|
|
295
295
|
showFiles: !0,
|
|
@@ -307,10 +307,10 @@ var B = {
|
|
|
307
307
|
autoFocus: !0,
|
|
308
308
|
onEscape: a
|
|
309
309
|
});
|
|
310
|
-
},
|
|
310
|
+
}, Z = (e) => /* @__PURE__ */ P(R, {
|
|
311
311
|
...e,
|
|
312
|
-
renderContentFileTree: (e) => /* @__PURE__ */ P(
|
|
313
|
-
}),
|
|
312
|
+
renderContentFileTree: (e) => /* @__PURE__ */ P(X, { ...e })
|
|
313
|
+
}), se = (e) => e == null || /[\s/]/.test(e), ce = (e, t, n) => {
|
|
314
314
|
let r = [], i = 0;
|
|
315
315
|
return t.forEach((t, a) => {
|
|
316
316
|
let o = `/${n(t.url)}`, s = i;
|
|
@@ -318,7 +318,7 @@ var B = {
|
|
|
318
318
|
let t = e.indexOf(o, s);
|
|
319
319
|
if (t === -1) return;
|
|
320
320
|
let n = t + o.length;
|
|
321
|
-
if (
|
|
321
|
+
if (se(e[n])) {
|
|
322
322
|
r.push({
|
|
323
323
|
skillIndex: a,
|
|
324
324
|
start: t,
|
|
@@ -329,14 +329,14 @@ var B = {
|
|
|
329
329
|
s = t + 1;
|
|
330
330
|
}
|
|
331
331
|
}), r;
|
|
332
|
-
},
|
|
332
|
+
}, le = (e, t) => {
|
|
333
333
|
let n = /* @__PURE__ */ new Map();
|
|
334
334
|
t.forEach((e) => {
|
|
335
335
|
e.name !== "" && !n.has(e.name) && n.set(e.name, e.url);
|
|
336
336
|
});
|
|
337
337
|
let r = [...n.keys()].sort((e, t) => t.length - e.length), i = [], a = e.indexOf("/");
|
|
338
338
|
for (; a !== -1;) {
|
|
339
|
-
let t = a === 0 || /\s/.test(e[a - 1]), o = a + 1, s = t ? r.find((t) => e.startsWith(t, o) &&
|
|
339
|
+
let t = a === 0 || /\s/.test(e[a - 1]), o = a + 1, s = t ? r.find((t) => e.startsWith(t, o) && se(e[o + t.length])) : void 0, c = s == null ? void 0 : n.get(s);
|
|
340
340
|
s != null && c != null ? (i.push({
|
|
341
341
|
url: c,
|
|
342
342
|
name: s,
|
|
@@ -345,7 +345,7 @@ var B = {
|
|
|
345
345
|
}), a = e.indexOf("/", o + s.length)) : a = e.indexOf("/", o);
|
|
346
346
|
}
|
|
347
347
|
return i;
|
|
348
|
-
},
|
|
348
|
+
}, ue = (e, t) => {
|
|
349
349
|
let n = Math.min(e.length, t.length), r = 0;
|
|
350
350
|
for (; r < n && e[r] === t[r];) r += 1;
|
|
351
351
|
let i = n - r, a = 0;
|
|
@@ -355,13 +355,13 @@ var B = {
|
|
|
355
355
|
deletedLength: e.length - r - a,
|
|
356
356
|
insertedLength: t.length - r - a
|
|
357
357
|
};
|
|
358
|
-
},
|
|
358
|
+
}, de = (e, t) => {
|
|
359
359
|
let n = t.start + t.deletedLength, r = t.insertedLength - t.deletedLength;
|
|
360
360
|
return e.reduce((e, i) => i.start + i.length <= t.start ? (e.push(i), e) : (i.start >= n && e.push({
|
|
361
361
|
...i,
|
|
362
362
|
start: i.start + r
|
|
363
363
|
}), e), []);
|
|
364
|
-
},
|
|
364
|
+
}, Q = (e, t, n, r, i) => {
|
|
365
365
|
let a = r.length + 1, o = a + +!!i, s = e.map((e) => e.start >= t ? {
|
|
366
366
|
...e,
|
|
367
367
|
start: e.start + o
|
|
@@ -372,7 +372,7 @@ var B = {
|
|
|
372
372
|
length: a
|
|
373
373
|
};
|
|
374
374
|
return [...s, c].sort((e, t) => e.start - t.start);
|
|
375
|
-
},
|
|
375
|
+
}, fe = (e, t) => e.find((e) => e.start + e.length === t), pe = (e, t, n) => {
|
|
376
376
|
let r = t;
|
|
377
377
|
for (; r > 0 && !/\s/.test(e[r - 1]);) r--;
|
|
378
378
|
let i = r;
|
|
@@ -382,21 +382,21 @@ var B = {
|
|
|
382
382
|
start: r,
|
|
383
383
|
end: i
|
|
384
384
|
};
|
|
385
|
-
},
|
|
385
|
+
}, me = (e, t, n) => {
|
|
386
386
|
if (n === "" || t.insertedLength < n.length) return;
|
|
387
387
|
let r = e.indexOf(n, Math.max(0, t.start - n.length)), i = t.start + t.insertedLength - n.length;
|
|
388
388
|
return r !== -1 && r <= i ? r : void 0;
|
|
389
|
-
},
|
|
390
|
-
let [e, t] =
|
|
389
|
+
}, he = () => {
|
|
390
|
+
let [e, t] = A(""), [n, r] = A([]), i = k(e);
|
|
391
391
|
i.current = e;
|
|
392
|
-
let a =
|
|
392
|
+
let a = k(n);
|
|
393
393
|
a.current = n;
|
|
394
|
-
let o =
|
|
395
|
-
let n =
|
|
394
|
+
let o = k(null), s = w((e) => {
|
|
395
|
+
let n = ue(i.current, e), a = o.current;
|
|
396
396
|
o.current = null;
|
|
397
|
-
let s = a == null ? void 0 :
|
|
397
|
+
let s = a == null ? void 0 : me(e, n, a.text);
|
|
398
398
|
r((t) => {
|
|
399
|
-
let r =
|
|
399
|
+
let r = de(t, n);
|
|
400
400
|
if (a == null || s == null) return r;
|
|
401
401
|
let i = a.mentions.map((e) => ({
|
|
402
402
|
...e,
|
|
@@ -406,11 +406,11 @@ var B = {
|
|
|
406
406
|
}), i.current = e, t(e);
|
|
407
407
|
}, []), c = w((e, n, a) => {
|
|
408
408
|
let o = i.current, s = !/^\s/.test(o.slice(a)), c = `/${n}${s ? " " : ""}`, l = o.slice(0, a) + c + o.slice(a);
|
|
409
|
-
return i.current = l, t(l), r((t) =>
|
|
409
|
+
return i.current = l, t(l), r((t) => Q(t, a, e, n, s)), s;
|
|
410
410
|
}, []), l = w((e, n, a) => {
|
|
411
411
|
let o = i.current, s = `/${n}`, c = o.slice(0, a) + s + o.slice(a);
|
|
412
|
-
i.current = c, t(c), r((t) =>
|
|
413
|
-
}, []), u = w((e) =>
|
|
412
|
+
i.current = c, t(c), r((t) => Q(t, a, e, n, !1));
|
|
413
|
+
}, []), u = w((e) => fe(a.current, e), []), d = O(() => {
|
|
414
414
|
if (n.length !== 0) return n.map((e) => ({ url: e.url }));
|
|
415
415
|
}, [n]), f = w((e, t) => {
|
|
416
416
|
o.current = t.length > 0 ? {
|
|
@@ -420,7 +420,7 @@ var B = {
|
|
|
420
420
|
}, []), p = w(() => {
|
|
421
421
|
t(""), r([]);
|
|
422
422
|
}, []), m = w((e, n, i) => {
|
|
423
|
-
let a = n ?? [], o =
|
|
423
|
+
let a = n ?? [], o = ce(e, a, i);
|
|
424
424
|
t(e), r(o.map((e) => {
|
|
425
425
|
let t = a[e.skillIndex];
|
|
426
426
|
return {
|
|
@@ -431,7 +431,7 @@ var B = {
|
|
|
431
431
|
};
|
|
432
432
|
}));
|
|
433
433
|
}, []);
|
|
434
|
-
return
|
|
434
|
+
return O(() => ({
|
|
435
435
|
draft: e,
|
|
436
436
|
anchors: n,
|
|
437
437
|
onDraftChange: s,
|
|
@@ -454,18 +454,18 @@ var B = {
|
|
|
454
454
|
p,
|
|
455
455
|
m
|
|
456
456
|
]);
|
|
457
|
-
},
|
|
457
|
+
}, ge = (e) => ({
|
|
458
458
|
id: e.url,
|
|
459
459
|
name: e.name,
|
|
460
460
|
description: e.description
|
|
461
|
-
}),
|
|
461
|
+
}), $ = (e) => {
|
|
462
462
|
let t = e.split("/").filter((e) => e.length > 0);
|
|
463
463
|
return t[t.length - 1] ?? e;
|
|
464
464
|
}, _e = (e) => {
|
|
465
465
|
let t = e.split("/").filter((e) => e.length > 0);
|
|
466
466
|
return t[0] !== "skills" || t.length < 3 ? null : t[1];
|
|
467
|
-
}, ve = (e, t) => _e(e) === t ?
|
|
468
|
-
let { addMenuLabel: _ = "Skills", backLabel: v = "Back", catalogModalTitleLabel: y = "Use skill", emptyQueryHintLabel: b = "Type to filter", deletedTooltipLabel: x, notSharedTooltipLabel: S, unsupportedTooltipLabel: T, panelLabels: E } = c ?? {}, [
|
|
467
|
+
}, ve = (e, t) => _e(e) === t ? V.Deleted : V.NotShared, ye = "/", be = ({ isSkillsSupported: e, skills: t, sharedWithMe: n, publicSkills: r, favoriteIds: a, viewerBucket: o, onToggleFavorite: s, labels: c, historyChipLabelClassName: u, activeMentionLabelClassName: d = "text-accent", activeMentionDetailsTrigger: f, historyDetailsTrigger: p, isRowTooltipHidden: m = !1, renderCatalogContent: h, detailsPanelComponent: g }) => {
|
|
468
|
+
let { addMenuLabel: _ = "Skills", backLabel: v = "Back", catalogModalTitleLabel: y = "Use skill", emptyQueryHintLabel: b = "Type to filter", deletedTooltipLabel: x, notSharedTooltipLabel: S, unsupportedTooltipLabel: T, panelLabels: E } = c ?? {}, [D, j] = A(!1), [M, N] = A(null), [te, ne] = A(0), F = k(null), [I, L] = A(0), [re, R] = A(void 0), z = he(), B = O(() => [
|
|
469
469
|
...t,
|
|
470
470
|
...n ?? [],
|
|
471
471
|
...r ?? []
|
|
@@ -473,72 +473,72 @@ var B = {
|
|
|
473
473
|
t,
|
|
474
474
|
n,
|
|
475
475
|
r
|
|
476
|
-
]),
|
|
476
|
+
]), V = O(() => new Map(B.map((e) => [e.url, e])), [B]), H = w((e) => V.get(e)?.name ?? $(e), [V]), W = O(() => B.filter((e) => a.has(e.url)).map((e) => ge(e)), [B, a]), ie = z.anchors.length > 0 && !e, ae = O(() => z.anchors.map((t) => ({
|
|
477
477
|
start: t.start,
|
|
478
478
|
length: t.length,
|
|
479
479
|
isUnsupported: !e,
|
|
480
|
-
render: () => /* @__PURE__ */ P(
|
|
480
|
+
render: () => /* @__PURE__ */ P(U, {
|
|
481
481
|
name: t.name,
|
|
482
482
|
path: t.url,
|
|
483
483
|
labelClassName: d,
|
|
484
|
-
description:
|
|
484
|
+
description: V.get(t.url)?.description,
|
|
485
485
|
isUnsupported: !e,
|
|
486
486
|
detailsTrigger: f,
|
|
487
|
-
onViewDetails:
|
|
487
|
+
onViewDetails: N,
|
|
488
488
|
labels: {
|
|
489
489
|
viewDetailsLabel: E?.viewDetailsLabel,
|
|
490
490
|
unsupportedTooltipLabel: T
|
|
491
491
|
}
|
|
492
492
|
})
|
|
493
493
|
})), [
|
|
494
|
-
|
|
494
|
+
z.anchors,
|
|
495
495
|
e,
|
|
496
|
-
|
|
496
|
+
V,
|
|
497
497
|
d,
|
|
498
498
|
f,
|
|
499
499
|
E,
|
|
500
500
|
T
|
|
501
|
-
]),
|
|
502
|
-
let r =
|
|
503
|
-
L((e) => e + 1),
|
|
504
|
-
}, [
|
|
505
|
-
let t =
|
|
506
|
-
return t == null ? e : (
|
|
507
|
-
}, [
|
|
508
|
-
let t =
|
|
501
|
+
]), G = w((e, t, n) => {
|
|
502
|
+
let r = z.insertMention(e, t, n);
|
|
503
|
+
L((e) => e + 1), R(n + 1 + t.length + +!!r);
|
|
504
|
+
}, [z]), q = w((e) => {
|
|
505
|
+
let t = pe(z.draft, e, ye);
|
|
506
|
+
return t == null ? e : (z.onDraftChange(z.draft.slice(0, t.start) + z.draft.slice(t.end)), t.start);
|
|
507
|
+
}, [z]), J = w((e) => {
|
|
508
|
+
let t = pe(z.draft, e, ye);
|
|
509
509
|
if (t == null) return;
|
|
510
|
-
let n =
|
|
510
|
+
let n = z.anchors.find((e) => e.start === t.start && e.start + e.length === t.end);
|
|
511
511
|
return {
|
|
512
512
|
position: t.start,
|
|
513
|
-
text:
|
|
513
|
+
text: z.draft.slice(t.start, t.end),
|
|
514
514
|
mentionUrl: n?.url
|
|
515
515
|
};
|
|
516
|
-
}, [
|
|
517
|
-
|
|
518
|
-
}, [
|
|
519
|
-
|
|
516
|
+
}, [z]), Y = w(() => {
|
|
517
|
+
z.reset(), L((e) => e + 1), R(void 0);
|
|
518
|
+
}, [z]), { expectInsertion: X } = z, Z = w((t) => {
|
|
519
|
+
X(t, e ? le(t, B) : []);
|
|
520
520
|
}, [
|
|
521
|
-
|
|
521
|
+
X,
|
|
522
522
|
e,
|
|
523
|
-
|
|
524
|
-
]),
|
|
525
|
-
|
|
526
|
-
}, [
|
|
523
|
+
B
|
|
524
|
+
]), se = w((e, t) => {
|
|
525
|
+
z.seedFromMessage(e, t, H), L((e) => e + 1), R(void 0);
|
|
526
|
+
}, [z, H]), ue = w((e, t) => {
|
|
527
527
|
if (t == null || t.length === 0) return null;
|
|
528
|
-
let n =
|
|
528
|
+
let n = ce(e, t, H), r = [], i = 0;
|
|
529
529
|
return n.forEach((n) => {
|
|
530
530
|
n.start > i && r.push(e.slice(i, n.start));
|
|
531
|
-
let a = t[n.skillIndex], s =
|
|
531
|
+
let a = t[n.skillIndex], s = V.get(a.url), c = s?.name ?? $(a.url), l = s == null ? ve(a.url, o) : void 0;
|
|
532
532
|
r.push({
|
|
533
533
|
text: e.slice(n.start, n.start + n.length),
|
|
534
|
-
node: /* @__PURE__ */ P(
|
|
534
|
+
node: /* @__PURE__ */ P(U, {
|
|
535
535
|
name: c,
|
|
536
536
|
path: a.url,
|
|
537
537
|
labelClassName: u,
|
|
538
538
|
description: s?.description,
|
|
539
539
|
unresolvedReason: l,
|
|
540
540
|
detailsTrigger: p,
|
|
541
|
-
onViewDetails:
|
|
541
|
+
onViewDetails: N,
|
|
542
542
|
labels: {
|
|
543
543
|
viewDetailsLabel: E?.viewDetailsLabel,
|
|
544
544
|
deletedTooltipLabel: x,
|
|
@@ -548,24 +548,24 @@ var B = {
|
|
|
548
548
|
}), i = n.start + n.length;
|
|
549
549
|
}), i < e.length && r.push(e.slice(i)), r;
|
|
550
550
|
}, [
|
|
551
|
-
U,
|
|
552
551
|
H,
|
|
552
|
+
V,
|
|
553
553
|
u,
|
|
554
554
|
p,
|
|
555
555
|
E,
|
|
556
556
|
o,
|
|
557
557
|
x,
|
|
558
558
|
S
|
|
559
|
-
]),
|
|
560
|
-
let t =
|
|
561
|
-
return /* @__PURE__ */ P(
|
|
559
|
+
]), de = w((e) => e == null || e.length === 0 ? null : e.map((e) => {
|
|
560
|
+
let t = V.get(e.url), n = t?.name ?? $(e.url), r = t == null ? ve(e.url, o) : void 0;
|
|
561
|
+
return /* @__PURE__ */ P(U, {
|
|
562
562
|
name: n,
|
|
563
563
|
path: e.url,
|
|
564
564
|
labelClassName: u,
|
|
565
565
|
description: t?.description,
|
|
566
566
|
unresolvedReason: r,
|
|
567
567
|
detailsTrigger: p,
|
|
568
|
-
onViewDetails:
|
|
568
|
+
onViewDetails: N,
|
|
569
569
|
labels: {
|
|
570
570
|
viewDetailsLabel: E?.viewDetailsLabel,
|
|
571
571
|
deletedTooltipLabel: x,
|
|
@@ -573,79 +573,79 @@ var B = {
|
|
|
573
573
|
}
|
|
574
574
|
}, e.url);
|
|
575
575
|
}), [
|
|
576
|
-
|
|
576
|
+
V,
|
|
577
577
|
u,
|
|
578
578
|
p,
|
|
579
579
|
E,
|
|
580
580
|
o,
|
|
581
581
|
x,
|
|
582
582
|
S
|
|
583
|
-
]),
|
|
584
|
-
favorites:
|
|
583
|
+
]), Q = w((e, t) => /* @__PURE__ */ P(K, {
|
|
584
|
+
favorites: W,
|
|
585
585
|
isMenu: !0,
|
|
586
586
|
onSelect: (n) => {
|
|
587
|
-
|
|
587
|
+
G(n.id, n.name, q(t)), e();
|
|
588
588
|
},
|
|
589
589
|
onToggleFavorite: s,
|
|
590
590
|
onBrowse: () => {
|
|
591
|
-
let n =
|
|
592
|
-
|
|
591
|
+
let n = J(t), r = q(t);
|
|
592
|
+
ne(r), F.current = n ?? null, e(), j(!0);
|
|
593
593
|
},
|
|
594
594
|
onViewDetails: (n) => {
|
|
595
|
-
|
|
595
|
+
q(t), e(), N(n.id);
|
|
596
596
|
},
|
|
597
597
|
isRowTooltipHidden: m,
|
|
598
598
|
labels: E
|
|
599
599
|
}), [
|
|
600
|
+
W,
|
|
600
601
|
G,
|
|
601
|
-
|
|
602
|
+
q,
|
|
602
603
|
J,
|
|
603
|
-
Y,
|
|
604
604
|
s,
|
|
605
605
|
m,
|
|
606
606
|
E
|
|
607
|
-
]),
|
|
607
|
+
]), fe = O(() => e ? {
|
|
608
608
|
key: "skills",
|
|
609
609
|
title: _,
|
|
610
|
-
icon: /* @__PURE__ */ P(
|
|
610
|
+
icon: /* @__PURE__ */ P(ee, {
|
|
611
611
|
size: i,
|
|
612
612
|
"aria-hidden": !0,
|
|
613
613
|
stroke: l
|
|
614
614
|
}),
|
|
615
|
-
renderOverlay:
|
|
615
|
+
renderOverlay: Q,
|
|
616
616
|
backLabel: v
|
|
617
617
|
} : void 0, [
|
|
618
618
|
e,
|
|
619
619
|
_,
|
|
620
620
|
v,
|
|
621
|
-
|
|
622
|
-
]),
|
|
621
|
+
Q
|
|
622
|
+
]), me = O(() => e ? {
|
|
623
623
|
triggerPrefix: ye,
|
|
624
624
|
menuLabel: _,
|
|
625
625
|
emptyQueryHint: b,
|
|
626
|
-
onTextPaste:
|
|
627
|
-
renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ P(
|
|
628
|
-
favorites:
|
|
626
|
+
onTextPaste: Z,
|
|
627
|
+
renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ P(K, {
|
|
628
|
+
favorites: W,
|
|
629
629
|
searchQuery: e,
|
|
630
630
|
listboxId: r,
|
|
631
631
|
activeOptionId: i,
|
|
632
632
|
onSelect: (e) => {
|
|
633
|
-
n({ consumeQuery: !0 }),
|
|
633
|
+
n({ consumeQuery: !0 }), G(e.id, e.name, t);
|
|
634
634
|
},
|
|
635
635
|
onToggleFavorite: s,
|
|
636
636
|
onBrowse: () => {
|
|
637
|
-
let r = `${ye}${e}`, i =
|
|
637
|
+
let r = `${ye}${e}`, i = z.anchors.find((e) => e.start === t && e.length === r.length);
|
|
638
638
|
n({
|
|
639
639
|
consumeQuery: !0,
|
|
640
640
|
returnFocus: !1
|
|
641
|
-
}),
|
|
641
|
+
}), ne(t), F.current = {
|
|
642
642
|
position: t,
|
|
643
643
|
text: r,
|
|
644
644
|
mentionUrl: i?.url
|
|
645
|
-
},
|
|
645
|
+
}, j(!0);
|
|
646
646
|
},
|
|
647
647
|
onViewDetails: (e) => {
|
|
648
|
-
n({ consumeQuery: !0 }),
|
|
648
|
+
n({ consumeQuery: !0 }), N(e.id);
|
|
649
649
|
},
|
|
650
650
|
isRowTooltipHidden: m,
|
|
651
651
|
labels: E
|
|
@@ -654,28 +654,28 @@ var B = {
|
|
|
654
654
|
e,
|
|
655
655
|
_,
|
|
656
656
|
b,
|
|
657
|
+
W,
|
|
657
658
|
G,
|
|
658
|
-
|
|
659
|
-
B.anchors,
|
|
659
|
+
z.anchors,
|
|
660
660
|
s,
|
|
661
661
|
m,
|
|
662
662
|
E,
|
|
663
|
-
|
|
663
|
+
Z
|
|
664
664
|
]), _e = w(() => {
|
|
665
|
-
|
|
665
|
+
j(!1);
|
|
666
666
|
let e = F.current;
|
|
667
667
|
if (F.current = null, e == null) return;
|
|
668
668
|
let { position: t, text: n, mentionUrl: r } = e;
|
|
669
|
-
r == null ?
|
|
670
|
-
}, [
|
|
669
|
+
r == null ? z.onDraftChange(z.draft.slice(0, t) + n + z.draft.slice(t)) : z.restoreMention(r, n.slice(1), t), L((e) => e + 1), R(t + n.length);
|
|
670
|
+
}, [z]);
|
|
671
671
|
return {
|
|
672
|
-
skillMenuOverlay:
|
|
673
|
-
commandMenu:
|
|
674
|
-
skillCatalogModal: /* @__PURE__ */ P(
|
|
675
|
-
isOpen:
|
|
672
|
+
skillMenuOverlay: fe,
|
|
673
|
+
commandMenu: me,
|
|
674
|
+
skillCatalogModal: /* @__PURE__ */ P(oe, {
|
|
675
|
+
isOpen: D,
|
|
676
676
|
onClose: _e,
|
|
677
677
|
onSelect: (e) => {
|
|
678
|
-
F.current = null,
|
|
678
|
+
F.current = null, G(e, H(e), te), j(!1);
|
|
679
679
|
},
|
|
680
680
|
title: y,
|
|
681
681
|
renderContent: h
|
|
@@ -683,23 +683,23 @@ var B = {
|
|
|
683
683
|
skillDetailsPanel: /* @__PURE__ */ P(C, {
|
|
684
684
|
fallback: null,
|
|
685
685
|
children: /* @__PURE__ */ P(g, {
|
|
686
|
-
skillId:
|
|
687
|
-
onClose: () =>
|
|
686
|
+
skillId: M,
|
|
687
|
+
onClose: () => N(null)
|
|
688
688
|
})
|
|
689
689
|
}),
|
|
690
|
-
message:
|
|
690
|
+
message: z.draft,
|
|
691
691
|
messageRevision: I,
|
|
692
|
-
activeMentions:
|
|
693
|
-
onDraftChange:
|
|
694
|
-
onBackspaceAtCaret:
|
|
695
|
-
caretPositionOverride:
|
|
696
|
-
isSkillUnsupported:
|
|
697
|
-
selectedSkills:
|
|
698
|
-
resetSkillMentions:
|
|
699
|
-
seedSkillMentions:
|
|
700
|
-
recognizeMentionsInInsertion:
|
|
701
|
-
renderHistorySkillSegments:
|
|
702
|
-
renderHistorySkills:
|
|
692
|
+
activeMentions: ae,
|
|
693
|
+
onDraftChange: z.onDraftChange,
|
|
694
|
+
onBackspaceAtCaret: z.onBackspaceAtCaret,
|
|
695
|
+
caretPositionOverride: re,
|
|
696
|
+
isSkillUnsupported: ie,
|
|
697
|
+
selectedSkills: z.orderedSkills,
|
|
698
|
+
resetSkillMentions: Y,
|
|
699
|
+
seedSkillMentions: se,
|
|
700
|
+
recognizeMentionsInInsertion: Z,
|
|
701
|
+
renderHistorySkillSegments: ue,
|
|
702
|
+
renderHistorySkills: de
|
|
703
703
|
};
|
|
704
704
|
}, xe = {
|
|
705
705
|
background: "_background_1ult0_1",
|
|
@@ -708,12 +708,12 @@ var B = {
|
|
|
708
708
|
clear: "_clear_1ult0_13",
|
|
709
709
|
invalid: "_invalid_1ult0_17"
|
|
710
710
|
}, Se = [], Ce = "Selected model does not support skills. Select a different model to use a skill.", we = ({ value: i, onChange: a, displayNames: o, skills: s = Se, isSkillsSupported: l, isDisabled: u = !1, error: d, labels: f, className: m, styles: h }) => {
|
|
711
|
-
let [g, _] =
|
|
711
|
+
let [g, _] = A(!1), [y, b] = A(""), S = E(), C = i.some((e) => n(e, l)), w = l && !u, T = g && w, D = i.length > 0 ? f.unsupportedTooltipLabel : void 0, O = !l && i.length === 0, k = O ? f.unavailableHintLabel ?? Ce : void 0, ee = new Map(i.map((e) => [e, {
|
|
712
712
|
id: e,
|
|
713
713
|
name: o?.[e] || e
|
|
714
714
|
}]));
|
|
715
|
-
s.forEach((e) =>
|
|
716
|
-
let
|
|
715
|
+
s.forEach((e) => ee.set(e.id, e));
|
|
716
|
+
let j = [...ee.values()].map((t) => ({
|
|
717
717
|
value: t.id,
|
|
718
718
|
label: t.name,
|
|
719
719
|
labelNode: y.trim() ? /* @__PURE__ */ P(p, {
|
|
@@ -726,7 +726,7 @@ var B = {
|
|
|
726
726
|
initialsName: t.name
|
|
727
727
|
}),
|
|
728
728
|
disabled: !l
|
|
729
|
-
})),
|
|
729
|
+
})), M = {
|
|
730
730
|
...t({
|
|
731
731
|
"--ssf-text": h?.colors?.text,
|
|
732
732
|
"--ssf-bg": h?.colors?.background,
|
|
@@ -735,21 +735,11 @@ var B = {
|
|
|
735
735
|
}),
|
|
736
736
|
...h?.cssVars
|
|
737
737
|
};
|
|
738
|
-
return
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
}, [
|
|
742
|
-
j,
|
|
743
|
-
C,
|
|
744
|
-
d,
|
|
745
|
-
u,
|
|
746
|
-
w
|
|
747
|
-
]), /* @__PURE__ */ F("div", {
|
|
748
|
-
ref: S,
|
|
749
|
-
className: r("min-w-0", m, B.selectorField),
|
|
750
|
-
style: N,
|
|
738
|
+
return /* @__PURE__ */ F("div", {
|
|
739
|
+
className: r("min-w-0", m, z.selectorField),
|
|
740
|
+
style: M,
|
|
751
741
|
children: [/* @__PURE__ */ P(x, {
|
|
752
|
-
tooltip:
|
|
742
|
+
tooltip: D,
|
|
753
743
|
hideTooltip: l,
|
|
754
744
|
triggerClassName: "block w-full min-w-0",
|
|
755
745
|
children: /* @__PURE__ */ P("div", {
|
|
@@ -757,34 +747,35 @@ var B = {
|
|
|
757
747
|
children: /* @__PURE__ */ P(v, {
|
|
758
748
|
multiple: !0,
|
|
759
749
|
searchable: !0,
|
|
760
|
-
open:
|
|
750
|
+
open: T,
|
|
761
751
|
onOpenChange: (e) => {
|
|
762
|
-
(!e ||
|
|
752
|
+
(!e || w) && _(e);
|
|
763
753
|
},
|
|
764
754
|
onSearchQueryChange: b,
|
|
765
755
|
value: i,
|
|
766
756
|
onChange: (e) => {
|
|
767
757
|
u || a(Array.isArray(e) ? e : [e]);
|
|
768
758
|
},
|
|
769
|
-
options:
|
|
759
|
+
options: j,
|
|
770
760
|
placeholder: f.placeholder,
|
|
771
761
|
labelProps: { label: f.fieldLabel },
|
|
772
762
|
error: d,
|
|
763
|
+
ariaDescribedBy: k ? S : void 0,
|
|
773
764
|
searchPlaceholder: f.searchPlaceholder ?? "Search skills",
|
|
774
765
|
emptyStateTitle: y.trim() ? f.noMatchingSkillsLabel ?? "No matching skills" : f.emptyLabel ?? "No skills available",
|
|
775
|
-
disabled: u ||
|
|
776
|
-
invalid: !!d ||
|
|
766
|
+
disabled: u || O,
|
|
767
|
+
invalid: !!d || C,
|
|
777
768
|
className: "w-full min-w-0",
|
|
778
|
-
fieldClassName: r(
|
|
769
|
+
fieldClassName: r(w ? "cursor-pointer" : "cursor-not-allowed", "--ssf-bg" in M && xe.background, "--ssf-border" in M && xe.border, "--ssf-text" in M && xe.value, (d || C) && xe.invalid, h?.typography?.fontClassName ?? "dial-small-text", h?.triggerClassName),
|
|
779
770
|
listClassName: "w-[min(var(--reference-width),calc(100vw-2rem))] max-w-full"
|
|
780
771
|
})
|
|
781
772
|
})
|
|
782
|
-
}),
|
|
783
|
-
id:
|
|
773
|
+
}), k && /* @__PURE__ */ P("span", {
|
|
774
|
+
id: S,
|
|
784
775
|
className: "sr-only",
|
|
785
|
-
children:
|
|
776
|
+
children: k
|
|
786
777
|
})]
|
|
787
778
|
});
|
|
788
779
|
};
|
|
789
780
|
//#endregion
|
|
790
|
-
export {
|
|
781
|
+
export { U as ChatSkill, K as FavoriteSkillsPanel, z as SKILLS_CLASS, J as SkillArchiveUploadDialog, oe as SkillCatalogModal, X as SkillContentFileTree, Z as SkillDetailsSidePanel, H as SkillInfoTooltipContent, we as SkillSelectorField, V as SkillUnresolvedReason, ge as buildFavoriteSkillItem, ue as diffTextChange, fe as findMentionAtCaret, $ as getSkillFallbackName, Q as insertAnchor, ce as matchSkillMentions, de as reconcileAnchors, he as useSkillMentions, be as useSkillSelectorOverlay };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-skills",
|
|
3
3
|
"description": "Host-agnostic UI for picking a favorite skill to attach to a chat input",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.160",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-catalog": "1.3.0-dev.
|
|
22
|
-
"@epam/ai-dial-conversation-input": "1.3.0-dev.
|
|
21
|
+
"@epam/ai-dial-catalog": "1.3.0-dev.160",
|
|
22
|
+
"@epam/ai-dial-conversation-input": "1.3.0-dev.160"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.160",
|
|
26
26
|
"@epam/ai-dial-react-file-manager": "^0.4.0-dev.11",
|
|
27
|
-
"@epam/ai-dial-ui-kit": "^0.16.0-dev.
|
|
27
|
+
"@epam/ai-dial-ui-kit": "^0.16.0-dev.33",
|
|
28
28
|
"react": "^19.2.8"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|