@epam/ai-dial-prompts 1.2.0-dev.6 → 1.2.0-dev.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/FavoritePromptsPanel/FavoritePromptsPanel.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +5 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +28 -27
- package/package.json +4 -4
|
@@ -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;
|
|
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 @@
|
|
|
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.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
._header_1pyx6_3{color:var(--fp-header-text,var(--text-tertiary,#848e9c))}._emptyHint_1pyx6_7{color:var(--fp-empty-hint-text,var(--text-icon-tertiary,#848e9c))}._star_1pyx6_11{color:var(--fp-star-color,var(--text-warning-icon,#eec840))}._footer_1pyx6_15{border-top-color:var(--fp-footer-border,var(--stroke-tertiary,#e0e6f0))}._rowEnter_1pyx6_23{animation:.2s ease-out _rowFadeIn_1pyx6_1}._rowLeaving_1pyx6_27{pointer-events:none;animation:.18s ease-out forwards _rowFadeOut_1pyx6_1}@keyframes _rowFadeIn_1pyx6_1{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes _rowFadeOut_1pyx6_1{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}._listContent_1pyx6_55{transition:max-height .2s}@media (prefers-reduced-motion:reduce){._rowEnter_1pyx6_23,._rowLeaving_1pyx6_27{animation:none}._listContent_1pyx6_55{transition:none}}._card_p8vwa_1{background:var(--pp-card-bg,var(--bg-layer-sunken,#eef1f7));border-color:var(--pp-card-border,var(--stroke-tertiary,#e0e6f0))}
|
|
2
|
-
/*$vite$:1
|
|
2
|
+
/*$vite$:1*/.m-0{margin:0}.flex{display:flex}.grid{display:grid}.list-item{display:list-item}.h-\[72px\]{height:72px}.h-auto{height:auto}.min-h-0{min-height:0}.w-full{width:100%}.min-w-\[240px\]{min-width:240px}.max-w-\[550px\]{max-width:550px}.flex-1{flex:1 1 0%}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.overflow-y-auto{overflow-y:auto}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-t{border-top-width:1px}.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{padding-bottom:.25rem;padding-top:.25rem}.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{padding-bottom:0}.pb-0\.5{padding-bottom:.125rem}.pb-1{padding-bottom:.25rem}.pb-4{padding-bottom:1rem}.pt-2{padding-top:.5rem}.text-start{text-align:start}.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)}.rtl\:scale-x-\[-1\]:where([dir=rtl],[dir=rtl] *){--tw-scale-x:-1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}
|
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
|
-
|
|
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
|
-
},
|
|
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
|
-
}), [
|
|
24
|
+
}), [F, I] = T(/* @__PURE__ */ new Set()), L = w(/* @__PURE__ */ new Map());
|
|
24
25
|
x(() => {
|
|
25
|
-
let e =
|
|
26
|
+
let e = L.current;
|
|
26
27
|
return () => {
|
|
27
28
|
e.forEach((e) => clearTimeout(e)), e.clear();
|
|
28
29
|
};
|
|
29
30
|
}, []);
|
|
30
|
-
let
|
|
31
|
+
let R = w(null), [z, B] = T();
|
|
31
32
|
C(() => {
|
|
32
|
-
|
|
33
|
+
R.current && B(Math.min(R.current.scrollHeight, r));
|
|
33
34
|
}, [e]);
|
|
34
|
-
let
|
|
35
|
-
|
|
35
|
+
let V = (e) => {
|
|
36
|
+
I((t) => new Set(t).add(e));
|
|
36
37
|
let t = setTimeout(() => {
|
|
37
|
-
c(e),
|
|
38
|
+
c(e), I((t) => {
|
|
38
39
|
let n = new Set(t);
|
|
39
40
|
return n.delete(e), n;
|
|
40
|
-
}),
|
|
41
|
-
},
|
|
42
|
-
|
|
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,
|
|
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",
|
|
54
|
-
style: { maxHeight:
|
|
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:
|
|
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:
|
|
73
|
+
className: M.star,
|
|
73
74
|
"aria-hidden": !0
|
|
74
75
|
}),
|
|
75
76
|
"aria-label": k,
|
|
76
77
|
isSelected: !0,
|
|
77
|
-
onClick: () =>
|
|
78
|
+
onClick: () => V(e.id)
|
|
78
79
|
})
|
|
79
80
|
}), r = e.description != null && e.description !== "";
|
|
80
81
|
return /* @__PURE__ */ E("li", {
|
|
81
|
-
className:
|
|
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",
|
|
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",
|
|
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
|
-
},
|
|
110
|
-
let { title: N = "Prompt parameters", closeLabel: P = "Close", backLabel:
|
|
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":
|
|
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",
|
|
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 {
|
|
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.
|
|
4
|
+
"version": "1.2.0-dev.69",
|
|
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.
|
|
21
|
+
"@epam/ai-dial-catalog": "1.2.0-dev.69"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
25
|
-
"@epam/ai-dial-ui-kit": "^0.
|
|
24
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.69",
|
|
25
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.9",
|
|
26
26
|
"react": "^19.2.8"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|