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