@epam/ai-dial-conversation-stages 1.1.0-dev.49 → 1.1.0-dev.492
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/StageIcon/StageIcon.d.ts.map +1 -1
- package/components/StageItem/StageItem.d.ts.map +1 -1
- package/components/StageMarkdownContent/StageCodeBlock.d.ts +2 -0
- package/components/StageMarkdownContent/StageCodeBlock.d.ts.map +1 -1
- package/components/StagesPanel/StagesPanel.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +304 -261
- package/models/collapsed-group.d.ts +1 -1
- package/models/collapsed-group.d.ts.map +1 -1
- package/models/stages-props.d.ts +13 -9
- package/models/stages-props.d.ts.map +1 -1
- package/package.json +8 -6
- package/utils/stage-name.d.ts +2 -0
- package/utils/stage-name.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"
|
|
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;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAUxE,gJAAgJ;AAChJ,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA8OlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageIcon.d.ts","sourceRoot":"","sources":["../../../src/components/StageIcon/StageIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"StageIcon.d.ts","sourceRoot":"","sources":["../../../src/components/StageIcon/StageIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAOxD,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAG3B,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4GAA4G;IAC5G,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,8FAA8F;AAC9F,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAgCxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageItem.d.ts","sourceRoot":"","sources":["../../../src/components/StageItem/StageItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"StageItem.d.ts","sourceRoot":"","sources":["../../../src/components/StageItem/StageItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAQvD,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAMnC,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,kHAAkH;IAClH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,6EAA6E;AAC7E,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA+HxC,CAAC"}
|
|
@@ -4,6 +4,8 @@ interface Props {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
/** Language class from react-markdown (e.g. `language-json`). */
|
|
6
6
|
codeClassName?: string;
|
|
7
|
+
/** Typography class applied to the `<pre>` block. Defaults to `'dial-code-text'`. */
|
|
8
|
+
blockClassName?: string;
|
|
7
9
|
/** Accessible label for the copy button. */
|
|
8
10
|
copyAriaLabel: string;
|
|
9
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageCodeBlock.d.ts","sourceRoot":"","sources":["../../../src/components/StageMarkdownContent/StageCodeBlock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StageCodeBlock.d.ts","sourceRoot":"","sources":["../../../src/components/StageMarkdownContent/StageCodeBlock.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,UAAU,KAAK;IACb,6BAA6B;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4CAA4C;IAC5C,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,mEAAmE;AACnE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,KAAK,CA4DpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/StagesPanel/StagesPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/StagesPanel/StagesPanel.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AA6InC,+FAA+F;AAC/F,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA+D5C,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
2
|
/*$vite$:1*/
|
package/index.js
CHANGED
|
@@ -1,33 +1,64 @@
|
|
|
1
1
|
import { MarkdownRenderer as e, StageStatus as t, buildCssVars as n, copyToClipboard as r, mergeClasses as i } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { DIAL_ICON_SIZE as a,
|
|
3
|
-
import { IconAlertCircle as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { Fragment as
|
|
2
|
+
import { DIAL_ICON_SIZE as a, DIAL_KIT_ICON_STROKE as o, ElementSize as s, EllipsisTooltip as c, GhostIconButton as l, LinkButton as u, Spinner as d } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconAlertCircle as f, IconCheck as p, IconChevronDown as m, IconChevronRight as h, IconCopy as g } from "@tabler/icons-react";
|
|
4
|
+
import { memo as _, useCallback as v, useEffect as y, useRef as b, useState as x } from "react";
|
|
5
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
6
6
|
//#region src/utils/stage-name.ts
|
|
7
|
-
var
|
|
8
|
-
let t = e
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{1,2}):([0-5]\d):([0-5]\d(?:\.\d+)?)\b/i, O = (e) => {
|
|
8
|
+
let t = e.trimEnd();
|
|
9
|
+
return t.endsWith(":") ? t.slice(0, -1) : t;
|
|
10
|
+
}, k = 1440 * 60, A = k / 2, j = (e) => {
|
|
11
|
+
let t = D.exec(e);
|
|
12
|
+
if (!t) return;
|
|
13
|
+
let n = Number(t[1]);
|
|
14
|
+
if (!(n > 23)) return n * 60 * 60 + Number(t[2]) * 60 + Number(t[3]);
|
|
15
|
+
}, M = (e) => {
|
|
16
|
+
T.lastIndex = 0;
|
|
17
|
+
let t;
|
|
18
|
+
for (; t = T.exec(e);) {
|
|
19
|
+
let e = t[0].slice(1, -1), n = E.exec(e);
|
|
20
|
+
if (n) return {
|
|
21
|
+
durationLabel: `${n[1]}s`,
|
|
22
|
+
groupIndex: t.index,
|
|
23
|
+
groupLength: t[0].length,
|
|
24
|
+
startTimeSeconds: j(e)
|
|
25
|
+
};
|
|
17
26
|
}
|
|
27
|
+
}, N = (e) => {
|
|
28
|
+
let t = e ?? "", n = M(t);
|
|
18
29
|
return {
|
|
19
|
-
name: (
|
|
20
|
-
durationLabel:
|
|
30
|
+
name: O(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
|
|
31
|
+
durationLabel: n?.durationLabel
|
|
21
32
|
};
|
|
22
|
-
},
|
|
33
|
+
}, P = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), F = (e) => e >= 60 ? `${Math.floor(e / 60)}m ${Math.round(e % 60)}s` : `${e.toFixed(1)}s`, I = (e) => {
|
|
23
34
|
if (!e) return;
|
|
24
35
|
let t = /^(\d+(?:\.\d+)?)s$/.exec(e);
|
|
25
36
|
return t ? parseFloat(t[1]) : void 0;
|
|
26
|
-
},
|
|
37
|
+
}, L = (e) => {
|
|
38
|
+
let t = e.flatMap((e) => {
|
|
39
|
+
let t = M(e ?? ""), n = I(t?.durationLabel);
|
|
40
|
+
return n == null ? [] : [{
|
|
41
|
+
durationSeconds: n,
|
|
42
|
+
startTimeSeconds: t?.startTimeSeconds
|
|
43
|
+
}];
|
|
44
|
+
});
|
|
45
|
+
if (t.length === 0) return 0;
|
|
46
|
+
if (t.some(({ startTimeSeconds: e }) => e == null)) return t.reduce((e, { durationSeconds: t }) => e + t, 0);
|
|
47
|
+
let n = 0, r, i = t.flatMap(({ durationSeconds: e, startTimeSeconds: t }) => {
|
|
48
|
+
if (t == null) return [];
|
|
49
|
+
let i = t + n;
|
|
50
|
+
return r != null && r - i > A && (n += k, i += k), r = i, {
|
|
51
|
+
start: i,
|
|
52
|
+
end: i + e
|
|
53
|
+
};
|
|
54
|
+
}).sort((e, t) => e.start - t.start), a = 0, o = i[0].start, s = i[0].end;
|
|
55
|
+
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
|
+
return a + s - o;
|
|
57
|
+
}, R = (e) => [...e].reverse().find((e) => e.status == null), z = (e, t) => e.findIndex((e) => e.index === t.index) + 1, B = (e) => {
|
|
27
58
|
let t = [], n = 0;
|
|
28
59
|
for (; n < e.length;) {
|
|
29
|
-
let r = e[n], i =
|
|
30
|
-
for (; a < e.length &&
|
|
60
|
+
let r = e[n], i = N(r.name).name, a = n + 1;
|
|
61
|
+
for (; a < e.length && N(e[a].name).name === i;) a += 1;
|
|
31
62
|
let o = e.slice(n, a);
|
|
32
63
|
o.length > 1 ? t.push({
|
|
33
64
|
key: r.index,
|
|
@@ -39,65 +70,68 @@ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e)
|
|
|
39
70
|
}), n = a;
|
|
40
71
|
}
|
|
41
72
|
return t;
|
|
42
|
-
},
|
|
43
|
-
panel: "
|
|
44
|
-
row: "
|
|
45
|
-
collapseButton: "
|
|
46
|
-
stageName: "
|
|
47
|
-
stageNameFailed: "
|
|
48
|
-
monoName: "
|
|
49
|
-
tag: "
|
|
50
|
-
count: "
|
|
51
|
-
duration: "
|
|
52
|
-
iconSecondary: "
|
|
53
|
-
iconCompleted: "
|
|
54
|
-
iconError: "
|
|
55
|
-
stageContent: "
|
|
56
|
-
codeBlock: "
|
|
57
|
-
codeInline: "
|
|
58
|
-
blockquote: "
|
|
59
|
-
tableCell: "
|
|
60
|
-
},
|
|
61
|
-
size: 16,
|
|
62
|
-
ariaLabel: r
|
|
63
|
-
}) : e === t.Failed ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(d, {
|
|
73
|
+
}, V = {
|
|
74
|
+
panel: "_panel_vd48n_1",
|
|
75
|
+
row: "_row_vd48n_5",
|
|
76
|
+
collapseButton: "_collapseButton_vd48n_9",
|
|
77
|
+
stageName: "_stageName_vd48n_13",
|
|
78
|
+
stageNameFailed: "_stageNameFailed_vd48n_17",
|
|
79
|
+
monoName: "_monoName_vd48n_21",
|
|
80
|
+
tag: "_tag_vd48n_25",
|
|
81
|
+
count: "_count_vd48n_29",
|
|
82
|
+
duration: "_duration_vd48n_34",
|
|
83
|
+
iconSecondary: "_iconSecondary_vd48n_39",
|
|
84
|
+
iconCompleted: "_iconCompleted_vd48n_44",
|
|
85
|
+
iconError: "_iconError_vd48n_48",
|
|
86
|
+
stageContent: "_stageContent_vd48n_52",
|
|
87
|
+
codeBlock: "_codeBlock_vd48n_56",
|
|
88
|
+
codeInline: "_codeInline_vd48n_62",
|
|
89
|
+
blockquote: "_blockquote_vd48n_68",
|
|
90
|
+
tableCell: "_tableCell_vd48n_73"
|
|
91
|
+
}, H = ({ status: e, isLive: n, runningLabel: r = "Running", failedLabel: i = "Failed" }) => e === t.Failed ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(f, {
|
|
64
92
|
size: a.MD,
|
|
65
|
-
className:
|
|
66
|
-
"aria-hidden": !0
|
|
67
|
-
|
|
93
|
+
className: V.iconError,
|
|
94
|
+
"aria-hidden": !0,
|
|
95
|
+
stroke: o
|
|
96
|
+
}), /* @__PURE__ */ C("span", {
|
|
68
97
|
className: "sr-only",
|
|
69
98
|
children: i
|
|
70
|
-
})] }) : /* @__PURE__ */
|
|
99
|
+
})] }) : e === t.Completed ? /* @__PURE__ */ C(p, {
|
|
71
100
|
size: a.SM,
|
|
72
|
-
className:
|
|
73
|
-
"aria-hidden": !0
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
101
|
+
className: V.iconCompleted,
|
|
102
|
+
"aria-hidden": !0,
|
|
103
|
+
stroke: o
|
|
104
|
+
}) : n ? /* @__PURE__ */ C(d, {
|
|
105
|
+
size: 16,
|
|
106
|
+
ariaLabel: r
|
|
107
|
+
}) : null, U = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: c }) => {
|
|
108
|
+
let [u, d] = x(!1), f = b(null);
|
|
109
|
+
y(() => () => {
|
|
110
|
+
f.current != null && clearTimeout(f.current);
|
|
78
111
|
}, []);
|
|
79
|
-
let
|
|
80
|
-
r(typeof e == "string" ? e : String(e ?? "")),
|
|
112
|
+
let m = v(() => {
|
|
113
|
+
r(typeof e == "string" ? e : String(e ?? "")), f.current && clearTimeout(f.current), d(!0), f.current = setTimeout(() => d(!1), 2e3);
|
|
81
114
|
}, [e]);
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
className: i("relative max-h-[300px] overflow-auto rounded border p-3
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
-
size:
|
|
86
|
-
icon:
|
|
115
|
+
return /* @__PURE__ */ w("pre", {
|
|
116
|
+
className: i("relative max-h-[300px] overflow-auto rounded border p-3", n, V.codeBlock),
|
|
117
|
+
children: [/* @__PURE__ */ C(l, {
|
|
118
|
+
size: s.Small,
|
|
119
|
+
icon: C(u ? p : g, {
|
|
87
120
|
size: a.SM,
|
|
88
|
-
className:
|
|
121
|
+
className: V.iconSecondary,
|
|
122
|
+
stroke: o
|
|
89
123
|
}),
|
|
90
|
-
"aria-label":
|
|
91
|
-
onClick:
|
|
124
|
+
"aria-label": c,
|
|
125
|
+
onClick: m,
|
|
92
126
|
className: "absolute end-2 top-2"
|
|
93
|
-
}), /* @__PURE__ */
|
|
94
|
-
className:
|
|
127
|
+
}), /* @__PURE__ */ C("code", {
|
|
128
|
+
className: t,
|
|
95
129
|
children: e
|
|
96
130
|
})]
|
|
97
131
|
});
|
|
98
|
-
},
|
|
99
|
-
let a = "mb-1.5 last:mb-0", o = i(n?.headingClassName ?? "dial-small-semi-text",
|
|
100
|
-
return /* @__PURE__ */
|
|
132
|
+
}, W = _(({ content: t, typography: n, copyAriaLabel: r = "Copy" }) => {
|
|
133
|
+
let a = "mb-1.5 last:mb-0", o = i(n?.headingClassName ?? "dial-small-semi-text", V.stageContent, a);
|
|
134
|
+
return /* @__PURE__ */ C(e, {
|
|
101
135
|
content: t,
|
|
102
136
|
classNames: {
|
|
103
137
|
h1: o,
|
|
@@ -106,150 +140,155 @@ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e)
|
|
|
106
140
|
h4: o,
|
|
107
141
|
h5: o,
|
|
108
142
|
h6: o,
|
|
109
|
-
p: i(n?.contentClassName ?? "dial-tiny-text",
|
|
110
|
-
ul: i(n?.contentClassName ?? "dial-tiny-text",
|
|
111
|
-
ol: i(n?.contentClassName ?? "dial-tiny-text",
|
|
112
|
-
strong: i(n?.strongClassName ?? n?.contentClassName ?? "dial-tiny-text",
|
|
113
|
-
codeInline:
|
|
114
|
-
blockquote: i(n?.contentClassName ?? "dial-tiny-text",
|
|
115
|
-
link: i(n?.contentClassName ?? "dial-tiny-text",
|
|
116
|
-
tableCell: i(n?.contentClassName ?? "dial-tiny-text",
|
|
143
|
+
p: i(n?.contentClassName ?? "dial-tiny-text", V.stageContent, "mb-1.5"),
|
|
144
|
+
ul: i(n?.contentClassName ?? "dial-tiny-text", V.stageContent, a),
|
|
145
|
+
ol: i(n?.contentClassName ?? "dial-tiny-text", V.stageContent, a),
|
|
146
|
+
strong: i(n?.strongClassName ?? n?.contentClassName ?? "dial-tiny-text", V.stageContent),
|
|
147
|
+
codeInline: V.codeInline,
|
|
148
|
+
blockquote: i(n?.contentClassName ?? "dial-tiny-text", V.blockquote, a),
|
|
149
|
+
link: i(n?.contentClassName ?? "dial-tiny-text", V.stageContent),
|
|
150
|
+
tableCell: i(n?.contentClassName ?? "dial-tiny-text", V.tableCell)
|
|
117
151
|
},
|
|
118
|
-
components: { code: ({ children: e, className: t }) => t?.includes("language-") ? /* @__PURE__ */
|
|
152
|
+
components: { code: ({ children: e, className: t }) => t?.includes("language-") ? /* @__PURE__ */ C(U, {
|
|
119
153
|
codeClassName: t,
|
|
154
|
+
blockClassName: n?.codeBlockClassName,
|
|
120
155
|
copyAriaLabel: r,
|
|
121
156
|
children: e
|
|
122
|
-
}) : /* @__PURE__ */
|
|
123
|
-
className: i("inline-block px-1.5 py-1", n?.codeClassName ?? "dial-
|
|
157
|
+
}) : /* @__PURE__ */ C("code", {
|
|
158
|
+
className: i("inline-block px-1.5 py-1", n?.codeClassName ?? "dial-code-text rounded-md", V.codeInline),
|
|
124
159
|
children: e
|
|
125
160
|
}) }
|
|
126
161
|
});
|
|
127
|
-
}),
|
|
128
|
-
let [
|
|
129
|
-
/* @__PURE__ */
|
|
162
|
+
}), 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 } = N(e.name), y = l ?? _, b = !l && P(_), T = e.status === t.Failed, E = !!e.content, D = /* @__PURE__ */ w(S, { children: [
|
|
164
|
+
/* @__PURE__ */ C("span", {
|
|
130
165
|
className: "flex flex-none items-center",
|
|
131
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ C(H, {
|
|
132
167
|
status: e.status,
|
|
133
168
|
isLive: n,
|
|
134
|
-
runningLabel:
|
|
135
|
-
failedLabel:
|
|
169
|
+
runningLabel: p,
|
|
170
|
+
failedLabel: g
|
|
136
171
|
})
|
|
137
172
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text",
|
|
140
|
-
children: /* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ C("span", {
|
|
174
|
+
className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", V.stageName, T && V.stageNameFailed, b && V.monoName),
|
|
175
|
+
children: /* @__PURE__ */ C(c, { text: y || e.status || "" })
|
|
141
176
|
}),
|
|
142
|
-
e.tag && /* @__PURE__ */
|
|
143
|
-
className: i("flex-none", r?.
|
|
177
|
+
e.tag && /* @__PURE__ */ C("span", {
|
|
178
|
+
className: i("flex-none", r?.tagClassName ?? "dial-tiny-lead-text", V.tag),
|
|
144
179
|
children: e.tag
|
|
145
180
|
}),
|
|
146
|
-
|
|
147
|
-
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text",
|
|
148
|
-
children:
|
|
181
|
+
v && /* @__PURE__ */ C("span", {
|
|
182
|
+
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", V.duration),
|
|
183
|
+
children: v
|
|
149
184
|
}),
|
|
150
|
-
|
|
151
|
-
className: i("flex-none",
|
|
152
|
-
children:
|
|
185
|
+
E && /* @__PURE__ */ C("span", {
|
|
186
|
+
className: i("flex-none", V.iconSecondary),
|
|
187
|
+
children: u ? /* @__PURE__ */ C(m, {
|
|
153
188
|
size: a.SM,
|
|
154
|
-
"aria-hidden": !0
|
|
155
|
-
|
|
189
|
+
"aria-hidden": !0,
|
|
190
|
+
stroke: o
|
|
191
|
+
}) : /* @__PURE__ */ C(h, {
|
|
156
192
|
size: a.SM,
|
|
157
193
|
className: "rtl:scale-x-[-1]",
|
|
158
|
-
"aria-hidden": !0
|
|
194
|
+
"aria-hidden": !0,
|
|
195
|
+
stroke: o
|
|
159
196
|
})
|
|
160
197
|
})
|
|
161
|
-
] }),
|
|
162
|
-
return
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
198
|
+
] }), O = i("flex w-full items-center gap-2 px-2 py-1.5", V.row);
|
|
199
|
+
return E ? /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("div", {
|
|
200
|
+
className: O,
|
|
201
|
+
children: /* @__PURE__ */ C("button", {
|
|
202
|
+
type: "button",
|
|
203
|
+
onClick: () => d((e) => !e),
|
|
204
|
+
"aria-expanded": u,
|
|
205
|
+
className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-start",
|
|
206
|
+
children: D
|
|
207
|
+
})
|
|
208
|
+
}), /* @__PURE__ */ C("div", {
|
|
209
|
+
className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out", u ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
210
|
+
children: /* @__PURE__ */ C("div", {
|
|
171
211
|
className: "overflow-hidden",
|
|
172
|
-
children: /* @__PURE__ */
|
|
212
|
+
children: /* @__PURE__ */ C("div", {
|
|
173
213
|
className: "mt-2 flex flex-col gap-3 py-1 ps-8",
|
|
174
|
-
children: e.content && /* @__PURE__ */
|
|
214
|
+
children: e.content && /* @__PURE__ */ C("div", {
|
|
175
215
|
className: "max-h-[300px] overflow-y-auto",
|
|
176
|
-
children: /* @__PURE__ */
|
|
216
|
+
children: /* @__PURE__ */ C(W, {
|
|
177
217
|
content: e.content,
|
|
178
218
|
typography: r,
|
|
179
|
-
copyAriaLabel:
|
|
219
|
+
copyAriaLabel: f
|
|
180
220
|
})
|
|
181
221
|
})
|
|
182
222
|
})
|
|
183
223
|
})
|
|
184
|
-
})] }) : /* @__PURE__ */
|
|
185
|
-
className:
|
|
186
|
-
children:
|
|
224
|
+
})] }) : /* @__PURE__ */ C("div", {
|
|
225
|
+
className: O,
|
|
226
|
+
children: D
|
|
187
227
|
});
|
|
188
|
-
},
|
|
189
|
-
let { runningAriaLabel:
|
|
190
|
-
|
|
191
|
-
return e + (A(n) ?? 0);
|
|
192
|
-
}, 0), _ = g > 0 ? k(g) : void 0;
|
|
193
|
-
return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("button", {
|
|
228
|
+
}, 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 = L((e.attempts || []).map((e) => e.name)), b = y > 0 ? F(y) : void 0;
|
|
230
|
+
return /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("button", {
|
|
194
231
|
type: "button",
|
|
195
|
-
onClick: () =>
|
|
196
|
-
"aria-expanded":
|
|
197
|
-
className: i("flex w-full items-center gap-2 px-2 py-1.5 text-start",
|
|
232
|
+
onClick: () => p((e) => !e),
|
|
233
|
+
"aria-expanded": f,
|
|
234
|
+
className: i("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-start", V.collapseButton, V.row),
|
|
198
235
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ C("span", {
|
|
200
237
|
className: "flex flex-none items-center",
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
-
status:
|
|
238
|
+
children: /* @__PURE__ */ C(H, {
|
|
239
|
+
status: v,
|
|
203
240
|
isLive: n,
|
|
204
|
-
runningLabel:
|
|
205
|
-
failedLabel:
|
|
241
|
+
runningLabel: l,
|
|
242
|
+
failedLabel: u
|
|
206
243
|
})
|
|
207
244
|
}),
|
|
208
|
-
/* @__PURE__ */ S("span", {
|
|
209
|
-
className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", P.stageName, h && P.stageNameFailed),
|
|
210
|
-
children: /* @__PURE__ */ S(o, { text: e.name })
|
|
211
|
-
}),
|
|
212
245
|
/* @__PURE__ */ C("span", {
|
|
213
|
-
className: i("
|
|
246
|
+
className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", V.stageName, _ && V.stageNameFailed),
|
|
247
|
+
children: /* @__PURE__ */ C(c, { text: e.name })
|
|
248
|
+
}),
|
|
249
|
+
/* @__PURE__ */ w("span", {
|
|
250
|
+
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", V.count),
|
|
214
251
|
children: ["×", e.attempts?.length ?? 0]
|
|
215
252
|
}),
|
|
216
|
-
|
|
217
|
-
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text",
|
|
218
|
-
children:
|
|
253
|
+
b && /* @__PURE__ */ C("span", {
|
|
254
|
+
className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", V.duration),
|
|
255
|
+
children: b
|
|
219
256
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
className: i("flex-none",
|
|
222
|
-
children:
|
|
257
|
+
/* @__PURE__ */ C("span", {
|
|
258
|
+
className: i("flex-none", V.iconSecondary),
|
|
259
|
+
children: f ? /* @__PURE__ */ C(m, {
|
|
223
260
|
size: a.SM,
|
|
224
|
-
"aria-hidden": !0
|
|
225
|
-
|
|
261
|
+
"aria-hidden": !0,
|
|
262
|
+
stroke: o
|
|
263
|
+
}) : /* @__PURE__ */ C(h, {
|
|
226
264
|
size: a.SM,
|
|
227
265
|
className: "rtl:scale-x-[-1]",
|
|
228
|
-
"aria-hidden": !0
|
|
266
|
+
"aria-hidden": !0,
|
|
267
|
+
stroke: o
|
|
229
268
|
})
|
|
230
269
|
})
|
|
231
270
|
]
|
|
232
|
-
}), /* @__PURE__ */
|
|
233
|
-
className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out",
|
|
234
|
-
children: /* @__PURE__ */
|
|
271
|
+
}), /* @__PURE__ */ C("div", {
|
|
272
|
+
className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out", f ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
273
|
+
children: /* @__PURE__ */ C("div", {
|
|
235
274
|
className: "overflow-hidden",
|
|
236
|
-
children: /* @__PURE__ */
|
|
275
|
+
children: /* @__PURE__ */ C("ul", {
|
|
237
276
|
role: "list",
|
|
238
277
|
className: "mt-1 flex flex-col gap-0.5 ps-6",
|
|
239
|
-
children: e.attempts?.map((
|
|
278
|
+
children: e.attempts?.map((e, t) => /* @__PURE__ */ C("li", {
|
|
240
279
|
role: "listitem",
|
|
241
|
-
children: /* @__PURE__ */
|
|
242
|
-
stage:
|
|
243
|
-
nameOverride:
|
|
244
|
-
isLive: n &&
|
|
280
|
+
children: /* @__PURE__ */ C(G, {
|
|
281
|
+
stage: e,
|
|
282
|
+
nameOverride: d(t + 1),
|
|
283
|
+
isLive: n && e.status == null,
|
|
245
284
|
typography: r,
|
|
246
285
|
labels: s
|
|
247
286
|
})
|
|
248
|
-
},
|
|
287
|
+
}, e.index))
|
|
249
288
|
})
|
|
250
289
|
})
|
|
251
290
|
})] });
|
|
252
|
-
},
|
|
291
|
+
}, q = ({ stages: e, isStreaming: t, className: r, styles: a, labels: o }) => {
|
|
253
292
|
let { colors: s, typography: c } = a ?? {}, l = n({
|
|
254
293
|
"--cs-text": s?.text,
|
|
255
294
|
"--cs-row-hover": s?.rowHoverColor,
|
|
@@ -266,185 +305,189 @@ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e)
|
|
|
266
305
|
"--cs-code-border": s?.codeBorderColor,
|
|
267
306
|
"--cs-code-text": s?.codeTextColor,
|
|
268
307
|
"--cs-border": s?.borderColor
|
|
269
|
-
}), u =
|
|
270
|
-
return /* @__PURE__ */
|
|
308
|
+
}), u = B(e);
|
|
309
|
+
return /* @__PURE__ */ C("div", {
|
|
271
310
|
style: l,
|
|
272
|
-
className: i("w-full",
|
|
273
|
-
children: /* @__PURE__ */
|
|
311
|
+
className: i("w-full", V.panel, r),
|
|
312
|
+
children: /* @__PURE__ */ C("ul", {
|
|
274
313
|
role: "list",
|
|
275
314
|
className: "flex w-full flex-col gap-0.5 ps-5",
|
|
276
|
-
children:
|
|
315
|
+
children: u.map((e) => e.stage ? /* @__PURE__ */ C("li", {
|
|
277
316
|
role: "listitem",
|
|
278
|
-
children: /* @__PURE__ */
|
|
317
|
+
children: /* @__PURE__ */ C(G, {
|
|
279
318
|
stage: e.stage,
|
|
280
|
-
isLive:
|
|
319
|
+
isLive: t && e.stage.status == null,
|
|
281
320
|
typography: c,
|
|
282
321
|
labels: o
|
|
283
322
|
})
|
|
284
|
-
}, e.key) : /* @__PURE__ */
|
|
323
|
+
}, e.key) : /* @__PURE__ */ C("li", {
|
|
285
324
|
role: "listitem",
|
|
286
|
-
children: /* @__PURE__ */
|
|
325
|
+
children: /* @__PURE__ */ C(K, {
|
|
287
326
|
row: e,
|
|
288
|
-
isLive:
|
|
327
|
+
isLive: t && (e.attempts?.some((e) => e.status == null) ?? !1),
|
|
289
328
|
typography: c,
|
|
290
329
|
labels: o
|
|
291
330
|
})
|
|
292
331
|
}, e.key))
|
|
293
332
|
})
|
|
294
333
|
});
|
|
295
|
-
},
|
|
296
|
-
toggleButton: "
|
|
297
|
-
executedLabel: "
|
|
298
|
-
stepsCount: "
|
|
299
|
-
doneIcon: "
|
|
300
|
-
failedText: "
|
|
301
|
-
liveName: "
|
|
302
|
-
},
|
|
303
|
-
let { executedLabel:
|
|
304
|
-
|
|
305
|
-
|
|
334
|
+
}, J = {
|
|
335
|
+
toggleButton: "_toggleButton_1sa5v_1",
|
|
336
|
+
executedLabel: "_executedLabel_1sa5v_13",
|
|
337
|
+
stepsCount: "_stepsCount_1sa5v_17",
|
|
338
|
+
doneIcon: "_doneIcon_1sa5v_22",
|
|
339
|
+
failedText: "_failedText_1sa5v_26",
|
|
340
|
+
liveName: "_liveName_1sa5v_30"
|
|
341
|
+
}, Y = ({ stages: e, isStreaming: r, labels: s, className: l, styles: f }) => {
|
|
342
|
+
let { executedLabel: g = "Executed", stepsLabel: _ = () => "steps", failedCountLabel: v = (e) => `${e} failed`, runningStepLabel: S = (e, t) => `Step ${e} of ${t}`, runningAriaLabel: T = "Running", copyAriaLabel: E, failedAriaLabel: D, attemptLabel: O } = s ?? {}, [k, A] = x(r), j = b(r);
|
|
343
|
+
y(() => {
|
|
344
|
+
j.current && !r && A(!1), j.current = r;
|
|
306
345
|
}, [r]);
|
|
307
|
-
let { colors:
|
|
308
|
-
"--cs-cg-label":
|
|
309
|
-
"--cs-cg-label-hover":
|
|
310
|
-
"--cs-cg-steps-count":
|
|
311
|
-
"--cs-cg-done":
|
|
312
|
-
"--cs-cg-failed":
|
|
313
|
-
"--cs-text":
|
|
314
|
-
"--cs-row-hover":
|
|
315
|
-
"--cs-button-bg":
|
|
316
|
-
"--cs-stage-text":
|
|
317
|
-
"--cs-failed-text":
|
|
318
|
-
"--cs-tag-text":
|
|
319
|
-
"--cs-count-text":
|
|
320
|
-
"--cs-duration-text":
|
|
321
|
-
"--cs-icon-secondary":
|
|
322
|
-
"--cs-icon-completed":
|
|
323
|
-
"--cs-icon-error":
|
|
324
|
-
"--cs-code-bg":
|
|
325
|
-
"--cs-code-border":
|
|
326
|
-
"--cs-code-text":
|
|
327
|
-
"--cs-border":
|
|
346
|
+
let { colors: M, panel: P } = f ?? {}, I = f?.typography ?? { fontClassName: "dial-small-text" }, B = n({
|
|
347
|
+
"--cs-cg-label": M?.labelColor,
|
|
348
|
+
"--cs-cg-label-hover": M?.labelHoverColor,
|
|
349
|
+
"--cs-cg-steps-count": M?.stepsCountColor,
|
|
350
|
+
"--cs-cg-done": M?.doneColor,
|
|
351
|
+
"--cs-cg-failed": M?.failedColor,
|
|
352
|
+
"--cs-text": P?.text,
|
|
353
|
+
"--cs-row-hover": P?.rowHoverColor,
|
|
354
|
+
"--cs-button-bg": P?.collapsedButtonBg,
|
|
355
|
+
"--cs-stage-text": P?.stageTextColor,
|
|
356
|
+
"--cs-failed-text": P?.failedColor,
|
|
357
|
+
"--cs-tag-text": P?.tagTextColor,
|
|
358
|
+
"--cs-count-text": P?.countTextColor,
|
|
359
|
+
"--cs-duration-text": P?.durationTextColor,
|
|
360
|
+
"--cs-icon-secondary": P?.iconSecondaryColor,
|
|
361
|
+
"--cs-icon-completed": P?.iconCompletedColor,
|
|
362
|
+
"--cs-icon-error": P?.iconErrorColor,
|
|
363
|
+
"--cs-code-bg": P?.codeBg,
|
|
364
|
+
"--cs-code-border": P?.codeBorderColor,
|
|
365
|
+
"--cs-code-text": P?.codeTextColor,
|
|
366
|
+
"--cs-border": P?.borderColor
|
|
328
367
|
});
|
|
329
368
|
if (e.length === 0) return null;
|
|
330
|
-
let
|
|
331
|
-
copyAriaLabel:
|
|
332
|
-
runningAriaLabel:
|
|
333
|
-
failedAriaLabel:
|
|
334
|
-
attemptLabel:
|
|
369
|
+
let V = {
|
|
370
|
+
copyAriaLabel: E,
|
|
371
|
+
runningAriaLabel: T,
|
|
372
|
+
failedAriaLabel: D,
|
|
373
|
+
attemptLabel: O
|
|
335
374
|
};
|
|
336
|
-
if (e.length === 1) return /* @__PURE__ */
|
|
375
|
+
if (e.length === 1) return /* @__PURE__ */ C(q, {
|
|
337
376
|
stages: e,
|
|
338
377
|
isStreaming: r,
|
|
339
|
-
className:
|
|
378
|
+
className: l,
|
|
340
379
|
styles: {
|
|
341
|
-
colors:
|
|
342
|
-
typography:
|
|
380
|
+
colors: P,
|
|
381
|
+
typography: f?.typography
|
|
343
382
|
},
|
|
344
|
-
labels:
|
|
383
|
+
labels: V
|
|
345
384
|
});
|
|
346
|
-
let H = e.some((e) => e.status === t.Failed), U = e.
|
|
347
|
-
let { durationLabel: n } = D(t.name);
|
|
348
|
-
return e + (A(n) ?? 0);
|
|
349
|
-
}, 0), W = U > 0 ? k(U) : void 0, G = r ? j(e) : void 0, K;
|
|
385
|
+
let H = e.some((e) => e.status === t.Failed), U = L(e.map((e) => e.name)), W = U > 0 ? F(U) : void 0, G = r ? R(e) : void 0, K;
|
|
350
386
|
if (r) {
|
|
351
|
-
let t = G ?
|
|
352
|
-
K = /* @__PURE__ */
|
|
387
|
+
let t = G ? z(e, G) : e.length, n = G ? N(G.name).name : "";
|
|
388
|
+
K = /* @__PURE__ */ w("span", {
|
|
353
389
|
role: "status",
|
|
354
390
|
"aria-live": "polite",
|
|
355
|
-
className: "
|
|
391
|
+
className: "flex min-w-0 items-center gap-2",
|
|
356
392
|
children: [
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
|
|
359
|
-
|
|
393
|
+
/* @__PURE__ */ C("span", {
|
|
394
|
+
className: "flex flex-none items-center",
|
|
395
|
+
children: /* @__PURE__ */ C(d, {
|
|
396
|
+
size: 14,
|
|
397
|
+
ariaLabel: T
|
|
398
|
+
})
|
|
360
399
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
-
className: i(
|
|
363
|
-
children:
|
|
400
|
+
/* @__PURE__ */ C("span", {
|
|
401
|
+
className: i("flex-none whitespace-nowrap", I.fontClassName, J.liveName),
|
|
402
|
+
children: S(t, e.length)
|
|
364
403
|
}),
|
|
365
|
-
n && /* @__PURE__ */
|
|
366
|
-
className: i(
|
|
367
|
-
children: n
|
|
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 })
|
|
368
407
|
})
|
|
369
408
|
]
|
|
370
409
|
});
|
|
371
410
|
} else if (H) {
|
|
372
411
|
let n = e.filter((e) => e.status === t.Failed).length;
|
|
373
|
-
K = /* @__PURE__ */
|
|
412
|
+
K = /* @__PURE__ */ w("span", {
|
|
374
413
|
className: "inline-flex items-center gap-1",
|
|
375
414
|
children: [
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
className: i(
|
|
415
|
+
/* @__PURE__ */ w("span", {
|
|
416
|
+
className: i(I.fontClassName, J.executedLabel),
|
|
378
417
|
children: [
|
|
379
|
-
|
|
418
|
+
g,
|
|
380
419
|
" ",
|
|
381
420
|
e.length,
|
|
382
421
|
" ",
|
|
383
|
-
|
|
422
|
+
_(e.length)
|
|
384
423
|
]
|
|
385
424
|
}),
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
className: i(
|
|
388
|
-
children:
|
|
425
|
+
/* @__PURE__ */ C("span", {
|
|
426
|
+
className: i(I.fontClassName, J.failedText),
|
|
427
|
+
children: v(n)
|
|
389
428
|
}),
|
|
390
|
-
W && /* @__PURE__ */
|
|
391
|
-
className: i(
|
|
429
|
+
W && /* @__PURE__ */ C("span", {
|
|
430
|
+
className: i(I.fontClassName, J.stepsCount),
|
|
392
431
|
children: W
|
|
393
432
|
})
|
|
394
433
|
]
|
|
395
434
|
});
|
|
396
|
-
} else K = /* @__PURE__ */
|
|
435
|
+
} else K = /* @__PURE__ */ w("span", {
|
|
397
436
|
className: "inline-flex items-center gap-1",
|
|
398
437
|
children: [
|
|
399
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ C(p, {
|
|
400
439
|
size: a.SM,
|
|
401
|
-
className:
|
|
402
|
-
"aria-hidden": !0
|
|
440
|
+
className: J.doneIcon,
|
|
441
|
+
"aria-hidden": !0,
|
|
442
|
+
stroke: o
|
|
403
443
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
className: i(
|
|
444
|
+
/* @__PURE__ */ w("span", {
|
|
445
|
+
className: i(I.fontClassName, J.executedLabel),
|
|
406
446
|
children: [
|
|
407
|
-
|
|
447
|
+
g,
|
|
408
448
|
" ",
|
|
409
449
|
e.length,
|
|
410
450
|
" ",
|
|
411
|
-
|
|
451
|
+
_(e.length)
|
|
412
452
|
]
|
|
413
453
|
}),
|
|
414
|
-
W && /* @__PURE__ */
|
|
415
|
-
className: i(
|
|
454
|
+
W && /* @__PURE__ */ C("span", {
|
|
455
|
+
className: i(I.fontClassName, J.stepsCount),
|
|
416
456
|
children: W
|
|
417
457
|
})
|
|
418
458
|
]
|
|
419
459
|
});
|
|
420
|
-
return /* @__PURE__ */
|
|
421
|
-
style:
|
|
422
|
-
className: i("flex w-full flex-col gap-1",
|
|
423
|
-
children: [/* @__PURE__ */
|
|
424
|
-
className:
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
460
|
+
return /* @__PURE__ */ w("div", {
|
|
461
|
+
style: B,
|
|
462
|
+
className: i("flex w-full flex-col gap-1", l),
|
|
463
|
+
children: [/* @__PURE__ */ C(u, {
|
|
464
|
+
className: J.toggleButton,
|
|
465
|
+
textClassName: "min-w-0",
|
|
466
|
+
onClick: () => A((e) => !e),
|
|
467
|
+
"aria-expanded": k,
|
|
468
|
+
iconAfter: k ? /* @__PURE__ */ C(m, {
|
|
428
469
|
size: 12,
|
|
429
|
-
"aria-hidden": !0
|
|
430
|
-
|
|
470
|
+
"aria-hidden": !0,
|
|
471
|
+
stroke: o
|
|
472
|
+
}) : /* @__PURE__ */ C(h, {
|
|
431
473
|
size: 12,
|
|
432
474
|
className: "rtl:scale-x-[-1]",
|
|
433
|
-
"aria-hidden": !0
|
|
475
|
+
"aria-hidden": !0,
|
|
476
|
+
stroke: o
|
|
434
477
|
}),
|
|
435
478
|
label: K
|
|
436
|
-
}), /* @__PURE__ */
|
|
437
|
-
className: i("grid transition-[grid-template-rows] duration-300 ease-in-out",
|
|
438
|
-
children: /* @__PURE__ */
|
|
479
|
+
}), /* @__PURE__ */ C("div", {
|
|
480
|
+
className: i("grid transition-[grid-template-rows] duration-300 ease-in-out", k ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
481
|
+
children: /* @__PURE__ */ C("div", {
|
|
439
482
|
className: "overflow-hidden",
|
|
440
|
-
children: /* @__PURE__ */
|
|
483
|
+
children: /* @__PURE__ */ C(q, {
|
|
441
484
|
stages: e,
|
|
442
485
|
isStreaming: r,
|
|
443
486
|
styles: {
|
|
444
|
-
colors:
|
|
445
|
-
typography:
|
|
487
|
+
colors: P,
|
|
488
|
+
typography: f?.typography
|
|
446
489
|
},
|
|
447
|
-
labels:
|
|
490
|
+
labels: V,
|
|
448
491
|
className: "pt-1"
|
|
449
492
|
})
|
|
450
493
|
})
|
|
@@ -452,4 +495,4 @@ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e)
|
|
|
452
495
|
});
|
|
453
496
|
};
|
|
454
497
|
//#endregion
|
|
455
|
-
export {
|
|
498
|
+
export { Y as CollapsedGroup, q as StagesPanel };
|
|
@@ -15,7 +15,7 @@ export interface CollapsedGroupColors {
|
|
|
15
15
|
}
|
|
16
16
|
/** Typography configuration for the toggle button label text. */
|
|
17
17
|
export interface CollapsedGroupTypography {
|
|
18
|
-
/** CSS utility class applied to the toggle button label. */
|
|
18
|
+
/** CSS utility class applied to the toggle button label. Defaults to `'dial-small-text'`. */
|
|
19
19
|
fontClassName?: string;
|
|
20
20
|
}
|
|
21
21
|
/** Combined style overrides (colors and typography) for the `CollapsedGroup` component. */
|
|
@@ -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,
|
|
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,gIAAgI;IAChI,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9D,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/models/stages-props.d.ts
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { Stage } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
/** Typography class overrides for stage name and expanded content elements in `StagesPanel`. */
|
|
3
3
|
export interface StageTypography {
|
|
4
|
-
/** CSS utility class applied to the stage/step name. */
|
|
4
|
+
/** CSS utility class applied to the stage/step name. Defaults to `'dial-small-text'`. */
|
|
5
5
|
fontClassName?: string;
|
|
6
|
-
/** CSS utility class applied to expanded content text elements (paragraphs, lists, blockquotes, links, table cells). */
|
|
6
|
+
/** CSS utility class applied to expanded content text elements (paragraphs, lists, blockquotes, links, table cells). Defaults to `'dial-tiny-text'`. */
|
|
7
7
|
contentClassName?: string;
|
|
8
|
-
/** CSS utility class applied to `<strong>` (bold markdown) inside expanded content. */
|
|
8
|
+
/** CSS utility class applied to `<strong>` (bold markdown) inside expanded content. Falls back to `contentClassName`, then `'dial-tiny-text'`. */
|
|
9
9
|
strongClassName?: string;
|
|
10
|
-
/** CSS utility class applied to every heading level (`h1`–`h6`) inside expanded content. */
|
|
10
|
+
/** CSS utility class applied to every heading level (`h1`–`h6`) inside expanded content. Defaults to `'dial-small-semi-text'`. */
|
|
11
11
|
headingClassName?: string;
|
|
12
|
-
/** CSS utility class applied to inline code elements. */
|
|
12
|
+
/** CSS utility class applied to inline code elements. Defaults to `'dial-code-text rounded-md'`. */
|
|
13
13
|
codeClassName?: string;
|
|
14
|
-
/** CSS utility class applied to
|
|
14
|
+
/** CSS utility class applied to fenced code blocks (`<pre>`). Defaults to `'dial-code-text'`. */
|
|
15
|
+
codeBlockClassName?: string;
|
|
16
|
+
/** CSS utility class applied to count badges (e.g. `×N` collapsed group). Defaults to `'dial-tiny-text'`. */
|
|
15
17
|
countFontClassName?: string;
|
|
18
|
+
/** CSS utility class applied to a stage's tag label. Defaults to `'dial-tiny-lead-text'`, which uppercases the label itself. */
|
|
19
|
+
tagClassName?: string;
|
|
16
20
|
}
|
|
17
21
|
/** CSS custom property color overrides for the `StagesPanel` component. */
|
|
18
22
|
export interface StagesPanelColors {
|
|
19
23
|
/** General text color. Defaults to `--text-primary`. */
|
|
20
24
|
text?: string;
|
|
21
|
-
/** Background tint on row hover. Defaults to `--bg-layer-
|
|
25
|
+
/** Background tint on row hover. Defaults to `--bg-layer-sunken`. */
|
|
22
26
|
rowHoverColor?: string;
|
|
23
27
|
/** Text color of each stage name. Defaults to `--text-secondary`. */
|
|
24
28
|
stageTextColor?: string;
|
|
@@ -38,7 +42,7 @@ export interface StagesPanelColors {
|
|
|
38
42
|
iconCompletedColor?: string;
|
|
39
43
|
/** Color of the error/exception icon. Defaults to `--text-warning`. */
|
|
40
44
|
iconErrorColor?: string;
|
|
41
|
-
/** Background color of fenced code blocks and inline code. Defaults to `--bg-layer-
|
|
45
|
+
/** Background color of fenced code blocks and inline code. Defaults to `--bg-layer-raised`. */
|
|
42
46
|
codeBg?: string;
|
|
43
47
|
/** Border color of fenced code blocks and inline code. Defaults to `--stroke-secondary`. */
|
|
44
48
|
codeBorderColor?: string;
|
|
@@ -69,7 +73,7 @@ export interface StagesPanelLabels {
|
|
|
69
73
|
export interface StagesPanelProps {
|
|
70
74
|
/** Ordered list of stages to display. */
|
|
71
75
|
stages: Stage[];
|
|
72
|
-
/** When `true
|
|
76
|
+
/** When `true`, every stage with `status: null` shows a live spinner. */
|
|
73
77
|
isStreaming: boolean;
|
|
74
78
|
/** Extra class name(s) merged onto the outer wrapper. */
|
|
75
79
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stages-props.d.ts","sourceRoot":"","sources":["../../src/models/stages-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,gGAAgG;AAChG,MAAM,WAAW,eAAe;IAC9B,
|
|
1
|
+
{"version":3,"file":"stages-props.d.ts","sourceRoot":"","sources":["../../src/models/stages-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,gGAAgG;AAChG,MAAM,WAAW,eAAe;IAC9B,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wJAAwJ;IACxJ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kJAAkJ;IAClJ,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kIAAkI;IAClI,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oGAAoG;IACpG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iGAAiG;IACjG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,6GAA6G;IAC7G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gIAAgI;IAChI,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4FAA4F;IAC5F,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+FAA+F;IAC/F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wFAAwF;AACxF,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,iEAAiE;IACjE,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kGAAkG;IAClG,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD;AAED,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,yEAAyE;IACzE,WAAW,EAAE,OAAO,CAAC;IACrB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B"}
|
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.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.492",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -9,18 +9,20 @@
|
|
|
9
9
|
"types": "./index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
"./package.json": "./package.json",
|
|
12
|
-
"./styles.css": "./
|
|
12
|
+
"./styles.css": "./index.css",
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./index.d.ts",
|
|
15
15
|
"import": "./index.js",
|
|
16
16
|
"default": "./index.js"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@tabler/icons-react": "^3.44.0"
|
|
21
|
+
},
|
|
19
22
|
"peerDependencies": {
|
|
20
|
-
"react": "^19.
|
|
21
|
-
"@
|
|
22
|
-
"@epam/ai-dial-
|
|
23
|
-
"@epam/ai-dial-ui-kit": "^0.13.0-dev.12"
|
|
23
|
+
"react": "^19.2.8",
|
|
24
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.492",
|
|
25
|
+
"@epam/ai-dial-ui-kit": "^0.14.2"
|
|
24
26
|
},
|
|
25
27
|
"repository": {
|
|
26
28
|
"type": "git",
|
package/utils/stage-name.d.ts
CHANGED
|
@@ -13,5 +13,7 @@ export declare const isIdentifierLike: (name: string) => boolean;
|
|
|
13
13
|
export declare const formatTotalDuration: (totalSeconds: number) => string;
|
|
14
14
|
/** Parses a duration label produced by {@link cleanStageName} (e.g. `'3.99s'`) back into seconds. */
|
|
15
15
|
export declare const parseDurationSeconds: (durationLabel: string | undefined) => number | undefined;
|
|
16
|
+
/** Returns the elapsed duration represented by stage names, without double-counting overlapping timed stages. */
|
|
17
|
+
export declare const calculateStagesDurationSeconds: (stageNames: string[]) => number;
|
|
16
18
|
export {};
|
|
17
19
|
//# sourceMappingURL=stage-name.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage-name.d.ts","sourceRoot":"","sources":["../../src/utils/stage-name.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stage-name.d.ts","sourceRoot":"","sources":["../../src/utils/stage-name.ts"],"names":[],"mappings":"AAuCA,+DAA+D;AAC/D,UAAU,gBAAgB;IACxB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,8FAA8F;IAC9F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAkCD,0HAA0H;AAC1H,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,gBAiBhD,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,OACW,CAAC;AAE5D,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,GAAI,cAAc,MAAM,KAAG,MAO1D,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,oBAAoB,GAC/B,eAAe,MAAM,GAAG,SAAS,KAChC,MAAM,GAAG,SAIX,CAAC;AAEF,iHAAiH;AACjH,eAAO,MAAM,8BAA8B,GACzC,YAAY,MAAM,EAAE,KACnB,MA2DF,CAAC"}
|