@allurereport/web-awesome 3.11.0 → 3.12.0
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/.babelrc.js +8 -4
- package/dist/multi/{121.app-79d160f9989770266f96.js → 121.app-6aea04b0f9a38ec6a723.js} +1 -1
- package/dist/multi/{779.app-79d160f9989770266f96.js → 779.app-6aea04b0f9a38ec6a723.js} +1 -1
- package/dist/multi/app-6aea04b0f9a38ec6a723.js +2 -0
- package/dist/multi/manifest.json +24 -24
- package/dist/single/app-db7a3c70e9c29036a037.js +2 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +10 -10
- package/src/components/Categories/MessageTreeItem/index.tsx +6 -2
- package/src/components/SplitLayout/index.tsx +6 -12
- package/src/components/TestResult/TrError/index.tsx +10 -20
- package/src/hooks/useTestResultOverviewFocusScroll.ts +6 -6
- package/src/stores/testResultOverviewNav.ts +5 -0
- package/dist/multi/app-79d160f9989770266f96.js +0 -2
- package/dist/single/app-36af07268613f77d3ac5.js +0 -2
- /package/dist/multi/{173.app-79d160f9989770266f96.js → 173.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{174.app-79d160f9989770266f96.js → 174.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{252.app-79d160f9989770266f96.js → 252.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{282.app-79d160f9989770266f96.js → 282.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{29.app-79d160f9989770266f96.js → 29.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{310.app-79d160f9989770266f96.js → 310.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{416.app-79d160f9989770266f96.js → 416.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{507.app-79d160f9989770266f96.js → 507.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{527.app-79d160f9989770266f96.js → 527.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{600.app-79d160f9989770266f96.js → 600.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{605.app-79d160f9989770266f96.js → 605.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{638.app-79d160f9989770266f96.js → 638.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{672.app-79d160f9989770266f96.js → 672.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{686.app-79d160f9989770266f96.js → 686.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{725.app-79d160f9989770266f96.js → 725.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{741.app-79d160f9989770266f96.js → 741.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{749.app-79d160f9989770266f96.js → 749.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{755.app-79d160f9989770266f96.js → 755.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{894.app-79d160f9989770266f96.js → 894.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{943.app-79d160f9989770266f96.js → 943.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{980.app-79d160f9989770266f96.js → 980.app-6aea04b0f9a38ec6a723.js} +0 -0
- /package/dist/multi/{app-79d160f9989770266f96.js.LICENSE.txt → app-6aea04b0f9a38ec6a723.js.LICENSE.txt} +0 -0
- /package/dist/single/{app-36af07268613f77d3ac5.js.LICENSE.txt → app-db7a3c70e9c29036a037.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/web-awesome",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0",
|
|
4
4
|
"description": "The static files for Allure Awesome Report",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"lint:fix": "oxlint --import-plugin --fix src test features stories"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@allurereport/charts-api": "3.
|
|
34
|
-
"@allurereport/core-api": "3.
|
|
35
|
-
"@allurereport/plugin-api": "3.
|
|
36
|
-
"@allurereport/web-commons": "3.
|
|
37
|
-
"@allurereport/web-components": "3.
|
|
33
|
+
"@allurereport/charts-api": "3.12.0",
|
|
34
|
+
"@allurereport/core-api": "3.12.0",
|
|
35
|
+
"@allurereport/plugin-api": "3.12.0",
|
|
36
|
+
"@allurereport/web-commons": "3.12.0",
|
|
37
|
+
"@allurereport/web-components": "3.12.0",
|
|
38
38
|
"@preact/signals": "^2.6.1",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"d3-shape": "^3.2.0",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"typescript": "^5",
|
|
88
88
|
"vite": "^8.0.9",
|
|
89
89
|
"vitest": "^4.1.0",
|
|
90
|
-
"webpack": "^5
|
|
91
|
-
"webpack-cli": "^
|
|
92
|
-
"webpack-dev-server": "^5
|
|
93
|
-
"webpack-manifest-plugin": "^
|
|
90
|
+
"webpack": "^5",
|
|
91
|
+
"webpack-cli": "^7",
|
|
92
|
+
"webpack-dev-server": "^5",
|
|
93
|
+
"webpack-manifest-plugin": "^6"
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CategoryNode, CategoryNodeProps, Statistic, TestStatus } from "@allurereport/core-api";
|
|
2
2
|
import { getWorstStatus } from "@allurereport/core-api";
|
|
3
|
-
import { ansiToHTML } from "@allurereport/web-commons";
|
|
3
|
+
import { ansiSemanticColors, ansiToHTML, normalizeAnsiForegroundColors } from "@allurereport/web-commons";
|
|
4
4
|
import { ArrowButton, Button, Code, TreeStatusBar } from "@allurereport/web-components";
|
|
5
5
|
import clsx from "clsx";
|
|
6
6
|
import type { ComponentChildren } from "preact";
|
|
@@ -57,7 +57,11 @@ export const MessageTreeItem: FC<MessageTreeItemProps> = ({
|
|
|
57
57
|
}) => {
|
|
58
58
|
const { t } = useI18n("ui");
|
|
59
59
|
const status = statusFromStatistic(node.statistic);
|
|
60
|
-
const sanitizedMessage = ansiToHTML(node.name ?? ""
|
|
60
|
+
const sanitizedMessage = ansiToHTML(normalizeAnsiForegroundColors(node.name ?? ""), {
|
|
61
|
+
fg: "var(--color-text-primary)",
|
|
62
|
+
bg: "none",
|
|
63
|
+
colors: ansiSemanticColors,
|
|
64
|
+
});
|
|
61
65
|
const stickyStyle = createCategoriesStickyStyle(depth);
|
|
62
66
|
const hasLongMessage = (node.name ?? "").length > 80;
|
|
63
67
|
const [isMessageExpanded, setIsMessageExpanded] = useState(false);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Loadable, PageLoader, Text } from "@allurereport/web-components";
|
|
2
2
|
import { computed } from "@preact/signals";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import
|
|
5
|
-
import { useEffect, useRef, useState } from "preact/hooks";
|
|
4
|
+
import { useMemo, useRef } from "preact/hooks";
|
|
6
5
|
|
|
7
6
|
import MainReport from "@/components/MainReport";
|
|
8
7
|
import SideBySide from "@/components/SideBySide";
|
|
@@ -40,10 +39,11 @@ const isTestResultRoute = computed(
|
|
|
40
39
|
|
|
41
40
|
export const SplitLayout = () => {
|
|
42
41
|
const testResultId = currentTrId.value;
|
|
43
|
-
const [cachedMain, setCachedMain] = useState<JSX.Element | null>(null);
|
|
44
42
|
const { t } = useI18n("controls");
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
|
|
44
|
+
const leftSide = useMemo(
|
|
45
|
+
() => <Loadable source={treeStore} renderLoader={() => <PageLoader />} renderData={() => <MainReportWrapper />} />,
|
|
46
|
+
[],
|
|
47
47
|
);
|
|
48
48
|
|
|
49
49
|
const TrView = () => {
|
|
@@ -67,15 +67,9 @@ export const SplitLayout = () => {
|
|
|
67
67
|
);
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
if (!cachedMain) {
|
|
72
|
-
setCachedMain(leftSide);
|
|
73
|
-
}
|
|
74
|
-
}, [cachedMain]);
|
|
75
|
-
|
|
76
70
|
return (
|
|
77
71
|
<div className={styles["side-by-side"]} data-testId={"split-layout"}>
|
|
78
|
-
<SideBySide left={
|
|
72
|
+
<SideBySide left={leftSide} right={<TrView />} />
|
|
79
73
|
</div>
|
|
80
74
|
);
|
|
81
75
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TestError, TestStatus } from "@allurereport/core-api";
|
|
2
|
-
import { ansiToHTML } from "@allurereport/web-commons";
|
|
2
|
+
import { ansiSemanticColors, ansiToHTML, normalizeAnsiForegroundColors } from "@allurereport/web-commons";
|
|
3
3
|
import { Button, Code, IconButton, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { type FunctionalComponent } from "preact";
|
|
@@ -13,20 +13,16 @@ import { copyToClipboard } from "@/utils/copyToClipboard";
|
|
|
13
13
|
|
|
14
14
|
import * as styles from "./styles.scss";
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const ansiStatusDetailsToHTML = (text: string) =>
|
|
17
|
+
ansiToHTML(normalizeAnsiForegroundColors(text), {
|
|
18
18
|
fg: "var(--color-text-primary)",
|
|
19
19
|
bg: "none",
|
|
20
|
-
colors:
|
|
21
|
-
0: "none",
|
|
22
|
-
1: "none",
|
|
23
|
-
2: "var(--color-intent-info-text)",
|
|
24
|
-
3: "var(--color-intent-warning-text)",
|
|
25
|
-
4: "var(--color-status-unknown-chart)",
|
|
26
|
-
5: "var(--color-syntax-type)",
|
|
27
|
-
},
|
|
20
|
+
colors: ansiSemanticColors,
|
|
28
21
|
});
|
|
29
22
|
|
|
23
|
+
const TrErrorTrace = ({ trace }: { trace: string }) => {
|
|
24
|
+
const sanitizedTrace = ansiStatusDetailsToHTML(trace);
|
|
25
|
+
|
|
30
26
|
return (
|
|
31
27
|
<div data-testid="test-result-error-trace" className={styles["test-result-error-trace"]}>
|
|
32
28
|
<Code size={"s"} type={"ui"}>
|
|
@@ -52,13 +48,7 @@ export const TrError: FunctionalComponent<
|
|
|
52
48
|
data: { actual, expected },
|
|
53
49
|
component: <TrDiff actual={actual} expected={expected} />,
|
|
54
50
|
});
|
|
55
|
-
const sanitizedMessage =
|
|
56
|
-
showMessage && message
|
|
57
|
-
? ansiToHTML(message, {
|
|
58
|
-
fg: "var(--color-text-primary)",
|
|
59
|
-
colors: {},
|
|
60
|
-
})
|
|
61
|
-
: "";
|
|
51
|
+
const sanitizedMessage = showMessage && message ? ansiStatusDetailsToHTML(message) : "";
|
|
62
52
|
|
|
63
53
|
return (
|
|
64
54
|
<div
|
|
@@ -83,7 +73,7 @@ export const TrError: FunctionalComponent<
|
|
|
83
73
|
size={"s"}
|
|
84
74
|
icon={allureIcons.lineGeneralCopy3}
|
|
85
75
|
onClick={() => {
|
|
86
|
-
copyToClipboard(message);
|
|
76
|
+
copyToClipboard(trace || message);
|
|
87
77
|
}}
|
|
88
78
|
/>
|
|
89
79
|
</TooltipWrapper>
|
|
@@ -117,7 +107,7 @@ export const TrError: FunctionalComponent<
|
|
|
117
107
|
size={"s"}
|
|
118
108
|
icon={allureIcons.lineGeneralCopy3}
|
|
119
109
|
onClick={() => {
|
|
120
|
-
copyToClipboard(message);
|
|
110
|
+
copyToClipboard(trace || message);
|
|
121
111
|
}}
|
|
122
112
|
/>
|
|
123
113
|
</TooltipWrapper>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { scrollFocusIntoView } from "@allurereport/web-commons";
|
|
2
2
|
import { useLayoutEffect } from "preact/hooks";
|
|
3
3
|
|
|
4
|
-
import { getFlatTestResultNode,
|
|
4
|
+
import { getFlatTestResultNode, testResultScrollToId } from "@/stores/testResultOverviewNav";
|
|
5
5
|
|
|
6
6
|
export const useTestResultOverviewFocusScroll = () => {
|
|
7
|
-
const
|
|
7
|
+
const scrollToId = testResultScrollToId.value;
|
|
8
8
|
|
|
9
9
|
useLayoutEffect(() => {
|
|
10
|
-
if (!
|
|
10
|
+
if (!scrollToId) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const node = document.querySelector(`[data-tr-focus-id="${
|
|
14
|
+
const node = document.querySelector(`[data-tr-focus-id="${scrollToId}"]`);
|
|
15
15
|
|
|
16
16
|
if (!(node instanceof HTMLElement)) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const flatNode = getFlatTestResultNode(
|
|
20
|
+
const flatNode = getFlatTestResultNode(scrollToId);
|
|
21
21
|
scrollFocusIntoView(node, { containerAttribute: "data-tr-scroll-container", kind: flatNode?.kind });
|
|
22
|
-
}, [
|
|
22
|
+
}, [scrollToId]);
|
|
23
23
|
};
|
|
@@ -9,6 +9,9 @@ import { collapsedTrees, isTreeOpened, setTreeOpened, toggleTree } from "@/store
|
|
|
9
9
|
import { flattenTestResultOverview } from "@/utils/flattenTestResultOverview";
|
|
10
10
|
export const testResultFocusId = signal<string | undefined>(undefined);
|
|
11
11
|
|
|
12
|
+
/** Set only by explicit keyboard navigation (not auto-initialization). Controls scroll in useTestResultOverviewFocusScroll. */
|
|
13
|
+
export const testResultScrollToId = signal<string | undefined>(undefined);
|
|
14
|
+
|
|
12
15
|
export const isTestResultOverviewNavigationContext = (): boolean =>
|
|
13
16
|
isTestResultHotkeysContext() && trCurrentTab.value === "overview";
|
|
14
17
|
|
|
@@ -52,6 +55,7 @@ export const moveTestResultFocus = (direction: MoveDirection): MoveFocusResult =
|
|
|
52
55
|
|
|
53
56
|
export const setTestResultFocusId = (id: string | undefined) => {
|
|
54
57
|
testResultFocusId.value = id;
|
|
58
|
+
testResultScrollToId.value = id;
|
|
55
59
|
};
|
|
56
60
|
|
|
57
61
|
export const ensureTestResultFocusId = () => {
|
|
@@ -87,6 +91,7 @@ effect(() => {
|
|
|
87
91
|
|
|
88
92
|
if (trCurrentTab.value !== "overview") {
|
|
89
93
|
testResultFocusId.value = undefined;
|
|
94
|
+
testResultScrollToId.value = undefined;
|
|
90
95
|
}
|
|
91
96
|
});
|
|
92
97
|
|