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