@m4l/layouts 2.0.4 → 3.0.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.
@@ -2,8 +2,8 @@ import { unstable_HistoryRouter } from "react-router-dom";
2
2
  import { EnvironmentProvider, HostToolsProvider, NetworkProvider, DomainCountryProvider } from "@m4l/core";
3
3
  import { LocalesProvider, HostThemeProvider, ResponsiveContainerProvider, FormatterProvider } from "@m4l/graphics";
4
4
  import { BaseModule, WindowToolsMFProvider, DynamicMFParmsProvider } from "@m4l/components";
5
- import { M as MFWindowsTitle } from "../index.26c591f5.js";
6
5
  import { jsx } from "react/jsx-runtime";
6
+ import { M as MFWindowsTitle } from "../index-uQ5qk7MJ.js";
7
7
  function MFHostApp(props) {
8
8
  const {
9
9
  children,
@@ -3,7 +3,6 @@ import { FormatterProvider, ResponsiveContainerProvider } from "@m4l/graphics";
3
3
  import { BaseModule, useSetWindowsTitle } from "@m4l/components";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { Fragment } from "react";
6
- import "react-router-dom";
7
6
  function MFNoAuthApp(props) {
8
7
  const {
9
8
  children,
@@ -61,8 +61,9 @@ function AuthProvider(props) {
61
61
  domain_token
62
62
  } = useEnvironment();
63
63
  const [nextValSession, setNextValSession] = useLocalStorageWithListener(
64
+ //Variable para saber si ha cambiado la session en otro navegador
64
65
  "vSession",
65
- new Date().getTime() + ""
66
+ (/* @__PURE__ */ new Date()).getTime() + ""
66
67
  );
67
68
  useEffect(() => {
68
69
  const initialize = async () => {
@@ -124,7 +125,7 @@ function AuthProvider(props) {
124
125
  user
125
126
  }
126
127
  });
127
- setNextValSession(new Date().getTime() + "");
128
+ setNextValSession((/* @__PURE__ */ new Date()).getTime() + "");
128
129
  });
129
130
  };
130
131
  const logout = async (isAuthenticated) => {
@@ -137,7 +138,7 @@ function AuthProvider(props) {
137
138
  dispatch({
138
139
  type: EnumTypes.Logout
139
140
  });
140
- setNextValSession(new Date().getTime() + "");
141
+ setNextValSession((/* @__PURE__ */ new Date()).getTime() + "");
141
142
  };
142
143
  const onNetserviceUnautorized = () => {
143
144
  logout(false);
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+
@@ -1,9 +1,8 @@
1
1
  import { useContext } from "react";
2
- import { A as AuthContext } from "../../contexts/AuthContext/index.59755369.js";
2
+ import { A as AuthContext } from "../../contexts/AuthContext/index-DARkRRM4.js";
3
3
  const useAuth = () => {
4
4
  const context = useContext(AuthContext);
5
- if (!context)
6
- throw new Error("Auth context must be use inside AuthProvider");
5
+ if (!context) throw new Error("Auth context must be use inside AuthProvider");
7
6
  return context;
8
7
  };
9
8
  export {
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "react";
2
- import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index.748f7ada.js";
2
+ import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index-DeC4RoBs.js";
3
3
  const useMasterDetail = () => useContext(MasterDetailContext);
4
4
  export {
5
5
  useMasterDetail as u
@@ -1,9 +1,8 @@
1
1
  import { useContext } from "react";
2
- import { M as ModuleContext } from "../../layouts/ModuleLayout/index.e7218171.js";
2
+ import { M as ModuleContext } from "../../layouts/ModuleLayout/index-DAtDuh6s.js";
3
3
  const useModule = () => {
4
4
  const context = useContext(ModuleContext);
5
- if (!context)
6
- throw new Error("useModule context must be use inside ModuleContext");
5
+ if (!context) throw new Error("useModule context must be use inside ModuleContext");
7
6
  return context;
8
7
  };
9
8
  export {
package/index.js CHANGED
@@ -1,21 +1,12 @@
1
- import { a } from "./components/index.26c591f5.js";
2
- import { M } from "./components/MFHostApp/index.8ccceab6.js";
3
- import { A, a as a2 } from "./contexts/AuthContext/index.59755369.js";
4
- import { a as a3, d, g } from "./layouts/ModuleLayout/index.e7218171.js";
5
- import { a as a4, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index.748f7ada.js";
6
- import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index.83cd3ea3.js";
7
- import { u } from "./hooks/useMasterDetail/index.d45f2a86.js";
8
- import { u as u2 } from "./hooks/useAuth/index.ae68bf71.js";
9
- import { u as u3 } from "./hooks/useModule/index.b5f598b1.js";
10
- import "@m4l/core";
11
- import "@m4l/graphics";
12
- import "@m4l/components";
13
- import "react/jsx-runtime";
14
- import "react";
15
- import "react-router-dom";
16
- import "@mui/material/styles";
17
- import "@mui/material";
18
- import "@mui/base";
1
+ import { a } from "./components/index-uQ5qk7MJ.js";
2
+ import { M } from "./components/MFHostApp/index-_3WAKrrA.js";
3
+ import { A, a as a2 } from "./contexts/AuthContext/index-DARkRRM4.js";
4
+ import { a as a3, d, g } from "./layouts/ModuleLayout/index-DAtDuh6s.js";
5
+ import { a as a4, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index-DeC4RoBs.js";
6
+ import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index-CUgDdhzy.js";
7
+ import { u } from "./hooks/useMasterDetail/index-D4QUQYYc.js";
8
+ import { u as u2 } from "./hooks/useAuth/index-8hAi3guc.js";
9
+ import { u as u3 } from "./hooks/useModule/index-FY5nsBmE.js";
19
10
  export {
20
11
  A as AuthContext,
21
12
  a2 as AuthProvider,
@@ -1,7 +1,7 @@
1
1
  import { createContext, useState, useRef, useMemo, useCallback } from "react";
2
2
  import { voidFunction, useEnvironment, useModuleDictionary } from "@m4l/core";
3
3
  import { WindowBase, SplitLayout } from "@m4l/components";
4
- import { a as ModuleLayout, g as getModuleLayoutComponentsDictionary } from "../ModuleLayout/index.e7218171.js";
4
+ import { a as ModuleLayout, g as getModuleLayoutComponentsDictionary } from "../ModuleLayout/index-DAtDuh6s.js";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { useResponsiveDesktop } from "@m4l/graphics";
7
7
  import { generateUtilityClasses, generateUtilityClass, styled } from "@mui/material";
@@ -29,7 +29,9 @@ function MasterDetailProvider(props) {
29
29
  }
30
30
  const componentName = "M4LMasterDetailLayout";
31
31
  generateUtilityClasses(componentName, [
32
+ /* elements */
32
33
  "root"
34
+ /* states or variants of elements */
33
35
  ]);
34
36
  function getMasterDetailLayoutUtilityClass(slot) {
35
37
  return generateUtilityClass(componentName, slot);
@@ -58,6 +60,7 @@ function MasterDetailLayout(props) {
58
60
  detailComponent,
59
61
  moduleActions,
60
62
  version
63
+ // defaultDictionary,
61
64
  } = props;
62
65
  const {
63
66
  host_static_assets,
@@ -111,6 +114,7 @@ function MasterDetailLayout(props) {
111
114
  children: typeof detailComponent === "function" ? detailComponent({}) : detailComponent
112
115
  }
113
116
  )
117
+ // actions: undefined,
114
118
  });
115
119
  }, [detailComponent, getLabel]);
116
120
  const finalModuleActions = useMemo(() => {
@@ -146,6 +150,7 @@ const defaultMasterDetailDictionary = {
146
150
  no_split: "No split",
147
151
  view_detail: "View detail"
148
152
  }
153
+ //...defaultModuleLayoutDictionary,
149
154
  };
150
155
  export {
151
156
  MasterDetailContext as M,
@@ -11,8 +11,10 @@ const InnerModuleRoot = styled("div")(({
11
11
  }));
12
12
  const componentName = "M4LModuleLayout";
13
13
  generateUtilityClasses(componentName, [
14
+ /* elements */
14
15
  "root",
15
16
  "moduleContent"
17
+ /* states or variants of elements */
16
18
  ]);
17
19
  function getModuleLayoutUtilityClass(slot) {
18
20
  return generateUtilityClass(componentName, slot);
@@ -74,8 +76,13 @@ function ModuleProvider(props) {
74
76
  }, [finalModuleActions]);
75
77
  return /* @__PURE__ */ jsx(ModuleContext.Provider, {
76
78
  value: {
79
+ // moduleActions: finalModuleActions,
80
+ // dynamicActions,
77
81
  setDynamicActions,
78
82
  moduleId: configOptions.moduleId
83
+ // moduleNameField: configOptions.moduleNameField,
84
+ // urlIcon: configOptions.urlIcon,
85
+ // breadcrumbLinks: configOptions.breadcrumbLinks,
79
86
  },
80
87
  children
81
88
  });
@@ -12,7 +12,7 @@ const InnerModuleRoot = styled("div")(({
12
12
  alignItems: "center",
13
13
  height: "100vh",
14
14
  padding: "20px",
15
- backgroundColor: theme.vars.palette.background.background,
15
+ backgroundColor: theme.vars.palette.background.bold,
16
16
  [theme.breakpoints.down("md")]: {
17
17
  padding: "0px"
18
18
  }
@@ -20,7 +20,7 @@ const InnerModuleRoot = styled("div")(({
20
20
  const DesktopContentRoot = styled$1("div")(({ theme }) => ({
21
21
  display: "flex",
22
22
  borderRadius: "16px",
23
- backgroundColor: theme.vars.palette.background.neutral,
23
+ backgroundColor: theme.vars.palette.background.main,
24
24
  boxShadow: theme.vars.customShadows?.z4,
25
25
  padding: "20px 0 20px 20px",
26
26
  width: "100%",
@@ -51,23 +51,20 @@ const DesktopBanner = styled$1("div")(({ theme }) => ({
51
51
  width: "100%",
52
52
  maxWidth: "400px",
53
53
  height: "100%",
54
- backgroundColor: theme.vars.palette.state?.focus,
54
+ backgroundColor: theme.vars.palette.primary?.focus,
55
55
  boxShadow: theme.vars.customShadows?.z4,
56
56
  padding: "0 60px",
57
57
  gap: "40px",
58
58
  overflow: "hidden",
59
59
  "& .MuiTypography-root": {
60
- color: theme.palette.patronus?.marbleLight[10],
60
+ color: theme.palette.common?.white,
61
61
  display: "flex",
62
62
  justifyContent: "center",
63
63
  textAlign: "center",
64
64
  textTransform: "uppercase"
65
65
  },
66
66
  "& .M4LTypography-root .MuiSkeleton-root": {
67
- backgroundColor: alpha(
68
- `${theme.colorSchemes.finalTheme.palette.patronus?.marbleLight[10]}`,
69
- 0.24
70
- ),
67
+ backgroundColor: alpha(`${theme.colorSchemes.finalTheme.palette.common.white}`, 0.24),
71
68
  margin: "auto"
72
69
  }
73
70
  }));
@@ -76,15 +73,12 @@ const ContainerLogo$1 = styled$1("div")(({ theme }) => ({
76
73
  width: "84px",
77
74
  height: "84px",
78
75
  borderRadius: "6px",
79
- backgroundColor: theme.vars.palette.state?.active,
76
+ backgroundColor: theme.vars.palette.primary?.active,
80
77
  justifyContent: "center",
81
78
  alignItems: "center",
82
- boxShadow: `0px 4px 8px ${alpha(
83
- theme.colorSchemes.finalTheme.palette.patronus?.coolGrey[70] || "",
84
- 0.16
85
- )}`,
79
+ boxShadow: `0px 4px 8px ${alpha(theme.colorSchemes.finalTheme.palette.grey["700"] || "", 0.16)}`,
86
80
  "& .M4LImage-root": {
87
- backgroundColor: theme.vars.palette.patronus?.marbleLight[10],
81
+ backgroundColor: theme.vars.palette.common?.white,
88
82
  borderRadius: "6px"
89
83
  }
90
84
  }));
@@ -205,7 +199,7 @@ const MobileContentRoot = styled$1("div")(({ theme }) => ({
205
199
  flexDirection: "column",
206
200
  width: "100%",
207
201
  height: "100%",
208
- backgroundColor: theme.vars.palette.background.neutral,
202
+ backgroundColor: theme.vars.palette.background.main,
209
203
  padding: "12px",
210
204
  gap: "32px"
211
205
  }));
@@ -215,7 +209,7 @@ const MobileBanner = styled$1("div")(({ theme }) => ({
215
209
  padding: "12px",
216
210
  gap: "20px",
217
211
  width: "100%",
218
- backgroundColor: theme.vars.palette.state?.focus,
212
+ backgroundColor: theme.vars.palette.primary?.focus,
219
213
  boxShadow: theme.customShadows?.z4,
220
214
  position: "relative",
221
215
  borderRadius: "8px",
@@ -231,16 +225,16 @@ const MobileBanner = styled$1("div")(({ theme }) => ({
231
225
  right: "40px",
232
226
  zIndex: 1,
233
227
  "& .M4LIcon-root .M4LIcon-icon": {
234
- backgroundColor: theme.vars.palette.patronus?.marbleLight[10]
228
+ backgroundColor: theme.vars.palette.common?.white
235
229
  }
236
230
  },
237
231
  "& .MuiTypography-root": {
238
- color: theme.vars.palette.patronus?.marbleLight[10],
232
+ color: theme.vars.palette.common?.white,
239
233
  display: "flex",
240
234
  textTransform: "uppercase"
241
235
  },
242
236
  "& .MuiSkeleton-root": {
243
- backgroundColor: alpha(`${theme.colorSchemes.finalTheme.palette.patronus?.marbleLight[10]}`, 0.24),
237
+ backgroundColor: alpha(`${theme.colorSchemes.finalTheme.palette.common.white}`, 0.24),
244
238
  margin: "auto"
245
239
  }
246
240
  }));
@@ -252,12 +246,12 @@ const ContainerLogo = styled$1("div")(({ theme }) => ({
252
246
  width: "52px",
253
247
  height: "52px",
254
248
  borderRadius: "6px",
255
- backgroundColor: theme.vars.palette.state?.active,
249
+ backgroundColor: theme.vars.palette.primary?.active,
256
250
  justifyContent: "center",
257
251
  alignItems: "center",
258
- boxShadow: `0px 4px 8px ${alpha(theme.colorSchemes.finalTheme.palette.patronus?.coolGrey[70] || "", 0.16)}`,
252
+ boxShadow: `0px 4px 8px ${alpha(theme.colorSchemes.finalTheme.palette.grey["700"] || "", 0.16)}`,
259
253
  "& .M4LImage-root": {
260
- backgroundColor: theme.vars.palette.patronus?.marbleLight[10],
254
+ backgroundColor: theme.vars.palette.common?.white,
261
255
  borderRadius: "6px"
262
256
  }
263
257
  }));
@@ -0,0 +1 @@
1
+
@@ -1 +0,0 @@
1
-
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "2.0.4",
3
+ "version": "3.0.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "private": false,
7
7
  "dependencies": {
8
8
  "@mui/material": "5.15.19",
9
9
  "@m4l/core": "^2.0.0",
10
- "@m4l/graphics": "^2.0.0",
11
- "@m4l/styles": "^2.0.0"
10
+ "@m4l/graphics": "^3.0.0",
11
+ "@m4l/styles": "^3.0.0"
12
12
  },
13
13
  "peerDependencies": {
14
- "@m4l/components": "^3.0.0",
14
+ "@m4l/components": "^4.0.0",
15
15
  "@types/react": "^17.0.0 || ^18.0.0",
16
16
  "@types/react-dom": "^17.0.0 || ^18.0.0",
17
17
  "eventemitter3": "^4.0.7",
package/vite-env.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- /// <reference types="vite/client" />
2
- /// <reference types="vitest" />
3
- /// <reference types="vitest/importMeta" />
1
+ /// <reference types="vite/client" />
2
+ /// <reference types="vitest" />
3
+ /// <reference types="vitest/importMeta" />
@@ -1 +0,0 @@
1
- import "./AuthContext/index.59755369.js";
@@ -1,4 +0,0 @@
1
- import "react";
2
- import "../layouts/MasterDetailLayout/index.748f7ada.js";
3
- import "../contexts/AuthContext/index.59755369.js";
4
- import "../layouts/ModuleLayout/index.e7218171.js";
@@ -1,8 +0,0 @@
1
- import "./ModuleLayout/index.e7218171.js";
2
- import "@m4l/components";
3
- import "react";
4
- import "@m4l/core";
5
- import "./MasterDetailLayout/index.748f7ada.js";
6
- import "@m4l/graphics";
7
- import "react/jsx-runtime";
8
- import "./NoAuthModuleLayout/index.83cd3ea3.js";