@epam/ai-dial-skills 1.3.0-dev.37 → 1.3.0-dev.372
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 +4 -2
- package/index.d.ts.map +1 -1
- package/index.js +469 -411
- package/models/chat-skill-props.d.ts +20 -15
- 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 +16 -11
- 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,96 +1,119 @@
|
|
|
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
|
+
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: "
|
|
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: "text-start",
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
size: u.Small,
|
|
49
|
+
className: "self-start",
|
|
50
|
+
label: p,
|
|
51
|
+
iconBefore: /* @__PURE__ */ L(P, {
|
|
42
52
|
size: c.SM,
|
|
43
53
|
stroke: l,
|
|
44
54
|
"aria-hidden": !0
|
|
45
55
|
}),
|
|
46
|
-
onClick:
|
|
47
|
-
tabIndex:
|
|
56
|
+
onClick: m,
|
|
57
|
+
tabIndex: h
|
|
48
58
|
})]
|
|
49
|
-
}) : /* @__PURE__ */
|
|
50
|
-
className: "text-start",
|
|
51
|
-
children:
|
|
59
|
+
}) : /* @__PURE__ */ L("p", {
|
|
60
|
+
className: r(g, "text-start"),
|
|
61
|
+
children: n
|
|
52
62
|
});
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
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(() => {
|
|
76
|
+
if (!C) return;
|
|
77
|
+
let e = () => {
|
|
78
|
+
C.isConnected && D(C.getBoundingClientRect().width);
|
|
79
|
+
};
|
|
80
|
+
if (e(), typeof ResizeObserver > "u") return;
|
|
81
|
+
let t = new ResizeObserver(e);
|
|
82
|
+
return t.observe(C), () => t.disconnect();
|
|
83
|
+
}, [C, s]), /* @__PURE__ */ L(m, {
|
|
63
84
|
asChild: !0,
|
|
64
|
-
placement:
|
|
65
|
-
trigger:
|
|
66
|
-
contentClassName:
|
|
67
|
-
content:
|
|
68
|
-
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,
|
|
69
90
|
viewDetailsLabel: f,
|
|
70
91
|
onViewDetails: S
|
|
71
|
-
}) : /* @__PURE__ */
|
|
72
|
-
unresolvedReason:
|
|
92
|
+
}) : /* @__PURE__ */ L(q, {
|
|
93
|
+
unresolvedReason: o,
|
|
73
94
|
deletedMessage: g,
|
|
74
|
-
notSharedMessage: _
|
|
95
|
+
notSharedMessage: _,
|
|
96
|
+
colors: c?.tooltip
|
|
75
97
|
}),
|
|
76
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ R("span", {
|
|
77
99
|
tabIndex: 0,
|
|
78
|
-
className: r("relative -
|
|
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,
|
|
79
102
|
"aria-label": `/${e}`,
|
|
80
|
-
children: [/* @__PURE__ */
|
|
81
|
-
ref:
|
|
103
|
+
children: [/* @__PURE__ */ L("span", {
|
|
104
|
+
ref: w,
|
|
82
105
|
"aria-hidden": !0,
|
|
83
|
-
className: "inset-inline-start-0 pointer-events-none absolute
|
|
106
|
+
className: "inset-inline-start-0 pointer-events-none absolute select-none",
|
|
84
107
|
children: "/"
|
|
85
|
-
}), /* @__PURE__ */
|
|
108
|
+
}), /* @__PURE__ */ L("span", {
|
|
86
109
|
"aria-hidden": !0,
|
|
87
110
|
className: "select-none",
|
|
88
|
-
style: { paddingInlineStart:
|
|
111
|
+
style: { paddingInlineStart: T ?? void 0 },
|
|
89
112
|
children: e
|
|
90
113
|
})]
|
|
91
114
|
})
|
|
92
115
|
}, v);
|
|
93
|
-
},
|
|
116
|
+
}, X = {
|
|
94
117
|
row: "_row_1v431_1",
|
|
95
118
|
header: "_header_1v431_8",
|
|
96
119
|
emptyHint: "_emptyHint_1v431_12",
|
|
@@ -101,149 +124,148 @@ var B = {
|
|
|
101
124
|
rowLeaving: "_rowLeaving_1v431_32",
|
|
102
125
|
rowFadeOut: "_rowFadeOut_1v431_1",
|
|
103
126
|
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 =
|
|
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;
|
|
114
137
|
return () => {
|
|
115
138
|
e.forEach((e) => clearTimeout(e)), e.clear();
|
|
116
139
|
};
|
|
117
140
|
}, []);
|
|
118
|
-
let V =
|
|
119
|
-
V ?
|
|
120
|
-
let
|
|
121
|
-
|
|
122
|
-
Q.current &&
|
|
123
|
-
}, [n,
|
|
124
|
-
let
|
|
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));
|
|
146
|
+
}, [n, h]);
|
|
147
|
+
let ue = (e, t) => {
|
|
125
148
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i(t));
|
|
126
|
-
},
|
|
127
|
-
|
|
149
|
+
}, de = (e) => {
|
|
150
|
+
z((t) => new Set(t).add(e));
|
|
128
151
|
let t = setTimeout(() => {
|
|
129
|
-
a?.(e),
|
|
152
|
+
a?.(e), z((t) => {
|
|
130
153
|
let n = new Set(t);
|
|
131
154
|
return n.delete(e), n;
|
|
132
|
-
}),
|
|
133
|
-
},
|
|
134
|
-
|
|
155
|
+
}), B.current.delete(e);
|
|
156
|
+
}, oe);
|
|
157
|
+
B.current.set(e, t);
|
|
135
158
|
};
|
|
136
|
-
return /* @__PURE__ */
|
|
137
|
-
className: r("flex w-full flex-col desktop:w-[280px]",
|
|
138
|
-
style:
|
|
159
|
+
return /* @__PURE__ */ R("div", {
|
|
160
|
+
className: r("flex w-full flex-col desktop:w-[280px]", u, U.favoritesPanel),
|
|
161
|
+
style: I,
|
|
139
162
|
children: [
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
id:
|
|
142
|
-
className: r(
|
|
163
|
+
/* @__PURE__ */ L("p", {
|
|
164
|
+
id: K,
|
|
165
|
+
className: r(T, ae, X.header),
|
|
143
166
|
children: D
|
|
144
167
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
className: r("max-h-72 min-h-0 flex-1 overflow-y-auto",
|
|
147
|
-
style: { maxHeight:
|
|
148
|
-
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", {
|
|
149
172
|
ref: Q,
|
|
150
|
-
children: Z.length > 0 ? /* @__PURE__ */
|
|
151
|
-
id:
|
|
152
|
-
role: V ? "listbox" :
|
|
153
|
-
"aria-labelledby": V ?
|
|
173
|
+
children: [Z.length > 0 ? /* @__PURE__ */ L("ul", {
|
|
174
|
+
id: v,
|
|
175
|
+
role: V ? "listbox" : W,
|
|
176
|
+
"aria-labelledby": V ? K : void 0,
|
|
154
177
|
className: "flex flex-col gap-1 px-1 pb-1",
|
|
155
178
|
children: Z.map((t) => {
|
|
156
|
-
let n = V ? `${
|
|
157
|
-
role:
|
|
179
|
+
let n = V ? `${v}-${encodeURIComponent(t.id)}` : void 0, o = V ? -1 : void 0, u = /* @__PURE__ */ R("div", {
|
|
180
|
+
role: G,
|
|
158
181
|
id: n,
|
|
159
|
-
"aria-selected": V ? n ===
|
|
182
|
+
"aria-selected": V ? n === y : void 0,
|
|
160
183
|
"aria-label": t.name,
|
|
161
184
|
tabIndex: 0,
|
|
162
|
-
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),
|
|
163
186
|
onClick: () => i(t),
|
|
164
|
-
onKeyDown: (e) =>
|
|
187
|
+
onKeyDown: (e) => ue(e, t),
|
|
165
188
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ L(e, {
|
|
167
190
|
size: c.MD,
|
|
168
191
|
initialsName: t.name
|
|
169
192
|
}),
|
|
170
|
-
|
|
171
|
-
className: r(
|
|
193
|
+
h == null ? /* @__PURE__ */ L("span", {
|
|
194
|
+
className: r(C, "min-w-0 flex-1 truncate text-start"),
|
|
172
195
|
children: t.name
|
|
173
|
-
}) : /* @__PURE__ */
|
|
196
|
+
}) : /* @__PURE__ */ L(p, {
|
|
174
197
|
text: t.name,
|
|
175
|
-
query:
|
|
198
|
+
query: h,
|
|
176
199
|
maxLines: 1,
|
|
177
|
-
className: r(
|
|
200
|
+
className: r(C, "min-w-0 flex-1 text-start")
|
|
178
201
|
}),
|
|
179
|
-
a && /* @__PURE__ */
|
|
180
|
-
icon: /* @__PURE__ */
|
|
202
|
+
a && /* @__PURE__ */ L(w, {
|
|
203
|
+
icon: /* @__PURE__ */ L(ne, {
|
|
181
204
|
size: c.SM,
|
|
182
|
-
className:
|
|
205
|
+
className: X.star,
|
|
183
206
|
"aria-hidden": !0
|
|
184
207
|
}),
|
|
185
|
-
"aria-label":
|
|
208
|
+
"aria-label": te,
|
|
186
209
|
isSelected: !0,
|
|
187
210
|
tabIndex: o,
|
|
188
211
|
onClick: (e) => {
|
|
189
|
-
e.stopPropagation(),
|
|
212
|
+
e.stopPropagation(), de(t.id);
|
|
190
213
|
}
|
|
191
214
|
})
|
|
192
215
|
]
|
|
193
216
|
});
|
|
194
|
-
return /* @__PURE__ */
|
|
195
|
-
role:
|
|
196
|
-
className:
|
|
197
|
-
children: s ? /* @__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, {
|
|
198
221
|
asChild: !0,
|
|
199
|
-
contentClassName:
|
|
200
|
-
content: /* @__PURE__ */
|
|
222
|
+
contentClassName: ie,
|
|
223
|
+
content: /* @__PURE__ */ L(q, {
|
|
201
224
|
description: t.description,
|
|
202
|
-
viewDetailsLabel:
|
|
225
|
+
viewDetailsLabel: P,
|
|
203
226
|
onViewDetails: () => s(t),
|
|
204
227
|
viewDetailsTabIndex: o
|
|
205
228
|
}),
|
|
206
|
-
children:
|
|
207
|
-
}) :
|
|
229
|
+
children: u
|
|
230
|
+
}) : u
|
|
208
231
|
}, t.id);
|
|
209
232
|
})
|
|
210
|
-
}) :
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
})
|
|
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
|
+
})]
|
|
219
241
|
})
|
|
220
242
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
className: r("border-t px-2 py-3",
|
|
223
|
-
children: /* @__PURE__ */
|
|
224
|
-
role:
|
|
225
|
-
label:
|
|
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,
|
|
247
|
+
label: j,
|
|
226
248
|
className: "w-full justify-center",
|
|
227
249
|
onClick: o
|
|
228
250
|
})
|
|
229
251
|
})
|
|
230
252
|
]
|
|
231
253
|
});
|
|
232
|
-
},
|
|
233
|
-
let { dialogTitle: c = "Upload skill", dropZoneLabel: l = "Drag and drop it or click here to upload", dropZoneMobileLabel:
|
|
234
|
-
return /* @__PURE__ */
|
|
254
|
+
}, ce = ".zip,.md", Q = ({ isOpen: e, errorText: t, isUploading: n = !1, accept: r = ce, labels: i, onClose: a, onFilesSelected: o, onFilesRejected: s }) => {
|
|
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 ?? {};
|
|
256
|
+
return /* @__PURE__ */ L(v, {
|
|
235
257
|
open: e,
|
|
236
|
-
size:
|
|
258
|
+
size: y.Sm,
|
|
237
259
|
header: c,
|
|
238
260
|
closeAriaLabel: m,
|
|
239
261
|
onClose: a,
|
|
240
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ R("div", {
|
|
241
263
|
className: "flex flex-col gap-4 px-6 py-4",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
243
|
-
label: /* @__PURE__ */
|
|
264
|
+
children: [/* @__PURE__ */ L(d, {
|
|
265
|
+
label: /* @__PURE__ */ R(re, { children: [/* @__PURE__ */ L("span", {
|
|
244
266
|
className: "desktop:hidden",
|
|
245
|
-
children:
|
|
246
|
-
}), /* @__PURE__ */
|
|
267
|
+
children: u
|
|
268
|
+
}), /* @__PURE__ */ L("span", {
|
|
247
269
|
className: "hidden desktop:inline",
|
|
248
270
|
children: l
|
|
249
271
|
})] }),
|
|
@@ -254,56 +276,59 @@ var B = {
|
|
|
254
276
|
errorText: n ? void 0 : t,
|
|
255
277
|
onChange: o,
|
|
256
278
|
onReject: s
|
|
257
|
-
}), n && /* @__PURE__ */
|
|
279
|
+
}), n && /* @__PURE__ */ L(x, { ariaLabel: h })]
|
|
258
280
|
})
|
|
259
281
|
});
|
|
260
|
-
},
|
|
282
|
+
}, le = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ L(v, {
|
|
261
283
|
open: e,
|
|
262
284
|
header: r,
|
|
263
|
-
size:
|
|
264
|
-
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",
|
|
265
287
|
overlayClassName: "mobile:p-0",
|
|
266
288
|
onClose: t,
|
|
267
|
-
children: /* @__PURE__ */
|
|
289
|
+
children: /* @__PURE__ */ L("div", {
|
|
268
290
|
className: "h-[min(80vh,840px)] overflow-auto mobile:h-full",
|
|
269
|
-
children: /* @__PURE__ */
|
|
291
|
+
children: /* @__PURE__ */ L(D, {
|
|
270
292
|
fallback: null,
|
|
271
293
|
children: e && i(n, t)
|
|
272
294
|
})
|
|
273
295
|
})
|
|
274
|
-
}),
|
|
296
|
+
}), $ = (e, t = null) => e.map((e) => e.type === V.Folder ? {
|
|
275
297
|
path: e.id,
|
|
276
298
|
name: e.name,
|
|
277
|
-
nodeType:
|
|
299
|
+
nodeType: z.FOLDER,
|
|
278
300
|
parentPath: t,
|
|
279
301
|
folderId: e.id,
|
|
280
|
-
items:
|
|
302
|
+
items: $(e.items, e.id)
|
|
281
303
|
} : {
|
|
282
304
|
path: e.id,
|
|
283
305
|
name: e.name,
|
|
284
|
-
nodeType:
|
|
306
|
+
nodeType: z.ITEM,
|
|
285
307
|
parentPath: t,
|
|
286
308
|
folderId: t ?? ""
|
|
287
|
-
}),
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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, {
|
|
304
329
|
...e,
|
|
305
|
-
renderContentFileTree: (e) => /* @__PURE__ */
|
|
306
|
-
}),
|
|
330
|
+
renderContentFileTree: (e) => /* @__PURE__ */ L(ue, { ...e })
|
|
331
|
+
}), fe = (e) => e == null || /[\s/]/.test(e), pe = (e, t, n) => {
|
|
307
332
|
let r = [], i = 0;
|
|
308
333
|
return t.forEach((t, a) => {
|
|
309
334
|
let o = `/${n(t.url)}`, s = i;
|
|
@@ -311,7 +336,7 @@ var B = {
|
|
|
311
336
|
let t = e.indexOf(o, s);
|
|
312
337
|
if (t === -1) return;
|
|
313
338
|
let n = t + o.length;
|
|
314
|
-
if (
|
|
339
|
+
if (fe(e[n])) {
|
|
315
340
|
r.push({
|
|
316
341
|
skillIndex: a,
|
|
317
342
|
start: t,
|
|
@@ -322,14 +347,14 @@ var B = {
|
|
|
322
347
|
s = t + 1;
|
|
323
348
|
}
|
|
324
349
|
}), r;
|
|
325
|
-
},
|
|
350
|
+
}, me = (e, t) => {
|
|
326
351
|
let n = /* @__PURE__ */ new Map();
|
|
327
352
|
t.forEach((e) => {
|
|
328
353
|
e.name !== "" && !n.has(e.name) && n.set(e.name, e.url);
|
|
329
354
|
});
|
|
330
355
|
let r = [...n.keys()].sort((e, t) => t.length - e.length), i = [], a = e.indexOf("/");
|
|
331
356
|
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) &&
|
|
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);
|
|
333
358
|
s != null && c != null ? (i.push({
|
|
334
359
|
url: c,
|
|
335
360
|
name: s,
|
|
@@ -338,7 +363,7 @@ var B = {
|
|
|
338
363
|
}), a = e.indexOf("/", o + s.length)) : a = e.indexOf("/", o);
|
|
339
364
|
}
|
|
340
365
|
return i;
|
|
341
|
-
},
|
|
366
|
+
}, he = (e, t) => {
|
|
342
367
|
let n = Math.min(e.length, t.length), r = 0;
|
|
343
368
|
for (; r < n && e[r] === t[r];) r += 1;
|
|
344
369
|
let i = n - r, a = 0;
|
|
@@ -348,13 +373,13 @@ var B = {
|
|
|
348
373
|
deletedLength: e.length - r - a,
|
|
349
374
|
insertedLength: t.length - r - a
|
|
350
375
|
};
|
|
351
|
-
},
|
|
376
|
+
}, ge = (e, t) => {
|
|
352
377
|
let n = t.start + t.deletedLength, r = t.insertedLength - t.deletedLength;
|
|
353
378
|
return e.reduce((e, i) => i.start + i.length <= t.start ? (e.push(i), e) : (i.start >= n && e.push({
|
|
354
379
|
...i,
|
|
355
380
|
start: i.start + r
|
|
356
381
|
}), e), []);
|
|
357
|
-
},
|
|
382
|
+
}, _e = (e, t, n, r, i) => {
|
|
358
383
|
let a = r.length + 1, o = a + +!!i, s = e.map((e) => e.start >= t ? {
|
|
359
384
|
...e,
|
|
360
385
|
start: e.start + o
|
|
@@ -365,31 +390,31 @@ var B = {
|
|
|
365
390
|
length: a
|
|
366
391
|
};
|
|
367
392
|
return [...s, c].sort((e, t) => e.start - t.start);
|
|
368
|
-
},
|
|
393
|
+
}, ve = (e, t) => e.find((e) => e.start + e.length === t), ye = (e, t, n) => {
|
|
369
394
|
let r = t;
|
|
370
395
|
for (; r > 0 && !/\s/.test(e[r - 1]);) r--;
|
|
371
396
|
let i = r;
|
|
372
397
|
for (; i < e.length && !/\s/.test(e[i]);) i++;
|
|
373
398
|
let a = e.slice(r, i);
|
|
374
|
-
if (
|
|
399
|
+
if (a.startsWith(n) && !a.slice(n.length).includes(n)) return {
|
|
375
400
|
start: r,
|
|
376
401
|
end: i
|
|
377
402
|
};
|
|
378
|
-
},
|
|
403
|
+
}, be = (e, t, n) => {
|
|
379
404
|
if (n === "" || t.insertedLength < n.length) return;
|
|
380
405
|
let r = e.indexOf(n, Math.max(0, t.start - n.length)), i = t.start + t.insertedLength - n.length;
|
|
381
406
|
return r !== -1 && r <= i ? r : void 0;
|
|
382
|
-
},
|
|
383
|
-
let [e, t] =
|
|
407
|
+
}, xe = () => {
|
|
408
|
+
let [e, t] = N(""), [n, r] = N([]), i = M(e);
|
|
384
409
|
i.current = e;
|
|
385
|
-
let a =
|
|
410
|
+
let a = M(n);
|
|
386
411
|
a.current = n;
|
|
387
|
-
let o =
|
|
388
|
-
let n =
|
|
412
|
+
let o = M(null), s = O((e) => {
|
|
413
|
+
let n = he(i.current, e), a = o.current;
|
|
389
414
|
o.current = null;
|
|
390
|
-
let s = a == null ? void 0 :
|
|
415
|
+
let s = a == null ? void 0 : be(e, n, a.text);
|
|
391
416
|
r((t) => {
|
|
392
|
-
let r =
|
|
417
|
+
let r = ge(t, n);
|
|
393
418
|
if (a == null || s == null) return r;
|
|
394
419
|
let i = a.mentions.map((e) => ({
|
|
395
420
|
...e,
|
|
@@ -397,23 +422,23 @@ var B = {
|
|
|
397
422
|
})).filter((t) => e.startsWith(`/${t.name}`, t.start) && !r.some((e) => e.start < t.start + t.length && t.start < e.start + e.length));
|
|
398
423
|
return [...r, ...i].sort((e, t) => e.start - t.start);
|
|
399
424
|
}), i.current = e, t(e);
|
|
400
|
-
}, []), c =
|
|
425
|
+
}, []), c = O((e, n, a) => {
|
|
401
426
|
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 =
|
|
427
|
+
return i.current = l, t(l), r((t) => _e(t, a, e, n, s)), s;
|
|
428
|
+
}, []), l = O((e, n, a) => {
|
|
404
429
|
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 =
|
|
430
|
+
i.current = c, t(c), r((t) => _e(t, a, e, n, !1));
|
|
431
|
+
}, []), u = O((e) => ve(a.current, e), []), d = j(() => {
|
|
407
432
|
if (n.length !== 0) return n.map((e) => ({ url: e.url }));
|
|
408
|
-
}, [n]), f =
|
|
433
|
+
}, [n]), f = O((e, t) => {
|
|
409
434
|
o.current = t.length > 0 ? {
|
|
410
435
|
text: e,
|
|
411
436
|
mentions: t
|
|
412
437
|
} : null;
|
|
413
|
-
}, []), p =
|
|
438
|
+
}, []), p = O(() => {
|
|
414
439
|
t(""), r([]);
|
|
415
|
-
}, []), m =
|
|
416
|
-
let a = n ?? [], o =
|
|
440
|
+
}, []), m = O((e, n, i) => {
|
|
441
|
+
let a = n ?? [], o = pe(e, a, i);
|
|
417
442
|
t(e), r(o.map((e) => {
|
|
418
443
|
let t = a[e.skillIndex];
|
|
419
444
|
return {
|
|
@@ -424,7 +449,7 @@ var B = {
|
|
|
424
449
|
};
|
|
425
450
|
}));
|
|
426
451
|
}, []);
|
|
427
|
-
return
|
|
452
|
+
return j(() => ({
|
|
428
453
|
draft: e,
|
|
429
454
|
anchors: n,
|
|
430
455
|
onDraftChange: s,
|
|
@@ -447,18 +472,18 @@ var B = {
|
|
|
447
472
|
p,
|
|
448
473
|
m
|
|
449
474
|
]);
|
|
450
|
-
},
|
|
475
|
+
}, Se = (e) => ({
|
|
451
476
|
id: e.url,
|
|
452
477
|
name: e.name,
|
|
453
478
|
description: e.description
|
|
454
|
-
}),
|
|
479
|
+
}), Ce = (e) => {
|
|
455
480
|
let t = e.split("/").filter((e) => e.length > 0);
|
|
456
481
|
return t[t.length - 1] ?? e;
|
|
457
|
-
},
|
|
482
|
+
}, we = (e) => {
|
|
458
483
|
let t = e.split("/").filter((e) => e.length > 0);
|
|
459
484
|
return t[0] !== "skills" || t.length < 3 ? null : t[1];
|
|
460
|
-
},
|
|
461
|
-
let { addMenuLabel:
|
|
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(() => [
|
|
462
487
|
...t,
|
|
463
488
|
...n ?? [],
|
|
464
489
|
...r ?? []
|
|
@@ -466,312 +491,345 @@ var B = {
|
|
|
466
491
|
t,
|
|
467
492
|
n,
|
|
468
493
|
r
|
|
469
|
-
]),
|
|
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) => ({
|
|
470
495
|
start: t.start,
|
|
471
496
|
length: t.length,
|
|
472
497
|
isUnsupported: !e,
|
|
473
|
-
render: () => /* @__PURE__ */
|
|
498
|
+
render: () => /* @__PURE__ */ L(Y, {
|
|
474
499
|
name: t.name,
|
|
475
500
|
path: t.url,
|
|
476
|
-
labelClassName:
|
|
477
|
-
|
|
501
|
+
labelClassName: "",
|
|
502
|
+
colors: d,
|
|
503
|
+
description: V.get(t.url)?.description,
|
|
478
504
|
isUnsupported: !e,
|
|
479
505
|
detailsTrigger: f,
|
|
480
|
-
onViewDetails:
|
|
506
|
+
onViewDetails: k,
|
|
481
507
|
labels: {
|
|
482
|
-
viewDetailsLabel:
|
|
483
|
-
unsupportedTooltipLabel:
|
|
508
|
+
viewDetailsLabel: w?.viewDetailsLabel,
|
|
509
|
+
unsupportedTooltipLabel: C
|
|
484
510
|
}
|
|
485
511
|
})
|
|
486
512
|
})), [
|
|
487
|
-
|
|
513
|
+
z.anchors,
|
|
488
514
|
e,
|
|
489
|
-
|
|
515
|
+
V,
|
|
490
516
|
d,
|
|
491
517
|
f,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
]),
|
|
495
|
-
let r =
|
|
496
|
-
|
|
497
|
-
}, [
|
|
498
|
-
let t =
|
|
499
|
-
return t == null ? e : (
|
|
500
|
-
}, [
|
|
501
|
-
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);
|
|
502
528
|
if (t == null) return;
|
|
503
|
-
let n =
|
|
529
|
+
let n = z.anchors.find((e) => e.start === t.start && e.start + e.length === t.end);
|
|
504
530
|
return {
|
|
505
531
|
position: t.start,
|
|
506
|
-
text:
|
|
532
|
+
text: z.draft.slice(t.start, t.end),
|
|
507
533
|
mentionUrl: n?.url
|
|
508
534
|
};
|
|
509
|
-
}, [
|
|
510
|
-
|
|
511
|
-
}, [
|
|
512
|
-
|
|
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) : []);
|
|
513
539
|
}, [
|
|
514
|
-
|
|
540
|
+
X,
|
|
515
541
|
e,
|
|
516
|
-
|
|
517
|
-
]), oe =
|
|
518
|
-
|
|
519
|
-
}, [
|
|
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) => {
|
|
520
546
|
if (t == null || t.length === 0) return null;
|
|
521
|
-
let n =
|
|
547
|
+
let n = pe(e, t, H), r = [], i = 0;
|
|
522
548
|
return n.forEach((n) => {
|
|
523
549
|
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
|
-
|
|
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;
|
|
551
|
+
r.push({
|
|
552
|
+
text: e.slice(n.start, n.start + n.length),
|
|
553
|
+
node: /* @__PURE__ */ L(Y, {
|
|
554
|
+
name: c,
|
|
555
|
+
path: a.url,
|
|
556
|
+
labelClassName: u,
|
|
557
|
+
colors: d,
|
|
558
|
+
description: s?.description,
|
|
559
|
+
unresolvedReason: l,
|
|
560
|
+
detailsTrigger: p,
|
|
561
|
+
onViewDetails: k,
|
|
562
|
+
labels: {
|
|
563
|
+
viewDetailsLabel: w?.viewDetailsLabel,
|
|
564
|
+
deletedTooltipLabel: x,
|
|
565
|
+
notSharedTooltipLabel: S
|
|
566
|
+
}
|
|
567
|
+
}, `${a.url}-${n.start}`)
|
|
568
|
+
}), i = n.start + n.length;
|
|
539
569
|
}), i < e.length && r.push(e.slice(i)), r;
|
|
540
570
|
}, [
|
|
541
|
-
W,
|
|
542
571
|
H,
|
|
572
|
+
V,
|
|
543
573
|
u,
|
|
574
|
+
d,
|
|
544
575
|
p,
|
|
545
|
-
|
|
576
|
+
w,
|
|
546
577
|
o,
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
]),
|
|
550
|
-
let t =
|
|
551
|
-
return /* @__PURE__ */
|
|
578
|
+
x,
|
|
579
|
+
S
|
|
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, {
|
|
552
583
|
name: n,
|
|
553
584
|
path: e.url,
|
|
554
585
|
labelClassName: u,
|
|
586
|
+
colors: d,
|
|
555
587
|
description: t?.description,
|
|
556
588
|
unresolvedReason: r,
|
|
557
589
|
detailsTrigger: p,
|
|
558
|
-
onViewDetails:
|
|
590
|
+
onViewDetails: k,
|
|
559
591
|
labels: {
|
|
560
|
-
viewDetailsLabel:
|
|
561
|
-
deletedTooltipLabel:
|
|
562
|
-
notSharedTooltipLabel:
|
|
592
|
+
viewDetailsLabel: w?.viewDetailsLabel,
|
|
593
|
+
deletedTooltipLabel: x,
|
|
594
|
+
notSharedTooltipLabel: S
|
|
563
595
|
}
|
|
564
596
|
}, e.url);
|
|
565
597
|
}), [
|
|
566
|
-
|
|
598
|
+
V,
|
|
567
599
|
u,
|
|
600
|
+
d,
|
|
568
601
|
p,
|
|
569
|
-
|
|
602
|
+
w,
|
|
570
603
|
o,
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
]),
|
|
574
|
-
favorites:
|
|
604
|
+
x,
|
|
605
|
+
S
|
|
606
|
+
]), $ = O((e, t) => /* @__PURE__ */ L(Z, {
|
|
607
|
+
favorites: U,
|
|
575
608
|
isMenu: !0,
|
|
576
609
|
onSelect: (n) => {
|
|
577
|
-
|
|
610
|
+
G(n.id, n.name, K(t)), e();
|
|
578
611
|
},
|
|
579
612
|
onToggleFavorite: s,
|
|
580
613
|
onBrowse: () => {
|
|
581
|
-
let n =
|
|
582
|
-
P(
|
|
614
|
+
let n = q(t), r = K(t);
|
|
615
|
+
P(r), F.current = n ?? null, e(), E(!0);
|
|
583
616
|
},
|
|
584
617
|
onViewDetails: (n) => {
|
|
585
|
-
|
|
618
|
+
K(t), e(), k(n.id);
|
|
586
619
|
},
|
|
587
|
-
|
|
620
|
+
isRowTooltipHidden: m,
|
|
621
|
+
labels: w
|
|
588
622
|
}), [
|
|
623
|
+
U,
|
|
589
624
|
G,
|
|
625
|
+
K,
|
|
590
626
|
q,
|
|
591
|
-
J,
|
|
592
|
-
X,
|
|
593
627
|
s,
|
|
594
|
-
|
|
595
|
-
|
|
628
|
+
m,
|
|
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]);
|
|
596
694
|
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]),
|
|
695
|
+
skillMenuOverlay: ue,
|
|
696
|
+
commandMenu: de,
|
|
697
|
+
skillCatalogModal: /* @__PURE__ */ L(le, {
|
|
698
|
+
isOpen: T,
|
|
699
|
+
onClose: fe,
|
|
663
700
|
onSelect: (e) => {
|
|
664
|
-
|
|
701
|
+
F.current = null, G(e, H(e), A), E(!1);
|
|
665
702
|
},
|
|
666
|
-
title:
|
|
667
|
-
renderContent:
|
|
703
|
+
title: y,
|
|
704
|
+
renderContent: h
|
|
668
705
|
}),
|
|
669
|
-
skillDetailsPanel: /* @__PURE__ */
|
|
706
|
+
skillDetailsPanel: /* @__PURE__ */ L(D, {
|
|
670
707
|
fallback: null,
|
|
671
|
-
children: /* @__PURE__ */
|
|
672
|
-
skillId:
|
|
673
|
-
onClose: () =>
|
|
708
|
+
children: /* @__PURE__ */ L(g, {
|
|
709
|
+
skillId: ee,
|
|
710
|
+
onClose: () => k(null)
|
|
674
711
|
})
|
|
675
712
|
}),
|
|
676
|
-
message:
|
|
677
|
-
messageRevision:
|
|
678
|
-
activeMentions:
|
|
679
|
-
onDraftChange:
|
|
680
|
-
onBackspaceAtCaret:
|
|
681
|
-
caretPositionOverride:
|
|
682
|
-
isSkillUnsupported:
|
|
683
|
-
selectedSkills:
|
|
684
|
-
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,
|
|
685
722
|
seedSkillMentions: oe,
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
723
|
+
selectSkillByUrl: se,
|
|
724
|
+
recognizeMentionsInInsertion: ae,
|
|
725
|
+
renderHistorySkillSegments: ce,
|
|
726
|
+
renderHistorySkills: Q
|
|
689
727
|
};
|
|
690
|
-
},
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
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, {
|
|
698
744
|
id: e,
|
|
699
745
|
name: o?.[e] || e
|
|
700
746
|
}]));
|
|
701
|
-
|
|
702
|
-
let
|
|
747
|
+
l.forEach((e) => M.set(e.id, e));
|
|
748
|
+
let te = [...M.values()].map((t) => ({
|
|
703
749
|
value: t.id,
|
|
704
750
|
label: t.name,
|
|
705
|
-
labelNode: y.trim() ? /* @__PURE__ */
|
|
751
|
+
labelNode: y.trim() ? /* @__PURE__ */ L(p, {
|
|
706
752
|
text: t.name,
|
|
707
753
|
query: y,
|
|
708
754
|
maxLines: 1
|
|
709
755
|
}) : void 0,
|
|
710
|
-
icon: /* @__PURE__ */
|
|
756
|
+
icon: /* @__PURE__ */ L(e, {
|
|
711
757
|
size: c.SM,
|
|
712
758
|
initialsName: t.name
|
|
713
759
|
}),
|
|
714
|
-
disabled: !
|
|
715
|
-
})),
|
|
760
|
+
disabled: !u || s.includes(t.id)
|
|
761
|
+
})), P = {
|
|
716
762
|
...t({
|
|
717
|
-
"--ssf-text":
|
|
718
|
-
"--ssf-bg":
|
|
719
|
-
"--ssf-border":
|
|
720
|
-
"--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
|
|
721
769
|
}),
|
|
722
|
-
...
|
|
770
|
+
...g?.cssVars
|
|
723
771
|
};
|
|
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,
|
|
772
|
+
return /* @__PURE__ */ R("div", {
|
|
773
|
+
className: r("min-w-0", h, U.selectorField),
|
|
774
|
+
style: P,
|
|
775
|
+
children: [/* @__PURE__ */ L(T, {
|
|
776
|
+
tooltip: ee,
|
|
777
|
+
hideTooltip: u,
|
|
740
778
|
triggerClassName: "block w-full min-w-0",
|
|
741
|
-
children: /* @__PURE__ */
|
|
742
|
-
inert:
|
|
743
|
-
children: /* @__PURE__ */
|
|
779
|
+
children: /* @__PURE__ */ L("div", {
|
|
780
|
+
inert: d ? !0 : void 0,
|
|
781
|
+
children: /* @__PURE__ */ L(b, {
|
|
744
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,
|
|
745
803
|
searchable: !0,
|
|
746
|
-
open:
|
|
804
|
+
open: O,
|
|
747
805
|
onOpenChange: (e) => {
|
|
748
|
-
e
|
|
806
|
+
(!e || D) && v(e);
|
|
749
807
|
},
|
|
750
808
|
onSearchQueryChange: x,
|
|
751
809
|
value: i,
|
|
752
810
|
onChange: (e) => {
|
|
753
|
-
|
|
811
|
+
d || a(Array.isArray(e) ? e : [e]);
|
|
754
812
|
},
|
|
755
|
-
options:
|
|
756
|
-
placeholder:
|
|
757
|
-
labelProps: { label:
|
|
758
|
-
error:
|
|
759
|
-
|
|
760
|
-
searchPlaceholder:
|
|
761
|
-
emptyStateTitle: y.trim() ?
|
|
762
|
-
disabled:
|
|
763
|
-
invalid: !!
|
|
813
|
+
options: te,
|
|
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,
|
|
764
822
|
className: "w-full min-w-0",
|
|
765
|
-
fieldClassName: r(D ? "cursor-pointer" : "cursor-not-allowed", "--ssf-bg" in
|
|
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),
|
|
766
824
|
listClassName: "w-[min(var(--reference-width),calc(100vw-2rem))] max-w-full"
|
|
767
825
|
})
|
|
768
826
|
})
|
|
769
|
-
}),
|
|
770
|
-
id:
|
|
827
|
+
}), j && /* @__PURE__ */ L("span", {
|
|
828
|
+
id: w,
|
|
771
829
|
className: "sr-only",
|
|
772
|
-
children:
|
|
830
|
+
children: j
|
|
773
831
|
})]
|
|
774
832
|
});
|
|
775
833
|
};
|
|
776
834
|
//#endregion
|
|
777
|
-
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 };
|