@hitachivantara/app-shell-ui 1.0.1 → 1.1.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.
@@ -1,31 +1,34 @@
1
- import { jsx as o, jsxs as u } from "@emotion/react/jsx-runtime";
2
- import { lazy as l, Suspense as i } from "react";
3
- import { Routes as f, Route as n } from "react-router-dom";
4
- import { ErrorBoundary as c } from "react-error-boundary";
5
- import { useHvAppShellConfig as d } from "@hitachivantara/app-shell-shared";
6
- import a from "../../pages/LoadingPage/LoadingPage.js";
7
- import { getAppIdFromBundle as h } from "../../lib/utils/navigationUtil.js";
8
- import g from "../AppShellViewProvider/AppShellViewProvider.js";
9
- import A from "../../pages/GenericError/GenericError.js";
10
- const R = l(() => import("../../pages/NotFound/index.js")), S = () => {
11
- var e;
1
+ import { jsx as o, jsxs as i } from "@emotion/react/jsx-runtime";
2
+ import { lazy as l, Suspense as d } from "react";
3
+ import { Routes as f, Route as n, Outlet as a } from "react-router-dom";
4
+ import { ErrorBoundary as h } from "react-error-boundary";
5
+ import { useHvAppShellConfig as g } from "@hitachivantara/app-shell-shared";
6
+ import R from "../../pages/LoadingPage/LoadingPage.js";
7
+ import { getAppIdFromBundle as A } from "../../lib/utils/navigationUtil.js";
8
+ import S from "../AppShellViewProvider/AppShellViewProvider.js";
9
+ import b from "../../pages/GenericError/GenericError.js";
10
+ const x = l(() => import("../../pages/NotFound/index.js"));
11
+ function p(e, u = !1) {
12
+ return e.map((r) => {
13
+ const {
14
+ bundle: t
15
+ } = r, s = A(t), m = l(() => import(
16
+ /* @vite-ignore */
17
+ t
18
+ )), c = u ? r.route.replace(/^\//, "") : r.route;
19
+ return /* @__PURE__ */ o(n, { path: c, element: /* @__PURE__ */ o(S, { id: s, children: /* @__PURE__ */ o(h, { fallback: /* @__PURE__ */ o(b, { fullPage: !1 }), children: /* @__PURE__ */ o(m, { ...r.config, children: r.views != null ? /* @__PURE__ */ o(a, {}) : null }) }, r.route) }), children: r.views != null ? p(r.views, !0) : void 0 }, r.route);
20
+ });
21
+ }
22
+ const F = () => {
12
23
  const {
13
- mainPanel: t
14
- } = d();
15
- return /* @__PURE__ */ o(i, { fallback: /* @__PURE__ */ o(a, {}), children: /* @__PURE__ */ u(f, { children: [
16
- (e = t == null ? void 0 : t.views) == null ? void 0 : e.map((r) => {
17
- const {
18
- bundle: p
19
- } = r, m = h(p), s = l(() => import(
20
- /* @vite-ignore */
21
- p
22
- ));
23
- return /* @__PURE__ */ o(n, { path: r.route, element: /* @__PURE__ */ o(g, { id: m, children: /* @__PURE__ */ o(c, { fallback: /* @__PURE__ */ o(A, { fullPage: !1 }), children: /* @__PURE__ */ o(s, { ...r.config }) }, r.route) }) }, r.route);
24
- }),
25
- /* @__PURE__ */ o(n, { path: "*", element: /* @__PURE__ */ o(R, {}) }, "notFound")
24
+ mainPanel: e
25
+ } = g();
26
+ return /* @__PURE__ */ o(d, { fallback: /* @__PURE__ */ o(R, {}), children: /* @__PURE__ */ i(f, { children: [
27
+ (e == null ? void 0 : e.views) != null ? p(e == null ? void 0 : e.views) : null,
28
+ /* @__PURE__ */ o(n, { path: "*", element: /* @__PURE__ */ o(x, {}) }, "notFound")
26
29
  ] }) });
27
- }, I = S;
30
+ }, H = F;
28
31
  export {
29
- I as default
32
+ H as default
30
33
  };
31
34
  //# sourceMappingURL=AppShellRoutes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppShellRoutes.js","sources":["../../../../src/components/AppShellRoutes/AppShellRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from \"react\";\nimport { Route, Routes } from \"react-router-dom\";\nimport { ErrorBoundary } from \"react-error-boundary\";\nimport { useHvAppShellConfig } 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\";\n\nconst NotFound = lazy(() => import(\"../../pages/NotFound\"));\n\nconst AppShellRoutes = () => {\n const { mainPanel } = useHvAppShellConfig();\n return (\n <Suspense fallback={<LoadingPage />}>\n <Routes>\n {mainPanel?.views?.map(view => {\n const { bundle } = view;\n const appId = getAppIdFromBundle(bundle);\n\n const RouteComponent = lazy(() => import(/* @vite-ignore */ bundle));\n\n return (\n <Route\n key={view.route}\n path={view.route}\n element={\n <AppShellViewProvider id={appId}>\n <ErrorBoundary\n key={view.route}\n fallback={<GenericError fullPage={false} />}>\n <RouteComponent {...view.config} />\n </ErrorBoundary>\n </AppShellViewProvider>\n }\n />\n );\n })}\n <Route path=\"*\" key=\"notFound\" element={<NotFound />} />\n </Routes>\n </Suspense>\n );\n};\n\nexport default AppShellRoutes;\n"],"names":["NotFound","lazy","AppShellRoutes","mainPanel","useHvAppShellConfig","Suspense","LoadingPage","Routes","views","map","view","bundle","appId","getAppIdFromBundle","RouteComponent","jsx","Route","route","AppShellViewProvider","ErrorBoundary","GenericError","config","AppShellRoutes$1"],"mappings":";;;;;;;;;AAUA,MAAMA,IAAWC,EAAK,MAAM,OAAO,+BAAsB,CAAC,GAEpDC,IAAiBA,MAAM;;AACrB,QAAA;AAAA,IAAEC,WAAAA;AAAAA,MAAcC,EAAoB;AAC1C,2BACGC,GAAS,EAAA,4BAAWC,GAAW,CAAA,CAAA,GAC9B,4BAACC,GACEJ,EAAAA,UAAAA;AAAAA,KAAWK,IAAAA,KAAAA,gBAAAA,EAAAA,UAAAA,gBAAAA,EAAOC,IAAIC,CAAQA,MAAA;AACvB,YAAA;AAAA,QAAEC,QAAAA;AAAAA,MAAWD,IAAAA,GACbE,IAAQC,EAAmBF,CAAM,GAEjCG,IAAiBb,EAAK,MAAM;AAAA;AAAA,QAA0BU;AAAAA,OAAO;AAEnE,aACG,gBAAAI,EAAAC,GAAA,EAEC,MAAMN,EAAKO,OACX,SACG,gBAAAF,EAAAG,GAAA,EAAqB,IAAIN,GACxB,UAAC,gBAAAG,EAAAI,GAAA,EAEC,UAAU,gBAAAJ,EAACK,GAAa,EAAA,UAAU,GAAM,CAAA,GACxC,UAAC,gBAAAL,EAAAD,GAAA,KAAmBJ,EAAKW,OAAO,CAAA,EAAA,GAF3BX,EAAKO,KAGZ,EACF,CAAA,KATGP,EAAKO,KAWV;AAAA,IAAA;AAAA,IAGN,gBAAAF,EAACC,KAAM,MAAK,KAAmB,SAAU,gBAAAD,EAAAf,GAAA,CAAA,MAArB,UAAiC;AAAA,EAAA,EACvD,CAAA,EACF,CAAA;AAEJ,GAEAsB,IAAepB;"}
1
+ {"version":3,"file":"AppShellRoutes.js","sources":["../../../../src/components/AppShellRoutes/AppShellRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from \"react\";\nimport { Outlet, Route, Routes } from \"react-router-dom\";\nimport { ErrorBoundary } from \"react-error-boundary\";\nimport {\n HvAppShellViewsConfig,\n useHvAppShellConfig\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\";\n\nconst NotFound = lazy(() => import(\"../../pages/NotFound\"));\n\nfunction renderRoutes(views: HvAppShellViewsConfig[], isNestedView = false) {\n return views.map(view => {\n const { bundle } = view;\n const appId = getAppIdFromBundle(bundle);\n\n const RouteComponent = lazy(() => import(/* @vite-ignore */ bundle));\n\n const path = isNestedView ? view.route.replace(/^\\//, \"\") : view.route;\n\n return (\n <Route\n key={view.route}\n path={path}\n element={\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 {view.views != null ? renderRoutes(view.views, true) : undefined}\n </Route>\n );\n });\n}\n\nconst AppShellRoutes = () => {\n const { mainPanel } = useHvAppShellConfig();\n return (\n <Suspense fallback={<LoadingPage />}>\n <Routes>\n {mainPanel?.views != null ? renderRoutes(mainPanel?.views) : null}\n <Route path=\"*\" key=\"notFound\" element={<NotFound />} />\n </Routes>\n </Suspense>\n );\n};\n\nexport default AppShellRoutes;\n"],"names":["NotFound","lazy","renderRoutes","views","isNestedView","map","view","bundle","appId","getAppIdFromBundle","RouteComponent","path","route","replace","Route","jsx","AppShellViewProvider","ErrorBoundary","GenericError","config","Outlet","undefined","AppShellRoutes","mainPanel","useHvAppShellConfig","Suspense","LoadingPage","Routes","AppShellRoutes$1"],"mappings":";;;;;;;;;AAaA,MAAMA,IAAWC,EAAK,MAAM,OAAO,+BAAsB,CAAC;AAE1D,SAASC,EAAaC,GAAgCC,IAAe,IAAO;AACnED,SAAAA,EAAME,IAAIC,CAAQA,MAAA;AACjB,UAAA;AAAA,MAAEC,QAAAA;AAAAA,IAAWD,IAAAA,GACbE,IAAQC,EAAmBF,CAAM,GAEjCG,IAAiBT,EAAK,MAAM;AAAA;AAAA,MAA0BM;AAAAA,KAAO,GAE7DI,IAAOP,IAAeE,EAAKM,MAAMC,QAAQ,OAAO,EAAE,IAAIP,EAAKM;AAEjE,6BACGE,GAEC,EAAA,MAAAH,GACA,SACG,gBAAAI,EAAAC,GAAA,EAAqB,IAAIR,GACxB,UAAA,gBAAAO,EAACE,KAEC,UAAU,gBAAAF,EAACG,KAAa,UAAU,GAAA,CAAM,GACxC,UAAC,gBAAAH,EAAAL,GAAA,KAAmBJ,EAAKa,QACtBb,YAAKH,SAAS,yBAAQiB,GAAS,CAAA,CAAA,IAAG,KACrC,CAAA,EAJKd,GAAAA,EAAKM,KAKZ,EACF,CAAA,GAEDN,YAAKH,SAAS,OAAOD,EAAaI,EAAKH,OAAO,EAAI,IAAIkB,OAAAA,GAblDf,EAAKM,KAcZ;AAAA,EAAA,CAEH;AACH;AAEA,MAAMU,IAAiBA,MAAM;AACrB,QAAA;AAAA,IAAEC,WAAAA;AAAAA,MAAcC,EAAoB;AAC1C,2BACGC,GAAS,EAAA,4BAAWC,GAAW,CAAA,CAAA,GAC9B,4BAACC,GACEJ,EAAAA,UAAAA;AAAAA,KAAAA,KAAAA,gBAAAA,EAAWpB,UAAS,OAAOD,EAAaqB,KAAAA,gBAAAA,EAAWpB,KAAK,IAAI;AAAA,IAC7D,gBAAAY,EAACD,KAAM,MAAK,KAAmB,SAAU,gBAAAC,EAAAf,GAAA,CAAA,MAArB,UAAiC;AAAA,EAAA,EACvD,CAAA,EACF,CAAA;AAEJ,GAEA4B,IAAeN;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/app-shell-ui",
3
- "version": "1.0.1",
3
+ "version": "1.1.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.0",
42
- "@hitachivantara/app-shell-navigation": "1.0.0",
43
- "@hitachivantara/app-shell-shared": "1.0.0",
42
+ "@hitachivantara/app-shell-navigation": "1.2.0",
43
+ "@hitachivantara/app-shell-shared": "1.1.0",
44
44
  "@hitachivantara/uikit-react-core": "^5.31.0",
45
45
  "@hitachivantara/uikit-react-icons": "^5.6.8",
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": "e40a1b58e984df9a38dfc4630d3a3a8ad5b6c100"
71
+ "gitHead": "6140d2027f6c2d215f1d3c015a9adafd0cf00de6"
72
72
  }