@m4l/graphics 7.2.2 → 7.2.3-beta.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 (97) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +43 -43
  3. package/lib/graphics.d.ts +6 -0
  4. package/lib/graphics.d.ts.map +1 -0
  5. package/package.json +29 -57
  6. package/components/GlobalStyles/index.d.ts +0 -8
  7. package/components/GlobalStyles/index.js +0 -82
  8. package/components/index.d.ts +0 -1
  9. package/components/index.js +0 -1
  10. package/contexts/DeviceTypeContext/helper.d.ts +0 -9
  11. package/contexts/DeviceTypeContext/helper.js +0 -4
  12. package/contexts/DeviceTypeContext/index.d.ts +0 -15
  13. package/contexts/DeviceTypeContext/index.js +0 -18
  14. package/contexts/DeviceTypeContext/store.d.ts +0 -18
  15. package/contexts/DeviceTypeContext/store.js +0 -36
  16. package/contexts/DeviceTypeContext/types.d.ts +0 -36
  17. package/contexts/FormatterContext/index.d.ts +0 -12
  18. package/contexts/FormatterContext/index.js +0 -74
  19. package/contexts/FormatterContext/types.d.ts +0 -58
  20. package/contexts/HostThemeContext/index.d.ts +0 -11
  21. package/contexts/HostThemeContext/index.js +0 -46
  22. package/contexts/HostThemeContext/types.d.ts +0 -17
  23. package/contexts/LocalesContext/helper.d.ts +0 -25
  24. package/contexts/LocalesContext/helper.js +0 -35
  25. package/contexts/LocalesContext/index.d.ts +0 -11
  26. package/contexts/LocalesContext/index.js +0 -71
  27. package/contexts/LocalesContext/types.d.ts +0 -26
  28. package/contexts/ResponsiveContainerContext/constants.d.ts +0 -2
  29. package/contexts/ResponsiveContainerContext/constants.js +0 -4
  30. package/contexts/ResponsiveContainerContext/index.d.ts +0 -16
  31. package/contexts/ResponsiveContainerContext/index.js +0 -51
  32. package/contexts/ResponsiveContainerContext/store.d.ts +0 -18
  33. package/contexts/ResponsiveContainerContext/store.js +0 -33
  34. package/contexts/ResponsiveContainerContext/types.d.ts +0 -26
  35. package/contexts/ThemeSettingsContext/ThemeSettingsContext.d.ts +0 -19
  36. package/contexts/ThemeSettingsContext/ThemeSettingsContext.js +0 -32
  37. package/contexts/ThemeSettingsContext/constants.d.ts +0 -2
  38. package/contexts/ThemeSettingsContext/constants.js +0 -10
  39. package/contexts/ThemeSettingsContext/index.d.ts +0 -3
  40. package/contexts/ThemeSettingsContext/index.js +0 -1
  41. package/contexts/ThemeSettingsContext/store.d.ts +0 -19
  42. package/contexts/ThemeSettingsContext/store.js +0 -177
  43. package/contexts/ThemeSettingsContext/types.d.ts +0 -71
  44. package/contexts/index.d.ts +0 -12
  45. package/contexts/index.js +0 -1
  46. package/hooks/index.d.ts +0 -14
  47. package/hooks/index.js +0 -1
  48. package/hooks/useFirstRender/index.d.ts +0 -9
  49. package/hooks/useFirstRender/index.js +0 -10
  50. package/hooks/useFormatter/index.d.ts +0 -8
  51. package/hooks/useFormatter/index.js +0 -11
  52. package/hooks/useHostTheme/index.d.ts +0 -8
  53. package/hooks/useHostTheme/index.js +0 -11
  54. package/hooks/useIsMobile/index.d.ts +0 -14
  55. package/hooks/useIsMobile/index.js +0 -16
  56. package/hooks/useIsMountedRef/index.d.ts +0 -8
  57. package/hooks/useIsMountedRef/index.js +0 -13
  58. package/hooks/useLocales/index.d.ts +0 -8
  59. package/hooks/useLocales/index.js +0 -11
  60. package/hooks/useOffSetTop.d.ts +0 -8
  61. package/hooks/useOffSetTop.js +0 -12
  62. package/hooks/usePaginate/index.d.ts +0 -14
  63. package/hooks/usePaginate/index.js +0 -76
  64. package/hooks/usePaginate/index.test.d.ts +0 -35
  65. package/hooks/usePaginate/types.d.ts +0 -21
  66. package/hooks/usePaginate/types.js +0 -8
  67. package/hooks/useResizeObserver/index.d.ts +0 -9
  68. package/hooks/useResizeObserver/index.js +0 -18
  69. package/hooks/useResponsive/index.d.ts +0 -5
  70. package/hooks/useResponsive/index.js +0 -7
  71. package/hooks/useResponsiveContainer/index.d.ts +0 -6
  72. package/hooks/useResponsiveContainer/index.js +0 -12
  73. package/hooks/useRows/index.d.ts +0 -11
  74. package/hooks/useRows/index.js +0 -70
  75. package/hooks/useRows/index.test.d.ts +0 -1
  76. package/hooks/useRows/state.d.ts +0 -29
  77. package/hooks/useRows/state.js +0 -25
  78. package/hooks/useRows/state.test.d.ts +0 -1
  79. package/hooks/useRows/types.d.ts +0 -9
  80. package/hooks/useThemSettingsStore/index.d.ts +0 -9
  81. package/hooks/useThemSettingsStore/index.js +0 -12
  82. package/hooks/useUserAgent/index.d.ts +0 -4
  83. package/hooks/useUserAgent/index.js +0 -25
  84. package/test/setup.d.ts +0 -0
  85. package/test/utils.d.ts +0 -9
  86. package/utils/anchorEl.d.ts +0 -20
  87. package/utils/anchorEl.js +0 -49
  88. package/utils/getContrastTextColor/getContrastTextColor.d.ts +0 -5
  89. package/utils/getContrastTextColor/getContrastTextColor.js +0 -14
  90. package/utils/getContrastTextColor/index.d.ts +0 -2
  91. package/utils/getContrastTextColor/index.js +0 -1
  92. package/utils/getContrastTextColor/types.d.ts +0 -2
  93. package/utils/index.d.ts +0 -3
  94. package/utils/index.js +0 -1
  95. package/utils/strings.d.ts +0 -1
  96. package/utils/strings.js +0 -4
  97. package/vite-env.d.ts +0 -1
package/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './components';
2
2
  export * from './contexts';
3
3
  export * from './hooks';
4
4
  export * from './utils';
5
+ //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -1,60 +1,60 @@
1
- import { G as r } from "./components/GlobalStyles/index.js";
2
- import { g as s } from "./contexts/LocalesContext/helper.js";
3
- import { F as m, a as p } from "./contexts/FormatterContext/index.js";
4
- import { L as f, a as u } from "./contexts/LocalesContext/index.js";
5
- import { R as n, a as v } from "./contexts/ResponsiveContainerContext/index.js";
6
- import { H as l, a as T } from "./contexts/HostThemeContext/index.js";
7
- import { D as C, a as c } from "./contexts/DeviceTypeContext/index.js";
8
- import { d as h } from "./contexts/ThemeSettingsContext/constants.js";
9
- import { T as S, a as F } from "./contexts/ThemeSettingsContext/ThemeSettingsContext.js";
10
- import { u as D } from "./hooks/useFirstRender/index.js";
11
- import { u as b } from "./hooks/useFormatter/index.js";
12
- import { u as y } from "./hooks/useIsMountedRef/index.js";
13
- import { u as z } from "./hooks/useLocales/index.js";
14
- import { u as G } from "./hooks/useResponsiveContainer/index.js";
15
- import { u as M } from "./hooks/useUserAgent/index.js";
16
- import { u as E } from "./hooks/useIsMobile/index.js";
17
- import { u as U } from "./hooks/useOffSetTop.js";
18
- import { u as j } from "./hooks/useHostTheme/index.js";
19
- import { u as B } from "./hooks/useResizeObserver/index.js";
20
- import { u as K } from "./hooks/useResponsive/index.js";
21
- import { u as V } from "./hooks/useThemSettingsStore/index.js";
22
- import { u as Y } from "./hooks/usePaginate/index.js";
23
- import { u as _ } from "./hooks/useRows/index.js";
24
- import { c as ee } from "./utils/strings.js";
25
- import { g as re } from "./utils/anchorEl.js";
26
- import { g as se } from "./utils/getContrastTextColor/getContrastTextColor.js";
1
+ import { GlobalStyles as r } from "./components/GlobalStyles/index.js";
2
+ import { FormatterContext as s, FormatterProvider as m } from "./contexts/FormatterContext/index.js";
3
+ import { LocalesContext as x, LocalesProvider as f } from "./contexts/LocalesContext/index.js";
4
+ import { ResponsiveContainerContext as n, ResponsiveContainerProvider as a } from "./contexts/ResponsiveContainerContext/index.js";
5
+ import { getLocaleFromNetwork as v } from "./contexts/LocalesContext/helper.js";
6
+ import { HostThemeContext as C, HostThemeProvider as T } from "./contexts/HostThemeContext/index.js";
7
+ import { DeviceTypeContext as g, DeviceTypeProvider as c } from "./contexts/DeviceTypeContext/index.js";
8
+ import { ThemeSettingsContext as P, ThemeSettingsProvider as R } from "./contexts/ThemeSettingsContext/ThemeSettingsContext.js";
9
+ import { defaultThemeSettings as F } from "./contexts/ThemeSettingsContext/constants.js";
10
+ import { useFirstRender as b } from "./hooks/useFirstRender/index.js";
11
+ import { useFormatter as y } from "./hooks/useFormatter/index.js";
12
+ import { useIsMountedRef as H } from "./hooks/useIsMountedRef/index.js";
13
+ import { useLocales as z } from "./hooks/useLocales/index.js";
14
+ import { useResponsiveContainerStore as I } from "./hooks/useResponsiveContainer/index.js";
15
+ import { useUserAgent as O } from "./hooks/useUserAgent/index.js";
16
+ import { useIsMobile as G } from "./hooks/useIsMobile/index.js";
17
+ import { useOffSetTop as U } from "./hooks/useOffSetTop.js";
18
+ import { useHostTheme as j } from "./hooks/useHostTheme/index.js";
19
+ import { useResizeObserver as B } from "./hooks/useResizeObserver/index.js";
20
+ import { useResponsiveDesktop as K } from "./hooks/useResponsive/index.js";
21
+ import { useThemeSettingsStore as V } from "./hooks/useThemSettingsStore/index.js";
22
+ import { usePaginate as Y } from "./hooks/usePaginate/index.js";
23
+ import { useRows as _ } from "./hooks/useRows/index.js";
24
+ import { capitalize as ee } from "./utils/strings.js";
25
+ import { getAnchorElPositionWindow as re } from "./utils/anchorEl.js";
26
+ import { getContrastTextColor as se } from "./utils/getContrastTextColor/getContrastTextColor.js";
27
27
  export {
28
- C as DeviceTypeContext,
28
+ g as DeviceTypeContext,
29
29
  c as DeviceTypeProvider,
30
- m as FormatterContext,
31
- p as FormatterProvider,
30
+ s as FormatterContext,
31
+ m as FormatterProvider,
32
32
  r as GlobalStyles,
33
- l as HostThemeContext,
33
+ C as HostThemeContext,
34
34
  T as HostThemeProvider,
35
- f as LocalesContext,
36
- u as LocalesProvider,
35
+ x as LocalesContext,
36
+ f as LocalesProvider,
37
37
  n as ResponsiveContainerContext,
38
- v as ResponsiveContainerProvider,
39
- S as ThemeSettingsContext,
40
- F as ThemeSettingsProvider,
38
+ a as ResponsiveContainerProvider,
39
+ P as ThemeSettingsContext,
40
+ R as ThemeSettingsProvider,
41
41
  ee as capitalize,
42
- h as defaultThemeSettings,
42
+ F as defaultThemeSettings,
43
43
  re as getAnchorElPositionWindow,
44
44
  se as getContrastTextColor,
45
- s as getLocaleFromNetwork,
46
- D as useFirstRender,
47
- b as useFormatter,
45
+ v as getLocaleFromNetwork,
46
+ b as useFirstRender,
47
+ y as useFormatter,
48
48
  j as useHostTheme,
49
- E as useIsMobile,
50
- y as useIsMountedRef,
49
+ G as useIsMobile,
50
+ H as useIsMountedRef,
51
51
  z as useLocales,
52
52
  U as useOffSetTop,
53
53
  Y as usePaginate,
54
54
  B as useResizeObserver,
55
- G as useResponsiveContainerStore,
55
+ I as useResponsiveContainerStore,
56
56
  K as useResponsiveDesktop,
57
57
  _ as useRows,
58
58
  V as useThemeSettingsStore,
59
- M as useUserAgent
59
+ O as useUserAgent
60
60
  };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * M4lGraphics component
3
+ */
4
+ export declare function M4lGraphics(): import("@emotion/react/jsx-runtime").JSX.Element;
5
+ export default M4lGraphics;
6
+ //# sourceMappingURL=graphics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphics.d.ts","sourceRoot":"","sources":["../../../../../packages/graphics/src/lib/graphics.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,WAAW,qDAM1B;AAED,eAAe,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,68 +1,40 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "7.2.2",
4
- "license": "UNLICENSED",
5
- "author": "M4L Team*",
6
- "type": "module",
3
+ "version": "7.2.3-beta.0",
7
4
  "publishConfig": {
8
5
  "access": "public"
9
6
  },
10
- "lint-staged": {
11
- "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
12
- },
13
- "dependencies": {
14
- "date-fns": "^2.30.0",
15
- "lodash-es": "^4.17.21",
16
- "zustand": "4.3.6"
17
- },
18
- "peerDependencies": {
19
- "@m4l/core": "^2.0.0",
20
- "@m4l/styles": "^7.0.0",
21
- "@mui/material": "5.16.7",
22
- "@mui/x-date-pickers": "6.20.2",
23
- "@types/react": "^18.0.0",
24
- "react": "^18.0.0"
25
- },
26
- "peerDependenciesMeta": {
27
- "@mui/material": {
28
- "optional": true
29
- },
30
- "@mui/x-date-pickers": {
31
- "optional": true
32
- }
33
- },
34
- "resolutions": {
35
- "eslint": "9.28.0",
36
- "react": "^18.0.0",
37
- "@types/react": "^18.0.0",
38
- "@types/react-dom": "^18.0.0",
39
- "react-dom": "^18.0.0",
40
- "vite": "6.3.5"
41
- },
42
- "overrides": {
43
- "eslint": "9.28.0",
44
- "react": "^18.0.0",
45
- "@types/react": "^18.0.0",
46
- "@types/react-dom": "^18.0.0",
47
- "react-dom": "^18.0.0",
48
- "vite": "6.3.5"
49
- },
50
- "files": [
51
- "*"
52
- ],
53
- "source": "./index.js",
54
- "main": "src/index.ts",
7
+ "type": "module",
8
+ "main": "./index.js",
55
9
  "module": "./index.js",
56
10
  "types": "./index.d.ts",
57
- "sideEffects": false,
58
- "engines": {
59
- "node": ">=12.0.0"
60
- },
61
- "packageManager": "yarn@4.5.0",
62
- "private": false,
11
+ "files": [
12
+ "index.js",
13
+ "index.d.ts",
14
+ "lib/**/*"
15
+ ],
63
16
  "exports": {
17
+ "./package.json": "./package.json",
64
18
  ".": {
65
- "import": "./index.js"
19
+ "types": "./index.d.ts",
20
+ "import": "./index.js",
21
+ "default": "./index.js"
66
22
  }
23
+ },
24
+ "peerDependencies": {
25
+ "@emotion/react": "11.14.0",
26
+ "@emotion/styled": "11.14.1",
27
+ "react": "^18.0.0 || ^19.0.0",
28
+ "react-dom": "^18.0.0 || ^19.0.0"
29
+ },
30
+ "dependencies": {
31
+ "@emotion/react": "11.14.0",
32
+ "@mui/material": "5.16.7",
33
+ "react": "^19.0.0",
34
+ "@mui/x-date-pickers": "6.20.2",
35
+ "lodash-es": "^4.17.21",
36
+ "date-fns": "^2.30.0",
37
+ "zustand": "4.3.6",
38
+ "fast-equals": "^5.0.1"
67
39
  }
68
- }
40
+ }
@@ -1,8 +0,0 @@
1
- /**
2
- * Estilos globales
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-06 20:07:17 - automatic
5
- * @updatedAt 2024-10-06 20:07:18 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
- */
8
- export declare function GlobalStyles(): import("react").JSX.Element;
@@ -1,82 +0,0 @@
1
- import { jsx as e, Fragment as o } from "react/jsx-runtime";
2
- import { useTheme as r } from "@mui/material/styles";
3
- import { GlobalStyles as a } from "@mui/material";
4
- import { globalRemSize as i } from "@m4l/styles";
5
- function h() {
6
- const t = r();
7
- return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(
8
- a,
9
- {
10
- styles: {
11
- body: {
12
- fontFamily: 'Inter, "Segoe UI", Roboto, "Helvetica Neue", sans-serif, Open Sans',
13
- textRendering: "geometricPrecision",
14
- width: "100%",
15
- height: "100vh",
16
- "#rootIsolation": {
17
- width: "100vw",
18
- height: "100vh"
19
- },
20
- "*::-webkit-scrollbar": {
21
- width: `${t.vars.size.baseSpacings.sp1}!important`,
22
- height: `${t.vars.size.baseSpacings.sp1}!important`
23
- },
24
- "*::-webkit-scrollbar-track": {
25
- backgroundColor: "transparent"
26
- },
27
- "*::-webkit-scrollbar-thumb": {
28
- backgroundColor: `${t.vars.palette.default.focusOpacity}!important`,
29
- borderRadius: `${t.vars.size.borderRadius["r0-5"]}!important`
30
- },
31
- "input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active": {
32
- color: t.vars.palette.text.primary
33
- },
34
- "& #root": {
35
- width: "100%",
36
- height: "100%"
37
- }
38
- },
39
- "#nprogress": {
40
- pointerEvents: "none",
41
- "& .bar": {
42
- top: 0,
43
- left: 0,
44
- height: 2,
45
- width: "100%",
46
- position: "fixed",
47
- zIndex: t.zIndex.snackbar,
48
- backgroundColor: t.vars.palette.primary.main,
49
- boxShadow: `0 0 2px ${t.vars.palette.primary.main}`
50
- },
51
- "& .peg": {
52
- right: 0,
53
- opacity: 1,
54
- width: 100,
55
- height: "100%",
56
- display: "block",
57
- position: "absolute",
58
- transform: "rotate(3deg) translate(0px, -4px)",
59
- boxShadow: `0 0 10px ${t.vars.palette.primary.main}, 0 0 5px ${t.vars.palette.primary.main}`
60
- }
61
- },
62
- "& html": {
63
- fontSize: i.desktop,
64
- [t.breakpoints.down("sm")]: {
65
- fontSize: i.mobile
66
- }
67
- },
68
- // Global styles for native tags html
69
- img: {
70
- width: "100%"
71
- },
72
- // Global styles for native tags h1, h2, h3, h4, h5, h6
73
- "h1, h2, h3, h4, h5, h6, p": {
74
- margin: "unset"
75
- }
76
- }
77
- }
78
- ) });
79
- }
80
- export {
81
- h as G
82
- };
@@ -1 +0,0 @@
1
- export { GlobalStyles } from './GlobalStyles';
@@ -1 +0,0 @@
1
-
@@ -1,9 +0,0 @@
1
- import { DeviceType } from './types';
2
- /**
3
- * Check if the device type
4
- * @author Juan Escobar - automatic
5
- * @createdAt 2024-10-06 20:07:18 - automatic
6
- * @updatedAt 2024-10-08 19:28:36 - automatic
7
- * @updatedUser Juan Escobar - automatic
8
- */
9
- export declare const getDeviceType: (userAgent: string | undefined) => DeviceType;
@@ -1,4 +0,0 @@
1
- const i = (e) => typeof e > "u" ? "desktop" : /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e) ? "mobile" : "desktop";
2
- export {
3
- i as g
4
- };
@@ -1,15 +0,0 @@
1
- import { DeviceTypePrivderProps } from './types';
2
- declare const DeviceTypeContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('./types').DeviceTypeWithActions>, "setState"> & {
3
- setState<A extends string | {
4
- type: unknown;
5
- }>(partial: import('./types').DeviceTypeWithActions | Partial<import('./types').DeviceTypeWithActions> | ((state: import('./types').DeviceTypeWithActions) => import('./types').DeviceTypeWithActions | Partial<import('./types').DeviceTypeWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
6
- }, "setState"> & {
7
- setState(nextStateOrUpdater: import('./types').DeviceTypeWithActions | Partial<import('./types').DeviceTypeWithActions> | ((state: import('immer/dist/internal').WritableDraft<import('./types').DeviceTypeWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
8
- type: unknown;
9
- } | undefined): void;
10
- }) | null>;
11
- /**
12
- * Proveedor de contenedor responsivo
13
- */
14
- declare const DeviceTypeProvider: (props: DeviceTypePrivderProps) => import("react").JSX.Element;
15
- export { DeviceTypeProvider, DeviceTypeContext };
@@ -1,18 +0,0 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { createContext as a, useRef as u, useEffect as v } from "react";
3
- import { c as f } from "./store.js";
4
- import { g as m } from "./helper.js";
5
- import { u as d } from "../../hooks/useUserAgent/index.js";
6
- const y = a(null), S = (r) => {
7
- const { children: o, forcedDeviceType: c, storeId: s, storeDevtoolsEnabled: i } = r, n = d(), e = u(), t = c ?? m(n);
8
- return e.current || (e.current = f({
9
- deviceType: t,
10
- storeId: s
11
- }, i)), v(() => {
12
- e.current?.getState().deviceType !== t && e.current?.getState().actions.setDeviceType(t);
13
- }, [t]), /* @__PURE__ */ p(y.Provider, { value: e.current, children: o });
14
- };
15
- export {
16
- y as D,
17
- S as a
18
- };
@@ -1,18 +0,0 @@
1
- import { InitialDeviceTypeProps, DeviceTypeWithActions } from './types';
2
- /**
3
- * Crea la tienda de contenedor responsivo
4
- * @author Juan Escobar - automatic
5
- * @createdAt 2024-10-06 20:07:18 - automatic
6
- * @updatedAt 2024-10-06 20:07:18 - automatic
7
- * @updatedUser Juan Escobar - automatic
8
- */
9
- export declare const createDeviceTypeStore: (initProps: InitialDeviceTypeProps, storeDevtoolsEnabled?: boolean) => Omit<Omit<import('zustand').StoreApi<DeviceTypeWithActions>, "setState"> & {
10
- setState<A extends string | {
11
- type: unknown;
12
- }>(partial: DeviceTypeWithActions | Partial<DeviceTypeWithActions> | ((state: DeviceTypeWithActions) => DeviceTypeWithActions | Partial<DeviceTypeWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
13
- }, "setState"> & {
14
- setState(nextStateOrUpdater: DeviceTypeWithActions | Partial<DeviceTypeWithActions> | ((state: import('immer/dist/internal').WritableDraft<DeviceTypeWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
15
- type: unknown;
16
- } | undefined): void;
17
- };
18
- export type DeviceTypeStore = ReturnType<typeof createDeviceTypeStore>;
@@ -1,36 +0,0 @@
1
- import { createStore as a } from "zustand";
2
- import { devtools as n } from "zustand/middleware";
3
- import { immer as p } from "zustand/middleware/immer";
4
- const m = (e, t) => {
5
- const { enabled: o = !1 } = t;
6
- return o && process.env.NODE_ENV === "development" ? n(e, t) : e;
7
- }, D = (e, t = !1) => {
8
- const o = {
9
- ...e
10
- };
11
- return a(
12
- m(
13
- p((r, v) => ({
14
- ...o,
15
- actions: {
16
- /**
17
- * Establece el punto de interrupción
18
- * @author Juan Escobar - automatic
19
- * @createdAt 2024-10-06 20:07:18 - automatic
20
- * @updatedAt 2024-10-06 20:07:18 - automatic
21
- * @updatedUser Juan Escobar - automatic
22
- */
23
- setDeviceType: (s) => {
24
- r((c) => {
25
- c.deviceType = s;
26
- });
27
- }
28
- }
29
- })),
30
- { name: `DeviceTypeStore: ${e.storeId}`, enabled: t }
31
- )
32
- );
33
- };
34
- export {
35
- D as c
36
- };
@@ -1,36 +0,0 @@
1
- import { default as React } from 'react';
2
- export type DeviceType = 'mobile' | 'desktop';
3
- export interface DeviceTypeState {
4
- /**
5
- * "storeId" Id del store
6
- */
7
- storeId?: string;
8
- /**
9
- * "deviceType" Tipo de dispositivo detectado
10
- */
11
- deviceType: DeviceType;
12
- }
13
- export type InitialDeviceTypeProps = Pick<DeviceTypeState, 'deviceType' | 'storeId'>;
14
- export interface DeviceTypePrivderProps {
15
- /**
16
- * "storeId" Id del store
17
- */
18
- storeId?: string;
19
- /**
20
- * "storeDevtoolsEnabled" Determina si se debe usar devtools para el store
21
- */
22
- storeDevtoolsEnabled?: boolean;
23
- /**
24
- * "forcedDeviceType" Tipo de dispositivo forzado, para no usar el detectado del userAgent
25
- */
26
- forcedDeviceType?: DeviceType;
27
- /**
28
- * "children" Componentes hijos
29
- */
30
- children: React.ReactNode;
31
- }
32
- export interface DeviceTypeWithActions extends DeviceTypeState {
33
- actions: {
34
- setDeviceType: (newDeviceType: DeviceType) => void;
35
- };
36
- }
@@ -1,12 +0,0 @@
1
- import { FormatterProviderProps, Formatters } from './types';
2
- declare const FormatterContext: import('react').Context<Formatters | null>;
3
- /**
4
- * Componente encargado de proveer un contexto que permita saber los diferentes forrmatos,
5
- * Segunda linea
6
- * @author Juan Escobar - automatic
7
- * @createdAt 2024-10-06 20:07:18 - automatic
8
- * @updatedAt 2024-10-06 20:07:18 - automatic
9
- * @updatedUser Juan Escobar - automatic
10
- */
11
- declare function FormatterProvider(props: FormatterProviderProps): import("react").JSX.Element;
12
- export { FormatterProvider, FormatterContext };
@@ -1,74 +0,0 @@
1
- import { jsx as D } from "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 { u 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 || (() => {
8
- throw new Error("Incorrect use of formatDate");
9
- }), y = V(), { events_emit: g } = R(), [H, E] = k({
10
- currencyFormatter: {
11
- decimalDigits: r,
12
- code: o
13
- },
14
- numberFormatter: { decimalSymbol: a, thousandsSymbol: s },
15
- dateFormatter: {
16
- dateFormat: m,
17
- dateMask: n,
18
- datetimeFormat: c,
19
- datetimeMask: i,
20
- timeFormat: _,
21
- timeMask: d,
22
- formatDate: u
23
- }
24
- }), S = p((e) => {
25
- E(e);
26
- }, []);
27
- return h({
28
- isMicroFrontEnd: F,
29
- event: f.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
30
- setHandler: S
31
- }), v(() => {
32
- if (F || y)
33
- return;
34
- const e = {
35
- currencyFormatter: { decimalDigits: r, code: o },
36
- numberFormatter: { decimalSymbol: a, thousandsSymbol: s },
37
- dateFormatter: {
38
- dateFormat: m,
39
- dateMask: n,
40
- datetimeFormat: c,
41
- datetimeMask: i,
42
- timeFormat: _,
43
- timeMask: d,
44
- formatDate: u
45
- }
46
- };
47
- E(e), g(f.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
48
- }, [
49
- y,
50
- o,
51
- r,
52
- a,
53
- s,
54
- m,
55
- n,
56
- c,
57
- i,
58
- _,
59
- d,
60
- u
61
- ]), /* @__PURE__ */ D(
62
- x.Provider,
63
- {
64
- value: {
65
- ...H
66
- },
67
- children: b
68
- }
69
- );
70
- }
71
- export {
72
- x as F,
73
- I as a
74
- };
@@ -1,58 +0,0 @@
1
- import { Locale } from 'date-fns';
2
- import { ReactNode } from 'react';
3
- export interface CurrencyFormatter {
4
- code: string;
5
- decimalDigits: number;
6
- }
7
- export interface NumberFormatter {
8
- decimalSymbol: string;
9
- thousandsSymbol: string;
10
- }
11
- /**
12
- * Formateador de fechas
13
- * @author Juan Escobar - automatic
14
- * @createdAt 2024-10-06 20:07:18 - automatic
15
- * @updatedAt 2024-10-06 20:07:18 - automatic
16
- * @updatedUser Juan Escobar - automatic
17
- */
18
- export interface DateFormatter {
19
- dateFormat: string;
20
- datetimeFormat: string;
21
- dateMask: string;
22
- datetimeMask: string;
23
- timeFormat: string;
24
- timeMask: string;
25
- formatDate: (date: Date | number, format: string, options?: any) => string;
26
- }
27
- export interface OptionalDateFormatter {
28
- dateFormat?: string;
29
- datetimeFormat?: string;
30
- dateMask?: string;
31
- datetimeMask?: string;
32
- timeFormat?: string;
33
- timeMask?: string;
34
- formatDate: (date: Date | number, format: string, options?: {
35
- locale?: Locale;
36
- weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
37
- firstWeekContainsDate?: number;
38
- useAdditionalWeekYearTokens?: boolean;
39
- useAdditionalDayOfYearTokens?: boolean;
40
- }) => string;
41
- }
42
- export interface Formatters {
43
- currencyFormatter: CurrencyFormatter;
44
- dateFormatter: DateFormatter;
45
- numberFormatter: NumberFormatter;
46
- }
47
- export interface OptionalFormatters {
48
- currencyFormatter?: CurrencyFormatter;
49
- dateFormatter?: OptionalDateFormatter;
50
- numberFormatter?: NumberFormatter;
51
- }
52
- /**
53
- */
54
- export interface FormatterProviderProps extends OptionalFormatters {
55
- isMicroFrontEnd: boolean;
56
- children: ReactNode;
57
- }
58
- export type FormatterContextProps = Formatters;
@@ -1,11 +0,0 @@
1
- import { HostThemeProviderProps } from './types';
2
- declare const HostThemeContext: import('react').Context<import('./types').HostThemeType | null>;
3
- /**
4
- * Host theme provider
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-06 20:07:18 - automatic
7
- * @updatedAt 2024-10-08 19:28:36 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
- */
10
- declare function HostThemeProvider(props: HostThemeProviderProps): import("react").JSX.Element;
11
- export { HostThemeProvider, HostThemeContext };