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