@m4l/layouts 0.1.39 → 0.1.41

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.
Files changed (32) hide show
  1. package/components/BaseModule/index.6309486a.js +24 -24
  2. package/components/MFHostApp/index.420c2626.js +58 -58
  3. package/components/MFIsolationApp/index.e36cf308.js +137 -117
  4. package/contexts/AuthContext/index.6f966215.js +118 -88
  5. package/hooks/index.33191825.js +4 -0
  6. package/hooks/useAuth/index.cb6a3420.js +7 -7
  7. package/hooks/useMasterDetail/index.be4908d9.js +6 -0
  8. package/hooks/useModule/index.b5f598b1.js +11 -0
  9. package/index.js +29 -27
  10. package/layouts/MasterDetailLayout/classes/constants.d.ts +1 -0
  11. package/layouts/MasterDetailLayout/classes/index.d.ts +6 -0
  12. package/layouts/MasterDetailLayout/classes/types.d.ts +6 -0
  13. package/layouts/MasterDetailLayout/index.fe6ac47b.js +163 -0
  14. package/layouts/MasterDetailLayout/styles.d.ts +2 -0
  15. package/layouts/ModuleLayout/classes/constants.d.ts +1 -0
  16. package/layouts/ModuleLayout/classes/index.d.ts +7 -0
  17. package/layouts/ModuleLayout/classes/types.d.ts +7 -0
  18. package/layouts/ModuleLayout/index.e7218171.js +122 -0
  19. package/layouts/ModuleLayout/subcomponents/InnerModule/styles.d.ts +1 -2
  20. package/layouts/NoAuthModuleLayout/index.2808fa44.js +379 -0
  21. package/layouts/index.96a3745e.js +8 -0
  22. package/layouts/index.d.ts +2 -2
  23. package/package.json +2 -1
  24. package/hooks/index.a0c767ed.js +0 -4
  25. package/hooks/useMasterDetail/index.927c0c26.js +0 -6
  26. package/hooks/useModule/index.edcd7b28.js +0 -11
  27. package/layouts/MasterDetailLayout/index.bca0fce5.js +0 -118
  28. package/layouts/ModuleLayout/index.850f7dcf.js +0 -103
  29. package/layouts/NoAuthModuleLayout/index.eabf38c1.js +0 -345
  30. package/layouts/index.07aacf57.js +0 -8
  31. /package/layouts/MasterDetailLayout/{index.d.ts → MasterDetailLayout.d.ts} +0 -0
  32. /package/layouts/ModuleLayout/{index.d.ts → ModuleLayout.d.ts} +0 -0
@@ -1,103 +0,0 @@
1
- import { useModal as x, useWindowToolsMF as v, ModalProvider as g, getModalDialogComponentsDictionary as h } from "@m4l/components";
2
- import { forwardRef as p, useRef as m, useImperativeHandle as f, createContext as I, useState as a, useMemo as C, useEffect as A } from "react";
3
- import { styled as M } from "@mui/material/styles";
4
- import { jsx as t } from "react/jsx-runtime";
5
- const D = M("div")(() => ({
6
- display: "flex",
7
- flexDirection: "column",
8
- position: "absolute",
9
- margin: "0px 12px 12px 12px",
10
- left: "0px",
11
- right: "0px",
12
- top: "0px",
13
- bottom: "0px",
14
- overflow: "hidden"
15
- })), w = M("div")(({
16
- theme: o
17
- }) => ({
18
- display: "flex",
19
- position: "relative",
20
- marginTop: o.spacing(1),
21
- justifyContent: "center",
22
- flexGrow: "1",
23
- overflow: "hidden"
24
- })), y = p((o, r) => {
25
- const {
26
- children: e
27
- } = o, {
28
- openModal: l
29
- } = x(), n = m(null);
30
- return f(r, () => ({
31
- openModal: l,
32
- current: n.current
33
- })), /* @__PURE__ */ t(D, {
34
- id: "WrapperInnerModule",
35
- className: "m4l_module_layout",
36
- ref: n,
37
- children: /* @__PURE__ */ t(w, {
38
- id: "ModuleContent",
39
- children: e
40
- })
41
- });
42
- });
43
- y.displayName = "InnerModule";
44
- const L = I(null);
45
- function R(o) {
46
- const {
47
- children: r,
48
- moduleActions: e,
49
- moduleId: l,
50
- version: n
51
- } = o, [u] = a(() => ({
52
- moduleId: l,
53
- dictionary: void 0
54
- })), {
55
- setActions: d
56
- } = v(), [i, s] = a([]), c = C(() => (e || []).concat(i), [e, i]);
57
- return A(() => {
58
- d(c, n);
59
- }, [c]), /* @__PURE__ */ t(L.Provider, {
60
- value: {
61
- setDynamicActions: s,
62
- moduleId: u.moduleId
63
- },
64
- children: r
65
- });
66
- }
67
- const _ = p((o, r) => {
68
- const {
69
- moduleId: e,
70
- moduleActions: l,
71
- version: n,
72
- children: u
73
- } = o, d = m(null), i = (s) => {
74
- d.current?.openModal(s);
75
- };
76
- return f(r, () => ({
77
- openModal: i,
78
- current: d.current
79
- })), /* @__PURE__ */ t(R, {
80
- moduleId: e,
81
- moduleActions: l,
82
- version: n,
83
- children: /* @__PURE__ */ t(g, {
84
- children: /* @__PURE__ */ t(y, {
85
- ref: d,
86
- children: u
87
- })
88
- })
89
- });
90
- });
91
- _.displayName = "ModuleLayout";
92
- function j() {
93
- return ["module_layout"].concat(h());
94
- }
95
- const T = {
96
- module_layout: {}
97
- };
98
- export {
99
- L as M,
100
- _ as a,
101
- T as d,
102
- j as g
103
- };
@@ -1,345 +0,0 @@
1
- import { useResponsiveDesktop as I, useLocales as $ } from "@m4l/graphics";
2
- import { LanguagePopover as h, Image as x, Typography as a, ScrollBar as m, HelmetPage as W } from "@m4l/components";
3
- import { styled as t, alpha as d } from "@mui/material/styles";
4
- import { useBase as u, useModuleDictionary as g, useDomain as y, useEnvironment as H, BaseProvider as N, FlagsProvider as R, ModuleDictionaryProvider as U, ModuleSkeletonProvider as F } from "@m4l/core";
5
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
6
- const P = t("div")(({
7
- theme: o
8
- }) => ({
9
- display: "flex",
10
- justifyContent: "center",
11
- alignItems: "center",
12
- height: "100vh",
13
- padding: "20px",
14
- backgroundColor: o.palette.background.background,
15
- [o.breakpoints.down("md")]: {
16
- padding: "0px"
17
- }
18
- })), j = t("div")(({ theme: o }) => ({
19
- display: "flex",
20
- borderRadius: "16px",
21
- backgroundColor: o.palette.background.neutral,
22
- boxShadow: o.customShadows?.z4,
23
- padding: "20px 0 20px 20px",
24
- width: "100%",
25
- height: "100%",
26
- maxWidth: "965px",
27
- maxHeight: "900px",
28
- position: "relative",
29
- overflow: "auto",
30
- "& .M4LanguagePopover-root": {
31
- position: "absolute",
32
- top: "20px",
33
- right: "20px",
34
- zIndex: 1
35
- }
36
- })), T = t("div")(({ theme: o }) => ({
37
- display: "flex",
38
- flexDirection: "column",
39
- justifyContent: "center",
40
- alignItems: "center",
41
- borderRadius: "16px",
42
- width: "100%",
43
- maxWidth: "400px",
44
- height: "100%",
45
- backgroundColor: o.palette.state?.focus,
46
- boxShadow: o.customShadows?.z4,
47
- padding: "0 60px",
48
- gap: "40px",
49
- overflow: "hidden",
50
- "& .MuiTypography-root": {
51
- color: o.palette.patronus?.marbleLight[10],
52
- display: "flex",
53
- justifyContent: "center",
54
- textAlign: "center",
55
- textTransform: "uppercase"
56
- },
57
- "& .M4LTypography-root .MuiSkeleton-root": {
58
- backgroundColor: d(`${o.palette.patronus?.marbleLight[10]}`, 0.24),
59
- margin: "auto"
60
- }
61
- })), A = t("div")(({ theme: o }) => ({
62
- display: "flex",
63
- width: "84px",
64
- height: "84px",
65
- borderRadius: "6px",
66
- backgroundColor: o.palette.state?.active,
67
- justifyContent: "center",
68
- alignItems: "center",
69
- boxShadow: `0px 4px 8px ${d(o.palette.patronus?.coolGrey[70] || "", 0.16)}`,
70
- "& .M4LImage-root": {
71
- backgroundColor: o.palette.patronus?.marbleLight[10],
72
- borderRadius: "6px"
73
- }
74
- })), B = t("div")(() => ({
75
- display: "flex",
76
- flexDirection: "column",
77
- gap: "5px",
78
- width: "100%"
79
- })), z = t("div")(() => ({
80
- display: "flex",
81
- flexDirection: "column",
82
- gap: "5px",
83
- width: "100%"
84
- })), G = t("div")(() => ({
85
- display: "flex",
86
- flexDirection: "column",
87
- padding: "0 60px 0 80px",
88
- margin: "auto 0",
89
- width: "100%",
90
- gap: "20px"
91
- })), E = t("div")(() => ({
92
- display: "flex",
93
- width: "100%",
94
- height: "100%"
95
- })), q = t("div")(() => ({
96
- display: "flex",
97
- flexDirection: "column",
98
- width: "100%",
99
- gap: "4px"
100
- })), J = () => {
101
- const {
102
- children: o,
103
- companyLogoSmallUrl: l
104
- } = u(), {
105
- getLabel: n
106
- } = g(), {
107
- name: r
108
- } = y();
109
- return /* @__PURE__ */ i(j, {
110
- children: [/* @__PURE__ */ e(h, {}), /* @__PURE__ */ i(T, {
111
- children: [/* @__PURE__ */ e(A, {
112
- children: /* @__PURE__ */ e(x, {
113
- src: l,
114
- ratio: "1:1",
115
- width: "64px",
116
- height: "64px"
117
- })
118
- }), /* @__PURE__ */ i(B, {
119
- children: [/* @__PURE__ */ e(a, {
120
- variant: "subtitleDens",
121
- skeletonWidth: "70%",
122
- skeletongHeight: "24px",
123
- children: r
124
- }), /* @__PURE__ */ e(a, {
125
- variant: "paragraph",
126
- skeletonWidth: "40%",
127
- skeletongHeight: "20px",
128
- children: n("company_name_subtitle")
129
- })]
130
- }), /* @__PURE__ */ i(z, {
131
- children: [/* @__PURE__ */ e(a, {
132
- variant: "h5",
133
- skeletonWidth: "50%",
134
- skeletongHeight: "36px",
135
- children: n("module_leyend")
136
- }), /* @__PURE__ */ e(a, {
137
- variant: "subtitle",
138
- skeletonWidth: "80%",
139
- skeletongHeight: "24px",
140
- children: "slogan"
141
- })]
142
- })]
143
- }), /* @__PURE__ */ e(E, {
144
- children: /* @__PURE__ */ e(m, {
145
- children: /* @__PURE__ */ i(G, {
146
- children: [/* @__PURE__ */ i(q, {
147
- children: [/* @__PURE__ */ e(a, {
148
- variant: "h5",
149
- skeletonWidth: "20%",
150
- skeletongHeight: "36px",
151
- children: n("module_name")
152
- }), /* @__PURE__ */ e(a, {
153
- variant: "paragraph",
154
- skeletonWidth: "40%",
155
- skeletongHeight: "20px",
156
- children: n("module_description")
157
- })]
158
- }), o]
159
- })
160
- })
161
- })]
162
- });
163
- }, K = t("div")(({ theme: o }) => ({
164
- display: "flex",
165
- flexDirection: "column",
166
- width: "100%",
167
- height: "100%",
168
- backgroundColor: o.palette.background.neutral,
169
- padding: "12px",
170
- gap: "32px"
171
- })), O = t("div")(({ theme: o }) => ({
172
- display: "flex",
173
- flexDirection: "column",
174
- padding: "12px",
175
- gap: "20px",
176
- width: "100%",
177
- backgroundColor: o.palette.state?.focus,
178
- boxShadow: o.customShadows?.z4,
179
- position: "relative",
180
- borderRadius: "8px",
181
- "& .M4LanguagePopover-root": {
182
- position: "absolute",
183
- top: "12px",
184
- right: "12px"
185
- },
186
- "& .MuiTypography-root": {
187
- color: o.palette.patronus?.marbleLight[10],
188
- display: "flex",
189
- textTransform: "uppercase"
190
- },
191
- "& .MuiSkeleton-root": {
192
- backgroundColor: d(`${o.palette.patronus?.marbleLight[10]}`, 0.24),
193
- margin: "auto"
194
- }
195
- }));
196
- t("div")(() => ({
197
- display: "flex"
198
- }));
199
- const Q = t("div")(({ theme: o }) => ({
200
- display: "flex",
201
- width: "52px",
202
- height: "52px",
203
- borderRadius: "6px",
204
- backgroundColor: o.palette.state?.active,
205
- justifyContent: "center",
206
- alignItems: "center",
207
- boxShadow: `0px 4px 8px ${d(o.palette.patronus?.coolGrey[70] || "", 0.16)}`,
208
- "& .M4LImage-root": {
209
- backgroundColor: o.palette.patronus?.marbleLight[10],
210
- borderRadius: "6px"
211
- }
212
- })), V = t("div")(() => ({
213
- display: "flex",
214
- flexDirection: "column",
215
- width: "100%"
216
- })), X = t("div")(() => ({
217
- display: "flex",
218
- flexDirection: "column",
219
- padding: "12px",
220
- margin: "auto 0",
221
- width: "100%",
222
- gap: "20px"
223
- })), Y = t("div")(() => ({
224
- display: "flex",
225
- width: "100%",
226
- height: "100%",
227
- overflow: "hidden"
228
- })), Z = t("div")(() => ({
229
- display: "flex",
230
- flexDirection: "column",
231
- width: "100%",
232
- gap: "4px"
233
- })), oo = () => {
234
- const {
235
- children: o,
236
- companyLogoSmallUrl: l
237
- } = u(), {
238
- getLabel: n
239
- } = g(), {
240
- name: r
241
- } = y();
242
- return /* @__PURE__ */ i(K, {
243
- children: [/* @__PURE__ */ i(O, {
244
- children: [/* @__PURE__ */ e(Q, {
245
- children: /* @__PURE__ */ e(x, {
246
- src: l,
247
- ratio: "1:1",
248
- width: "44px",
249
- height: "44px"
250
- })
251
- }), /* @__PURE__ */ i(V, {
252
- children: [/* @__PURE__ */ e(a, {
253
- variant: "subtitleDens",
254
- skeletonWidth: "70%",
255
- skeletongHeight: "24px",
256
- children: r
257
- }), /* @__PURE__ */ e(a, {
258
- variant: "paragraph",
259
- skeletonWidth: "40%",
260
- skeletongHeight: "20px",
261
- children: n("company_name_subtitle")
262
- })]
263
- }), /* @__PURE__ */ e(h, {})]
264
- }), /* @__PURE__ */ e(Y, {
265
- children: /* @__PURE__ */ e(m, {
266
- children: /* @__PURE__ */ i(X, {
267
- children: [/* @__PURE__ */ i(Z, {
268
- children: [/* @__PURE__ */ e(a, {
269
- variant: "h5",
270
- skeletonWidth: "20%",
271
- skeletongHeight: "36px",
272
- children: n("module_name")
273
- }), /* @__PURE__ */ e(a, {
274
- variant: "paragraph",
275
- skeletonWidth: "40%",
276
- skeletongHeight: "20px",
277
- children: n("module_description")
278
- })]
279
- }), o]
280
- })
281
- })
282
- })]
283
- });
284
- }, eo = () => {
285
- const {
286
- getModuleLabel: o
287
- } = g(), l = I(), {
288
- subtitle: n
289
- } = u();
290
- return /* @__PURE__ */ e(W, {
291
- title: o(),
292
- subtitle: n,
293
- children: /* @__PURE__ */ e(P, {
294
- children: l ? /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ e(oo, {})
295
- })
296
- });
297
- }, ro = (o) => {
298
- const {
299
- moduleId: l,
300
- moduleNameField: n,
301
- children: r,
302
- componentsDictionary: f,
303
- skeletonFlags: b,
304
- subtitle: v,
305
- companyLogoSmallUrl: k,
306
- companyLogoNormalUrl: C,
307
- moduleIlustrationUrl: L
308
- } = o, {
309
- host_static_assets: s,
310
- environment_assets: p
311
- } = H(), w = $().currentLocale?.localeString, D = C || `${s}/${p}/frontend/commons/assets/icons/logotipo_m4l.svg`, M = k || `${s}/${p}/frontend/commons/assets/icons/isotipo_m4l.svg`, _ = L || `${s}/${p}/frontend/domain/host/commons/assets/img/illustration_noauth.png`, c = b;
312
- return c.findIndex((S) => S === "dictionary_loaded") < 0 && c.push("dictionary_loaded"), /* @__PURE__ */ e(N, {
313
- value: {
314
- subtitle: v,
315
- companyLogoSmallUrl: M,
316
- companyLogoNormalUrl: D,
317
- moduleIlustrationUrl: _,
318
- children: r
319
- },
320
- children: /* @__PURE__ */ e(R, {
321
- children: /* @__PURE__ */ e(U, {
322
- isAuth: !1,
323
- moduleId: l,
324
- moduleNameField: n,
325
- componentsDictionary: f,
326
- currentLang: w,
327
- children: /* @__PURE__ */ e(F, {
328
- flags: c,
329
- children: /* @__PURE__ */ e(eo, {})
330
- })
331
- })
332
- })
333
- });
334
- };
335
- function so() {
336
- return ["no_auth_module_layout"];
337
- }
338
- const po = {
339
- no_auth_module_layout: {}
340
- };
341
- export {
342
- ro as N,
343
- po as d,
344
- so as g
345
- };
@@ -1,8 +0,0 @@
1
- import "./ModuleLayout/index.850f7dcf.js";
2
- import "@m4l/components";
3
- import "react";
4
- import "@m4l/core";
5
- import "./MasterDetailLayout/index.bca0fce5.js";
6
- import "@m4l/graphics";
7
- import "react/jsx-runtime";
8
- import "./NoAuthModuleLayout/index.eabf38c1.js";