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