@allurereport/web-classic 3.0.0-beta.21 → 3.0.0-beta.23

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 (66) hide show
  1. package/dist/multi/app-5296476c01199f82d212.js +2 -0
  2. package/dist/multi/manifest.json +22 -22
  3. package/dist/multi/{styles-1a506a3ca8c2a7cefa96.css → styles-d45d3e6c674788d3eb5e.css} +1 -1
  4. package/dist/single/app-84ebc38ffa00e75e120e.js +2 -0
  5. package/dist/single/manifest.json +1 -1
  6. package/package.json +5 -5
  7. package/src/assets/scss/theme.scss +64 -61
  8. package/src/components/Behaviors/BehaviorsList.tsx +3 -3
  9. package/src/components/Categories/CategoriesList.tsx +3 -3
  10. package/src/components/Footer/FooterVersion.tsx +2 -2
  11. package/src/components/Modal/index.tsx +2 -2
  12. package/src/components/Packages/PackagesList.tsx +3 -3
  13. package/src/components/ReportHeader/ReportHeaderLogo.tsx +2 -2
  14. package/src/components/ReportHeader/index.tsx +2 -2
  15. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +2 -2
  16. package/src/components/TestResult/TestResultDescription/index.tsx +2 -2
  17. package/src/components/TestResult/TestResultHeader/index.tsx +2 -2
  18. package/src/components/TestResult/TestResultHistory/index.tsx +2 -2
  19. package/src/components/TestResult/TestResultInfo/index.tsx +2 -2
  20. package/src/components/TestResult/TestResultLinks/index.tsx +2 -2
  21. package/src/components/TestResult/TestResultMetadata/index.tsx +2 -2
  22. package/src/components/TestResult/TestResultNavigation/index.tsx +2 -2
  23. package/src/components/TestResult/TestResultOverview.tsx +2 -2
  24. package/src/components/TestResult/TestResultParameters/index.tsx +2 -2
  25. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +2 -2
  26. package/src/components/TestResult/TestResultRetriesView/index.tsx +2 -2
  27. package/src/components/TestResult/TestResultSetup/index.tsx +2 -2
  28. package/src/components/TestResult/TestResultSteps/index.tsx +4 -4
  29. package/src/components/TestResult/TestResultTeardown/index.tsx +2 -2
  30. package/src/components/TestResult/index.tsx +4 -4
  31. package/src/components/Tree/Tree.tsx +3 -3
  32. package/src/components/Tree/index.tsx +3 -3
  33. package/src/stores/behaviors.ts +6 -6
  34. package/src/stores/categories.ts +6 -6
  35. package/src/stores/locale.ts +2 -2
  36. package/src/stores/packages.ts +6 -6
  37. package/src/stores/testResults.ts +3 -3
  38. package/src/stores/theme.ts +15 -18
  39. package/src/stores/tree.ts +6 -6
  40. package/src/utils/treeFilters.ts +13 -13
  41. package/test/utils/treeFilters.test.ts +44 -44
  42. package/types.d.ts +22 -20
  43. package/dist/multi/app-363db15563ff7ed5d239.js +0 -2
  44. package/dist/single/app-ff898dcf0525b0bca38c.js +0 -2
  45. /package/dist/multi/{10.app-363db15563ff7ed5d239.js → 10.app-5296476c01199f82d212.js} +0 -0
  46. /package/dist/multi/{222.app-363db15563ff7ed5d239.js → 222.app-5296476c01199f82d212.js} +0 -0
  47. /package/dist/multi/{26.app-363db15563ff7ed5d239.js → 26.app-5296476c01199f82d212.js} +0 -0
  48. /package/dist/multi/{302.app-363db15563ff7ed5d239.js → 302.app-5296476c01199f82d212.js} +0 -0
  49. /package/dist/multi/{304.app-363db15563ff7ed5d239.js → 304.app-5296476c01199f82d212.js} +0 -0
  50. /package/dist/multi/{369.app-363db15563ff7ed5d239.js → 369.app-5296476c01199f82d212.js} +0 -0
  51. /package/dist/multi/{389.app-363db15563ff7ed5d239.js → 389.app-5296476c01199f82d212.js} +0 -0
  52. /package/dist/multi/{498.app-363db15563ff7ed5d239.js → 498.app-5296476c01199f82d212.js} +0 -0
  53. /package/dist/multi/{60.app-363db15563ff7ed5d239.js → 60.app-5296476c01199f82d212.js} +0 -0
  54. /package/dist/multi/{643.app-363db15563ff7ed5d239.js → 643.app-5296476c01199f82d212.js} +0 -0
  55. /package/dist/multi/{671.app-363db15563ff7ed5d239.js → 671.app-5296476c01199f82d212.js} +0 -0
  56. /package/dist/multi/{725.app-363db15563ff7ed5d239.js → 725.app-5296476c01199f82d212.js} +0 -0
  57. /package/dist/multi/{770.app-363db15563ff7ed5d239.js → 770.app-5296476c01199f82d212.js} +0 -0
  58. /package/dist/multi/{848.app-363db15563ff7ed5d239.js → 848.app-5296476c01199f82d212.js} +0 -0
  59. /package/dist/multi/{853.app-363db15563ff7ed5d239.js → 853.app-5296476c01199f82d212.js} +0 -0
  60. /package/dist/multi/{872.app-363db15563ff7ed5d239.js → 872.app-5296476c01199f82d212.js} +0 -0
  61. /package/dist/multi/{895.app-363db15563ff7ed5d239.js → 895.app-5296476c01199f82d212.js} +0 -0
  62. /package/dist/multi/{920.app-363db15563ff7ed5d239.js → 920.app-5296476c01199f82d212.js} +0 -0
  63. /package/dist/multi/{979.app-363db15563ff7ed5d239.js → 979.app-5296476c01199f82d212.js} +0 -0
  64. /package/dist/multi/{991.app-363db15563ff7ed5d239.js → 991.app-5296476c01199f82d212.js} +0 -0
  65. /package/dist/multi/{app-363db15563ff7ed5d239.js.LICENSE.txt → app-5296476c01199f82d212.js.LICENSE.txt} +0 -0
  66. /package/dist/single/{app-ff898dcf0525b0bca38c.js.LICENSE.txt → app-84ebc38ffa00e75e120e.js.LICENSE.txt} +0 -0
@@ -2,7 +2,7 @@ import type { Statistic } from "@allurereport/core-api";
2
2
  import cx from "clsx";
3
3
  import type { FunctionComponent } from "preact";
4
4
  import { useState } from "preact/hooks";
5
- import type { AwesomeRecursiveTree, AwesomeStatus } from "types";
5
+ import type { ClassicRecursiveTree, ClassicStatus } from "types";
6
6
  import TreeItem from "@/components/Tree/TreeItem";
7
7
  import { route } from "@/stores/router";
8
8
  import TreeHeader from "./TreeHeader";
@@ -10,10 +10,10 @@ import * as styles from "./styles.scss";
10
10
 
11
11
  interface TreeProps {
12
12
  statistic?: Statistic;
13
- tree: AwesomeRecursiveTree;
13
+ tree: ClassicRecursiveTree;
14
14
  name?: string;
15
15
  root?: boolean;
16
- statusFilter?: AwesomeStatus;
16
+ statusFilter?: ClassicStatus;
17
17
  }
18
18
 
19
19
  const Tree: FunctionComponent<TreeProps> = ({ tree, statusFilter, root, name, statistic }) => {
@@ -1,6 +1,6 @@
1
1
  import { Button, Loadable, PageLoader, Text } from "@allurereport/web-components";
2
2
  import { useEffect } from "preact/hooks";
3
- import type { AwesomeStatus } from "types";
3
+ import type { ClassicStatus } from "types";
4
4
  import Tree from "@/components/Tree/Tree";
5
5
  import { useI18n } from "@/stores/locale";
6
6
  import { currentTab } from "@/stores/tabs";
@@ -11,7 +11,7 @@ export const TreeList = () => {
11
11
  const { t } = useI18n("empty");
12
12
 
13
13
  useEffect(() => {
14
- setTreeStatus(currentTab.value as AwesomeStatus);
14
+ setTreeStatus(currentTab.value as ClassicStatus);
15
15
  }, [currentTab.value]);
16
16
 
17
17
  return (
@@ -51,7 +51,7 @@ export const TreeList = () => {
51
51
 
52
52
  return (
53
53
  <div className={styles["tree-list"]}>
54
- <Tree tree={filteredTree.value} statusFilter={currentTab.value as AwesomeStatus} root />
54
+ <Tree tree={filteredTree.value} statusFilter={currentTab.value as ClassicStatus} root />
55
55
  </div>
56
56
  );
57
57
  }}
@@ -1,6 +1,6 @@
1
1
  import { fetchReportJsonData } from "@allurereport/web-commons";
2
2
  import { computed, signal } from "@preact/signals";
3
- import type { AwesomeStatus, AwesomeTree, AwesomeTreeGroup } from "types";
3
+ import type { ClassicStatus, ClassicTree, ClassicTreeGroup } from "types";
4
4
  import type { StoreSignalState } from "@/stores/types";
5
5
  import { createRecursiveTree, isRecursiveTreeEmpty } from "@/utils/treeFilters";
6
6
 
@@ -9,13 +9,13 @@ export type TreeDirection = "asc" | "desc";
9
9
  export type TreeFilters = "flaky" | "retry" | "new";
10
10
  export type TreeFiltersState = {
11
11
  query: string;
12
- status: AwesomeStatus;
12
+ status: ClassicStatus;
13
13
  filter: Record<TreeFilters, boolean>;
14
14
  sortBy: TreeSortBy;
15
15
  direction: TreeDirection;
16
16
  };
17
17
 
18
- export const behaviorsStore = signal<StoreSignalState<AwesomeTree>>({
18
+ export const behaviorsStore = signal<StoreSignalState<ClassicTree>>({
19
19
  loading: true,
20
20
  error: undefined,
21
21
  data: undefined,
@@ -39,7 +39,7 @@ export const filteredBehaviors = computed(() => {
39
39
  const { root, leavesById, groupsById } = behaviorsStore.value.data;
40
40
 
41
41
  return createRecursiveTree({
42
- group: root as AwesomeTreeGroup,
42
+ group: root as ClassicTreeGroup,
43
43
  leavesById,
44
44
  groupsById,
45
45
  filterOptions: behaviorsFiltersStore.value,
@@ -71,7 +71,7 @@ export const setBehaviorsQuery = (query: string) => {
71
71
  };
72
72
  };
73
73
 
74
- export const setBehaviorsStatus = (status: AwesomeStatus) => {
74
+ export const setBehaviorsStatus = (status: ClassicStatus) => {
75
75
  behaviorsFiltersStore.value = {
76
76
  ...behaviorsFiltersStore.value,
77
77
  status,
@@ -110,7 +110,7 @@ export const fetchBehaviorsData = async () => {
110
110
  };
111
111
 
112
112
  try {
113
- const res = await fetchReportJsonData<AwesomeTree>("widgets/behaviors.json", { bustCache: true });
113
+ const res = await fetchReportJsonData<ClassicTree>("widgets/behaviors.json", { bustCache: true });
114
114
 
115
115
  behaviorsStore.value = {
116
116
  data: res,
@@ -1,6 +1,6 @@
1
1
  import { fetchReportJsonData } from "@allurereport/web-commons";
2
2
  import { computed, signal } from "@preact/signals";
3
- import type { AwesomeStatus, AwesomeTree, AwesomeTreeGroup } from "types";
3
+ import type { ClassicStatus, ClassicTree, ClassicTreeGroup } from "types";
4
4
  import type { StoreSignalState } from "@/stores/types";
5
5
  import { createRecursiveTree, isRecursiveTreeEmpty } from "@/utils/treeFilters";
6
6
 
@@ -9,13 +9,13 @@ export type TreeDirection = "asc" | "desc";
9
9
  export type TreeFilters = "flaky" | "retry" | "new";
10
10
  export type TreeFiltersState = {
11
11
  query: string;
12
- status: AwesomeStatus;
12
+ status: ClassicStatus;
13
13
  filter: Record<TreeFilters, boolean>;
14
14
  sortBy: TreeSortBy;
15
15
  direction: TreeDirection;
16
16
  };
17
17
 
18
- export const categoriesStore = signal<StoreSignalState<AwesomeTree>>({
18
+ export const categoriesStore = signal<StoreSignalState<ClassicTree>>({
19
19
  loading: true,
20
20
  error: undefined,
21
21
  data: undefined,
@@ -39,7 +39,7 @@ export const filteredCategories = computed(() => {
39
39
  const { root, leavesById, groupsById } = categoriesStore.value.data;
40
40
 
41
41
  return createRecursiveTree({
42
- group: root as AwesomeTreeGroup,
42
+ group: root as ClassicTreeGroup,
43
43
  leavesById,
44
44
  groupsById,
45
45
  filterOptions: categoriesFiltersStore.value,
@@ -71,7 +71,7 @@ export const setCategoriesQuery = (query: string) => {
71
71
  };
72
72
  };
73
73
 
74
- export const setCategoriesStatus = (status: AwesomeStatus) => {
74
+ export const setCategoriesStatus = (status: ClassicStatus) => {
75
75
  categoriesFiltersStore.value = {
76
76
  ...categoriesFiltersStore.value,
77
77
  status,
@@ -110,7 +110,7 @@ export const fetchCategoriesData = async () => {
110
110
  };
111
111
 
112
112
  try {
113
- const res = await fetchReportJsonData<AwesomeTree>("widgets/categories.json", { bustCache: true });
113
+ const res = await fetchReportJsonData<ClassicTree>("widgets/categories.json", { bustCache: true });
114
114
 
115
115
  categoriesStore.value = {
116
116
  data: res,
@@ -2,9 +2,9 @@ import { getReportOptions } from "@allurereport/web-commons";
2
2
  import { computed, signal } from "@preact/signals";
3
3
  import i18next, { type TOptions } from "i18next";
4
4
  import { DEFAULT_LOCALE, LANG_LOCALE, type LangLocale } from "@/translations/constants";
5
- import type { AwesomeReportOptions } from "../../types.js";
5
+ import type { ClassicReportOptions } from "../../types.js";
6
6
 
7
- const { reportLanguage } = getReportOptions<AwesomeReportOptions>() ?? {};
7
+ const { reportLanguage } = getReportOptions<ClassicReportOptions>() ?? {};
8
8
 
9
9
  const namespaces = [
10
10
  "empty",
@@ -1,6 +1,6 @@
1
1
  import { fetchReportJsonData } from "@allurereport/web-commons";
2
2
  import { computed, signal } from "@preact/signals";
3
- import type { AwesomeStatus, AwesomeTree, AwesomeTreeGroup } from "types";
3
+ import type { ClassicStatus, ClassicTree, ClassicTreeGroup } from "types";
4
4
  import type { StoreSignalState } from "@/stores/types";
5
5
  import { createRecursiveTree, isRecursiveTreeEmpty } from "@/utils/treeFilters";
6
6
 
@@ -9,13 +9,13 @@ export type TreeDirection = "asc" | "desc";
9
9
  export type TreeFilters = "flaky" | "retry" | "new";
10
10
  export type TreeFiltersState = {
11
11
  query: string;
12
- status: AwesomeStatus;
12
+ status: ClassicStatus;
13
13
  filter: Record<TreeFilters, boolean>;
14
14
  sortBy: TreeSortBy;
15
15
  direction: TreeDirection;
16
16
  };
17
17
 
18
- export const packagesStore = signal<StoreSignalState<AwesomeTree>>({
18
+ export const packagesStore = signal<StoreSignalState<ClassicTree>>({
19
19
  loading: true,
20
20
  error: undefined,
21
21
  data: undefined,
@@ -39,7 +39,7 @@ export const filteredPackages = computed(() => {
39
39
  const { root, leavesById, groupsById } = packagesStore.value.data;
40
40
 
41
41
  return createRecursiveTree({
42
- group: root as AwesomeTreeGroup,
42
+ group: root as ClassicTreeGroup,
43
43
  leavesById,
44
44
  groupsById,
45
45
  filterOptions: packagesFiltersStore.value,
@@ -71,7 +71,7 @@ export const setPackagesQuery = (query: string) => {
71
71
  };
72
72
  };
73
73
 
74
- export const setPackagesStatus = (status: AwesomeStatus) => {
74
+ export const setPackagesStatus = (status: ClassicStatus) => {
75
75
  packagesFiltersStore.value = {
76
76
  ...packagesFiltersStore.value,
77
77
  status,
@@ -110,7 +110,7 @@ export const fetchPackagesData = async () => {
110
110
  };
111
111
 
112
112
  try {
113
- const res = await fetchReportJsonData<AwesomeTree>("widgets/packages.json", { bustCache: true });
113
+ const res = await fetchReportJsonData<ClassicTree>("widgets/packages.json", { bustCache: true });
114
114
 
115
115
  packagesStore.value = {
116
116
  data: res,
@@ -1,9 +1,9 @@
1
1
  import { fetchReportJsonData } from "@allurereport/web-commons";
2
2
  import { signal } from "@preact/signals";
3
- import { type AwesomeTestResult } from "types";
3
+ import { type ClassicTestResult } from "types";
4
4
  import { type StoreSignalState } from "./types";
5
5
 
6
- export type TestResultsStoreState = Record<string, AwesomeTestResult>;
6
+ export type TestResultsStoreState = Record<string, ClassicTestResult>;
7
7
 
8
8
  export type TestResultNavStoreState = string[];
9
9
 
@@ -49,7 +49,7 @@ export const fetchTestResult = async (testResultId: string) => {
49
49
  };
50
50
 
51
51
  try {
52
- const data = await fetchReportJsonData<AwesomeTestResult>(`data/test-results/${testResultId}.json`);
52
+ const data = await fetchReportJsonData<ClassicTestResult>(`data/test-results/${testResultId}.json`);
53
53
 
54
54
  testResultStore.value = {
55
55
  data: { ...testResultStore.value.data, [testResultId]: data },
@@ -1,33 +1,30 @@
1
1
  import { getReportOptions } from "@allurereport/web-commons";
2
+ import type { Theme } from "@allurereport/web-components";
2
3
  import { signal } from "@preact/signals";
3
- import type { AwesomeReportOptions } from "../../types.js";
4
+ import type { ClassicReportOptions } from "../../types.js";
4
5
 
5
- type Theme = "light" | "dark";
6
+ export const themeStore = signal<Theme>("auto");
6
7
 
7
- const { theme } = getReportOptions<AwesomeReportOptions>() ?? {};
8
+ export const setTheme = (mode: "light" | "dark" | "auto") => {
9
+ themeStore.value = mode;
8
10
 
9
- export const themeStore = signal<Theme>("light");
11
+ try {
12
+ window.localStorage.setItem("theme", mode);
13
+ } catch {}
10
14
 
11
- export const setTheme = (newTheme: Theme): void => {
12
- themeStore.value = newTheme;
13
- document.documentElement.setAttribute("data-theme", newTheme);
14
- window.localStorage.setItem("theme", newTheme);
15
+ document.documentElement.setAttribute("data-theme", mode);
15
16
  };
16
17
 
17
18
  export const toggleTheme = () => {
18
- setTheme(themeStore.value === "light" ? "dark" : "light");
19
+ const order = ["light", "dark", "auto"];
20
+ const current = themeStore.value;
21
+ const next = order[(order.indexOf(current) + 1) % order.length] as Theme;
22
+ setTheme(next);
19
23
  };
20
24
 
21
25
  export const getTheme = () => {
26
+ const { theme } = getReportOptions<ClassicReportOptions>() ?? {};
22
27
  const themeFromLS = (window.localStorage.getItem("theme") as Theme | null) || (theme as Theme);
23
28
 
24
- if (themeFromLS) {
25
- setTheme(themeFromLS);
26
- return;
27
- }
28
-
29
- const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)").matches;
30
- const initialTheme = prefersDarkScheme ? "dark" : "light";
31
-
32
- setTheme(initialTheme);
29
+ setTheme(themeFromLS);
33
30
  };
@@ -1,6 +1,6 @@
1
1
  import { fetchReportJsonData } from "@allurereport/web-commons";
2
2
  import { computed, signal } from "@preact/signals";
3
- import type { AwesomeStatus, AwesomeTree, AwesomeTreeGroup } from "types";
3
+ import type { ClassicStatus, ClassicTree, ClassicTreeGroup } from "types";
4
4
  import type { StoreSignalState } from "@/stores/types";
5
5
  import { createRecursiveTree, isRecursiveTreeEmpty } from "@/utils/treeFilters";
6
6
 
@@ -9,13 +9,13 @@ export type TreeDirection = "asc" | "desc";
9
9
  export type TreeFilters = "flaky" | "retry" | "new";
10
10
  export type TreeFiltersState = {
11
11
  query: string;
12
- status: AwesomeStatus;
12
+ status: ClassicStatus;
13
13
  filter: Record<TreeFilters, boolean>;
14
14
  sortBy: TreeSortBy;
15
15
  direction: TreeDirection;
16
16
  };
17
17
 
18
- export const treeStore = signal<StoreSignalState<AwesomeTree>>({
18
+ export const treeStore = signal<StoreSignalState<ClassicTree>>({
19
19
  loading: true,
20
20
  error: undefined,
21
21
  data: undefined,
@@ -39,7 +39,7 @@ export const filteredTree = computed(() => {
39
39
  const { root, leavesById, groupsById } = treeStore.value.data;
40
40
 
41
41
  return createRecursiveTree({
42
- group: root as AwesomeTreeGroup,
42
+ group: root as ClassicTreeGroup,
43
43
  leavesById,
44
44
  groupsById,
45
45
  filterOptions: treeFiltersStore.value,
@@ -71,7 +71,7 @@ export const setTreeQuery = (query: string) => {
71
71
  };
72
72
  };
73
73
 
74
- export const setTreeStatus = (status: AwesomeStatus) => {
74
+ export const setTreeStatus = (status: ClassicStatus) => {
75
75
  treeFiltersStore.value = {
76
76
  ...treeFiltersStore.value,
77
77
  status,
@@ -110,7 +110,7 @@ export const fetchTreeData = async () => {
110
110
  };
111
111
 
112
112
  try {
113
- const res = await fetchReportJsonData<AwesomeTree>("widgets/tree.json", { bustCache: true });
113
+ const res = await fetchReportJsonData<ClassicTree>("widgets/tree.json", { bustCache: true });
114
114
 
115
115
  treeStore.value = {
116
116
  data: res,
@@ -12,9 +12,9 @@ import {
12
12
  reverse,
13
13
  } from "@allurereport/core-api";
14
14
  import type { TreeFiltersState, TreeSortBy } from "@/stores/tree";
15
- import type { AwesomeRecursiveTree, AwesomeTree, AwesomeTreeGroup, AwesomeTreeLeaf } from "../../types";
15
+ import type { ClassicRecursiveTree, ClassicTree, ClassicTreeGroup, ClassicTreeLeaf } from "../../types";
16
16
 
17
- export const isIncluded = (leaf: TreeLeaf<AwesomeTreeLeaf>, filterOptions: TreeFiltersState) => {
17
+ export const isIncluded = (leaf: TreeLeaf<ClassicTreeLeaf>, filterOptions: TreeFiltersState) => {
18
18
  const queryMatched = !filterOptions?.query || leaf.name.toLowerCase().includes(filterOptions.query.toLowerCase());
19
19
  const statusMatched =
20
20
  !filterOptions?.status || filterOptions?.status === "total" || leaf.status === filterOptions.status;
@@ -26,8 +26,8 @@ export const isIncluded = (leaf: TreeLeaf<AwesomeTreeLeaf>, filterOptions: TreeF
26
26
  return [queryMatched, statusMatched, flakyMatched, retryMatched].every(Boolean);
27
27
  };
28
28
 
29
- const leafComparatorByTreeSortBy = (sortBy: TreeSortBy): Comparator<TreeLeaf<AwesomeTreeLeaf>> => {
30
- const typedCompareBy = compareBy<TreeLeaf<AwesomeTreeLeaf>>;
29
+ const leafComparatorByTreeSortBy = (sortBy: TreeSortBy): Comparator<TreeLeaf<ClassicTreeLeaf>> => {
30
+ const typedCompareBy = compareBy<TreeLeaf<ClassicTreeLeaf>>;
31
31
  switch (sortBy) {
32
32
  case "order":
33
33
  return typedCompareBy("groupOrder", ordinal());
@@ -52,7 +52,7 @@ const groupComparatorByTreeSortBy = (sortBy: TreeSortBy): Comparator<DefaultTree
52
52
  }
53
53
  };
54
54
 
55
- export const leafComparator = (filterOptions: TreeFiltersState): Comparator<TreeLeaf<AwesomeTreeLeaf>> => {
55
+ export const leafComparator = (filterOptions: TreeFiltersState): Comparator<TreeLeaf<ClassicTreeLeaf>> => {
56
56
  const cmp = leafComparatorByTreeSortBy(filterOptions.sortBy);
57
57
  const directional = filterOptions.direction === "asc" ? cmp : reverse(cmp);
58
58
  // apply fallback sorting by name
@@ -68,12 +68,12 @@ export const groupComparator = (filterOptions: TreeFiltersState): Comparator<Def
68
68
 
69
69
  export const filterLeaves = (
70
70
  leaves: string[] = [],
71
- leavesById: AwesomeTree["leavesById"],
71
+ leavesById: ClassicTree["leavesById"],
72
72
  filterOptions: TreeFiltersState,
73
73
  ) => {
74
74
  const filteredLeaves = [...leaves]
75
75
  .map((leafId) => leavesById[leafId])
76
- .filter((leaf: TreeLeaf<AwesomeTreeLeaf>) => isIncluded(leaf, filterOptions));
76
+ .filter((leaf: TreeLeaf<ClassicTreeLeaf>) => isIncluded(leaf, filterOptions));
77
77
 
78
78
  const comparator = leafComparator(filterOptions);
79
79
  return filteredLeaves.sort(comparator);
@@ -85,11 +85,11 @@ export const filterLeaves = (
85
85
  * @param payload
86
86
  */
87
87
  export const createRecursiveTree = (payload: {
88
- group: AwesomeTreeGroup;
89
- groupsById: AwesomeTree["groupsById"];
90
- leavesById: AwesomeTree["leavesById"];
88
+ group: ClassicTreeGroup;
89
+ groupsById: ClassicTree["groupsById"];
90
+ leavesById: ClassicTree["leavesById"];
91
91
  filterOptions?: TreeFiltersState;
92
- }): AwesomeRecursiveTree => {
92
+ }): ClassicRecursiveTree => {
93
93
  const { group, groupsById, leavesById, filterOptions } = payload;
94
94
  const groupLeaves: string[] = group.leaves ?? [];
95
95
 
@@ -107,7 +107,7 @@ export const createRecursiveTree = (payload: {
107
107
  ?.filter((rt) => !isRecursiveTreeEmpty(rt)) ?? [];
108
108
 
109
109
  const statistic: Statistic = emptyStatistic();
110
- trees.forEach((rt: AwesomeRecursiveTree) => {
110
+ trees.forEach((rt: ClassicRecursiveTree) => {
111
111
  if (rt.statistic) {
112
112
  const additional: Statistic = rt.statistic;
113
113
  mergeStatistic(statistic, additional);
@@ -126,7 +126,7 @@ export const createRecursiveTree = (payload: {
126
126
  };
127
127
  };
128
128
 
129
- export const isRecursiveTreeEmpty = (tree: AwesomeRecursiveTree): boolean => {
129
+ export const isRecursiveTreeEmpty = (tree: ClassicRecursiveTree): boolean => {
130
130
  if (!tree.trees?.length && !tree.leaves?.length) {
131
131
  return true;
132
132
  }