@epam/ai-dial-skills 1.2.0-rc.0 → 1.3.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hooks/useSkillMentions/useSkillMentions.d.ts +7 -0
- package/hooks/useSkillMentions/useSkillMentions.d.ts.map +1 -1
- package/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.d.ts.map +1 -1
- package/index.js +231 -187
- package/models/skill-selector-overlay.d.ts +8 -0
- package/models/skill-selector-overlay.d.ts.map +1 -1
- package/package.json +4 -4
- package/utils/skill-mention-matching.d.ts +9 -0
- package/utils/skill-mention-matching.d.ts.map +1 -1
- package/utils/skill-mention-tracking.d.ts +5 -0
- package/utils/skill-mention-tracking.d.ts.map +1 -1
|
@@ -43,6 +43,13 @@ export interface UseSkillMentionsResult {
|
|
|
43
43
|
* not seeded as an anchor.
|
|
44
44
|
*/
|
|
45
45
|
seedFromMessage: (text: string, skills: RequestSkill[] | undefined, resolveName: (url: string) => string) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Registers text about to be inserted into the draft (e.g. a picked prompt)
|
|
48
|
+
* with the mentions found in it, offsets relative to `text`. The next
|
|
49
|
+
* `onDraftChange` that lands `text` tracks them as anchors; any other
|
|
50
|
+
* change discards them.
|
|
51
|
+
*/
|
|
52
|
+
expectInsertion: (text: string, mentions: SkillMentionAnchor[]) => void;
|
|
46
53
|
}
|
|
47
54
|
/**
|
|
48
55
|
* Tracks an ordered set of skill mentions live within a plain-text draft, as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSkillMentions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSkillMentions/useSkillMentions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"useSkillMentions.d.ts","source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
1
|
-
{"version":3,"file":"useSkillSelectorOverlay.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"useSkillSelectorOverlay.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,qCAAqC,CAAC;AAsB7C;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,iSAerC,8BAA8B,KAAG,6BA6iBnC,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
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, FileDropzone as u, GhostButton as d, Highlight as f, InteractiveTooltip as p, InteractiveTooltipTrigger as m, Popup as h, PopupSize as g, Select as _, Spinner as v, ToggleIconButton as y, Tooltip as b, TooltipPlacement as x } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { Suspense as S, useCallback as C, useEffect as w, useId as T, useLayoutEffect as
|
|
4
|
-
import { IconBlocks as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { DialFileNodeType as
|
|
7
|
-
import { CatalogContentNodeType as
|
|
3
|
+
import { Suspense as S, useCallback as C, useEffect as w, useId as T, useLayoutEffect as E, useMemo as D, useRef as O, useState as k } from "react";
|
|
4
|
+
import { IconBlocks as ee, IconEye as A, IconLock as j, IconStarFilled as M, IconTrash as N } from "@tabler/icons-react";
|
|
5
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
6
|
+
import { DialFileNodeType as L, DialFoldersTree as R } from "@epam/ai-dial-react-file-manager";
|
|
7
|
+
import { CatalogContentNodeType as te, DetailsPanel as z } from "@epam/ai-dial-catalog";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
9
|
var B = {
|
|
10
10
|
selectorField: "dial-skills-selector-field",
|
|
@@ -14,31 +14,31 @@ var B = {
|
|
|
14
14
|
return e.Deleted = "deleted", e.NotShared = "not-shared", e;
|
|
15
15
|
}({}), H = ({ description: e, unsupportedMessage: t, unresolvedReason: n, deletedMessage: r, notSharedMessage: i, viewDetailsLabel: u = "View details", onViewDetails: d, viewDetailsTabIndex: f }) => {
|
|
16
16
|
if (n != null) {
|
|
17
|
-
let e = n === V.Deleted, t = e ?
|
|
18
|
-
return /* @__PURE__ */
|
|
17
|
+
let e = n === V.Deleted, t = e ? N : j, a = e ? r : i;
|
|
18
|
+
return /* @__PURE__ */ I("div", {
|
|
19
19
|
className: "flex flex-row items-center gap-2",
|
|
20
|
-
children: [/* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ F(t, {
|
|
21
21
|
size: c.MD,
|
|
22
22
|
stroke: l,
|
|
23
23
|
"aria-hidden": !0,
|
|
24
24
|
className: "shrink-0 text-secondary"
|
|
25
|
-
}), /* @__PURE__ */
|
|
25
|
+
}), /* @__PURE__ */ F("p", {
|
|
26
26
|
className: "dial-tiny-text text-start text-primary",
|
|
27
27
|
children: a
|
|
28
28
|
})]
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
return t == null ? /* @__PURE__ */
|
|
31
|
+
return t == null ? /* @__PURE__ */ I("div", {
|
|
32
32
|
className: "flex flex-col gap-3",
|
|
33
|
-
children: [e != null && e !== "" && /* @__PURE__ */
|
|
33
|
+
children: [e != null && e !== "" && /* @__PURE__ */ F("p", {
|
|
34
34
|
className: "text-start",
|
|
35
35
|
children: e
|
|
36
|
-
}), /* @__PURE__ */
|
|
36
|
+
}), /* @__PURE__ */ F(a, {
|
|
37
37
|
variant: s.Primary,
|
|
38
38
|
appearance: o.Link,
|
|
39
39
|
className: "h-[24px] self-start",
|
|
40
40
|
label: u,
|
|
41
|
-
iconBefore: /* @__PURE__ */
|
|
41
|
+
iconBefore: /* @__PURE__ */ F(A, {
|
|
42
42
|
size: c.SM,
|
|
43
43
|
stroke: l,
|
|
44
44
|
"aria-hidden": !0
|
|
@@ -46,43 +46,43 @@ var B = {
|
|
|
46
46
|
onClick: d,
|
|
47
47
|
tabIndex: f
|
|
48
48
|
})]
|
|
49
|
-
}) : /* @__PURE__ */
|
|
49
|
+
}) : /* @__PURE__ */ F("p", {
|
|
50
50
|
className: "text-start",
|
|
51
51
|
children: t
|
|
52
52
|
});
|
|
53
53
|
}, 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 = {} }) => {
|
|
54
|
-
let { viewDetailsLabel: f = "View details", unsupportedTooltipLabel: h = "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
|
+
let { viewDetailsLabel: f = "View details", unsupportedTooltipLabel: h = "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] = k(0), b = l === "click", S = () => {
|
|
55
55
|
y((e) => e + 1), u(t);
|
|
56
|
-
}, C =
|
|
57
|
-
return
|
|
56
|
+
}, C = O(null), [w, T] = k(null);
|
|
57
|
+
return E(() => {
|
|
58
58
|
let e = C.current, t = () => T(e?.getBoundingClientRect().width ?? null);
|
|
59
59
|
if (t(), !e || typeof ResizeObserver > "u") return;
|
|
60
60
|
let n = new ResizeObserver(t);
|
|
61
61
|
return n.observe(e), () => n.disconnect();
|
|
62
|
-
}, [o]), /* @__PURE__ */
|
|
62
|
+
}, [o]), /* @__PURE__ */ F(p, {
|
|
63
63
|
asChild: !0,
|
|
64
64
|
placement: x.Top,
|
|
65
65
|
trigger: b ? m.Click : m.Hover,
|
|
66
66
|
contentClassName: "max-w-[min(550px,calc(100vw-10px))]",
|
|
67
|
-
content: a == null ? i ? /* @__PURE__ */
|
|
67
|
+
content: a == null ? i ? /* @__PURE__ */ F(H, { unsupportedMessage: h }) : /* @__PURE__ */ F(H, {
|
|
68
68
|
description: n,
|
|
69
69
|
viewDetailsLabel: f,
|
|
70
70
|
onViewDetails: S
|
|
71
|
-
}) : /* @__PURE__ */
|
|
71
|
+
}) : /* @__PURE__ */ F(H, {
|
|
72
72
|
unresolvedReason: a,
|
|
73
73
|
deletedMessage: g,
|
|
74
74
|
notSharedMessage: _
|
|
75
75
|
}),
|
|
76
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ I("span", {
|
|
77
77
|
tabIndex: 0,
|
|
78
78
|
className: r("relative -me-1 -ms-1 inline cursor-pointer select-text rounded-full pe-1 ps-1", i ? c : "hover:bg-info focus-visible:bg-info active:bg-info", i ? r(o, s) : o, B.chip),
|
|
79
79
|
"aria-label": `/${e}`,
|
|
80
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ F("span", {
|
|
81
81
|
ref: C,
|
|
82
82
|
"aria-hidden": !0,
|
|
83
83
|
className: "inset-inline-start-0 pointer-events-none absolute top-0 select-none",
|
|
84
84
|
children: "/"
|
|
85
|
-
}), /* @__PURE__ */
|
|
85
|
+
}), /* @__PURE__ */ F("span", {
|
|
86
86
|
"aria-hidden": !0,
|
|
87
87
|
className: "select-none",
|
|
88
88
|
style: { paddingInlineStart: w ?? void 0 },
|
|
@@ -102,13 +102,13 @@ var B = {
|
|
|
102
102
|
rowFadeOut: "_rowFadeOut_1v431_1",
|
|
103
103
|
listContent: "_listContent_1v431_60"
|
|
104
104
|
}, G = "px-3 pb-0.5 pt-2", ne = 180, re = 288, K = ({ favorites: n, onSelect: i, onToggleFavorite: a, onBrowse: o, onViewDetails: s, className: l, rowClassName: u, searchQuery: m, listboxId: h, activeOptionId: g, isMenu: _ = !1, labels: v = {}, colors: b, nameClassName: x = "dial-small-text", headerClassName: S = "dial-tiny-lead-semi-text", emptyHintClassName: C = "dial-small-text" }) => {
|
|
105
|
-
let { myCollectionLabel:
|
|
105
|
+
let { myCollectionLabel: D = "My Collection", emptyHintLabel: ee = "Star a skill to pin it here", browseLabel: A = "Browse", removeFromFavoritesLabel: j = "Remove from favorites", viewDetailsLabel: N = "View details", noMatchingSkillsLabel: P = "No matching skills" } = v, L = t({
|
|
106
106
|
"--fs-row-hover-bg": b?.rowHoverBackground,
|
|
107
107
|
"--fs-header-text": b?.headerText,
|
|
108
108
|
"--fs-empty-hint-text": b?.emptyHintText,
|
|
109
109
|
"--fs-star-color": b?.starColor,
|
|
110
110
|
"--fs-footer-border": b?.footerBorder
|
|
111
|
-
}), [
|
|
111
|
+
}), [R, te] = k(/* @__PURE__ */ new Set()), z = O(/* @__PURE__ */ new Map());
|
|
112
112
|
w(() => {
|
|
113
113
|
let e = z.current;
|
|
114
114
|
return () => {
|
|
@@ -117,43 +117,43 @@ var B = {
|
|
|
117
117
|
}, []);
|
|
118
118
|
let V = h != null, U = _ && !V, K = V || U ? "none" : void 0, q = "button";
|
|
119
119
|
V ? q = "option" : U && (q = "menuitem");
|
|
120
|
-
let J = T(), Y = m != null, X = m?.toLowerCase() ?? "", Z = Y ? n.filter((e) => e.name.toLowerCase().includes(X)) : n, Q =
|
|
121
|
-
|
|
122
|
-
Q.current &&
|
|
120
|
+
let J = T(), Y = m != null, X = m?.toLowerCase() ?? "", Z = Y ? n.filter((e) => e.name.toLowerCase().includes(X)) : n, Q = O(null), [$, ie] = k();
|
|
121
|
+
E(() => {
|
|
122
|
+
Q.current && ie(Math.min(Q.current.scrollHeight, re));
|
|
123
123
|
}, [n, m]);
|
|
124
|
-
let
|
|
124
|
+
let ae = (e, t) => {
|
|
125
125
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i(t));
|
|
126
|
-
},
|
|
127
|
-
|
|
126
|
+
}, oe = (e) => {
|
|
127
|
+
te((t) => new Set(t).add(e));
|
|
128
128
|
let t = setTimeout(() => {
|
|
129
|
-
a?.(e),
|
|
129
|
+
a?.(e), te((t) => {
|
|
130
130
|
let n = new Set(t);
|
|
131
131
|
return n.delete(e), n;
|
|
132
132
|
}), z.current.delete(e);
|
|
133
133
|
}, ne);
|
|
134
134
|
z.current.set(e, t);
|
|
135
135
|
};
|
|
136
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ I("div", {
|
|
137
137
|
className: r("flex w-full flex-col desktop:w-[280px]", l, B.favoritesPanel),
|
|
138
|
-
style:
|
|
138
|
+
style: L,
|
|
139
139
|
children: [
|
|
140
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ F("p", {
|
|
141
141
|
id: J,
|
|
142
142
|
className: r(S, G, W.header),
|
|
143
|
-
children:
|
|
143
|
+
children: D
|
|
144
144
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ F("div", {
|
|
146
146
|
className: r("max-h-72 min-h-0 flex-1 overflow-y-auto", W.listContent),
|
|
147
|
-
style: { maxHeight:
|
|
148
|
-
children: /* @__PURE__ */
|
|
147
|
+
style: { maxHeight: $ },
|
|
148
|
+
children: /* @__PURE__ */ F("div", {
|
|
149
149
|
ref: Q,
|
|
150
|
-
children: Z.length > 0 ? /* @__PURE__ */
|
|
150
|
+
children: Z.length > 0 ? /* @__PURE__ */ F("ul", {
|
|
151
151
|
id: h,
|
|
152
152
|
role: V ? "listbox" : K,
|
|
153
153
|
"aria-labelledby": V ? J : void 0,
|
|
154
154
|
className: "flex flex-col gap-1 px-1 pb-1",
|
|
155
155
|
children: Z.map((t) => {
|
|
156
|
-
let n = V ? `${h}-${encodeURIComponent(t.id)}` : void 0, o = V ? -1 : void 0, l = /* @__PURE__ */
|
|
156
|
+
let n = V ? `${h}-${encodeURIComponent(t.id)}` : void 0, o = V ? -1 : void 0, l = /* @__PURE__ */ I("div", {
|
|
157
157
|
role: q,
|
|
158
158
|
id: n,
|
|
159
159
|
"aria-selected": V ? n === g : void 0,
|
|
@@ -161,45 +161,45 @@ var B = {
|
|
|
161
161
|
tabIndex: 0,
|
|
162
162
|
className: r("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors", W.row, u),
|
|
163
163
|
onClick: () => i(t),
|
|
164
|
-
onKeyDown: (e) =>
|
|
164
|
+
onKeyDown: (e) => ae(e, t),
|
|
165
165
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ F(e, {
|
|
167
167
|
size: c.MD,
|
|
168
168
|
initialsName: t.name
|
|
169
169
|
}),
|
|
170
|
-
m == null ? /* @__PURE__ */
|
|
170
|
+
m == null ? /* @__PURE__ */ F("span", {
|
|
171
171
|
className: r(x, "min-w-0 flex-1 truncate text-start"),
|
|
172
172
|
children: t.name
|
|
173
|
-
}) : /* @__PURE__ */
|
|
173
|
+
}) : /* @__PURE__ */ F(f, {
|
|
174
174
|
text: t.name,
|
|
175
175
|
query: m,
|
|
176
176
|
maxLines: 1,
|
|
177
177
|
className: r(x, "min-w-0 flex-1 text-start")
|
|
178
178
|
}),
|
|
179
|
-
a && /* @__PURE__ */
|
|
180
|
-
icon: /* @__PURE__ */
|
|
179
|
+
a && /* @__PURE__ */ F(y, {
|
|
180
|
+
icon: /* @__PURE__ */ F(M, {
|
|
181
181
|
size: c.SM,
|
|
182
182
|
className: W.star,
|
|
183
183
|
"aria-hidden": !0
|
|
184
184
|
}),
|
|
185
|
-
"aria-label":
|
|
185
|
+
"aria-label": j,
|
|
186
186
|
isSelected: !0,
|
|
187
187
|
tabIndex: o,
|
|
188
188
|
onClick: (e) => {
|
|
189
|
-
e.stopPropagation(),
|
|
189
|
+
e.stopPropagation(), oe(t.id);
|
|
190
190
|
}
|
|
191
191
|
})
|
|
192
192
|
]
|
|
193
193
|
});
|
|
194
|
-
return /* @__PURE__ */
|
|
194
|
+
return /* @__PURE__ */ F("li", {
|
|
195
195
|
role: K,
|
|
196
|
-
className:
|
|
197
|
-
children: s ? /* @__PURE__ */
|
|
196
|
+
className: R.has(t.id) ? W.rowLeaving : W.rowEnter,
|
|
197
|
+
children: s ? /* @__PURE__ */ F(p, {
|
|
198
198
|
asChild: !0,
|
|
199
199
|
contentClassName: "max-w-[550px]",
|
|
200
|
-
content: /* @__PURE__ */
|
|
200
|
+
content: /* @__PURE__ */ F(H, {
|
|
201
201
|
description: t.description,
|
|
202
|
-
viewDetailsLabel:
|
|
202
|
+
viewDetailsLabel: N,
|
|
203
203
|
onViewDetails: () => s(t),
|
|
204
204
|
viewDetailsTabIndex: o
|
|
205
205
|
}),
|
|
@@ -207,22 +207,22 @@ var B = {
|
|
|
207
207
|
}) : l
|
|
208
208
|
}, t.id);
|
|
209
209
|
})
|
|
210
|
-
}) : Y && X !== "" ? /* @__PURE__ */
|
|
210
|
+
}) : Y && X !== "" ? /* @__PURE__ */ F("p", {
|
|
211
211
|
role: "status",
|
|
212
212
|
"aria-live": "polite",
|
|
213
213
|
className: r(C, "px-4 py-4 text-start", W.emptyHint),
|
|
214
|
-
children:
|
|
215
|
-
}) : /* @__PURE__ */
|
|
214
|
+
children: P
|
|
215
|
+
}) : /* @__PURE__ */ F("p", {
|
|
216
216
|
className: r(C, "px-4 py-4 text-start", W.emptyHint),
|
|
217
|
-
children:
|
|
217
|
+
children: ee
|
|
218
218
|
})
|
|
219
219
|
})
|
|
220
220
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ F("div", {
|
|
222
222
|
className: r("border-t px-2 py-3", W.footer),
|
|
223
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ F(d, {
|
|
224
224
|
role: U ? "menuitem" : void 0,
|
|
225
|
-
label:
|
|
225
|
+
label: A,
|
|
226
226
|
className: "w-full justify-center",
|
|
227
227
|
onClick: o
|
|
228
228
|
})
|
|
@@ -231,19 +231,19 @@ var B = {
|
|
|
231
231
|
});
|
|
232
232
|
}, q = ".zip,.md", J = ({ isOpen: e, errorText: t, isUploading: n = !1, accept: r = q, labels: i, onClose: a, onFilesSelected: o, onFilesRejected: s }) => {
|
|
233
233
|
let { dialogTitle: c = "Upload skill", dropZoneLabel: l = "Drag and drop it or click here to upload", dropZoneMobileLabel: d = "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: _ = "Uploading skill" } = i ?? {};
|
|
234
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ F(h, {
|
|
235
235
|
open: e,
|
|
236
236
|
size: g.Sm,
|
|
237
237
|
header: c,
|
|
238
238
|
closeAriaLabel: m,
|
|
239
239
|
onClose: a,
|
|
240
|
-
children: /* @__PURE__ */
|
|
240
|
+
children: /* @__PURE__ */ I("div", {
|
|
241
241
|
className: "flex flex-col gap-4 px-6 py-4",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
243
|
-
label: /* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ F(u, {
|
|
243
|
+
label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
|
|
244
244
|
className: "desktop:hidden",
|
|
245
245
|
children: d
|
|
246
|
-
}), /* @__PURE__ */
|
|
246
|
+
}), /* @__PURE__ */ F("span", {
|
|
247
247
|
className: "hidden desktop:inline",
|
|
248
248
|
children: l
|
|
249
249
|
})] }),
|
|
@@ -254,55 +254,55 @@ var B = {
|
|
|
254
254
|
errorText: n ? void 0 : t,
|
|
255
255
|
onChange: o,
|
|
256
256
|
onReject: s
|
|
257
|
-
}), n && /* @__PURE__ */
|
|
257
|
+
}), n && /* @__PURE__ */ F(v, { ariaLabel: _ })]
|
|
258
258
|
})
|
|
259
259
|
});
|
|
260
|
-
}, Y = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */
|
|
260
|
+
}, Y = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ F(h, {
|
|
261
261
|
open: e,
|
|
262
262
|
header: r,
|
|
263
263
|
size: g.Lg,
|
|
264
264
|
className: "h-[min(90vh,860px)] !max-w-[min(95vw,1200px)] overflow-hidden",
|
|
265
265
|
onClose: t,
|
|
266
|
-
children: /* @__PURE__ */
|
|
266
|
+
children: /* @__PURE__ */ F("div", {
|
|
267
267
|
className: "h-[min(80vh,840px)] overflow-auto",
|
|
268
|
-
children: /* @__PURE__ */
|
|
268
|
+
children: /* @__PURE__ */ F(S, {
|
|
269
269
|
fallback: null,
|
|
270
270
|
children: e && i(n, t)
|
|
271
271
|
})
|
|
272
272
|
})
|
|
273
|
-
}), X = (e, t = null) => e.map((e) => e.type ===
|
|
273
|
+
}), X = (e, t = null) => e.map((e) => e.type === te.Folder ? {
|
|
274
274
|
path: e.id,
|
|
275
275
|
name: e.name,
|
|
276
|
-
nodeType:
|
|
276
|
+
nodeType: L.FOLDER,
|
|
277
277
|
parentPath: t,
|
|
278
278
|
folderId: e.id,
|
|
279
279
|
items: X(e.items, e.id)
|
|
280
280
|
} : {
|
|
281
281
|
path: e.id,
|
|
282
282
|
name: e.name,
|
|
283
|
-
nodeType:
|
|
283
|
+
nodeType: L.ITEM,
|
|
284
284
|
parentPath: t,
|
|
285
285
|
folderId: t ?? ""
|
|
286
|
-
}), Z = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => /* @__PURE__ */
|
|
287
|
-
items:
|
|
286
|
+
}), Z = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => /* @__PURE__ */ F(R, {
|
|
287
|
+
items: D(() => X(e), [e]),
|
|
288
288
|
showFiles: !0,
|
|
289
289
|
areHiddenFilesVisible: !0,
|
|
290
290
|
selectedPath: t,
|
|
291
|
-
expandedPaths:
|
|
291
|
+
expandedPaths: D(() => new Set(n), [n]),
|
|
292
292
|
onExpandedPathsChange: (e) => {
|
|
293
293
|
for (let t of e) n.has(t) || r(t);
|
|
294
294
|
for (let t of n) e.has(t) || r(t);
|
|
295
295
|
},
|
|
296
296
|
onItemClick: (e) => {
|
|
297
|
-
e.nodeType ===
|
|
297
|
+
e.nodeType === L.ITEM && i(e.path);
|
|
298
298
|
},
|
|
299
299
|
ariaLabel: o,
|
|
300
300
|
autoFocus: !0,
|
|
301
301
|
onEscape: a
|
|
302
|
-
}), Q = (e) => /* @__PURE__ */
|
|
302
|
+
}), Q = (e) => /* @__PURE__ */ F(z, {
|
|
303
303
|
...e,
|
|
304
|
-
renderContentFileTree: (e) => /* @__PURE__ */
|
|
305
|
-
}),
|
|
304
|
+
renderContentFileTree: (e) => /* @__PURE__ */ F(Z, { ...e })
|
|
305
|
+
}), $ = (e) => e == null || /[\s/]/.test(e), ie = (e, t, n) => {
|
|
306
306
|
let r = [], i = 0;
|
|
307
307
|
return t.forEach((t, a) => {
|
|
308
308
|
let o = `/${n(t.url)}`, s = i;
|
|
@@ -310,7 +310,7 @@ var B = {
|
|
|
310
310
|
let t = e.indexOf(o, s);
|
|
311
311
|
if (t === -1) return;
|
|
312
312
|
let n = t + o.length;
|
|
313
|
-
if (
|
|
313
|
+
if ($(e[n])) {
|
|
314
314
|
r.push({
|
|
315
315
|
skillIndex: a,
|
|
316
316
|
start: t,
|
|
@@ -321,6 +321,22 @@ var B = {
|
|
|
321
321
|
s = t + 1;
|
|
322
322
|
}
|
|
323
323
|
}), r;
|
|
324
|
+
}, ae = (e, t) => {
|
|
325
|
+
let n = /* @__PURE__ */ new Map();
|
|
326
|
+
t.forEach((e) => {
|
|
327
|
+
e.name !== "" && !n.has(e.name) && n.set(e.name, e.url);
|
|
328
|
+
});
|
|
329
|
+
let r = [...n.keys()].sort((e, t) => t.length - e.length), i = [], a = e.indexOf("/");
|
|
330
|
+
for (; a !== -1;) {
|
|
331
|
+
let t = a === 0 || /\s/.test(e[a - 1]), o = a + 1, s = t ? r.find((t) => e.startsWith(t, o) && $(e[o + t.length])) : void 0, c = s == null ? void 0 : n.get(s);
|
|
332
|
+
s != null && c != null ? (i.push({
|
|
333
|
+
url: c,
|
|
334
|
+
name: s,
|
|
335
|
+
start: a,
|
|
336
|
+
length: s.length + 1
|
|
337
|
+
}), a = e.indexOf("/", o + s.length)) : a = e.indexOf("/", o);
|
|
338
|
+
}
|
|
339
|
+
return i;
|
|
324
340
|
}, oe = (e, t) => {
|
|
325
341
|
let n = Math.min(e.length, t.length), r = 0;
|
|
326
342
|
for (; r < n && e[r] === t[r];) r += 1;
|
|
@@ -331,13 +347,13 @@ var B = {
|
|
|
331
347
|
deletedLength: e.length - r - a,
|
|
332
348
|
insertedLength: t.length - r - a
|
|
333
349
|
};
|
|
334
|
-
},
|
|
350
|
+
}, se = (e, t) => {
|
|
335
351
|
let n = t.start + t.deletedLength, r = t.insertedLength - t.deletedLength;
|
|
336
352
|
return e.reduce((e, i) => i.start + i.length <= t.start ? (e.push(i), e) : (i.start >= n && e.push({
|
|
337
353
|
...i,
|
|
338
354
|
start: i.start + r
|
|
339
355
|
}), e), []);
|
|
340
|
-
},
|
|
356
|
+
}, ce = (e, t, n, r, i) => {
|
|
341
357
|
let a = r.length + 1, o = a + +!!i, s = e.map((e) => e.start >= t ? {
|
|
342
358
|
...e,
|
|
343
359
|
start: e.start + o
|
|
@@ -348,7 +364,7 @@ var B = {
|
|
|
348
364
|
length: a
|
|
349
365
|
};
|
|
350
366
|
return [...s, c].sort((e, t) => e.start - t.start);
|
|
351
|
-
},
|
|
367
|
+
}, le = (e, t) => e.find((e) => e.start + e.length === t), ue = (e, t, n) => {
|
|
352
368
|
let r = t;
|
|
353
369
|
for (; r > 0 && !/\s/.test(e[r - 1]);) r--;
|
|
354
370
|
let i = r;
|
|
@@ -358,26 +374,45 @@ var B = {
|
|
|
358
374
|
start: r,
|
|
359
375
|
end: i
|
|
360
376
|
};
|
|
361
|
-
},
|
|
362
|
-
|
|
377
|
+
}, de = (e, t, n) => {
|
|
378
|
+
if (n === "" || t.insertedLength < n.length) return;
|
|
379
|
+
let r = e.indexOf(n, Math.max(0, t.start - n.length)), i = t.start + t.insertedLength - n.length;
|
|
380
|
+
return r !== -1 && r <= i ? r : void 0;
|
|
381
|
+
}, fe = () => {
|
|
382
|
+
let [e, t] = k(""), [n, r] = k([]), i = O(e);
|
|
363
383
|
i.current = e;
|
|
364
|
-
let a =
|
|
384
|
+
let a = O(n);
|
|
365
385
|
a.current = n;
|
|
366
|
-
let o = C((e) => {
|
|
367
|
-
let n = oe(i.current, e);
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
386
|
+
let o = O(null), s = C((e) => {
|
|
387
|
+
let n = oe(i.current, e), a = o.current;
|
|
388
|
+
o.current = null;
|
|
389
|
+
let s = a == null ? void 0 : de(e, n, a.text);
|
|
390
|
+
r((t) => {
|
|
391
|
+
let r = se(t, n);
|
|
392
|
+
if (a == null || s == null) return r;
|
|
393
|
+
let i = a.mentions.map((e) => ({
|
|
394
|
+
...e,
|
|
395
|
+
start: e.start + s
|
|
396
|
+
})).filter((t) => e.startsWith(`/${t.name}`, t.start) && !r.some((e) => e.start < t.start + t.length && t.start < e.start + e.length));
|
|
397
|
+
return [...r, ...i].sort((e, t) => e.start - t.start);
|
|
398
|
+
}), i.current = e, t(e);
|
|
372
399
|
}, []), c = C((e, n, a) => {
|
|
400
|
+
let o = i.current, s = !/^\s/.test(o.slice(a)), c = `/${n}${s ? " " : ""}`, l = o.slice(0, a) + c + o.slice(a);
|
|
401
|
+
return i.current = l, t(l), r((t) => ce(t, a, e, n, s)), s;
|
|
402
|
+
}, []), l = C((e, n, a) => {
|
|
373
403
|
let o = i.current, s = `/${n}`, c = o.slice(0, a) + s + o.slice(a);
|
|
374
|
-
i.current = c, t(c), r((t) =>
|
|
375
|
-
}, []),
|
|
404
|
+
i.current = c, t(c), r((t) => ce(t, a, e, n, !1));
|
|
405
|
+
}, []), u = C((e) => le(a.current, e), []), d = D(() => {
|
|
376
406
|
if (n.length !== 0) return n.map((e) => ({ url: e.url }));
|
|
377
|
-
}, [n]),
|
|
407
|
+
}, [n]), f = C((e, t) => {
|
|
408
|
+
o.current = t.length > 0 ? {
|
|
409
|
+
text: e,
|
|
410
|
+
mentions: t
|
|
411
|
+
} : null;
|
|
412
|
+
}, []), p = C(() => {
|
|
378
413
|
t(""), r([]);
|
|
379
|
-
}, []),
|
|
380
|
-
let a = n ?? [], o =
|
|
414
|
+
}, []), m = C((e, n, i) => {
|
|
415
|
+
let a = n ?? [], o = ie(e, a, i);
|
|
381
416
|
t(e), r(o.map((e) => {
|
|
382
417
|
let t = a[e.skillIndex];
|
|
383
418
|
return {
|
|
@@ -388,39 +423,41 @@ var B = {
|
|
|
388
423
|
};
|
|
389
424
|
}));
|
|
390
425
|
}, []);
|
|
391
|
-
return
|
|
426
|
+
return D(() => ({
|
|
392
427
|
draft: e,
|
|
393
428
|
anchors: n,
|
|
394
|
-
onDraftChange:
|
|
395
|
-
insertMention:
|
|
396
|
-
restoreMention:
|
|
397
|
-
onBackspaceAtCaret:
|
|
398
|
-
orderedSkills:
|
|
399
|
-
reset:
|
|
400
|
-
seedFromMessage:
|
|
429
|
+
onDraftChange: s,
|
|
430
|
+
insertMention: c,
|
|
431
|
+
restoreMention: l,
|
|
432
|
+
onBackspaceAtCaret: u,
|
|
433
|
+
orderedSkills: d,
|
|
434
|
+
reset: p,
|
|
435
|
+
seedFromMessage: m,
|
|
436
|
+
expectInsertion: f
|
|
401
437
|
}), [
|
|
438
|
+
f,
|
|
402
439
|
e,
|
|
403
440
|
n,
|
|
404
|
-
o,
|
|
405
441
|
s,
|
|
406
442
|
c,
|
|
407
443
|
l,
|
|
408
444
|
u,
|
|
409
445
|
d,
|
|
410
|
-
|
|
446
|
+
p,
|
|
447
|
+
m
|
|
411
448
|
]);
|
|
412
|
-
},
|
|
449
|
+
}, pe = (e) => ({
|
|
413
450
|
id: e.url,
|
|
414
451
|
name: e.name,
|
|
415
452
|
description: e.description
|
|
416
|
-
}),
|
|
453
|
+
}), me = (e) => {
|
|
417
454
|
let t = e.split("/").filter((e) => e.length > 0);
|
|
418
455
|
return t[t.length - 1] ?? e;
|
|
419
|
-
},
|
|
456
|
+
}, he = (e) => {
|
|
420
457
|
let t = e.split("/").filter((e) => e.length > 0);
|
|
421
458
|
return t[0] !== "skills" || t.length < 3 ? null : t[1];
|
|
422
|
-
},
|
|
423
|
-
let { addMenuLabel: g = "Skills", backLabel: _ = "Back", catalogModalTitleLabel: v = "Use skill", emptyQueryHintLabel: y = "Type to filter", deletedTooltipLabel: b, notSharedTooltipLabel: x, unsupportedTooltipLabel: w, panelLabels: T } = c ?? {}, [
|
|
459
|
+
}, ge = (e, t) => he(e) === t ? V.Deleted : V.NotShared, _e = "/", ve = ({ 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, renderCatalogContent: m, detailsPanelComponent: h }) => {
|
|
460
|
+
let { addMenuLabel: g = "Skills", backLabel: _ = "Back", catalogModalTitleLabel: v = "Use skill", emptyQueryHintLabel: y = "Type to filter", deletedTooltipLabel: b, notSharedTooltipLabel: x, unsupportedTooltipLabel: w, panelLabels: T } = c ?? {}, [E, A] = k(!1), [j, M] = k(null), [N, P] = k(0), I = O(null), [L, R] = k(0), [te, z] = k(void 0), B = fe(), V = D(() => [
|
|
424
461
|
...t,
|
|
425
462
|
...n ?? [],
|
|
426
463
|
...r ?? []
|
|
@@ -428,18 +465,18 @@ var B = {
|
|
|
428
465
|
t,
|
|
429
466
|
n,
|
|
430
467
|
r
|
|
431
|
-
]), H =
|
|
468
|
+
]), H = D(() => new Map(V.map((e) => [e.url, e])), [V]), W = C((e) => H.get(e)?.name ?? me(e), [H]), G = D(() => V.filter((e) => a.has(e.url)).map((e) => pe(e)), [V, a]), ne = B.anchors.length > 0 && !e, re = D(() => B.anchors.map((t) => ({
|
|
432
469
|
start: t.start,
|
|
433
470
|
length: t.length,
|
|
434
471
|
isUnsupported: !e,
|
|
435
|
-
render: () => /* @__PURE__ */
|
|
472
|
+
render: () => /* @__PURE__ */ F(U, {
|
|
436
473
|
name: t.name,
|
|
437
474
|
path: t.url,
|
|
438
475
|
labelClassName: d,
|
|
439
476
|
description: H.get(t.url)?.description,
|
|
440
477
|
isUnsupported: !e,
|
|
441
478
|
detailsTrigger: f,
|
|
442
|
-
onViewDetails:
|
|
479
|
+
onViewDetails: M,
|
|
443
480
|
labels: {
|
|
444
481
|
viewDetailsLabel: T?.viewDetailsLabel,
|
|
445
482
|
unsupportedTooltipLabel: w
|
|
@@ -455,12 +492,12 @@ var B = {
|
|
|
455
492
|
w
|
|
456
493
|
]), q = C((e, t, n) => {
|
|
457
494
|
let r = B.insertMention(e, t, n);
|
|
458
|
-
|
|
495
|
+
R((e) => e + 1), z(n + 1 + t.length + +!!r);
|
|
459
496
|
}, [B]), J = C((e) => {
|
|
460
|
-
let t =
|
|
497
|
+
let t = ue(B.draft, e, _e);
|
|
461
498
|
return t == null ? e : (B.onDraftChange(B.draft.slice(0, t.start) + B.draft.slice(t.end)), t.start);
|
|
462
499
|
}, [B]), X = C((e) => {
|
|
463
|
-
let t =
|
|
500
|
+
let t = ue(B.draft, e, _e);
|
|
464
501
|
if (t == null) return;
|
|
465
502
|
let n = B.anchors.find((e) => e.start === t.start && e.start + e.length === t.end);
|
|
466
503
|
return {
|
|
@@ -469,23 +506,29 @@ var B = {
|
|
|
469
506
|
mentionUrl: n?.url
|
|
470
507
|
};
|
|
471
508
|
}, [B]), Z = C(() => {
|
|
472
|
-
B.reset(),
|
|
473
|
-
}, [B]), Q = C((
|
|
474
|
-
|
|
475
|
-
}, [
|
|
509
|
+
B.reset(), R((e) => e + 1), z(void 0);
|
|
510
|
+
}, [B]), { expectInsertion: Q } = B, $ = C((t) => {
|
|
511
|
+
Q(t, e ? ae(t, V) : []);
|
|
512
|
+
}, [
|
|
513
|
+
Q,
|
|
514
|
+
e,
|
|
515
|
+
V
|
|
516
|
+
]), oe = C((e, t) => {
|
|
517
|
+
B.seedFromMessage(e, t, W), R((e) => e + 1), z(void 0);
|
|
518
|
+
}, [B, W]), se = C((e, t) => {
|
|
476
519
|
if (t == null || t.length === 0) return null;
|
|
477
|
-
let n =
|
|
520
|
+
let n = ie(e, t, W), r = [], i = 0;
|
|
478
521
|
return n.forEach((n) => {
|
|
479
522
|
n.start > i && r.push(e.slice(i, n.start));
|
|
480
|
-
let a = t[n.skillIndex], s = H.get(a.url), c = s?.name ??
|
|
481
|
-
r.push(/* @__PURE__ */
|
|
523
|
+
let a = t[n.skillIndex], s = H.get(a.url), c = s?.name ?? me(a.url), l = s == null ? ge(a.url, o) : void 0;
|
|
524
|
+
r.push(/* @__PURE__ */ F(U, {
|
|
482
525
|
name: c,
|
|
483
526
|
path: a.url,
|
|
484
527
|
labelClassName: u,
|
|
485
528
|
description: s?.description,
|
|
486
529
|
unresolvedReason: l,
|
|
487
530
|
detailsTrigger: p,
|
|
488
|
-
onViewDetails:
|
|
531
|
+
onViewDetails: M,
|
|
489
532
|
labels: {
|
|
490
533
|
viewDetailsLabel: T?.viewDetailsLabel,
|
|
491
534
|
deletedTooltipLabel: b,
|
|
@@ -502,16 +545,16 @@ var B = {
|
|
|
502
545
|
o,
|
|
503
546
|
b,
|
|
504
547
|
x
|
|
505
|
-
]),
|
|
506
|
-
let t = H.get(e.url), n = t?.name ??
|
|
507
|
-
return /* @__PURE__ */
|
|
548
|
+
]), ce = C((e) => e == null || e.length === 0 ? null : e.map((e) => {
|
|
549
|
+
let t = H.get(e.url), n = t?.name ?? me(e.url), r = t == null ? ge(e.url, o) : void 0;
|
|
550
|
+
return /* @__PURE__ */ F(U, {
|
|
508
551
|
name: n,
|
|
509
552
|
path: e.url,
|
|
510
553
|
labelClassName: u,
|
|
511
554
|
description: t?.description,
|
|
512
555
|
unresolvedReason: r,
|
|
513
556
|
detailsTrigger: p,
|
|
514
|
-
onViewDetails:
|
|
557
|
+
onViewDetails: M,
|
|
515
558
|
labels: {
|
|
516
559
|
viewDetailsLabel: T?.viewDetailsLabel,
|
|
517
560
|
deletedTooltipLabel: b,
|
|
@@ -526,7 +569,7 @@ var B = {
|
|
|
526
569
|
o,
|
|
527
570
|
b,
|
|
528
571
|
x
|
|
529
|
-
]),
|
|
572
|
+
]), le = C((e, t) => /* @__PURE__ */ F(K, {
|
|
530
573
|
favorites: G,
|
|
531
574
|
isMenu: !0,
|
|
532
575
|
onSelect: (n) => {
|
|
@@ -535,10 +578,10 @@ var B = {
|
|
|
535
578
|
onToggleFavorite: s,
|
|
536
579
|
onBrowse: () => {
|
|
537
580
|
let n = X(t);
|
|
538
|
-
|
|
581
|
+
P(J(t)), I.current = n ?? null, e(), A(!0);
|
|
539
582
|
},
|
|
540
583
|
onViewDetails: (n) => {
|
|
541
|
-
J(t), e(),
|
|
584
|
+
J(t), e(), M(n.id);
|
|
542
585
|
},
|
|
543
586
|
labels: T
|
|
544
587
|
}), [
|
|
@@ -550,27 +593,27 @@ var B = {
|
|
|
550
593
|
T
|
|
551
594
|
]);
|
|
552
595
|
return {
|
|
553
|
-
skillMenuOverlay:
|
|
596
|
+
skillMenuOverlay: D(() => e ? {
|
|
554
597
|
key: "skills",
|
|
555
598
|
title: g,
|
|
556
|
-
icon: /* @__PURE__ */
|
|
599
|
+
icon: /* @__PURE__ */ F(ee, {
|
|
557
600
|
size: i,
|
|
558
601
|
"aria-hidden": !0,
|
|
559
602
|
stroke: l
|
|
560
603
|
}),
|
|
561
|
-
renderOverlay:
|
|
604
|
+
renderOverlay: le,
|
|
562
605
|
backLabel: _
|
|
563
606
|
} : void 0, [
|
|
564
607
|
e,
|
|
565
608
|
g,
|
|
566
609
|
_,
|
|
567
|
-
|
|
610
|
+
le
|
|
568
611
|
]),
|
|
569
|
-
commandMenu:
|
|
570
|
-
triggerPrefix:
|
|
612
|
+
commandMenu: D(() => e ? {
|
|
613
|
+
triggerPrefix: _e,
|
|
571
614
|
menuLabel: g,
|
|
572
615
|
emptyQueryHint: y,
|
|
573
|
-
renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */
|
|
616
|
+
renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ F(K, {
|
|
574
617
|
favorites: G,
|
|
575
618
|
searchQuery: e,
|
|
576
619
|
listboxId: r,
|
|
@@ -580,18 +623,18 @@ var B = {
|
|
|
580
623
|
},
|
|
581
624
|
onToggleFavorite: s,
|
|
582
625
|
onBrowse: () => {
|
|
583
|
-
let r = `${
|
|
626
|
+
let r = `${_e}${e}`, i = B.anchors.find((e) => e.start === t && e.length === r.length);
|
|
584
627
|
n({
|
|
585
628
|
consumeQuery: !0,
|
|
586
629
|
returnFocus: !1
|
|
587
|
-
}),
|
|
630
|
+
}), P(t), I.current = {
|
|
588
631
|
position: t,
|
|
589
632
|
text: r,
|
|
590
633
|
mentionUrl: i?.url
|
|
591
|
-
},
|
|
634
|
+
}, A(!0);
|
|
592
635
|
},
|
|
593
636
|
onViewDetails: (e) => {
|
|
594
|
-
n({ consumeQuery: !0 }),
|
|
637
|
+
n({ consumeQuery: !0 }), M(e.id);
|
|
595
638
|
},
|
|
596
639
|
labels: T
|
|
597
640
|
})
|
|
@@ -605,67 +648,68 @@ var B = {
|
|
|
605
648
|
s,
|
|
606
649
|
T
|
|
607
650
|
]),
|
|
608
|
-
skillCatalogModal: /* @__PURE__ */
|
|
609
|
-
isOpen:
|
|
651
|
+
skillCatalogModal: /* @__PURE__ */ F(Y, {
|
|
652
|
+
isOpen: E,
|
|
610
653
|
onClose: C(() => {
|
|
611
|
-
|
|
612
|
-
let e =
|
|
613
|
-
if (
|
|
654
|
+
A(!1);
|
|
655
|
+
let e = I.current;
|
|
656
|
+
if (I.current = null, e == null) return;
|
|
614
657
|
let { position: t, text: n, mentionUrl: r } = e;
|
|
615
|
-
r == null ? B.onDraftChange(B.draft.slice(0, t) + n + B.draft.slice(t)) : B.restoreMention(r, n.slice(1), t),
|
|
658
|
+
r == null ? B.onDraftChange(B.draft.slice(0, t) + n + B.draft.slice(t)) : B.restoreMention(r, n.slice(1), t), R((e) => e + 1), z(t + n.length);
|
|
616
659
|
}, [B]),
|
|
617
660
|
onSelect: (e) => {
|
|
618
|
-
|
|
661
|
+
I.current = null, q(e, W(e), N), A(!1);
|
|
619
662
|
},
|
|
620
663
|
title: v,
|
|
621
664
|
renderContent: m
|
|
622
665
|
}),
|
|
623
|
-
skillDetailsPanel: /* @__PURE__ */
|
|
666
|
+
skillDetailsPanel: /* @__PURE__ */ F(S, {
|
|
624
667
|
fallback: null,
|
|
625
|
-
children: /* @__PURE__ */
|
|
626
|
-
skillId:
|
|
627
|
-
onClose: () =>
|
|
668
|
+
children: /* @__PURE__ */ F(h, {
|
|
669
|
+
skillId: j,
|
|
670
|
+
onClose: () => M(null)
|
|
628
671
|
})
|
|
629
672
|
}),
|
|
630
673
|
message: B.draft,
|
|
631
|
-
messageRevision:
|
|
674
|
+
messageRevision: L,
|
|
632
675
|
activeMentions: re,
|
|
633
676
|
onDraftChange: B.onDraftChange,
|
|
634
677
|
onBackspaceAtCaret: B.onBackspaceAtCaret,
|
|
635
|
-
caretPositionOverride:
|
|
678
|
+
caretPositionOverride: te,
|
|
636
679
|
isSkillUnsupported: ne,
|
|
637
680
|
selectedSkills: B.orderedSkills,
|
|
638
681
|
resetSkillMentions: Z,
|
|
639
|
-
seedSkillMentions:
|
|
640
|
-
|
|
641
|
-
|
|
682
|
+
seedSkillMentions: oe,
|
|
683
|
+
recognizeMentionsInInsertion: $,
|
|
684
|
+
renderHistorySkillSegments: se,
|
|
685
|
+
renderHistorySkills: ce
|
|
642
686
|
};
|
|
643
|
-
},
|
|
687
|
+
}, ye = {
|
|
644
688
|
background: "_background_1ult0_1",
|
|
645
689
|
border: "_border_1ult0_5",
|
|
646
690
|
value: "_value_1ult0_9",
|
|
647
691
|
clear: "_clear_1ult0_13",
|
|
648
692
|
invalid: "_invalid_1ult0_17"
|
|
649
|
-
},
|
|
650
|
-
let [g, v] =
|
|
693
|
+
}, be = [], xe = "Selected model does not support skills. Select a different model to use a skill.", Se = ({ value: i, onChange: a, displayNames: o, skills: s = be, isSkillsSupported: l, isDisabled: u = !1, error: d, labels: p, className: m, styles: h }) => {
|
|
694
|
+
let [g, v] = k(!1), [y, x] = k(""), S = O(null), C = T(), w = i.some((e) => n(e, l)), D = l && !u, ee = g && D, A = i.length > 0 ? p.unsupportedTooltipLabel : p.unavailableTooltipLabel ?? xe, j = !l && i.length === 0, M = d ?? (j ? A : void 0), N = new Map(i.map((e) => [e, {
|
|
651
695
|
id: e,
|
|
652
696
|
name: o?.[e] || e
|
|
653
697
|
}]));
|
|
654
|
-
s.forEach((e) =>
|
|
655
|
-
let
|
|
698
|
+
s.forEach((e) => N.set(e.id, e));
|
|
699
|
+
let P = [...N.values()].map((t) => ({
|
|
656
700
|
value: t.id,
|
|
657
701
|
label: t.name,
|
|
658
|
-
labelNode: y.trim() ? /* @__PURE__ */
|
|
702
|
+
labelNode: y.trim() ? /* @__PURE__ */ F(f, {
|
|
659
703
|
text: t.name,
|
|
660
704
|
query: y,
|
|
661
705
|
maxLines: 1
|
|
662
706
|
}) : void 0,
|
|
663
|
-
icon: /* @__PURE__ */
|
|
707
|
+
icon: /* @__PURE__ */ F(e, {
|
|
664
708
|
size: c.SM,
|
|
665
709
|
initialsName: t.name
|
|
666
710
|
}),
|
|
667
711
|
disabled: !l
|
|
668
|
-
})),
|
|
712
|
+
})), L = {
|
|
669
713
|
...t({
|
|
670
714
|
"--ssf-text": h?.colors?.text,
|
|
671
715
|
"--ssf-bg": h?.colors?.background,
|
|
@@ -674,57 +718,57 @@ var B = {
|
|
|
674
718
|
}),
|
|
675
719
|
...h?.cssVars
|
|
676
720
|
};
|
|
677
|
-
return
|
|
721
|
+
return E(() => {
|
|
678
722
|
let e = S.current?.querySelector("[role=\"combobox\"]");
|
|
679
|
-
e && (
|
|
723
|
+
e && (M ? e.setAttribute("aria-describedby", C) : e.removeAttribute("aria-describedby"), d || w ? e.setAttribute("aria-invalid", "true") : e.removeAttribute("aria-invalid"));
|
|
680
724
|
}, [
|
|
681
|
-
|
|
725
|
+
M,
|
|
682
726
|
C,
|
|
683
727
|
d,
|
|
684
728
|
u,
|
|
685
729
|
w
|
|
686
|
-
]), /* @__PURE__ */
|
|
730
|
+
]), /* @__PURE__ */ I("div", {
|
|
687
731
|
ref: S,
|
|
688
732
|
className: r("min-w-0", m, B.selectorField),
|
|
689
|
-
style:
|
|
690
|
-
children: [/* @__PURE__ */
|
|
691
|
-
tooltip:
|
|
733
|
+
style: L,
|
|
734
|
+
children: [/* @__PURE__ */ F(b, {
|
|
735
|
+
tooltip: A,
|
|
692
736
|
hideTooltip: l,
|
|
693
737
|
triggerClassName: "block w-full min-w-0",
|
|
694
|
-
children: /* @__PURE__ */
|
|
738
|
+
children: /* @__PURE__ */ F("div", {
|
|
695
739
|
inert: u ? !0 : void 0,
|
|
696
|
-
children: /* @__PURE__ */
|
|
740
|
+
children: /* @__PURE__ */ F(_, {
|
|
697
741
|
multiple: !0,
|
|
698
742
|
searchable: !0,
|
|
699
|
-
open:
|
|
743
|
+
open: ee,
|
|
700
744
|
onOpenChange: (e) => {
|
|
701
|
-
e && !
|
|
745
|
+
e && !D || v(e);
|
|
702
746
|
},
|
|
703
747
|
onSearchQueryChange: x,
|
|
704
748
|
value: i,
|
|
705
749
|
onChange: (e) => {
|
|
706
750
|
u || a(Array.isArray(e) ? e : [e]);
|
|
707
751
|
},
|
|
708
|
-
options:
|
|
752
|
+
options: P,
|
|
709
753
|
placeholder: p.placeholder,
|
|
710
754
|
labelProps: { label: p.fieldLabel },
|
|
711
755
|
error: d,
|
|
712
|
-
caption:
|
|
756
|
+
caption: j ? A : void 0,
|
|
713
757
|
searchPlaceholder: p.searchPlaceholder ?? "Search skills",
|
|
714
758
|
emptyStateTitle: y.trim() ? p.noMatchingSkillsLabel ?? "No matching skills" : p.emptyLabel ?? "No skills available",
|
|
715
|
-
disabled: u ||
|
|
759
|
+
disabled: u || j,
|
|
716
760
|
invalid: !!d || w,
|
|
717
761
|
className: "w-full min-w-0",
|
|
718
|
-
fieldClassName: r(
|
|
762
|
+
fieldClassName: r(D ? "cursor-pointer" : "cursor-not-allowed", "--ssf-bg" in L && ye.background, "--ssf-border" in L && ye.border, "--ssf-text" in L && ye.value, (d || w) && ye.invalid, h?.typography?.fontClassName ?? "dial-small-text", h?.triggerClassName),
|
|
719
763
|
listClassName: "w-[min(var(--reference-width),calc(100vw-2rem))] max-w-full"
|
|
720
764
|
})
|
|
721
765
|
})
|
|
722
|
-
}),
|
|
766
|
+
}), M && /* @__PURE__ */ F("span", {
|
|
723
767
|
id: C,
|
|
724
768
|
className: "sr-only",
|
|
725
|
-
children:
|
|
769
|
+
children: M
|
|
726
770
|
})]
|
|
727
771
|
});
|
|
728
772
|
};
|
|
729
773
|
//#endregion
|
|
730
|
-
export { U as ChatSkill, K as FavoriteSkillsPanel, B as SKILLS_CLASS, J as SkillArchiveUploadDialog, Y as SkillCatalogModal, Z as SkillContentFileTree, Q as SkillDetailsSidePanel, H as SkillInfoTooltipContent,
|
|
774
|
+
export { U as ChatSkill, K as FavoriteSkillsPanel, B as SKILLS_CLASS, J as SkillArchiveUploadDialog, Y as SkillCatalogModal, Z as SkillContentFileTree, Q as SkillDetailsSidePanel, H as SkillInfoTooltipContent, Se as SkillSelectorField, V as SkillUnresolvedReason, pe as buildFavoriteSkillItem, oe as diffTextChange, le as findMentionAtCaret, me as getSkillFallbackName, ce as insertAnchor, ie as matchSkillMentions, se as reconcileAnchors, fe as useSkillMentions, ve as useSkillSelectorOverlay };
|
|
@@ -224,6 +224,14 @@ export interface UseSkillSelectorOverlayResult {
|
|
|
224
224
|
* `custom_content.skills`.
|
|
225
225
|
*/
|
|
226
226
|
seedSkillMentions: (content: string, skills: RequestSkill[] | undefined) => void;
|
|
227
|
+
/**
|
|
228
|
+
* Marks `text` as about to be inserted into the composer (e.g. a picked
|
|
229
|
+
* prompt): once the insertion reaches `onDraftChange`, every `/{name}` run
|
|
230
|
+
* in it that names a listed skill becomes a tracked mention. Call right
|
|
231
|
+
* before handing `text` to the composer's insertion channel. A no-op on a
|
|
232
|
+
* deployment without skills support; an ordinary paste stays plain text.
|
|
233
|
+
*/
|
|
234
|
+
recognizeMentionsInInsertion: (text: string) => void;
|
|
227
235
|
/**
|
|
228
236
|
* Renders a user message's `content` and `custom_content.skills` as an
|
|
229
237
|
* ordered array interleaving plain-text runs and `ChatSkill` elements at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-selector-overlay.d.ts","sourceRoot":"","sources":["../../src/models/skill-selector-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,WAAW,+BA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;OAGG;IACH,iBAAiB,EAAE,SAAS,CAAC;IAC7B;;OAEG;IACH,iBAAiB,EAAE,SAAS,CAAC;IAC7B;;;;;;;;OAQG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,cAAc,EAAE,oBAAoB,EAAE,CAAC;IACvC;;;;;;OAMG;IACH,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;;;;OAOG;IACH,kBAAkB,EAAE,CAClB,aAAa,EAAE,MAAM,KAClB,oBAAoB,GAAG,SAAS,CAAC;IACtC;;;;;;OAMG;IACH,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C;;;;OAIG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,cAAc,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;IAC3C;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B;;;;;;OAMG;IACH,iBAAiB,EAAE,CACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,KAC/B,IAAI,CAAC;IACV;;;;;;OAMG;IACH,4BAA4B,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD;;;;;;;;;;;;;;OAcG;IACH,0BAA0B,EAAE,CAC1B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,KAC/B,SAAS,EAAE,GAAG,IAAI,CAAC;IACxB;;;;;;;OAOG;IACH,mBAAmB,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,KAAK,SAAS,CAAC;CACxE"}
|
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.
|
|
4
|
+
"version": "1.3.0-dev.5",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-catalog": "1.
|
|
22
|
-
"@epam/ai-dial-conversation-input": "1.
|
|
21
|
+
"@epam/ai-dial-catalog": "1.3.0-dev.5",
|
|
22
|
+
"@epam/ai-dial-conversation-input": "1.3.0-dev.5"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.5",
|
|
26
26
|
"@epam/ai-dial-react-file-manager": "^0.3.0",
|
|
27
27
|
"@epam/ai-dial-ui-kit": "^0.15.0",
|
|
28
28
|
"react": "^19.2.8"
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { RequestSkill } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { SkillListingEntry } from '../models/favorite-skill-item';
|
|
3
|
+
import { SkillMentionAnchor } from '../models/skill-mention-anchor';
|
|
2
4
|
/** One resolved mention location, or omitted for a skill whose text mention could not be found. */
|
|
3
5
|
export interface ResolvedSkillMention {
|
|
4
6
|
/** Index into the input `skills` array this location resolves. */
|
|
@@ -22,4 +24,11 @@ export interface ResolvedSkillMention {
|
|
|
22
24
|
* independent forward search from the same unmoved cursor.
|
|
23
25
|
*/
|
|
24
26
|
export declare const matchSkillMentions: (text: string, skills: RequestSkill[], resolveName: (url: string) => string) => ResolvedSkillMention[];
|
|
27
|
+
/**
|
|
28
|
+
* Returns every `/{name}` run in `text` that names one of `skills`, as mention
|
|
29
|
+
* anchors with offsets into `text`. A run must start the text or follow
|
|
30
|
+
* whitespace and end at a word boundary; the longest matching name wins, and
|
|
31
|
+
* a name shared by several skills resolves to the first of them in `skills`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const findSkillMentionsInText: (text: string, skills: Pick<SkillListingEntry, "url" | "name">[]) => SkillMentionAnchor[];
|
|
25
34
|
//# sourceMappingURL=skill-mention-matching.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-mention-matching.d.ts","sourceRoot":"","sources":["../../src/utils/skill-mention-matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"skill-mention-matching.d.ts","sourceRoot":"","sources":["../../src/utils/skill-mention-matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,mGAAmG;AACnG,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,MAAM,EACZ,QAAQ,YAAY,EAAE,EACtB,aAAa,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACnC,oBAAoB,EA0BtB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,MAAM,EACZ,QAAQ,IAAI,CAAC,iBAAiB,EAAE,KAAK,GAAG,MAAM,CAAC,EAAE,KAChD,kBAAkB,EAiCpB,CAAC"}
|
|
@@ -48,4 +48,9 @@ export declare const findSlashQueryAtCaret: (text: string, caretPosition: number
|
|
|
48
48
|
start: number;
|
|
49
49
|
end: number;
|
|
50
50
|
} | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the offset in `next` at which `text` landed when `change` is the
|
|
53
|
+
* edit that inserted it, or `undefined` when `change` cannot have inserted it.
|
|
54
|
+
*/
|
|
55
|
+
export declare const findInsertedTextOffset: (next: string, change: TextChange, text: string) => number | undefined;
|
|
51
56
|
//# sourceMappingURL=skill-mention-tracking.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-mention-tracking.d.ts","sourceRoot":"","sources":["../../src/utils/skill-mention-tracking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,yFAAyF;AACzF,MAAM,WAAW,UAAU;IACzB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,EAAE,MAAM,MAAM,KAAG,UAyB/D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,kBAAkB,EAAE,EAC7B,QAAQ,UAAU,KACjB,kBAAkB,EAmBpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,SAAS,kBAAkB,EAAE,EAC7B,SAAS,MAAM,EACf,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,kBAAkB,OAAO,KACxB,kBAAkB,EAkBpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,kBAAkB,EAAE,EAC7B,eAAe,MAAM,KACpB,kBAAkB,GAAG,SACkD,CAAC;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,QAAQ,MAAM,KACb;IAAE,KAAK,EAAE,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