@epam/ai-dial-skills 1.2.0-dev.141 → 1.2.0-dev.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ChatSkill/ChatSkill.d.ts +3 -2
- package/components/ChatSkill/ChatSkill.d.ts.map +1 -1
- package/hooks/useSkillMentions/useSkillMentions.d.ts +50 -0
- package/hooks/useSkillMentions/useSkillMentions.d.ts.map +1 -0
- package/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.d.ts +4 -3
- package/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +8 -0
- package/index.d.ts.map +1 -1
- package/index.js +406 -281
- package/models/skill-mention-anchor.d.ts +12 -0
- package/models/skill-mention-anchor.d.ts.map +1 -0
- package/models/skill-selector-overlay.d.ts +100 -54
- package/models/skill-selector-overlay.d.ts.map +1 -1
- package/package.json +4 -4
- package/utils/skill-mention-matching.d.ts +25 -0
- package/utils/skill-mention-matching.d.ts.map +1 -0
- package/utils/skill-mention-tracking.d.ts +39 -0
- package/utils/skill-mention-tracking.d.ts.map +1 -0
package/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
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, Dropdown as u, FileDropzone as d, GhostButton as f, Highlight as p, Input as m, InteractiveTooltip as h, Popup as g, PopupSize as _, Search as v, ToggleIconButton as
|
|
3
|
-
import { Suspense as
|
|
4
|
-
import { IconBlocks as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { DetailsPanel 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, Dropdown as u, FileDropzone as d, GhostButton as f, Highlight as p, Input as m, InteractiveTooltip as h, Popup as g, PopupSize as _, Search as v, ToggleIconButton as ee, TooltipPlacement as y } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Suspense as b, useCallback as x, useEffect as te, useId as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
|
|
4
|
+
import { IconBlocks as D, IconChevronDown as ne, IconEye as O, IconStarFilled as k, IconX as A } from "@tabler/icons-react";
|
|
5
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
6
|
+
import { DetailsPanel as P } from "@epam/ai-dial-catalog";
|
|
7
7
|
//#region src/constants/public-class-names.ts
|
|
8
|
-
var
|
|
8
|
+
var F = {
|
|
9
9
|
selectorField: "dial-skills-selector-field",
|
|
10
10
|
favoritesPanel: "dial-skills-favorites-panel",
|
|
11
11
|
chip: "dial-skills-chip"
|
|
12
|
-
},
|
|
12
|
+
}, I = ({ description: e, unsupportedMessage: t, viewDetailsLabel: n = "View details", onViewDetails: r, viewDetailsTabIndex: i }) => t == null ? /* @__PURE__ */ N("div", {
|
|
13
13
|
className: "flex flex-col gap-3",
|
|
14
|
-
children: [e != null && e !== "" && /* @__PURE__ */
|
|
14
|
+
children: [e != null && e !== "" && /* @__PURE__ */ M("p", {
|
|
15
15
|
className: "text-start",
|
|
16
16
|
children: e
|
|
17
|
-
}), /* @__PURE__ */
|
|
17
|
+
}), /* @__PURE__ */ M(a, {
|
|
18
18
|
variant: s.Primary,
|
|
19
19
|
appearance: o.Link,
|
|
20
20
|
className: "h-[24px] self-start",
|
|
21
21
|
label: n,
|
|
22
|
-
iconBefore: /* @__PURE__ */
|
|
22
|
+
iconBefore: /* @__PURE__ */ M(O, {
|
|
23
23
|
size: c.SM,
|
|
24
24
|
stroke: l,
|
|
25
25
|
"aria-hidden": !0
|
|
@@ -27,32 +27,42 @@ var L = {
|
|
|
27
27
|
onClick: r,
|
|
28
28
|
tabIndex: i
|
|
29
29
|
})]
|
|
30
|
-
}) : /* @__PURE__ */
|
|
30
|
+
}) : /* @__PURE__ */ M("p", {
|
|
31
31
|
className: "text-start",
|
|
32
32
|
children: t
|
|
33
|
-
}),
|
|
34
|
-
let { viewDetailsLabel: u = "View details", unsupportedTooltipLabel: d = "Selected model does not support skills. Remove the skill or select different model to proceed." } = l, [
|
|
35
|
-
|
|
33
|
+
}), L = ({ name: e, path: t, description: n, isUnsupported: i = !1, labelClassName: a = "dial-body-paragraph-text text-accent", unsupportedLabelClassName: o = "text-error", unsupportedClassName: s = "bg-error", onViewDetails: c, labels: l = {} }) => {
|
|
34
|
+
let { viewDetailsLabel: u = "View details", unsupportedTooltipLabel: d = "Selected model does not support skills. Remove the skill or select different model to proceed." } = l, [f, p] = E(0), m = () => {
|
|
35
|
+
p((e) => e + 1), c(t);
|
|
36
|
+
}, g = T(null), [_, v] = E(null);
|
|
37
|
+
return C(() => {
|
|
38
|
+
v(g.current?.getBoundingClientRect().width ?? null);
|
|
39
|
+
}, [a]), /* @__PURE__ */ M(h, {
|
|
36
40
|
asChild: !0,
|
|
37
|
-
placement:
|
|
41
|
+
placement: y.Top,
|
|
38
42
|
contentClassName: "max-w-[550px]",
|
|
39
|
-
content: i ? /* @__PURE__ */
|
|
43
|
+
content: i ? /* @__PURE__ */ M(I, { unsupportedMessage: d }) : /* @__PURE__ */ M(I, {
|
|
40
44
|
description: n,
|
|
41
45
|
viewDetailsLabel: u,
|
|
42
|
-
onViewDetails:
|
|
43
|
-
m((e) => e + 1), c(t);
|
|
44
|
-
}
|
|
46
|
+
onViewDetails: m
|
|
45
47
|
}),
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
children: /* @__PURE__ */ N("span", {
|
|
49
|
+
tabIndex: 0,
|
|
50
|
+
className: r("relative -me-1 -ms-1 inline-block cursor-pointer select-text rounded-full pe-1 ps-1", i ? s : "hover:bg-info focus-visible:bg-info active:bg-info", i ? r(a, o) : a, F.chip),
|
|
51
|
+
"aria-label": `/${e}`,
|
|
52
|
+
children: [/* @__PURE__ */ M("span", {
|
|
53
|
+
ref: g,
|
|
54
|
+
"aria-hidden": !0,
|
|
55
|
+
className: "inset-inline-start-0 pointer-events-none absolute top-0 select-none",
|
|
56
|
+
children: "/"
|
|
57
|
+
}), /* @__PURE__ */ M("span", {
|
|
58
|
+
"aria-hidden": !0,
|
|
59
|
+
className: "select-none",
|
|
60
|
+
style: { paddingInlineStart: _ ?? void 0 },
|
|
61
|
+
children: e
|
|
62
|
+
})]
|
|
53
63
|
})
|
|
54
|
-
},
|
|
55
|
-
},
|
|
64
|
+
}, f);
|
|
65
|
+
}, R = {
|
|
56
66
|
row: "_row_1v431_1",
|
|
57
67
|
header: "_header_1v431_8",
|
|
58
68
|
emptyHint: "_emptyHint_1v431_12",
|
|
@@ -63,105 +73,105 @@ var L = {
|
|
|
63
73
|
rowLeaving: "_rowLeaving_1v431_32",
|
|
64
74
|
rowFadeOut: "_rowFadeOut_1v431_1",
|
|
65
75
|
listContent: "_listContent_1v431_60"
|
|
66
|
-
},
|
|
67
|
-
let { myCollectionLabel:
|
|
68
|
-
"--fs-row-hover-bg":
|
|
69
|
-
"--fs-header-text":
|
|
70
|
-
"--fs-empty-hint-text":
|
|
71
|
-
"--fs-star-color":
|
|
72
|
-
"--fs-footer-border":
|
|
73
|
-
}), [
|
|
74
|
-
|
|
75
|
-
let e =
|
|
76
|
+
}, z = "px-3 pb-0.5 pt-2", B = 180, V = 288, H = ({ favorites: n, onSelect: i, onToggleFavorite: a, onBrowse: o, onViewDetails: s, className: l, rowClassName: u, searchQuery: d, listboxId: m, activeOptionId: g, isMenu: _ = !1, labels: v = {}, colors: y, nameClassName: b = "dial-small-text", headerClassName: x = "dial-tiny-lead-semi-text", emptyHintClassName: w = "dial-small-text" }) => {
|
|
77
|
+
let { myCollectionLabel: D = "My Collection", emptyHintLabel: ne = "Star a skill to pin it here", browseLabel: O = "Browse", removeFromFavoritesLabel: A = "Remove from favorites", viewDetailsLabel: j = "View details", noMatchingSkillsLabel: P = "No matching skills" } = v, L = t({
|
|
78
|
+
"--fs-row-hover-bg": y?.rowHoverBackground,
|
|
79
|
+
"--fs-header-text": y?.headerText,
|
|
80
|
+
"--fs-empty-hint-text": y?.emptyHintText,
|
|
81
|
+
"--fs-star-color": y?.starColor,
|
|
82
|
+
"--fs-footer-border": y?.footerBorder
|
|
83
|
+
}), [H, U] = E(/* @__PURE__ */ new Set()), W = T(/* @__PURE__ */ new Map());
|
|
84
|
+
te(() => {
|
|
85
|
+
let e = W.current;
|
|
76
86
|
return () => {
|
|
77
87
|
e.forEach((e) => clearTimeout(e)), e.clear();
|
|
78
88
|
};
|
|
79
89
|
}, []);
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
let
|
|
83
|
-
|
|
84
|
-
|
|
90
|
+
let G = m != null, K = _ && !G, q = G || K ? "none" : void 0, J = "button";
|
|
91
|
+
G ? J = "option" : K && (J = "menuitem");
|
|
92
|
+
let Y = S(), X = d != null, Z = d?.toLowerCase() ?? "", Q = X ? n.filter((e) => e.name.toLowerCase().includes(Z)) : n, re = T(null), [ie, ae] = E();
|
|
93
|
+
C(() => {
|
|
94
|
+
re.current && ae(Math.min(re.current.scrollHeight, V));
|
|
85
95
|
}, [n, d]);
|
|
86
|
-
let
|
|
96
|
+
let oe = (e, t) => {
|
|
87
97
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i(t));
|
|
88
|
-
},
|
|
89
|
-
|
|
98
|
+
}, $ = (e) => {
|
|
99
|
+
U((t) => new Set(t).add(e));
|
|
90
100
|
let t = setTimeout(() => {
|
|
91
|
-
a?.(e),
|
|
101
|
+
a?.(e), U((t) => {
|
|
92
102
|
let n = new Set(t);
|
|
93
103
|
return n.delete(e), n;
|
|
94
|
-
}),
|
|
95
|
-
},
|
|
96
|
-
|
|
104
|
+
}), W.current.delete(e);
|
|
105
|
+
}, B);
|
|
106
|
+
W.current.set(e, t);
|
|
97
107
|
};
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
className: r("flex w-full flex-col desktop:w-[280px]", l,
|
|
100
|
-
style:
|
|
108
|
+
return /* @__PURE__ */ N("div", {
|
|
109
|
+
className: r("flex w-full flex-col desktop:w-[280px]", l, F.favoritesPanel),
|
|
110
|
+
style: L,
|
|
101
111
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
id:
|
|
104
|
-
className: r(
|
|
105
|
-
children:
|
|
112
|
+
/* @__PURE__ */ M("p", {
|
|
113
|
+
id: Y,
|
|
114
|
+
className: r(x, z, R.header),
|
|
115
|
+
children: D
|
|
106
116
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
className: r("max-h-72 min-h-0 flex-1 overflow-y-auto",
|
|
109
|
-
style: { maxHeight:
|
|
110
|
-
children: /* @__PURE__ */
|
|
111
|
-
ref:
|
|
112
|
-
children: Q.length > 0 ? /* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ M("div", {
|
|
118
|
+
className: r("max-h-72 min-h-0 flex-1 overflow-y-auto", R.listContent),
|
|
119
|
+
style: { maxHeight: ie },
|
|
120
|
+
children: /* @__PURE__ */ M("div", {
|
|
121
|
+
ref: re,
|
|
122
|
+
children: Q.length > 0 ? /* @__PURE__ */ M("ul", {
|
|
113
123
|
id: m,
|
|
114
|
-
role:
|
|
115
|
-
"aria-labelledby":
|
|
124
|
+
role: G ? "listbox" : q,
|
|
125
|
+
"aria-labelledby": G ? Y : void 0,
|
|
116
126
|
className: "flex flex-col gap-1 px-1 pb-1",
|
|
117
127
|
children: Q.map((t) => {
|
|
118
|
-
let n =
|
|
119
|
-
role:
|
|
128
|
+
let n = G ? `${m}-${encodeURIComponent(t.id)}` : void 0, o = G ? -1 : void 0, l = /* @__PURE__ */ N("div", {
|
|
129
|
+
role: J,
|
|
120
130
|
id: n,
|
|
121
|
-
"aria-selected":
|
|
131
|
+
"aria-selected": G ? n === g : void 0,
|
|
122
132
|
"aria-label": t.name,
|
|
123
133
|
tabIndex: 0,
|
|
124
|
-
className: r("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors",
|
|
134
|
+
className: r("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors", R.row, u),
|
|
125
135
|
onClick: () => i(t),
|
|
126
|
-
onKeyDown: (e) =>
|
|
136
|
+
onKeyDown: (e) => oe(e, t),
|
|
127
137
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ M(e, {
|
|
129
139
|
size: c.MD,
|
|
130
140
|
initialsName: t.name
|
|
131
141
|
}),
|
|
132
|
-
d == null ? /* @__PURE__ */
|
|
133
|
-
className: r(
|
|
142
|
+
d == null ? /* @__PURE__ */ M("span", {
|
|
143
|
+
className: r(b, "min-w-0 flex-1 truncate text-start"),
|
|
134
144
|
children: t.name
|
|
135
|
-
}) : /* @__PURE__ */
|
|
145
|
+
}) : /* @__PURE__ */ M(p, {
|
|
136
146
|
text: t.name,
|
|
137
147
|
query: d,
|
|
138
148
|
maxLines: 1,
|
|
139
|
-
className: r(
|
|
149
|
+
className: r(b, "min-w-0 flex-1 text-start")
|
|
140
150
|
}),
|
|
141
|
-
a && /* @__PURE__ */
|
|
142
|
-
icon: /* @__PURE__ */
|
|
151
|
+
a && /* @__PURE__ */ M(ee, {
|
|
152
|
+
icon: /* @__PURE__ */ M(k, {
|
|
143
153
|
size: c.SM,
|
|
144
|
-
className:
|
|
154
|
+
className: R.star,
|
|
145
155
|
"aria-hidden": !0
|
|
146
156
|
}),
|
|
147
|
-
"aria-label":
|
|
157
|
+
"aria-label": A,
|
|
148
158
|
isSelected: !0,
|
|
149
159
|
tabIndex: o,
|
|
150
160
|
onClick: (e) => {
|
|
151
|
-
e.stopPropagation(),
|
|
161
|
+
e.stopPropagation(), $(t.id);
|
|
152
162
|
}
|
|
153
163
|
})
|
|
154
164
|
]
|
|
155
165
|
});
|
|
156
|
-
return /* @__PURE__ */
|
|
157
|
-
role:
|
|
158
|
-
className:
|
|
159
|
-
children: s ? /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ M("li", {
|
|
167
|
+
role: q,
|
|
168
|
+
className: H.has(t.id) ? R.rowLeaving : R.rowEnter,
|
|
169
|
+
children: s ? /* @__PURE__ */ M(h, {
|
|
160
170
|
asChild: !0,
|
|
161
171
|
contentClassName: "max-w-[550px]",
|
|
162
|
-
content: /* @__PURE__ */
|
|
172
|
+
content: /* @__PURE__ */ M(I, {
|
|
163
173
|
description: t.description,
|
|
164
|
-
viewDetailsLabel:
|
|
174
|
+
viewDetailsLabel: j,
|
|
165
175
|
onViewDetails: () => s(t),
|
|
166
176
|
viewDetailsTabIndex: o
|
|
167
177
|
}),
|
|
@@ -169,43 +179,43 @@ var L = {
|
|
|
169
179
|
}) : l
|
|
170
180
|
}, t.id);
|
|
171
181
|
})
|
|
172
|
-
}) :
|
|
182
|
+
}) : X && Z !== "" ? /* @__PURE__ */ M("p", {
|
|
173
183
|
role: "status",
|
|
174
184
|
"aria-live": "polite",
|
|
175
|
-
className: r(
|
|
176
|
-
children:
|
|
177
|
-
}) : /* @__PURE__ */
|
|
178
|
-
className: r(
|
|
179
|
-
children:
|
|
185
|
+
className: r(w, "px-4 py-4 text-start", R.emptyHint),
|
|
186
|
+
children: P
|
|
187
|
+
}) : /* @__PURE__ */ M("p", {
|
|
188
|
+
className: r(w, "px-4 py-4 text-start", R.emptyHint),
|
|
189
|
+
children: ne
|
|
180
190
|
})
|
|
181
191
|
})
|
|
182
192
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
className: r("border-t px-2 py-3",
|
|
185
|
-
children: /* @__PURE__ */
|
|
186
|
-
role:
|
|
187
|
-
label:
|
|
193
|
+
/* @__PURE__ */ M("div", {
|
|
194
|
+
className: r("border-t px-2 py-3", R.footer),
|
|
195
|
+
children: /* @__PURE__ */ M(f, {
|
|
196
|
+
role: K ? "menuitem" : void 0,
|
|
197
|
+
label: O,
|
|
188
198
|
className: "w-full justify-center",
|
|
189
199
|
onClick: o
|
|
190
200
|
})
|
|
191
201
|
})
|
|
192
202
|
]
|
|
193
203
|
});
|
|
194
|
-
},
|
|
204
|
+
}, U = ".zip,.md", W = ({ isOpen: e, errorText: t, accept: n = U, labels: r, onClose: i, onFilesSelected: a, onFilesRejected: o }) => {
|
|
195
205
|
let { dialogTitle: s = "Upload skill", dropZoneLabel: c = "Drag and drop it or click here to upload", dropZoneMobileLabel: l = "Click here to upload", formatsLabel: u = "File formats .zip and SKILL.md", fileInputAriaLabel: f = "Upload a skill ZIP archive or a SKILL.md file", closeAriaLabel: p = "Close" } = r ?? {};
|
|
196
|
-
return /* @__PURE__ */
|
|
206
|
+
return /* @__PURE__ */ M(g, {
|
|
197
207
|
open: e,
|
|
198
208
|
size: _.Sm,
|
|
199
209
|
header: s,
|
|
200
210
|
closeAriaLabel: p,
|
|
201
211
|
onClose: i,
|
|
202
|
-
children: /* @__PURE__ */
|
|
212
|
+
children: /* @__PURE__ */ M("div", {
|
|
203
213
|
className: "px-6 py-4",
|
|
204
|
-
children: /* @__PURE__ */
|
|
205
|
-
label: /* @__PURE__ */
|
|
214
|
+
children: /* @__PURE__ */ M(d, {
|
|
215
|
+
label: /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("span", {
|
|
206
216
|
className: "desktop:hidden",
|
|
207
217
|
children: l
|
|
208
|
-
}), /* @__PURE__ */
|
|
218
|
+
}), /* @__PURE__ */ M("span", {
|
|
209
219
|
className: "hidden desktop:inline",
|
|
210
220
|
children: c
|
|
211
221
|
})] }),
|
|
@@ -218,307 +228,422 @@ var L = {
|
|
|
218
228
|
})
|
|
219
229
|
})
|
|
220
230
|
});
|
|
221
|
-
},
|
|
231
|
+
}, G = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ M(g, {
|
|
222
232
|
open: e,
|
|
223
233
|
header: r,
|
|
224
234
|
size: _.Lg,
|
|
225
235
|
className: "h-[min(90vh,860px)] !max-w-[min(95vw,1200px)] overflow-hidden",
|
|
226
236
|
onClose: t,
|
|
227
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ M("div", {
|
|
228
238
|
className: "h-[min(80vh,840px)] overflow-auto",
|
|
229
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ M(b, {
|
|
230
240
|
fallback: null,
|
|
231
241
|
children: e && i(n, t)
|
|
232
242
|
})
|
|
233
243
|
})
|
|
234
|
-
}),
|
|
244
|
+
}), K = (e) => /* @__PURE__ */ M(P, { ...e }), q = (e) => e == null || /[\s/]/.test(e), J = (e, t, n) => {
|
|
245
|
+
let r = [], i = 0;
|
|
246
|
+
return t.forEach((t, a) => {
|
|
247
|
+
let o = `/${n(t.url)}`, s = i;
|
|
248
|
+
for (; s <= e.length;) {
|
|
249
|
+
let t = e.indexOf(o, s);
|
|
250
|
+
if (t === -1) return;
|
|
251
|
+
let n = t + o.length;
|
|
252
|
+
if (q(e[n])) {
|
|
253
|
+
r.push({
|
|
254
|
+
skillIndex: a,
|
|
255
|
+
start: t,
|
|
256
|
+
length: o.length
|
|
257
|
+
}), i = n;
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
s = t + 1;
|
|
261
|
+
}
|
|
262
|
+
}), r;
|
|
263
|
+
}, Y = (e, t) => {
|
|
264
|
+
let n = Math.min(e.length, t.length), r = 0;
|
|
265
|
+
for (; r < n && e[r] === t[r];) r += 1;
|
|
266
|
+
let i = n - r, a = 0;
|
|
267
|
+
for (; a < i && e[e.length - 1 - a] === t[t.length - 1 - a];) a += 1;
|
|
268
|
+
return {
|
|
269
|
+
start: r,
|
|
270
|
+
deletedLength: e.length - r - a,
|
|
271
|
+
insertedLength: t.length - r - a
|
|
272
|
+
};
|
|
273
|
+
}, X = (e, t) => {
|
|
274
|
+
let n = t.start + t.deletedLength, r = t.insertedLength - t.deletedLength;
|
|
275
|
+
return e.reduce((e, i) => i.start + i.length <= t.start ? (e.push(i), e) : (i.start >= n && e.push({
|
|
276
|
+
...i,
|
|
277
|
+
start: i.start + r
|
|
278
|
+
}), e), []);
|
|
279
|
+
}, Z = (e, t, n, r, i) => {
|
|
280
|
+
let a = r.length + 1, o = a + +!!i, s = e.map((e) => e.start >= t ? {
|
|
281
|
+
...e,
|
|
282
|
+
start: e.start + o
|
|
283
|
+
} : e), c = {
|
|
284
|
+
url: n,
|
|
285
|
+
name: r,
|
|
286
|
+
start: t,
|
|
287
|
+
length: a
|
|
288
|
+
};
|
|
289
|
+
return [...s, c].sort((e, t) => e.start - t.start);
|
|
290
|
+
}, Q = (e, t) => e.find((e) => e.start + e.length === t), re = () => {
|
|
291
|
+
let [e, t] = E(""), [n, r] = E([]), i = T(e);
|
|
292
|
+
i.current = e;
|
|
293
|
+
let a = T(n);
|
|
294
|
+
return a.current = n, {
|
|
295
|
+
draft: e,
|
|
296
|
+
anchors: n,
|
|
297
|
+
onDraftChange: x((e) => {
|
|
298
|
+
let n = Y(i.current, e);
|
|
299
|
+
r((e) => X(e, n)), i.current = e, t(e);
|
|
300
|
+
}, []),
|
|
301
|
+
insertMention: x((e, n, a) => {
|
|
302
|
+
let o = i.current, s = !/^\s/.test(o.slice(a)), c = `/${n}${s ? " " : ""}`, l = o.slice(0, a) + c + o.slice(a);
|
|
303
|
+
return i.current = l, t(l), r((t) => Z(t, a, e, n, s)), s;
|
|
304
|
+
}, []),
|
|
305
|
+
onBackspaceAtCaret: x((e) => Q(a.current, e), []),
|
|
306
|
+
orderedSkills: w(() => {
|
|
307
|
+
if (n.length !== 0) return n.map((e) => ({ url: e.url }));
|
|
308
|
+
}, [n]),
|
|
309
|
+
reset: x(() => {
|
|
310
|
+
t(""), r([]);
|
|
311
|
+
}, []),
|
|
312
|
+
seedFromMessage: x((e, n, i) => {
|
|
313
|
+
let a = n ?? [], o = J(e, a, i);
|
|
314
|
+
t(e), r(o.map((e) => {
|
|
315
|
+
let t = a[e.skillIndex];
|
|
316
|
+
return {
|
|
317
|
+
url: t.url,
|
|
318
|
+
name: i(t.url),
|
|
319
|
+
start: e.start,
|
|
320
|
+
length: e.length
|
|
321
|
+
};
|
|
322
|
+
}));
|
|
323
|
+
}, [])
|
|
324
|
+
};
|
|
325
|
+
}, ie = (e) => ({
|
|
235
326
|
id: e.url,
|
|
236
327
|
name: e.name,
|
|
237
328
|
description: e.description
|
|
238
|
-
}),
|
|
329
|
+
}), ae = (e) => {
|
|
239
330
|
let t = e.split("/").filter((e) => e.length > 0);
|
|
240
331
|
return t[t.length - 1] ?? e;
|
|
241
|
-
},
|
|
242
|
-
let { addMenuLabel:
|
|
243
|
-
...
|
|
244
|
-
...
|
|
245
|
-
...
|
|
332
|
+
}, oe = ({ isEnabled: e, isSkillsSupported: t, skills: n, sharedWithMe: r, publicSkills: a, favoriteIds: o, onToggleFavorite: s, labels: c, historyChipLabelClassName: u, renderCatalogContent: d, detailsPanelComponent: f }) => {
|
|
333
|
+
let { addMenuLabel: p = "Skills", backLabel: m = "Back", catalogModalTitleLabel: h = "Use skill", emptyQueryHintLabel: g = "Type to filter", panelLabels: _ } = c ?? {}, v = e && t, [ee, y] = E(!1), [te, S] = E(null), [C, T] = E(0), [ne, O] = E(0), [k, A] = E(void 0), j = re(), N = w(() => [
|
|
334
|
+
...n,
|
|
335
|
+
...r ?? [],
|
|
336
|
+
...a ?? []
|
|
246
337
|
], [
|
|
338
|
+
n,
|
|
247
339
|
r,
|
|
248
|
-
a
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
340
|
+
a
|
|
341
|
+
]), P = w(() => new Map(N.map((e) => [e.url, e])), [N]), F = x((e) => P.get(e)?.name ?? ae(e), [P]), I = w(() => N.filter((e) => o.has(e.url)).map((e) => ie(e)), [N, o]), R = j.anchors.length > 0 && !t, z = w(() => j.anchors.map((e) => ({
|
|
342
|
+
start: e.start,
|
|
343
|
+
length: e.length,
|
|
344
|
+
isUnsupported: !t,
|
|
345
|
+
render: () => /* @__PURE__ */ M(L, {
|
|
346
|
+
name: e.name,
|
|
347
|
+
path: e.url,
|
|
348
|
+
labelClassName: u,
|
|
349
|
+
description: P.get(e.url)?.description,
|
|
350
|
+
isUnsupported: !t,
|
|
351
|
+
onViewDetails: S,
|
|
352
|
+
labels: { viewDetailsLabel: _?.viewDetailsLabel }
|
|
353
|
+
})
|
|
354
|
+
})), [
|
|
355
|
+
j.anchors,
|
|
356
|
+
t,
|
|
357
|
+
P,
|
|
358
|
+
u,
|
|
359
|
+
_
|
|
360
|
+
]), B = x((e, t, n) => {
|
|
361
|
+
let r = j.insertMention(e, t, n);
|
|
362
|
+
O((e) => e + 1), A(n + 1 + t.length + +!!r);
|
|
363
|
+
}, [j]), V = x(() => {
|
|
364
|
+
j.reset(), O((e) => e + 1), A(void 0);
|
|
365
|
+
}, [j]), U = x((e, t) => {
|
|
366
|
+
j.seedFromMessage(e, t, F), O((e) => e + 1), A(void 0);
|
|
367
|
+
}, [j, F]), W = x((e, t) => {
|
|
368
|
+
if (t == null || t.length === 0) return null;
|
|
369
|
+
let n = J(e, t, F), r = [], i = 0;
|
|
370
|
+
return n.forEach((n) => {
|
|
371
|
+
n.start > i && r.push(e.slice(i, n.start));
|
|
372
|
+
let a = t[n.skillIndex], o = P.get(a.url), s = o?.name ?? ae(a.url);
|
|
373
|
+
r.push(/* @__PURE__ */ M(L, {
|
|
374
|
+
name: s,
|
|
375
|
+
path: a.url,
|
|
376
|
+
labelClassName: u,
|
|
377
|
+
description: o?.description,
|
|
378
|
+
onViewDetails: S,
|
|
379
|
+
labels: { viewDetailsLabel: _?.viewDetailsLabel }
|
|
380
|
+
}, `${a.url}-${n.start}`)), i = n.start + n.length;
|
|
381
|
+
}), i < e.length && r.push(e.slice(i)), r;
|
|
382
|
+
}, [
|
|
268
383
|
F,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
]),
|
|
273
|
-
let t =
|
|
274
|
-
return /* @__PURE__ */
|
|
275
|
-
name: t?.name ??
|
|
384
|
+
P,
|
|
385
|
+
u,
|
|
386
|
+
_
|
|
387
|
+
]), K = x((e) => e == null || e.length === 0 ? null : e.map((e) => {
|
|
388
|
+
let t = P.get(e.url);
|
|
389
|
+
return /* @__PURE__ */ M(L, {
|
|
390
|
+
name: t?.name ?? ae(e.url),
|
|
276
391
|
path: e.url,
|
|
277
|
-
labelClassName:
|
|
392
|
+
labelClassName: u,
|
|
278
393
|
description: t?.description,
|
|
279
|
-
onViewDetails:
|
|
280
|
-
labels: { viewDetailsLabel:
|
|
394
|
+
onViewDetails: S,
|
|
395
|
+
labels: { viewDetailsLabel: _?.viewDetailsLabel }
|
|
281
396
|
}, e.url);
|
|
282
397
|
}), [
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
]),
|
|
287
|
-
favorites:
|
|
398
|
+
P,
|
|
399
|
+
u,
|
|
400
|
+
_
|
|
401
|
+
]), q = x((e, t) => /* @__PURE__ */ M(H, {
|
|
402
|
+
favorites: I,
|
|
288
403
|
isMenu: !0,
|
|
289
|
-
onSelect: (
|
|
290
|
-
|
|
404
|
+
onSelect: (n) => {
|
|
405
|
+
B(n.id, n.name, t), e();
|
|
291
406
|
},
|
|
292
|
-
onToggleFavorite:
|
|
407
|
+
onToggleFavorite: s,
|
|
293
408
|
onBrowse: () => {
|
|
294
|
-
e(),
|
|
409
|
+
T(t), e(), y(!0);
|
|
295
410
|
},
|
|
296
411
|
onViewDetails: (t) => {
|
|
297
|
-
e(),
|
|
412
|
+
e(), S(t.id);
|
|
298
413
|
},
|
|
299
|
-
labels:
|
|
414
|
+
labels: _
|
|
300
415
|
}), [
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
]),
|
|
416
|
+
I,
|
|
417
|
+
B,
|
|
418
|
+
s,
|
|
419
|
+
_
|
|
420
|
+
]), Y = w(() => v ? {
|
|
306
421
|
key: "skills",
|
|
307
|
-
title:
|
|
308
|
-
icon: /* @__PURE__ */
|
|
422
|
+
title: p,
|
|
423
|
+
icon: /* @__PURE__ */ M(D, {
|
|
309
424
|
size: i,
|
|
310
425
|
"aria-hidden": !0,
|
|
311
426
|
stroke: l
|
|
312
427
|
}),
|
|
313
|
-
renderOverlay:
|
|
314
|
-
backLabel:
|
|
428
|
+
renderOverlay: q,
|
|
429
|
+
backLabel: m
|
|
315
430
|
} : void 0, [
|
|
316
|
-
|
|
431
|
+
v,
|
|
432
|
+
p,
|
|
317
433
|
m,
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
]), q = T(() => b ? {
|
|
434
|
+
q
|
|
435
|
+
]), X = w(() => v ? {
|
|
321
436
|
triggerPrefix: "/",
|
|
322
|
-
menuLabel:
|
|
323
|
-
emptyQueryHint:
|
|
324
|
-
renderMenu: ({ query: e,
|
|
325
|
-
favorites:
|
|
437
|
+
menuLabel: p,
|
|
438
|
+
emptyQueryHint: g,
|
|
439
|
+
renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ M(H, {
|
|
440
|
+
favorites: I,
|
|
326
441
|
searchQuery: e,
|
|
327
|
-
listboxId:
|
|
328
|
-
activeOptionId:
|
|
442
|
+
listboxId: r,
|
|
443
|
+
activeOptionId: i,
|
|
329
444
|
onSelect: (e) => {
|
|
330
|
-
|
|
445
|
+
n({ consumeQuery: !0 }), B(e.id, e.name, t);
|
|
331
446
|
},
|
|
332
|
-
onToggleFavorite:
|
|
447
|
+
onToggleFavorite: s,
|
|
333
448
|
onBrowse: () => {
|
|
334
|
-
|
|
449
|
+
n({ consumeQuery: !0 }), T(t), y(!0);
|
|
335
450
|
},
|
|
336
451
|
onViewDetails: (e) => {
|
|
337
|
-
|
|
452
|
+
n({ consumeQuery: !0 }), S(e.id);
|
|
338
453
|
},
|
|
339
|
-
labels:
|
|
454
|
+
labels: _
|
|
340
455
|
})
|
|
341
456
|
} : void 0, [
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
457
|
+
v,
|
|
458
|
+
p,
|
|
459
|
+
g,
|
|
460
|
+
I,
|
|
461
|
+
B,
|
|
462
|
+
s,
|
|
463
|
+
_
|
|
349
464
|
]);
|
|
350
465
|
return e ? {
|
|
351
|
-
skillMenuOverlay:
|
|
352
|
-
commandMenu:
|
|
353
|
-
skillCatalogModal: /* @__PURE__ */
|
|
466
|
+
skillMenuOverlay: Y,
|
|
467
|
+
commandMenu: X,
|
|
468
|
+
skillCatalogModal: /* @__PURE__ */ M(G, {
|
|
354
469
|
isOpen: ee,
|
|
355
|
-
onClose: () =>
|
|
470
|
+
onClose: () => y(!1),
|
|
356
471
|
onSelect: (e) => {
|
|
357
|
-
|
|
472
|
+
B(e, F(e), C), y(!1);
|
|
358
473
|
},
|
|
359
|
-
title:
|
|
360
|
-
renderContent:
|
|
474
|
+
title: h,
|
|
475
|
+
renderContent: d
|
|
361
476
|
}),
|
|
362
|
-
skillDetailsPanel: /* @__PURE__ */
|
|
477
|
+
skillDetailsPanel: /* @__PURE__ */ M(b, {
|
|
363
478
|
fallback: null,
|
|
364
|
-
children: /* @__PURE__ */
|
|
365
|
-
skillId:
|
|
366
|
-
onClose: () =>
|
|
479
|
+
children: /* @__PURE__ */ M(f, {
|
|
480
|
+
skillId: te,
|
|
481
|
+
onClose: () => S(null)
|
|
367
482
|
})
|
|
368
483
|
}),
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
484
|
+
message: j.draft,
|
|
485
|
+
messageRevision: ne,
|
|
486
|
+
activeMentions: z,
|
|
487
|
+
onDraftChange: j.onDraftChange,
|
|
488
|
+
onBackspaceAtCaret: j.onBackspaceAtCaret,
|
|
489
|
+
caretPositionOverride: k,
|
|
490
|
+
isSkillUnsupported: R,
|
|
491
|
+
selectedSkills: j.orderedSkills,
|
|
492
|
+
resetSkillMentions: V,
|
|
493
|
+
seedSkillMentions: U,
|
|
494
|
+
renderHistorySkillSegments: W,
|
|
495
|
+
renderHistorySkills: K
|
|
376
496
|
} : {
|
|
377
497
|
skillMenuOverlay: void 0,
|
|
378
498
|
commandMenu: void 0,
|
|
379
499
|
skillCatalogModal: null,
|
|
380
500
|
skillDetailsPanel: null,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
501
|
+
message: "",
|
|
502
|
+
messageRevision: 0,
|
|
503
|
+
activeMentions: [],
|
|
504
|
+
onDraftChange: () => void 0,
|
|
505
|
+
onBackspaceAtCaret: () => void 0,
|
|
506
|
+
caretPositionOverride: void 0,
|
|
384
507
|
isSkillUnsupported: !1,
|
|
385
|
-
|
|
386
|
-
|
|
508
|
+
selectedSkills: void 0,
|
|
509
|
+
resetSkillMentions: () => void 0,
|
|
510
|
+
seedSkillMentions: () => void 0,
|
|
511
|
+
renderHistorySkillSegments: () => null,
|
|
387
512
|
renderHistorySkills: () => null
|
|
388
513
|
};
|
|
389
|
-
},
|
|
514
|
+
}, $ = {
|
|
390
515
|
background: "_background_14zdf_1",
|
|
391
516
|
border: "_border_14zdf_5",
|
|
392
517
|
value: "_value_14zdf_9",
|
|
393
518
|
clear: "_clear_14zdf_13",
|
|
394
519
|
invalid: "_invalid_14zdf_17"
|
|
395
|
-
},
|
|
396
|
-
let [
|
|
397
|
-
|
|
520
|
+
}, se = [], ce = ({ value: e, onChange: i, displayName: a, favorites: o = se, onToggleFavorite: s, onViewDetails: c, renderOverlay: d, isSkillsSupported: p, isDisabled: h = !1, isInvalid: g = !1, labelledById: _, describedById: ee, labels: y, renderCatalogContent: b, className: x, styles: C }) => {
|
|
521
|
+
let [w, D] = E(!1), [O, k] = E(!1), [P, I] = E(""), L = T(null), R = S(), z = T(null), B = T(!1), V = n(e, p), U = p && !h, W = w && U, K = O && U, q = () => {
|
|
522
|
+
z.current && !z.current.disabled ? z.current.focus() : L.current?.querySelector("button:not(:disabled)")?.focus();
|
|
398
523
|
};
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}, [
|
|
402
|
-
let
|
|
403
|
-
e && !
|
|
404
|
-
},
|
|
405
|
-
|
|
406
|
-
},
|
|
524
|
+
te(() => {
|
|
525
|
+
B.current && !W && !K && ((document.activeElement === document.body || L.current?.contains(document.activeElement)) && q(), D(!1), k(!1)), B.current = W || K;
|
|
526
|
+
}, [W, K]);
|
|
527
|
+
let J = (e) => {
|
|
528
|
+
e && !U || (I(""), D(e));
|
|
529
|
+
}, Y = (e) => {
|
|
530
|
+
U && i(e), D(!1), k(!1);
|
|
531
|
+
}, X = {
|
|
407
532
|
...t({
|
|
408
|
-
"--ssf-text":
|
|
409
|
-
"--ssf-bg":
|
|
410
|
-
"--ssf-border":
|
|
411
|
-
"--ssf-error":
|
|
533
|
+
"--ssf-text": C?.colors?.text,
|
|
534
|
+
"--ssf-bg": C?.colors?.background,
|
|
535
|
+
"--ssf-border": C?.colors?.border,
|
|
536
|
+
"--ssf-error": C?.colors?.error
|
|
412
537
|
}),
|
|
413
|
-
...
|
|
414
|
-
},
|
|
415
|
-
id:
|
|
538
|
+
...C?.cssVars
|
|
539
|
+
}, Z = /* @__PURE__ */ N("div", {
|
|
540
|
+
id: R,
|
|
416
541
|
className: "w-full min-w-0",
|
|
417
|
-
children: [/* @__PURE__ */
|
|
542
|
+
children: [/* @__PURE__ */ M("div", {
|
|
418
543
|
className: "p-2",
|
|
419
|
-
children: /* @__PURE__ */
|
|
420
|
-
value:
|
|
421
|
-
onChange: (e) =>
|
|
422
|
-
placeholder:
|
|
423
|
-
"aria-label":
|
|
424
|
-
clearLabel:
|
|
544
|
+
children: /* @__PURE__ */ M(v, {
|
|
545
|
+
value: P,
|
|
546
|
+
onChange: (e) => I(e ?? ""),
|
|
547
|
+
placeholder: y.searchPlaceholder ?? "Search skills",
|
|
548
|
+
"aria-label": y.searchPlaceholder ?? "Search skills",
|
|
549
|
+
clearLabel: y.clearSearchLabel ?? "Clear search"
|
|
425
550
|
})
|
|
426
|
-
}), /* @__PURE__ */
|
|
551
|
+
}), /* @__PURE__ */ M(H, {
|
|
427
552
|
className: "min-w-0 desktop:w-full",
|
|
428
553
|
rowClassName: "min-h-11",
|
|
429
554
|
favorites: o,
|
|
430
|
-
searchQuery:
|
|
431
|
-
labels:
|
|
432
|
-
onSelect: (e) =>
|
|
555
|
+
searchQuery: P,
|
|
556
|
+
labels: y.panelLabels,
|
|
557
|
+
onSelect: (e) => Y(e.id),
|
|
433
558
|
onToggleFavorite: s,
|
|
434
559
|
onViewDetails: c ? (e) => {
|
|
435
|
-
|
|
560
|
+
D(!1), c(e);
|
|
436
561
|
} : void 0,
|
|
437
562
|
onBrowse: () => {
|
|
438
|
-
|
|
563
|
+
D(!1), k(!0);
|
|
439
564
|
}
|
|
440
565
|
})]
|
|
441
|
-
}),
|
|
442
|
-
inputRef:
|
|
566
|
+
}), Q = /* @__PURE__ */ M(m, {
|
|
567
|
+
inputRef: z,
|
|
443
568
|
readOnly: !0,
|
|
444
569
|
role: "combobox",
|
|
445
570
|
"aria-haspopup": "dialog",
|
|
446
|
-
"aria-expanded":
|
|
447
|
-
"aria-controls":
|
|
571
|
+
"aria-expanded": W,
|
|
572
|
+
"aria-controls": W ? R : void 0,
|
|
448
573
|
"aria-labelledby": _,
|
|
449
|
-
"aria-describedby":
|
|
450
|
-
"aria-invalid": g ||
|
|
451
|
-
disabled: !
|
|
452
|
-
invalid: g ||
|
|
574
|
+
"aria-describedby": ee,
|
|
575
|
+
"aria-invalid": g || V,
|
|
576
|
+
disabled: !U,
|
|
577
|
+
invalid: g || V,
|
|
453
578
|
value: e ? a || e : "",
|
|
454
|
-
placeholder:
|
|
455
|
-
title: p ? e ? a || e : void 0 :
|
|
579
|
+
placeholder: y.placeholder,
|
|
580
|
+
title: p ? e ? a || e : void 0 : y.unsupportedTooltipLabel,
|
|
456
581
|
containerClassName: "w-full min-w-0",
|
|
457
|
-
wrapperClassName: r("cursor-pointer", "--ssf-bg" in
|
|
458
|
-
className: r("min-w-0 cursor-pointer text-ellipsis", "--ssf-text" in
|
|
582
|
+
wrapperClassName: r("cursor-pointer", "--ssf-bg" in X && $.background, "--ssf-border" in X && $.border, (g || V) && $.invalid, C?.triggerClassName),
|
|
583
|
+
className: r("min-w-0 cursor-pointer text-ellipsis", "--ssf-text" in X && $.value, C?.typography?.fontClassName ?? "dial-small-text"),
|
|
459
584
|
onKeyDown: (e) => {
|
|
460
585
|
[
|
|
461
586
|
"Enter",
|
|
462
587
|
" ",
|
|
463
588
|
"ArrowDown"
|
|
464
|
-
].includes(e.key) ? (e.preventDefault(), e.stopPropagation(),
|
|
589
|
+
].includes(e.key) ? (e.preventDefault(), e.stopPropagation(), J(e.key === "ArrowDown" || !W)) : e.key === "Escape" && J(!1);
|
|
465
590
|
},
|
|
466
|
-
iconAfter: /* @__PURE__ */
|
|
591
|
+
iconAfter: /* @__PURE__ */ N("span", {
|
|
467
592
|
className: "flex shrink-0 items-center",
|
|
468
|
-
children: [e && /* @__PURE__ */
|
|
593
|
+
children: [e && /* @__PURE__ */ M(f, {
|
|
469
594
|
type: "button",
|
|
470
|
-
className: r("size-11 shrink-0",
|
|
595
|
+
className: r("size-11 shrink-0", $.clear),
|
|
471
596
|
disabled: h,
|
|
472
|
-
"aria-label":
|
|
597
|
+
"aria-label": y.removeSkillLabel,
|
|
473
598
|
onKeyDown: (e) => e.stopPropagation(),
|
|
474
599
|
onClick: (e) => {
|
|
475
|
-
e.stopPropagation(), i(void 0),
|
|
600
|
+
e.stopPropagation(), i(void 0), D(!1), U ? z.current?.focus() : L.current?.focus();
|
|
476
601
|
},
|
|
477
|
-
iconBefore: /* @__PURE__ */
|
|
602
|
+
iconBefore: /* @__PURE__ */ M(A, {
|
|
478
603
|
"aria-hidden": !0,
|
|
479
604
|
size: 18,
|
|
480
605
|
stroke: l
|
|
481
606
|
})
|
|
482
|
-
}), /* @__PURE__ */
|
|
607
|
+
}), /* @__PURE__ */ M(ne, {
|
|
483
608
|
"aria-hidden": !0,
|
|
484
609
|
size: 20,
|
|
485
610
|
stroke: l,
|
|
486
|
-
className: r("transition-transform",
|
|
611
|
+
className: r("transition-transform", W && "rotate-180")
|
|
487
612
|
})]
|
|
488
613
|
})
|
|
489
614
|
});
|
|
490
|
-
return /* @__PURE__ */
|
|
491
|
-
ref:
|
|
615
|
+
return /* @__PURE__ */ N("div", {
|
|
616
|
+
ref: L,
|
|
492
617
|
role: "group",
|
|
493
618
|
"aria-labelledby": _,
|
|
494
619
|
tabIndex: -1,
|
|
495
|
-
className: r("min-w-0",
|
|
496
|
-
style:
|
|
497
|
-
children: [d ? /* @__PURE__ */
|
|
620
|
+
className: r("min-w-0", x, F.selectorField),
|
|
621
|
+
style: X,
|
|
622
|
+
children: [d ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("div", {
|
|
498
623
|
className: "w-full min-w-0",
|
|
499
|
-
onClick: () =>
|
|
500
|
-
children:
|
|
501
|
-
}), d(
|
|
502
|
-
open:
|
|
503
|
-
onOpenChange:
|
|
504
|
-
disabled: !
|
|
624
|
+
onClick: () => J(!W),
|
|
625
|
+
children: Q
|
|
626
|
+
}), d(Z, W, () => J(!1))] }) : /* @__PURE__ */ M(u, {
|
|
627
|
+
open: W,
|
|
628
|
+
onOpenChange: J,
|
|
629
|
+
disabled: !U,
|
|
505
630
|
className: "w-full min-w-0",
|
|
506
631
|
listClassName: "w-[min(var(--reference-width),calc(100vw-2rem))] max-w-full",
|
|
507
|
-
renderOverlay: () => /* @__PURE__ */
|
|
632
|
+
renderOverlay: () => /* @__PURE__ */ M("div", {
|
|
508
633
|
role: "dialog",
|
|
509
634
|
"aria-labelledby": _,
|
|
510
|
-
children:
|
|
635
|
+
children: Z
|
|
511
636
|
}),
|
|
512
637
|
initialFocus: 0,
|
|
513
|
-
children:
|
|
514
|
-
}),
|
|
638
|
+
children: Q
|
|
639
|
+
}), K && /* @__PURE__ */ M(G, {
|
|
515
640
|
isOpen: !0,
|
|
516
|
-
onClose: () =>
|
|
517
|
-
title:
|
|
518
|
-
onSelect:
|
|
519
|
-
renderContent:
|
|
641
|
+
onClose: () => k(!1),
|
|
642
|
+
title: y.modalTitle,
|
|
643
|
+
onSelect: Y,
|
|
644
|
+
renderContent: b
|
|
520
645
|
})]
|
|
521
646
|
});
|
|
522
647
|
};
|
|
523
648
|
//#endregion
|
|
524
|
-
export {
|
|
649
|
+
export { L as ChatSkill, H as FavoriteSkillsPanel, F as SKILLS_CLASS, W as SkillArchiveUploadDialog, G as SkillCatalogModal, K as SkillDetailsSidePanel, I as SkillInfoTooltipContent, ce as SkillSelectorField, ie as buildFavoriteSkillItem, Y as diffTextChange, Q as findMentionAtCaret, ae as getSkillFallbackName, Z as insertAnchor, J as matchSkillMentions, X as reconcileAnchors, re as useSkillMentions, oe as useSkillSelectorOverlay };
|