@epam/ai-dial-skills 1.3.0-dev.6 → 1.3.0-dev.61
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/SkillCatalogModal/SkillCatalogModal.d.ts.map +1 -1
- package/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +166 -157
- package/models/skill-selector-overlay.d.ts +5 -4
- package/models/skill-selector-overlay.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatSkill.d.ts","sourceRoot":"","sources":["../../../src/components/ChatSkill/ChatSkill.tsx"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"ChatSkill.d.ts","sourceRoot":"","sources":["../../../src/components/ChatSkill/ChatSkill.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA6B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAGpE;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAyJxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkillCatalogModal.d.ts","sourceRoot":"","sources":["../../../src/components/SkillCatalogModal/SkillCatalogModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAErF,mHAAmH;AACnH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"SkillCatalogModal.d.ts","sourceRoot":"","sources":["../../../src/components/SkillCatalogModal/SkillCatalogModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAErF,mHAAmH;AACnH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAuBxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSkillSelectorOverlay.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,qCAAqC,CAAC;AAsB7C;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,iSAerC,8BAA8B,KAAG,
|
|
1
|
+
{"version":3,"file":"useSkillSelectorOverlay.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,qCAAqC,CAAC;AAsB7C;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,iSAerC,8BAA8B,KAAG,6BAmjBnC,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
._row_1v431_1:hover,._row_1v431_1:focus-visible,._row_1v431_1[aria-selected=true]{background:var(--fs-row-hover-bg,var(--bg-layer-sunken,#eef1f7))}._header_1v431_8{color:var(--fs-header-text,var(--text-tertiary,#848e9c))}._emptyHint_1v431_12{color:var(--fs-empty-hint-text,var(--text-icon-tertiary,#848e9c))}._star_1v431_16{color:var(--fs-star-color,var(--text-warning-icon,#eec840))}._footer_1v431_20{border-top-color:var(--fs-footer-border,var(--stroke-tertiary,#e0e6f0))}._rowEnter_1v431_28{animation:.2s ease-out _rowFadeIn_1v431_1}._rowLeaving_1v431_32{pointer-events:none;animation:.18s ease-out forwards _rowFadeOut_1v431_1}@keyframes _rowFadeIn_1v431_1{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes _rowFadeOut_1v431_1{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}._listContent_1v431_60{transition:max-height .2s}@media (prefers-reduced-motion:reduce){._rowEnter_1v431_28,._rowLeaving_1v431_32{animation:none}._listContent_1v431_60{transition:none}}._background_1ult0_1{background:var(--ssf-bg)}._border_1ult0_5{border-color:var(--ssf-border)}._value_1ult0_9{color:var(--ssf-text)}._clear_1ult0_13{margin-block:-.5rem}._invalid_1ult0_17{color:var(--ssf-error,var(--text-error,#ae2f2f));border-color:var(--ssf-error,var(--text-error,#ae2f2f))}._invalid_1ult0_17 input{color:var(--ssf-error,var(--text-error,#ae2f2f))}
|
|
2
|
-
/*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.top-0{top:0}.-me-1{margin-inline-end:-.25rem}.-ms-1{margin-inline-start:-.25rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-\[24px\]{height:24px}.h-\[min\(80vh\2c 840px\)\]{height:min(80vh,840px)}.h-\[min\(90vh\2c 860px\)\]{height:min(90vh,860px)}.max-h-72{max-height:18rem}.min-h-0{min-height:0}.w-\[min\(var\(--reference-width\)\2c calc\(100vw-2rem\)\)\]{width:min(var(--reference-width),calc(100vw - 2rem))}.w-full{width:100%}.min-w-0{min-width:0}.\!max-w-\[min\(95vw\2c 1200px\)\]{max-width:min(95vw,1200px)!important}.max-w-\[550px\]{max-width:550px}.max-w-\[min\(550px\2c calc\(100vw-10px\)\)\]{max-width:min(550px,calc(100vw - 10px))}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.self-start{align-self:flex-start}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-t{border-top-width:1px}.border-transparent{border-color:transparent}.bg-error{background-color:var(--bg-error,#f3d6d8)}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.pb-0\.5{padding-bottom:.125rem}.pb-1{padding-bottom:.25rem}.pe-1{padding-inline-end:.25rem}.ps-1{padding-inline-start:.25rem}.pt-2{padding-top:.5rem}.text-start{text-align:start}.text-accent{color:var(--text-accent,#1d4ed8)}.text-error{color:var(--text-error,#ae2f2f)}.text-primary{color:var(--text-primary,#161b2d)}.text-secondary{color:var(--text-secondary,#57647a)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\:bg-info:hover{background-color:var(--bg-info,#e1eaf9)}.focus-visible\:bg-info:focus-visible{background-color:var(--bg-info,#e1eaf9)}.active\:bg-info:active{background-color:var(--bg-info,#e1eaf9)}@media (min-width:1280px){.desktop\:inline{display:inline}.desktop\:hidden{display:none}.desktop\:w-\[280px\]{width:280px}}
|
|
2
|
+
/*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.top-0{top:0}.-me-1{margin-inline-end:-.25rem}.-ms-1{margin-inline-start:-.25rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-\[24px\]{height:24px}.h-\[min\(80vh\2c 840px\)\]{height:min(80vh,840px)}.h-\[min\(90vh\2c 860px\)\]{height:min(90vh,860px)}.max-h-72{max-height:18rem}.min-h-0{min-height:0}.w-\[min\(var\(--reference-width\)\2c calc\(100vw-2rem\)\)\]{width:min(var(--reference-width),calc(100vw - 2rem))}.w-full{width:100%}.min-w-0{min-width:0}.\!max-w-\[min\(95vw\2c 1200px\)\]{max-width:min(95vw,1200px)!important}.max-w-\[550px\]{max-width:550px}.max-w-\[min\(550px\2c calc\(100vw-10px\)\)\]{max-width:min(550px,calc(100vw - 10px))}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.self-start{align-self:flex-start}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-t{border-top-width:1px}.border-transparent{border-color:transparent}.bg-error{background-color:var(--bg-error,#f3d6d8)}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.pb-0\.5{padding-bottom:.125rem}.pb-1{padding-bottom:.25rem}.pe-1{padding-inline-end:.25rem}.ps-1{padding-inline-start:.25rem}.pt-2{padding-top:.5rem}.text-start{text-align:start}.text-accent{color:var(--text-accent,#1d4ed8)}.text-error{color:var(--text-error,#ae2f2f)}.text-primary{color:var(--text-primary,#161b2d)}.text-secondary{color:var(--text-secondary,#57647a)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\:bg-info:hover{background-color:var(--bg-info,#e1eaf9)}.focus-visible\:bg-info:focus-visible{background-color:var(--bg-info,#e1eaf9)}.active\:bg-info:active{background-color:var(--bg-info,#e1eaf9)}@media (max-width:1279px){.mobile\:h-full{height:100%}.mobile\:\!max-w-full{max-width:100%!important}.mobile\:rounded-none{border-radius:0}.mobile\:p-0{padding:0}}@media (min-width:1280px){.desktop\:inline{display:inline}.desktop\:hidden{display:none}.desktop\:w-\[280px\]{width:280px}}
|
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DeploymentIcon as e, buildCssVars as t, isSkillSelectionUnsupported as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
|
|
2
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, FileDropzone as u, GhostButton as d, Highlight as f, InteractiveTooltip as p, InteractiveTooltipTrigger as m, Popup as h, PopupSize as g, Select as _, Spinner as v, ToggleIconButton as y, Tooltip 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
|
|
4
|
-
import { IconBlocks as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { DialFileNodeType as
|
|
7
|
-
import { CatalogContentNodeType as
|
|
3
|
+
import { Suspense as S, useCallback as C, useEffect as w, useId as T, useLayoutEffect as ee, useMemo as E, useRef as D, useState as O } from "react";
|
|
4
|
+
import { IconBlocks as te, IconEye as k, IconLock as A, IconStarFilled as j, IconTrash as M } 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",
|
|
@@ -14,31 +14,31 @@ var B = {
|
|
|
14
14
|
return e.Deleted = "deleted", e.NotShared = "not-shared", e;
|
|
15
15
|
}({}), H = ({ description: e, unsupportedMessage: t, unresolvedReason: n, deletedMessage: r, notSharedMessage: i, viewDetailsLabel: u = "View details", onViewDetails: d, viewDetailsTabIndex: f }) => {
|
|
16
16
|
if (n != null) {
|
|
17
|
-
let e = n === V.Deleted, t = e ?
|
|
18
|
-
return /* @__PURE__ */
|
|
17
|
+
let e = n === V.Deleted, t = e ? M : A, a = e ? r : i;
|
|
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__ */
|
|
25
|
+
}), /* @__PURE__ */ P("p", {
|
|
26
26
|
className: "dial-tiny-text 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__ */
|
|
33
|
+
children: [e != null && e !== "" && /* @__PURE__ */ P("p", {
|
|
34
34
|
className: "text-start",
|
|
35
35
|
children: e
|
|
36
|
-
}), /* @__PURE__ */
|
|
36
|
+
}), /* @__PURE__ */ P(a, {
|
|
37
37
|
variant: s.Primary,
|
|
38
38
|
appearance: o.Link,
|
|
39
39
|
className: "h-[24px] self-start",
|
|
40
40
|
label: u,
|
|
41
|
-
iconBefore: /* @__PURE__ */
|
|
41
|
+
iconBefore: /* @__PURE__ */ P(k, {
|
|
42
42
|
size: c.SM,
|
|
43
43
|
stroke: l,
|
|
44
44
|
"aria-hidden": !0
|
|
@@ -46,46 +46,49 @@ var B = {
|
|
|
46
46
|
onClick: d,
|
|
47
47
|
tabIndex: f
|
|
48
48
|
})]
|
|
49
|
-
}) : /* @__PURE__ */
|
|
49
|
+
}) : /* @__PURE__ */ P("p", {
|
|
50
50
|
className: "text-start",
|
|
51
51
|
children: t
|
|
52
52
|
});
|
|
53
53
|
}, 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: h = "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] =
|
|
54
|
+
let { viewDetailsLabel: f = "View details", unsupportedTooltipLabel: h = "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] = O(0), b = l === "click", S = () => {
|
|
55
55
|
y((e) => e + 1), u(t);
|
|
56
|
-
}, C = O(null), [
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
}, [C, w] = O(null), [T, E] = O(null);
|
|
57
|
+
return ee(() => {
|
|
58
|
+
if (!C) return;
|
|
59
|
+
let e = () => {
|
|
60
|
+
C.isConnected && E(C.getBoundingClientRect().width);
|
|
61
|
+
};
|
|
62
|
+
if (e(), typeof ResizeObserver > "u") return;
|
|
63
|
+
let t = new ResizeObserver(e);
|
|
64
|
+
return t.observe(C), () => t.disconnect();
|
|
65
|
+
}, [C, o]), /* @__PURE__ */ P(p, {
|
|
63
66
|
asChild: !0,
|
|
64
67
|
placement: x.Top,
|
|
65
68
|
trigger: b ? m.Click : m.Hover,
|
|
66
69
|
contentClassName: "max-w-[min(550px,calc(100vw-10px))]",
|
|
67
|
-
content: a == null ? i ? /* @__PURE__ */
|
|
70
|
+
content: a == null ? i ? /* @__PURE__ */ P(H, { unsupportedMessage: h }) : /* @__PURE__ */ P(H, {
|
|
68
71
|
description: n,
|
|
69
72
|
viewDetailsLabel: f,
|
|
70
73
|
onViewDetails: S
|
|
71
|
-
}) : /* @__PURE__ */
|
|
74
|
+
}) : /* @__PURE__ */ P(H, {
|
|
72
75
|
unresolvedReason: a,
|
|
73
76
|
deletedMessage: g,
|
|
74
77
|
notSharedMessage: _
|
|
75
78
|
}),
|
|
76
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ F("span", {
|
|
77
80
|
tabIndex: 0,
|
|
78
81
|
className: r("relative -me-1 -ms-1 inline 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, B.chip),
|
|
79
82
|
"aria-label": `/${e}`,
|
|
80
|
-
children: [/* @__PURE__ */
|
|
81
|
-
ref:
|
|
83
|
+
children: [/* @__PURE__ */ P("span", {
|
|
84
|
+
ref: w,
|
|
82
85
|
"aria-hidden": !0,
|
|
83
|
-
className: "inset-inline-start-0 pointer-events-none absolute
|
|
86
|
+
className: "inset-inline-start-0 pointer-events-none absolute select-none",
|
|
84
87
|
children: "/"
|
|
85
|
-
}), /* @__PURE__ */
|
|
88
|
+
}), /* @__PURE__ */ P("span", {
|
|
86
89
|
"aria-hidden": !0,
|
|
87
90
|
className: "select-none",
|
|
88
|
-
style: { paddingInlineStart:
|
|
91
|
+
style: { paddingInlineStart: T ?? void 0 },
|
|
89
92
|
children: e
|
|
90
93
|
})]
|
|
91
94
|
})
|
|
@@ -102,13 +105,13 @@ var B = {
|
|
|
102
105
|
rowFadeOut: "_rowFadeOut_1v431_1",
|
|
103
106
|
listContent: "_listContent_1v431_60"
|
|
104
107
|
}, G = "px-3 pb-0.5 pt-2", ne = 180, re = 288, K = ({ favorites: n, onSelect: i, onToggleFavorite: a, onBrowse: o, onViewDetails: s, className: l, rowClassName: u, searchQuery: m, listboxId: h, activeOptionId: g, isMenu: _ = !1, labels: v = {}, colors: b, nameClassName: x = "dial-small-text", headerClassName: S = "dial-tiny-lead-semi-text", emptyHintClassName: C = "dial-small-text" }) => {
|
|
105
|
-
let { myCollectionLabel:
|
|
108
|
+
let { myCollectionLabel: E = "My Collection", emptyHintLabel: te = "Star a skill to pin it here", browseLabel: k = "Browse", removeFromFavoritesLabel: A = "Remove from favorites", viewDetailsLabel: M = "View details", noMatchingSkillsLabel: N = "No matching skills" } = v, I = t({
|
|
106
109
|
"--fs-row-hover-bg": b?.rowHoverBackground,
|
|
107
110
|
"--fs-header-text": b?.headerText,
|
|
108
111
|
"--fs-empty-hint-text": b?.emptyHintText,
|
|
109
112
|
"--fs-star-color": b?.starColor,
|
|
110
113
|
"--fs-footer-border": b?.footerBorder
|
|
111
|
-
}), [
|
|
114
|
+
}), [L, R] = O(/* @__PURE__ */ new Set()), z = D(/* @__PURE__ */ new Map());
|
|
112
115
|
w(() => {
|
|
113
116
|
let e = z.current;
|
|
114
117
|
return () => {
|
|
@@ -117,43 +120,43 @@ var B = {
|
|
|
117
120
|
}, []);
|
|
118
121
|
let V = h != null, U = _ && !V, K = V || U ? "none" : void 0, q = "button";
|
|
119
122
|
V ? q = "option" : U && (q = "menuitem");
|
|
120
|
-
let J = T(), Y = m != null, X = m?.toLowerCase() ?? "", Z = Y ? n.filter((e) => e.name.toLowerCase().includes(X)) : n, Q =
|
|
121
|
-
|
|
123
|
+
let J = T(), Y = m != null, X = m?.toLowerCase() ?? "", Z = Y ? n.filter((e) => e.name.toLowerCase().includes(X)) : n, Q = D(null), [$, ie] = O();
|
|
124
|
+
ee(() => {
|
|
122
125
|
Q.current && ie(Math.min(Q.current.scrollHeight, re));
|
|
123
126
|
}, [n, m]);
|
|
124
127
|
let ae = (e, t) => {
|
|
125
128
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i(t));
|
|
126
129
|
}, oe = (e) => {
|
|
127
|
-
|
|
130
|
+
R((t) => new Set(t).add(e));
|
|
128
131
|
let t = setTimeout(() => {
|
|
129
|
-
a?.(e),
|
|
132
|
+
a?.(e), R((t) => {
|
|
130
133
|
let n = new Set(t);
|
|
131
134
|
return n.delete(e), n;
|
|
132
135
|
}), z.current.delete(e);
|
|
133
136
|
}, ne);
|
|
134
137
|
z.current.set(e, t);
|
|
135
138
|
};
|
|
136
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ F("div", {
|
|
137
140
|
className: r("flex w-full flex-col desktop:w-[280px]", l, B.favoritesPanel),
|
|
138
|
-
style:
|
|
141
|
+
style: I,
|
|
139
142
|
children: [
|
|
140
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ P("p", {
|
|
141
144
|
id: J,
|
|
142
145
|
className: r(S, G, W.header),
|
|
143
|
-
children:
|
|
146
|
+
children: E
|
|
144
147
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ P("div", {
|
|
146
149
|
className: r("max-h-72 min-h-0 flex-1 overflow-y-auto", W.listContent),
|
|
147
150
|
style: { maxHeight: $ },
|
|
148
|
-
children: /* @__PURE__ */
|
|
151
|
+
children: /* @__PURE__ */ P("div", {
|
|
149
152
|
ref: Q,
|
|
150
|
-
children: Z.length > 0 ? /* @__PURE__ */
|
|
153
|
+
children: Z.length > 0 ? /* @__PURE__ */ P("ul", {
|
|
151
154
|
id: h,
|
|
152
155
|
role: V ? "listbox" : K,
|
|
153
156
|
"aria-labelledby": V ? J : void 0,
|
|
154
157
|
className: "flex flex-col gap-1 px-1 pb-1",
|
|
155
158
|
children: Z.map((t) => {
|
|
156
|
-
let n = V ? `${h}-${encodeURIComponent(t.id)}` : void 0, o = V ? -1 : void 0, l = /* @__PURE__ */
|
|
159
|
+
let n = V ? `${h}-${encodeURIComponent(t.id)}` : void 0, o = V ? -1 : void 0, l = /* @__PURE__ */ F("div", {
|
|
157
160
|
role: q,
|
|
158
161
|
id: n,
|
|
159
162
|
"aria-selected": V ? n === g : void 0,
|
|
@@ -163,26 +166,26 @@ var B = {
|
|
|
163
166
|
onClick: () => i(t),
|
|
164
167
|
onKeyDown: (e) => ae(e, t),
|
|
165
168
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ P(e, {
|
|
167
170
|
size: c.MD,
|
|
168
171
|
initialsName: t.name
|
|
169
172
|
}),
|
|
170
|
-
m == null ? /* @__PURE__ */
|
|
173
|
+
m == null ? /* @__PURE__ */ P("span", {
|
|
171
174
|
className: r(x, "min-w-0 flex-1 truncate text-start"),
|
|
172
175
|
children: t.name
|
|
173
|
-
}) : /* @__PURE__ */
|
|
176
|
+
}) : /* @__PURE__ */ P(f, {
|
|
174
177
|
text: t.name,
|
|
175
178
|
query: m,
|
|
176
179
|
maxLines: 1,
|
|
177
180
|
className: r(x, "min-w-0 flex-1 text-start")
|
|
178
181
|
}),
|
|
179
|
-
a && /* @__PURE__ */
|
|
180
|
-
icon: /* @__PURE__ */
|
|
182
|
+
a && /* @__PURE__ */ P(y, {
|
|
183
|
+
icon: /* @__PURE__ */ P(j, {
|
|
181
184
|
size: c.SM,
|
|
182
185
|
className: W.star,
|
|
183
186
|
"aria-hidden": !0
|
|
184
187
|
}),
|
|
185
|
-
"aria-label":
|
|
188
|
+
"aria-label": A,
|
|
186
189
|
isSelected: !0,
|
|
187
190
|
tabIndex: o,
|
|
188
191
|
onClick: (e) => {
|
|
@@ -191,15 +194,15 @@ var B = {
|
|
|
191
194
|
})
|
|
192
195
|
]
|
|
193
196
|
});
|
|
194
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ P("li", {
|
|
195
198
|
role: K,
|
|
196
|
-
className:
|
|
197
|
-
children: s ? /* @__PURE__ */
|
|
199
|
+
className: L.has(t.id) ? W.rowLeaving : W.rowEnter,
|
|
200
|
+
children: s ? /* @__PURE__ */ P(p, {
|
|
198
201
|
asChild: !0,
|
|
199
202
|
contentClassName: "max-w-[550px]",
|
|
200
|
-
content: /* @__PURE__ */
|
|
203
|
+
content: /* @__PURE__ */ P(H, {
|
|
201
204
|
description: t.description,
|
|
202
|
-
viewDetailsLabel:
|
|
205
|
+
viewDetailsLabel: M,
|
|
203
206
|
onViewDetails: () => s(t),
|
|
204
207
|
viewDetailsTabIndex: o
|
|
205
208
|
}),
|
|
@@ -207,22 +210,22 @@ var B = {
|
|
|
207
210
|
}) : l
|
|
208
211
|
}, t.id);
|
|
209
212
|
})
|
|
210
|
-
}) : Y && X !== "" ? /* @__PURE__ */
|
|
213
|
+
}) : Y && X !== "" ? /* @__PURE__ */ P("p", {
|
|
211
214
|
role: "status",
|
|
212
215
|
"aria-live": "polite",
|
|
213
216
|
className: r(C, "px-4 py-4 text-start", W.emptyHint),
|
|
214
|
-
children:
|
|
215
|
-
}) : /* @__PURE__ */
|
|
217
|
+
children: N
|
|
218
|
+
}) : /* @__PURE__ */ P("p", {
|
|
216
219
|
className: r(C, "px-4 py-4 text-start", W.emptyHint),
|
|
217
|
-
children:
|
|
220
|
+
children: te
|
|
218
221
|
})
|
|
219
222
|
})
|
|
220
223
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ P("div", {
|
|
222
225
|
className: r("border-t px-2 py-3", W.footer),
|
|
223
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ P(d, {
|
|
224
227
|
role: U ? "menuitem" : void 0,
|
|
225
|
-
label:
|
|
228
|
+
label: k,
|
|
226
229
|
className: "w-full justify-center",
|
|
227
230
|
onClick: o
|
|
228
231
|
})
|
|
@@ -231,19 +234,19 @@ var B = {
|
|
|
231
234
|
});
|
|
232
235
|
}, q = ".zip,.md", J = ({ isOpen: e, errorText: t, isUploading: n = !1, accept: r = q, labels: i, onClose: a, onFilesSelected: o, onFilesRejected: s }) => {
|
|
233
236
|
let { dialogTitle: c = "Upload skill", dropZoneLabel: l = "Drag and drop it or click here to upload", dropZoneMobileLabel: d = "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: _ = "Uploading skill" } = i ?? {};
|
|
234
|
-
return /* @__PURE__ */
|
|
237
|
+
return /* @__PURE__ */ P(h, {
|
|
235
238
|
open: e,
|
|
236
239
|
size: g.Sm,
|
|
237
240
|
header: c,
|
|
238
241
|
closeAriaLabel: m,
|
|
239
242
|
onClose: a,
|
|
240
|
-
children: /* @__PURE__ */
|
|
243
|
+
children: /* @__PURE__ */ F("div", {
|
|
241
244
|
className: "flex flex-col gap-4 px-6 py-4",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
243
|
-
label: /* @__PURE__ */
|
|
245
|
+
children: [/* @__PURE__ */ P(u, {
|
|
246
|
+
label: /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("span", {
|
|
244
247
|
className: "desktop:hidden",
|
|
245
248
|
children: d
|
|
246
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ P("span", {
|
|
247
250
|
className: "hidden desktop:inline",
|
|
248
251
|
children: l
|
|
249
252
|
})] }),
|
|
@@ -254,54 +257,55 @@ var B = {
|
|
|
254
257
|
errorText: n ? void 0 : t,
|
|
255
258
|
onChange: o,
|
|
256
259
|
onReject: s
|
|
257
|
-
}), n && /* @__PURE__ */
|
|
260
|
+
}), n && /* @__PURE__ */ P(v, { ariaLabel: _ })]
|
|
258
261
|
})
|
|
259
262
|
});
|
|
260
|
-
}, Y = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */
|
|
263
|
+
}, Y = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ P(h, {
|
|
261
264
|
open: e,
|
|
262
265
|
header: r,
|
|
263
266
|
size: g.Lg,
|
|
264
|
-
className: "h-[min(90vh,860px)] !max-w-[min(95vw,1200px)] overflow-hidden",
|
|
267
|
+
className: "h-[min(90vh,860px)] !max-w-[min(95vw,1200px)] overflow-hidden mobile:h-full mobile:!max-w-full mobile:rounded-none",
|
|
268
|
+
overlayClassName: "mobile:p-0",
|
|
265
269
|
onClose: t,
|
|
266
|
-
children: /* @__PURE__ */
|
|
267
|
-
className: "h-[min(80vh,840px)] overflow-auto",
|
|
268
|
-
children: /* @__PURE__ */
|
|
270
|
+
children: /* @__PURE__ */ P("div", {
|
|
271
|
+
className: "h-[min(80vh,840px)] overflow-auto mobile:h-full",
|
|
272
|
+
children: /* @__PURE__ */ P(S, {
|
|
269
273
|
fallback: null,
|
|
270
274
|
children: e && i(n, t)
|
|
271
275
|
})
|
|
272
276
|
})
|
|
273
|
-
}), X = (e, t = null) => e.map((e) => e.type ===
|
|
277
|
+
}), X = (e, t = null) => e.map((e) => e.type === R.Folder ? {
|
|
274
278
|
path: e.id,
|
|
275
279
|
name: e.name,
|
|
276
|
-
nodeType:
|
|
280
|
+
nodeType: I.FOLDER,
|
|
277
281
|
parentPath: t,
|
|
278
282
|
folderId: e.id,
|
|
279
283
|
items: X(e.items, e.id)
|
|
280
284
|
} : {
|
|
281
285
|
path: e.id,
|
|
282
286
|
name: e.name,
|
|
283
|
-
nodeType:
|
|
287
|
+
nodeType: I.ITEM,
|
|
284
288
|
parentPath: t,
|
|
285
289
|
folderId: t ?? ""
|
|
286
|
-
}), Z = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => /* @__PURE__ */
|
|
287
|
-
items:
|
|
290
|
+
}), Z = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => /* @__PURE__ */ P(L, {
|
|
291
|
+
items: E(() => X(e), [e]),
|
|
288
292
|
showFiles: !0,
|
|
289
293
|
areHiddenFilesVisible: !0,
|
|
290
294
|
selectedPath: t,
|
|
291
|
-
expandedPaths:
|
|
295
|
+
expandedPaths: E(() => new Set(n), [n]),
|
|
292
296
|
onExpandedPathsChange: (e) => {
|
|
293
297
|
for (let t of e) n.has(t) || r(t);
|
|
294
298
|
for (let t of n) e.has(t) || r(t);
|
|
295
299
|
},
|
|
296
300
|
onItemClick: (e) => {
|
|
297
|
-
e.nodeType ===
|
|
301
|
+
e.nodeType === I.ITEM && i(e.path);
|
|
298
302
|
},
|
|
299
303
|
ariaLabel: o,
|
|
300
304
|
autoFocus: !0,
|
|
301
305
|
onEscape: a
|
|
302
|
-
}), Q = (e) => /* @__PURE__ */
|
|
306
|
+
}), Q = (e) => /* @__PURE__ */ P(z, {
|
|
303
307
|
...e,
|
|
304
|
-
renderContentFileTree: (e) => /* @__PURE__ */
|
|
308
|
+
renderContentFileTree: (e) => /* @__PURE__ */ P(Z, { ...e })
|
|
305
309
|
}), $ = (e) => e == null || /[\s/]/.test(e), ie = (e, t, n) => {
|
|
306
310
|
let r = [], i = 0;
|
|
307
311
|
return t.forEach((t, a) => {
|
|
@@ -379,11 +383,11 @@ var B = {
|
|
|
379
383
|
let r = e.indexOf(n, Math.max(0, t.start - n.length)), i = t.start + t.insertedLength - n.length;
|
|
380
384
|
return r !== -1 && r <= i ? r : void 0;
|
|
381
385
|
}, fe = () => {
|
|
382
|
-
let [e, t] =
|
|
386
|
+
let [e, t] = O(""), [n, r] = O([]), i = D(e);
|
|
383
387
|
i.current = e;
|
|
384
|
-
let a =
|
|
388
|
+
let a = D(n);
|
|
385
389
|
a.current = n;
|
|
386
|
-
let o =
|
|
390
|
+
let o = D(null), s = C((e) => {
|
|
387
391
|
let n = oe(i.current, e), a = o.current;
|
|
388
392
|
o.current = null;
|
|
389
393
|
let s = a == null ? void 0 : de(e, n, a.text);
|
|
@@ -402,7 +406,7 @@ var B = {
|
|
|
402
406
|
}, []), l = C((e, n, a) => {
|
|
403
407
|
let o = i.current, s = `/${n}`, c = o.slice(0, a) + s + o.slice(a);
|
|
404
408
|
i.current = c, t(c), r((t) => ce(t, a, e, n, !1));
|
|
405
|
-
}, []), u = C((e) => le(a.current, e), []), d =
|
|
409
|
+
}, []), u = C((e) => le(a.current, e), []), d = E(() => {
|
|
406
410
|
if (n.length !== 0) return n.map((e) => ({ url: e.url }));
|
|
407
411
|
}, [n]), f = C((e, t) => {
|
|
408
412
|
o.current = t.length > 0 ? {
|
|
@@ -423,7 +427,7 @@ var B = {
|
|
|
423
427
|
};
|
|
424
428
|
}));
|
|
425
429
|
}, []);
|
|
426
|
-
return
|
|
430
|
+
return E(() => ({
|
|
427
431
|
draft: e,
|
|
428
432
|
anchors: n,
|
|
429
433
|
onDraftChange: s,
|
|
@@ -457,7 +461,7 @@ var B = {
|
|
|
457
461
|
let t = e.split("/").filter((e) => e.length > 0);
|
|
458
462
|
return t[0] !== "skills" || t.length < 3 ? null : t[1];
|
|
459
463
|
}, ge = (e, t) => he(e) === t ? V.Deleted : V.NotShared, _e = "/", ve = ({ 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, renderCatalogContent: m, detailsPanelComponent: h }) => {
|
|
460
|
-
let { addMenuLabel: g = "Skills", backLabel: _ = "Back", catalogModalTitleLabel: v = "Use skill", emptyQueryHintLabel: y = "Type to filter", deletedTooltipLabel: b, notSharedTooltipLabel: x, unsupportedTooltipLabel: w, panelLabels: T } = c ?? {}, [
|
|
464
|
+
let { addMenuLabel: g = "Skills", backLabel: _ = "Back", catalogModalTitleLabel: v = "Use skill", emptyQueryHintLabel: y = "Type to filter", deletedTooltipLabel: b, notSharedTooltipLabel: x, unsupportedTooltipLabel: w, panelLabels: T } = c ?? {}, [ee, k] = O(!1), [A, j] = O(null), [M, N] = O(0), F = D(null), [I, L] = O(0), [R, z] = O(void 0), B = fe(), V = E(() => [
|
|
461
465
|
...t,
|
|
462
466
|
...n ?? [],
|
|
463
467
|
...r ?? []
|
|
@@ -465,18 +469,18 @@ var B = {
|
|
|
465
469
|
t,
|
|
466
470
|
n,
|
|
467
471
|
r
|
|
468
|
-
]), H =
|
|
472
|
+
]), H = E(() => new Map(V.map((e) => [e.url, e])), [V]), W = C((e) => H.get(e)?.name ?? me(e), [H]), G = E(() => V.filter((e) => a.has(e.url)).map((e) => pe(e)), [V, a]), ne = B.anchors.length > 0 && !e, re = E(() => B.anchors.map((t) => ({
|
|
469
473
|
start: t.start,
|
|
470
474
|
length: t.length,
|
|
471
475
|
isUnsupported: !e,
|
|
472
|
-
render: () => /* @__PURE__ */
|
|
476
|
+
render: () => /* @__PURE__ */ P(U, {
|
|
473
477
|
name: t.name,
|
|
474
478
|
path: t.url,
|
|
475
479
|
labelClassName: d,
|
|
476
480
|
description: H.get(t.url)?.description,
|
|
477
481
|
isUnsupported: !e,
|
|
478
482
|
detailsTrigger: f,
|
|
479
|
-
onViewDetails:
|
|
483
|
+
onViewDetails: j,
|
|
480
484
|
labels: {
|
|
481
485
|
viewDetailsLabel: T?.viewDetailsLabel,
|
|
482
486
|
unsupportedTooltipLabel: w
|
|
@@ -492,7 +496,7 @@ var B = {
|
|
|
492
496
|
w
|
|
493
497
|
]), q = C((e, t, n) => {
|
|
494
498
|
let r = B.insertMention(e, t, n);
|
|
495
|
-
|
|
499
|
+
L((e) => e + 1), z(n + 1 + t.length + +!!r);
|
|
496
500
|
}, [B]), J = C((e) => {
|
|
497
501
|
let t = ue(B.draft, e, _e);
|
|
498
502
|
return t == null ? e : (B.onDraftChange(B.draft.slice(0, t.start) + B.draft.slice(t.end)), t.start);
|
|
@@ -506,7 +510,7 @@ var B = {
|
|
|
506
510
|
mentionUrl: n?.url
|
|
507
511
|
};
|
|
508
512
|
}, [B]), Z = C(() => {
|
|
509
|
-
B.reset(),
|
|
513
|
+
B.reset(), L((e) => e + 1), z(void 0);
|
|
510
514
|
}, [B]), { expectInsertion: Q } = B, $ = C((t) => {
|
|
511
515
|
Q(t, e ? ae(t, V) : []);
|
|
512
516
|
}, [
|
|
@@ -514,27 +518,30 @@ var B = {
|
|
|
514
518
|
e,
|
|
515
519
|
V
|
|
516
520
|
]), oe = C((e, t) => {
|
|
517
|
-
B.seedFromMessage(e, t, W),
|
|
521
|
+
B.seedFromMessage(e, t, W), L((e) => e + 1), z(void 0);
|
|
518
522
|
}, [B, W]), se = C((e, t) => {
|
|
519
523
|
if (t == null || t.length === 0) return null;
|
|
520
524
|
let n = ie(e, t, W), r = [], i = 0;
|
|
521
525
|
return n.forEach((n) => {
|
|
522
526
|
n.start > i && r.push(e.slice(i, n.start));
|
|
523
527
|
let a = t[n.skillIndex], s = H.get(a.url), c = s?.name ?? me(a.url), l = s == null ? ge(a.url, o) : void 0;
|
|
524
|
-
r.push(
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
528
|
+
r.push({
|
|
529
|
+
text: e.slice(n.start, n.start + n.length),
|
|
530
|
+
node: /* @__PURE__ */ P(U, {
|
|
531
|
+
name: c,
|
|
532
|
+
path: a.url,
|
|
533
|
+
labelClassName: u,
|
|
534
|
+
description: s?.description,
|
|
535
|
+
unresolvedReason: l,
|
|
536
|
+
detailsTrigger: p,
|
|
537
|
+
onViewDetails: j,
|
|
538
|
+
labels: {
|
|
539
|
+
viewDetailsLabel: T?.viewDetailsLabel,
|
|
540
|
+
deletedTooltipLabel: b,
|
|
541
|
+
notSharedTooltipLabel: x
|
|
542
|
+
}
|
|
543
|
+
}, `${a.url}-${n.start}`)
|
|
544
|
+
}), i = n.start + n.length;
|
|
538
545
|
}), i < e.length && r.push(e.slice(i)), r;
|
|
539
546
|
}, [
|
|
540
547
|
W,
|
|
@@ -547,14 +554,14 @@ var B = {
|
|
|
547
554
|
x
|
|
548
555
|
]), ce = C((e) => e == null || e.length === 0 ? null : e.map((e) => {
|
|
549
556
|
let t = H.get(e.url), n = t?.name ?? me(e.url), r = t == null ? ge(e.url, o) : void 0;
|
|
550
|
-
return /* @__PURE__ */
|
|
557
|
+
return /* @__PURE__ */ P(U, {
|
|
551
558
|
name: n,
|
|
552
559
|
path: e.url,
|
|
553
560
|
labelClassName: u,
|
|
554
561
|
description: t?.description,
|
|
555
562
|
unresolvedReason: r,
|
|
556
563
|
detailsTrigger: p,
|
|
557
|
-
onViewDetails:
|
|
564
|
+
onViewDetails: j,
|
|
558
565
|
labels: {
|
|
559
566
|
viewDetailsLabel: T?.viewDetailsLabel,
|
|
560
567
|
deletedTooltipLabel: b,
|
|
@@ -569,7 +576,7 @@ var B = {
|
|
|
569
576
|
o,
|
|
570
577
|
b,
|
|
571
578
|
x
|
|
572
|
-
]), le = C((e, t) => /* @__PURE__ */
|
|
579
|
+
]), le = C((e, t) => /* @__PURE__ */ P(K, {
|
|
573
580
|
favorites: G,
|
|
574
581
|
isMenu: !0,
|
|
575
582
|
onSelect: (n) => {
|
|
@@ -578,10 +585,10 @@ var B = {
|
|
|
578
585
|
onToggleFavorite: s,
|
|
579
586
|
onBrowse: () => {
|
|
580
587
|
let n = X(t);
|
|
581
|
-
|
|
588
|
+
N(J(t)), F.current = n ?? null, e(), k(!0);
|
|
582
589
|
},
|
|
583
590
|
onViewDetails: (n) => {
|
|
584
|
-
J(t), e(),
|
|
591
|
+
J(t), e(), j(n.id);
|
|
585
592
|
},
|
|
586
593
|
labels: T
|
|
587
594
|
}), [
|
|
@@ -593,10 +600,10 @@ var B = {
|
|
|
593
600
|
T
|
|
594
601
|
]);
|
|
595
602
|
return {
|
|
596
|
-
skillMenuOverlay:
|
|
603
|
+
skillMenuOverlay: E(() => e ? {
|
|
597
604
|
key: "skills",
|
|
598
605
|
title: g,
|
|
599
|
-
icon: /* @__PURE__ */
|
|
606
|
+
icon: /* @__PURE__ */ P(te, {
|
|
600
607
|
size: i,
|
|
601
608
|
"aria-hidden": !0,
|
|
602
609
|
stroke: l
|
|
@@ -609,11 +616,12 @@ var B = {
|
|
|
609
616
|
_,
|
|
610
617
|
le
|
|
611
618
|
]),
|
|
612
|
-
commandMenu:
|
|
619
|
+
commandMenu: E(() => e ? {
|
|
613
620
|
triggerPrefix: _e,
|
|
614
621
|
menuLabel: g,
|
|
615
622
|
emptyQueryHint: y,
|
|
616
|
-
|
|
623
|
+
onTextPaste: $,
|
|
624
|
+
renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ P(K, {
|
|
617
625
|
favorites: G,
|
|
618
626
|
searchQuery: e,
|
|
619
627
|
listboxId: r,
|
|
@@ -627,14 +635,14 @@ var B = {
|
|
|
627
635
|
n({
|
|
628
636
|
consumeQuery: !0,
|
|
629
637
|
returnFocus: !1
|
|
630
|
-
}),
|
|
638
|
+
}), N(t), F.current = {
|
|
631
639
|
position: t,
|
|
632
640
|
text: r,
|
|
633
641
|
mentionUrl: i?.url
|
|
634
|
-
},
|
|
642
|
+
}, k(!0);
|
|
635
643
|
},
|
|
636
644
|
onViewDetails: (e) => {
|
|
637
|
-
n({ consumeQuery: !0 }),
|
|
645
|
+
n({ consumeQuery: !0 }), j(e.id);
|
|
638
646
|
},
|
|
639
647
|
labels: T
|
|
640
648
|
})
|
|
@@ -646,36 +654,37 @@ var B = {
|
|
|
646
654
|
q,
|
|
647
655
|
B.anchors,
|
|
648
656
|
s,
|
|
649
|
-
T
|
|
657
|
+
T,
|
|
658
|
+
$
|
|
650
659
|
]),
|
|
651
|
-
skillCatalogModal: /* @__PURE__ */
|
|
652
|
-
isOpen:
|
|
660
|
+
skillCatalogModal: /* @__PURE__ */ P(Y, {
|
|
661
|
+
isOpen: ee,
|
|
653
662
|
onClose: C(() => {
|
|
654
|
-
|
|
655
|
-
let e =
|
|
656
|
-
if (
|
|
663
|
+
k(!1);
|
|
664
|
+
let e = F.current;
|
|
665
|
+
if (F.current = null, e == null) return;
|
|
657
666
|
let { position: t, text: n, mentionUrl: r } = e;
|
|
658
|
-
r == null ? B.onDraftChange(B.draft.slice(0, t) + n + B.draft.slice(t)) : B.restoreMention(r, n.slice(1), t),
|
|
667
|
+
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);
|
|
659
668
|
}, [B]),
|
|
660
669
|
onSelect: (e) => {
|
|
661
|
-
|
|
670
|
+
F.current = null, q(e, W(e), M), k(!1);
|
|
662
671
|
},
|
|
663
672
|
title: v,
|
|
664
673
|
renderContent: m
|
|
665
674
|
}),
|
|
666
|
-
skillDetailsPanel: /* @__PURE__ */
|
|
675
|
+
skillDetailsPanel: /* @__PURE__ */ P(S, {
|
|
667
676
|
fallback: null,
|
|
668
|
-
children: /* @__PURE__ */
|
|
669
|
-
skillId:
|
|
670
|
-
onClose: () =>
|
|
677
|
+
children: /* @__PURE__ */ P(h, {
|
|
678
|
+
skillId: A,
|
|
679
|
+
onClose: () => j(null)
|
|
671
680
|
})
|
|
672
681
|
}),
|
|
673
682
|
message: B.draft,
|
|
674
|
-
messageRevision:
|
|
683
|
+
messageRevision: I,
|
|
675
684
|
activeMentions: re,
|
|
676
685
|
onDraftChange: B.onDraftChange,
|
|
677
686
|
onBackspaceAtCaret: B.onBackspaceAtCaret,
|
|
678
|
-
caretPositionOverride:
|
|
687
|
+
caretPositionOverride: R,
|
|
679
688
|
isSkillUnsupported: ne,
|
|
680
689
|
selectedSkills: B.orderedSkills,
|
|
681
690
|
resetSkillMentions: Z,
|
|
@@ -691,25 +700,25 @@ var B = {
|
|
|
691
700
|
clear: "_clear_1ult0_13",
|
|
692
701
|
invalid: "_invalid_1ult0_17"
|
|
693
702
|
}, be = [], xe = "Selected model does not support skills. Select a different model to use a skill.", Se = ({ value: i, onChange: a, displayNames: o, skills: s = be, isSkillsSupported: l, isDisabled: u = !1, error: d, labels: p, className: m, styles: h }) => {
|
|
694
|
-
let [g, v] =
|
|
703
|
+
let [g, v] = O(!1), [y, x] = O(""), S = D(null), C = T(), w = i.some((e) => n(e, l)), E = l && !u, te = g && E, k = i.length > 0 ? p.unsupportedTooltipLabel : p.unavailableTooltipLabel ?? xe, A = !l && i.length === 0, j = d ?? (A ? k : void 0), M = new Map(i.map((e) => [e, {
|
|
695
704
|
id: e,
|
|
696
705
|
name: o?.[e] || e
|
|
697
706
|
}]));
|
|
698
|
-
s.forEach((e) =>
|
|
699
|
-
let
|
|
707
|
+
s.forEach((e) => M.set(e.id, e));
|
|
708
|
+
let N = [...M.values()].map((t) => ({
|
|
700
709
|
value: t.id,
|
|
701
710
|
label: t.name,
|
|
702
|
-
labelNode: y.trim() ? /* @__PURE__ */
|
|
711
|
+
labelNode: y.trim() ? /* @__PURE__ */ P(f, {
|
|
703
712
|
text: t.name,
|
|
704
713
|
query: y,
|
|
705
714
|
maxLines: 1
|
|
706
715
|
}) : void 0,
|
|
707
|
-
icon: /* @__PURE__ */
|
|
716
|
+
icon: /* @__PURE__ */ P(e, {
|
|
708
717
|
size: c.SM,
|
|
709
718
|
initialsName: t.name
|
|
710
719
|
}),
|
|
711
720
|
disabled: !l
|
|
712
|
-
})),
|
|
721
|
+
})), I = {
|
|
713
722
|
...t({
|
|
714
723
|
"--ssf-text": h?.colors?.text,
|
|
715
724
|
"--ssf-bg": h?.colors?.background,
|
|
@@ -718,55 +727,55 @@ var B = {
|
|
|
718
727
|
}),
|
|
719
728
|
...h?.cssVars
|
|
720
729
|
};
|
|
721
|
-
return
|
|
730
|
+
return ee(() => {
|
|
722
731
|
let e = S.current?.querySelector("[role=\"combobox\"]");
|
|
723
|
-
e && (
|
|
732
|
+
e && (j ? e.setAttribute("aria-describedby", C) : e.removeAttribute("aria-describedby"), d || w ? e.setAttribute("aria-invalid", "true") : e.removeAttribute("aria-invalid"));
|
|
724
733
|
}, [
|
|
725
|
-
|
|
734
|
+
j,
|
|
726
735
|
C,
|
|
727
736
|
d,
|
|
728
737
|
u,
|
|
729
738
|
w
|
|
730
|
-
]), /* @__PURE__ */
|
|
739
|
+
]), /* @__PURE__ */ F("div", {
|
|
731
740
|
ref: S,
|
|
732
741
|
className: r("min-w-0", m, B.selectorField),
|
|
733
|
-
style:
|
|
734
|
-
children: [/* @__PURE__ */
|
|
735
|
-
tooltip:
|
|
742
|
+
style: I,
|
|
743
|
+
children: [/* @__PURE__ */ P(b, {
|
|
744
|
+
tooltip: k,
|
|
736
745
|
hideTooltip: l,
|
|
737
746
|
triggerClassName: "block w-full min-w-0",
|
|
738
|
-
children: /* @__PURE__ */
|
|
747
|
+
children: /* @__PURE__ */ P("div", {
|
|
739
748
|
inert: u ? !0 : void 0,
|
|
740
|
-
children: /* @__PURE__ */
|
|
749
|
+
children: /* @__PURE__ */ P(_, {
|
|
741
750
|
multiple: !0,
|
|
742
751
|
searchable: !0,
|
|
743
|
-
open:
|
|
752
|
+
open: te,
|
|
744
753
|
onOpenChange: (e) => {
|
|
745
|
-
e && !
|
|
754
|
+
e && !E || v(e);
|
|
746
755
|
},
|
|
747
756
|
onSearchQueryChange: x,
|
|
748
757
|
value: i,
|
|
749
758
|
onChange: (e) => {
|
|
750
759
|
u || a(Array.isArray(e) ? e : [e]);
|
|
751
760
|
},
|
|
752
|
-
options:
|
|
761
|
+
options: N,
|
|
753
762
|
placeholder: p.placeholder,
|
|
754
763
|
labelProps: { label: p.fieldLabel },
|
|
755
764
|
error: d,
|
|
756
|
-
caption:
|
|
765
|
+
caption: A ? k : void 0,
|
|
757
766
|
searchPlaceholder: p.searchPlaceholder ?? "Search skills",
|
|
758
767
|
emptyStateTitle: y.trim() ? p.noMatchingSkillsLabel ?? "No matching skills" : p.emptyLabel ?? "No skills available",
|
|
759
|
-
disabled: u ||
|
|
768
|
+
disabled: u || A,
|
|
760
769
|
invalid: !!d || w,
|
|
761
770
|
className: "w-full min-w-0",
|
|
762
|
-
fieldClassName: r(
|
|
771
|
+
fieldClassName: r(E ? "cursor-pointer" : "cursor-not-allowed", "--ssf-bg" in I && ye.background, "--ssf-border" in I && ye.border, "--ssf-text" in I && ye.value, (d || w) && ye.invalid, h?.typography?.fontClassName ?? "dial-small-text", h?.triggerClassName),
|
|
763
772
|
listClassName: "w-[min(var(--reference-width),calc(100vw-2rem))] max-w-full"
|
|
764
773
|
})
|
|
765
774
|
})
|
|
766
|
-
}),
|
|
775
|
+
}), j && /* @__PURE__ */ P("span", {
|
|
767
776
|
id: C,
|
|
768
777
|
className: "sr-only",
|
|
769
|
-
children:
|
|
778
|
+
children: j
|
|
770
779
|
})]
|
|
771
780
|
});
|
|
772
781
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RequestSkill } from '@epam/ai-dial-chat-shared';
|
|
1
|
+
import { RequestSkill, TextSegment } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
import { CommandMenuConfig, HighlightedTextRange, MenuOverlayConfig } from '@epam/ai-dial-conversation-input';
|
|
3
3
|
import { ComponentType, ReactNode } from 'react';
|
|
4
4
|
import { ChatSkillDetailsTrigger } from './chat-skill-props';
|
|
@@ -229,12 +229,13 @@ export interface UseSkillSelectorOverlayResult {
|
|
|
229
229
|
* prompt): once the insertion reaches `onDraftChange`, every `/{name}` run
|
|
230
230
|
* in it that names a listed skill becomes a tracked mention. Call right
|
|
231
231
|
* before handing `text` to the composer's insertion channel. A no-op on a
|
|
232
|
-
* deployment without skills support
|
|
232
|
+
* deployment without skills support. A paste into the input goes through
|
|
233
|
+
* the same recognition via `commandMenu.onTextPaste`.
|
|
233
234
|
*/
|
|
234
235
|
recognizeMentionsInInsertion: (text: string) => void;
|
|
235
236
|
/**
|
|
236
237
|
* Renders a user message's `content` and `custom_content.skills` as an
|
|
237
|
-
* ordered array interleaving
|
|
238
|
+
* ordered array interleaving markdown string runs and `ChatSkill` segments (each with its matched `/{name}` text) at
|
|
238
239
|
* each mention's actual text position — for `UserMessageBubble`'s
|
|
239
240
|
* `textSegments` prop. Resolves each entry's name from the listing pools
|
|
240
241
|
* matched on its url, falling back to the url's last non-empty segment;
|
|
@@ -247,7 +248,7 @@ export interface UseSkillSelectorOverlayResult {
|
|
|
247
248
|
* `matchSkillMentions` cannot locate in `content` is simply omitted from
|
|
248
249
|
* the render (see `matchSkillMentions`'s own doc for that heuristic).
|
|
249
250
|
*/
|
|
250
|
-
renderHistorySkillSegments: (content: string, skills: RequestSkill[] | undefined) =>
|
|
251
|
+
renderHistorySkillSegments: (content: string, skills: RequestSkill[] | undefined) => TextSegment[] | null;
|
|
251
252
|
/**
|
|
252
253
|
* Renders every entry of `skills` as a flat list of `ChatSkill` elements,
|
|
253
254
|
* ignoring text position — for `AssistantMessageBubble`'s `beforeContent`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-selector-overlay.d.ts","sourceRoot":"","sources":["../../src/models/skill-selector-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"skill-selector-overlay.d.ts","sourceRoot":"","sources":["../../src/models/skill-selector-overlay.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-skills",
|
|
3
3
|
"description": "Host-agnostic UI for picking a favorite skill to attach to a chat input",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.61",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-catalog": "1.3.0-dev.
|
|
22
|
-
"@epam/ai-dial-conversation-input": "1.3.0-dev.
|
|
21
|
+
"@epam/ai-dial-catalog": "1.3.0-dev.61",
|
|
22
|
+
"@epam/ai-dial-conversation-input": "1.3.0-dev.61"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
26
|
-
"@epam/ai-dial-react-file-manager": "^0.3.
|
|
27
|
-
"@epam/ai-dial-ui-kit": "^0.15.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.61",
|
|
26
|
+
"@epam/ai-dial-react-file-manager": "^0.3.5",
|
|
27
|
+
"@epam/ai-dial-ui-kit": "^0.15.4",
|
|
28
28
|
"react": "^19.2.8"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|