@epam/ai-dial-prompts 1.2.0-dev.48 → 1.2.0-dev.58

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":"FavoritePromptsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/FavoritePromptsPanel/FavoritePromptsPanel.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAgD,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAQ3F;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA+L9D,CAAC"}
1
+ {"version":3,"file":"FavoritePromptsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/FavoritePromptsPanel/FavoritePromptsPanel.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAgD,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAG9E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAQ3F;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAqM9D,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const PROMPTS_CLASS: {
2
+ /** The favorite-prompts panel root, which carries the themed CSS variables. */
3
+ readonly favoritesPanel: "dial-prompts-favorites-panel";
4
+ };
5
+ //# sourceMappingURL=public-class-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,aAAa;IACxB,+EAA+E;;CAEvE,CAAC"}
package/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export { PromptParametersPopup } from './components/PromptParametersPopup/Prompt
3
3
  export type { FavoritePromptItem } from './models/favorite-prompt-item';
4
4
  export type { FavoritePromptsPanelColors, FavoritePromptsPanelLabels, FavoritePromptsPanelProps, } from './models/favorite-prompts-panel-props';
5
5
  export type { PromptParametersPopupColors, PromptParametersPopupLabels, PromptParametersPopupProps, } from './models/prompt-parameters-popup-props';
6
+ export { PROMPTS_CLASS } from './constants/public-class-names';
6
7
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AACjG,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,YAAY,EACV,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,wCAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AACjG,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,YAAY,EACV,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC"}
package/index.js CHANGED
@@ -4,7 +4,8 @@ import { IconChevronLeft as y, IconStarFilled as b } from "@tabler/icons-react";
4
4
  import { useEffect as x, useId as S, useLayoutEffect as C, useRef as w, useState as T } from "react";
5
5
  import { jsx as E, jsxs as D } from "react/jsx-runtime";
6
6
  import { AppIdentity as O, ContentTab as k, DeploymentSize as A } from "@epam/ai-dial-catalog";
7
- var j = {
7
+ //#region src/constants/public-class-names.ts
8
+ var j = { favoritesPanel: "dial-prompts-favorites-panel" }, M = {
8
9
  header: "_header_1pyx6_3",
9
10
  emptyHint: "_emptyHint_1pyx6_7",
10
11
  star: "_star_1pyx6_11",
@@ -14,46 +15,46 @@ var j = {
14
15
  rowLeaving: "_rowLeaving_1pyx6_27",
15
16
  rowFadeOut: "_rowFadeOut_1pyx6_1",
16
17
  listContent: "_listContent_1pyx6_55"
17
- }, M = "px-3 pb-0.5 pt-2", N = 180, P = ({ favorites: e, onSelect: a, onToggleFavorite: c, onBrowse: u, labels: p = {}, colors: m, nameClassName: h = "dial-small-text", headerClassName: g = "dial-tiny-lead-semi-text", emptyHintClassName: _ = "dial-small-text" }) => {
18
+ }, N = "px-3 pb-0.5 pt-2", P = 180, F = ({ favorites: e, onSelect: a, onToggleFavorite: c, onBrowse: u, labels: p = {}, colors: m, nameClassName: h = "dial-small-text", headerClassName: g = "dial-tiny-lead-semi-text", emptyHintClassName: _ = "dial-small-text" }) => {
18
19
  let { myCollectionLabel: y = "My Collection", emptyHintLabel: S = "Star a prompt to pin it here", browseLabel: O = "Browse", removeFromFavoritesLabel: k = "Remove from favorites" } = p, A = i({
19
20
  "--fp-header-text": m?.headerText,
20
21
  "--fp-empty-hint-text": m?.emptyHintText,
21
22
  "--fp-star-color": m?.starColor,
22
23
  "--fp-footer-border": m?.footerBorder
23
- }), [P, F] = T(/* @__PURE__ */ new Set()), I = w(/* @__PURE__ */ new Map());
24
+ }), [F, I] = T(/* @__PURE__ */ new Set()), L = w(/* @__PURE__ */ new Map());
24
25
  x(() => {
25
- let e = I.current;
26
+ let e = L.current;
26
27
  return () => {
27
28
  e.forEach((e) => clearTimeout(e)), e.clear();
28
29
  };
29
30
  }, []);
30
- let L = w(null), [R, z] = T();
31
+ let R = w(null), [z, B] = T();
31
32
  C(() => {
32
- L.current && z(Math.min(L.current.scrollHeight, r));
33
+ R.current && B(Math.min(R.current.scrollHeight, r));
33
34
  }, [e]);
34
- let B = (e) => {
35
- F((t) => new Set(t).add(e));
35
+ let V = (e) => {
36
+ I((t) => new Set(t).add(e));
36
37
  let t = setTimeout(() => {
37
- c(e), F((t) => {
38
+ c(e), I((t) => {
38
39
  let n = new Set(t);
39
40
  return n.delete(e), n;
40
- }), I.current.delete(e);
41
- }, N);
42
- I.current.set(e, t);
41
+ }), L.current.delete(e);
42
+ }, P);
43
+ L.current.set(e, t);
43
44
  };
44
45
  return /* @__PURE__ */ D("div", {
45
- className: "flex min-w-[240px] flex-col",
46
+ className: o("flex min-w-[240px] flex-col", j.favoritesPanel),
46
47
  style: A,
47
48
  children: [
48
49
  /* @__PURE__ */ E("p", {
49
- className: o(g, M, j.header),
50
+ className: o(g, N, M.header),
50
51
  children: y
51
52
  }),
52
53
  /* @__PURE__ */ E("div", {
53
- className: o(n, "min-h-0 flex-1 overflow-y-auto", j.listContent),
54
- style: { maxHeight: R },
54
+ className: o(n, "min-h-0 flex-1 overflow-y-auto", M.listContent),
55
+ style: { maxHeight: z },
55
56
  children: /* @__PURE__ */ E("div", {
56
- ref: L,
57
+ ref: R,
57
58
  children: e.length > 0 ? /* @__PURE__ */ E("ul", {
58
59
  className: "flex flex-col gap-1 px-1 pb-1",
59
60
  children: e.map((e) => {
@@ -69,16 +70,16 @@ var j = {
69
70
  rightControl: /* @__PURE__ */ E(v, {
70
71
  icon: /* @__PURE__ */ E(b, {
71
72
  size: s.SM,
72
- className: j.star,
73
+ className: M.star,
73
74
  "aria-hidden": !0
74
75
  }),
75
76
  "aria-label": k,
76
77
  isSelected: !0,
77
- onClick: () => B(e.id)
78
+ onClick: () => V(e.id)
78
79
  })
79
80
  }), r = e.description != null && e.description !== "";
80
81
  return /* @__PURE__ */ E("li", {
81
- className: P.has(e.id) ? j.rowLeaving : j.rowEnter,
82
+ className: F.has(e.id) ? M.rowLeaving : M.rowEnter,
82
83
  children: r ? /* @__PURE__ */ E(d, {
83
84
  asChild: !0,
84
85
  contentClassName: "max-w-[550px]",
@@ -91,13 +92,13 @@ var j = {
91
92
  }, e.id);
92
93
  })
93
94
  }) : /* @__PURE__ */ E("p", {
94
- className: o(_, "px-4 py-4 text-start", j.emptyHint),
95
+ className: o(_, "px-4 py-4 text-start", M.emptyHint),
95
96
  children: S
96
97
  })
97
98
  })
98
99
  }),
99
100
  /* @__PURE__ */ E("div", {
100
- className: o("border-t px-2 py-3", j.footer),
101
+ className: o("border-t px-2 py-3", M.footer),
101
102
  children: /* @__PURE__ */ E(l, {
102
103
  label: O,
103
104
  className: "w-full justify-center",
@@ -106,8 +107,8 @@ var j = {
106
107
  })
107
108
  ]
108
109
  });
109
- }, F = { card: "_card_p8vwa_1" }, I = ({ open: t, promptName: n, content: r, description: s, parameters: l, onBack: d, onClose: f, onSubmit: v, onCancel: b, labels: x = {}, colors: C, titleClassName: w = "dial-h2-text", parametersLabelClassName: j = "dial-h2-text", detailsLabelClassName: M = "dial-h2-text" }) => {
110
- let { title: N = "Prompt parameters", closeLabel: P = "Close", backLabel: I = "Back", parametersLabel: L = "Parameters", detailsLabel: R = "Details", enterValuePlaceholder: z = "Enter value", cancelLabel: B = "Cancel", submitLabel: V = "Confirm" } = x, H = l.map(({ name: e, defaultValue: t }) => `${e}\u0000${t ?? ""}`).join(""), [U, W] = T(() => a(l)), [G, K] = T(H);
110
+ }, I = { card: "_card_p8vwa_1" }, L = ({ open: t, promptName: n, content: r, description: s, parameters: l, onBack: d, onClose: f, onSubmit: v, onCancel: b, labels: x = {}, colors: C, titleClassName: w = "dial-h2-text", parametersLabelClassName: j = "dial-h2-text", detailsLabelClassName: M = "dial-h2-text" }) => {
111
+ let { title: N = "Prompt parameters", closeLabel: P = "Close", backLabel: F = "Back", parametersLabel: L = "Parameters", detailsLabel: R = "Details", enterValuePlaceholder: z = "Enter value", cancelLabel: B = "Cancel", submitLabel: V = "Confirm" } = x, H = l.map(({ name: e, defaultValue: t }) => `${e}\u0000${t ?? ""}`).join(""), [U, W] = T(() => a(l)), [G, K] = T(H);
111
112
  G !== H && (K(H), W(a(l)));
112
113
  let q = S(), J = i({
113
114
  "--pp-card-bg": C?.cardBackground,
@@ -123,7 +124,7 @@ var j = {
123
124
  "aria-hidden": !0,
124
125
  stroke: c
125
126
  }),
126
- "aria-label": I,
127
+ "aria-label": F,
127
128
  onClick: d
128
129
  }), /* @__PURE__ */ E("span", {
129
130
  className: w,
@@ -150,7 +151,7 @@ var j = {
150
151
  children: /* @__PURE__ */ D("div", {
151
152
  className: "flex flex-col gap-4 px-6 pb-4 pt-2",
152
153
  children: [/* @__PURE__ */ E("div", {
153
- className: o("flex h-[72px] w-full items-center rounded-lg border px-3", F.card),
154
+ className: o("flex h-[72px] w-full items-center rounded-lg border px-3", I.card),
154
155
  style: J,
155
156
  children: /* @__PURE__ */ E(O, {
156
157
  type: e.Prompt,
@@ -198,4 +199,4 @@ var j = {
198
199
  });
199
200
  };
200
201
  //#endregion
201
- export { P as FavoritePromptsPanel, I as PromptParametersPopup };
202
+ export { F as FavoritePromptsPanel, j as PROMPTS_CLASS, L as PromptParametersPopup };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-prompts",
3
3
  "description": "Host-agnostic UI for picking a favorite prompt and resolving its {{parameter}} placeholders before it is inserted into a chat message",
4
- "version": "1.2.0-dev.48",
4
+ "version": "1.2.0-dev.58",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@tabler/icons-react": "^3.44.0",
21
- "@epam/ai-dial-catalog": "1.2.0-dev.48"
21
+ "@epam/ai-dial-catalog": "1.2.0-dev.58"
22
22
  },
23
23
  "peerDependencies": {
24
- "@epam/ai-dial-chat-shared": "1.2.0-dev.48",
25
- "@epam/ai-dial-ui-kit": "^0.15.0-dev.7",
24
+ "@epam/ai-dial-chat-shared": "1.2.0-dev.58",
25
+ "@epam/ai-dial-ui-kit": "^0.15.0-dev.9",
26
26
  "react": "^19.2.8"
27
27
  },
28
28
  "repository": {