@m4l/layouts 0.1.18 → 0.1.19

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.
@@ -0,0 +1,52 @@
1
+ import { unstable_HistoryRouter as l } from "react-router-dom";
2
+ import { EnvironmentProvider as a, HostToolsProvider as u, NetworkProvider as h, DomainCountryProvider as y } from "@m4l/core";
3
+ import { LocalesProvider as F, HostThemeProvider as v, FormatterProvider as b } from "@m4l/graphics";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ function E(t) {
6
+ const {
7
+ children: i,
8
+ currentLocale: n,
9
+ hostTheme: s,
10
+ environment: m,
11
+ hostTools: e,
12
+ axiosOperation: c,
13
+ formatters: o,
14
+ dynamicMFParameters: d
15
+ } = t;
16
+ return console.log("formatters", o), /* @__PURE__ */ r(a, {
17
+ ...m,
18
+ children: /* @__PURE__ */ r(u, {
19
+ ...e,
20
+ children: /* @__PURE__ */ r(h, {
21
+ axiosOperation: c,
22
+ children: /* @__PURE__ */ r(F, {
23
+ isMicroFrontEnd: !0,
24
+ localeHost: n,
25
+ children: /* @__PURE__ */ r(v, {
26
+ isMicroFrontEnd: !0,
27
+ ...s,
28
+ children: /* @__PURE__ */ r(l, {
29
+ history: e.history,
30
+ children: /* @__PURE__ */ r(y, {
31
+ isMicroFrontEnd: !0,
32
+ id: d?.id || 1,
33
+ currency: o.currencyFormatter.symbol,
34
+ currency_decimal_digits: o.currencyFormatter.decimalDigits,
35
+ decimal_symbol: o.numberFormatter.decimalSymbol,
36
+ thousands_symbol: o.numberFormatter.thousandsSymbol,
37
+ children: /* @__PURE__ */ r(b, {
38
+ isMicroFrontEnd: !0,
39
+ ...o,
40
+ children: i
41
+ })
42
+ })
43
+ })
44
+ })
45
+ })
46
+ })
47
+ })
48
+ });
49
+ }
50
+ export {
51
+ E as M
52
+ };
@@ -1,13 +1,17 @@
1
1
  import { ReactNode } from 'react';
2
2
  import type { AxiosOperation, EnvironmentType, HostToolsType } from '@m4l/core';
3
- import { HostThemeType, LocaleType } from '@m4l/graphics';
3
+ import { Formatters, HostThemeType, LocaleType } from '@m4l/graphics';
4
+ export interface DynamicMFParameters extends Record<string, any> {
5
+ version: number;
6
+ }
4
7
  export interface ByHostProps {
5
8
  environment: EnvironmentType;
6
9
  hostTools: HostToolsType;
7
- axiosOperation: AxiosOperation;
8
10
  hostTheme: HostThemeType;
9
11
  currentLocale: LocaleType;
10
- domainCountryId: number;
12
+ axiosOperation: AxiosOperation;
13
+ formatters: Formatters;
14
+ dynamicMFParameters: DynamicMFParameters;
11
15
  }
12
16
  export interface MFHostAppProps extends ByHostProps {
13
17
  children: ReactNode;
@@ -0,0 +1,106 @@
1
+ import { useEffect as _, useMemo as m } from "react";
2
+ import { unstable_HistoryRouter as P } from "react-router-dom";
3
+ import { ToastContainer as F, toast as y } from "react-toastify";
4
+ import { HostThemeProvider as g, defaultThemeOptions as w, fnComponentsOverrides as M, ProgressBarStyle as A, LocalesProvider as E, getLocaleFromNetwork as T, FormatterProvider as x } from "@m4l/graphics";
5
+ import { A as b } from "../../contexts/AuthContext/index.6f966215.js";
6
+ import { voidFunction as c, EnvironmentProvider as H, HostToolsProvider as N, NetworkProvider as O, axiosOperation as k, DomainCountryProvider as C } from "@m4l/core";
7
+ import { c as L, f as j, N as d } from "../../node_modules.6b42d9a4.js";
8
+ import { u as B } from "../../hooks/useAuth/index.cb6a3420.js";
9
+ import { jsx as r, jsxs as D } from "react/jsx-runtime";
10
+ function I(t) {
11
+ const {
12
+ children: s,
13
+ user: i,
14
+ pwd: n
15
+ } = t, {
16
+ isAuthenticated: o,
17
+ isInitialized: e,
18
+ login: a
19
+ } = B();
20
+ return _(() => {
21
+ e && o === !1 && a(i, n, !1);
22
+ }, [e, o]), o ? /* @__PURE__ */ D(g, {
23
+ hostThemeOptions: w,
24
+ fnComponentsOverrides: M,
25
+ isMicroFrontEnd: !0,
26
+ children: [/* @__PURE__ */ r(A, {}), /* @__PURE__ */ r(F, {}), s]
27
+ }) : /* @__PURE__ */ r("div", {
28
+ children: "Pendiente x atenticar"
29
+ });
30
+ }
31
+ const l = L({
32
+ window
33
+ });
34
+ function U(t) {
35
+ const {
36
+ children: s,
37
+ user: i,
38
+ pwd: n,
39
+ host_api_local: o,
40
+ host_api_remote: e,
41
+ host_static_assets: a,
42
+ environment_assets: h
43
+ } = t, u = () => {
44
+ d.configure({
45
+ showSpinner: !0
46
+ }), d.start();
47
+ }, f = () => {
48
+ d.done();
49
+ }, p = m(() => ({
50
+ host: "",
51
+ isLocalhost: !0,
52
+ domain_token: "lab1",
53
+ host_api_local: o,
54
+ host_api_remote: e,
55
+ host_static_assets: a,
56
+ environment_assets: h
57
+ }), []), v = m(() => ({
58
+ history: l,
59
+ toast: y,
60
+ startProgress: u,
61
+ stopProgress: f,
62
+ events_add_listener: c,
63
+ events_remove_listener: c,
64
+ events_emit: c
65
+ }), []);
66
+ return /* @__PURE__ */ r(H, {
67
+ ...p,
68
+ children: /* @__PURE__ */ r(N, {
69
+ ...v,
70
+ children: /* @__PURE__ */ r(O, {
71
+ axiosOperation: k,
72
+ children: /* @__PURE__ */ r(P, {
73
+ history: l,
74
+ children: /* @__PURE__ */ r(E, {
75
+ isMicroFrontEnd: !1,
76
+ getLocaleFromNetwork: T,
77
+ children: /* @__PURE__ */ r(C, {
78
+ id: 1,
79
+ isMicroFrontEnd: !1,
80
+ currency: "$",
81
+ currency_decimal_digits: 0,
82
+ decimal_symbol: ".",
83
+ thousands_symbol: ",",
84
+ children: /* @__PURE__ */ r(x, {
85
+ isMicroFrontEnd: !1,
86
+ dateFormatter: {
87
+ formatDate: j
88
+ },
89
+ children: /* @__PURE__ */ r(b, {
90
+ children: /* @__PURE__ */ r(I, {
91
+ user: i,
92
+ pwd: n,
93
+ children: s
94
+ })
95
+ })
96
+ })
97
+ })
98
+ })
99
+ })
100
+ })
101
+ })
102
+ });
103
+ }
104
+ export {
105
+ U as M
106
+ };
@@ -1,3 +1,3 @@
1
1
  export { MFIsolationApp } from './MFIsolationApp';
2
2
  export { MFHostApp } from './MFHostApp';
3
- export type { ByHostProps } from './MFHostApp/types';
3
+ export type { ByHostProps, DynamicMFParameters } from './MFHostApp/types';
@@ -1,4 +1,4 @@
1
- import { Maybe } from '@m4l/core';
1
+ import { DomainCountry, Maybe } from '@m4l/core';
2
2
  import { ReactNode } from 'react';
3
3
  export declare enum EnumTypes {
4
4
  Initial = "INITIALIZE",
@@ -29,17 +29,13 @@ export declare type SessionAuthPayload = {
29
29
  [EnumTypes.Logout]: undefined;
30
30
  };
31
31
  export declare type SessionActions = ActionMap<SessionAuthPayload>[keyof ActionMap<SessionAuthPayload>];
32
- export declare type AuthStoreState = {
33
- user: User;
34
- remember?: boolean;
35
- };
36
32
  export interface User {
37
33
  email: string;
38
34
  id: number;
39
35
  first_name: string;
40
36
  last_name: string;
41
37
  account_id: number;
42
- domain_country_id: number;
38
+ domainCountry: DomainCountry;
43
39
  avatar_url?: Maybe<string>;
44
40
  }
45
41
  export declare type AuthUser = Maybe<User>;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { M as n } from "./components/MFIsolationApp/index.21e432e9.js";
2
- import { M as f } from "./components/MFHostApp/index.e1f2766e.js";
1
+ import { M as n } from "./components/MFIsolationApp/index.e6e8c4a3.js";
2
+ import { M as f } from "./components/MFHostApp/index.93b68f81.js";
3
3
  import { a as D, A } from "./contexts/AuthContext/index.6f966215.js";
4
4
  import { a as c, d as g, g as h } from "./layouts/ModuleLayout/index.842072c5.js";
5
5
  import { a as N, d as F, g as v } from "./layouts/MasterDetailLayout/index.71de0dc7.js";
@@ -12,8 +12,8 @@ import "react-router-dom";
12
12
  import "react-toastify";
13
13
  import "@m4l/graphics";
14
14
  import "@m4l/core";
15
- import "./node_modules.adf5d2c5.js";
16
- import "./vendor.63d78656.js";
15
+ import "./node_modules.6b42d9a4.js";
16
+ import "./vendor.1dc9ad6c.js";
17
17
  import "react/jsx-runtime";
18
18
  import "@m4l/components";
19
19
  import "@mui/material";
@@ -1,4 +1,4 @@
1
- import { c as le } from "./vendor.63d78656.js";
1
+ import { c as le } from "./vendor.1dc9ad6c.js";
2
2
  function G() {
3
3
  return G = Object.assign ? Object.assign.bind() : function(r) {
4
4
  for (var t = 1; t < arguments.length; t++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "license": "UNLICENSED",
5
5
  "dependencies": {
6
6
  "@m4l/components": "*",
@@ -1,4 +1,4 @@
1
- import "./components/MFIsolationApp/index.21e432e9.js";
1
+ import "./components/MFIsolationApp/index.e6e8c4a3.js";
2
2
  import "react-router-dom";
3
3
  import "@m4l/core";
4
4
  import "@m4l/graphics";
@@ -10,7 +10,7 @@ import "react";
10
10
  import "./layouts/MasterDetailLayout/index.71de0dc7.js";
11
11
  import "@mui/material";
12
12
  import "./layouts/NoAuthModuleLayout/index.5d1098ef.js";
13
- import "./components/MFHostApp/index.e1f2766e.js";
13
+ import "./components/MFHostApp/index.93b68f81.js";
14
14
  import "./hooks/useMasterDetail/index.8e9e900b.js";
15
15
  import "./hooks/useAuth/index.cb6a3420.js";
16
16
  import "./hooks/useModule/index.096d7d13.js";
@@ -1,43 +0,0 @@
1
- import { unstable_HistoryRouter as l } from "react-router-dom";
2
- import { EnvironmentProvider as m, HostToolsProvider as h, NetworkProvider as u, DomainCountryProvider as a } from "@m4l/core";
3
- import { LocalesProvider as p, HostThemeProvider as v } from "@m4l/graphics";
4
- import { jsx as r } from "react/jsx-runtime";
5
- function M(e) {
6
- const {
7
- children: i,
8
- currentLocale: t,
9
- hostTheme: n,
10
- environment: s,
11
- hostTools: o,
12
- axiosOperation: d,
13
- domainCountryId: c
14
- } = e;
15
- return /* @__PURE__ */ r(m, {
16
- ...s,
17
- children: /* @__PURE__ */ r(h, {
18
- ...o,
19
- children: /* @__PURE__ */ r(u, {
20
- axiosOperation: d,
21
- children: /* @__PURE__ */ r(p, {
22
- isMicroFrontEnd: !0,
23
- localeHost: t,
24
- children: /* @__PURE__ */ r(v, {
25
- isMicroFrontEnd: !0,
26
- ...n,
27
- children: /* @__PURE__ */ r(a, {
28
- domainCountryId: c,
29
- isMicroFrontEnd: !0,
30
- children: /* @__PURE__ */ r(l, {
31
- history: o.history,
32
- children: i
33
- })
34
- })
35
- })
36
- })
37
- })
38
- })
39
- });
40
- }
41
- export {
42
- M
43
- };
@@ -1,105 +0,0 @@
1
- import { useEffect as v, useMemo as d } from "react";
2
- import { unstable_HistoryRouter as y } from "react-router-dom";
3
- import { ToastContainer as P, toast as M } from "react-toastify";
4
- import { HostThemeProvider as w, defaultThemeOptions as F, fnComponentsOverrides as H, ProgressBarStyle as g, LocalesProvider as A, getLocaleFromNetwork as k } from "@m4l/graphics";
5
- import { A as T } from "../../contexts/AuthContext/index.6f966215.js";
6
- import { voidFunction as m, EnvironmentProvider as x, HostToolsProvider as E, NetworkProvider as C, axiosOperation as N, DomainCountryProvider as O } from "@m4l/core";
7
- import { c as I, f as L, N as _ } from "../../node_modules.adf5d2c5.js";
8
- import { u as b } from "../../hooks/useAuth/index.cb6a3420.js";
9
- import { jsx as o, jsxs as j } from "react/jsx-runtime";
10
- function B(r) {
11
- const {
12
- children: s,
13
- user: i,
14
- pwd: n
15
- } = r, {
16
- isAuthenticated: t,
17
- isInitialized: e,
18
- login: a
19
- } = b();
20
- return v(() => {
21
- e && t === !1 && a(i, n, !1);
22
- }, [e, t]), t ? /* @__PURE__ */ j(w, {
23
- hostThemeOptions: F,
24
- fnComponentsOverrides: H,
25
- isMicroFrontEnd: !0,
26
- children: [/* @__PURE__ */ o(g, {}), /* @__PURE__ */ o(P, {}), s]
27
- }) : /* @__PURE__ */ o("div", {
28
- children: "Pendiente x atenticar"
29
- });
30
- }
31
- const c = I({
32
- window
33
- });
34
- function U(r) {
35
- const {
36
- children: s,
37
- user: i,
38
- pwd: n,
39
- host_api_local: t,
40
- host_api_remote: e,
41
- host_static_assets: a,
42
- environment_assets: l
43
- } = r, f = () => {
44
- _.configure({
45
- showSpinner: !0
46
- }), _.start();
47
- }, h = () => {
48
- _.done();
49
- }, u = d(() => ({
50
- host: "",
51
- isLocalhost: !0,
52
- domain_token: "lab1",
53
- host_api_local: t,
54
- host_api_remote: e,
55
- host_static_assets: a,
56
- environment_assets: l,
57
- dfnsFormat: {
58
- date_format: "yyyy-MM-dd",
59
- date_mask: "____-__-__",
60
- time_format: "HH:mm:ss",
61
- time_mask: "__:__:__",
62
- datetime_format: "yyyy-MM-dd HH:mm:ss",
63
- datetime_mask: "____-__-__ __:__:__"
64
- }
65
- }), []), p = d(() => ({
66
- history: c,
67
- toast: M,
68
- startProgress: f,
69
- stopProgress: h,
70
- events_add_listener: m,
71
- events_remove_listener: m,
72
- events_emit: m,
73
- formatDate: L
74
- }), []);
75
- return /* @__PURE__ */ o(x, {
76
- ...u,
77
- children: /* @__PURE__ */ o(E, {
78
- ...p,
79
- children: /* @__PURE__ */ o(C, {
80
- axiosOperation: N,
81
- children: /* @__PURE__ */ o(y, {
82
- history: c,
83
- children: /* @__PURE__ */ o(A, {
84
- isMicroFrontEnd: !1,
85
- getLocaleFromNetwork: k,
86
- children: /* @__PURE__ */ o(O, {
87
- domainCountryId: 1,
88
- isMicroFrontEnd: !1,
89
- children: /* @__PURE__ */ o(T, {
90
- children: /* @__PURE__ */ o(B, {
91
- user: i,
92
- pwd: n,
93
- children: s
94
- })
95
- })
96
- })
97
- })
98
- })
99
- })
100
- })
101
- });
102
- }
103
- export {
104
- U as M
105
- };