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