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