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