@allurereport/web-awesome 3.11.0 → 3.13.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.
Files changed (40) hide show
  1. package/.babelrc.js +8 -4
  2. package/dist/multi/{121.app-79d160f9989770266f96.js → 509.app-053841c82b2f540bd018.js} +1 -1
  3. package/dist/multi/{894.app-79d160f9989770266f96.js → 513.app-053841c82b2f540bd018.js} +1 -1
  4. package/dist/multi/{779.app-79d160f9989770266f96.js → 894.app-053841c82b2f540bd018.js} +1 -1
  5. package/dist/multi/app-053841c82b2f540bd018.js +2 -0
  6. package/dist/multi/manifest.json +25 -25
  7. package/dist/multi/{styles-b7f017f505b72e148e8b.css → styles-9fdc0be625e301f9a5c7.css} +1 -1
  8. package/dist/single/app-cef45219222a43ba1d28.js +2 -0
  9. package/dist/single/manifest.json +1 -1
  10. package/package.json +12 -12
  11. package/src/components/Categories/MessageTreeItem/index.tsx +6 -2
  12. package/src/components/KeyboardShortcuts/styles.scss +1 -1
  13. package/src/components/SplitLayout/index.tsx +6 -12
  14. package/src/components/TestResult/TrError/index.tsx +10 -20
  15. package/src/hooks/useTestResultOverviewFocusScroll.ts +6 -6
  16. package/src/stores/testResultOverviewNav.ts +5 -0
  17. package/dist/multi/app-79d160f9989770266f96.js +0 -2
  18. package/dist/single/app-36af07268613f77d3ac5.js +0 -2
  19. /package/dist/multi/{173.app-79d160f9989770266f96.js → 173.app-053841c82b2f540bd018.js} +0 -0
  20. /package/dist/multi/{174.app-79d160f9989770266f96.js → 174.app-053841c82b2f540bd018.js} +0 -0
  21. /package/dist/multi/{252.app-79d160f9989770266f96.js → 252.app-053841c82b2f540bd018.js} +0 -0
  22. /package/dist/multi/{282.app-79d160f9989770266f96.js → 282.app-053841c82b2f540bd018.js} +0 -0
  23. /package/dist/multi/{29.app-79d160f9989770266f96.js → 29.app-053841c82b2f540bd018.js} +0 -0
  24. /package/dist/multi/{310.app-79d160f9989770266f96.js → 310.app-053841c82b2f540bd018.js} +0 -0
  25. /package/dist/multi/{416.app-79d160f9989770266f96.js → 416.app-053841c82b2f540bd018.js} +0 -0
  26. /package/dist/multi/{507.app-79d160f9989770266f96.js → 507.app-053841c82b2f540bd018.js} +0 -0
  27. /package/dist/multi/{527.app-79d160f9989770266f96.js → 527.app-053841c82b2f540bd018.js} +0 -0
  28. /package/dist/multi/{600.app-79d160f9989770266f96.js → 600.app-053841c82b2f540bd018.js} +0 -0
  29. /package/dist/multi/{605.app-79d160f9989770266f96.js → 605.app-053841c82b2f540bd018.js} +0 -0
  30. /package/dist/multi/{638.app-79d160f9989770266f96.js → 638.app-053841c82b2f540bd018.js} +0 -0
  31. /package/dist/multi/{672.app-79d160f9989770266f96.js → 672.app-053841c82b2f540bd018.js} +0 -0
  32. /package/dist/multi/{686.app-79d160f9989770266f96.js → 686.app-053841c82b2f540bd018.js} +0 -0
  33. /package/dist/multi/{725.app-79d160f9989770266f96.js → 725.app-053841c82b2f540bd018.js} +0 -0
  34. /package/dist/multi/{741.app-79d160f9989770266f96.js → 741.app-053841c82b2f540bd018.js} +0 -0
  35. /package/dist/multi/{749.app-79d160f9989770266f96.js → 749.app-053841c82b2f540bd018.js} +0 -0
  36. /package/dist/multi/{755.app-79d160f9989770266f96.js → 755.app-053841c82b2f540bd018.js} +0 -0
  37. /package/dist/multi/{943.app-79d160f9989770266f96.js → 943.app-053841c82b2f540bd018.js} +0 -0
  38. /package/dist/multi/{980.app-79d160f9989770266f96.js → 980.app-053841c82b2f540bd018.js} +0 -0
  39. /package/dist/multi/{app-79d160f9989770266f96.js.LICENSE.txt → app-053841c82b2f540bd018.js.LICENSE.txt} +0 -0
  40. /package/dist/single/{app-36af07268613f77d3ac5.js.LICENSE.txt → app-cef45219222a43ba1d28.js.LICENSE.txt} +0 -0
@@ -1,3 +1,3 @@
1
1
  {
2
- "main.js": "app-36af07268613f77d3ac5.js"
2
+ "main.js": "app-cef45219222a43ba1d28.js"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/web-awesome",
3
- "version": "3.11.0",
3
+ "version": "3.13.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.11.0",
34
- "@allurereport/core-api": "3.11.0",
35
- "@allurereport/plugin-api": "3.11.0",
36
- "@allurereport/web-commons": "3.11.0",
37
- "@allurereport/web-components": "3.11.0",
33
+ "@allurereport/charts-api": "3.13.0",
34
+ "@allurereport/core-api": "3.13.0",
35
+ "@allurereport/plugin-api": "3.13.0",
36
+ "@allurereport/web-commons": "3.13.0",
37
+ "@allurereport/web-components": "3.13.0",
38
38
  "@preact/signals": "^2.6.1",
39
39
  "clsx": "^2.1.1",
40
40
  "d3-shape": "^3.2.0",
@@ -56,7 +56,7 @@
56
56
  "@testing-library/preact": "^3.2.3",
57
57
  "@testing-library/user-event": "^14.5.1",
58
58
  "@types/babel__core": "^7.20.5",
59
- "@types/d3-shape": "^3.1.6",
59
+ "@types/d3-shape": "^3.1.8",
60
60
  "@types/md5": "^2.3.5",
61
61
  "@types/node": "^20",
62
62
  "@types/prismjs": "^1.26.5",
@@ -67,7 +67,7 @@
67
67
  "autoprefixer": "^10.4.20",
68
68
  "babel-loader": "^9.2.1",
69
69
  "babel-plugin-prismjs": "^2.1.0",
70
- "css-loader": "^7.1.2",
70
+ "css-loader": "^7.1.4",
71
71
  "diff": "^8.0.3",
72
72
  "filesize": "^10.1.6",
73
73
  "fork-ts-checker-webpack-plugin": "^9.0.2",
@@ -87,9 +87,9 @@
87
87
  "typescript": "^5",
88
88
  "vite": "^8.0.9",
89
89
  "vitest": "^4.1.0",
90
- "webpack": "^5.99.9",
91
- "webpack-cli": "^5.1.4",
92
- "webpack-dev-server": "^5.2.4",
93
- "webpack-manifest-plugin": "^5.0.0"
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 ?? "", { fg: "var(--color-text-primary)", colors: {} });
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,7 +1,7 @@
1
1
  .shortcuts {
2
2
  position: fixed;
3
3
  right: 16px;
4
- bottom: 16px;
4
+ bottom: 8px;
5
5
  z-index: 1000;
6
6
  display: flex;
7
7
  flex-direction: column;
@@ -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 type { JSX } from "preact";
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
- const leftSide = (
46
- <Loadable source={treeStore} renderLoader={() => <PageLoader />} renderData={() => <MainReportWrapper />} />
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={cachedMain} right={<TrView />} />
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 TrErrorTrace = ({ trace }: { trace: string }) => {
17
- const sanitizedTrace = ansiToHTML(trace, {
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, testResultFocusId } from "@/stores/testResultOverviewNav";
4
+ import { getFlatTestResultNode, testResultScrollToId } from "@/stores/testResultOverviewNav";
5
5
 
6
6
  export const useTestResultOverviewFocusScroll = () => {
7
- const focusId = testResultFocusId.value;
7
+ const scrollToId = testResultScrollToId.value;
8
8
 
9
9
  useLayoutEffect(() => {
10
- if (!focusId) {
10
+ if (!scrollToId) {
11
11
  return;
12
12
  }
13
13
 
14
- const node = document.querySelector(`[data-tr-focus-id="${focusId}"]`);
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(focusId);
20
+ const flatNode = getFlatTestResultNode(scrollToId);
21
21
  scrollFocusIntoView(node, { containerAttribute: "data-tr-scroll-container", kind: flatNode?.kind });
22
- }, [focusId]);
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