@epam/ai-dial-skills 1.2.0-dev.321 → 1.2.0-dev.324

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