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