@m4l/layouts 2.0.0 → 2.0.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.
@@ -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);
@@ -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 { M } from "./components/index.56bd7864.js";
2
- import { M as M2 } from "./components/MFHostApp/index.6286a793.js";
3
- import { A, a } from "./contexts/AuthContext/index.59755369.js";
4
- import { a as a2, d, g } from "./layouts/ModuleLayout/index.e7218171.js";
5
- import { a as a3, 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-router-dom";
15
- import "react";
16
- import "@mui/material/styles";
17
- import "@mui/material";
18
- import "@mui/base";
1
+ import { M } from "./components/index-BydiHRF0.js";
2
+ import { M as M2 } from "./components/MFHostApp/index-CKsHsRY8.js";
3
+ import { A, a } from "./contexts/AuthContext/index-DARkRRM4.js";
4
+ import { a as a2, d, g } from "./layouts/ModuleLayout/index-DAtDuh6s.js";
5
+ import { a as a3, 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-BxJ0vCUq.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
  a 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
  });
@@ -269,6 +269,8 @@ const CompanyName = styled$1("div")(() => ({
269
269
  const FormContent = styled$1("div")(() => ({
270
270
  display: "flex",
271
271
  flexDirection: "column",
272
+ /* justifyContent: 'flex-start',
273
+ alignItems: 'center', */
272
274
  padding: "12px",
273
275
  margin: "auto 0",
274
276
  width: "100%",
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "private": false,
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" />
File without changes