@epam/ai-dial-conversation-stages 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.
- package/components/CollapsedGroup/CollapsedGroup.d.ts.map +1 -1
- package/components/StagesPanel/StagesPanel.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +9 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +129 -125
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAUxE,gJAAgJ;AAChJ,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAqPlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/StagesPanel/StagesPanel.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/StagesPanel/StagesPanel.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAGrC,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AA6InC,+FAA+F;AAC/F,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAoE5C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const CONVERSATION_STAGES_CLASS: {
|
|
2
|
+
/** The stages panel root, which carries the themed CSS variables. */
|
|
3
|
+
readonly panel: "dial-conversation-stages-panel";
|
|
4
|
+
/** The root of a `CollapsedGroup`, wrapping its summary line and the panel. */
|
|
5
|
+
readonly group: "dial-conversation-stages-group";
|
|
6
|
+
/** The summary line of a `CollapsedGroup`, which expands and collapses it. */
|
|
7
|
+
readonly groupToggle: "dial-conversation-stages-group-toggle";
|
|
8
|
+
};
|
|
9
|
+
//# 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,yBAAyB;IACpC,qEAAqE;;IAErE,+EAA+E;;IAE/E,8EAA8E;;CAEtE,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { CollapsedGroup } from './components/CollapsedGroup/CollapsedGroup';
|
|
|
2
2
|
export { StagesPanel } from './components/StagesPanel/StagesPanel';
|
|
3
3
|
export type { CollapsedGroupColors, CollapsedGroupLabels, CollapsedGroupProps, CollapsedGroupStyles, CollapsedGroupTypography, } from './models/collapsed-group';
|
|
4
4
|
export type { StagesPanelColors, StagesPanelLabels, StagesPanelProps, StagesPanelStyles, StageTypography, } from './models/stages-props';
|
|
5
|
+
export { CONVERSATION_STAGES_CLASS } from './constants/public-class-names';
|
|
5
6
|
//# 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,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/index.js
CHANGED
|
@@ -3,40 +3,44 @@ import { DIAL_ICON_SIZE as a, DIAL_KIT_ICON_STROKE as o, ElementSize as s, Ellip
|
|
|
3
3
|
import { IconAlertCircle as f, IconCheck as p, IconChevronDown as m, IconChevronRight as h, IconCopy as g } from "@tabler/icons-react";
|
|
4
4
|
import { memo as _, useCallback as v, useEffect as y, useRef as b, useState as x } from "react";
|
|
5
5
|
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
6
|
-
//#region src/
|
|
7
|
-
var T =
|
|
6
|
+
//#region src/constants/public-class-names.ts
|
|
7
|
+
var T = {
|
|
8
|
+
panel: "dial-conversation-stages-panel",
|
|
9
|
+
group: "dial-conversation-stages-group",
|
|
10
|
+
groupToggle: "dial-conversation-stages-group-toggle"
|
|
11
|
+
}, E = /[([][^()[\]]*[)\]]/g, D = /(\d+(?:\.\d+)?)\s*s\b/, O = /\bStart:\s*(\d{1,2}):([0-5]\d):([0-5]\d(?:\.\d+)?)\b/i, k = (e) => {
|
|
8
12
|
let t = e.trimEnd();
|
|
9
13
|
return t.endsWith(":") ? t.slice(0, -1) : t;
|
|
10
|
-
},
|
|
11
|
-
let t =
|
|
14
|
+
}, A = 1440 * 60, j = A / 2, M = (e) => {
|
|
15
|
+
let t = O.exec(e);
|
|
12
16
|
if (!t) return;
|
|
13
17
|
let n = Number(t[1]);
|
|
14
18
|
if (!(n > 23)) return n * 60 * 60 + Number(t[2]) * 60 + Number(t[3]);
|
|
15
|
-
},
|
|
16
|
-
|
|
19
|
+
}, N = (e) => {
|
|
20
|
+
E.lastIndex = 0;
|
|
17
21
|
let t;
|
|
18
|
-
for (; t =
|
|
19
|
-
let e = t[0].slice(1, -1), n =
|
|
22
|
+
for (; t = E.exec(e);) {
|
|
23
|
+
let e = t[0].slice(1, -1), n = D.exec(e);
|
|
20
24
|
if (n) return {
|
|
21
25
|
durationLabel: `${n[1]}s`,
|
|
22
26
|
groupIndex: t.index,
|
|
23
27
|
groupLength: t[0].length,
|
|
24
|
-
startTimeSeconds:
|
|
28
|
+
startTimeSeconds: M(e)
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
|
-
},
|
|
28
|
-
let t = e ?? "", n =
|
|
31
|
+
}, P = (e) => {
|
|
32
|
+
let t = e ?? "", n = N(t);
|
|
29
33
|
return {
|
|
30
|
-
name:
|
|
34
|
+
name: k(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
|
|
31
35
|
durationLabel: n?.durationLabel
|
|
32
36
|
};
|
|
33
|
-
},
|
|
37
|
+
}, F = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), I = (e) => e >= 60 ? `${Math.floor(e / 60)}m ${Math.round(e % 60)}s` : `${e.toFixed(1)}s`, L = (e) => {
|
|
34
38
|
if (!e) return;
|
|
35
39
|
let t = /^(\d+(?:\.\d+)?)s$/.exec(e);
|
|
36
40
|
return t ? parseFloat(t[1]) : void 0;
|
|
37
|
-
},
|
|
41
|
+
}, R = (e) => {
|
|
38
42
|
let t = e.flatMap((e) => {
|
|
39
|
-
let t =
|
|
43
|
+
let t = N(e ?? ""), n = L(t?.durationLabel);
|
|
40
44
|
return n == null ? [] : [{
|
|
41
45
|
durationSeconds: n,
|
|
42
46
|
startTimeSeconds: t?.startTimeSeconds
|
|
@@ -47,18 +51,18 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
47
51
|
let n = 0, r, i = t.flatMap(({ durationSeconds: e, startTimeSeconds: t }) => {
|
|
48
52
|
if (t == null) return [];
|
|
49
53
|
let i = t + n;
|
|
50
|
-
return r != null && r - i >
|
|
54
|
+
return r != null && r - i > j && (n += A, i += A), r = i, {
|
|
51
55
|
start: i,
|
|
52
56
|
end: i + e
|
|
53
57
|
};
|
|
54
58
|
}).sort((e, t) => e.start - t.start), a = 0, o = i[0].start, s = i[0].end;
|
|
55
59
|
for (let e of i.slice(1)) e.start <= s ? s = Math.max(s, e.end) : (a += s - o, o = e.start, s = e.end);
|
|
56
60
|
return a + s - o;
|
|
57
|
-
},
|
|
61
|
+
}, z = (e) => [...e].reverse().find((e) => e.status == null), B = (e, t) => e.findIndex((e) => e.index === t.index) + 1, V = (e) => {
|
|
58
62
|
let t = [], n = 0;
|
|
59
63
|
for (; n < e.length;) {
|
|
60
|
-
let r = e[n], i =
|
|
61
|
-
for (; a < e.length &&
|
|
64
|
+
let r = e[n], i = P(r.name).name, a = n + 1;
|
|
65
|
+
for (; a < e.length && P(e[a].name).name === i;) a += 1;
|
|
62
66
|
let o = e.slice(n, a);
|
|
63
67
|
o.length > 1 ? t.push({
|
|
64
68
|
key: r.index,
|
|
@@ -70,7 +74,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
70
74
|
}), n = a;
|
|
71
75
|
}
|
|
72
76
|
return t;
|
|
73
|
-
},
|
|
77
|
+
}, H = {
|
|
74
78
|
panel: "_panel_vd48n_1",
|
|
75
79
|
row: "_row_vd48n_5",
|
|
76
80
|
collapseButton: "_collapseButton_vd48n_9",
|
|
@@ -88,9 +92,9 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
88
92
|
codeInline: "_codeInline_vd48n_62",
|
|
89
93
|
blockquote: "_blockquote_vd48n_68",
|
|
90
94
|
tableCell: "_tableCell_vd48n_73"
|
|
91
|
-
},
|
|
95
|
+
}, U = ({ status: e, isLive: n, runningLabel: r = "Running", failedLabel: i = "Failed" }) => e === t.Failed ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(f, {
|
|
92
96
|
size: a.MD,
|
|
93
|
-
className:
|
|
97
|
+
className: H.iconError,
|
|
94
98
|
"aria-hidden": !0,
|
|
95
99
|
stroke: o
|
|
96
100
|
}), /* @__PURE__ */ C("span", {
|
|
@@ -98,13 +102,13 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
98
102
|
children: i
|
|
99
103
|
})] }) : e === t.Completed ? /* @__PURE__ */ C(p, {
|
|
100
104
|
size: a.SM,
|
|
101
|
-
className:
|
|
105
|
+
className: H.iconCompleted,
|
|
102
106
|
"aria-hidden": !0,
|
|
103
107
|
stroke: o
|
|
104
108
|
}) : n ? /* @__PURE__ */ C(d, {
|
|
105
109
|
size: 16,
|
|
106
110
|
ariaLabel: r
|
|
107
|
-
}) : null,
|
|
111
|
+
}) : null, W = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: c }) => {
|
|
108
112
|
let [u, d] = x(!1), f = b(null);
|
|
109
113
|
y(() => () => {
|
|
110
114
|
f.current != null && clearTimeout(f.current);
|
|
@@ -113,12 +117,12 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
113
117
|
r(typeof e == "string" ? e : String(e ?? "")), f.current && clearTimeout(f.current), d(!0), f.current = setTimeout(() => d(!1), 2e3);
|
|
114
118
|
}, [e]);
|
|
115
119
|
return /* @__PURE__ */ w("pre", {
|
|
116
|
-
className: i("relative max-h-[300px] overflow-auto rounded border p-3", n,
|
|
120
|
+
className: i("relative max-h-[300px] overflow-auto rounded border p-3", n, H.codeBlock),
|
|
117
121
|
children: [/* @__PURE__ */ C(l, {
|
|
118
122
|
size: s.Small,
|
|
119
123
|
icon: C(u ? p : g, {
|
|
120
124
|
size: a.SM,
|
|
121
|
-
className:
|
|
125
|
+
className: H.iconSecondary,
|
|
122
126
|
stroke: o
|
|
123
127
|
}),
|
|
124
128
|
"aria-label": c,
|
|
@@ -129,8 +133,8 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
129
133
|
children: e
|
|
130
134
|
})]
|
|
131
135
|
});
|
|
132
|
-
},
|
|
133
|
-
let a = "mb-1.5 last:mb-0", o = i(n?.headingClassName ?? "dial-small-semi-text",
|
|
136
|
+
}, G = _(({ content: t, typography: n, copyAriaLabel: r = "Copy" }) => {
|
|
137
|
+
let a = "mb-1.5 last:mb-0", o = i(n?.headingClassName ?? "dial-small-semi-text", H.stageContent, a);
|
|
134
138
|
return /* @__PURE__ */ C(e, {
|
|
135
139
|
content: t,
|
|
136
140
|
classNames: {
|
|
@@ -140,30 +144,30 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
140
144
|
h4: o,
|
|
141
145
|
h5: o,
|
|
142
146
|
h6: o,
|
|
143
|
-
p: i(n?.contentClassName ?? "dial-tiny-text",
|
|
144
|
-
ul: i(n?.contentClassName ?? "dial-tiny-text",
|
|
145
|
-
ol: i(n?.contentClassName ?? "dial-tiny-text",
|
|
146
|
-
strong: i(n?.strongClassName ?? n?.contentClassName ?? "dial-tiny-text",
|
|
147
|
-
codeInline:
|
|
148
|
-
blockquote: i(n?.contentClassName ?? "dial-tiny-text",
|
|
149
|
-
link: i(n?.contentClassName ?? "dial-tiny-text",
|
|
150
|
-
tableCell: i(n?.contentClassName ?? "dial-tiny-text",
|
|
147
|
+
p: i(n?.contentClassName ?? "dial-tiny-text", H.stageContent, "mb-1.5"),
|
|
148
|
+
ul: i(n?.contentClassName ?? "dial-tiny-text", H.stageContent, a),
|
|
149
|
+
ol: i(n?.contentClassName ?? "dial-tiny-text", H.stageContent, a),
|
|
150
|
+
strong: i(n?.strongClassName ?? n?.contentClassName ?? "dial-tiny-text", H.stageContent),
|
|
151
|
+
codeInline: H.codeInline,
|
|
152
|
+
blockquote: i(n?.contentClassName ?? "dial-tiny-text", H.blockquote, a),
|
|
153
|
+
link: i(n?.contentClassName ?? "dial-tiny-text", H.stageContent),
|
|
154
|
+
tableCell: i(n?.contentClassName ?? "dial-tiny-text", H.tableCell)
|
|
151
155
|
},
|
|
152
|
-
components: { code: ({ children: e, className: t }) => t?.includes("language-") ? /* @__PURE__ */ C(
|
|
156
|
+
components: { code: ({ children: e, className: t }) => t?.includes("language-") ? /* @__PURE__ */ C(W, {
|
|
153
157
|
codeClassName: t,
|
|
154
158
|
blockClassName: n?.codeBlockClassName,
|
|
155
159
|
copyAriaLabel: r,
|
|
156
160
|
children: e
|
|
157
161
|
}) : /* @__PURE__ */ C("code", {
|
|
158
|
-
className: i("inline-block px-1.5 py-1", n?.codeClassName ?? "dial-code-text rounded-md",
|
|
162
|
+
className: i("inline-block px-1.5 py-1", n?.codeClassName ?? "dial-code-text rounded-md", H.codeInline),
|
|
159
163
|
children: e
|
|
160
164
|
}) }
|
|
161
165
|
});
|
|
162
|
-
}),
|
|
163
|
-
let [u, d] = x(!1), { copyAriaLabel: f = "Copy stage content", runningAriaLabel: p, failedAriaLabel: g } = s ?? {}, { name: _, durationLabel: v } =
|
|
166
|
+
}), K = ({ stage: e, isLive: n, typography: r, labels: s, nameOverride: l }) => {
|
|
167
|
+
let [u, d] = x(!1), { copyAriaLabel: f = "Copy stage content", runningAriaLabel: p, failedAriaLabel: g } = s ?? {}, { name: _, durationLabel: v } = P(e.name), y = l ?? _, b = !l && F(_), T = e.status === t.Failed, E = !!e.content, D = /* @__PURE__ */ w(S, { children: [
|
|
164
168
|
/* @__PURE__ */ C("span", {
|
|
165
169
|
className: "flex flex-none items-center",
|
|
166
|
-
children: /* @__PURE__ */ C(
|
|
170
|
+
children: /* @__PURE__ */ C(U, {
|
|
167
171
|
status: e.status,
|
|
168
172
|
isLive: n,
|
|
169
173
|
runningLabel: p,
|
|
@@ -171,19 +175,19 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
171
175
|
})
|
|
172
176
|
}),
|
|
173
177
|
/* @__PURE__ */ C("span", {
|
|
174
|
-
className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text",
|
|
178
|
+
className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", H.stageName, T && H.stageNameFailed, b && H.monoName),
|
|
175
179
|
children: /* @__PURE__ */ C(c, { text: y || e.status || "" })
|
|
176
180
|
}),
|
|
177
181
|
e.tag && /* @__PURE__ */ C("span", {
|
|
178
|
-
className: i("flex-none", r?.tagClassName ?? "dial-tiny-lead-text",
|
|
182
|
+
className: i("flex-none", r?.tagClassName ?? "dial-tiny-lead-text", H.tag),
|
|
179
183
|
children: e.tag
|
|
180
184
|
}),
|
|
181
185
|
v && /* @__PURE__ */ C("span", {
|
|
182
|
-
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text",
|
|
186
|
+
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", H.duration),
|
|
183
187
|
children: v
|
|
184
188
|
}),
|
|
185
189
|
E && /* @__PURE__ */ C("span", {
|
|
186
|
-
className: i("flex-none",
|
|
190
|
+
className: i("flex-none", H.iconSecondary),
|
|
187
191
|
children: u ? /* @__PURE__ */ C(m, {
|
|
188
192
|
size: a.SM,
|
|
189
193
|
"aria-hidden": !0,
|
|
@@ -195,7 +199,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
195
199
|
stroke: o
|
|
196
200
|
})
|
|
197
201
|
})
|
|
198
|
-
] }), O = i("flex w-full items-center gap-2 px-2 py-1.5",
|
|
202
|
+
] }), O = i("flex w-full items-center gap-2 px-2 py-1.5", H.row);
|
|
199
203
|
return E ? /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("div", {
|
|
200
204
|
className: O,
|
|
201
205
|
children: /* @__PURE__ */ C("button", {
|
|
@@ -213,7 +217,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
213
217
|
className: "mt-2 flex flex-col gap-3 py-1 ps-8",
|
|
214
218
|
children: e.content && /* @__PURE__ */ C("div", {
|
|
215
219
|
className: "max-h-[300px] overflow-y-auto",
|
|
216
|
-
children: /* @__PURE__ */ C(
|
|
220
|
+
children: /* @__PURE__ */ C(G, {
|
|
217
221
|
content: e.content,
|
|
218
222
|
typography: r,
|
|
219
223
|
copyAriaLabel: f
|
|
@@ -225,17 +229,17 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
225
229
|
className: O,
|
|
226
230
|
children: D
|
|
227
231
|
});
|
|
228
|
-
},
|
|
229
|
-
let { runningAriaLabel: l, failedAriaLabel: u, attemptLabel: d = (e) => `Attempt ${e}` } = s ?? {}, [f, p] = x(!1), g = e.attempts?.some((e) => e.status == null) ?? !1, _ = e.attempts?.some((e) => e.status === t.Failed), v = g ? null : _ ? t.Failed : t.Completed, y =
|
|
232
|
+
}, q = ({ row: e, isLive: n, typography: r, labels: s }) => {
|
|
233
|
+
let { runningAriaLabel: l, failedAriaLabel: u, attemptLabel: d = (e) => `Attempt ${e}` } = s ?? {}, [f, p] = x(!1), g = e.attempts?.some((e) => e.status == null) ?? !1, _ = e.attempts?.some((e) => e.status === t.Failed), v = g ? null : _ ? t.Failed : t.Completed, y = R((e.attempts || []).map((e) => e.name)), b = y > 0 ? I(y) : void 0;
|
|
230
234
|
return /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("button", {
|
|
231
235
|
type: "button",
|
|
232
236
|
onClick: () => p((e) => !e),
|
|
233
237
|
"aria-expanded": f,
|
|
234
|
-
className: i("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-start",
|
|
238
|
+
className: i("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-start", H.collapseButton, H.row),
|
|
235
239
|
children: [
|
|
236
240
|
/* @__PURE__ */ C("span", {
|
|
237
241
|
className: "flex flex-none items-center",
|
|
238
|
-
children: /* @__PURE__ */ C(
|
|
242
|
+
children: /* @__PURE__ */ C(U, {
|
|
239
243
|
status: v,
|
|
240
244
|
isLive: n,
|
|
241
245
|
runningLabel: l,
|
|
@@ -243,19 +247,19 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
243
247
|
})
|
|
244
248
|
}),
|
|
245
249
|
/* @__PURE__ */ C("span", {
|
|
246
|
-
className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text",
|
|
250
|
+
className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", H.stageName, _ && H.stageNameFailed),
|
|
247
251
|
children: /* @__PURE__ */ C(c, { text: e.name })
|
|
248
252
|
}),
|
|
249
253
|
/* @__PURE__ */ w("span", {
|
|
250
|
-
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text",
|
|
254
|
+
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", H.count),
|
|
251
255
|
children: ["×", e.attempts?.length ?? 0]
|
|
252
256
|
}),
|
|
253
257
|
b && /* @__PURE__ */ C("span", {
|
|
254
|
-
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text",
|
|
258
|
+
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", H.duration),
|
|
255
259
|
children: b
|
|
256
260
|
}),
|
|
257
261
|
/* @__PURE__ */ C("span", {
|
|
258
|
-
className: i("flex-none",
|
|
262
|
+
className: i("flex-none", H.iconSecondary),
|
|
259
263
|
children: f ? /* @__PURE__ */ C(m, {
|
|
260
264
|
size: a.SM,
|
|
261
265
|
"aria-hidden": !0,
|
|
@@ -277,7 +281,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
277
281
|
className: "mt-1 flex flex-col gap-0.5 ps-6",
|
|
278
282
|
children: e.attempts?.map((e, t) => /* @__PURE__ */ C("li", {
|
|
279
283
|
role: "listitem",
|
|
280
|
-
children: /* @__PURE__ */ C(
|
|
284
|
+
children: /* @__PURE__ */ C(K, {
|
|
281
285
|
stage: e,
|
|
282
286
|
nameOverride: d(t + 1),
|
|
283
287
|
isLive: n && e.status == null,
|
|
@@ -288,7 +292,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
288
292
|
})
|
|
289
293
|
})
|
|
290
294
|
})] });
|
|
291
|
-
},
|
|
295
|
+
}, J = ({ stages: e, isStreaming: t, className: r, styles: a, labels: o }) => {
|
|
292
296
|
let { colors: s, typography: c } = a ?? {}, l = n({
|
|
293
297
|
"--cs-text": s?.text,
|
|
294
298
|
"--cs-row-hover": s?.rowHoverColor,
|
|
@@ -305,16 +309,16 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
305
309
|
"--cs-code-border": s?.codeBorderColor,
|
|
306
310
|
"--cs-code-text": s?.codeTextColor,
|
|
307
311
|
"--cs-border": s?.borderColor
|
|
308
|
-
}), u =
|
|
312
|
+
}), u = V(e);
|
|
309
313
|
return /* @__PURE__ */ C("div", {
|
|
310
314
|
style: l,
|
|
311
|
-
className: i("w-full",
|
|
315
|
+
className: i("w-full", H.panel, r, T.panel),
|
|
312
316
|
children: /* @__PURE__ */ C("ul", {
|
|
313
317
|
role: "list",
|
|
314
318
|
className: "flex w-full flex-col gap-0.5 ps-5",
|
|
315
319
|
children: u.map((e) => e.stage ? /* @__PURE__ */ C("li", {
|
|
316
320
|
role: "listitem",
|
|
317
|
-
children: /* @__PURE__ */ C(
|
|
321
|
+
children: /* @__PURE__ */ C(K, {
|
|
318
322
|
stage: e.stage,
|
|
319
323
|
isLive: t && e.stage.status == null,
|
|
320
324
|
typography: c,
|
|
@@ -322,7 +326,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
322
326
|
})
|
|
323
327
|
}, e.key) : /* @__PURE__ */ C("li", {
|
|
324
328
|
role: "listitem",
|
|
325
|
-
children: /* @__PURE__ */ C(
|
|
329
|
+
children: /* @__PURE__ */ C(q, {
|
|
326
330
|
row: e,
|
|
327
331
|
isLive: t && (e.attempts?.some((e) => e.status == null) ?? !1),
|
|
328
332
|
typography: c,
|
|
@@ -331,61 +335,61 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
331
335
|
}, e.key))
|
|
332
336
|
})
|
|
333
337
|
});
|
|
334
|
-
},
|
|
338
|
+
}, Y = {
|
|
335
339
|
toggleButton: "_toggleButton_1sa5v_1",
|
|
336
340
|
executedLabel: "_executedLabel_1sa5v_13",
|
|
337
341
|
stepsCount: "_stepsCount_1sa5v_17",
|
|
338
342
|
doneIcon: "_doneIcon_1sa5v_22",
|
|
339
343
|
failedText: "_failedText_1sa5v_26",
|
|
340
344
|
liveName: "_liveName_1sa5v_30"
|
|
341
|
-
},
|
|
342
|
-
let { executedLabel: g = "Executed", stepsLabel: _ = () => "steps", failedCountLabel: v = (e) => `${e} failed`, runningStepLabel: S = (e, t) => `Step ${e} of ${t}`, runningAriaLabel:
|
|
345
|
+
}, X = ({ stages: e, isStreaming: r, labels: s, className: l, styles: f }) => {
|
|
346
|
+
let { executedLabel: g = "Executed", stepsLabel: _ = () => "steps", failedCountLabel: v = (e) => `${e} failed`, runningStepLabel: S = (e, t) => `Step ${e} of ${t}`, runningAriaLabel: E = "Running", copyAriaLabel: D, failedAriaLabel: O, attemptLabel: k } = s ?? {}, [A, j] = x(r), M = b(r);
|
|
343
347
|
y(() => {
|
|
344
|
-
|
|
348
|
+
M.current && !r && j(!1), M.current = r;
|
|
345
349
|
}, [r]);
|
|
346
|
-
let { colors:
|
|
347
|
-
"--cs-cg-label":
|
|
348
|
-
"--cs-cg-label-hover":
|
|
349
|
-
"--cs-cg-steps-count":
|
|
350
|
-
"--cs-cg-done":
|
|
351
|
-
"--cs-cg-failed":
|
|
352
|
-
"--cs-text":
|
|
353
|
-
"--cs-row-hover":
|
|
354
|
-
"--cs-button-bg":
|
|
355
|
-
"--cs-stage-text":
|
|
356
|
-
"--cs-failed-text":
|
|
357
|
-
"--cs-tag-text":
|
|
358
|
-
"--cs-count-text":
|
|
359
|
-
"--cs-duration-text":
|
|
360
|
-
"--cs-icon-secondary":
|
|
361
|
-
"--cs-icon-completed":
|
|
362
|
-
"--cs-icon-error":
|
|
363
|
-
"--cs-code-bg":
|
|
364
|
-
"--cs-code-border":
|
|
365
|
-
"--cs-code-text":
|
|
366
|
-
"--cs-border":
|
|
350
|
+
let { colors: N, panel: F } = f ?? {}, L = f?.typography ?? { fontClassName: "dial-small-text" }, V = n({
|
|
351
|
+
"--cs-cg-label": N?.labelColor,
|
|
352
|
+
"--cs-cg-label-hover": N?.labelHoverColor,
|
|
353
|
+
"--cs-cg-steps-count": N?.stepsCountColor,
|
|
354
|
+
"--cs-cg-done": N?.doneColor,
|
|
355
|
+
"--cs-cg-failed": N?.failedColor,
|
|
356
|
+
"--cs-text": F?.text,
|
|
357
|
+
"--cs-row-hover": F?.rowHoverColor,
|
|
358
|
+
"--cs-button-bg": F?.collapsedButtonBg,
|
|
359
|
+
"--cs-stage-text": F?.stageTextColor,
|
|
360
|
+
"--cs-failed-text": F?.failedColor,
|
|
361
|
+
"--cs-tag-text": F?.tagTextColor,
|
|
362
|
+
"--cs-count-text": F?.countTextColor,
|
|
363
|
+
"--cs-duration-text": F?.durationTextColor,
|
|
364
|
+
"--cs-icon-secondary": F?.iconSecondaryColor,
|
|
365
|
+
"--cs-icon-completed": F?.iconCompletedColor,
|
|
366
|
+
"--cs-icon-error": F?.iconErrorColor,
|
|
367
|
+
"--cs-code-bg": F?.codeBg,
|
|
368
|
+
"--cs-code-border": F?.codeBorderColor,
|
|
369
|
+
"--cs-code-text": F?.codeTextColor,
|
|
370
|
+
"--cs-border": F?.borderColor
|
|
367
371
|
});
|
|
368
372
|
if (e.length === 0) return null;
|
|
369
|
-
let
|
|
370
|
-
copyAriaLabel:
|
|
371
|
-
runningAriaLabel:
|
|
372
|
-
failedAriaLabel:
|
|
373
|
-
attemptLabel:
|
|
373
|
+
let H = {
|
|
374
|
+
copyAriaLabel: D,
|
|
375
|
+
runningAriaLabel: E,
|
|
376
|
+
failedAriaLabel: O,
|
|
377
|
+
attemptLabel: k
|
|
374
378
|
};
|
|
375
|
-
if (e.length === 1) return /* @__PURE__ */ C(
|
|
379
|
+
if (e.length === 1) return /* @__PURE__ */ C(J, {
|
|
376
380
|
stages: e,
|
|
377
381
|
isStreaming: r,
|
|
378
382
|
className: l,
|
|
379
383
|
styles: {
|
|
380
|
-
colors:
|
|
384
|
+
colors: F,
|
|
381
385
|
typography: f?.typography
|
|
382
386
|
},
|
|
383
|
-
labels:
|
|
387
|
+
labels: H
|
|
384
388
|
});
|
|
385
|
-
let
|
|
389
|
+
let U = e.some((e) => e.status === t.Failed), W = R(e.map((e) => e.name)), G = W > 0 ? I(W) : void 0, K = r ? z(e) : void 0, q;
|
|
386
390
|
if (r) {
|
|
387
|
-
let t =
|
|
388
|
-
|
|
391
|
+
let t = K ? B(e, K) : e.length, n = K ? P(K.name).name : "";
|
|
392
|
+
q = /* @__PURE__ */ w("span", {
|
|
389
393
|
role: "status",
|
|
390
394
|
"aria-live": "polite",
|
|
391
395
|
className: "flex min-w-0 items-center gap-2",
|
|
@@ -394,26 +398,26 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
394
398
|
className: "flex flex-none items-center",
|
|
395
399
|
children: /* @__PURE__ */ C(d, {
|
|
396
400
|
size: 14,
|
|
397
|
-
ariaLabel:
|
|
401
|
+
ariaLabel: E
|
|
398
402
|
})
|
|
399
403
|
}),
|
|
400
404
|
/* @__PURE__ */ C("span", {
|
|
401
|
-
className: i("flex-none whitespace-nowrap",
|
|
405
|
+
className: i("flex-none whitespace-nowrap", L.fontClassName, Y.liveName),
|
|
402
406
|
children: S(t, e.length)
|
|
403
407
|
}),
|
|
404
408
|
n && /* @__PURE__ */ C("span", {
|
|
405
|
-
className: i("min-w-0 max-w-[22rem] truncate",
|
|
409
|
+
className: i("min-w-0 max-w-[22rem] truncate", L.fontClassName, Y.executedLabel),
|
|
406
410
|
children: /* @__PURE__ */ C(c, { text: n })
|
|
407
411
|
})
|
|
408
412
|
]
|
|
409
413
|
});
|
|
410
|
-
} else if (
|
|
414
|
+
} else if (U) {
|
|
411
415
|
let n = e.filter((e) => e.status === t.Failed).length;
|
|
412
|
-
|
|
416
|
+
q = /* @__PURE__ */ w("span", {
|
|
413
417
|
className: "inline-flex items-center gap-1",
|
|
414
418
|
children: [
|
|
415
419
|
/* @__PURE__ */ w("span", {
|
|
416
|
-
className: i(
|
|
420
|
+
className: i(L.fontClassName, Y.executedLabel),
|
|
417
421
|
children: [
|
|
418
422
|
g,
|
|
419
423
|
" ",
|
|
@@ -423,26 +427,26 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
423
427
|
]
|
|
424
428
|
}),
|
|
425
429
|
/* @__PURE__ */ C("span", {
|
|
426
|
-
className: i(
|
|
430
|
+
className: i(L.fontClassName, Y.failedText),
|
|
427
431
|
children: v(n)
|
|
428
432
|
}),
|
|
429
|
-
|
|
430
|
-
className: i(
|
|
431
|
-
children:
|
|
433
|
+
G && /* @__PURE__ */ C("span", {
|
|
434
|
+
className: i(L.fontClassName, Y.stepsCount),
|
|
435
|
+
children: G
|
|
432
436
|
})
|
|
433
437
|
]
|
|
434
438
|
});
|
|
435
|
-
} else
|
|
439
|
+
} else q = /* @__PURE__ */ w("span", {
|
|
436
440
|
className: "inline-flex items-center gap-1",
|
|
437
441
|
children: [
|
|
438
442
|
/* @__PURE__ */ C(p, {
|
|
439
443
|
size: a.SM,
|
|
440
|
-
className:
|
|
444
|
+
className: Y.doneIcon,
|
|
441
445
|
"aria-hidden": !0,
|
|
442
446
|
stroke: o
|
|
443
447
|
}),
|
|
444
448
|
/* @__PURE__ */ w("span", {
|
|
445
|
-
className: i(
|
|
449
|
+
className: i(L.fontClassName, Y.executedLabel),
|
|
446
450
|
children: [
|
|
447
451
|
g,
|
|
448
452
|
" ",
|
|
@@ -451,21 +455,21 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
451
455
|
_(e.length)
|
|
452
456
|
]
|
|
453
457
|
}),
|
|
454
|
-
|
|
455
|
-
className: i(
|
|
456
|
-
children:
|
|
458
|
+
G && /* @__PURE__ */ C("span", {
|
|
459
|
+
className: i(L.fontClassName, Y.stepsCount),
|
|
460
|
+
children: G
|
|
457
461
|
})
|
|
458
462
|
]
|
|
459
463
|
});
|
|
460
464
|
return /* @__PURE__ */ w("div", {
|
|
461
|
-
style:
|
|
462
|
-
className: i("flex w-full flex-col gap-1", l),
|
|
465
|
+
style: V,
|
|
466
|
+
className: i("flex w-full flex-col gap-1", l, T.group),
|
|
463
467
|
children: [/* @__PURE__ */ C(u, {
|
|
464
|
-
className:
|
|
468
|
+
className: i(Y.toggleButton, T.groupToggle),
|
|
465
469
|
textClassName: "min-w-0",
|
|
466
|
-
onClick: () =>
|
|
467
|
-
"aria-expanded":
|
|
468
|
-
iconAfter:
|
|
470
|
+
onClick: () => j((e) => !e),
|
|
471
|
+
"aria-expanded": A,
|
|
472
|
+
iconAfter: A ? /* @__PURE__ */ C(m, {
|
|
469
473
|
size: 12,
|
|
470
474
|
"aria-hidden": !0,
|
|
471
475
|
stroke: o
|
|
@@ -475,19 +479,19 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
475
479
|
"aria-hidden": !0,
|
|
476
480
|
stroke: o
|
|
477
481
|
}),
|
|
478
|
-
label:
|
|
482
|
+
label: q
|
|
479
483
|
}), /* @__PURE__ */ C("div", {
|
|
480
|
-
className: i("grid transition-[grid-template-rows] duration-300 ease-in-out",
|
|
484
|
+
className: i("grid transition-[grid-template-rows] duration-300 ease-in-out", A ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
481
485
|
children: /* @__PURE__ */ C("div", {
|
|
482
486
|
className: "overflow-hidden",
|
|
483
|
-
children: /* @__PURE__ */ C(
|
|
487
|
+
children: /* @__PURE__ */ C(J, {
|
|
484
488
|
stages: e,
|
|
485
489
|
isStreaming: r,
|
|
486
490
|
styles: {
|
|
487
|
-
colors:
|
|
491
|
+
colors: F,
|
|
488
492
|
typography: f?.typography
|
|
489
493
|
},
|
|
490
|
-
labels:
|
|
494
|
+
labels: H,
|
|
491
495
|
className: "pt-1"
|
|
492
496
|
})
|
|
493
497
|
})
|
|
@@ -495,4 +499,4 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
495
499
|
});
|
|
496
500
|
};
|
|
497
501
|
//#endregion
|
|
498
|
-
export {
|
|
502
|
+
export { T as CONVERSATION_STAGES_CLASS, X as CollapsedGroup, J as StagesPanel };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-conversation-stages",
|
|
3
3
|
"description": "Panel for displaying agent processing stages during LLM response streaming",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.58",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^19.2.8",
|
|
24
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
25
|
-
"@epam/ai-dial-ui-kit": "^0.15.0-dev.
|
|
24
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.58",
|
|
25
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.9"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|