@m4l/layouts 2.0.2 → 2.0.3
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/components/MFHostApp/{index-_3WAKrrA.js → index.8ccceab6.js} +1 -1
- package/components/{index-uQ5qk7MJ.js → index.26c591f5.js} +1 -0
- package/contexts/AuthContext/{index-DARkRRM4.js → index.59755369.js} +3 -4
- package/contexts/index.2c681457.js +1 -0
- package/hooks/index.bec02723.js +4 -0
- package/hooks/useAuth/{index-8hAi3guc.js → index.ae68bf71.js} +3 -2
- package/hooks/useMasterDetail/{index-D4QUQYYc.js → index.d45f2a86.js} +1 -1
- package/hooks/useModule/{index-FY5nsBmE.js → index.b5f598b1.js} +3 -2
- package/index.js +18 -9
- package/layouts/MasterDetailLayout/{index-DeC4RoBs.js → index.748f7ada.js} +1 -6
- package/layouts/ModuleLayout/{index-DAtDuh6s.js → index.e7218171.js} +0 -7
- package/layouts/NoAuthModuleLayout/{index-BxJ0vCUq.js → index.83cd3ea3.js} +0 -2
- package/layouts/index.b6d6ef2f.js +8 -0
- package/m4l_layouts/types.d.ts +1 -0
- package/package.json +6 -6
- package/vite-env.d.ts +3 -3
- package/contexts/index-l0sNRNKZ.js +0 -1
- package/hooks/index-l0sNRNKZ.js +0 -1
- package/layouts/index-l0sNRNKZ.js +0 -1
|
@@ -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";
|
|
5
6
|
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,6 +3,7 @@ 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";
|
|
6
7
|
function MFNoAuthApp(props) {
|
|
7
8
|
const {
|
|
8
9
|
children,
|
|
@@ -61,9 +61,8 @@ 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
|
|
65
64
|
"vSession",
|
|
66
|
-
|
|
65
|
+
new Date().getTime() + ""
|
|
67
66
|
);
|
|
68
67
|
useEffect(() => {
|
|
69
68
|
const initialize = async () => {
|
|
@@ -125,7 +124,7 @@ function AuthProvider(props) {
|
|
|
125
124
|
user
|
|
126
125
|
}
|
|
127
126
|
});
|
|
128
|
-
setNextValSession(
|
|
127
|
+
setNextValSession(new Date().getTime() + "");
|
|
129
128
|
});
|
|
130
129
|
};
|
|
131
130
|
const logout = async (isAuthenticated) => {
|
|
@@ -138,7 +137,7 @@ function AuthProvider(props) {
|
|
|
138
137
|
dispatch({
|
|
139
138
|
type: EnumTypes.Logout
|
|
140
139
|
});
|
|
141
|
-
setNextValSession(
|
|
140
|
+
setNextValSession(new Date().getTime() + "");
|
|
142
141
|
};
|
|
143
142
|
const onNetserviceUnautorized = () => {
|
|
144
143
|
logout(false);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./AuthContext/index.59755369.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { A as AuthContext } from "../../contexts/AuthContext/index
|
|
2
|
+
import { A as AuthContext } from "../../contexts/AuthContext/index.59755369.js";
|
|
3
3
|
const useAuth = () => {
|
|
4
4
|
const context = useContext(AuthContext);
|
|
5
|
-
if (!context)
|
|
5
|
+
if (!context)
|
|
6
|
+
throw new Error("Auth context must be use inside AuthProvider");
|
|
6
7
|
return context;
|
|
7
8
|
};
|
|
8
9
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index
|
|
2
|
+
import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index.748f7ada.js";
|
|
3
3
|
const useMasterDetail = () => useContext(MasterDetailContext);
|
|
4
4
|
export {
|
|
5
5
|
useMasterDetail as u
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { M as ModuleContext } from "../../layouts/ModuleLayout/index
|
|
2
|
+
import { M as ModuleContext } from "../../layouts/ModuleLayout/index.e7218171.js";
|
|
3
3
|
const useModule = () => {
|
|
4
4
|
const context = useContext(ModuleContext);
|
|
5
|
-
if (!context)
|
|
5
|
+
if (!context)
|
|
6
|
+
throw new Error("useModule context must be use inside ModuleContext");
|
|
6
7
|
return context;
|
|
7
8
|
};
|
|
8
9
|
export {
|
package/index.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { a } from "./components/index
|
|
2
|
-
import { M } from "./components/MFHostApp/index
|
|
3
|
-
import { A, a as a2 } from "./contexts/AuthContext/index
|
|
4
|
-
import { a as a3, d, g } from "./layouts/ModuleLayout/index
|
|
5
|
-
import { a as a4, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index
|
|
6
|
-
import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index
|
|
7
|
-
import { u } from "./hooks/useMasterDetail/index
|
|
8
|
-
import { u as u2 } from "./hooks/useAuth/index
|
|
9
|
-
import { u as u3 } from "./hooks/useModule/index
|
|
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";
|
|
10
19
|
export {
|
|
11
20
|
A as AuthContext,
|
|
12
21
|
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
|
|
4
|
+
import { a as ModuleLayout, g as getModuleLayoutComponentsDictionary } from "../ModuleLayout/index.e7218171.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,9 +29,7 @@ function MasterDetailProvider(props) {
|
|
|
29
29
|
}
|
|
30
30
|
const componentName = "M4LMasterDetailLayout";
|
|
31
31
|
generateUtilityClasses(componentName, [
|
|
32
|
-
/* elements */
|
|
33
32
|
"root"
|
|
34
|
-
/* states or variants of elements */
|
|
35
33
|
]);
|
|
36
34
|
function getMasterDetailLayoutUtilityClass(slot) {
|
|
37
35
|
return generateUtilityClass(componentName, slot);
|
|
@@ -60,7 +58,6 @@ function MasterDetailLayout(props) {
|
|
|
60
58
|
detailComponent,
|
|
61
59
|
moduleActions,
|
|
62
60
|
version
|
|
63
|
-
// defaultDictionary,
|
|
64
61
|
} = props;
|
|
65
62
|
const {
|
|
66
63
|
host_static_assets,
|
|
@@ -114,7 +111,6 @@ function MasterDetailLayout(props) {
|
|
|
114
111
|
children: typeof detailComponent === "function" ? detailComponent({}) : detailComponent
|
|
115
112
|
}
|
|
116
113
|
)
|
|
117
|
-
// actions: undefined,
|
|
118
114
|
});
|
|
119
115
|
}, [detailComponent, getLabel]);
|
|
120
116
|
const finalModuleActions = useMemo(() => {
|
|
@@ -150,7 +146,6 @@ const defaultMasterDetailDictionary = {
|
|
|
150
146
|
no_split: "No split",
|
|
151
147
|
view_detail: "View detail"
|
|
152
148
|
}
|
|
153
|
-
//...defaultModuleLayoutDictionary,
|
|
154
149
|
};
|
|
155
150
|
export {
|
|
156
151
|
MasterDetailContext as M,
|
|
@@ -11,10 +11,8 @@ const InnerModuleRoot = styled("div")(({
|
|
|
11
11
|
}));
|
|
12
12
|
const componentName = "M4LModuleLayout";
|
|
13
13
|
generateUtilityClasses(componentName, [
|
|
14
|
-
/* elements */
|
|
15
14
|
"root",
|
|
16
15
|
"moduleContent"
|
|
17
|
-
/* states or variants of elements */
|
|
18
16
|
]);
|
|
19
17
|
function getModuleLayoutUtilityClass(slot) {
|
|
20
18
|
return generateUtilityClass(componentName, slot);
|
|
@@ -76,13 +74,8 @@ function ModuleProvider(props) {
|
|
|
76
74
|
}, [finalModuleActions]);
|
|
77
75
|
return /* @__PURE__ */ jsx(ModuleContext.Provider, {
|
|
78
76
|
value: {
|
|
79
|
-
// moduleActions: finalModuleActions,
|
|
80
|
-
// dynamicActions,
|
|
81
77
|
setDynamicActions,
|
|
82
78
|
moduleId: configOptions.moduleId
|
|
83
|
-
// moduleNameField: configOptions.moduleNameField,
|
|
84
|
-
// urlIcon: configOptions.urlIcon,
|
|
85
|
-
// breadcrumbLinks: configOptions.breadcrumbLinks,
|
|
86
79
|
},
|
|
87
80
|
children
|
|
88
81
|
});
|
|
@@ -269,8 +269,6 @@ 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', */
|
|
274
272
|
padding: "12px",
|
|
275
273
|
margin: "auto 0",
|
|
276
274
|
width: "100%",
|
|
@@ -0,0 +1,8 @@
|
|
|
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";
|
package/m4l_layouts/types.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/layouts",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "M4L Team",
|
|
6
6
|
"private": false,
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@
|
|
9
|
-
"@m4l/
|
|
10
|
-
"@m4l/
|
|
11
|
-
"@m4l/
|
|
12
|
-
"@
|
|
8
|
+
"@mui/material": "5.15.19",
|
|
9
|
+
"@m4l/components": "^3.0.0",
|
|
10
|
+
"@m4l/core": "^2.0.0",
|
|
11
|
+
"@m4l/graphics": "^2.0.0",
|
|
12
|
+
"@m4l/styles": "^2.0.0"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"@types/react": "^17.0.0 || ^18.0.0",
|
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
|
-
|
package/hooks/index-l0sNRNKZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|