@m4l/graphics 7.5.0-beta-feature-731-code-editor.0 → 7.5.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.
Files changed (27) hide show
  1. package/contexts/FormatterContext/helpers.d.ts +7 -0
  2. package/contexts/FormatterContext/helpers.d.ts.map +1 -0
  3. package/contexts/FormatterContext/helpers.js +39 -0
  4. package/contexts/FormatterContext/index.d.ts +2 -2
  5. package/contexts/FormatterContext/index.d.ts.map +1 -1
  6. package/contexts/FormatterContext/index.js +49 -44
  7. package/contexts/FormatterContext/types.d.ts +4 -1
  8. package/contexts/FormatterContext/types.d.ts.map +1 -1
  9. package/contexts/LocalesContext/helper.d.ts +5 -1
  10. package/contexts/LocalesContext/helper.d.ts.map +1 -1
  11. package/contexts/LocalesContext/helper.js +25 -17
  12. package/contexts/ThemeSettingsContext/store.d.ts.map +1 -1
  13. package/contexts/ThemeSettingsContext/store.js +52 -70
  14. package/contexts/ThemeSettingsContext/types.d.ts +0 -7
  15. package/contexts/ThemeSettingsContext/types.d.ts.map +1 -1
  16. package/contexts/index.d.ts +2 -1
  17. package/contexts/index.d.ts.map +1 -1
  18. package/decorators/MFIsolationAppStorybook/constants.d.ts +2 -2
  19. package/decorators/MFIsolationAppStorybook/constants.d.ts.map +1 -1
  20. package/decorators/MFIsolationAppStorybook/constants.js +23 -11
  21. package/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.d.ts +1 -1
  22. package/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.d.ts.map +1 -1
  23. package/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.js +18 -23
  24. package/hooks/useFormatter/index.d.ts +1 -1
  25. package/hooks/useFormatter/index.d.ts.map +1 -1
  26. package/index.js +81 -77
  27. package/package.json +2 -1
@@ -0,0 +1,7 @@
1
+ import { UserPreferencesSource } from '@m4l/core';
2
+ import { Formatters } from './types';
3
+ /**
4
+ * Build the shared formatter contract from the effective user-preferences source.
5
+ */
6
+ export declare function buildFormattersFromUserPreferences(source?: UserPreferencesSource | null): Formatters;
7
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/FormatterContext/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAGjF,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,SAAS,CAAC;AAoCjE;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,CAAC,EAAE,qBAAqB,GAAG,IAAI,GACpC,UAAU,CAwBZ"}
@@ -0,0 +1,39 @@
1
+ import { normalizeUserPreferences as o } from "@m4l/core";
2
+ import { format as i } from "date-fns";
3
+ import { formatInTimeZone as n } from "date-fns-tz";
4
+ function a(t) {
5
+ return t.replace(/[A-Za-z]/g, "_");
6
+ }
7
+ function c(t) {
8
+ return t ? (r, e, m) => n(
9
+ r,
10
+ t,
11
+ e,
12
+ m
13
+ ) : i;
14
+ }
15
+ function F(t) {
16
+ const r = o(t), e = `${r.dateFormat} ${r.timeFormat}`, m = c(r.timeZone?.name);
17
+ return {
18
+ currencyFormatter: {
19
+ code: r.currency,
20
+ decimalDigits: r.currencyDecimalDigits
21
+ },
22
+ numberFormatter: {
23
+ decimalSymbol: r.decimalSymbol,
24
+ thousandsSymbol: r.thousandsSymbol
25
+ },
26
+ dateFormatter: {
27
+ dateFormat: r.dateFormat,
28
+ dateMask: a(r.dateFormat),
29
+ datetimeFormat: e,
30
+ datetimeMask: a(e),
31
+ timeFormat: r.timeFormat,
32
+ timeMask: a(r.timeFormat),
33
+ formatDate: m
34
+ }
35
+ };
36
+ }
37
+ export {
38
+ F as buildFormattersFromUserPreferences
39
+ };
@@ -1,5 +1,5 @@
1
- import { FormatterProviderProps, Formatters } from './types';
2
- declare const FormatterContext: import('react').Context<Formatters | null>;
1
+ import { FormatterProviderProps, FormatterContextProps } from './types';
2
+ declare const FormatterContext: import('react').Context<FormatterContextProps | null>;
3
3
  /**
4
4
  * Componente encargado de proveer un contexto que permita saber los diferentes forrmatos,
5
5
  * Segunda linea
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/FormatterContext/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAyB,UAAU,EAAE,MAAM,SAAS,CAAC;AAKpF,QAAA,MAAM,gBAAgB,4CAAoD,CAAC;AAC3E;;;;;;;GAOG;AACH,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,oDA2GvD;AAED,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/FormatterContext/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAc,MAAM,SAAS,CAAC;AAMpF,QAAA,MAAM,gBAAgB,uDAAoD,CAAC;AAC3E;;;;;;;GAOG;AACH,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,oDAuHvD;AAED,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,74 +1,79 @@
1
- import { jsx as D } from "@emotion/react/jsx-runtime";
2
- import { createContext as C, useState as k, useCallback as p, useEffect as v } from "react";
3
- import { useHostTools as R, usePropageteMF as h, EmitEvents as f } from "@m4l/core";
4
- import { useFirstRender as V } from "../../hooks/useFirstRender/index.js";
5
- const x = C(null);
6
- function I(T) {
7
- const { children: b, isMicroFrontEnd: F, currencyFormatter: l, numberFormatter: M, dateFormatter: t } = T, r = l?.decimalDigits || 0, o = l?.code || "USD", a = M?.decimalSymbol || 0.1.toLocaleString().substring(1, 2), s = M?.thousandsSymbol || 1e3.toLocaleString().substring(1, 2), m = t?.dateFormat || "yyyy-MM-dd", n = t?.dateMask || "____-__-__", c = t?.datetimeFormat || "yyyy-MM-dd HH:mm:ss", i = t?.datetimeMask || "____-__-__ __:__:__", _ = t?.timeFormat || "HH:mm:ss", d = t?.timeMask || "__:__:__", u = t?.formatDate || (() => {
1
+ import { jsx as C } from "@emotion/react/jsx-runtime";
2
+ import { createContext as k, useState as p, useCallback as S, useEffect as v } from "react";
3
+ import { useHostTools as N, formatNumberWithDelimiters as R, usePropageteMF as V, EmitEvents as E } from "@m4l/core";
4
+ import { useFirstRender as x } from "../../hooks/useFirstRender/index.js";
5
+ const A = k(null);
6
+ function G(T) {
7
+ const { children: g, isMicroFrontEnd: F, currencyFormatter: y, numberFormatter: b, dateFormatter: t } = T, o = y?.decimalDigits || 0, m = y?.code || "USD", a = b?.decimalSymbol || 0.1.toLocaleString().substring(1, 2), s = b?.thousandsSymbol || 1e3.toLocaleString().substring(1, 2), n = t?.dateFormat || "yyyy-MM-dd", c = t?.dateMask || "____-__-__", i = t?.datetimeFormat || "yyyy-MM-dd HH:mm:ss", u = t?.datetimeMask || "____-__-__ __:__:__", d = t?.timeFormat || "HH:mm:ss", _ = t?.timeMask || "__:__:__", l = t?.formatDate || (() => {
8
8
  throw new Error("Incorrect use of formatDate");
9
- }), y = V(), { events_emit: g } = R(), [H, E] = k({
9
+ }), M = x(), { events_emit: D } = N(), [r, f] = p({
10
10
  currencyFormatter: {
11
- decimalDigits: r,
12
- code: o
11
+ decimalDigits: o,
12
+ code: m
13
13
  },
14
14
  numberFormatter: { decimalSymbol: a, thousandsSymbol: s },
15
15
  dateFormatter: {
16
- dateFormat: m,
17
- dateMask: n,
18
- datetimeFormat: c,
19
- datetimeMask: i,
20
- timeFormat: _,
21
- timeMask: d,
22
- formatDate: u
16
+ dateFormat: n,
17
+ dateMask: c,
18
+ datetimeFormat: i,
19
+ datetimeMask: u,
20
+ timeFormat: d,
21
+ timeMask: _,
22
+ formatDate: l
23
23
  }
24
- }), S = p((e) => {
25
- E(e);
26
- }, []);
27
- return h({
24
+ }), H = S((e) => {
25
+ f(e);
26
+ }, []), h = S((e) => R({
27
+ ...e,
28
+ decimalSymbol: r.numberFormatter.decimalSymbol,
29
+ thousandsSymbol: r.numberFormatter.thousandsSymbol
30
+ }), [r.numberFormatter.decimalSymbol, r.numberFormatter.thousandsSymbol]);
31
+ return V({
28
32
  isMicroFrontEnd: F,
29
- event: f.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
30
- setHandler: S
33
+ event: E.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
34
+ setHandler: H
31
35
  }), v(() => {
32
- if (F || y)
36
+ if (F || M)
33
37
  return;
34
38
  const e = {
35
- currencyFormatter: { decimalDigits: r, code: o },
39
+ currencyFormatter: { decimalDigits: o, code: m },
36
40
  numberFormatter: { decimalSymbol: a, thousandsSymbol: s },
37
41
  dateFormatter: {
38
- dateFormat: m,
39
- dateMask: n,
40
- datetimeFormat: c,
41
- datetimeMask: i,
42
- timeFormat: _,
43
- timeMask: d,
44
- formatDate: u
42
+ dateFormat: n,
43
+ dateMask: c,
44
+ datetimeFormat: i,
45
+ datetimeMask: u,
46
+ timeFormat: d,
47
+ timeMask: _,
48
+ formatDate: l
45
49
  }
46
50
  };
47
- E(e), g(f.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
51
+ f(e), D(E.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
48
52
  }, [
49
- y,
53
+ M,
54
+ m,
50
55
  o,
51
- r,
52
56
  a,
53
57
  s,
54
- m,
55
58
  n,
56
59
  c,
57
60
  i,
58
- _,
61
+ u,
59
62
  d,
60
- u
61
- ]), /* @__PURE__ */ D(
62
- x.Provider,
63
+ _,
64
+ l
65
+ ]), /* @__PURE__ */ C(
66
+ A.Provider,
63
67
  {
64
68
  value: {
65
- ...H
69
+ ...r,
70
+ formatNumber: h
66
71
  },
67
- children: b
72
+ children: g
68
73
  }
69
74
  );
70
75
  }
71
76
  export {
72
- x as FormatterContext,
73
- I as FormatterProvider
77
+ A as FormatterContext,
78
+ G as FormatterProvider
74
79
  };
@@ -1,5 +1,6 @@
1
1
  import { Locale } from 'date-fns';
2
2
  import { ReactNode } from 'react';
3
+ import { ResolveNumberPresentationOptions } from '@m4l/core';
3
4
  export interface CurrencyFormatter {
4
5
  code: string;
5
6
  decimalDigits: number;
@@ -55,5 +56,7 @@ export interface FormatterProviderProps extends OptionalFormatters {
55
56
  isMicroFrontEnd: boolean;
56
57
  children: ReactNode;
57
58
  }
58
- export type FormatterContextProps = Formatters;
59
+ export interface FormatterContextProps extends Formatters {
60
+ formatNumber: (options: ResolveNumberPresentationOptions) => string;
61
+ }
59
62
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/FormatterContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IAGb,aAAa,EAAE,MAAM,CAAC;CACvB;AACD,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB;AACD;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IAGjB,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;CAC5E;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,CACV,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACzC,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,2BAA2B,CAAC,EAAE,OAAO,CAAC;QACtC,4BAA4B,CAAC,EAAE,OAAO,CAAC;KACxC,KACE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,UAAU;IACzB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IAEjC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAEtC,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AACD;GACG;AACH,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAEhE,eAAe,EAAE,OAAO,CAAC;IAGzB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/FormatterContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAA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AAW,UAAU;IACzB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IAEjC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAEtC,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AACD;GACG;AACH,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAEhE,eAAe,EAAE,OAAO,CAAC;IAGzB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACvD,YAAY,EAAE,CAAC,OAAO,EAAE,gCAAgC,KAAK,MAAM,CAAC;CACrE"}
@@ -1,4 +1,4 @@
1
- import { BaseLocale, LocaleType, NetworkLocaleType } from './types';
1
+ import { BaseLocale, LocaleType, NetworkLocaleType, SupportedLocales } from './types';
2
2
  /**
3
3
  * Obtiene el locale de la red
4
4
  * @author Juan Escobar - automatic
@@ -7,6 +7,10 @@ import { BaseLocale, LocaleType, NetworkLocaleType } from './types';
7
7
  * @updatedUser Juan Escobar - automatic
8
8
  */
9
9
  export declare function getLocaleFromNetwork(locale: NetworkLocaleType, host_static_assets: string, environment_assets: string): Promise<LocaleType>;
10
+ /**
11
+ * Collapse one locale string into the closest locale currently supported by the host.
12
+ */
13
+ export declare function normalizeSupportedLocaleString(locale?: string | null): SupportedLocales | null;
10
14
  /**
11
15
  * Une los elementos de un locale
12
16
  * @author Juan Escobar - automatic
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/LocalesContext/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIpE;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,iBAAiB,EACzB,kBAAkB,EAAE,MAAM,EAC1B,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,UAAU,CAAC,CA0BrB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAYzD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAgBtD"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/LocalesContext/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMtF;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,iBAAiB,EACzB,kBAAkB,EAAE,MAAM,EAC1B,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,UAAU,CAAC,CA0BrB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACrB,gBAAgB,GAAG,IAAI,CAoBzB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAYzD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAgBtD"}
@@ -1,24 +1,31 @@
1
1
  import o from "date-fns/locale/en-US";
2
- async function s(n, e, c) {
3
- const r = l(n), t = { ...n };
4
- let i;
5
- return r === "es" ? i = (await import("date-fns/locale/es")).default : r === "fr" ? i = (await import("date-fns/locale/fr")).default : r === "en-US" ? i = o : (i = o, t.lang = "en", t.script = void 0, t.region = "US", t.urlIcon = `${e}/${c}/frontend/commons/assets/icons/langs/lang_en.svg`, t.name = "English US*"), {
6
- ...t,
7
- module: i,
8
- localeString: l(t)
2
+ const s = "en-US";
3
+ async function f(r, n, c) {
4
+ const i = l(r), e = { ...r };
5
+ let t;
6
+ return i === "es" ? t = (await import("date-fns/locale/es")).default : i === "fr" ? t = (await import("date-fns/locale/fr")).default : i === "en-US" ? t = o : (t = o, e.lang = "en", e.script = void 0, e.region = "US", e.urlIcon = `${n}/${c}/frontend/commons/assets/icons/langs/lang_en.svg`, e.name = "English US*"), {
7
+ ...e,
8
+ module: t,
9
+ localeString: l(e)
9
10
  };
10
11
  }
11
- function l(n) {
12
- let e = n.lang;
13
- return n.script && n.script !== "" && (e = e + "-" + n.script), n.region && n.region !== "" && (e = e + "-" + n.region), e;
12
+ function a(r) {
13
+ if (!r)
14
+ return null;
15
+ const { lang: n } = g(r);
16
+ return n === "es" ? "es" : n === "fr" ? "fr" : n === "en" ? "en-US" : s;
14
17
  }
15
- function a(n) {
18
+ function l(r) {
19
+ let n = r.lang;
20
+ return r.script && r.script !== "" && (n = n + "-" + r.script), r.region && r.region !== "" && (n = n + "-" + r.region), n;
21
+ }
22
+ function g(r) {
16
23
  try {
17
- const e = new Intl.Locale(n);
24
+ const n = new Intl.Locale(r);
18
25
  return {
19
- lang: e.language || "",
20
- script: e.script,
21
- region: e.region
26
+ lang: n.language || "",
27
+ script: n.script,
28
+ region: n.region
22
29
  };
23
30
  } catch {
24
31
  return {
@@ -29,7 +36,8 @@ function a(n) {
29
36
  }
30
37
  }
31
38
  export {
32
- s as getLocaleFromNetwork,
39
+ f as getLocaleFromNetwork,
33
40
  l as joinLocale,
34
- a as splitLocale
41
+ a as normalizeSupportedLocaleString,
42
+ g as splitLocale
35
43
  };
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/store.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAI9B,MAAM,SAAS,CAAC;AAkHjB;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,cAAc,8BAA8B;;;;;;;;CA2LpF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/store.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAI9B,MAAM,SAAS,CAAC;AAwGjB;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,cAAc,8BAA8B;;;;;;;;CAwKpF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -1,54 +1,46 @@
1
- import { createStore as d } from "zustand";
2
- import { devtools as u } from "zustand/middleware";
3
- import { immer as U } from "zustand/middleware/immer";
4
- import { EmitEvents as f } from "@m4l/core";
5
- import { getPaletteByPreset as x, createCustomShadows as C, shadows as l, typographyOld as T, getColorPresets as i } from "@m4l/styles";
6
- import { alpha as s } from "@mui/system";
7
- import { defaultThemeSettings as S } from "./constants.js";
8
- function c(r, o = "m4l") {
1
+ import { createStore as c } from "zustand";
2
+ import { devtools as d } from "zustand/middleware";
3
+ import { immer as u } from "zustand/middleware/immer";
4
+ import { getPaletteByPreset as a, createCustomShadows as x, shadows as s, typographyOld as U, getColorPresets as m } from "@m4l/styles";
5
+ import { alpha as p } from "@mui/system";
6
+ import { defaultThemeSettings as g } from "./constants.js";
7
+ function l(o, r = "m4l") {
9
8
  const n = document.querySelector("[data-mui-color-scheme]");
10
- n && Object.keys(r).forEach((t) => {
11
- const e = r[t];
9
+ n && Object.keys(o).forEach((t) => {
10
+ const e = o[t];
12
11
  if (typeof e == "string" || typeof e == "number") {
13
- const p = `--${o}-${t}`;
14
- n.style.setProperty(p, e.toString());
15
- } else typeof e == "object" && e !== null && c(e, `${o}-${t}`);
12
+ const S = `--${r}-${t}`;
13
+ n.style.setProperty(S, e.toString());
14
+ } else typeof e == "object" && e !== null && l(e, `${r}-${t}`);
16
15
  });
17
16
  }
18
- const m = (r) => {
19
- const o = r.themeUserSettings || S, n = o.themeMode === "light", t = x(o.themeColor), e = n ? t.light : t.dark;
20
- r.themeOptions = {
21
- ...r.themeOptions,
22
- ...T,
17
+ const h = (o) => {
18
+ const r = o.themeUserSettings || g, n = r.themeMode === "light", t = a(r.themeColor), e = n ? t.light : t.dark;
19
+ o.themeOptions = {
20
+ ...o.themeOptions,
21
+ ...U,
23
22
  palette: {
24
- ...r.themeOptions?.palette ?? {},
23
+ ...o.themeOptions?.palette ?? {},
25
24
  ...e
26
25
  },
27
26
  shape: { borderRadius: 8 },
28
- direction: o.themeDirection,
29
- shadows: n ? l.light : l.dark,
27
+ direction: r.themeDirection,
28
+ shadows: n ? s.light : s.dark,
30
29
  customShadows: {
31
- primary: n ? `0 4px 8px -4px ${s(i(o.themeColor)?.enabledLight, 0.12)},
32
- 0 2px 27px 2px ${s(i(o.themeColor)?.enabledLight, 0.02)}` : `0 4px 8px -4px ${s(i(o.themeColor)?.enabledDark, 0.12)},
33
- 0 2px 27px 2px ${s(i(o.themeColor)?.enabledDark, 0.02)}`,
34
- ...C(o.themeMode),
35
- primary2: n ? `0px 2px 3px 0px ${s(i(o.themeColor)?.hoverOpacityLight, 0.2)}` : `0px 2px 3px 0px ${s(i(o.themeColor)?.hoverOpacityDark, 0.2)}`
30
+ primary: n ? `0 4px 8px -4px ${p(m(r.themeColor)?.enabledLight, 0.12)},
31
+ 0 2px 27px 2px ${p(m(r.themeColor)?.enabledLight, 0.02)}` : `0 4px 8px -4px ${p(m(r.themeColor)?.enabledDark, 0.12)},
32
+ 0 2px 27px 2px ${p(m(r.themeColor)?.enabledDark, 0.02)}`,
33
+ ...x(r.themeMode),
34
+ primary2: n ? `0px 2px 3px 0px ${p(m(r.themeColor)?.hoverOpacityLight, 0.2)}` : `0px 2px 3px 0px ${p(m(r.themeColor)?.hoverOpacityDark, 0.2)}`
36
35
  },
37
- stretch: o.themeStretch
38
- }, c(r.themeOptions);
39
- }, h = (r) => {
40
- r.themeSettingsPersistFn?.(r.themeUserSettings);
41
- };
42
- function g(r) {
43
- r.hostToolsEventsEmit?.(
44
- f.EMMIT_EVENT_HOST_THEME_CHANGE,
45
- r.themeUserSettings.themeMode
46
- );
47
- }
48
- const b = (r) => d(
49
- u(
50
- U((o, n) => ({
51
- ...r,
36
+ stretch: r.themeStretch
37
+ }, l(o.themeOptions);
38
+ }, i = (o) => {
39
+ o.themeSettingsPersistFn?.(o.themeUserSettings);
40
+ }, T = (o) => c(
41
+ d(
42
+ u((r, n) => ({
43
+ ...o,
52
44
  settingsActions: {
53
45
  /**
54
46
  * Inicializa la tienda de configuración del tema
@@ -58,8 +50,8 @@ const b = (r) => d(
58
50
  * @updatedUser Juan Escobar - automatic
59
51
  */
60
52
  init: () => {
61
- o((t) => {
62
- m(t);
53
+ r((t) => {
54
+ h(t);
63
55
  });
64
56
  },
65
57
  /**
@@ -70,9 +62,8 @@ const b = (r) => d(
70
62
  * @updatedUser Juan Escobar - automatic
71
63
  */
72
64
  setThemeSettings: (t) => {
73
- o((e) => {
74
- const p = e.themeUserSettings.themeMode;
75
- e.themeUserSettings = { ...e.themeUserSettings, ...t }, h(e), m(e), p !== e.themeUserSettings.themeMode && g(e);
65
+ r((e) => {
66
+ e.themeUserSettings = { ...e.themeUserSettings, ...t }, i(e), h(e);
76
67
  });
77
68
  },
78
69
  /**
@@ -83,19 +74,11 @@ const b = (r) => d(
83
74
  * @updatedUser Juan Escobar - automatic
84
75
  */
85
76
  onChangeMode: (t) => {
86
- o((e) => {
77
+ r((e) => {
87
78
  t !== e.themeUserSettings.themeMode && (e.themeUserSettings = {
88
79
  ...e.themeUserSettings,
89
80
  themeMode: t
90
- }, h(e), m(e), g(e));
91
- });
92
- },
93
- /**
94
- * Register the host-tools emitter used to broadcast theme-mode changes.
95
- */
96
- registerHostToolsEventsEmit: (t) => {
97
- o((e) => {
98
- e.hostToolsEventsEmit = t;
81
+ }, i(e), h(e));
99
82
  });
100
83
  },
101
84
  /**
@@ -106,7 +89,7 @@ const b = (r) => d(
106
89
  * @updatedUser Juan Escobar - automatic
107
90
  */
108
91
  handleOpen: () => {
109
- o((t) => {
92
+ r((t) => {
110
93
  t.open = !t.open;
111
94
  });
112
95
  },
@@ -118,11 +101,11 @@ const b = (r) => d(
118
101
  * @updatedUser Juan Escobar - automatic
119
102
  */
120
103
  onChangeDirection: (t) => {
121
- o((e) => {
104
+ r((e) => {
122
105
  t !== e.themeUserSettings.themeDirection && (e.themeUserSettings = {
123
106
  ...e.themeUserSettings,
124
107
  themeDirection: t
125
- }, h(e), m(e));
108
+ }, i(e), h(e));
126
109
  });
127
110
  },
128
111
  /**
@@ -133,11 +116,11 @@ const b = (r) => d(
133
116
  * @updatedUser Juan Escobar - automatic
134
117
  */
135
118
  onChangeColor: (t) => {
136
- o((e) => {
119
+ r((e) => {
137
120
  t !== e.themeUserSettings.themeColor && (e.themeUserSettings = {
138
121
  ...e.themeUserSettings,
139
122
  themeColor: t
140
- }, h(e), m(e));
123
+ }, i(e), h(e));
141
124
  });
142
125
  },
143
126
  /**
@@ -148,11 +131,11 @@ const b = (r) => d(
148
131
  * @updatedUser Juan Escobar - automatic
149
132
  */
150
133
  onChangeLayout: (t) => {
151
- o((e) => {
134
+ r((e) => {
152
135
  e.themeUserSettings = {
153
136
  ...e.themeUserSettings,
154
137
  themeLayout: t.target.value
155
- }, h(e), m(e);
138
+ }, i(e), h(e);
156
139
  });
157
140
  },
158
141
  /**
@@ -163,11 +146,11 @@ const b = (r) => d(
163
146
  * @updatedUser Juan Escobar - automatic
164
147
  */
165
148
  onToggleStretch: () => {
166
- o((t) => {
149
+ r((t) => {
167
150
  t.themeUserSettings = {
168
151
  ...t.themeUserSettings,
169
152
  themeStretch: !t.themeUserSettings.themeStretch
170
- }, h(t), m(t);
153
+ }, i(t), h(t);
171
154
  });
172
155
  },
173
156
  /**
@@ -178,11 +161,10 @@ const b = (r) => d(
178
161
  * @updatedUser Juan Escobar - automatic
179
162
  */
180
163
  onResetSetting: () => {
181
- o((t) => {
182
- const e = t.themeUserSettings.themeMode;
164
+ r((t) => {
183
165
  t.themeUserSettings = {
184
- ...S
185
- }, h(t), m(t), e !== t.themeUserSettings.themeMode && g(t);
166
+ ...g
167
+ }, i(t), h(t);
186
168
  });
187
169
  }
188
170
  }
@@ -191,5 +173,5 @@ const b = (r) => d(
191
173
  )
192
174
  );
193
175
  export {
194
- b as createThemeSettingsStore
176
+ T as createThemeSettingsStore
195
177
  };
@@ -1,4 +1,3 @@
1
- import { EmmitFunction } from '@m4l/core';
2
1
  import { PresetsOptionsColorMain, ThemeUserColor } from '@m4l/styles';
3
2
  import { Theme } from '@mui/material/styles';
4
3
  import { ReactNode } from 'react';
@@ -42,11 +41,6 @@ export interface ThemeSettingsStore {
42
41
  * @updatedUser Juan Escobar - automatic
43
42
  */
44
43
  themeSettingsPersistFn?: (newValue: ThemeUserSettings) => void;
45
- /**
46
- * Host-owned event emitter injected when this store should broadcast mode changes
47
- * through the shared host-tools contract.
48
- */
49
- hostToolsEventsEmit?: EmmitFunction;
50
44
  /**
51
45
  * "open" es una variable que se encarga de abrir o cerrar el formulario
52
46
  * @createdAt 2024-10-08 13:22:53 - automatic
@@ -65,7 +59,6 @@ export interface ThemeSettingsStateWithActions extends ThemeSettingsStore {
65
59
  onChangeColor: (color: ThemeUserColor) => void;
66
60
  onChangeLayout: (event: React.ChangeEvent<HTMLInputElement>) => void;
67
61
  handleOpen: () => void;
68
- registerHostToolsEventsEmit: (eventsEmit?: EmmitFunction) => void;
69
62
  setThemeSettings: (newValue: Partial<ThemeUserSettings>) => void;
70
63
  };
71
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAG,uBAAuB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;A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MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IACrC;;;OAGG;IACH,YAAY,EAAE,KAAK,CAAC;IACpB;;;OAGG;IACH,uBAAuB,EAAE,uBAAuB,CAAC;IACjD;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/D;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,MAAM,8BAA8B,GAAG,kBAAkB,CAAC;AAChE,MAAM,MAAM,8BAA8B,GAAG,8BAA8B,CAAC;AAE5E,MAAM,WAAW,6BAA8B,SAAQ,kBAAkB;IACvE,eAAe,EAAE;QACf,IAAI,EAAE,MAAM,IAAI,CAAC;QACjB,eAAe,EAAE,MAAM,IAAI,CAAC;QAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;QAC3B,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;QAC5C,iBAAiB,EAAE,CAAC,SAAS,EAAE,kBAAkB,KAAK,IAAI,CAAC;QAC3D,aAAa,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;QAC/C,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;QACrE,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KAClE,CAAC;CACH;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;IACxC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC"}
@@ -1,11 +1,12 @@
1
1
  export * from './FormatterContext';
2
+ export { buildFormattersFromUserPreferences } from './FormatterContext/helpers';
2
3
  export type { Formatters, DateFormatter, NumberFormatter, CurrencyFormatter, } from './FormatterContext/types';
3
4
  export * from './AppearanceComponentContext';
4
5
  export * from './LocalesContext';
5
6
  export * from './ResponsiveContainerContext';
6
7
  export type { BreakpointType } from './ResponsiveContainerContext/types';
7
8
  export type { NetworkLocaleType, LocaleType } from './LocalesContext/types';
8
- export { getLocaleFromNetwork } from './LocalesContext/helper';
9
+ export { getLocaleFromNetwork, normalizeSupportedLocaleString, splitLocale, } from './LocalesContext/helper';
9
10
  export * from './HostThemeContext';
10
11
  export * from './DeviceTypeContext';
11
12
  export * from './ThemeSettingsContext';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/graphics/src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,YAAY,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAElC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,cAAc,oBAAoB,CAAC;AAEnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AAEvC,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/graphics/src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;AAChF,YAAY,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAElC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,WAAW,GACZ,MAAM,yBAAyB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AAEvC,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,7 +1,7 @@
1
- import { DomainCountry } from '@m4l/core';
1
+ import { UserPreferences } from '@m4l/core';
2
2
  import { LocaleType } from '../../contexts';
3
3
  export declare const STORYBOOK_LOCALE_HOST_EN: LocaleType;
4
- export declare const STORYBOOK_DOMAIN_COUNTRY: DomainCountry;
4
+ export declare const STORYBOOK_USER_PREFERENCES: UserPreferences;
5
5
  export declare const STORYBOOK_THEME_MODE = "light";
6
6
  export declare const STORYBOOK_THEME_COLOR = "patronus";
7
7
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/decorators/MFIsolationAppStorybook/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,wBAAwB,EAAE,UAStC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,aAMtC,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,qBAAqB,aAAa,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/decorators/MFIsolationAppStorybook/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,wBAAwB,EAAE,UAStC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,eAkBxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,qBAAqB,aAAa,CAAC"}
@@ -1,22 +1,34 @@
1
- import n from "date-fns/locale/en-US";
1
+ import e from "date-fns/locale/en-US";
2
2
  const o = {
3
3
  lang: "en",
4
4
  script: void 0,
5
5
  region: "US",
6
6
  name: "English US",
7
7
  urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/commons/assets/icons/langs/lang_en.svg",
8
- module: n,
8
+ module: e,
9
9
  localeString: "en-US"
10
- }, e = {
11
- id: 1,
10
+ }, n = {
11
+ decimalSymbol: ".",
12
+ thousandsSymbol: ",",
13
+ dateFormat: "yyyy-MM-dd",
14
+ timeFormat: "HH:mm:ss",
15
+ timeZone: {
16
+ id: 1,
17
+ name: "America/Bogota",
18
+ title: "Bogota",
19
+ baseOffset: -5,
20
+ dstOffset: -5,
21
+ countryCode: "CO"
22
+ },
23
+ locale: o.localeString,
24
+ magnitudesSystemId: -1,
25
+ properties: [],
12
26
  currency: "USD",
13
- currency_decimal_digits: 2,
14
- decimal_symbol: ".",
15
- thousands_symbol: ","
16
- }, t = "light", O = "patronus";
27
+ currencyDecimalDigits: 2
28
+ }, s = "light", a = "patronus";
17
29
  export {
18
- e as STORYBOOK_DOMAIN_COUNTRY,
19
30
  o as STORYBOOK_LOCALE_HOST_EN,
20
- O as STORYBOOK_THEME_COLOR,
21
- t as STORYBOOK_THEME_MODE
31
+ a as STORYBOOK_THEME_COLOR,
32
+ s as STORYBOOK_THEME_MODE,
33
+ n as STORYBOOK_USER_PREFERENCES
22
34
  };
@@ -1,6 +1,6 @@
1
1
  import { MFAuthAppStorybookProps } from './types';
2
2
  /**
3
- * Provide the shared Storybook theme, formatter, and domain-country layer.
3
+ * Provide the shared Storybook theme plus the same effective-preferences seam used by runtime shells.
4
4
  */
5
5
  export declare function MFAppStorybook(props: MFAuthAppStorybookProps): import("@emotion/react/jsx-runtime").JSX.Element;
6
6
  //# sourceMappingURL=MFAppStorybook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MFAppStorybook.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/graphics/src/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,uBAAuB,oDAyB5D"}
1
+ {"version":3,"file":"MFAppStorybook.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/graphics/src/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,uBAAuB,oDAsB5D"}
@@ -1,35 +1,30 @@
1
1
  import { jsx as r } from "@emotion/react/jsx-runtime";
2
- import { format as i } from "date-fns";
3
- import { DomainCountryProvider as m } from "@m4l/core";
4
- import { fnComponentsOverrides as n, getUserThemeOptions as c } from "@m4l/styles";
5
- import { STORYBOOK_DOMAIN_COUNTRY as o, STORYBOOK_THEME_MODE as O, STORYBOOK_THEME_COLOR as s } from "../../constants.js";
6
- import { HostThemeProvider as d } from "../../../../contexts/HostThemeContext/index.js";
7
- import { FormatterProvider as f } from "../../../../contexts/FormatterContext/index.js";
8
- function l(t) {
9
- const { children: e } = t;
2
+ import { UserPreferencesProvider as m } from "@m4l/core";
3
+ import { fnComponentsOverrides as s, getUserThemeOptions as n } from "@m4l/styles";
4
+ import { useMemo as O } from "react";
5
+ import { STORYBOOK_USER_PREFERENCES as o, STORYBOOK_THEME_MODE as f, STORYBOOK_THEME_COLOR as p } from "../../constants.js";
6
+ import { buildFormattersFromUserPreferences as E } from "../../../../contexts/FormatterContext/helpers.js";
7
+ import { HostThemeProvider as c } from "../../../../contexts/HostThemeContext/index.js";
8
+ import { FormatterProvider as d } from "../../../../contexts/FormatterContext/index.js";
9
+ function S(e) {
10
+ const { children: t } = e, i = O(() => E(o), []);
10
11
  return /* @__PURE__ */ r(
11
- d,
12
+ c,
12
13
  {
13
- hostThemeOptions: c(O, s),
14
- fnComponentsOverrides: n,
14
+ hostThemeOptions: n(f, p),
15
+ fnComponentsOverrides: s,
15
16
  isMicroFrontEnd: !0,
16
- children: /* @__PURE__ */ r(m, { ...o, isMicroFrontEnd: !1, children: /* @__PURE__ */ r(
17
- f,
17
+ children: /* @__PURE__ */ r(
18
+ m,
18
19
  {
19
20
  isMicroFrontEnd: !1,
20
- dateFormatter: {
21
- formatDate: i
22
- },
23
- currencyFormatter: {
24
- code: o.currency,
25
- decimalDigits: o.currency_decimal_digits
26
- },
27
- children: e
21
+ ...o,
22
+ children: /* @__PURE__ */ r(d, { isMicroFrontEnd: !1, ...i, children: t })
28
23
  }
29
- ) })
24
+ )
30
25
  }
31
26
  );
32
27
  }
33
28
  export {
34
- l as MFAppStorybook
29
+ S as MFAppStorybook
35
30
  };
@@ -5,5 +5,5 @@
5
5
  * @updatedAt 2024-10-06 20:07:18 - automatic
6
6
  * @updatedUser Juan Escobar - automatic
7
7
  */
8
- export declare const useFormatter: () => import('../..').Formatters;
8
+ export declare const useFormatter: () => import('../../contexts/FormatterContext/types').FormatterContextProps;
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/hooks/useFormatter/index.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,kCAOxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/hooks/useFormatter/index.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,6EAOxB,CAAC"}
package/index.js CHANGED
@@ -1,83 +1,87 @@
1
- import { GlobalStyles as t } from "./components/GlobalStyles/index.js";
1
+ import { GlobalStyles as r } from "./components/GlobalStyles/index.js";
2
2
  import { M4L_CHROMATIC_AUTOFILL as p, getInputAutofillBodyNestedStyles as m, getInputAutofillKeyframeStyles as n } from "./components/GlobalStyles/getInputAutofillGlobalStyles.js";
3
- import { getLocaleFromNetwork as x } from "./contexts/LocalesContext/helper.js";
4
- import { FormatterContext as i, FormatterProvider as a } from "./contexts/FormatterContext/index.js";
5
- import { AppearanceComponentContext as u, AppearanceComponentProvider as S } from "./contexts/AppearanceComponentContext/AppearanceComponentContext.js";
6
- import { createAppearanceComponentStore as T } from "./contexts/AppearanceComponentContext/AppearanceComponentStore.js";
7
- import { useAppearanceComponentStore as A } from "./contexts/AppearanceComponentContext/useAppearanceComponentStore.js";
8
- import { LocalesContext as d, LocalesProvider as h } from "./contexts/LocalesContext/index.js";
9
- import { ResponsiveContainerContext as y, ResponsiveContainerProvider as R } from "./contexts/ResponsiveContainerContext/index.js";
10
- import { HostThemeContext as P, HostThemeProvider as F } from "./contexts/HostThemeContext/index.js";
11
- import { DeviceTypeContext as b, DeviceTypeProvider as M } from "./contexts/DeviceTypeContext/index.js";
12
- import { KEY_LOCAL_STORAGE_THEME_SETTINGS as E, defaultThemeSettings as O } from "./contexts/ThemeSettingsContext/constants.js";
13
- import { ThemeSettingsContext as H, ThemeSettingsProvider as W } from "./contexts/ThemeSettingsContext/ThemeSettingsContext.js";
14
- import { WithAppearanceContext as z } from "./decorators/WithAppearanceContext/WithAppearanceContext.js";
15
- import { MFIsolationAppStorybook as G } from "./decorators/MFIsolationAppStorybook/MFIsolationAppStorybook.js";
16
- import { MFAppStorybook as K } from "./decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.js";
17
- import { WithStorybookThemeContext as B, createWithStorybookThemeContext as Y } from "./decorators/WithStorybookThemeContext/WithStorybookThemeContext.js";
18
- import { useFirstRender as q } from "./hooks/useFirstRender/index.js";
19
- import { useComponentSize as Q } from "./hooks/useComponentSize/useComponentSize.js";
20
- import { useFormatter as X } from "./hooks/useFormatter/index.js";
21
- import { useIsMountedRef as $ } from "./hooks/useIsMountedRef/index.js";
22
- import { useLocales as oe } from "./hooks/useLocales/index.js";
23
- import { useResponsiveContainerStore as re } from "./hooks/useResponsiveContainer/index.js";
24
- import { useUserAgent as me } from "./hooks/useUserAgent/index.js";
25
- import { useIsMobile as se } from "./hooks/useIsMobile/index.js";
26
- import { useOffSetTop as fe } from "./hooks/useOffSetTop.js";
27
- import { useHostTheme as ae } from "./hooks/useHostTheme/index.js";
28
- import { useResizeObserver as ue } from "./hooks/useResizeObserver/index.js";
29
- import { useResponsiveDesktop as le } from "./hooks/useResponsive/index.js";
30
- import { useThemeSettingsStore as ce } from "./hooks/useThemSettingsStore/index.js";
31
- import { usePaginate as ve } from "./hooks/usePaginate/index.js";
32
- import { useRows as he } from "./hooks/useRows/index.js";
33
- import { capitalize as ye } from "./utils/strings.js";
34
- import { getAnchorElPositionWindow as Le } from "./utils/anchorEl.js";
35
- import { getContrastTextColor as Fe } from "./utils/getContrastTextColor/getContrastTextColor.js";
3
+ import { buildFormattersFromUserPreferences as x } from "./contexts/FormatterContext/helpers.js";
4
+ import { getLocaleFromNetwork as i, normalizeSupportedLocaleString as a, splitLocale as l } from "./contexts/LocalesContext/helper.js";
5
+ import { FormatterContext as C, FormatterProvider as S } from "./contexts/FormatterContext/index.js";
6
+ import { AppearanceComponentContext as c, AppearanceComponentProvider as d } from "./contexts/AppearanceComponentContext/AppearanceComponentContext.js";
7
+ import { createAppearanceComponentStore as v } from "./contexts/AppearanceComponentContext/AppearanceComponentStore.js";
8
+ import { useAppearanceComponentStore as g } from "./contexts/AppearanceComponentContext/useAppearanceComponentStore.js";
9
+ import { LocalesContext as L, LocalesProvider as F } from "./contexts/LocalesContext/index.js";
10
+ import { ResponsiveContainerContext as R, ResponsiveContainerProvider as b } from "./contexts/ResponsiveContainerContext/index.js";
11
+ import { HostThemeContext as M, HostThemeProvider as k } from "./contexts/HostThemeContext/index.js";
12
+ import { DeviceTypeContext as O, DeviceTypeProvider as _ } from "./contexts/DeviceTypeContext/index.js";
13
+ import { KEY_LOCAL_STORAGE_THEME_SETTINGS as z, defaultThemeSettings as W } from "./contexts/ThemeSettingsContext/constants.js";
14
+ import { ThemeSettingsContext as D, ThemeSettingsProvider as G } from "./contexts/ThemeSettingsContext/ThemeSettingsContext.js";
15
+ import { WithAppearanceContext as U } from "./decorators/WithAppearanceContext/WithAppearanceContext.js";
16
+ import { MFIsolationAppStorybook as B } from "./decorators/MFIsolationAppStorybook/MFIsolationAppStorybook.js";
17
+ import { MFAppStorybook as j } from "./decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.js";
18
+ import { WithStorybookThemeContext as J, createWithStorybookThemeContext as Q } from "./decorators/WithStorybookThemeContext/WithStorybookThemeContext.js";
19
+ import { useFirstRender as X } from "./hooks/useFirstRender/index.js";
20
+ import { useComponentSize as $ } from "./hooks/useComponentSize/useComponentSize.js";
21
+ import { useFormatter as oe } from "./hooks/useFormatter/index.js";
22
+ import { useIsMountedRef as te } from "./hooks/useIsMountedRef/index.js";
23
+ import { useLocales as me } from "./hooks/useLocales/index.js";
24
+ import { useResponsiveContainerStore as se } from "./hooks/useResponsiveContainer/index.js";
25
+ import { useUserAgent as fe } from "./hooks/useUserAgent/index.js";
26
+ import { useIsMobile as ae } from "./hooks/useIsMobile/index.js";
27
+ import { useOffSetTop as ue } from "./hooks/useOffSetTop.js";
28
+ import { useHostTheme as Se } from "./hooks/useHostTheme/index.js";
29
+ import { useResizeObserver as ce } from "./hooks/useResizeObserver/index.js";
30
+ import { useResponsiveDesktop as Ae } from "./hooks/useResponsive/index.js";
31
+ import { useThemeSettingsStore as he } from "./hooks/useThemSettingsStore/index.js";
32
+ import { usePaginate as ye } from "./hooks/usePaginate/index.js";
33
+ import { useRows as Fe } from "./hooks/useRows/index.js";
34
+ import { capitalize as Re } from "./utils/strings.js";
35
+ import { getAnchorElPositionWindow as Ie } from "./utils/anchorEl.js";
36
+ import { getContrastTextColor as ke } from "./utils/getContrastTextColor/getContrastTextColor.js";
36
37
  export {
37
- u as AppearanceComponentContext,
38
- S as AppearanceComponentProvider,
39
- b as DeviceTypeContext,
40
- M as DeviceTypeProvider,
41
- i as FormatterContext,
42
- a as FormatterProvider,
43
- t as GlobalStyles,
44
- P as HostThemeContext,
45
- F as HostThemeProvider,
46
- E as KEY_LOCAL_STORAGE_THEME_SETTINGS,
47
- d as LocalesContext,
48
- h as LocalesProvider,
38
+ c as AppearanceComponentContext,
39
+ d as AppearanceComponentProvider,
40
+ O as DeviceTypeContext,
41
+ _ as DeviceTypeProvider,
42
+ C as FormatterContext,
43
+ S as FormatterProvider,
44
+ r as GlobalStyles,
45
+ M as HostThemeContext,
46
+ k as HostThemeProvider,
47
+ z as KEY_LOCAL_STORAGE_THEME_SETTINGS,
48
+ L as LocalesContext,
49
+ F as LocalesProvider,
49
50
  p as M4L_CHROMATIC_AUTOFILL,
50
- K as MFAppStorybook,
51
- G as MFIsolationAppStorybook,
52
- y as ResponsiveContainerContext,
53
- R as ResponsiveContainerProvider,
54
- H as ThemeSettingsContext,
55
- W as ThemeSettingsProvider,
56
- z as WithAppearanceContext,
57
- B as WithStorybookThemeContext,
58
- ye as capitalize,
59
- T as createAppearanceComponentStore,
60
- Y as createWithStorybookThemeContext,
61
- O as defaultThemeSettings,
62
- Le as getAnchorElPositionWindow,
63
- Fe as getContrastTextColor,
51
+ j as MFAppStorybook,
52
+ B as MFIsolationAppStorybook,
53
+ R as ResponsiveContainerContext,
54
+ b as ResponsiveContainerProvider,
55
+ D as ThemeSettingsContext,
56
+ G as ThemeSettingsProvider,
57
+ U as WithAppearanceContext,
58
+ J as WithStorybookThemeContext,
59
+ x as buildFormattersFromUserPreferences,
60
+ Re as capitalize,
61
+ v as createAppearanceComponentStore,
62
+ Q as createWithStorybookThemeContext,
63
+ W as defaultThemeSettings,
64
+ Ie as getAnchorElPositionWindow,
65
+ ke as getContrastTextColor,
64
66
  m as getInputAutofillBodyNestedStyles,
65
67
  n as getInputAutofillKeyframeStyles,
66
- x as getLocaleFromNetwork,
67
- A as useAppearanceComponentStore,
68
- Q as useComponentSize,
69
- q as useFirstRender,
70
- X as useFormatter,
71
- ae as useHostTheme,
72
- se as useIsMobile,
73
- $ as useIsMountedRef,
74
- oe as useLocales,
75
- fe as useOffSetTop,
76
- ve as usePaginate,
77
- ue as useResizeObserver,
78
- re as useResponsiveContainerStore,
79
- le as useResponsiveDesktop,
80
- he as useRows,
81
- ce as useThemeSettingsStore,
82
- me as useUserAgent
68
+ i as getLocaleFromNetwork,
69
+ a as normalizeSupportedLocaleString,
70
+ l as splitLocale,
71
+ g as useAppearanceComponentStore,
72
+ $ as useComponentSize,
73
+ X as useFirstRender,
74
+ oe as useFormatter,
75
+ Se as useHostTheme,
76
+ ae as useIsMobile,
77
+ te as useIsMountedRef,
78
+ me as useLocales,
79
+ ue as useOffSetTop,
80
+ ye as usePaginate,
81
+ ce as useResizeObserver,
82
+ se as useResponsiveContainerStore,
83
+ Ae as useResponsiveDesktop,
84
+ Fe as useRows,
85
+ he as useThemeSettingsStore,
86
+ fe as useUserAgent
83
87
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "7.5.0-beta-feature-731-code-editor.0",
3
+ "version": "7.5.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -43,6 +43,7 @@
43
43
  "@emotion/react": "11.14.0",
44
44
  "@mui/material": "5.16.7",
45
45
  "date-fns": "2.30.0",
46
+ "date-fns-tz": "2.0.0",
46
47
  "react": "19.2.4",
47
48
  "zustand": "4.3.6",
48
49
  "@mui/x-date-pickers": "6.20.2",