@hitachivantara/app-shell-ui 1.6.0 → 1.6.1

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 (139) hide show
  1. package/dist/esm/components/AppShell/AppShell.js +8 -6
  2. package/dist/esm/components/AppShellProvider/AppShellProvider.js +80 -56
  3. package/dist/esm/components/AppShellRoutes/AppShellRoutes.js +74 -65
  4. package/dist/esm/components/AppShellViewProvider/AppShellViewProvider.js +13 -13
  5. package/dist/esm/components/CustomHooksInitializer/CustomHooksInitializer.js +9 -5
  6. package/dist/esm/components/GlobalStyles/GlobalStyles.js +8 -8
  7. package/dist/esm/components/GlobalStyles/index.js +2 -3
  8. package/dist/esm/components/IconUiKit/IconUiKit.js +10 -8
  9. package/dist/esm/components/IconUiKit/index.js +4 -5
  10. package/dist/esm/components/hoc/withClickAwayListener.js +19 -12
  11. package/dist/esm/components/hoc/withGlobalProvider.js +30 -25
  12. package/dist/esm/components/layout/Header/BrandLogo/BrandLogo.js +27 -17
  13. package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi.js +10 -8
  14. package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada.js +15 -13
  15. package/dist/esm/components/layout/Header/BrandLogo/Logos/Pentaho.js +10 -8
  16. package/dist/esm/components/layout/Header/Header.js +54 -42
  17. package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/DynamicAction.js +22 -18
  18. package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/index.js +2 -3
  19. package/dist/esm/components/layout/Header/HeaderActions/HeaderActions.js +17 -14
  20. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.js +57 -46
  21. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/index.js +2 -3
  22. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/styles.js +6 -6
  23. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/ColorModeSwitcher.js +19 -17
  24. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/index.js +2 -3
  25. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js +23 -20
  26. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/index.js +2 -3
  27. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/InternalAction/InternalAction.js +23 -21
  28. package/dist/esm/components/layout/Header/HeaderActions/index.js +2 -3
  29. package/dist/esm/components/layout/Header/styles.js +7 -7
  30. package/dist/esm/components/layout/Loading/Loading.js +9 -7
  31. package/dist/esm/components/layout/Loading/styles.js +20 -8
  32. package/dist/esm/components/layout/Main/Main.js +23 -22
  33. package/dist/esm/components/layout/Main/styles.js +17 -8
  34. package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js +67 -49
  35. package/dist/esm/components/layout/VerticalNavigation/styles.js +15 -16
  36. package/dist/esm/index.js +2 -3
  37. package/dist/esm/lib/hooks/useClearLocationState.js +14 -14
  38. package/dist/esm/lib/hooks/useCustomEventListener.js +19 -14
  39. package/dist/esm/lib/hooks/useLocalStorage.js +22 -16
  40. package/dist/esm/lib/hooks/useNavigationMenuItems.js +36 -28
  41. package/dist/esm/lib/hooks/useNotificationsEventListener.js +47 -37
  42. package/dist/esm/lib/hooks/useThemeEventListener.js +25 -20
  43. package/dist/esm/lib/i18n/index.js +23 -19
  44. package/dist/esm/lib/i18n/localization/en.json.js +18 -15
  45. package/dist/esm/lib/i18n/localization/pt.json.js +18 -15
  46. package/dist/esm/lib/utils/CombinedProviders.js +19 -14
  47. package/dist/esm/lib/utils/basePathUtils.js +4 -3
  48. package/dist/esm/lib/utils/documentUtil.js +10 -6
  49. package/dist/esm/lib/utils/navigationUtil.js +65 -38
  50. package/dist/esm/lib/utils/textUtil.js +4 -3
  51. package/dist/esm/pages/ErrorPage/ErrorPage.js +24 -24
  52. package/dist/esm/pages/ErrorPage/Footer/Footer.js +47 -31
  53. package/dist/esm/pages/ErrorPage/Footer/styles.js +8 -8
  54. package/dist/esm/pages/ErrorPage/styles.js +25 -15
  55. package/dist/esm/pages/GenericError/500.svg.js +2 -3
  56. package/dist/esm/pages/GenericError/GenericError.js +13 -13
  57. package/dist/esm/pages/LoadingPage/LoadingPage.js +12 -12
  58. package/dist/esm/pages/LoadingPage/index.js +2 -3
  59. package/dist/esm/pages/LoadingPage/styles.js +15 -9
  60. package/dist/esm/pages/NotFound/404.svg.js +2 -3
  61. package/dist/esm/pages/NotFound/NotFound.js +11 -11
  62. package/dist/esm/pages/NotFound/index.js +2 -3
  63. package/dist/esm/pages/Root/Root.js +22 -22
  64. package/dist/esm/providers/BannerProvider.js +67 -57
  65. package/dist/esm/providers/LayoutProvider.js +19 -16
  66. package/dist/esm/providers/NavigationProvider.js +87 -55
  67. package/dist/esm/providers/hooks/useBannerContext.js +9 -7
  68. package/dist/esm/providers/hooks/useLayoutContext.js +9 -7
  69. package/dist/esm/providers/hooks/useNavigationContext.js +9 -7
  70. package/package.json +5 -5
  71. package/dist/esm/components/AppShell/AppShell.js.map +0 -1
  72. package/dist/esm/components/AppShellProvider/AppShellProvider.js.map +0 -1
  73. package/dist/esm/components/AppShellRoutes/AppShellRoutes.js.map +0 -1
  74. package/dist/esm/components/AppShellViewProvider/AppShellViewProvider.js.map +0 -1
  75. package/dist/esm/components/CustomHooksInitializer/CustomHooksInitializer.js.map +0 -1
  76. package/dist/esm/components/GlobalStyles/GlobalStyles.js.map +0 -1
  77. package/dist/esm/components/GlobalStyles/index.js.map +0 -1
  78. package/dist/esm/components/IconUiKit/IconUiKit.js.map +0 -1
  79. package/dist/esm/components/IconUiKit/index.js.map +0 -1
  80. package/dist/esm/components/hoc/withClickAwayListener.js.map +0 -1
  81. package/dist/esm/components/hoc/withGlobalProvider.js.map +0 -1
  82. package/dist/esm/components/layout/Header/BrandLogo/BrandLogo.js.map +0 -1
  83. package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi.js.map +0 -1
  84. package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada.js.map +0 -1
  85. package/dist/esm/components/layout/Header/BrandLogo/Logos/Pentaho.js.map +0 -1
  86. package/dist/esm/components/layout/Header/Header.js.map +0 -1
  87. package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/DynamicAction.js.map +0 -1
  88. package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/index.js.map +0 -1
  89. package/dist/esm/components/layout/Header/HeaderActions/HeaderActions.js.map +0 -1
  90. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.js.map +0 -1
  91. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/index.js.map +0 -1
  92. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/styles.js.map +0 -1
  93. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/ColorModeSwitcher.js.map +0 -1
  94. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/index.js.map +0 -1
  95. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js.map +0 -1
  96. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/index.js.map +0 -1
  97. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/InternalAction/InternalAction.js.map +0 -1
  98. package/dist/esm/components/layout/Header/HeaderActions/index.js.map +0 -1
  99. package/dist/esm/components/layout/Header/styles.js.map +0 -1
  100. package/dist/esm/components/layout/Loading/Loading.js.map +0 -1
  101. package/dist/esm/components/layout/Loading/styles.js.map +0 -1
  102. package/dist/esm/components/layout/Main/Main.js.map +0 -1
  103. package/dist/esm/components/layout/Main/styles.js.map +0 -1
  104. package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js.map +0 -1
  105. package/dist/esm/components/layout/VerticalNavigation/styles.js.map +0 -1
  106. package/dist/esm/index.js.map +0 -1
  107. package/dist/esm/lib/hooks/useClearLocationState.js.map +0 -1
  108. package/dist/esm/lib/hooks/useCustomEventListener.js.map +0 -1
  109. package/dist/esm/lib/hooks/useLocalStorage.js.map +0 -1
  110. package/dist/esm/lib/hooks/useNavigationMenuItems.js.map +0 -1
  111. package/dist/esm/lib/hooks/useNotificationsEventListener.js.map +0 -1
  112. package/dist/esm/lib/hooks/useThemeEventListener.js.map +0 -1
  113. package/dist/esm/lib/i18n/index.js.map +0 -1
  114. package/dist/esm/lib/i18n/localization/en.json.js.map +0 -1
  115. package/dist/esm/lib/i18n/localization/pt.json.js.map +0 -1
  116. package/dist/esm/lib/utils/CombinedProviders.js.map +0 -1
  117. package/dist/esm/lib/utils/basePathUtils.js.map +0 -1
  118. package/dist/esm/lib/utils/documentUtil.js.map +0 -1
  119. package/dist/esm/lib/utils/navigationUtil.js.map +0 -1
  120. package/dist/esm/lib/utils/textUtil.js.map +0 -1
  121. package/dist/esm/pages/ErrorPage/ErrorPage.js.map +0 -1
  122. package/dist/esm/pages/ErrorPage/Footer/Footer.js.map +0 -1
  123. package/dist/esm/pages/ErrorPage/Footer/styles.js.map +0 -1
  124. package/dist/esm/pages/ErrorPage/styles.js.map +0 -1
  125. package/dist/esm/pages/GenericError/500.svg.js.map +0 -1
  126. package/dist/esm/pages/GenericError/GenericError.js.map +0 -1
  127. package/dist/esm/pages/LoadingPage/LoadingPage.js.map +0 -1
  128. package/dist/esm/pages/LoadingPage/index.js.map +0 -1
  129. package/dist/esm/pages/LoadingPage/styles.js.map +0 -1
  130. package/dist/esm/pages/NotFound/404.svg.js.map +0 -1
  131. package/dist/esm/pages/NotFound/NotFound.js.map +0 -1
  132. package/dist/esm/pages/NotFound/index.js.map +0 -1
  133. package/dist/esm/pages/Root/Root.js.map +0 -1
  134. package/dist/esm/providers/BannerProvider.js.map +0 -1
  135. package/dist/esm/providers/LayoutProvider.js.map +0 -1
  136. package/dist/esm/providers/NavigationProvider.js.map +0 -1
  137. package/dist/esm/providers/hooks/useBannerContext.js.map +0 -1
  138. package/dist/esm/providers/hooks/useLayoutContext.js.map +0 -1
  139. package/dist/esm/providers/hooks/useNavigationContext.js.map +0 -1
@@ -1,8 +1,10 @@
1
- import { jsx as o } from "@emotion/react/jsx-runtime";
2
- import r from "../hoc/withGlobalProvider.js";
3
- import p from "../AppShellRoutes/AppShellRoutes.js";
4
- const t = () => /* @__PURE__ */ o(p, {}), i = r(t);
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import withGlobalProvider from "../hoc/withGlobalProvider.js";
3
+ import AppShellRoutes from "../AppShellRoutes/AppShellRoutes.js";
4
+ const AppShell = () => {
5
+ return /* @__PURE__ */ jsx(AppShellRoutes, {});
6
+ };
7
+ const HvAppShell = withGlobalProvider(AppShell);
5
8
  export {
6
- i as default
9
+ HvAppShell as default
7
10
  };
8
- //# sourceMappingURL=AppShell.js.map
@@ -1,61 +1,85 @@
1
- import { jsx as m } from "@emotion/react/jsx-runtime";
2
- import { useContext as O, useState as d, useEffect as p, useMemo as h } from "react";
3
- import { HvAppShellContext as R, HvAppShellRuntimeContext as w, HvAppShellCombinedProvidersContext as N, CONFIG_TRANSLATIONS_NAMESPACE as T } from "@hitachivantara/app-shell-shared";
4
- import { I18nContext as _ } from "react-i18next";
5
- import { themes as j, HvProvider as C } from "@hitachivantara/uikit-react-core";
6
- import { addResourceBundles as B } from "../../lib/i18n/index.js";
7
- import D from "../../lib/hooks/useLocalStorage.js";
8
- const F = ({
9
- children: A,
10
- config: n,
11
- configUrl: i
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { useContext, useState, useEffect, useMemo } from "react";
3
+ import { HvAppShellContext, HvAppShellRuntimeContext, HvAppShellCombinedProvidersContext, CONFIG_TRANSLATIONS_NAMESPACE } from "@hitachivantara/app-shell-shared";
4
+ import { I18nContext } from "react-i18next";
5
+ import { themes, HvProvider } from "@hitachivantara/uikit-react-core";
6
+ import { addResourceBundles } from "../../lib/i18n/index.js";
7
+ import useLocalStorage from "../../lib/hooks/useLocalStorage.js";
8
+ const AppShellProvider = ({
9
+ children,
10
+ config: localConfig,
11
+ configUrl
12
12
  }) => {
13
- var f, P, x, S;
14
13
  const {
15
- i18n: l
16
- } = O(_), {
17
- value: I
18
- } = D("COLOR_MODE"), [c, v] = d(void 0), [$, E] = d(!1);
19
- p(() => {
20
- !n && i && fetch(new URL(i)).then((r) => r.json()).then((r) => v(r)).catch((r) => {
21
- console.error(`It was not possible to obtain the context from: ${i}`, r), v(void 0), E(!0);
22
- });
23
- }, [n, i]);
24
- const e = h(() => n ?? c, [n, c]);
25
- if ($)
14
+ i18n
15
+ } = useContext(I18nContext);
16
+ const {
17
+ value: storedColorModeValue
18
+ } = useLocalStorage("COLOR_MODE");
19
+ const [loadedConfig, setLoadedConfig] = useState(void 0);
20
+ const [hasError, setHasError] = useState(false);
21
+ useEffect(() => {
22
+ if (!localConfig && configUrl) {
23
+ fetch(new URL(configUrl)).then((result) => {
24
+ return result.json();
25
+ }).then((data) => setLoadedConfig(data)).catch((e) => {
26
+ console.error(`It was not possible to obtain the context from: ${configUrl}`, e);
27
+ setLoadedConfig(void 0);
28
+ setHasError(true);
29
+ });
30
+ }
31
+ }, [localConfig, configUrl]);
32
+ const theConfig = useMemo(() => localConfig ?? loadedConfig, [localConfig, loadedConfig]);
33
+ if (hasError) {
26
34
  throw Error("It was not possible to obtain the configuration");
27
- e != null && e.translations && B(l, e.translations, T);
28
- const [u, b] = d(void 0), [a, M] = d(void 0);
29
- p(() => {
30
- var r, o;
31
- (r = e == null ? void 0 : e.theming) != null && r.themes && Promise.all((o = e.theming.themes) == null ? void 0 : o.map((t) => j[t] ?? import(
32
- /* @vite-ignore */
33
- t
34
- ).then((s) => s.default).catch((s) => {
35
- console.error(`Import of theme bundle ${t} failed! ${s}`);
36
- }))).then((t) => {
37
- b(t.filter((s) => !!s));
38
- }).catch((t) => {
39
- console.error(`Import of themes failed! ${t}`);
40
- });
41
- }, [(f = e == null ? void 0 : e.theming) == null ? void 0 : f.themes]), p(() => {
42
- e != null && e.providers && Promise.all(e.providers.map((r) => import(
43
- /* @vite-ignore */
44
- r.bundle
45
- ).then((o) => o.default).catch((o) => {
46
- console.error(`Import of provider '${r.bundle}' failed! ${o}`);
47
- }))).then((r) => M(r.filter((o) => !!o))).catch((r) => {
48
- console.error("Import of providers failed!", r);
49
- });
50
- }, [e == null ? void 0 : e.providers]);
51
- const H = h(() => ({
52
- i18n: l
53
- }), [l]), L = h(() => ({
54
- providers: a
55
- }), [a]);
56
- return !e || (P = e.theming) != null && P.themes && !u || e.providers != null && a === void 0 ? null : /* @__PURE__ */ m(R.Provider, { value: e, children: /* @__PURE__ */ m(w.Provider, { value: H, children: /* @__PURE__ */ m(C, { themes: u, theme: (x = e.theming) == null ? void 0 : x.theme, colorMode: I ?? ((S = e.theming) == null ? void 0 : S.colorMode), children: /* @__PURE__ */ m(N.Provider, { value: L, children: A }) }) }) });
57
- }, K = F;
35
+ }
36
+ if (theConfig?.translations) {
37
+ addResourceBundles(i18n, theConfig.translations, CONFIG_TRANSLATIONS_NAMESPACE);
38
+ }
39
+ const [themes$1, setThemes] = useState(void 0);
40
+ const [providers, setProviders] = useState(void 0);
41
+ useEffect(() => {
42
+ if (theConfig?.theming?.themes) {
43
+ Promise.all(theConfig.theming.themes?.map((bundle) => {
44
+ return themes[bundle] ?? import(
45
+ /* @vite-ignore */
46
+ bundle
47
+ ).then((module) => module.default).catch((e) => {
48
+ console.error(`Import of theme bundle ${bundle} failed! ${e}`);
49
+ });
50
+ })).then((loadedThemes) => {
51
+ setThemes(loadedThemes.filter((theme) => !!theme));
52
+ }).catch((e) => {
53
+ console.error(`Import of themes failed! ${e}`);
54
+ });
55
+ }
56
+ }, [theConfig?.theming?.themes]);
57
+ useEffect(() => {
58
+ if (theConfig?.providers) {
59
+ Promise.all(theConfig.providers.map((provider) => {
60
+ return import(
61
+ /* @vite-ignore */
62
+ provider.bundle
63
+ ).then((module) => module.default).catch((e) => {
64
+ console.error(`Import of provider '${provider.bundle}' failed! ${e}`);
65
+ });
66
+ })).then((loadedProviders) => setProviders(loadedProviders.filter((provider) => !!provider))).catch((e) => {
67
+ console.error(`Import of providers failed!`, e);
68
+ });
69
+ }
70
+ }, [theConfig?.providers]);
71
+ const runtimeContext = useMemo(() => ({
72
+ i18n
73
+ }), [i18n]);
74
+ const providersContext = useMemo(() => ({
75
+ providers
76
+ }), [providers]);
77
+ if (!theConfig || theConfig.theming?.themes && !themes$1 || theConfig.providers != null && providers === void 0) {
78
+ return null;
79
+ }
80
+ return /* @__PURE__ */ jsx(HvAppShellContext.Provider, { value: theConfig, children: /* @__PURE__ */ jsx(HvAppShellRuntimeContext.Provider, { value: runtimeContext, children: /* @__PURE__ */ jsx(HvProvider, { themes: themes$1, theme: theConfig.theming?.theme, colorMode: storedColorModeValue ?? theConfig.theming?.colorMode, children: /* @__PURE__ */ jsx(HvAppShellCombinedProvidersContext.Provider, { value: providersContext, children }) }) }) });
81
+ };
82
+ const AppShellProvider$1 = AppShellProvider;
58
83
  export {
59
- K as default
84
+ AppShellProvider$1 as default
60
85
  };
61
- //# sourceMappingURL=AppShellProvider.js.map
@@ -1,86 +1,95 @@
1
- import { jsx as e } from "@emotion/react/jsx-runtime";
2
- import { lazy as p } from "react";
3
- import { RouterProvider as b, createBrowserRouter as A, Outlet as s } from "react-router-dom";
4
- import { ErrorBoundary as d } from "react-error-boundary";
5
- import { HvContainer as c } from "@hitachivantara/uikit-react-core";
6
- import { useHvAppShellConfig as w, useHvAppShellCombinedProviders as E } from "@hitachivantara/app-shell-shared";
7
- import S from "../../pages/LoadingPage/LoadingPage.js";
8
- import { getAppIdFromBundle as f } from "../../lib/utils/navigationUtil.js";
9
- import W from "../../lib/utils/basePathUtils.js";
10
- import B from "../../pages/Root/Root.js";
11
- import m from "../../pages/GenericError/GenericError.js";
12
- import h from "../AppShellViewProvider/AppShellViewProvider.js";
13
- const k = p(() => import("../../pages/NotFound/index.js"));
14
- function g(r) {
15
- if (r)
16
- return r.map((o) => {
17
- const {
18
- bundle: t
19
- } = o, n = f(t), i = p(() => import(
20
- /* @vite-ignore */
21
- t
22
- ));
23
- return {
24
- path: o.route.replace(/^\//, ""),
25
- // "Component" used instead of "element" due to lazy loading
26
- Component: () => /* @__PURE__ */ e(h, { id: n, children: /* @__PURE__ */ e(d, { fallback: /* @__PURE__ */ e(m, { fullPage: !1 }), children: /* @__PURE__ */ e(i, { ...o.config, children: o.views != null ? /* @__PURE__ */ e(s, {}) : null }) }, o.route) }),
27
- children: g(o.views)
28
- };
29
- });
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { lazy } from "react";
3
+ import { RouterProvider, createBrowserRouter, Outlet } from "react-router-dom";
4
+ import { ErrorBoundary } from "react-error-boundary";
5
+ import { HvContainer } from "@hitachivantara/uikit-react-core";
6
+ import { useHvAppShellConfig, useHvAppShellCombinedProviders } from "@hitachivantara/app-shell-shared";
7
+ import LoadingPage from "../../pages/LoadingPage/LoadingPage.js";
8
+ import { getAppIdFromBundle } from "../../lib/utils/navigationUtil.js";
9
+ import getBasePath from "../../lib/utils/basePathUtils.js";
10
+ import RootRoute from "../../pages/Root/Root.js";
11
+ import GenericError from "../../pages/GenericError/GenericError.js";
12
+ import AppShellViewProvider from "../AppShellViewProvider/AppShellViewProvider.js";
13
+ const NotFound = lazy(() => import("../../pages/NotFound/index.js"));
14
+ function renderNestedRoutes(views) {
15
+ if (!views) {
16
+ return void 0;
17
+ }
18
+ return views.map((view) => {
19
+ const {
20
+ bundle
21
+ } = view;
22
+ const appId = getAppIdFromBundle(bundle);
23
+ const RouteComponent = lazy(() => import(
24
+ /* @vite-ignore */
25
+ bundle
26
+ ));
27
+ const path = view.route.replace(/^\//, "");
28
+ return {
29
+ path,
30
+ // "Component" used instead of "element" due to lazy loading
31
+ Component: () => /* @__PURE__ */ jsx(AppShellViewProvider, { id: appId, children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(GenericError, { fullPage: false }), children: /* @__PURE__ */ jsx(RouteComponent, { ...view.config, children: view.views != null ? /* @__PURE__ */ jsx(Outlet, {}) : null }) }, view.route) }),
32
+ children: renderNestedRoutes(view.views)
33
+ };
34
+ });
30
35
  }
31
- function H(r) {
32
- if (r == null || r.views == null)
36
+ function renderRoutes(mainPanel) {
37
+ if (mainPanel == null || mainPanel.views == null) {
33
38
  return [];
39
+ }
34
40
  const {
35
- views: o,
36
- maxWidth: t = "xl",
37
- ...n
38
- } = r;
39
- return o.map((i) => {
41
+ views,
42
+ maxWidth = "xl",
43
+ ...mainContainerProps
44
+ } = mainPanel;
45
+ return views.map((view) => {
40
46
  const {
41
- bundle: l,
42
- route: u,
43
- config: P,
44
- views: a,
45
- maxWidth: R,
46
- ...v
47
- } = i, C = f(l), x = p(() => import(
47
+ bundle,
48
+ route,
49
+ config,
50
+ views: nestedViews,
51
+ maxWidth: viewMaxWidth,
52
+ ...viewContainerProps
53
+ } = view;
54
+ const appId = getAppIdFromBundle(bundle);
55
+ const RouteComponent = lazy(() => import(
48
56
  /* @vite-ignore */
49
- l
57
+ bundle
50
58
  ));
51
59
  return {
52
- path: u,
60
+ path: route,
53
61
  // "Component" used instead of "element" due to lazy loading
54
- Component: () => /* @__PURE__ */ e(c, { maxWidth: R ?? t, ...n, ...v, children: /* @__PURE__ */ e(h, { id: C, children: /* @__PURE__ */ e(d, { fallback: /* @__PURE__ */ e(m, { fullPage: !1 }), children: /* @__PURE__ */ e(x, { ...P, children: a != null ? /* @__PURE__ */ e(s, {}) : null }) }, u) }) }),
55
- children: g(a)
62
+ Component: () => /* @__PURE__ */ jsx(HvContainer, { maxWidth: viewMaxWidth ?? maxWidth, ...mainContainerProps, ...viewContainerProps, children: /* @__PURE__ */ jsx(AppShellViewProvider, { id: appId, children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(GenericError, { fullPage: false }), children: /* @__PURE__ */ jsx(RouteComponent, { ...config, children: nestedViews != null ? /* @__PURE__ */ jsx(Outlet, {}) : null }) }, route) }) }),
63
+ children: renderNestedRoutes(nestedViews)
56
64
  };
57
65
  });
58
66
  }
59
- function I(r) {
67
+ function renderErrorRoutes(mainPanel) {
60
68
  const {
61
- views: o,
62
- maxWidth: t = "xl",
63
- ...n
64
- } = r ?? {};
69
+ views,
70
+ maxWidth = "xl",
71
+ ...mainContainerProps
72
+ } = mainPanel ?? {};
65
73
  return [{
66
74
  path: "*",
67
- element: /* @__PURE__ */ e(c, { maxWidth: t, ...n, children: /* @__PURE__ */ e(k, {}) })
75
+ element: /* @__PURE__ */ jsx(HvContainer, { maxWidth, ...mainContainerProps, children: /* @__PURE__ */ jsx(NotFound, {}) })
68
76
  }];
69
77
  }
70
- const y = () => {
71
- const r = w(), {
72
- providers: o
73
- } = E();
74
- return /* @__PURE__ */ e(b, { fallbackElement: /* @__PURE__ */ e(S, {}), router: A([{
75
- element: /* @__PURE__ */ e(B, { providers: o }),
78
+ const AppShellRoutes = () => {
79
+ const config = useHvAppShellConfig();
80
+ const {
81
+ providers
82
+ } = useHvAppShellCombinedProviders();
83
+ return /* @__PURE__ */ jsx(RouterProvider, { fallbackElement: /* @__PURE__ */ jsx(LoadingPage, {}), router: createBrowserRouter([{
84
+ element: /* @__PURE__ */ jsx(RootRoute, { providers }),
76
85
  // All routes live inside `RootRoute`
77
- errorElement: /* @__PURE__ */ e(m, { fullPage: !0 }),
78
- children: [...H(r.mainPanel), ...I(r.mainPanel)]
86
+ errorElement: /* @__PURE__ */ jsx(GenericError, { fullPage: true }),
87
+ children: [...renderRoutes(config.mainPanel), ...renderErrorRoutes(config.mainPanel)]
79
88
  }], {
80
- basename: W(r)
89
+ basename: getBasePath(config)
81
90
  }) });
82
- }, J = y;
91
+ };
92
+ const AppShellRoutes$1 = AppShellRoutes;
83
93
  export {
84
- J as default
94
+ AppShellRoutes$1 as default
85
95
  };
86
- //# sourceMappingURL=AppShellRoutes.js.map
@@ -1,16 +1,16 @@
1
- import { jsx as t } from "@emotion/react/jsx-runtime";
2
- import { useMemo as p } from "react";
3
- import { HvAppShellViewContext as i } from "@hitachivantara/app-shell-shared";
4
- const l = ({
5
- children: o,
6
- id: e
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { HvAppShellViewContext } from "@hitachivantara/app-shell-shared";
4
+ const AppShellViewProvider = ({
5
+ children,
6
+ id
7
7
  }) => {
8
- const r = p(() => ({
9
- id: e
10
- }), [e]);
11
- return /* @__PURE__ */ t(i.Provider, { value: r, children: o });
12
- }, v = l;
8
+ const value = useMemo(() => ({
9
+ id
10
+ }), [id]);
11
+ return /* @__PURE__ */ jsx(HvAppShellViewContext.Provider, { value, children });
12
+ };
13
+ const AppShellViewProvider$1 = AppShellViewProvider;
13
14
  export {
14
- v as default
15
+ AppShellViewProvider$1 as default
15
16
  };
16
- //# sourceMappingURL=AppShellViewProvider.js.map
@@ -1,7 +1,11 @@
1
- import t from "../../lib/hooks/useClearLocationState.js";
2
- import o from "../../lib/hooks/useCustomEventListener.js";
3
- const e = () => (o(), t(), null), i = e;
1
+ import useClearLocationState from "../../lib/hooks/useClearLocationState.js";
2
+ import useCustomEventListener from "../../lib/hooks/useCustomEventListener.js";
3
+ const CustomHooksInitializer = () => {
4
+ useCustomEventListener();
5
+ useClearLocationState();
6
+ return null;
7
+ };
8
+ const CustomHooksInitializer$1 = CustomHooksInitializer;
4
9
  export {
5
- i as default
10
+ CustomHooksInitializer$1 as default
6
11
  };
7
- //# sourceMappingURL=CustomHooksInitializer.js.map
@@ -1,19 +1,19 @@
1
- import { jsx as b } from "@emotion/react/jsx-runtime";
2
- import { Global as l } from "@emotion/react";
3
- function s() {
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { Global } from "@emotion/react";
3
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() {
4
4
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
5
5
  }
6
- var c = process.env.NODE_ENV === "production" ? {
6
+ var _ref = process.env.NODE_ENV === "production" ? {
7
7
  name: "1ay3zcm",
8
8
  styles: "html,body{height:unset;}"
9
9
  } : {
10
10
  name: "1xkfqfu-GlobalStyles",
11
11
  styles: "html,body{height:unset;};label:GlobalStyles;",
12
12
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL0dsb2JhbFN0eWxlcy9HbG9iYWxTdHlsZXMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVVlIiwiZmlsZSI6Ii9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL0dsb2JhbFN0eWxlcy9HbG9iYWxTdHlsZXMudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgR2xvYmFsLCBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcblxuLyoqXG4gKiBUaGlzIGNvbXBvbmVudCBjYW4gYmUgdXNlZCB0byBzZXQgfCBhZGQgfCBtb2RpZnkgZ2xvYmFsIGNzcy4gSXQgY2FuIGFsc28gb3ZlcnJpZGUgcHJvcGVydGllcyBkZWZpbmVkIGluIFVJLUtJVC5cbiAqXG4gKiBXZSBuZWVkIHRvIGhhdmUgdGhpcyBjb21wb25lbnQgYmVjYXVzZSB0aGUgVUktS0lUIGlzIGZvcmNpbmcgdGhlIGhlaWdodCB0byAxMDAlIGFuZCB0aGlzIGNhdXNlZCBBcHAgU2hlbGwgdG8gc2hvd1xuICogYSB2ZXJ0aWNhbCBzY3JvbGwgYmFyIHdoZW4gaXQgc2hvdWxkbid0IGR1ZSB0byB0aGUgaGVhZGVyIGhlaWdodC5cbiAqL1xuY29uc3QgR2xvYmFsU3R5bGVzID0gKCkgPT4gKFxuICA8R2xvYmFsXG4gICAgc3R5bGVzPXtjc3NgXG4gICAgICBodG1sLFxuICAgICAgYm9keSB7XG4gICAgICAgIGhlaWdodDogdW5zZXQ7XG4gICAgICB9XG4gICAgYH1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IEdsb2JhbFN0eWxlcztcbiJdfQ== */",
13
- toString: s
13
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
14
14
  };
15
- const G = () => /* @__PURE__ */ b(l, { styles: c }), o = G;
15
+ const GlobalStyles = () => /* @__PURE__ */ jsx(Global, { styles: _ref });
16
+ const GlobalStyles$1 = GlobalStyles;
16
17
  export {
17
- o as default
18
+ GlobalStyles$1 as default
18
19
  };
19
- //# sourceMappingURL=GlobalStyles.js.map
@@ -1,5 +1,4 @@
1
- import o from "./GlobalStyles.js";
1
+ import GlobalStyles from "./GlobalStyles.js";
2
2
  export {
3
- o as default
3
+ GlobalStyles as default
4
4
  };
5
- //# sourceMappingURL=index.js.map
@@ -1,10 +1,12 @@
1
- import { jsx as r } from "@emotion/react/jsx-runtime";
2
- import { HvIconSprite as s } from "@hitachivantara/uikit-react-icons";
3
- var i, o;
4
- const e = (o = (i = import.meta).resolve) == null ? void 0 : o.call(i, "@hv/uikit-icons/icons.svg"), n = ({
5
- name: t
6
- }) => /* @__PURE__ */ r(s, { spriteUrl: e, iconName: t }), p = n;
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { HvIconSprite } from "@hitachivantara/uikit-react-icons";
3
+ const spriteUri = import.meta.resolve?.("@hv/uikit-icons/icons.svg");
4
+ const IconUiKit = ({
5
+ name
6
+ }) => {
7
+ return /* @__PURE__ */ jsx(HvIconSprite, { spriteUrl: spriteUri, iconName: name });
8
+ };
9
+ const IconUiKit$1 = IconUiKit;
7
10
  export {
8
- p as default
11
+ IconUiKit$1 as default
9
12
  };
10
- //# sourceMappingURL=IconUiKit.js.map
@@ -1,7 +1,6 @@
1
- import o from "react";
2
- import t from "./IconUiKit.js";
3
- const r = o.memo(t);
1
+ import React from "react";
2
+ import IconUiKit$1 from "./IconUiKit.js";
3
+ const IconUiKit = React.memo(IconUiKit$1);
4
4
  export {
5
- r as default
5
+ IconUiKit as default
6
6
  };
7
- //# sourceMappingURL=index.js.map
@@ -1,15 +1,22 @@
1
- import { jsx as e } from "@emotion/react/jsx-runtime";
2
- import { createPortal as m } from "react-dom";
3
- import { ClickAwayListener as s } from "@mui/material";
4
- import c from "../../lib/utils/documentUtil.js";
5
- const u = (t) => {
6
- const a = t.displayName ?? t.name, l = c(), i = ({
7
- onClickAway: r,
8
- ...n
9
- }) => r ? m(/* @__PURE__ */ e(s, { onClickAway: r, children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(t, { ...n }) }) }), l) : /* @__PURE__ */ e(t, { ...n });
10
- return i.displayName = `withClickAwayListener(${a})`, i;
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { createPortal } from "react-dom";
3
+ import { ClickAwayListener } from "@mui/material";
4
+ import createAppContainerElement from "../../lib/utils/documentUtil.js";
5
+ const withClickAwayListener = (WrappedComponent) => {
6
+ const displayName = WrappedComponent.displayName ?? WrappedComponent.name;
7
+ const panelContainerElement = createAppContainerElement();
8
+ const ComponentWithClickAwayListener = ({
9
+ onClickAway,
10
+ ...wrappedProps
11
+ }) => {
12
+ if (onClickAway) {
13
+ return createPortal(/* @__PURE__ */ jsx(ClickAwayListener, { onClickAway, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(WrappedComponent, { ...wrappedProps }) }) }), panelContainerElement);
14
+ }
15
+ return /* @__PURE__ */ jsx(WrappedComponent, { ...wrappedProps });
16
+ };
17
+ ComponentWithClickAwayListener.displayName = `withClickAwayListener(${displayName})`;
18
+ return ComponentWithClickAwayListener;
11
19
  };
12
20
  export {
13
- u as default
21
+ withClickAwayListener as default
14
22
  };
15
- //# sourceMappingURL=withClickAwayListener.js.map
@@ -1,28 +1,33 @@
1
- import { jsx as I, jsxs as m } from "@emotion/react/jsx-runtime";
2
- import { css as i } from "@emotion/css";
3
- import { I18nextProvider as G } from "react-i18next";
4
- import { HelmetProvider as A } from "react-helmet-async";
5
- import { theme as X, HvProvider as d, HvSnackbarProvider as t } from "@hitachivantara/uikit-react-core";
6
- import { ErrorBoundary as Z } from "react-error-boundary";
7
- import o from "../GlobalStyles/GlobalStyles.js";
8
- import B from "../AppShellProvider/AppShellProvider.js";
9
- import e from "../../lib/i18n/index.js";
10
- import r from "../../providers/LayoutProvider.js";
11
- import V from "../../pages/GenericError/GenericError.js";
12
- const h = {
13
- containerRoot: /* @__PURE__ */ i("margin-top:", X.header.height, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:containerRoot;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2hvYy93aXRoR2xvYmFsUHJvdmlkZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdCb0IiLCJmaWxlIjoiL19fdy9odi1hcHAtc2hlbGwvaHYtYXBwLXNoZWxsL2NsaWVudC9wYWNrYWdlcy9hcHAtc2hlbGwtdWkvc3JjL2NvbXBvbmVudHMvaG9jL3dpdGhHbG9iYWxQcm92aWRlci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vY3NzXCI7XG5pbXBvcnQgeyBJMThuZXh0UHJvdmlkZXIgfSBmcm9tIFwicmVhY3QtaTE4bmV4dFwiO1xuaW1wb3J0IHsgSGVsbWV0UHJvdmlkZXIgfSBmcm9tIFwicmVhY3QtaGVsbWV0LWFzeW5jXCI7XG5cbmltcG9ydCB7XG4gIEh2UHJvdmlkZXIsXG4gIEh2U25hY2tiYXJQcm92aWRlcixcbiAgdGhlbWVcbn0gZnJvbSBcIkBoaXRhY2hpdmFudGFyYS91aWtpdC1yZWFjdC1jb3JlXCI7XG5cbmltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7IEVycm9yQm91bmRhcnkgfSBmcm9tIFwicmVhY3QtZXJyb3ItYm91bmRhcnlcIjtcblxuaW1wb3J0IEdsb2JhbFN0eWxlcyBmcm9tIFwiLi4vR2xvYmFsU3R5bGVzXCI7XG5pbXBvcnQgQXBwU2hlbGxQcm92aWRlciBmcm9tIFwiLi4vQXBwU2hlbGxQcm92aWRlci9BcHBTaGVsbFByb3ZpZGVyXCI7XG5pbXBvcnQgY3JlYXRlSTE4TmV4dCBmcm9tIFwiLi4vLi4vbGliL2kxOG5cIjtcbmltcG9ydCBMYXlvdXRQcm92aWRlciBmcm9tIFwiLi4vLi4vcHJvdmlkZXJzL0xheW91dFByb3ZpZGVyXCI7XG5pbXBvcnQgR2VuZXJpY0Vycm9yIGZyb20gXCIuLi8uLi9wYWdlcy9HZW5lcmljRXJyb3JcIjtcblxudHlwZSBXcmFwcGVkQ29tcG9uZW50UHJvcHM8VCBleHRlbmRzIFJlYWN0LkVsZW1lbnRUeXBlPiA9IFJlYWN0LkNvbXBvbmVudFR5cGU8XG4gIFJlYWN0LkNvbXBvbmVudFByb3BzPFQ+XG4+O1xuXG5jb25zdCBzbmFja2JhckNsYXNzZXMgPSB7XG4gIGNvbnRhaW5lclJvb3Q6IGNzc2BcbiAgICBtYXJnaW4tdG9wOiAke3RoZW1lLmhlYWRlci5oZWlnaHR9O1xuICBgXG59O1xuXG5jb25zdCB3aXRoR2xvYmFsUHJvdmlkZXIgPSA8VCBleHRlbmRzIFJlYWN0LkVsZW1lbnRUeXBlPihcbiAgV3JhcHBlZENvbXBvbmVudDogV3JhcHBlZENvbXBvbmVudFByb3BzPFQ+XG4pID0+IHtcbiAgY29uc3QgZGlzcGxheU5hbWUgPSBXcmFwcGVkQ29tcG9uZW50LmRpc3BsYXlOYW1lID8/IFdyYXBwZWRDb21wb25lbnQubmFtZTtcblxuICBjb25zdCB7IGkxOG4gfSA9IGNyZWF0ZUkxOE5leHQoKTtcblxuICBjb25zdCBDb21wb25lbnRXaXRoR2xvYmFsUHJvdmlkZXIgPSAoe1xuICAgIC4uLndyYXBwZWRQcm9wc1xuICB9OiBSZWFjdC5Db21wb25lbnRQcm9wczxUPikgPT4ge1xuICAgIHJldHVybiAoXG4gICAgICA8SGVsbWV0UHJvdmlkZXI+XG4gICAgICAgIDxIdlByb3ZpZGVyPlxuICAgICAgICAgIDxHbG9iYWxTdHlsZXMgLz5cbiAgICAgICAgICA8STE4bmV4dFByb3ZpZGVyIGkxOG49e2kxOG59PlxuICAgICAgICAgICAgPEVycm9yQm91bmRhcnlcbiAgICAgICAgICAgICAga2V5PVwiZ2VuZXJhbFwiXG4gICAgICAgICAgICAgIGZhbGxiYWNrPXs8R2VuZXJpY0Vycm9yIGZ1bGxQYWdlIGluY2x1ZGVGb290ZXI9e2ZhbHNlfSAvPn0+XG4gICAgICAgICAgICAgIDxBcHBTaGVsbFByb3ZpZGVyXG4gICAgICAgICAgICAgICAgY29uZmlnPXt3cmFwcGVkUHJvcHMuY29uZmlnfVxuICAgICAgICAgICAgICAgIGNvbmZpZ1VybD17d3JhcHBlZFByb3BzLmNvbmZpZ1VybH0+XG4gICAgICAgICAgICAgICAgPExheW91dFByb3ZpZGVyPlxuICAgICAgICAgICAgICAgICAgPEh2U25hY2tiYXJQcm92aWRlclxuICAgICAgICAgICAgICAgICAgICBub3Rpc3RhY2tDbGFzc2VzT3ZlcnJpZGU9e3NuYWNrYmFyQ2xhc3Nlc30+XG4gICAgICAgICAgICAgICAgICAgIDxXcmFwcGVkQ29tcG9uZW50IHsuLi53cmFwcGVkUHJvcHN9IC8+XG4gICAgICAgICAgICAgICAgICA8L0h2U25hY2tiYXJQcm92aWRlcj5cbiAgICAgICAgICAgICAgICA8L0xheW91dFByb3ZpZGVyPlxuICAgICAgICAgICAgICA8L0FwcFNoZWxsUHJvdmlkZXI+XG4gICAgICAgICAgICA8L0Vycm9yQm91bmRhcnk+XG4gICAgICAgICAgPC9JMThuZXh0UHJvdmlkZXI+XG4gICAgICAgIDwvSHZQcm92aWRlcj5cbiAgICAgIDwvSGVsbWV0UHJvdmlkZXI+XG4gICAgKTtcbiAgfTtcblxuICBDb21wb25lbnRXaXRoR2xvYmFsUHJvdmlkZXIuZGlzcGxheU5hbWUgPSBgd2l0aEdsb2JhbFByb3ZpZGVyKCR7ZGlzcGxheU5hbWV9KWA7XG5cbiAgcmV0dXJuIENvbXBvbmVudFdpdGhHbG9iYWxQcm92aWRlcjtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IHdpdGhHbG9iYWxQcm92aWRlcjtcbiJdfQ== */")
14
- }, R = (c) => {
15
- const l = c.displayName ?? c.name, {
16
- i18n: C
17
- } = e(), g = ({
18
- ...b
19
- }) => /* @__PURE__ */ I(A, { children: /* @__PURE__ */ m(d, { children: [
20
- /* @__PURE__ */ I(o, {}),
21
- /* @__PURE__ */ I(G, { i18n: C, children: /* @__PURE__ */ I(Z, { fallback: /* @__PURE__ */ I(V, { fullPage: !0, includeFooter: !1 }), children: /* @__PURE__ */ I(B, { config: b.config, configUrl: b.configUrl, children: /* @__PURE__ */ I(r, { children: /* @__PURE__ */ I(t, { notistackClassesOverride: h, children: /* @__PURE__ */ I(c, { ...b }) }) }) }) }, "general") })
22
- ] }) });
23
- return g.displayName = `withGlobalProvider(${l})`, g;
1
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
2
+ import { css } from "@emotion/css";
3
+ import { I18nextProvider } from "react-i18next";
4
+ import { HelmetProvider } from "react-helmet-async";
5
+ import { theme, HvProvider, HvSnackbarProvider } from "@hitachivantara/uikit-react-core";
6
+ import { ErrorBoundary } from "react-error-boundary";
7
+ import GlobalStyles from "../GlobalStyles/GlobalStyles.js";
8
+ import AppShellProvider from "../AppShellProvider/AppShellProvider.js";
9
+ import createI18Next from "../../lib/i18n/index.js";
10
+ import LayoutProvider from "../../providers/LayoutProvider.js";
11
+ import GenericError from "../../pages/GenericError/GenericError.js";
12
+ const snackbarClasses = {
13
+ containerRoot: /* @__PURE__ */ css("margin-top:", theme.header.height, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:containerRoot;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2hvYy93aXRoR2xvYmFsUHJvdmlkZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdCb0IiLCJmaWxlIjoiL19fdy9odi1hcHAtc2hlbGwvaHYtYXBwLXNoZWxsL2NsaWVudC9wYWNrYWdlcy9hcHAtc2hlbGwtdWkvc3JjL2NvbXBvbmVudHMvaG9jL3dpdGhHbG9iYWxQcm92aWRlci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vY3NzXCI7XG5pbXBvcnQgeyBJMThuZXh0UHJvdmlkZXIgfSBmcm9tIFwicmVhY3QtaTE4bmV4dFwiO1xuaW1wb3J0IHsgSGVsbWV0UHJvdmlkZXIgfSBmcm9tIFwicmVhY3QtaGVsbWV0LWFzeW5jXCI7XG5cbmltcG9ydCB7XG4gIEh2UHJvdmlkZXIsXG4gIEh2U25hY2tiYXJQcm92aWRlcixcbiAgdGhlbWVcbn0gZnJvbSBcIkBoaXRhY2hpdmFudGFyYS91aWtpdC1yZWFjdC1jb3JlXCI7XG5cbmltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7IEVycm9yQm91bmRhcnkgfSBmcm9tIFwicmVhY3QtZXJyb3ItYm91bmRhcnlcIjtcblxuaW1wb3J0IEdsb2JhbFN0eWxlcyBmcm9tIFwiLi4vR2xvYmFsU3R5bGVzXCI7XG5pbXBvcnQgQXBwU2hlbGxQcm92aWRlciBmcm9tIFwiLi4vQXBwU2hlbGxQcm92aWRlci9BcHBTaGVsbFByb3ZpZGVyXCI7XG5pbXBvcnQgY3JlYXRlSTE4TmV4dCBmcm9tIFwiLi4vLi4vbGliL2kxOG5cIjtcbmltcG9ydCBMYXlvdXRQcm92aWRlciBmcm9tIFwiLi4vLi4vcHJvdmlkZXJzL0xheW91dFByb3ZpZGVyXCI7XG5pbXBvcnQgR2VuZXJpY0Vycm9yIGZyb20gXCIuLi8uLi9wYWdlcy9HZW5lcmljRXJyb3JcIjtcblxudHlwZSBXcmFwcGVkQ29tcG9uZW50UHJvcHM8VCBleHRlbmRzIFJlYWN0LkVsZW1lbnRUeXBlPiA9IFJlYWN0LkNvbXBvbmVudFR5cGU8XG4gIFJlYWN0LkNvbXBvbmVudFByb3BzPFQ+XG4+O1xuXG5jb25zdCBzbmFja2JhckNsYXNzZXMgPSB7XG4gIGNvbnRhaW5lclJvb3Q6IGNzc2BcbiAgICBtYXJnaW4tdG9wOiAke3RoZW1lLmhlYWRlci5oZWlnaHR9O1xuICBgXG59O1xuXG5jb25zdCB3aXRoR2xvYmFsUHJvdmlkZXIgPSA8VCBleHRlbmRzIFJlYWN0LkVsZW1lbnRUeXBlPihcbiAgV3JhcHBlZENvbXBvbmVudDogV3JhcHBlZENvbXBvbmVudFByb3BzPFQ+XG4pID0+IHtcbiAgY29uc3QgZGlzcGxheU5hbWUgPSBXcmFwcGVkQ29tcG9uZW50LmRpc3BsYXlOYW1lID8/IFdyYXBwZWRDb21wb25lbnQubmFtZTtcblxuICBjb25zdCB7IGkxOG4gfSA9IGNyZWF0ZUkxOE5leHQoKTtcblxuICBjb25zdCBDb21wb25lbnRXaXRoR2xvYmFsUHJvdmlkZXIgPSAoe1xuICAgIC4uLndyYXBwZWRQcm9wc1xuICB9OiBSZWFjdC5Db21wb25lbnRQcm9wczxUPikgPT4ge1xuICAgIHJldHVybiAoXG4gICAgICA8SGVsbWV0UHJvdmlkZXI+XG4gICAgICAgIDxIdlByb3ZpZGVyPlxuICAgICAgICAgIDxHbG9iYWxTdHlsZXMgLz5cbiAgICAgICAgICA8STE4bmV4dFByb3ZpZGVyIGkxOG49e2kxOG59PlxuICAgICAgICAgICAgPEVycm9yQm91bmRhcnlcbiAgICAgICAgICAgICAga2V5PVwiZ2VuZXJhbFwiXG4gICAgICAgICAgICAgIGZhbGxiYWNrPXs8R2VuZXJpY0Vycm9yIGZ1bGxQYWdlIGluY2x1ZGVGb290ZXI9e2ZhbHNlfSAvPn0+XG4gICAgICAgICAgICAgIDxBcHBTaGVsbFByb3ZpZGVyXG4gICAgICAgICAgICAgICAgY29uZmlnPXt3cmFwcGVkUHJvcHMuY29uZmlnfVxuICAgICAgICAgICAgICAgIGNvbmZpZ1VybD17d3JhcHBlZFByb3BzLmNvbmZpZ1VybH0+XG4gICAgICAgICAgICAgICAgPExheW91dFByb3ZpZGVyPlxuICAgICAgICAgICAgICAgICAgPEh2U25hY2tiYXJQcm92aWRlclxuICAgICAgICAgICAgICAgICAgICBub3Rpc3RhY2tDbGFzc2VzT3ZlcnJpZGU9e3NuYWNrYmFyQ2xhc3Nlc30+XG4gICAgICAgICAgICAgICAgICAgIDxXcmFwcGVkQ29tcG9uZW50IHsuLi53cmFwcGVkUHJvcHN9IC8+XG4gICAgICAgICAgICAgICAgICA8L0h2U25hY2tiYXJQcm92aWRlcj5cbiAgICAgICAgICAgICAgICA8L0xheW91dFByb3ZpZGVyPlxuICAgICAgICAgICAgICA8L0FwcFNoZWxsUHJvdmlkZXI+XG4gICAgICAgICAgICA8L0Vycm9yQm91bmRhcnk+XG4gICAgICAgICAgPC9JMThuZXh0UHJvdmlkZXI+XG4gICAgICAgIDwvSHZQcm92aWRlcj5cbiAgICAgIDwvSGVsbWV0UHJvdmlkZXI+XG4gICAgKTtcbiAgfTtcblxuICBDb21wb25lbnRXaXRoR2xvYmFsUHJvdmlkZXIuZGlzcGxheU5hbWUgPSBgd2l0aEdsb2JhbFByb3ZpZGVyKCR7ZGlzcGxheU5hbWV9KWA7XG5cbiAgcmV0dXJuIENvbXBvbmVudFdpdGhHbG9iYWxQcm92aWRlcjtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IHdpdGhHbG9iYWxQcm92aWRlcjtcbiJdfQ== */")
14
+ };
15
+ const withGlobalProvider = (WrappedComponent) => {
16
+ const displayName = WrappedComponent.displayName ?? WrappedComponent.name;
17
+ const {
18
+ i18n
19
+ } = createI18Next();
20
+ const ComponentWithGlobalProvider = ({
21
+ ...wrappedProps
22
+ }) => {
23
+ return /* @__PURE__ */ jsx(HelmetProvider, { children: /* @__PURE__ */ jsxs(HvProvider, { children: [
24
+ /* @__PURE__ */ jsx(GlobalStyles, {}),
25
+ /* @__PURE__ */ jsx(I18nextProvider, { i18n, children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(GenericError, { fullPage: true, includeFooter: false }), children: /* @__PURE__ */ jsx(AppShellProvider, { config: wrappedProps.config, configUrl: wrappedProps.configUrl, children: /* @__PURE__ */ jsx(LayoutProvider, { children: /* @__PURE__ */ jsx(HvSnackbarProvider, { notistackClassesOverride: snackbarClasses, children: /* @__PURE__ */ jsx(WrappedComponent, { ...wrappedProps }) }) }) }) }, "general") })
26
+ ] }) });
27
+ };
28
+ ComponentWithGlobalProvider.displayName = `withGlobalProvider(${displayName})`;
29
+ return ComponentWithGlobalProvider;
24
30
  };
25
31
  export {
26
- R as default
32
+ withGlobalProvider as default
27
33
  };
28
- //# sourceMappingURL=withGlobalProvider.js.map
@@ -1,21 +1,31 @@
1
- import { jsx as t } from "@emotion/react/jsx-runtime";
2
- import { CONFIG_TRANSLATIONS_NAMESPACE as m } from "@hitachivantara/app-shell-shared";
3
- import { useTranslation as e } from "react-i18next";
4
- import i from "./Logos/Hitachi.js";
5
- import a from "./Logos/Lumada.js";
6
- import f from "./Logos/Pentaho.js";
7
- const s = ({
8
- logo: r
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { CONFIG_TRANSLATIONS_NAMESPACE } from "@hitachivantara/app-shell-shared";
3
+ import { useTranslation } from "react-i18next";
4
+ import Hitachi from "./Logos/Hitachi.js";
5
+ import Lumada from "./Logos/Lumada.js";
6
+ import Pentaho from "./Logos/Pentaho.js";
7
+ const BrandLogo = ({
8
+ logo
9
9
  }) => {
10
10
  const {
11
- t: o
12
- } = e(m);
13
- if (!r)
14
- return r === null ? null : /* @__PURE__ */ t(i, {});
15
- const n = r.description != null ? o(r.description) : void 0;
16
- return r.name === "LUMADA" ? /* @__PURE__ */ t(a, { description: n }) : r.name === "PENTAHO+" ? /* @__PURE__ */ t(f, { description: n }) : /* @__PURE__ */ t(i, { description: n });
17
- }, N = s;
11
+ t: tConfig
12
+ } = useTranslation(CONFIG_TRANSLATIONS_NAMESPACE);
13
+ if (!logo) {
14
+ if (logo === null) {
15
+ return null;
16
+ }
17
+ return /* @__PURE__ */ jsx(Hitachi, {});
18
+ }
19
+ const description = logo.description != null ? tConfig(logo.description) : void 0;
20
+ if (logo.name === "LUMADA") {
21
+ return /* @__PURE__ */ jsx(Lumada, { description });
22
+ }
23
+ if (logo.name === "PENTAHO+") {
24
+ return /* @__PURE__ */ jsx(Pentaho, { description });
25
+ }
26
+ return /* @__PURE__ */ jsx(Hitachi, { description });
27
+ };
28
+ const BrandLogo$1 = BrandLogo;
18
29
  export {
19
- N as default
30
+ BrandLogo$1 as default
20
31
  };
21
- //# sourceMappingURL=BrandLogo.js.map