@epam/ai-dial-prompts 1.1.0-dev.438 → 1.1.0-dev.441

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;AAgB3F;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA+O9D,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;AAE9E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAQ3F;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA+L9D,CAAC"}
package/index.js CHANGED
@@ -14,40 +14,32 @@ var j = {
14
14
  rowLeaving: "_rowLeaving_1pyx6_27",
15
15
  rowFadeOut: "_rowFadeOut_1pyx6_1",
16
16
  listContent: "_listContent_1pyx6_55"
17
- }, M = "px-3 pb-0.5 pt-2", N = 180, P = 300, F = ({ favorites: e, onSelect: s, onToggleFavorite: l, onBrowse: f, labels: p = {}, colors: m, nameClassName: h = "dial-small-text", headerClassName: g = "dial-tiny-lead-semi-text", emptyHintClassName: v = "dial-small-text" }) => {
17
+ }, M = "px-3 pb-0.5 pt-2", N = 180, P = ({ favorites: e, onSelect: s, onToggleFavorite: l, onBrowse: f, labels: p = {}, colors: m, nameClassName: h = "dial-small-text", headerClassName: g = "dial-tiny-lead-semi-text", emptyHintClassName: v = "dial-small-text" }) => {
18
18
  let { myCollectionLabel: x = "My Collection", emptyHintLabel: C = "Star a prompt to pin it here", browseLabel: O = "Browse", removeFromFavoritesLabel: k = "Remove from favorites" } = p, A = i({
19
19
  "--fp-header-text": m?.headerText,
20
20
  "--fp-empty-hint-text": m?.emptyHintText,
21
21
  "--fp-star-color": m?.starColor,
22
22
  "--fp-footer-border": m?.footerBorder
23
- }), [F, I] = T(/* @__PURE__ */ new Set()), L = w(/* @__PURE__ */ new Map()), [R, z] = T(null), B = w(void 0), V = () => {
24
- clearTimeout(B.current), B.current = void 0;
25
- }, H = (e) => {
26
- V(), z(e);
27
- }, U = () => {
28
- V(), B.current = setTimeout(() => {
29
- z(null), B.current = void 0;
30
- }, P);
31
- };
23
+ }), [P, F] = T(/* @__PURE__ */ new Set()), I = w(/* @__PURE__ */ new Map());
32
24
  b(() => {
33
- let e = L.current;
25
+ let e = I.current;
34
26
  return () => {
35
- e.forEach((e) => clearTimeout(e)), e.clear(), clearTimeout(B.current);
27
+ e.forEach((e) => clearTimeout(e)), e.clear();
36
28
  };
37
29
  }, []);
38
- let W = w(null), [G, K] = T();
30
+ let L = w(null), [R, z] = T();
39
31
  S(() => {
40
- W.current && K(Math.min(W.current.scrollHeight, r));
32
+ L.current && z(Math.min(L.current.scrollHeight, r));
41
33
  }, [e]);
42
- let q = (e) => {
43
- I((t) => new Set(t).add(e));
34
+ let B = (e) => {
35
+ F((t) => new Set(t).add(e));
44
36
  let t = setTimeout(() => {
45
- l(e), I((t) => {
37
+ l(e), F((t) => {
46
38
  let n = new Set(t);
47
39
  return n.delete(e), n;
48
- }), L.current.delete(e);
40
+ }), I.current.delete(e);
49
41
  }, N);
50
- L.current.set(e, t);
42
+ I.current.set(e, t);
51
43
  };
52
44
  return /* @__PURE__ */ D("div", {
53
45
  className: "flex min-w-[240px] flex-col",
@@ -59,9 +51,9 @@ var j = {
59
51
  }),
60
52
  /* @__PURE__ */ E("div", {
61
53
  className: a(n, "min-h-0 flex-1 overflow-y-auto", j.listContent),
62
- style: { maxHeight: G },
54
+ style: { maxHeight: R },
63
55
  children: /* @__PURE__ */ E("div", {
64
- ref: W,
56
+ ref: L,
65
57
  children: e.length > 0 ? /* @__PURE__ */ E("ul", {
66
58
  className: "flex flex-col gap-1 px-1 pb-1",
67
59
  children: e.map((e) => {
@@ -74,10 +66,6 @@ var j = {
74
66
  label: e.name,
75
67
  labelClassName: h,
76
68
  onClick: () => s(e),
77
- onMouseEnter: () => H(e.id),
78
- onMouseLeave: U,
79
- onFocus: () => H(e.id),
80
- onBlur: U,
81
69
  rightControl: /* @__PURE__ */ E(_, {
82
70
  icon: /* @__PURE__ */ E(y, {
83
71
  size: o.SM,
@@ -86,24 +74,17 @@ var j = {
86
74
  }),
87
75
  "aria-label": k,
88
76
  isSelected: !0,
89
- onClick: () => q(e.id)
77
+ onClick: () => B(e.id)
90
78
  })
91
79
  }), r = e.description != null && e.description !== "";
92
80
  return /* @__PURE__ */ E("li", {
93
- className: F.has(e.id) ? j.rowLeaving : j.rowEnter,
81
+ className: P.has(e.id) ? j.rowLeaving : j.rowEnter,
94
82
  children: r ? /* @__PURE__ */ E(u, {
95
83
  asChild: !0,
96
- open: R === e.id,
97
84
  contentClassName: "max-w-[550px]",
98
- content: /* @__PURE__ */ E("div", {
99
- onMouseEnter: V,
100
- onMouseLeave: U,
101
- onFocus: V,
102
- onBlur: U,
103
- children: /* @__PURE__ */ E("p", {
104
- className: "text-start",
105
- children: e.description
106
- })
85
+ content: /* @__PURE__ */ E("p", {
86
+ className: "text-start",
87
+ children: e.description
107
88
  }),
108
89
  children: n
109
90
  }) : n
@@ -125,8 +106,8 @@ var j = {
125
106
  })
126
107
  ]
127
108
  });
128
- }, I = { card: "_card_p8vwa_1" }, L = ({ open: t, promptName: n, content: r, description: o, parameters: c, onBack: u, onClose: d, onSubmit: _, onCancel: y, labels: b = {}, colors: S, titleClassName: w = "dial-h2-text", parametersLabelClassName: j = "dial-h2-text", detailsLabelClassName: M = "dial-h2-text" }) => {
129
- 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" } = b, [H, U] = T({}), W = x(), G = i({
109
+ }, F = { card: "_card_p8vwa_1" }, I = ({ open: t, promptName: n, content: r, description: o, parameters: c, onBack: u, onClose: d, onSubmit: _, onCancel: y, labels: b = {}, colors: S, 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" } = b, [H, U] = T({}), W = x(), G = i({
130
111
  "--pp-card-bg": S?.cardBackground,
131
112
  "--pp-card-border": S?.cardBorder
132
113
  }), K = C(() => c.some((e) => !H[e]?.trim()), [c, H]);
@@ -140,7 +121,7 @@ var j = {
140
121
  "aria-hidden": !0,
141
122
  stroke: s
142
123
  }),
143
- "aria-label": F,
124
+ "aria-label": I,
144
125
  onClick: u
145
126
  }), /* @__PURE__ */ E("span", {
146
127
  className: w,
@@ -167,7 +148,7 @@ var j = {
167
148
  children: /* @__PURE__ */ D("div", {
168
149
  className: "flex flex-col gap-4 px-6 pb-4 pt-2",
169
150
  children: [/* @__PURE__ */ E("div", {
170
- className: a("flex h-[72px] w-full items-center rounded-lg border px-3", I.card),
151
+ className: a("flex h-[72px] w-full items-center rounded-lg border px-3", F.card),
171
152
  style: G,
172
153
  children: /* @__PURE__ */ E(O, {
173
154
  type: e.Prompt,
@@ -215,4 +196,4 @@ var j = {
215
196
  });
216
197
  };
217
198
  //#endregion
218
- export { F as FavoritePromptsPanel, L as PromptParametersPopup };
199
+ export { P as FavoritePromptsPanel, I 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.1.0-dev.438",
4
+ "version": "1.1.0-dev.441",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -16,8 +16,8 @@
16
16
  }
17
17
  },
18
18
  "peerDependencies": {
19
- "@epam/ai-dial-catalog": "1.1.0-dev.438",
20
- "@epam/ai-dial-chat-shared": "1.1.0-dev.438",
19
+ "@epam/ai-dial-catalog": "1.1.0-dev.441",
20
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.441",
21
21
  "@epam/ai-dial-ui-kit": "*",
22
22
  "@tabler/icons-react": "^3.0.0",
23
23
  "react": "^19.0.0"