@epam/ai-dial-skills 1.3.0-dev.16 → 1.3.0-dev.160
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 +380 -376
- 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,91 +1,95 @@
|
|
|
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 ee, IconEye 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 D, useMemo as O, useRef as k, useState as A } from "react";
|
|
4
|
+
import { IconBlocks as ee, IconEye as j, IconLock as M, IconStarFilled as N, IconTrash as te } from "@tabler/icons-react";
|
|
5
|
+
import { Fragment as ne, 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 re, DetailsPanel as R } from "@epam/ai-dial-catalog";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
|
-
var
|
|
9
|
+
var z = {
|
|
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
|
+
}, B = "max-h-[280px] max-w-[min(420px,calc(100vw-10px))] overflow-y-auto", V = /* @__PURE__ */ function(e) {
|
|
14
14
|
return e.Deleted = "deleted", e.NotShared = "not-shared", e;
|
|
15
|
-
}({}), H = ({ description: e, unsupportedMessage: t, unresolvedReason: n, deletedMessage:
|
|
15
|
+
}({}), H = ({ 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 === V.Deleted, t = e ?
|
|
18
|
-
return /* @__PURE__ */
|
|
17
|
+
let e = n === V.Deleted, t = e ? te : M, 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(j, {
|
|
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
|
}, U = ({ 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 = {} }) => {
|
|
54
|
-
let { viewDetailsLabel: f = "View details", unsupportedTooltipLabel:
|
|
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] = A(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] = A(null), [T, E] = A(null);
|
|
58
|
+
return D(() => {
|
|
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: B,
|
|
71
|
+
content: a == null ? i ? /* @__PURE__ */ P(H, { unsupportedMessage: p }) : /* @__PURE__ */ P(H, {
|
|
68
72
|
description: n,
|
|
69
73
|
viewDetailsLabel: f,
|
|
70
|
-
onViewDetails:
|
|
71
|
-
}) : /* @__PURE__ */
|
|
74
|
+
onViewDetails: x
|
|
75
|
+
}) : /* @__PURE__ */ P(H, {
|
|
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, z.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
|
})
|
|
@@ -101,128 +105,128 @@ var B = {
|
|
|
101
105
|
rowLeaving: "_rowLeaving_1v431_32",
|
|
102
106
|
rowFadeOut: "_rowFadeOut_1v431_1",
|
|
103
107
|
listContent: "_listContent_1v431_60"
|
|
104
|
-
},
|
|
105
|
-
let { myCollectionLabel:
|
|
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 =
|
|
108
|
+
}, ie = "px-3 pb-0.5 pt-2", ae = 180, G = 288, K = ({ 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: O = "My Collection", emptyHintLabel: ee = "Star a skill to pin it here", browseLabel: j = "Browse", removeFromFavoritesLabel: M = "Remove from favorites", viewDetailsLabel: te = "View details", noMatchingSkillsLabel: ne = "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, re] = A(/* @__PURE__ */ new Set()), R = k(/* @__PURE__ */ new Map());
|
|
116
|
+
T(() => {
|
|
117
|
+
let e = R.current;
|
|
114
118
|
return () => {
|
|
115
119
|
e.forEach((e) => clearTimeout(e)), e.clear();
|
|
116
120
|
};
|
|
117
121
|
}, []);
|
|
118
|
-
let V =
|
|
122
|
+
let V = g != null, U = v && !V, K = V || U ? "none" : void 0, q = "button";
|
|
119
123
|
V ? q = "option" : U && (q = "menuitem");
|
|
120
|
-
let J =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}, [n,
|
|
124
|
-
let
|
|
124
|
+
let J = E(), oe = h != null, Y = h?.toLowerCase() ?? "", X = oe ? n.filter((e) => e.name.toLowerCase().includes(Y)) : n, Z = k(null), [se, ce] = A();
|
|
125
|
+
D(() => {
|
|
126
|
+
Z.current && ce(Math.min(Z.current.scrollHeight, G));
|
|
127
|
+
}, [n, h]);
|
|
128
|
+
let le = (e, t) => {
|
|
125
129
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i(t));
|
|
126
|
-
},
|
|
127
|
-
|
|
130
|
+
}, ue = (e) => {
|
|
131
|
+
re((t) => new Set(t).add(e));
|
|
128
132
|
let t = setTimeout(() => {
|
|
129
|
-
a?.(e),
|
|
133
|
+
a?.(e), re((t) => {
|
|
130
134
|
let n = new Set(t);
|
|
131
135
|
return n.delete(e), n;
|
|
132
|
-
}),
|
|
133
|
-
},
|
|
134
|
-
|
|
136
|
+
}), R.current.delete(e);
|
|
137
|
+
}, ae);
|
|
138
|
+
R.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, z.favoritesPanel),
|
|
142
|
+
style: I,
|
|
139
143
|
children: [
|
|
140
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ P("p", {
|
|
141
145
|
id: J,
|
|
142
|
-
className: r(
|
|
143
|
-
children:
|
|
146
|
+
className: r(C, ie, W.header),
|
|
147
|
+
children: O
|
|
144
148
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ P("div", {
|
|
146
150
|
className: r("max-h-72 min-h-0 flex-1 overflow-y-auto", W.listContent),
|
|
147
|
-
style: { maxHeight:
|
|
148
|
-
children: /* @__PURE__ */
|
|
149
|
-
ref:
|
|
150
|
-
children:
|
|
151
|
-
id:
|
|
151
|
+
style: { maxHeight: se },
|
|
152
|
+
children: /* @__PURE__ */ P("div", {
|
|
153
|
+
ref: Z,
|
|
154
|
+
children: X.length > 0 ? /* @__PURE__ */ P("ul", {
|
|
155
|
+
id: g,
|
|
152
156
|
role: V ? "listbox" : K,
|
|
153
157
|
"aria-labelledby": V ? J : void 0,
|
|
154
158
|
className: "flex flex-col gap-1 px-1 pb-1",
|
|
155
|
-
children:
|
|
156
|
-
let n = V ? `${
|
|
159
|
+
children: X.map((t) => {
|
|
160
|
+
let n = V ? `${g}-${encodeURIComponent(t.id)}` : void 0, o = V ? -1 : void 0, u = /* @__PURE__ */ F("div", {
|
|
157
161
|
role: q,
|
|
158
162
|
id: n,
|
|
159
|
-
"aria-selected": V ? n ===
|
|
163
|
+
"aria-selected": V ? 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", W.row,
|
|
166
|
+
className: r("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors", W.row, d),
|
|
163
167
|
onClick: () => i(t),
|
|
164
|
-
onKeyDown: (e) =>
|
|
168
|
+
onKeyDown: (e) => le(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(N, {
|
|
181
185
|
size: c.SM,
|
|
182
186
|
className: W.star,
|
|
183
187
|
"aria-hidden": !0
|
|
184
188
|
}),
|
|
185
|
-
"aria-label":
|
|
189
|
+
"aria-label": M,
|
|
186
190
|
isSelected: !0,
|
|
187
191
|
tabIndex: o,
|
|
188
192
|
onClick: (e) => {
|
|
189
|
-
e.stopPropagation(),
|
|
193
|
+
e.stopPropagation(), ue(t.id);
|
|
190
194
|
}
|
|
191
195
|
})
|
|
192
196
|
]
|
|
193
197
|
});
|
|
194
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ P("li", {
|
|
195
199
|
role: K,
|
|
196
|
-
className:
|
|
197
|
-
children: s ? /* @__PURE__ */
|
|
200
|
+
className: L.has(t.id) ? W.rowLeaving : W.rowEnter,
|
|
201
|
+
children: s && !l ? /* @__PURE__ */ P(m, {
|
|
198
202
|
asChild: !0,
|
|
199
|
-
contentClassName:
|
|
200
|
-
content: /* @__PURE__ */
|
|
203
|
+
contentClassName: B,
|
|
204
|
+
content: /* @__PURE__ */ P(H, {
|
|
201
205
|
description: t.description,
|
|
202
|
-
viewDetailsLabel:
|
|
206
|
+
viewDetailsLabel: te,
|
|
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
|
+
}) : oe && Y !== "" ? /* @__PURE__ */ P("p", {
|
|
211
215
|
role: "status",
|
|
212
216
|
"aria-live": "polite",
|
|
213
|
-
className: r(
|
|
214
|
-
children:
|
|
215
|
-
}) : /* @__PURE__ */
|
|
216
|
-
className: r(
|
|
217
|
+
className: r(w, "px-4 py-4 text-start", W.emptyHint),
|
|
218
|
+
children: ne
|
|
219
|
+
}) : /* @__PURE__ */ P("p", {
|
|
220
|
+
className: r(w, "px-4 py-4 text-start", W.emptyHint),
|
|
217
221
|
children: ee
|
|
218
222
|
})
|
|
219
223
|
})
|
|
220
224
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ P("div", {
|
|
222
226
|
className: r("border-t px-2 py-3", W.footer),
|
|
223
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ P(f, {
|
|
224
228
|
role: U ? "menuitem" : void 0,
|
|
225
|
-
label:
|
|
229
|
+
label: j,
|
|
226
230
|
className: "w-full justify-center",
|
|
227
231
|
onClick: o
|
|
228
232
|
})
|
|
@@ -230,20 +234,20 @@ var B = {
|
|
|
230
234
|
]
|
|
231
235
|
});
|
|
232
236
|
}, q = ".zip,.md", J = ({ isOpen: e, errorText: t, isUploading: n = !1, accept: r = q, labels: i, onClose: a, onFilesSelected: o, onFilesRejected: s }) => {
|
|
233
|
-
let { dialogTitle: c = "Upload skill", dropZoneLabel: l = "Drag and drop it or click here to upload", dropZoneMobileLabel:
|
|
234
|
-
return /* @__PURE__ */
|
|
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(ne, { 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
|
+
}, oe = ({ 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
|
-
}),
|
|
278
|
+
}), Y = (e, t = null) => e.map((e) => e.type === re.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
|
-
items:
|
|
284
|
+
items: Y(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
|
-
}),
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
291
|
+
}), X = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => {
|
|
292
|
+
let s = O(() => Y(e), [e]), c = O(() => 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
|
+
}, Z = (e) => /* @__PURE__ */ P(R, {
|
|
304
311
|
...e,
|
|
305
|
-
renderContentFileTree: (e) => /* @__PURE__ */
|
|
306
|
-
}),
|
|
312
|
+
renderContentFileTree: (e) => /* @__PURE__ */ P(X, { ...e })
|
|
313
|
+
}), se = (e) => e == null || /[\s/]/.test(e), ce = (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 (se(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
|
+
}, le = (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) && se(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
|
+
}, ue = (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
|
+
}, de = (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
|
+
}, Q = (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
|
+
}, fe = (e, t) => e.find((e) => e.start + e.length === t), pe = (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
|
+
}, me = (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
|
-
},
|
|
383
|
-
let [e, t] =
|
|
389
|
+
}, he = () => {
|
|
390
|
+
let [e, t] = A(""), [n, r] = A([]), i = k(e);
|
|
384
391
|
i.current = e;
|
|
385
|
-
let a =
|
|
392
|
+
let a = k(n);
|
|
386
393
|
a.current = n;
|
|
387
|
-
let o =
|
|
388
|
-
let n =
|
|
394
|
+
let o = k(null), s = w((e) => {
|
|
395
|
+
let n = ue(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 : me(e, n, a.text);
|
|
391
398
|
r((t) => {
|
|
392
|
-
let r =
|
|
399
|
+
let r = de(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) => Q(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) => Q(t, a, e, n, !1));
|
|
413
|
+
}, []), u = w((e) => fe(a.current, e), []), d = O(() => {
|
|
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 = ce(e, a, i);
|
|
417
424
|
t(e), r(o.map((e) => {
|
|
418
425
|
let t = a[e.skillIndex];
|
|
419
426
|
return {
|
|
@@ -424,7 +431,7 @@ var B = {
|
|
|
424
431
|
};
|
|
425
432
|
}));
|
|
426
433
|
}, []);
|
|
427
|
-
return
|
|
434
|
+
return O(() => ({
|
|
428
435
|
draft: e,
|
|
429
436
|
anchors: n,
|
|
430
437
|
onDraftChange: s,
|
|
@@ -447,18 +454,18 @@ var B = {
|
|
|
447
454
|
p,
|
|
448
455
|
m
|
|
449
456
|
]);
|
|
450
|
-
},
|
|
457
|
+
}, ge = (e) => ({
|
|
451
458
|
id: e.url,
|
|
452
459
|
name: e.name,
|
|
453
460
|
description: e.description
|
|
454
|
-
}),
|
|
461
|
+
}), $ = (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 ? V.Deleted : V.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 ?? {}, [D, j] = A(!1), [M, N] = A(null), [te, ne] = A(0), F = k(null), [I, L] = A(0), [re, R] = A(void 0), z = he(), B = O(() => [
|
|
462
469
|
...t,
|
|
463
470
|
...n ?? [],
|
|
464
471
|
...r ?? []
|
|
@@ -466,253 +473,260 @@ var B = {
|
|
|
466
473
|
t,
|
|
467
474
|
n,
|
|
468
475
|
r
|
|
469
|
-
]),
|
|
476
|
+
]), V = O(() => new Map(B.map((e) => [e.url, e])), [B]), H = w((e) => V.get(e)?.name ?? $(e), [V]), W = O(() => B.filter((e) => a.has(e.url)).map((e) => ge(e)), [B, a]), ie = z.anchors.length > 0 && !e, ae = O(() => z.anchors.map((t) => ({
|
|
470
477
|
start: t.start,
|
|
471
478
|
length: t.length,
|
|
472
479
|
isUnsupported: !e,
|
|
473
|
-
render: () => /* @__PURE__ */
|
|
480
|
+
render: () => /* @__PURE__ */ P(U, {
|
|
474
481
|
name: t.name,
|
|
475
482
|
path: t.url,
|
|
476
483
|
labelClassName: d,
|
|
477
|
-
description:
|
|
484
|
+
description: V.get(t.url)?.description,
|
|
478
485
|
isUnsupported: !e,
|
|
479
486
|
detailsTrigger: f,
|
|
480
|
-
onViewDetails:
|
|
487
|
+
onViewDetails: N,
|
|
481
488
|
labels: {
|
|
482
|
-
viewDetailsLabel:
|
|
483
|
-
unsupportedTooltipLabel:
|
|
489
|
+
viewDetailsLabel: E?.viewDetailsLabel,
|
|
490
|
+
unsupportedTooltipLabel: T
|
|
484
491
|
}
|
|
485
492
|
})
|
|
486
493
|
})), [
|
|
487
|
-
|
|
494
|
+
z.anchors,
|
|
488
495
|
e,
|
|
489
|
-
|
|
496
|
+
V,
|
|
490
497
|
d,
|
|
491
498
|
f,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
]),
|
|
495
|
-
let r =
|
|
496
|
-
|
|
497
|
-
}, [
|
|
498
|
-
let t =
|
|
499
|
-
return t == null ? e : (
|
|
500
|
-
}, [
|
|
501
|
-
let t =
|
|
499
|
+
E,
|
|
500
|
+
T
|
|
501
|
+
]), G = w((e, t, n) => {
|
|
502
|
+
let r = z.insertMention(e, t, n);
|
|
503
|
+
L((e) => e + 1), R(n + 1 + t.length + +!!r);
|
|
504
|
+
}, [z]), q = w((e) => {
|
|
505
|
+
let t = pe(z.draft, e, ye);
|
|
506
|
+
return t == null ? e : (z.onDraftChange(z.draft.slice(0, t.start) + z.draft.slice(t.end)), t.start);
|
|
507
|
+
}, [z]), J = w((e) => {
|
|
508
|
+
let t = pe(z.draft, e, ye);
|
|
502
509
|
if (t == null) return;
|
|
503
|
-
let n =
|
|
510
|
+
let n = z.anchors.find((e) => e.start === t.start && e.start + e.length === t.end);
|
|
504
511
|
return {
|
|
505
512
|
position: t.start,
|
|
506
|
-
text:
|
|
513
|
+
text: z.draft.slice(t.start, t.end),
|
|
507
514
|
mentionUrl: n?.url
|
|
508
515
|
};
|
|
509
|
-
}, [
|
|
510
|
-
|
|
511
|
-
}, [
|
|
512
|
-
|
|
516
|
+
}, [z]), Y = w(() => {
|
|
517
|
+
z.reset(), L((e) => e + 1), R(void 0);
|
|
518
|
+
}, [z]), { expectInsertion: X } = z, Z = w((t) => {
|
|
519
|
+
X(t, e ? le(t, B) : []);
|
|
513
520
|
}, [
|
|
514
|
-
|
|
521
|
+
X,
|
|
515
522
|
e,
|
|
516
|
-
|
|
517
|
-
]),
|
|
518
|
-
|
|
519
|
-
}, [
|
|
523
|
+
B
|
|
524
|
+
]), se = w((e, t) => {
|
|
525
|
+
z.seedFromMessage(e, t, H), L((e) => e + 1), R(void 0);
|
|
526
|
+
}, [z, H]), ue = w((e, t) => {
|
|
520
527
|
if (t == null || t.length === 0) return null;
|
|
521
|
-
let n =
|
|
528
|
+
let n = ce(e, t, H), 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 =
|
|
525
|
-
r.push(
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
531
|
+
let a = t[n.skillIndex], s = V.get(a.url), c = s?.name ?? $(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(U, {
|
|
535
|
+
name: c,
|
|
536
|
+
path: a.url,
|
|
537
|
+
labelClassName: u,
|
|
538
|
+
description: s?.description,
|
|
539
|
+
unresolvedReason: l,
|
|
540
|
+
detailsTrigger: p,
|
|
541
|
+
onViewDetails: N,
|
|
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
|
-
W,
|
|
542
551
|
H,
|
|
552
|
+
V,
|
|
543
553
|
u,
|
|
544
554
|
p,
|
|
545
|
-
|
|
555
|
+
E,
|
|
546
556
|
o,
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
]),
|
|
550
|
-
let t =
|
|
551
|
-
return /* @__PURE__ */
|
|
557
|
+
x,
|
|
558
|
+
S
|
|
559
|
+
]), de = w((e) => e == null || e.length === 0 ? null : e.map((e) => {
|
|
560
|
+
let t = V.get(e.url), n = t?.name ?? $(e.url), r = t == null ? ve(e.url, o) : void 0;
|
|
561
|
+
return /* @__PURE__ */ P(U, {
|
|
552
562
|
name: n,
|
|
553
563
|
path: e.url,
|
|
554
564
|
labelClassName: u,
|
|
555
565
|
description: t?.description,
|
|
556
566
|
unresolvedReason: r,
|
|
557
567
|
detailsTrigger: p,
|
|
558
|
-
onViewDetails:
|
|
568
|
+
onViewDetails: N,
|
|
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
|
+
V,
|
|
567
577
|
u,
|
|
568
578
|
p,
|
|
569
|
-
|
|
579
|
+
E,
|
|
570
580
|
o,
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
]),
|
|
574
|
-
favorites:
|
|
581
|
+
x,
|
|
582
|
+
S
|
|
583
|
+
]), Q = w((e, t) => /* @__PURE__ */ P(K, {
|
|
584
|
+
favorites: W,
|
|
575
585
|
isMenu: !0,
|
|
576
586
|
onSelect: (n) => {
|
|
577
|
-
|
|
587
|
+
G(n.id, n.name, q(t)), e();
|
|
578
588
|
},
|
|
579
589
|
onToggleFavorite: s,
|
|
580
590
|
onBrowse: () => {
|
|
581
|
-
let n =
|
|
582
|
-
|
|
591
|
+
let n = J(t), r = q(t);
|
|
592
|
+
ne(r), F.current = n ?? null, e(), j(!0);
|
|
583
593
|
},
|
|
584
594
|
onViewDetails: (n) => {
|
|
585
|
-
|
|
595
|
+
q(t), e(), N(n.id);
|
|
586
596
|
},
|
|
587
|
-
|
|
597
|
+
isRowTooltipHidden: m,
|
|
598
|
+
labels: E
|
|
588
599
|
}), [
|
|
600
|
+
W,
|
|
589
601
|
G,
|
|
590
602
|
q,
|
|
591
603
|
J,
|
|
592
|
-
X,
|
|
593
604
|
s,
|
|
594
|
-
|
|
595
|
-
|
|
605
|
+
m,
|
|
606
|
+
E
|
|
607
|
+
]), fe = O(() => e ? {
|
|
608
|
+
key: "skills",
|
|
609
|
+
title: _,
|
|
610
|
+
icon: /* @__PURE__ */ P(ee, {
|
|
611
|
+
size: i,
|
|
612
|
+
"aria-hidden": !0,
|
|
613
|
+
stroke: l
|
|
614
|
+
}),
|
|
615
|
+
renderOverlay: Q,
|
|
616
|
+
backLabel: v
|
|
617
|
+
} : void 0, [
|
|
618
|
+
e,
|
|
619
|
+
_,
|
|
620
|
+
v,
|
|
621
|
+
Q
|
|
622
|
+
]), me = O(() => e ? {
|
|
623
|
+
triggerPrefix: ye,
|
|
624
|
+
menuLabel: _,
|
|
625
|
+
emptyQueryHint: b,
|
|
626
|
+
onTextPaste: Z,
|
|
627
|
+
renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ P(K, {
|
|
628
|
+
favorites: W,
|
|
629
|
+
searchQuery: e,
|
|
630
|
+
listboxId: r,
|
|
631
|
+
activeOptionId: i,
|
|
632
|
+
onSelect: (e) => {
|
|
633
|
+
n({ consumeQuery: !0 }), G(e.id, e.name, t);
|
|
634
|
+
},
|
|
635
|
+
onToggleFavorite: s,
|
|
636
|
+
onBrowse: () => {
|
|
637
|
+
let r = `${ye}${e}`, i = z.anchors.find((e) => e.start === t && e.length === r.length);
|
|
638
|
+
n({
|
|
639
|
+
consumeQuery: !0,
|
|
640
|
+
returnFocus: !1
|
|
641
|
+
}), ne(t), F.current = {
|
|
642
|
+
position: t,
|
|
643
|
+
text: r,
|
|
644
|
+
mentionUrl: i?.url
|
|
645
|
+
}, j(!0);
|
|
646
|
+
},
|
|
647
|
+
onViewDetails: (e) => {
|
|
648
|
+
n({ consumeQuery: !0 }), N(e.id);
|
|
649
|
+
},
|
|
650
|
+
isRowTooltipHidden: m,
|
|
651
|
+
labels: E
|
|
652
|
+
})
|
|
653
|
+
} : void 0, [
|
|
654
|
+
e,
|
|
655
|
+
_,
|
|
656
|
+
b,
|
|
657
|
+
W,
|
|
658
|
+
G,
|
|
659
|
+
z.anchors,
|
|
660
|
+
s,
|
|
661
|
+
m,
|
|
662
|
+
E,
|
|
663
|
+
Z
|
|
664
|
+
]), _e = w(() => {
|
|
665
|
+
j(!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 ? z.onDraftChange(z.draft.slice(0, t) + n + z.draft.slice(t)) : z.restoreMention(r, n.slice(1), t), L((e) => e + 1), R(t + n.length);
|
|
670
|
+
}, [z]);
|
|
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: fe,
|
|
673
|
+
commandMenu: me,
|
|
674
|
+
skillCatalogModal: /* @__PURE__ */ P(oe, {
|
|
675
|
+
isOpen: D,
|
|
676
|
+
onClose: _e,
|
|
663
677
|
onSelect: (e) => {
|
|
664
|
-
|
|
678
|
+
F.current = null, G(e, H(e), te), j(!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__ */
|
|
672
|
-
skillId:
|
|
673
|
-
onClose: () =>
|
|
685
|
+
children: /* @__PURE__ */ P(g, {
|
|
686
|
+
skillId: M,
|
|
687
|
+
onClose: () => N(null)
|
|
674
688
|
})
|
|
675
689
|
}),
|
|
676
|
-
message:
|
|
677
|
-
messageRevision:
|
|
678
|
-
activeMentions:
|
|
679
|
-
onDraftChange:
|
|
680
|
-
onBackspaceAtCaret:
|
|
681
|
-
caretPositionOverride:
|
|
682
|
-
isSkillUnsupported:
|
|
683
|
-
selectedSkills:
|
|
684
|
-
resetSkillMentions:
|
|
685
|
-
seedSkillMentions:
|
|
686
|
-
recognizeMentionsInInsertion:
|
|
687
|
-
renderHistorySkillSegments:
|
|
688
|
-
renderHistorySkills:
|
|
690
|
+
message: z.draft,
|
|
691
|
+
messageRevision: I,
|
|
692
|
+
activeMentions: ae,
|
|
693
|
+
onDraftChange: z.onDraftChange,
|
|
694
|
+
onBackspaceAtCaret: z.onBackspaceAtCaret,
|
|
695
|
+
caretPositionOverride: re,
|
|
696
|
+
isSkillUnsupported: ie,
|
|
697
|
+
selectedSkills: z.orderedSkills,
|
|
698
|
+
resetSkillMentions: Y,
|
|
699
|
+
seedSkillMentions: se,
|
|
700
|
+
recognizeMentionsInInsertion: Z,
|
|
701
|
+
renderHistorySkillSegments: ue,
|
|
702
|
+
renderHistorySkills: de
|
|
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, _] = A(!1), [y, b] = A(""), S = E(), C = i.some((e) => n(e, l)), w = l && !u, T = g && w, D = i.length > 0 ? f.unsupportedTooltipLabel : void 0, O = !l && i.length === 0, k = O ? f.unavailableHintLabel ?? Ce : void 0, ee = 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) => ee.set(e.id, e));
|
|
716
|
+
let j = [...ee.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
|
+
})), M = {
|
|
716
730
|
...t({
|
|
717
731
|
"--ssf-text": h?.colors?.text,
|
|
718
732
|
"--ssf-bg": h?.colors?.background,
|
|
@@ -721,57 +735,47 @@ var B = {
|
|
|
721
735
|
}),
|
|
722
736
|
...h?.cssVars
|
|
723
737
|
};
|
|
724
|
-
return
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
C,
|
|
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,
|
|
738
|
+
return /* @__PURE__ */ F("div", {
|
|
739
|
+
className: r("min-w-0", m, z.selectorField),
|
|
740
|
+
style: M,
|
|
741
|
+
children: [/* @__PURE__ */ P(x, {
|
|
742
|
+
tooltip: D,
|
|
739
743
|
hideTooltip: l,
|
|
740
744
|
triggerClassName: "block w-full min-w-0",
|
|
741
|
-
children: /* @__PURE__ */
|
|
745
|
+
children: /* @__PURE__ */ P("div", {
|
|
742
746
|
inert: u ? !0 : void 0,
|
|
743
|
-
children: /* @__PURE__ */
|
|
747
|
+
children: /* @__PURE__ */ P(v, {
|
|
744
748
|
multiple: !0,
|
|
745
749
|
searchable: !0,
|
|
746
|
-
open:
|
|
750
|
+
open: T,
|
|
747
751
|
onOpenChange: (e) => {
|
|
748
|
-
e
|
|
752
|
+
(!e || w) && _(e);
|
|
749
753
|
},
|
|
750
|
-
onSearchQueryChange:
|
|
754
|
+
onSearchQueryChange: b,
|
|
751
755
|
value: i,
|
|
752
756
|
onChange: (e) => {
|
|
753
757
|
u || a(Array.isArray(e) ? e : [e]);
|
|
754
758
|
},
|
|
755
|
-
options:
|
|
756
|
-
placeholder:
|
|
757
|
-
labelProps: { label:
|
|
759
|
+
options: j,
|
|
760
|
+
placeholder: f.placeholder,
|
|
761
|
+
labelProps: { label: f.fieldLabel },
|
|
758
762
|
error: d,
|
|
759
|
-
|
|
760
|
-
searchPlaceholder:
|
|
761
|
-
emptyStateTitle: y.trim() ?
|
|
762
|
-
disabled: u ||
|
|
763
|
-
invalid: !!d ||
|
|
763
|
+
ariaDescribedBy: k ? S : void 0,
|
|
764
|
+
searchPlaceholder: f.searchPlaceholder ?? "Search skills",
|
|
765
|
+
emptyStateTitle: y.trim() ? f.noMatchingSkillsLabel ?? "No matching skills" : f.emptyLabel ?? "No skills available",
|
|
766
|
+
disabled: u || O,
|
|
767
|
+
invalid: !!d || C,
|
|
764
768
|
className: "w-full min-w-0",
|
|
765
|
-
fieldClassName: r(
|
|
769
|
+
fieldClassName: r(w ? "cursor-pointer" : "cursor-not-allowed", "--ssf-bg" in M && xe.background, "--ssf-border" in M && xe.border, "--ssf-text" in M && xe.value, (d || C) && xe.invalid, h?.typography?.fontClassName ?? "dial-small-text", h?.triggerClassName),
|
|
766
770
|
listClassName: "w-[min(var(--reference-width),calc(100vw-2rem))] max-w-full"
|
|
767
771
|
})
|
|
768
772
|
})
|
|
769
|
-
}),
|
|
770
|
-
id:
|
|
773
|
+
}), k && /* @__PURE__ */ P("span", {
|
|
774
|
+
id: S,
|
|
771
775
|
className: "sr-only",
|
|
772
|
-
children:
|
|
776
|
+
children: k
|
|
773
777
|
})]
|
|
774
778
|
});
|
|
775
779
|
};
|
|
776
780
|
//#endregion
|
|
777
|
-
export { U as ChatSkill, K as FavoriteSkillsPanel,
|
|
781
|
+
export { U as ChatSkill, K as FavoriteSkillsPanel, z as SKILLS_CLASS, J as SkillArchiveUploadDialog, oe as SkillCatalogModal, X as SkillContentFileTree, Z as SkillDetailsSidePanel, H as SkillInfoTooltipContent, we as SkillSelectorField, V as SkillUnresolvedReason, ge as buildFavoriteSkillItem, ue as diffTextChange, fe as findMentionAtCaret, $ as getSkillFallbackName, Q as insertAnchor, ce as matchSkillMentions, de as reconcileAnchors, he as useSkillMentions, be as useSkillSelectorOverlay };
|