@hitachivantara/app-shell-ui 1.4.3 → 1.5.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/dist/esm/components/AppShell/AppShell.js +5 -10
- package/dist/esm/components/AppShell/AppShell.js.map +1 -1
- package/dist/esm/components/AppShellProvider/AppShellProvider.js +33 -34
- package/dist/esm/components/AppShellProvider/AppShellProvider.js.map +1 -1
- package/dist/esm/components/AppShellRoutes/AppShellRoutes.js +64 -44
- package/dist/esm/components/AppShellRoutes/AppShellRoutes.js.map +1 -1
- package/dist/esm/components/hoc/withGlobalProvider.js +23 -29
- package/dist/esm/components/hoc/withGlobalProvider.js.map +1 -1
- package/dist/esm/pages/Root/Root.js +25 -0
- package/dist/esm/pages/Root/Root.js.map +1 -0
- package/package.json +4 -4
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import p from "../
|
|
4
|
-
|
|
5
|
-
import m from "../AppShellRoutes/AppShellRoutes.js";
|
|
6
|
-
const i = () => /* @__PURE__ */ o(e, { children: [
|
|
7
|
-
/* @__PURE__ */ r(p, {}),
|
|
8
|
-
/* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(m, {}) })
|
|
9
|
-
] }), d = t(i);
|
|
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);
|
|
10
5
|
export {
|
|
11
|
-
|
|
6
|
+
i as default
|
|
12
7
|
};
|
|
13
8
|
//# sourceMappingURL=AppShell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.js","sources":["../../../../src/components/AppShell/AppShell.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"AppShell.js","sources":["../../../../src/components/AppShell/AppShell.tsx"],"sourcesContent":["import withGlobalProvider from \"../hoc/withGlobalProvider\";\nimport AppShellRoutes from \"../AppShellRoutes\";\n\nconst AppShell = () => {\n return <AppShellRoutes />;\n};\n\nexport default withGlobalProvider(AppShell);\n"],"names":["AppShell","AppShellRoutes","withGlobalProvider"],"mappings":";;;AAGA,MAAMA,IAAWA,wBACPC,GAAiB,CAAA,CAAA,GAGZC,IAAAA,EAAmBF,CAAQ;"}
|
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { HvAppShellContext as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
children: x,
|
|
13
|
-
config: m,
|
|
14
|
-
configUrl: n
|
|
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
|
|
15
12
|
}) => {
|
|
16
|
-
var
|
|
13
|
+
var f, P, x, S;
|
|
17
14
|
const {
|
|
18
15
|
i18n: l
|
|
19
|
-
} =
|
|
20
|
-
value:
|
|
21
|
-
} =
|
|
22
|
-
|
|
23
|
-
!
|
|
24
|
-
console.error(`It was not possible to obtain the context from: ${
|
|
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);
|
|
25
22
|
});
|
|
26
|
-
}, [
|
|
27
|
-
const e =
|
|
23
|
+
}, [n, i]);
|
|
24
|
+
const e = h(() => n ?? c, [n, c]);
|
|
28
25
|
if ($)
|
|
29
26
|
throw Error("It was not possible to obtain the configuration");
|
|
30
|
-
e != null && e.translations &&
|
|
31
|
-
const [
|
|
32
|
-
|
|
27
|
+
e != null && e.translations && B(l, e.translations, T);
|
|
28
|
+
const [u, b] = d(void 0), [a, M] = d(void 0);
|
|
29
|
+
p(() => {
|
|
33
30
|
var r, o;
|
|
34
|
-
(r = e == null ? void 0 : e.theming) != null && r.themes && Promise.all((o = e.theming.themes) == null ? void 0 : o.map((t) =>
|
|
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(
|
|
35
32
|
/* @vite-ignore */
|
|
36
33
|
t
|
|
37
34
|
).then((s) => s.default).catch((s) => {
|
|
38
35
|
console.error(`Import of theme bundle ${t} failed! ${s}`);
|
|
39
36
|
}))).then((t) => {
|
|
40
|
-
|
|
37
|
+
b(t.filter((s) => !!s));
|
|
41
38
|
}).catch((t) => {
|
|
42
39
|
console.error(`Import of themes failed! ${t}`);
|
|
43
40
|
});
|
|
44
|
-
}, [(
|
|
41
|
+
}, [(f = e == null ? void 0 : e.theming) == null ? void 0 : f.themes]), p(() => {
|
|
45
42
|
e != null && e.providers && Promise.all(e.providers.map((r) => import(
|
|
46
43
|
/* @vite-ignore */
|
|
47
44
|
r.bundle
|
|
@@ -51,12 +48,14 @@ const V = ({
|
|
|
51
48
|
console.error("Import of providers failed!", r);
|
|
52
49
|
});
|
|
53
50
|
}, [e == null ? void 0 : e.providers]);
|
|
54
|
-
const
|
|
51
|
+
const H = h(() => ({
|
|
55
52
|
i18n: l
|
|
56
|
-
}), [l])
|
|
57
|
-
|
|
58
|
-
},
|
|
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;
|
|
59
58
|
export {
|
|
60
|
-
|
|
59
|
+
K as default
|
|
61
60
|
};
|
|
62
61
|
//# sourceMappingURL=AppShellProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellProvider.js","sources":["../../../../src/components/AppShellProvider/AppShellProvider.tsx"],"sourcesContent":["import {\n ComponentType,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState\n} from \"react\";\nimport {\n CONFIG_TRANSLATIONS_NAMESPACE,\n HvAppShellConfig,\n HvAppShellContext,\n HvAppShellContextValue,\n HvAppShellRuntimeContext\n} from \"@hitachivantara/app-shell-shared\";\nimport {
|
|
1
|
+
{"version":3,"file":"AppShellProvider.js","sources":["../../../../src/components/AppShellProvider/AppShellProvider.tsx"],"sourcesContent":["import {\n ComponentType,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState\n} from \"react\";\nimport {\n CONFIG_TRANSLATIONS_NAMESPACE,\n HvAppShellConfig,\n HvAppShellContext,\n HvAppShellContextValue,\n HvAppShellRuntimeContext,\n HvAppShellCombinedProvidersContext\n} from \"@hitachivantara/app-shell-shared\";\nimport { I18nContext } from \"react-i18next\";\n\nimport {\n HvProvider,\n HvProviderProps,\n themes as baseThemes\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { addResourceBundles } from \"../../lib/i18n\";\nimport useLocalStorage from \"../../lib/hooks/useLocalStorage\";\n\nexport type AppShellProviderProps = {\n children: ReactNode;\n config?: Partial<HvAppShellConfig>;\n configUrl?: string;\n};\n\nconst AppShellProvider = ({\n children,\n config: localConfig,\n configUrl\n}: AppShellProviderProps) => {\n const { i18n } = useContext(I18nContext);\n const { value: storedColorModeValue } = useLocalStorage(\"COLOR_MODE\");\n const [loadedConfig, setLoadedConfig] = useState<\n HvAppShellConfig | undefined\n >(undefined);\n\n const [hasError, setHasError] = useState<boolean>(false);\n\n useEffect(() => {\n if (!localConfig && configUrl) {\n fetch(new URL(configUrl))\n .then(result => {\n return result.json();\n })\n .then(data => setLoadedConfig(data))\n .catch(e => {\n console.error(\n `It was not possible to obtain the context from: ${configUrl}`,\n e\n );\n setLoadedConfig(undefined);\n setHasError(true);\n });\n }\n }, [localConfig, configUrl]);\n\n const theConfig: HvAppShellContextValue | undefined = useMemo(\n () => localConfig ?? loadedConfig,\n [localConfig, loadedConfig]\n );\n\n if (hasError) {\n throw Error(\"It was not possible to obtain the configuration\");\n }\n\n if (theConfig?.translations) {\n addResourceBundles(\n i18n,\n theConfig.translations,\n CONFIG_TRANSLATIONS_NAMESPACE\n );\n }\n\n const [themes, setThemes] = useState<HvProviderProps[\"themes\"]>(undefined);\n const [providers, setProviders] = useState<\n ComponentType<{ children: ReactNode }>[] | undefined\n >(undefined);\n\n useEffect(() => {\n if (theConfig?.theming?.themes) {\n Promise.all(\n theConfig.theming.themes?.map(bundle => {\n return (\n baseThemes[bundle as keyof typeof baseThemes] ??\n import(/* @vite-ignore */ bundle)\n .then(module => module.default)\n .catch(e => {\n console.error(`Import of theme bundle ${bundle} failed! ${e}`);\n })\n );\n })\n )\n .then(loadedThemes => {\n setThemes(loadedThemes.filter(theme => !!theme));\n })\n .catch(e => {\n console.error(`Import of themes failed! ${e}`);\n });\n }\n }, [theConfig?.theming?.themes]);\n\n useEffect(() => {\n if (theConfig?.providers) {\n Promise.all(\n theConfig.providers.map(provider => {\n return import(/* @vite-ignore */ provider.bundle)\n .then(module => module.default)\n .catch(e => {\n console.error(\n `Import of provider '${provider.bundle}' failed! ${e}`\n );\n });\n })\n )\n .then(loadedProviders =>\n setProviders(loadedProviders.filter(provider => !!provider))\n )\n .catch(e => {\n console.error(`Import of providers failed!`, e);\n });\n }\n }, [theConfig?.providers]);\n\n const runtimeContext = useMemo(\n () => ({\n i18n\n }),\n [i18n]\n );\n\n const providersContext = useMemo(\n () => ({\n providers\n }),\n [providers]\n );\n\n if (\n !theConfig ||\n (theConfig.theming?.themes && !themes) ||\n (theConfig.providers != null && providers === undefined)\n ) {\n return null;\n }\n\n return (\n <HvAppShellContext.Provider value={theConfig}>\n <HvAppShellRuntimeContext.Provider value={runtimeContext}>\n <HvProvider\n themes={themes}\n theme={theConfig.theming?.theme}\n colorMode={storedColorModeValue ?? theConfig.theming?.colorMode}>\n <HvAppShellCombinedProvidersContext.Provider value={providersContext}>\n {children}\n </HvAppShellCombinedProvidersContext.Provider>\n </HvProvider>\n </HvAppShellRuntimeContext.Provider>\n </HvAppShellContext.Provider>\n );\n};\n\nexport default AppShellProvider;\n"],"names":["AppShellProvider","children","config","localConfig","configUrl","i18n","useContext","I18nContext","value","storedColorModeValue","useLocalStorage","loadedConfig","setLoadedConfig","useState","undefined","hasError","setHasError","useEffect","fetch","URL","then","result","json","data","catch","e","console","error","theConfig","useMemo","Error","translations","CONFIG_TRANSLATIONS_NAMESPACE","themes","setThemes","providers","setProviders","theming","Promise","all","map","bundle","baseThemes","module","default","loadedThemes","filter","theme","provider","loadedProviders","runtimeContext","providersContext","jsx","HvAppShellContext","HvAppShellRuntimeContext","HvProvider","colorMode","HvAppShellCombinedProvidersContext","AppShellProvider$1"],"mappings":";;;;;;;AAiCA,MAAMA,IAAmBA,CAAC;AAAA,EACxBC,UAAAA;AAAAA,EACAC,QAAQC;A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AAC,EAAkB,UAAlB,EAA2B,OAAOzB,GACjC,UAAA,gBAAAwB,EAACE,EAAyB,UAAzB,EAAkC,OAAOJ,GACxC,UAAA,gBAAAE,EAACG,aACCtB,GACA,QAAOL,IAAAA,EAAUS,YAAVT,gBAAAA,EAAmBmB,OAC1B,WAAWtC,OAAwBmB,IAAAA,EAAUS,YAAVT,gBAAAA,EAAmB4B,YACtD,UAAA,gBAAAJ,EAACK,EAAmC,UAAnC,EAA4C,OAAON,GACjDlD,UAAAA,EACH,CAAA,GACF,GACF,EACF,CAAA;AAEJ,GAEAyD,IAAe1D;"}
|
|
@@ -1,66 +1,86 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { lazy as p
|
|
3
|
-
import {
|
|
4
|
-
import { ErrorBoundary as
|
|
5
|
-
import { HvContainer as
|
|
6
|
-
import { useHvAppShellConfig as E } from "@hitachivantara/app-shell-shared";
|
|
7
|
-
import
|
|
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
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";
|
|
9
12
|
import h from "../AppShellViewProvider/AppShellViewProvider.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
+
});
|
|
22
30
|
}
|
|
23
|
-
function
|
|
24
|
-
if (
|
|
25
|
-
return;
|
|
31
|
+
function H(r) {
|
|
32
|
+
if (r == null || r.views == null)
|
|
33
|
+
return [];
|
|
26
34
|
const {
|
|
27
35
|
views: o,
|
|
28
|
-
maxWidth:
|
|
29
|
-
...
|
|
30
|
-
} =
|
|
36
|
+
maxWidth: t = "xl",
|
|
37
|
+
...n
|
|
38
|
+
} = r;
|
|
31
39
|
return o.map((i) => {
|
|
32
40
|
const {
|
|
33
41
|
bundle: l,
|
|
34
42
|
route: u,
|
|
35
|
-
config:
|
|
36
|
-
views:
|
|
37
|
-
maxWidth:
|
|
38
|
-
...
|
|
39
|
-
} = i,
|
|
43
|
+
config: P,
|
|
44
|
+
views: a,
|
|
45
|
+
maxWidth: R,
|
|
46
|
+
...v
|
|
47
|
+
} = i, C = f(l), x = p(() => import(
|
|
40
48
|
/* @vite-ignore */
|
|
41
49
|
l
|
|
42
50
|
));
|
|
43
|
-
return
|
|
51
|
+
return {
|
|
52
|
+
path: u,
|
|
53
|
+
// "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)
|
|
56
|
+
};
|
|
44
57
|
});
|
|
45
58
|
}
|
|
46
|
-
function
|
|
59
|
+
function I(r) {
|
|
47
60
|
const {
|
|
48
61
|
views: o,
|
|
49
|
-
maxWidth:
|
|
50
|
-
...
|
|
51
|
-
} =
|
|
52
|
-
return
|
|
62
|
+
maxWidth: t = "xl",
|
|
63
|
+
...n
|
|
64
|
+
} = r ?? {};
|
|
65
|
+
return [{
|
|
66
|
+
path: "*",
|
|
67
|
+
element: /* @__PURE__ */ e(c, { maxWidth: t, ...n, children: /* @__PURE__ */ e(k, {}) })
|
|
68
|
+
}];
|
|
53
69
|
}
|
|
54
70
|
const y = () => {
|
|
55
|
-
const {
|
|
56
|
-
|
|
71
|
+
const r = w(), {
|
|
72
|
+
providers: o
|
|
57
73
|
} = E();
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
return /* @__PURE__ */ e(b, { fallbackElement: /* @__PURE__ */ e(S, {}), router: A([{
|
|
75
|
+
element: /* @__PURE__ */ e(B, { providers: o }),
|
|
76
|
+
// All routes live inside `RootRoute`
|
|
77
|
+
errorElement: /* @__PURE__ */ e(m, { fullPage: !0 }),
|
|
78
|
+
children: [...H(r.mainPanel), ...I(r.mainPanel)]
|
|
79
|
+
}], {
|
|
80
|
+
basename: W(r)
|
|
81
|
+
}) });
|
|
82
|
+
}, J = y;
|
|
63
83
|
export {
|
|
64
|
-
|
|
84
|
+
J as default
|
|
65
85
|
};
|
|
66
86
|
//# sourceMappingURL=AppShellRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellRoutes.js","sources":["../../../../src/components/AppShellRoutes/AppShellRoutes.tsx"],"sourcesContent":["import { lazy
|
|
1
|
+
{"version":3,"file":"AppShellRoutes.js","sources":["../../../../src/components/AppShellRoutes/AppShellRoutes.tsx"],"sourcesContent":["import { lazy } from \"react\";\nimport {\n createBrowserRouter,\n Outlet,\n RouteObject,\n RouterProvider\n} from \"react-router-dom\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { HvContainer } from \"@hitachivantara/uikit-react-core\";\nimport {\n type HvAppShellMainPanelConfig,\n type HvAppShellViewsConfig,\n useHvAppShellConfig,\n useHvAppShellCombinedProviders\n} from \"@hitachivantara/app-shell-shared\";\n\nimport AppShellViewProvider from \"../AppShellViewProvider\";\nimport GenericError from \"../../pages/GenericError\";\nimport LoadingPage from \"../../pages/LoadingPage\";\nimport { getAppIdFromBundle } from \"../../lib/utils/navigationUtil\";\nimport getBasePath from \"../../lib/utils/basePathUtils\";\nimport RootRoute from \"../../pages/Root\";\n\nconst NotFound = lazy(() => import(\"../../pages/NotFound\"));\n\nfunction renderNestedRoutes(\n views: HvAppShellViewsConfig[] | undefined\n): RouteObject[] | undefined {\n if (!views) {\n return undefined;\n }\n return views.map<RouteObject>(view => {\n const { bundle } = view;\n const appId = getAppIdFromBundle(bundle);\n\n const RouteComponent = lazy(() => import(/* @vite-ignore */ bundle));\n\n const path = view.route.replace(/^\\//, \"\");\n\n return {\n path,\n // \"Component\" used instead of \"element\" due to lazy loading\n Component: () => (\n <AppShellViewProvider id={appId}>\n <ErrorBoundary\n key={view.route}\n fallback={<GenericError fullPage={false} />}>\n <RouteComponent {...view.config}>\n {view.views != null ? <Outlet /> : null}\n </RouteComponent>\n </ErrorBoundary>\n </AppShellViewProvider>\n ),\n children: renderNestedRoutes(view.views)\n };\n });\n}\n\nfunction renderRoutes(\n mainPanel: HvAppShellMainPanelConfig | undefined\n): RouteObject[] {\n if (mainPanel == null || mainPanel.views == null) {\n return [];\n }\n\n const { views, maxWidth = \"xl\", ...mainContainerProps } = mainPanel;\n\n return views.map(view => {\n const {\n bundle,\n route,\n config,\n views: nestedViews,\n maxWidth: viewMaxWidth,\n ...viewContainerProps\n } = view;\n\n const appId = getAppIdFromBundle(bundle);\n\n const RouteComponent = lazy(() => import(/* @vite-ignore */ bundle));\n\n return {\n path: route,\n // \"Component\" used instead of \"element\" due to lazy loading\n Component: () => (\n <HvContainer\n maxWidth={viewMaxWidth ?? maxWidth}\n {...mainContainerProps}\n {...viewContainerProps}>\n <AppShellViewProvider id={appId}>\n <ErrorBoundary\n key={route}\n fallback={<GenericError fullPage={false} />}>\n <RouteComponent {...config}>\n {nestedViews != null ? <Outlet /> : null}\n </RouteComponent>\n </ErrorBoundary>\n </AppShellViewProvider>\n </HvContainer>\n ),\n children: renderNestedRoutes(nestedViews)\n };\n });\n}\n\nfunction renderErrorRoutes(\n mainPanel: HvAppShellMainPanelConfig | undefined\n): RouteObject[] {\n const { views, maxWidth = \"xl\", ...mainContainerProps } = mainPanel ?? {};\n\n return [\n {\n path: \"*\",\n element: (\n <HvContainer maxWidth={maxWidth} {...mainContainerProps}>\n <NotFound />\n </HvContainer>\n )\n }\n ];\n}\n\nconst AppShellRoutes = () => {\n const config = useHvAppShellConfig();\n const { providers } = useHvAppShellCombinedProviders();\n\n return (\n <RouterProvider\n fallbackElement={<LoadingPage />}\n router={createBrowserRouter(\n [\n {\n element: <RootRoute providers={providers} />, // All routes live inside `RootRoute`\n errorElement: <GenericError fullPage />,\n children: [\n ...renderRoutes(config.mainPanel),\n ...renderErrorRoutes(config.mainPanel)\n ]\n }\n ],\n { basename: getBasePath(config) }\n )}\n />\n );\n};\n\nexport default AppShellRoutes;\n"],"names":["NotFound","lazy","renderNestedRoutes","views","map","view","bundle","appId","getAppIdFromBundle","RouteComponent","path","route","replace","Component","jsx","AppShellViewProvider","ErrorBoundary","GenericError","config","Outlet","children","renderRoutes","mainPanel","maxWidth","mainContainerProps","nestedViews","viewMaxWidth","viewContainerProps","HvContainer","renderErrorRoutes","element","AppShellRoutes","useHvAppShellConfig","providers","useHvAppShellCombinedProviders","RouterProvider","LoadingPage","createBrowserRouter","RootRoute","errorElement","basename","getBasePath","AppShellRoutes$1"],"mappings":";;;;;;;;;;;;AAwBA,MAAMA,IAAWC,EAAK,MAAM,OAAO,+BAAsB,CAAC;AAE1D,SAASC,EACPC,GAC2B;AAC3B,MAAKA;AAGEA,WAAAA,EAAMC,IAAiBC,CAAQA,MAAA;AAC9B,YAAA;AAAA,QAAEC,QAAAA;AAAAA,MAAWD,IAAAA,GACbE,IAAQC,EAAmBF,CAAM,GAEjCG,IAAiBR,EAAK,MAAM;AAAA;AAAA,QAA0BK;AAAAA,OAAO;AAI5D,aAAA;AAAA,QACLI,MAHWL,EAAKM,MAAMC,QAAQ,OAAO,EAAE;AAAA;AAAA,QAKvCC,WAAWA,MACR,gBAAAC,EAAAC,GAAA,EAAqB,IAAIR,GACxB,UAAC,gBAAAO,EAAAE,GAAA,EAEC,UAAU,gBAAAF,EAACG,GAAa,EAAA,UAAU,GAAM,CAAA,GACxC,UAAC,gBAAAH,EAAAL,GAAA,KAAmBJ,EAAKa,QACtBb,UAAAA,EAAKF,SAAS,OAAQ,gBAAAW,EAAAK,GAAA,CAAS,CAAA,IAAG,KAAA,CACrC,EAJKd,GAAAA,EAAKM,KAKZ,GACF;AAAA,QAEFS,UAAUlB,EAAmBG,EAAKF,KAAK;AAAA,MAAA;AAAA,IACzC,CACD;AACH;AAEA,SAASkB,EACPC,GACe;AACf,MAAIA,KAAa,QAAQA,EAAUnB,SAAS;AAC1C,WAAO;AAGH,QAAA;AAAA,IAAEA,OAAAA;AAAAA,IAAOoB,UAAAA,IAAW;AAAA,IAAM,GAAGC;AAAAA,EAAuBF,IAAAA;AAEnDnB,SAAAA,EAAMC,IAAIC,CAAQA,MAAA;AACjB,UAAA;AAAA,MACJC,QAAAA;AAAAA,MACAK,OAA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,IAC5CM,cAAc,gBAAAzB,EAACG,GAAa,EAAA,UAAQ,GAAG,CAAA;AAAA,IACvCG,UAAU,CACR,GAAGC,EAAaH,EAAOI,SAAS,GAChC,GAAGO,EAAkBX,EAAOI,SAAS,CAAC;AAAA,EAAA,CAEzC,GAEH;AAAA,IAAEkB,UAAUC,EAAYvB,CAAM;AAAA,EAChC,CAAA,EACA,CAAA;AAEN,GAEAwB,IAAeX;"}
|
|
@@ -1,34 +1,28 @@
|
|
|
1
|
-
import { jsx as I, jsxs as
|
|
2
|
-
import { css as
|
|
3
|
-
import { I18nextProvider as
|
|
4
|
-
import { HelmetProvider as
|
|
5
|
-
import { theme as
|
|
6
|
-
import { ErrorBoundary as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
...
|
|
22
|
-
}) => /* @__PURE__ */ I(d, { children: /* @__PURE__ */ b(a, { children: [
|
|
23
|
-
/* @__PURE__ */ I(v, {}),
|
|
24
|
-
/* @__PURE__ */ I(X, { i18n: i, children: /* @__PURE__ */ I(m, { fallback: /* @__PURE__ */ I(A, { fullPage: !0, includeFooter: !1 }), children: /* @__PURE__ */ I(r, { config: c.config, configUrl: c.configUrl, children: /* @__PURE__ */ I(W, { children: /* @__PURE__ */ I(t, { notistackClassesOverride: e, children: /* @__PURE__ */ I(m, { fallback: /* @__PURE__ */ I(A, { fullPage: !0 }), children: /* @__PURE__ */ I(h, { children: /* @__PURE__ */ b(o, { children: [
|
|
25
|
-
/* @__PURE__ */ I(u, {}),
|
|
26
|
-
/* @__PURE__ */ I(g, { ...c })
|
|
27
|
-
] }) }) }) }) }) }) }, "general") })
|
|
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2hvYy93aXRoR2xvYmFsUHJvdmlkZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdCb0IiLCJmaWxlIjoiL19fdy9odi1hcHAtc2hlbGwvaHYtYXBwLXNoZWxsL2NsaWVudC9wYWNrYWdlcy9hcHAtc2hlbGwtdWkvc3JjL2NvbXBvbmVudHMvaG9jL3dpdGhHbG9iYWxQcm92aWRlci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vY3NzXCI7XG5pbXBvcnQgeyBJMThuZXh0UHJvdmlkZXIgfSBmcm9tIFwicmVhY3QtaTE4bmV4dFwiO1xuaW1wb3J0IHsgSGVsbWV0UHJvdmlkZXIgfSBmcm9tIFwicmVhY3QtaGVsbWV0LWFzeW5jXC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+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") })
|
|
28
22
|
] }) });
|
|
29
|
-
return
|
|
23
|
+
return g.displayName = `withGlobalProvider(${l})`, g;
|
|
30
24
|
};
|
|
31
25
|
export {
|
|
32
|
-
|
|
26
|
+
R as default
|
|
33
27
|
};
|
|
34
28
|
//# sourceMappingURL=withGlobalProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withGlobalProvider.js","sources":["../../../../src/components/hoc/withGlobalProvider.tsx"],"sourcesContent":["import { css } from \"@emotion/css\";\nimport { I18nextProvider } from \"react-i18next\";\nimport { HelmetProvider } from \"react-helmet-async\";\n\nimport {\n HvProvider,\n HvSnackbarProvider,\n theme\n} from \"@hitachivantara/uikit-react-core\";\n\nimport React from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport GlobalStyles from \"../GlobalStyles\";\nimport AppShellProvider from \"../AppShellProvider/AppShellProvider\";\nimport
|
|
1
|
+
{"version":3,"file":"withGlobalProvider.js","sources":["../../../../src/components/hoc/withGlobalProvider.tsx"],"sourcesContent":["import { css } from \"@emotion/css\";\nimport { I18nextProvider } from \"react-i18next\";\nimport { HelmetProvider } from \"react-helmet-async\";\n\nimport {\n HvProvider,\n HvSnackbarProvider,\n theme\n} from \"@hitachivantara/uikit-react-core\";\n\nimport React from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport GlobalStyles from \"../GlobalStyles\";\nimport AppShellProvider from \"../AppShellProvider/AppShellProvider\";\nimport createI18Next from \"../../lib/i18n\";\nimport LayoutProvider from \"../../providers/LayoutProvider\";\nimport GenericError from \"../../pages/GenericError\";\n\ntype WrappedComponentProps<T extends React.ElementType> = React.ComponentType<\n React.ComponentProps<T>\n>;\n\nconst snackbarClasses = {\n containerRoot: css`\n margin-top: ${theme.header.height};\n `\n};\n\nconst withGlobalProvider = <T extends React.ElementType>(\n WrappedComponent: WrappedComponentProps<T>\n) => {\n const displayName = WrappedComponent.displayName ?? WrappedComponent.name;\n\n const { i18n } = createI18Next();\n\n const ComponentWithGlobalProvider = ({\n ...wrappedProps\n }: React.ComponentProps<T>) => {\n return (\n <HelmetProvider>\n <HvProvider>\n <GlobalStyles />\n <I18nextProvider i18n={i18n}>\n <ErrorBoundary\n key=\"general\"\n fallback={<GenericError fullPage includeFooter={false} />}>\n <AppShellProvider\n config={wrappedProps.config}\n configUrl={wrappedProps.configUrl}>\n <LayoutProvider>\n <HvSnackbarProvider\n notistackClassesOverride={snackbarClasses}>\n <WrappedComponent {...wrappedProps} />\n </HvSnackbarProvider>\n </LayoutProvider>\n </AppShellProvider>\n </ErrorBoundary>\n </I18nextProvider>\n </HvProvider>\n </HelmetProvider>\n );\n };\n\n ComponentWithGlobalProvider.displayName = `withGlobalProvider(${displayName})`;\n\n return ComponentWithGlobalProvider;\n};\n\nexport default withGlobalProvider;\n"],"names":["snackbarClasses","containerRoot","css","theme","header","height","process","env","NODE_ENV","withGlobalProvider","WrappedComponent","displayName","name","i18n","createI18Next","ComponentWithGlobalProvider","wrappedProps","jsx","HelmetProvider","jsxs","HvProvider","GlobalStyles","I18nextProvider","ErrorBoundary","GenericError","AppShellProvider","config","configUrl","LayoutProvider","HvSnackbarProvider"],"mappings":";;;;;;;;;;;AAuBA,MAAMA,IAAkB;AAAA,EACtBC,eAAkB,gBAAAC,EAAA,eACFC,EAAMC,OAAOC,QAAM,OAAAC,QAAAC,IAAAC,aAAA,eAAA,KAAA,0BAAAF,QAAAC,IAAAC,aAAA,eAAA,KAAA,6xGAAA;AAErC,GAEMC,IAAqB,CACzBC,MACG;AACGC,QAAAA,IAAcD,EAAiBC,eAAeD,EAAiBE,MAE/D;AAAA,IAAEC,MAAAA;AAAAA,MAASC,EAAc,GAEzBC,IAA8BA,CAAC;AAAA,IACnC,GAAGC;AAAAA,EAAAA,MAGD,gBAAAC,EAACC,GACC,EAAA,UAAA,gBAAAC,EAACC,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAH,EAACI,GAAY,EAAA;AAAA,sBACZC,GAAgB,EAAA,MAAAT,GACf,UAAC,gBAAAI,EAAAM,GAAA,EAEC,UAAW,gBAAAN,EAAAO,GAAA,EAAa,UAAQ,IAAC,eAAe,GAAM,CAAA,GACtD,UAAC,gBAAAP,EAAAQ,GAAA,EACC,QAAQT,EAAaU,QACrB,WAAWV,EAAaW,WACxB,UAAC,gBAAAV,EAAAW,GAAA,EACC,UAAC,gBAAAX,EAAAY,GAAA,EACC,0BAA0B7B,GAC1B,UAAA,gBAAAiB,EAACP,GAAiB,EAAA,GAAIM,GAAa,EACrC,CAAA,EACF,CAAA,GACF,EAAA,GAXI,SAYN,GACF;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAIwBL,SAAAA,EAAAA,cAAe,sBAAqBA,CAAY,KAErEI;AACT;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as r, jsxs as o, Fragment as e } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Suspense as m } from "react";
|
|
3
|
+
import { Outlet as t } from "react-router-dom";
|
|
4
|
+
import { ErrorBoundary as n } from "react-error-boundary";
|
|
5
|
+
import a from "../../lib/utils/CombinedProviders.js";
|
|
6
|
+
import f from "../../providers/BannerProvider.js";
|
|
7
|
+
import l from "../../providers/NavigationProvider.js";
|
|
8
|
+
import d from "../LoadingPage/LoadingPage.js";
|
|
9
|
+
import p from "../GenericError/GenericError.js";
|
|
10
|
+
import c from "../../components/CustomHooksInitializer/CustomHooksInitializer.js";
|
|
11
|
+
import s from "../../components/layout/Header/Header.js";
|
|
12
|
+
import u from "../../components/layout/Main/Main.js";
|
|
13
|
+
const h = ({
|
|
14
|
+
providers: i
|
|
15
|
+
}) => /* @__PURE__ */ r(n, { fallback: /* @__PURE__ */ r(p, { fullPage: !0 }), children: /* @__PURE__ */ r(a, { providers: i, children: /* @__PURE__ */ r(l, { children: /* @__PURE__ */ o(f, { children: [
|
|
16
|
+
/* @__PURE__ */ r(c, {}),
|
|
17
|
+
/* @__PURE__ */ o(e, { children: [
|
|
18
|
+
/* @__PURE__ */ r(s, {}),
|
|
19
|
+
/* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(m, { fallback: /* @__PURE__ */ r(d, {}), children: /* @__PURE__ */ r(t, {}) }) })
|
|
20
|
+
] })
|
|
21
|
+
] }) }) }) }), y = h;
|
|
22
|
+
export {
|
|
23
|
+
y as default
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=Root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Root.js","sources":["../../../../src/pages/Root/Root.tsx"],"sourcesContent":["import { Suspense } from \"react\";\nimport { Outlet } from \"react-router-dom\";\nimport { ErrorBoundary } from \"react-error-boundary\";\nimport GenericError from \"../GenericError\";\nimport CustomHooksInitializer from \"../../components/CustomHooksInitializer\";\nimport Header from \"../../components/layout/Header\";\nimport Main from \"../../components/layout/Main\";\nimport CombinedProviders from \"../../lib/utils/CombinedProviders\";\nimport BannerProvider from \"../../providers/BannerProvider\";\nimport NavigationProvider from \"../../providers/NavigationProvider\";\nimport LoadingPage from \"../LoadingPage\";\n\ninterface RootProps {\n providers?: React.ComponentType<{\n children: React.ReactNode;\n }>[];\n}\n\nconst Root = ({ providers }: RootProps) => (\n <ErrorBoundary fallback={<GenericError fullPage />}>\n <CombinedProviders providers={providers}>\n <NavigationProvider>\n <BannerProvider>\n <CustomHooksInitializer />\n <>\n <Header />\n <Main>\n <Suspense fallback={<LoadingPage />}>\n <Outlet />\n </Suspense>\n </Main>\n </>\n </BannerProvider>\n </NavigationProvider>\n </CombinedProviders>\n </ErrorBoundary>\n);\n\nexport default Root;\n"],"names":["Root","providers","jsx","ErrorBoundary","GenericError","CombinedProviders","NavigationProvider","BannerProvider","CustomHooksInitializer","jsxs","Fragment","Header","Main","Suspense","LoadingPage","Outlet","RootRoute"],"mappings":";;;;;;;;;;;;AAkBA,MAAMA,IAAOA,CAAC;AAAA,EAAEC,WAAAA;AAAqB,MAClC,gBAAAC,EAAAC,GAAA,EAAc,UAAU,gBAAAD,EAACE,KAAa,UAAQ,OAC7C,UAAA,gBAAAF,EAACG,GAAkB,EAAA,WAAAJ,GACjB,UAAC,gBAAAC,EAAAI,GAAA,EACC,4BAACC,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAL,EAACM,GAAsB,EAAA;AAAA,EAErB,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAR,EAACS,GAAM,EAAA;AAAA,IACP,gBAAAT,EAACU,GACC,EAAA,UAAA,gBAAAV,EAACW,GAAS,EAAA,UAAW,gBAAAX,EAAAY,GAAA,CAAW,CAAA,GAC9B,UAAA,gBAAAZ,EAACa,GAAM,CAAA,CAAA,EACT,CAAA,GACF;AAAA,EAAA,GACF;AAAA,EACF,CAAA,EACF,CAAA,GACF,EACF,CAAA,GAGFC,IAAehB;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/app-shell-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "AppShell Component",
|
|
5
5
|
"author": "Hitachi Vantara - Boba Fett Team",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@emotion/react": "^11.10.5",
|
|
40
40
|
"@emotion/styled": "^11.10.5",
|
|
41
41
|
"@hitachivantara/app-shell-events": "1.0.2",
|
|
42
|
-
"@hitachivantara/app-shell-navigation": "1.2.
|
|
43
|
-
"@hitachivantara/app-shell-shared": "1.
|
|
42
|
+
"@hitachivantara/app-shell-navigation": "1.2.5",
|
|
43
|
+
"@hitachivantara/app-shell-shared": "1.3.0",
|
|
44
44
|
"@hitachivantara/uikit-react-core": "^5.66.7",
|
|
45
45
|
"@hitachivantara/uikit-react-icons": "^5.10.1",
|
|
46
46
|
"@mui/material": "^5.12.3",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"vite-plugin-dts": "^3.6.4",
|
|
69
69
|
"vite-tsconfig-paths": "^4.0.5"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "0e7f62ae71bf4f6626445c977518a90be50a7e1c"
|
|
72
72
|
}
|