@epam/ai-dial-conversation-stages 1.2.0-dev.14 → 1.2.0-dev.142
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.css +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +78 -81
- package/models/collapsed-group.d.ts +0 -2
- package/models/collapsed-group.d.ts.map +1 -1
- package/package.json +3 -3
- package/utils/stage-progress.d.ts +0 -2
- package/utils/stage-progress.d.ts.map +1 -1
|
@@ -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,CA0OlD,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.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
._panel_vd48n_1{color:var(--cs-text,var(--text-primary,#161b2d))}._row_vd48n_5:hover{background:var(--cs-row-hover,var(--bg-layer-sunken,#eef1f7))}._collapseButton_vd48n_9{background:var(--cs-button-bg,transparent)}._stageName_vd48n_13{color:var(--cs-stage-text,var(--text-secondary,#57647a))}._stageNameFailed_vd48n_17{color:var(--cs-failed-text,var(--text-warning,#7f6300))}._monoName_vd48n_21{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace}._tag_vd48n_25{color:var(--cs-tag-text,var(--text-tertiary,#848e9c))}._count_vd48n_29{color:var(--cs-count-text,var(--text-tertiary,#848e9c));font-variant-numeric:tabular-nums}._duration_vd48n_34{color:var(--cs-duration-text,var(--text-tertiary,#848e9c));font-variant-numeric:tabular-nums}._iconSecondary_vd48n_39{color:var(--cs-icon-secondary,var(--text-secondary,#57647a));opacity:.7}._iconCompleted_vd48n_44{color:var(--cs-icon-completed,var(--text-tertiary,#848e9c))}._iconError_vd48n_48{color:var(--cs-icon-error,var(--text-warning,#7f6300))}._stageContent_vd48n_52{color:var(--cs-stage-text,var(--text-secondary,#57647a))}._codeBlock_vd48n_56{background:var(--cs-code-bg,var(--bg-layer-raised,#fcfcfc));border-color:var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._codeInline_vd48n_62{background:var(--cs-code-bg,var(--bg-layer-raised,#fcfcfc));border:1px solid var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._blockquote_vd48n_68{border-color:var(--cs-stage-text,var(--text-secondary,#57647a));color:var(--cs-stage-text,var(--text-secondary,#57647a))}._tableCell_vd48n_73{border-color:var(--cs-border,var(--stroke-secondary,#d1dbea));color:var(--cs-stage-text,var(--text-secondary,#57647a))}._toggleButton_1sa5v_1{color:var(--cs-cg-label,var(--text-secondary,#57647a));text-align:start;width:100%;min-width:0;justify-content:flex-start!important}._toggleButton_1sa5v_1:hover{color:var(--cs-cg-label-hover,var(--text-primary,#161b2d))}._executedLabel_1sa5v_13{color:var(--cs-cg-label,var(--text-secondary,#57647a))}._stepsCount_1sa5v_17{color:var(--cs-cg-steps-count,var(--text-tertiary,#848e9c));font-variant-numeric:tabular-nums}._doneIcon_1sa5v_22{color:var(--cs-cg-done,var(--text-success,#007274))}._failedText_1sa5v_26{color:var(--cs-cg-failed,var(--text-warning,#7f6300))}._liveName_1sa5v_30{color:var(--cs-cg-label,var(--text-primary,#161b2d))}
|
|
2
|
-
/*$vite$:1
|
|
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}.collapse{visibility:collapse}.absolute{position:absolute}.relative{position:relative}.end-2{inset-inline-end:.5rem}.top-2{top:.5rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.max-h-\[300px\]{max-height:300px}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\[22rem\]{max-width:22rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.cursor-pointer{cursor:pointer}.grid-rows-\[0fr\]{grid-template-rows:0fr}.grid-rows-\[1fr\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-0{gap:0}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:4px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.p-3{padding:.75rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.ps-5{padding-inline-start:1.25rem}.ps-6{padding-inline-start:1.5rem}.ps-8{padding-inline-start:2rem}.pt-1{padding-top:.25rem}.text-start{text-align:start}.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-\[grid-template-rows\]{transition-duration:.15s;transition-property:grid-template-rows;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.duration-\[250ms\]{transition-duration:.25s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.last\:mb-0:last-child{margin-bottom:0}.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
|
@@ -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) => {
|
|
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,
|
|
@@ -160,7 +164,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
160
164
|
}) }
|
|
161
165
|
});
|
|
162
166
|
}), G = ({ stage: e, isLive: n, typography: r, labels: s, nameOverride: l }) => {
|
|
163
|
-
let [u, d] = x(!1), { copyAriaLabel: f = "Copy stage content", runningAriaLabel: p, failedAriaLabel: g } = s ?? {}, { name: _, durationLabel: v } =
|
|
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
170
|
children: /* @__PURE__ */ C(H, {
|
|
@@ -226,7 +230,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
226
230
|
children: D
|
|
227
231
|
});
|
|
228
232
|
}, K = ({ row: e, isLive: n, typography: r, labels: s }) => {
|
|
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 =
|
|
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),
|
|
@@ -308,7 +312,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
308
312
|
}), u = B(e);
|
|
309
313
|
return /* @__PURE__ */ C("div", {
|
|
310
314
|
style: l,
|
|
311
|
-
className: i("w-full", V.panel, r),
|
|
315
|
+
className: i("w-full", V.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",
|
|
@@ -339,36 +343,36 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
339
343
|
failedText: "_failedText_1sa5v_26",
|
|
340
344
|
liveName: "_liveName_1sa5v_30"
|
|
341
345
|
}, Y = ({ stages: e, isStreaming: r, labels: s, className: l, styles: f }) => {
|
|
342
|
-
let { executedLabel: g = "Executed", stepsLabel: _ = () => "steps", failedCountLabel: v = (e) => `${e} failed`,
|
|
346
|
+
let { executedLabel: g = "Executed", stepsLabel: _ = () => "steps", failedCountLabel: v = (e) => `${e} failed`, runningAriaLabel: S = "Running", copyAriaLabel: E, failedAriaLabel: D, attemptLabel: O } = s ?? {}, [k, A] = x(r), j = b(r);
|
|
343
347
|
y(() => {
|
|
344
348
|
j.current && !r && A(!1), j.current = r;
|
|
345
349
|
}, [r]);
|
|
346
|
-
let { colors: M, panel:
|
|
350
|
+
let { colors: M, panel: N } = f ?? {}, F = f?.typography ?? { fontClassName: "dial-small-text" }, L = n({
|
|
347
351
|
"--cs-cg-label": M?.labelColor,
|
|
348
352
|
"--cs-cg-label-hover": M?.labelHoverColor,
|
|
349
353
|
"--cs-cg-steps-count": M?.stepsCountColor,
|
|
350
354
|
"--cs-cg-done": M?.doneColor,
|
|
351
355
|
"--cs-cg-failed": M?.failedColor,
|
|
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":
|
|
356
|
+
"--cs-text": N?.text,
|
|
357
|
+
"--cs-row-hover": N?.rowHoverColor,
|
|
358
|
+
"--cs-button-bg": N?.collapsedButtonBg,
|
|
359
|
+
"--cs-stage-text": N?.stageTextColor,
|
|
360
|
+
"--cs-failed-text": N?.failedColor,
|
|
361
|
+
"--cs-tag-text": N?.tagTextColor,
|
|
362
|
+
"--cs-count-text": N?.countTextColor,
|
|
363
|
+
"--cs-duration-text": N?.durationTextColor,
|
|
364
|
+
"--cs-icon-secondary": N?.iconSecondaryColor,
|
|
365
|
+
"--cs-icon-completed": N?.iconCompletedColor,
|
|
366
|
+
"--cs-icon-error": N?.iconErrorColor,
|
|
367
|
+
"--cs-code-bg": N?.codeBg,
|
|
368
|
+
"--cs-code-border": N?.codeBorderColor,
|
|
369
|
+
"--cs-code-text": N?.codeTextColor,
|
|
370
|
+
"--cs-border": N?.borderColor
|
|
367
371
|
});
|
|
368
372
|
if (e.length === 0) return null;
|
|
369
|
-
let
|
|
373
|
+
let B = {
|
|
370
374
|
copyAriaLabel: E,
|
|
371
|
-
runningAriaLabel:
|
|
375
|
+
runningAriaLabel: S,
|
|
372
376
|
failedAriaLabel: D,
|
|
373
377
|
attemptLabel: O
|
|
374
378
|
};
|
|
@@ -377,43 +381,36 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
377
381
|
isStreaming: r,
|
|
378
382
|
className: l,
|
|
379
383
|
styles: {
|
|
380
|
-
colors:
|
|
384
|
+
colors: N,
|
|
381
385
|
typography: f?.typography
|
|
382
386
|
},
|
|
383
|
-
labels:
|
|
387
|
+
labels: B
|
|
384
388
|
});
|
|
385
|
-
let
|
|
389
|
+
let V = e.some((e) => e.status === t.Failed), H = R(e.map((e) => e.name)), U = H > 0 ? I(H) : void 0, W;
|
|
386
390
|
if (r) {
|
|
387
|
-
let t =
|
|
388
|
-
|
|
391
|
+
let t = P((z(e) ?? e[e.length - 1]).name).name;
|
|
392
|
+
W = /* @__PURE__ */ w("span", {
|
|
389
393
|
role: "status",
|
|
390
394
|
"aria-live": "polite",
|
|
391
395
|
className: "flex min-w-0 items-center gap-2",
|
|
392
|
-
children: [
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
ariaLabel: T
|
|
398
|
-
})
|
|
399
|
-
}),
|
|
400
|
-
/* @__PURE__ */ C("span", {
|
|
401
|
-
className: i("flex-none whitespace-nowrap", I.fontClassName, J.liveName),
|
|
402
|
-
children: S(t, e.length)
|
|
403
|
-
}),
|
|
404
|
-
n && /* @__PURE__ */ C("span", {
|
|
405
|
-
className: i("min-w-0 max-w-[22rem] truncate", I.fontClassName, J.executedLabel),
|
|
406
|
-
children: /* @__PURE__ */ C(c, { text: n })
|
|
396
|
+
children: [/* @__PURE__ */ C("span", {
|
|
397
|
+
className: "flex flex-none items-center",
|
|
398
|
+
children: /* @__PURE__ */ C(d, {
|
|
399
|
+
size: 14,
|
|
400
|
+
ariaLabel: S
|
|
407
401
|
})
|
|
408
|
-
|
|
402
|
+
}), t && /* @__PURE__ */ C("span", {
|
|
403
|
+
className: i("min-w-0 max-w-[22rem] truncate", F.fontClassName, J.liveName),
|
|
404
|
+
children: /* @__PURE__ */ C(c, { text: t })
|
|
405
|
+
})]
|
|
409
406
|
});
|
|
410
|
-
} else if (
|
|
407
|
+
} else if (V) {
|
|
411
408
|
let n = e.filter((e) => e.status === t.Failed).length;
|
|
412
|
-
|
|
409
|
+
W = /* @__PURE__ */ w("span", {
|
|
413
410
|
className: "inline-flex items-center gap-1",
|
|
414
411
|
children: [
|
|
415
412
|
/* @__PURE__ */ w("span", {
|
|
416
|
-
className: i(
|
|
413
|
+
className: i(F.fontClassName, J.executedLabel),
|
|
417
414
|
children: [
|
|
418
415
|
g,
|
|
419
416
|
" ",
|
|
@@ -423,16 +420,16 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
423
420
|
]
|
|
424
421
|
}),
|
|
425
422
|
/* @__PURE__ */ C("span", {
|
|
426
|
-
className: i(
|
|
423
|
+
className: i(F.fontClassName, J.failedText),
|
|
427
424
|
children: v(n)
|
|
428
425
|
}),
|
|
429
|
-
|
|
430
|
-
className: i(
|
|
431
|
-
children:
|
|
426
|
+
U && /* @__PURE__ */ C("span", {
|
|
427
|
+
className: i(F.fontClassName, J.stepsCount),
|
|
428
|
+
children: U
|
|
432
429
|
})
|
|
433
430
|
]
|
|
434
431
|
});
|
|
435
|
-
} else
|
|
432
|
+
} else W = /* @__PURE__ */ w("span", {
|
|
436
433
|
className: "inline-flex items-center gap-1",
|
|
437
434
|
children: [
|
|
438
435
|
/* @__PURE__ */ C(p, {
|
|
@@ -442,7 +439,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
442
439
|
stroke: o
|
|
443
440
|
}),
|
|
444
441
|
/* @__PURE__ */ w("span", {
|
|
445
|
-
className: i(
|
|
442
|
+
className: i(F.fontClassName, J.executedLabel),
|
|
446
443
|
children: [
|
|
447
444
|
g,
|
|
448
445
|
" ",
|
|
@@ -451,17 +448,17 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
451
448
|
_(e.length)
|
|
452
449
|
]
|
|
453
450
|
}),
|
|
454
|
-
|
|
455
|
-
className: i(
|
|
456
|
-
children:
|
|
451
|
+
U && /* @__PURE__ */ C("span", {
|
|
452
|
+
className: i(F.fontClassName, J.stepsCount),
|
|
453
|
+
children: U
|
|
457
454
|
})
|
|
458
455
|
]
|
|
459
456
|
});
|
|
460
457
|
return /* @__PURE__ */ w("div", {
|
|
461
|
-
style:
|
|
462
|
-
className: i("flex w-full flex-col gap-1", l),
|
|
458
|
+
style: L,
|
|
459
|
+
className: i("flex w-full flex-col gap-1", l, T.group),
|
|
463
460
|
children: [/* @__PURE__ */ C(u, {
|
|
464
|
-
className: J.toggleButton,
|
|
461
|
+
className: i(J.toggleButton, T.groupToggle),
|
|
465
462
|
textClassName: "min-w-0",
|
|
466
463
|
onClick: () => A((e) => !e),
|
|
467
464
|
"aria-expanded": k,
|
|
@@ -475,7 +472,7 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
475
472
|
"aria-hidden": !0,
|
|
476
473
|
stroke: o
|
|
477
474
|
}),
|
|
478
|
-
label:
|
|
475
|
+
label: W
|
|
479
476
|
}), /* @__PURE__ */ C("div", {
|
|
480
477
|
className: i("grid transition-[grid-template-rows] duration-300 ease-in-out", k ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
481
478
|
children: /* @__PURE__ */ C("div", {
|
|
@@ -484,10 +481,10 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
484
481
|
stages: e,
|
|
485
482
|
isStreaming: r,
|
|
486
483
|
styles: {
|
|
487
|
-
colors:
|
|
484
|
+
colors: N,
|
|
488
485
|
typography: f?.typography
|
|
489
486
|
},
|
|
490
|
-
labels:
|
|
487
|
+
labels: B,
|
|
491
488
|
className: "pt-1"
|
|
492
489
|
})
|
|
493
490
|
})
|
|
@@ -495,4 +492,4 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
495
492
|
});
|
|
496
493
|
};
|
|
497
494
|
//#endregion
|
|
498
|
-
export { Y as CollapsedGroup, q as StagesPanel };
|
|
495
|
+
export { T as CONVERSATION_STAGES_CLASS, Y as CollapsedGroup, q as StagesPanel };
|
|
@@ -35,8 +35,6 @@ export interface CollapsedGroupLabels {
|
|
|
35
35
|
stepsLabel?: (count: number) => string;
|
|
36
36
|
/** Returns the "N failed" text in the failed summary. Defaults to `(n) => \`${n} failed\``. */
|
|
37
37
|
failedCountLabel?: (failedCount: number) => string;
|
|
38
|
-
/** Returns the "Step X of Y" text in the running summary. Defaults to `(current, total) => \`Step ${current} of ${total}\``. */
|
|
39
|
-
runningStepLabel?: (current: number, total: number) => string;
|
|
40
38
|
/** Accessible label announced for the running summary's spinner. Defaults to `'Running'`. */
|
|
41
39
|
runningAriaLabel?: string;
|
|
42
40
|
/** Accessible label for the copy button on each stage's content. Defaults to `'Copy'`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsed-group.d.ts","sourceRoot":"","sources":["../../src/models/collapsed-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mCAAmC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iEAAiE;AACjE,MAAM,WAAW,wBAAwB;IACvC,6FAA6F;IAC7F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,8CAA8C;IAC9C,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC,4DAA4D;IAC5D,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,+FAA+F;IAC/F,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IACnD,
|
|
1
|
+
{"version":3,"file":"collapsed-group.d.ts","sourceRoot":"","sources":["../../src/models/collapsed-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mCAAmC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iEAAiE;AACjE,MAAM,WAAW,wBAAwB;IACvC,6FAA6F;IAC7F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,8CAA8C;IAC9C,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC,4DAA4D;IAC5D,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,+FAA+F;IAC/F,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IACnD,6FAA6F;IAC7F,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mHAAmH;IACnH,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,8FAA8F;IAC9F,WAAW,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B"}
|
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.142",
|
|
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.
|
|
24
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.142",
|
|
25
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.18"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Stage } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
/** Returns the last stage with `status: null` (the currently executing stage), or `undefined` if none exists. */
|
|
3
3
|
export declare const findLiveStage: (stages: Stage[]) => Stage | undefined;
|
|
4
|
-
/** 1-based position of `stage` within `stages`, by its stable `index` field. */
|
|
5
|
-
export declare const stagePosition: (stages: Stage[], stage: Stage) => number;
|
|
6
4
|
//# sourceMappingURL=stage-progress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage-progress.d.ts","sourceRoot":"","sources":["../../src/utils/stage-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,iHAAiH;AACjH,eAAO,MAAM,aAAa,GAAI,QAAQ,KAAK,EAAE,KAAG,KAAK,GAAG,SACK,CAAC
|
|
1
|
+
{"version":3,"file":"stage-progress.d.ts","sourceRoot":"","sources":["../../src/utils/stage-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,iHAAiH;AACjH,eAAO,MAAM,aAAa,GAAI,QAAQ,KAAK,EAAE,KAAG,KAAK,GAAG,SACK,CAAC"}
|