@epam/ai-dial-skills 1.2.0-rc.0 → 1.2.0-rc.2

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":"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,CAoBxD,CAAC"}
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"}
@@ -43,6 +43,13 @@ export interface UseSkillMentionsResult {
43
43
  * not seeded as an anchor.
44
44
  */
45
45
  seedFromMessage: (text: string, skills: RequestSkill[] | undefined, resolveName: (url: string) => string) => void;
46
+ /**
47
+ * Registers text about to be inserted into the draft (e.g. a picked prompt)
48
+ * with the mentions found in it, offsets relative to `text`. The next
49
+ * `onDraftChange` that lands `text` tracks them as anchors; any other
50
+ * change discards them.
51
+ */
52
+ expectInsertion: (text: string, mentions: SkillMentionAnchor[]) => void;
46
53
  }
47
54
  /**
48
55
  * Tracks an ordered set of skill mentions live within a plain-text draft, as
@@ -1 +1 @@
1
- {"version":3,"file":"useSkillMentions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSkillMentions/useSkillMentions.tsx"],"names":[],"mappings":"AAAA,OAAO,K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C;AAW5E,gDAAgD;AAChD,MAAM,WAAW,sBAAsB;IACrC,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,yGAAyG;IACzG,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;;;;;;OASG;IACH,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5E,0LAA0L;IAC1L,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE;;;;;;;;;OASG;IACH,kBAAkB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC9E,iIAAiI;IACjI,aAAa,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;IAC1C,sDAAsD;IACtD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;;;OAKG;IACH,eAAe,EAAE,CACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,EAClC,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACjC,IAAI,CAAC;IACV;;;;;OAKG;IACH,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;CACzE;AAQD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAO,sBA0KnC,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;AAmB7C;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,iSAerC,8BAA8B,KAAG,6BA4hBnC,CAAC"}
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,6BAgjBnC,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}.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 (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 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";
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
+ 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 te, 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 ? M : A, a = e ? r : i;
18
- return /* @__PURE__ */ F("div", {
17
+ let e = n === V.Deleted, t = e ? N : j, a = e ? r : i;
18
+ return /* @__PURE__ */ I("div", {
19
19
  className: "flex flex-row items-center gap-2",
20
- children: [/* @__PURE__ */ P(t, {
20
+ children: [/* @__PURE__ */ F(t, {
21
21
  size: c.MD,
22
22
  stroke: l,
23
23
  "aria-hidden": !0,
24
24
  className: "shrink-0 text-secondary"
25
- }), /* @__PURE__ */ P("p", {
25
+ }), /* @__PURE__ */ F("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__ */ F("div", {
31
+ return t == null ? /* @__PURE__ */ I("div", {
32
32
  className: "flex flex-col gap-3",
33
- children: [e != null && e !== "" && /* @__PURE__ */ P("p", {
33
+ children: [e != null && e !== "" && /* @__PURE__ */ F("p", {
34
34
  className: "text-start",
35
35
  children: e
36
- }), /* @__PURE__ */ P(a, {
36
+ }), /* @__PURE__ */ F(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__ */ P(k, {
41
+ iconBefore: /* @__PURE__ */ F(A, {
42
42
  size: c.SM,
43
43
  stroke: l,
44
44
  "aria-hidden": !0
@@ -46,43 +46,43 @@ var B = {
46
46
  onClick: d,
47
47
  tabIndex: f
48
48
  })]
49
- }) : /* @__PURE__ */ P("p", {
49
+ }) : /* @__PURE__ */ F("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] = O(0), b = l === "click", S = () => {
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
55
  y((e) => e + 1), u(t);
56
- }, C = D(null), [w, T] = O(null);
57
- return ee(() => {
56
+ }, C = O(null), [w, T] = k(null);
57
+ return E(() => {
58
58
  let e = C.current, t = () => T(e?.getBoundingClientRect().width ?? null);
59
59
  if (t(), !e || typeof ResizeObserver > "u") return;
60
60
  let n = new ResizeObserver(t);
61
61
  return n.observe(e), () => n.disconnect();
62
- }, [o]), /* @__PURE__ */ P(p, {
62
+ }, [o]), /* @__PURE__ */ F(p, {
63
63
  asChild: !0,
64
64
  placement: x.Top,
65
65
  trigger: b ? m.Click : m.Hover,
66
66
  contentClassName: "max-w-[min(550px,calc(100vw-10px))]",
67
- content: a == null ? i ? /* @__PURE__ */ P(H, { unsupportedMessage: h }) : /* @__PURE__ */ P(H, {
67
+ content: a == null ? i ? /* @__PURE__ */ F(H, { unsupportedMessage: h }) : /* @__PURE__ */ F(H, {
68
68
  description: n,
69
69
  viewDetailsLabel: f,
70
70
  onViewDetails: S
71
- }) : /* @__PURE__ */ P(H, {
71
+ }) : /* @__PURE__ */ F(H, {
72
72
  unresolvedReason: a,
73
73
  deletedMessage: g,
74
74
  notSharedMessage: _
75
75
  }),
76
- children: /* @__PURE__ */ F("span", {
76
+ children: /* @__PURE__ */ I("span", {
77
77
  tabIndex: 0,
78
78
  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
79
  "aria-label": `/${e}`,
80
- children: [/* @__PURE__ */ P("span", {
80
+ children: [/* @__PURE__ */ F("span", {
81
81
  ref: C,
82
82
  "aria-hidden": !0,
83
83
  className: "inset-inline-start-0 pointer-events-none absolute top-0 select-none",
84
84
  children: "/"
85
- }), /* @__PURE__ */ P("span", {
85
+ }), /* @__PURE__ */ F("span", {
86
86
  "aria-hidden": !0,
87
87
  className: "select-none",
88
88
  style: { paddingInlineStart: w ?? void 0 },
@@ -102,13 +102,13 @@ var B = {
102
102
  rowFadeOut: "_rowFadeOut_1v431_1",
103
103
  listContent: "_listContent_1v431_60"
104
104
  }, 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: 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({
105
+ 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({
106
106
  "--fs-row-hover-bg": b?.rowHoverBackground,
107
107
  "--fs-header-text": b?.headerText,
108
108
  "--fs-empty-hint-text": b?.emptyHintText,
109
109
  "--fs-star-color": b?.starColor,
110
110
  "--fs-footer-border": b?.footerBorder
111
- }), [L, R] = O(/* @__PURE__ */ new Set()), z = D(/* @__PURE__ */ new Map());
111
+ }), [R, te] = k(/* @__PURE__ */ new Set()), z = O(/* @__PURE__ */ new Map());
112
112
  w(() => {
113
113
  let e = z.current;
114
114
  return () => {
@@ -117,43 +117,43 @@ var B = {
117
117
  }, []);
118
118
  let V = h != null, U = _ && !V, K = V || U ? "none" : void 0, q = "button";
119
119
  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 = D(null), [ie, ae] = O();
121
- ee(() => {
122
- Q.current && ae(Math.min(Q.current.scrollHeight, re));
120
+ let J = T(), Y = m != null, X = m?.toLowerCase() ?? "", Z = Y ? n.filter((e) => e.name.toLowerCase().includes(X)) : n, Q = O(null), [$, ie] = k();
121
+ E(() => {
122
+ Q.current && ie(Math.min(Q.current.scrollHeight, re));
123
123
  }, [n, m]);
124
- let oe = (e, t) => {
124
+ let ae = (e, t) => {
125
125
  e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i(t));
126
- }, $ = (e) => {
127
- R((t) => new Set(t).add(e));
126
+ }, oe = (e) => {
127
+ te((t) => new Set(t).add(e));
128
128
  let t = setTimeout(() => {
129
- a?.(e), R((t) => {
129
+ a?.(e), te((t) => {
130
130
  let n = new Set(t);
131
131
  return n.delete(e), n;
132
132
  }), z.current.delete(e);
133
133
  }, ne);
134
134
  z.current.set(e, t);
135
135
  };
136
- return /* @__PURE__ */ F("div", {
136
+ return /* @__PURE__ */ I("div", {
137
137
  className: r("flex w-full flex-col desktop:w-[280px]", l, B.favoritesPanel),
138
- style: I,
138
+ style: L,
139
139
  children: [
140
- /* @__PURE__ */ P("p", {
140
+ /* @__PURE__ */ F("p", {
141
141
  id: J,
142
142
  className: r(S, G, W.header),
143
- children: E
143
+ children: D
144
144
  }),
145
- /* @__PURE__ */ P("div", {
145
+ /* @__PURE__ */ F("div", {
146
146
  className: r("max-h-72 min-h-0 flex-1 overflow-y-auto", W.listContent),
147
- style: { maxHeight: ie },
148
- children: /* @__PURE__ */ P("div", {
147
+ style: { maxHeight: $ },
148
+ children: /* @__PURE__ */ F("div", {
149
149
  ref: Q,
150
- children: Z.length > 0 ? /* @__PURE__ */ P("ul", {
150
+ children: Z.length > 0 ? /* @__PURE__ */ F("ul", {
151
151
  id: h,
152
152
  role: V ? "listbox" : K,
153
153
  "aria-labelledby": V ? J : void 0,
154
154
  className: "flex flex-col gap-1 px-1 pb-1",
155
155
  children: Z.map((t) => {
156
- let n = V ? `${h}-${encodeURIComponent(t.id)}` : void 0, o = V ? -1 : void 0, l = /* @__PURE__ */ F("div", {
156
+ let n = V ? `${h}-${encodeURIComponent(t.id)}` : void 0, o = V ? -1 : void 0, l = /* @__PURE__ */ I("div", {
157
157
  role: q,
158
158
  id: n,
159
159
  "aria-selected": V ? n === g : void 0,
@@ -161,45 +161,45 @@ var B = {
161
161
  tabIndex: 0,
162
162
  className: r("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors", W.row, u),
163
163
  onClick: () => i(t),
164
- onKeyDown: (e) => oe(e, t),
164
+ onKeyDown: (e) => ae(e, t),
165
165
  children: [
166
- /* @__PURE__ */ P(e, {
166
+ /* @__PURE__ */ F(e, {
167
167
  size: c.MD,
168
168
  initialsName: t.name
169
169
  }),
170
- m == null ? /* @__PURE__ */ P("span", {
170
+ m == null ? /* @__PURE__ */ F("span", {
171
171
  className: r(x, "min-w-0 flex-1 truncate text-start"),
172
172
  children: t.name
173
- }) : /* @__PURE__ */ P(f, {
173
+ }) : /* @__PURE__ */ F(f, {
174
174
  text: t.name,
175
175
  query: m,
176
176
  maxLines: 1,
177
177
  className: r(x, "min-w-0 flex-1 text-start")
178
178
  }),
179
- a && /* @__PURE__ */ P(y, {
180
- icon: /* @__PURE__ */ P(j, {
179
+ a && /* @__PURE__ */ F(y, {
180
+ icon: /* @__PURE__ */ F(M, {
181
181
  size: c.SM,
182
182
  className: W.star,
183
183
  "aria-hidden": !0
184
184
  }),
185
- "aria-label": A,
185
+ "aria-label": j,
186
186
  isSelected: !0,
187
187
  tabIndex: o,
188
188
  onClick: (e) => {
189
- e.stopPropagation(), $(t.id);
189
+ e.stopPropagation(), oe(t.id);
190
190
  }
191
191
  })
192
192
  ]
193
193
  });
194
- return /* @__PURE__ */ P("li", {
194
+ return /* @__PURE__ */ F("li", {
195
195
  role: K,
196
- className: L.has(t.id) ? W.rowLeaving : W.rowEnter,
197
- children: s ? /* @__PURE__ */ P(p, {
196
+ className: R.has(t.id) ? W.rowLeaving : W.rowEnter,
197
+ children: s ? /* @__PURE__ */ F(p, {
198
198
  asChild: !0,
199
199
  contentClassName: "max-w-[550px]",
200
- content: /* @__PURE__ */ P(H, {
200
+ content: /* @__PURE__ */ F(H, {
201
201
  description: t.description,
202
- viewDetailsLabel: M,
202
+ viewDetailsLabel: N,
203
203
  onViewDetails: () => s(t),
204
204
  viewDetailsTabIndex: o
205
205
  }),
@@ -207,22 +207,22 @@ var B = {
207
207
  }) : l
208
208
  }, t.id);
209
209
  })
210
- }) : Y && X !== "" ? /* @__PURE__ */ P("p", {
210
+ }) : Y && X !== "" ? /* @__PURE__ */ F("p", {
211
211
  role: "status",
212
212
  "aria-live": "polite",
213
213
  className: r(C, "px-4 py-4 text-start", W.emptyHint),
214
- children: N
215
- }) : /* @__PURE__ */ P("p", {
214
+ children: P
215
+ }) : /* @__PURE__ */ F("p", {
216
216
  className: r(C, "px-4 py-4 text-start", W.emptyHint),
217
- children: te
217
+ children: ee
218
218
  })
219
219
  })
220
220
  }),
221
- /* @__PURE__ */ P("div", {
221
+ /* @__PURE__ */ F("div", {
222
222
  className: r("border-t px-2 py-3", W.footer),
223
- children: /* @__PURE__ */ P(d, {
223
+ children: /* @__PURE__ */ F(d, {
224
224
  role: U ? "menuitem" : void 0,
225
- label: k,
225
+ label: A,
226
226
  className: "w-full justify-center",
227
227
  onClick: o
228
228
  })
@@ -231,19 +231,19 @@ var B = {
231
231
  });
232
232
  }, q = ".zip,.md", J = ({ isOpen: e, errorText: t, isUploading: n = !1, accept: r = q, labels: i, onClose: a, onFilesSelected: o, onFilesRejected: s }) => {
233
233
  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__ */ P(h, {
234
+ return /* @__PURE__ */ F(h, {
235
235
  open: e,
236
236
  size: g.Sm,
237
237
  header: c,
238
238
  closeAriaLabel: m,
239
239
  onClose: a,
240
- children: /* @__PURE__ */ F("div", {
240
+ children: /* @__PURE__ */ I("div", {
241
241
  className: "flex flex-col gap-4 px-6 py-4",
242
- children: [/* @__PURE__ */ P(u, {
243
- label: /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("span", {
242
+ children: [/* @__PURE__ */ F(u, {
243
+ label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
244
244
  className: "desktop:hidden",
245
245
  children: d
246
- }), /* @__PURE__ */ P("span", {
246
+ }), /* @__PURE__ */ F("span", {
247
247
  className: "hidden desktop:inline",
248
248
  children: l
249
249
  })] }),
@@ -254,55 +254,56 @@ var B = {
254
254
  errorText: n ? void 0 : t,
255
255
  onChange: o,
256
256
  onReject: s
257
- }), n && /* @__PURE__ */ P(v, { ariaLabel: _ })]
257
+ }), n && /* @__PURE__ */ F(v, { ariaLabel: _ })]
258
258
  })
259
259
  });
260
- }, Y = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ P(h, {
260
+ }, Y = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ F(h, {
261
261
  open: e,
262
262
  header: r,
263
263
  size: g.Lg,
264
- className: "h-[min(90vh,860px)] !max-w-[min(95vw,1200px)] overflow-hidden",
264
+ className: "h-[min(90vh,860px)] !max-w-[min(95vw,1200px)] overflow-hidden mobile:h-full mobile:!max-w-full mobile:rounded-none",
265
+ overlayClassName: "mobile:p-0",
265
266
  onClose: t,
266
- children: /* @__PURE__ */ P("div", {
267
- className: "h-[min(80vh,840px)] overflow-auto",
268
- children: /* @__PURE__ */ P(S, {
267
+ children: /* @__PURE__ */ F("div", {
268
+ className: "h-[min(80vh,840px)] overflow-auto mobile:h-full",
269
+ children: /* @__PURE__ */ F(S, {
269
270
  fallback: null,
270
271
  children: e && i(n, t)
271
272
  })
272
273
  })
273
- }), X = (e, t = null) => e.map((e) => e.type === R.Folder ? {
274
+ }), X = (e, t = null) => e.map((e) => e.type === te.Folder ? {
274
275
  path: e.id,
275
276
  name: e.name,
276
- nodeType: I.FOLDER,
277
+ nodeType: L.FOLDER,
277
278
  parentPath: t,
278
279
  folderId: e.id,
279
280
  items: X(e.items, e.id)
280
281
  } : {
281
282
  path: e.id,
282
283
  name: e.name,
283
- nodeType: I.ITEM,
284
+ nodeType: L.ITEM,
284
285
  parentPath: t,
285
286
  folderId: t ?? ""
286
- }), Z = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => /* @__PURE__ */ P(L, {
287
- items: E(() => X(e), [e]),
287
+ }), Z = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => /* @__PURE__ */ F(R, {
288
+ items: D(() => X(e), [e]),
288
289
  showFiles: !0,
289
290
  areHiddenFilesVisible: !0,
290
291
  selectedPath: t,
291
- expandedPaths: E(() => new Set(n), [n]),
292
+ expandedPaths: D(() => new Set(n), [n]),
292
293
  onExpandedPathsChange: (e) => {
293
294
  for (let t of e) n.has(t) || r(t);
294
295
  for (let t of n) e.has(t) || r(t);
295
296
  },
296
297
  onItemClick: (e) => {
297
- e.nodeType === I.ITEM && i(e.path);
298
+ e.nodeType === L.ITEM && i(e.path);
298
299
  },
299
300
  ariaLabel: o,
300
301
  autoFocus: !0,
301
302
  onEscape: a
302
- }), Q = (e) => /* @__PURE__ */ P(z, {
303
+ }), Q = (e) => /* @__PURE__ */ F(z, {
303
304
  ...e,
304
- renderContentFileTree: (e) => /* @__PURE__ */ P(Z, { ...e })
305
- }), ie = (e) => e == null || /[\s/]/.test(e), ae = (e, t, n) => {
305
+ renderContentFileTree: (e) => /* @__PURE__ */ F(Z, { ...e })
306
+ }), $ = (e) => e == null || /[\s/]/.test(e), ie = (e, t, n) => {
306
307
  let r = [], i = 0;
307
308
  return t.forEach((t, a) => {
308
309
  let o = `/${n(t.url)}`, s = i;
@@ -310,7 +311,7 @@ var B = {
310
311
  let t = e.indexOf(o, s);
311
312
  if (t === -1) return;
312
313
  let n = t + o.length;
313
- if (ie(e[n])) {
314
+ if ($(e[n])) {
314
315
  r.push({
315
316
  skillIndex: a,
316
317
  start: t,
@@ -321,6 +322,22 @@ var B = {
321
322
  s = t + 1;
322
323
  }
323
324
  }), r;
325
+ }, ae = (e, t) => {
326
+ let n = /* @__PURE__ */ new Map();
327
+ t.forEach((e) => {
328
+ e.name !== "" && !n.has(e.name) && n.set(e.name, e.url);
329
+ });
330
+ let r = [...n.keys()].sort((e, t) => t.length - e.length), i = [], a = e.indexOf("/");
331
+ for (; a !== -1;) {
332
+ let t = a === 0 || /\s/.test(e[a - 1]), o = a + 1, s = t ? r.find((t) => e.startsWith(t, o) && $(e[o + t.length])) : void 0, c = s == null ? void 0 : n.get(s);
333
+ s != null && c != null ? (i.push({
334
+ url: c,
335
+ name: s,
336
+ start: a,
337
+ length: s.length + 1
338
+ }), a = e.indexOf("/", o + s.length)) : a = e.indexOf("/", o);
339
+ }
340
+ return i;
324
341
  }, oe = (e, t) => {
325
342
  let n = Math.min(e.length, t.length), r = 0;
326
343
  for (; r < n && e[r] === t[r];) r += 1;
@@ -331,13 +348,13 @@ var B = {
331
348
  deletedLength: e.length - r - a,
332
349
  insertedLength: t.length - r - a
333
350
  };
334
- }, $ = (e, t) => {
351
+ }, se = (e, t) => {
335
352
  let n = t.start + t.deletedLength, r = t.insertedLength - t.deletedLength;
336
353
  return e.reduce((e, i) => i.start + i.length <= t.start ? (e.push(i), e) : (i.start >= n && e.push({
337
354
  ...i,
338
355
  start: i.start + r
339
356
  }), e), []);
340
- }, se = (e, t, n, r, i) => {
357
+ }, ce = (e, t, n, r, i) => {
341
358
  let a = r.length + 1, o = a + +!!i, s = e.map((e) => e.start >= t ? {
342
359
  ...e,
343
360
  start: e.start + o
@@ -348,7 +365,7 @@ var B = {
348
365
  length: a
349
366
  };
350
367
  return [...s, c].sort((e, t) => e.start - t.start);
351
- }, ce = (e, t) => e.find((e) => e.start + e.length === t), le = (e, t, n) => {
368
+ }, le = (e, t) => e.find((e) => e.start + e.length === t), ue = (e, t, n) => {
352
369
  let r = t;
353
370
  for (; r > 0 && !/\s/.test(e[r - 1]);) r--;
354
371
  let i = r;
@@ -358,26 +375,45 @@ var B = {
358
375
  start: r,
359
376
  end: i
360
377
  };
361
- }, ue = () => {
362
- let [e, t] = O(""), [n, r] = O([]), i = D(e);
378
+ }, de = (e, t, n) => {
379
+ if (n === "" || t.insertedLength < n.length) return;
380
+ let r = e.indexOf(n, Math.max(0, t.start - n.length)), i = t.start + t.insertedLength - n.length;
381
+ return r !== -1 && r <= i ? r : void 0;
382
+ }, fe = () => {
383
+ let [e, t] = k(""), [n, r] = k([]), i = O(e);
363
384
  i.current = e;
364
- let a = D(n);
385
+ let a = O(n);
365
386
  a.current = n;
366
- let o = C((e) => {
367
- let n = oe(i.current, e);
368
- r((e) => $(e, n)), i.current = e, t(e);
369
- }, []), s = C((e, n, a) => {
370
- let o = i.current, s = !/^\s/.test(o.slice(a)), c = `/${n}${s ? " " : ""}`, l = o.slice(0, a) + c + o.slice(a);
371
- return i.current = l, t(l), r((t) => se(t, a, e, n, s)), s;
387
+ let o = O(null), s = C((e) => {
388
+ let n = oe(i.current, e), a = o.current;
389
+ o.current = null;
390
+ let s = a == null ? void 0 : de(e, n, a.text);
391
+ r((t) => {
392
+ let r = se(t, n);
393
+ if (a == null || s == null) return r;
394
+ let i = a.mentions.map((e) => ({
395
+ ...e,
396
+ start: e.start + s
397
+ })).filter((t) => e.startsWith(`/${t.name}`, t.start) && !r.some((e) => e.start < t.start + t.length && t.start < e.start + e.length));
398
+ return [...r, ...i].sort((e, t) => e.start - t.start);
399
+ }), i.current = e, t(e);
372
400
  }, []), c = C((e, n, a) => {
401
+ let o = i.current, s = !/^\s/.test(o.slice(a)), c = `/${n}${s ? " " : ""}`, l = o.slice(0, a) + c + o.slice(a);
402
+ return i.current = l, t(l), r((t) => ce(t, a, e, n, s)), s;
403
+ }, []), l = C((e, n, a) => {
373
404
  let o = i.current, s = `/${n}`, c = o.slice(0, a) + s + o.slice(a);
374
- i.current = c, t(c), r((t) => se(t, a, e, n, !1));
375
- }, []), l = C((e) => ce(a.current, e), []), u = E(() => {
405
+ i.current = c, t(c), r((t) => ce(t, a, e, n, !1));
406
+ }, []), u = C((e) => le(a.current, e), []), d = D(() => {
376
407
  if (n.length !== 0) return n.map((e) => ({ url: e.url }));
377
- }, [n]), d = C(() => {
408
+ }, [n]), f = C((e, t) => {
409
+ o.current = t.length > 0 ? {
410
+ text: e,
411
+ mentions: t
412
+ } : null;
413
+ }, []), p = C(() => {
378
414
  t(""), r([]);
379
- }, []), f = C((e, n, i) => {
380
- let a = n ?? [], o = ae(e, a, i);
415
+ }, []), m = C((e, n, i) => {
416
+ let a = n ?? [], o = ie(e, a, i);
381
417
  t(e), r(o.map((e) => {
382
418
  let t = a[e.skillIndex];
383
419
  return {
@@ -388,39 +424,41 @@ var B = {
388
424
  };
389
425
  }));
390
426
  }, []);
391
- return E(() => ({
427
+ return D(() => ({
392
428
  draft: e,
393
429
  anchors: n,
394
- onDraftChange: o,
395
- insertMention: s,
396
- restoreMention: c,
397
- onBackspaceAtCaret: l,
398
- orderedSkills: u,
399
- reset: d,
400
- seedFromMessage: f
430
+ onDraftChange: s,
431
+ insertMention: c,
432
+ restoreMention: l,
433
+ onBackspaceAtCaret: u,
434
+ orderedSkills: d,
435
+ reset: p,
436
+ seedFromMessage: m,
437
+ expectInsertion: f
401
438
  }), [
439
+ f,
402
440
  e,
403
441
  n,
404
- o,
405
442
  s,
406
443
  c,
407
444
  l,
408
445
  u,
409
446
  d,
410
- f
447
+ p,
448
+ m
411
449
  ]);
412
- }, de = (e) => ({
450
+ }, pe = (e) => ({
413
451
  id: e.url,
414
452
  name: e.name,
415
453
  description: e.description
416
- }), fe = (e) => {
454
+ }), me = (e) => {
417
455
  let t = e.split("/").filter((e) => e.length > 0);
418
456
  return t[t.length - 1] ?? e;
419
- }, pe = (e) => {
457
+ }, he = (e) => {
420
458
  let t = e.split("/").filter((e) => e.length > 0);
421
459
  return t[0] !== "skills" || t.length < 3 ? null : t[1];
422
- }, 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, activeMentionLabelClassName: d = "text-accent", activeMentionDetailsTrigger: f, historyDetailsTrigger: p, renderCatalogContent: m, detailsPanelComponent: h }) => {
423
- 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 = ue(), V = E(() => [
460
+ }, 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 }) => {
461
+ let { addMenuLabel: g = "Skills", backLabel: _ = "Back", catalogModalTitleLabel: v = "Use skill", emptyQueryHintLabel: y = "Type to filter", deletedTooltipLabel: b, notSharedTooltipLabel: x, unsupportedTooltipLabel: w, panelLabels: T } = c ?? {}, [E, A] = k(!1), [j, M] = k(null), [N, P] = k(0), I = O(null), [L, R] = k(0), [te, z] = k(void 0), B = fe(), V = D(() => [
424
462
  ...t,
425
463
  ...n ?? [],
426
464
  ...r ?? []
@@ -428,18 +466,18 @@ var B = {
428
466
  t,
429
467
  n,
430
468
  r
431
- ]), H = E(() => new Map(V.map((e) => [e.url, e])), [V]), W = C((e) => H.get(e)?.name ?? fe(e), [H]), G = E(() => V.filter((e) => a.has(e.url)).map((e) => de(e)), [V, a]), ne = B.anchors.length > 0 && !e, re = E(() => B.anchors.map((t) => ({
469
+ ]), H = D(() => new Map(V.map((e) => [e.url, e])), [V]), W = C((e) => H.get(e)?.name ?? me(e), [H]), G = D(() => V.filter((e) => a.has(e.url)).map((e) => pe(e)), [V, a]), ne = B.anchors.length > 0 && !e, re = D(() => B.anchors.map((t) => ({
432
470
  start: t.start,
433
471
  length: t.length,
434
472
  isUnsupported: !e,
435
- render: () => /* @__PURE__ */ P(U, {
473
+ render: () => /* @__PURE__ */ F(U, {
436
474
  name: t.name,
437
475
  path: t.url,
438
476
  labelClassName: d,
439
477
  description: H.get(t.url)?.description,
440
478
  isUnsupported: !e,
441
479
  detailsTrigger: f,
442
- onViewDetails: j,
480
+ onViewDetails: M,
443
481
  labels: {
444
482
  viewDetailsLabel: T?.viewDetailsLabel,
445
483
  unsupportedTooltipLabel: w
@@ -455,12 +493,12 @@ var B = {
455
493
  w
456
494
  ]), q = C((e, t, n) => {
457
495
  let r = B.insertMention(e, t, n);
458
- L((e) => e + 1), z(n + 1 + t.length + +!!r);
496
+ R((e) => e + 1), z(n + 1 + t.length + +!!r);
459
497
  }, [B]), J = C((e) => {
460
- let t = le(B.draft, e, he);
498
+ let t = ue(B.draft, e, _e);
461
499
  return t == null ? e : (B.onDraftChange(B.draft.slice(0, t.start) + B.draft.slice(t.end)), t.start);
462
500
  }, [B]), X = C((e) => {
463
- let t = le(B.draft, e, he);
501
+ let t = ue(B.draft, e, _e);
464
502
  if (t == null) return;
465
503
  let n = B.anchors.find((e) => e.start === t.start && e.start + e.length === t.end);
466
504
  return {
@@ -469,23 +507,29 @@ var B = {
469
507
  mentionUrl: n?.url
470
508
  };
471
509
  }, [B]), Z = C(() => {
472
- B.reset(), L((e) => e + 1), z(void 0);
473
- }, [B]), Q = C((e, t) => {
474
- B.seedFromMessage(e, t, W), L((e) => e + 1), z(void 0);
475
- }, [B, W]), ie = C((e, t) => {
510
+ B.reset(), R((e) => e + 1), z(void 0);
511
+ }, [B]), { expectInsertion: Q } = B, $ = C((t) => {
512
+ Q(t, e ? ae(t, V) : []);
513
+ }, [
514
+ Q,
515
+ e,
516
+ V
517
+ ]), oe = C((e, t) => {
518
+ B.seedFromMessage(e, t, W), R((e) => e + 1), z(void 0);
519
+ }, [B, W]), se = C((e, t) => {
476
520
  if (t == null || t.length === 0) return null;
477
- let n = ae(e, t, W), r = [], i = 0;
521
+ let n = ie(e, t, W), r = [], i = 0;
478
522
  return n.forEach((n) => {
479
523
  n.start > i && r.push(e.slice(i, n.start));
480
- let a = t[n.skillIndex], s = H.get(a.url), c = s?.name ?? fe(a.url), l = s == null ? me(a.url, o) : void 0;
481
- r.push(/* @__PURE__ */ P(U, {
524
+ 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;
525
+ r.push(/* @__PURE__ */ F(U, {
482
526
  name: c,
483
527
  path: a.url,
484
528
  labelClassName: u,
485
529
  description: s?.description,
486
530
  unresolvedReason: l,
487
531
  detailsTrigger: p,
488
- onViewDetails: j,
532
+ onViewDetails: M,
489
533
  labels: {
490
534
  viewDetailsLabel: T?.viewDetailsLabel,
491
535
  deletedTooltipLabel: b,
@@ -502,16 +546,16 @@ var B = {
502
546
  o,
503
547
  b,
504
548
  x
505
- ]), oe = C((e) => e == null || e.length === 0 ? null : e.map((e) => {
506
- let t = H.get(e.url), n = t?.name ?? fe(e.url), r = t == null ? me(e.url, o) : void 0;
507
- return /* @__PURE__ */ P(U, {
549
+ ]), ce = C((e) => e == null || e.length === 0 ? null : e.map((e) => {
550
+ let t = H.get(e.url), n = t?.name ?? me(e.url), r = t == null ? ge(e.url, o) : void 0;
551
+ return /* @__PURE__ */ F(U, {
508
552
  name: n,
509
553
  path: e.url,
510
554
  labelClassName: u,
511
555
  description: t?.description,
512
556
  unresolvedReason: r,
513
557
  detailsTrigger: p,
514
- onViewDetails: j,
558
+ onViewDetails: M,
515
559
  labels: {
516
560
  viewDetailsLabel: T?.viewDetailsLabel,
517
561
  deletedTooltipLabel: b,
@@ -526,7 +570,7 @@ var B = {
526
570
  o,
527
571
  b,
528
572
  x
529
- ]), $ = C((e, t) => /* @__PURE__ */ P(K, {
573
+ ]), le = C((e, t) => /* @__PURE__ */ F(K, {
530
574
  favorites: G,
531
575
  isMenu: !0,
532
576
  onSelect: (n) => {
@@ -535,10 +579,10 @@ var B = {
535
579
  onToggleFavorite: s,
536
580
  onBrowse: () => {
537
581
  let n = X(t);
538
- N(J(t)), F.current = n ?? null, e(), k(!0);
582
+ P(J(t)), I.current = n ?? null, e(), A(!0);
539
583
  },
540
584
  onViewDetails: (n) => {
541
- J(t), e(), j(n.id);
585
+ J(t), e(), M(n.id);
542
586
  },
543
587
  labels: T
544
588
  }), [
@@ -550,27 +594,28 @@ var B = {
550
594
  T
551
595
  ]);
552
596
  return {
553
- skillMenuOverlay: E(() => e ? {
597
+ skillMenuOverlay: D(() => e ? {
554
598
  key: "skills",
555
599
  title: g,
556
- icon: /* @__PURE__ */ P(te, {
600
+ icon: /* @__PURE__ */ F(ee, {
557
601
  size: i,
558
602
  "aria-hidden": !0,
559
603
  stroke: l
560
604
  }),
561
- renderOverlay: $,
605
+ renderOverlay: le,
562
606
  backLabel: _
563
607
  } : void 0, [
564
608
  e,
565
609
  g,
566
610
  _,
567
- $
611
+ le
568
612
  ]),
569
- commandMenu: E(() => e ? {
570
- triggerPrefix: he,
613
+ commandMenu: D(() => e ? {
614
+ triggerPrefix: _e,
571
615
  menuLabel: g,
572
616
  emptyQueryHint: y,
573
- renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ P(K, {
617
+ onTextPaste: $,
618
+ renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ F(K, {
574
619
  favorites: G,
575
620
  searchQuery: e,
576
621
  listboxId: r,
@@ -580,18 +625,18 @@ var B = {
580
625
  },
581
626
  onToggleFavorite: s,
582
627
  onBrowse: () => {
583
- let r = `${he}${e}`, i = B.anchors.find((e) => e.start === t && e.length === r.length);
628
+ let r = `${_e}${e}`, i = B.anchors.find((e) => e.start === t && e.length === r.length);
584
629
  n({
585
630
  consumeQuery: !0,
586
631
  returnFocus: !1
587
- }), N(t), F.current = {
632
+ }), P(t), I.current = {
588
633
  position: t,
589
634
  text: r,
590
635
  mentionUrl: i?.url
591
- }, k(!0);
636
+ }, A(!0);
592
637
  },
593
638
  onViewDetails: (e) => {
594
- n({ consumeQuery: !0 }), j(e.id);
639
+ n({ consumeQuery: !0 }), M(e.id);
595
640
  },
596
641
  labels: T
597
642
  })
@@ -603,69 +648,71 @@ var B = {
603
648
  q,
604
649
  B.anchors,
605
650
  s,
606
- T
651
+ T,
652
+ $
607
653
  ]),
608
- skillCatalogModal: /* @__PURE__ */ P(Y, {
609
- isOpen: ee,
654
+ skillCatalogModal: /* @__PURE__ */ F(Y, {
655
+ isOpen: E,
610
656
  onClose: C(() => {
611
- k(!1);
612
- let e = F.current;
613
- if (F.current = null, e == null) return;
657
+ A(!1);
658
+ let e = I.current;
659
+ if (I.current = null, e == null) return;
614
660
  let { position: t, text: n, mentionUrl: r } = e;
615
- 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);
661
+ r == null ? B.onDraftChange(B.draft.slice(0, t) + n + B.draft.slice(t)) : B.restoreMention(r, n.slice(1), t), R((e) => e + 1), z(t + n.length);
616
662
  }, [B]),
617
663
  onSelect: (e) => {
618
- F.current = null, q(e, W(e), M), k(!1);
664
+ I.current = null, q(e, W(e), N), A(!1);
619
665
  },
620
666
  title: v,
621
667
  renderContent: m
622
668
  }),
623
- skillDetailsPanel: /* @__PURE__ */ P(S, {
669
+ skillDetailsPanel: /* @__PURE__ */ F(S, {
624
670
  fallback: null,
625
- children: /* @__PURE__ */ P(h, {
626
- skillId: A,
627
- onClose: () => j(null)
671
+ children: /* @__PURE__ */ F(h, {
672
+ skillId: j,
673
+ onClose: () => M(null)
628
674
  })
629
675
  }),
630
676
  message: B.draft,
631
- messageRevision: I,
677
+ messageRevision: L,
632
678
  activeMentions: re,
633
679
  onDraftChange: B.onDraftChange,
634
680
  onBackspaceAtCaret: B.onBackspaceAtCaret,
635
- caretPositionOverride: R,
681
+ caretPositionOverride: te,
636
682
  isSkillUnsupported: ne,
637
683
  selectedSkills: B.orderedSkills,
638
684
  resetSkillMentions: Z,
639
- seedSkillMentions: Q,
640
- renderHistorySkillSegments: ie,
641
- renderHistorySkills: oe
685
+ seedSkillMentions: oe,
686
+ recognizeMentionsInInsertion: $,
687
+ renderHistorySkillSegments: se,
688
+ renderHistorySkills: ce
642
689
  };
643
- }, _e = {
690
+ }, ye = {
644
691
  background: "_background_1ult0_1",
645
692
  border: "_border_1ult0_5",
646
693
  value: "_value_1ult0_9",
647
694
  clear: "_clear_1ult0_13",
648
695
  invalid: "_invalid_1ult0_17"
649
- }, 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 }) => {
650
- 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 ?? ye, A = !l && i.length === 0, j = d ?? (A ? k : void 0), M = new Map(i.map((e) => [e, {
696
+ }, 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 }) => {
697
+ 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 ?? xe, j = !l && i.length === 0, M = d ?? (j ? A : void 0), N = new Map(i.map((e) => [e, {
651
698
  id: e,
652
699
  name: o?.[e] || e
653
700
  }]));
654
- s.forEach((e) => M.set(e.id, e));
655
- let N = [...M.values()].map((t) => ({
701
+ s.forEach((e) => N.set(e.id, e));
702
+ let P = [...N.values()].map((t) => ({
656
703
  value: t.id,
657
704
  label: t.name,
658
- labelNode: y.trim() ? /* @__PURE__ */ P(f, {
705
+ labelNode: y.trim() ? /* @__PURE__ */ F(f, {
659
706
  text: t.name,
660
707
  query: y,
661
708
  maxLines: 1
662
709
  }) : void 0,
663
- icon: /* @__PURE__ */ P(e, {
710
+ icon: /* @__PURE__ */ F(e, {
664
711
  size: c.SM,
665
712
  initialsName: t.name
666
713
  }),
667
714
  disabled: !l
668
- })), I = {
715
+ })), L = {
669
716
  ...t({
670
717
  "--ssf-text": h?.colors?.text,
671
718
  "--ssf-bg": h?.colors?.background,
@@ -674,57 +721,57 @@ var B = {
674
721
  }),
675
722
  ...h?.cssVars
676
723
  };
677
- return ee(() => {
724
+ return E(() => {
678
725
  let e = S.current?.querySelector("[role=\"combobox\"]");
679
- e && (j ? e.setAttribute("aria-describedby", C) : e.removeAttribute("aria-describedby"), d || w ? e.setAttribute("aria-invalid", "true") : e.removeAttribute("aria-invalid"));
726
+ e && (M ? e.setAttribute("aria-describedby", C) : e.removeAttribute("aria-describedby"), d || w ? e.setAttribute("aria-invalid", "true") : e.removeAttribute("aria-invalid"));
680
727
  }, [
681
- j,
728
+ M,
682
729
  C,
683
730
  d,
684
731
  u,
685
732
  w
686
- ]), /* @__PURE__ */ F("div", {
733
+ ]), /* @__PURE__ */ I("div", {
687
734
  ref: S,
688
735
  className: r("min-w-0", m, B.selectorField),
689
- style: I,
690
- children: [/* @__PURE__ */ P(b, {
691
- tooltip: k,
736
+ style: L,
737
+ children: [/* @__PURE__ */ F(b, {
738
+ tooltip: A,
692
739
  hideTooltip: l,
693
740
  triggerClassName: "block w-full min-w-0",
694
- children: /* @__PURE__ */ P("div", {
741
+ children: /* @__PURE__ */ F("div", {
695
742
  inert: u ? !0 : void 0,
696
- children: /* @__PURE__ */ P(_, {
743
+ children: /* @__PURE__ */ F(_, {
697
744
  multiple: !0,
698
745
  searchable: !0,
699
- open: te,
746
+ open: ee,
700
747
  onOpenChange: (e) => {
701
- e && !E || v(e);
748
+ e && !D || v(e);
702
749
  },
703
750
  onSearchQueryChange: x,
704
751
  value: i,
705
752
  onChange: (e) => {
706
753
  u || a(Array.isArray(e) ? e : [e]);
707
754
  },
708
- options: N,
755
+ options: P,
709
756
  placeholder: p.placeholder,
710
757
  labelProps: { label: p.fieldLabel },
711
758
  error: d,
712
- caption: A ? k : void 0,
759
+ caption: j ? A : void 0,
713
760
  searchPlaceholder: p.searchPlaceholder ?? "Search skills",
714
761
  emptyStateTitle: y.trim() ? p.noMatchingSkillsLabel ?? "No matching skills" : p.emptyLabel ?? "No skills available",
715
- disabled: u || A,
762
+ disabled: u || j,
716
763
  invalid: !!d || w,
717
764
  className: "w-full min-w-0",
718
- fieldClassName: r(E ? "cursor-pointer" : "cursor-not-allowed", "--ssf-bg" in I && _e.background, "--ssf-border" in I && _e.border, "--ssf-text" in I && _e.value, (d || w) && _e.invalid, h?.typography?.fontClassName ?? "dial-small-text", h?.triggerClassName),
765
+ fieldClassName: r(D ? "cursor-pointer" : "cursor-not-allowed", "--ssf-bg" in L && ye.background, "--ssf-border" in L && ye.border, "--ssf-text" in L && ye.value, (d || w) && ye.invalid, h?.typography?.fontClassName ?? "dial-small-text", h?.triggerClassName),
719
766
  listClassName: "w-[min(var(--reference-width),calc(100vw-2rem))] max-w-full"
720
767
  })
721
768
  })
722
- }), j && /* @__PURE__ */ P("span", {
769
+ }), M && /* @__PURE__ */ F("span", {
723
770
  id: C,
724
771
  className: "sr-only",
725
- children: j
772
+ children: M
726
773
  })]
727
774
  });
728
775
  };
729
776
  //#endregion
730
- 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, oe as diffTextChange, ce as findMentionAtCaret, fe as getSkillFallbackName, se as insertAnchor, ae as matchSkillMentions, $ as reconcileAnchors, ue as useSkillMentions, ge as useSkillSelectorOverlay };
777
+ 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, Se as SkillSelectorField, V as SkillUnresolvedReason, pe as buildFavoriteSkillItem, oe as diffTextChange, le as findMentionAtCaret, me as getSkillFallbackName, ce as insertAnchor, ie as matchSkillMentions, se as reconcileAnchors, fe as useSkillMentions, ve as useSkillSelectorOverlay };
@@ -224,6 +224,15 @@ export interface UseSkillSelectorOverlayResult {
224
224
  * `custom_content.skills`.
225
225
  */
226
226
  seedSkillMentions: (content: string, skills: RequestSkill[] | undefined) => void;
227
+ /**
228
+ * Marks `text` as about to be inserted into the composer (e.g. a picked
229
+ * prompt): once the insertion reaches `onDraftChange`, every `/{name}` run
230
+ * in it that names a listed skill becomes a tracked mention. Call right
231
+ * before handing `text` to the composer's insertion channel. A no-op on a
232
+ * deployment without skills support. A paste into the input goes through
233
+ * the same recognition via `commandMenu.onTextPaste`.
234
+ */
235
+ recognizeMentionsInInsertion: (text: string) => void;
227
236
  /**
228
237
  * Renders a user message's `content` and `custom_content.skills` as an
229
238
  * ordered array interleaving plain-text runs and `ChatSkill` elements at
@@ -1 +1 @@
1
- {"version":3,"file":"skill-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C/B,IAAI,CAAC;IACV;;;;;;;OAOG;IACH,4BAA4B,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD;;;;;;;;;;;;;;OAcG;IACH,0BAA0B,EAAE,CAC1B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,KAC/B,SAAS,EAAE,GAAG,IAAI,CAAC;IACxB;;;;;;;OAOG;IACH,mBAAmB,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,KAAK,SAAS,CAAC;CACxE"}
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-rc.0",
4
+ "version": "1.2.0-rc.2",
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-rc.0",
22
- "@epam/ai-dial-conversation-input": "1.2.0-rc.0"
21
+ "@epam/ai-dial-catalog": "1.2.0-rc.2",
22
+ "@epam/ai-dial-conversation-input": "1.2.0-rc.2"
23
23
  },
24
24
  "peerDependencies": {
25
- "@epam/ai-dial-chat-shared": "1.2.0-rc.0",
25
+ "@epam/ai-dial-chat-shared": "1.2.0-rc.2",
26
26
  "@epam/ai-dial-react-file-manager": "^0.3.0",
27
- "@epam/ai-dial-ui-kit": "^0.15.0",
27
+ "@epam/ai-dial-ui-kit": "^0.15.1",
28
28
  "react": "^19.2.8"
29
29
  },
30
30
  "repository": {
@@ -1,4 +1,6 @@
1
1
  import { RequestSkill } from '@epam/ai-dial-chat-shared';
2
+ import { SkillListingEntry } from '../models/favorite-skill-item';
3
+ import { SkillMentionAnchor } from '../models/skill-mention-anchor';
2
4
  /** One resolved mention location, or omitted for a skill whose text mention could not be found. */
3
5
  export interface ResolvedSkillMention {
4
6
  /** Index into the input `skills` array this location resolves. */
@@ -22,4 +24,11 @@ export interface ResolvedSkillMention {
22
24
  * independent forward search from the same unmoved cursor.
23
25
  */
24
26
  export declare const matchSkillMentions: (text: string, skills: RequestSkill[], resolveName: (url: string) => string) => ResolvedSkillMention[];
27
+ /**
28
+ * Returns every `/{name}` run in `text` that names one of `skills`, as mention
29
+ * anchors with offsets into `text`. A run must start the text or follow
30
+ * whitespace and end at a word boundary; the longest matching name wins, and
31
+ * a name shared by several skills resolves to the first of them in `skills`.
32
+ */
33
+ export declare const findSkillMentionsInText: (text: string, skills: Pick<SkillListingEntry, "url" | "name">[]) => SkillMentionAnchor[];
25
34
  //# sourceMappingURL=skill-mention-matching.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-mention-matching.d.ts","sourceRoot":"","sources":["../../src/utils/skill-mention-matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,mGAAmG;AACnG,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,MAAM,EACZ,QAAQ,YAAY,EAAE,EACtB,aAAa,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACnC,oBAAoB,EA0BtB,CAAC"}
1
+ {"version":3,"file":"skill-mention-matching.d.ts","sourceRoot":"","sources":["../../src/utils/skill-mention-matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,mGAAmG;AACnG,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,MAAM,EACZ,QAAQ,YAAY,EAAE,EACtB,aAAa,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACnC,oBAAoB,EA0BtB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,MAAM,EACZ,QAAQ,IAAI,CAAC,iBAAiB,EAAE,KAAK,GAAG,MAAM,CAAC,EAAE,KAChD,kBAAkB,EAiCpB,CAAC"}
@@ -48,4 +48,9 @@ export declare const findSlashQueryAtCaret: (text: string, caretPosition: number
48
48
  start: number;
49
49
  end: number;
50
50
  } | undefined;
51
+ /**
52
+ * Returns the offset in `next` at which `text` landed when `change` is the
53
+ * edit that inserted it, or `undefined` when `change` cannot have inserted it.
54
+ */
55
+ export declare const findInsertedTextOffset: (next: string, change: TextChange, text: string) => number | undefined;
51
56
  //# sourceMappingURL=skill-mention-tracking.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-mention-tracking.d.ts","sourceRoot":"","sources":["../../src/utils/skill-mention-tracking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,yFAAyF;AACzF,MAAM,WAAW,UAAU;IACzB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,EAAE,MAAM,MAAM,KAAG,UAy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