@m4l/components 9.24.0-beta-feature-731-m4l-components-code-editor.6 → 9.24.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 (70) hide show
  1. package/@types/types.d.ts +0 -11
  2. package/components/AppBar/AppBar.d.ts.map +1 -1
  3. package/components/AppBar/AppBar.js +36 -29
  4. package/components/AppBar/types.d.ts +2 -2
  5. package/components/AppBar/types.d.ts.map +1 -1
  6. package/components/GridLayout/subcomponents/GridItem/index.d.ts.map +1 -1
  7. package/components/GridLayout/subcomponents/GridItem/index.js +21 -20
  8. package/components/MFLoader/MFLoader.d.ts.map +1 -1
  9. package/components/MFLoader/MFLoader.js +39 -39
  10. package/components/MFLoader/types.d.ts +16 -0
  11. package/components/MFLoader/types.d.ts.map +1 -1
  12. package/components/SideBar/context/sideBarContext/index.d.ts.map +1 -1
  13. package/components/SideBar/context/sideBarContext/index.js +15 -14
  14. package/components/SideBar/hooks/useCollapse/useCollapse.d.ts +2 -1
  15. package/components/SideBar/hooks/useCollapse/useCollapse.d.ts.map +1 -1
  16. package/components/SideBar/hooks/useCollapse/useCollapse.js +9 -9
  17. package/components/SideBar/index.d.ts +1 -1
  18. package/components/SideBar/index.d.ts.map +1 -1
  19. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +1 -1
  20. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +1 -1
  21. package/components/SideBar/types.d.ts +8 -1
  22. package/components/SideBar/types.d.ts.map +1 -1
  23. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.d.ts.map +1 -1
  24. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +66 -52
  25. package/components/areas/contexts/AreasContext/store.d.ts.map +1 -1
  26. package/components/areas/contexts/AreasContext/store.js +142 -141
  27. package/components/extended/index.d.ts +0 -1
  28. package/components/extended/index.d.ts.map +1 -1
  29. package/components/hook-form/index.d.ts +0 -1
  30. package/components/hook-form/index.d.ts.map +1 -1
  31. package/index.js +559 -572
  32. package/package.json +7 -10
  33. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts +0 -6
  34. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +0 -1
  35. package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +0 -266
  36. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts +0 -3
  37. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +0 -1
  38. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +0 -311
  39. package/components/extended/ReactSimpleCodeEditor/constants.d.ts +0 -82
  40. package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +0 -1
  41. package/components/extended/ReactSimpleCodeEditor/constants.js +0 -148
  42. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +0 -11
  43. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +0 -1
  44. package/components/extended/ReactSimpleCodeEditor/dictionary.js +0 -7
  45. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts +0 -58
  46. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts.map +0 -1
  47. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.js +0 -1063
  48. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts +0 -6
  49. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts.map +0 -1
  50. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.js +0 -7
  51. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts +0 -6
  52. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts.map +0 -1
  53. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.js +0 -9
  54. package/components/extended/ReactSimpleCodeEditor/index.d.ts +0 -4
  55. package/components/extended/ReactSimpleCodeEditor/index.d.ts.map +0 -1
  56. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +0 -18
  57. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +0 -1
  58. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +0 -4
  59. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +0 -84
  60. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +0 -1
  61. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +0 -64
  62. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts +0 -3
  63. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts.map +0 -1
  64. package/components/extended/ReactSimpleCodeEditor/types.d.ts +0 -452
  65. package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +0 -1
  66. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts +0 -7
  67. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts.map +0 -1
  68. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.js +0 -6
  69. package/components/hook-form/RHFCodeEditor/index.d.ts +0 -3
  70. package/components/hook-form/RHFCodeEditor/index.d.ts.map +0 -1
@@ -1,14 +1,14 @@
1
- import { useState as a, useEffect as h } from "react";
2
- import f from "../useSideBar/index.js";
1
+ import { useState as h, useEffect as a } from "react";
2
+ import u from "../useSideBar/index.js";
3
3
  import { useIsMobile as d } from "@m4l/graphics";
4
- const C = (s, e = !1) => {
5
- const { onMenuItemClick: n, onToggleVisible: l } = f(), [r, i] = a(e), c = d(), o = s.children && Array.isArray(s.children) && s.children.length > 0, t = () => {
6
- n(s), i(!r), c && (!o || o === void 0) && l(!1);
4
+ const b = (e, s = !1) => {
5
+ const { onMenuItemClick: r, onToggleVisible: l } = u(), [i, n] = h(s), t = d(), o = e.children && Array.isArray(e.children) && e.children.length > 0, c = (f) => {
6
+ f?.shiftKey ? r(e, { shiftKey: !0 }) : r(e), n(!i), t && (!o || o === void 0) && l(!1);
7
7
  };
8
- return h(() => {
9
- i(e);
10
- }, [e]), { isOpen: r, handlerClick: t, hasChildren: o };
8
+ return a(() => {
9
+ n(s);
10
+ }, [s]), { isOpen: i, handlerClick: c, hasChildren: o };
11
11
  };
12
12
  export {
13
- C as useCollapse
13
+ b as useCollapse
14
14
  };
@@ -1,3 +1,3 @@
1
1
  export { SideBar } from './SideBar';
2
- export type { MenuDataType } from './types';
2
+ export type { MenuDataType, MenuItemClickOptions } from './types';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/SideBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/SideBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
@@ -47,7 +47,7 @@ function H(S) {
47
47
  selected: e.active,
48
48
  startIcon: N,
49
49
  endIcon: i ? /* @__PURE__ */ t(z, { openState: o, active: e.active, icon: /* @__PURE__ */ t(h, {}) }) : null,
50
- onClick: () => E(),
50
+ onClick: E,
51
51
  size: r
52
52
  }
53
53
  ) }),
@@ -29,7 +29,7 @@ const q = (m) => {
29
29
  {
30
30
  label: e.title,
31
31
  endIcon: p ? /* @__PURE__ */ t(O, { openState: r, active: e.active }) : null,
32
- onClick: () => c(),
32
+ onClick: c,
33
33
  size: o
34
34
  }
35
35
  ) }),
@@ -15,6 +15,13 @@ export interface MenuDataType extends Record<string, any> {
15
15
  debugPort?: number;
16
16
  children?: Array<MenuDataType>;
17
17
  }
18
+ /**
19
+ * Optional click metadata forwarded by sidebar emitters when modifier keys
20
+ * should influence how the host opens the selected module.
21
+ */
22
+ export interface MenuItemClickOptions {
23
+ shiftKey?: boolean;
24
+ }
18
25
  /**
19
26
  * Propiedades para el componente SideBar.
20
27
  */
@@ -52,7 +59,7 @@ export interface SideBarProps {
52
59
  */
53
60
  companySlogan?: string;
54
61
  moduleSelectedId?: string | undefined;
55
- onMenuItemClick: (item: MenuDataType) => void;
62
+ onMenuItemClick: (item: MenuDataType, options?: MenuItemClickOptions) => void;
56
63
  /**
57
64
  * Función para alternar el estado colapsado de la barra lateral.
58
65
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/SideBar/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACjK,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAChC;AACD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAE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qB,GAAG,sBAAsB,CAAC,kBAAkB,EAAE,OAAO,qBAAqB,EAAE,KAAK,CAAC,CAAA;AACnH,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,kBAAkB,EAAE,OAAO,qBAAqB,EAAE,KAAK,CAAC,CAAA;AACjH,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,kBAAkB,EAAE,OAAO,qBAAqB,EAAE,KAAK,CAAC,CAAA;AACjH,MAAM,MAAM,sBAAsB,GAAG,sBAAsB,CAAC,qBAAqB,EAAE,OAAO,qBAAqB,EAAE,KAAK,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AreaGridLayout.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../packages/components/src/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAa1C;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,eAAe,qDAsIpD,CAAC"}
1
+ {"version":3,"file":"AreaGridLayout.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../packages/components/src/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAa1C;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,eAAe,qDA4JpD,CAAC"}
@@ -1,83 +1,97 @@
1
- import { jsx as n, Fragment as b } from "@emotion/react/jsx-runtime";
2
- import { shallow as s } from "zustand/shallow";
1
+ import { jsx as m, Fragment as v } from "@emotion/react/jsx-runtime";
2
+ import { shallow as r } from "zustand/shallow";
3
3
  import { Window as N } from "../Window/Window.js";
4
4
  import { useAreasStore as a } from "../../../../../../hooks/useAreas/index.js";
5
- import { areasViewerClasses as l } from "../../../../classes/index.js";
5
+ import { areasViewerClasses as u } from "../../../../classes/index.js";
6
6
  import D from "clsx";
7
- import { PADDING_GRIDLAYOUT as g, MARGIN_GRIDLAYOUT as p, RESPONSIVE_ROW_HEIGHTS as E } from "../../../../../../contexts/AreasContext/helpers/helper.js";
8
- import { MemonizePopupsViewer as M } from "../../../../../../../popups/components/PopupsViewer/PopupsViewer.js";
9
- import { useState as O, useMemo as P } from "react";
10
- import { dragResizeWindowRNDClasses as t } from "../../../../../../../DragResizeWindowRND/classes/index.js";
11
- import { useTheme as T } from "@mui/material";
12
- import { useComponentSize as _ } from "../../../../../../../../hooks/useComponentSize/index.js";
13
- import { withSizeProvider as V } from "../../../../../../../GridLayout/subcomponents/withSizeProvider/index.js";
14
- import { Responsive as k } from "../../../../../../../GridLayout/subcomponents/Responsive/index.js";
15
- const $ = V(k), re = (u) => {
16
- const { areaId: o, size: f } = u, h = a((e) => e.hashAreas[o].layoutItemsIds, s), I = a((e) => e.hashAreas[o].layouts, s), S = a((e) => e.hashAreas[o].breakpoints, s), y = a((e) => e.hashAreas[o].maximizedId, s), z = a((e) => e.hashAreas[o].cols, s), { onBreakpointsLayoutsChange: L, onContainerChange: C } = a(
7
+ import { PADDING_GRIDLAYOUT as g, MARGIN_GRIDLAYOUT as p, RESPONSIVE_ROW_HEIGHTS as M } from "../../../../../../contexts/AreasContext/helpers/helper.js";
8
+ import { MemonizePopupsViewer as O } from "../../../../../../../popups/components/PopupsViewer/PopupsViewer.js";
9
+ import { useState as P, useMemo as T, useEffect as V } from "react";
10
+ import { dragResizeWindowRNDClasses as s } from "../../../../../../../DragResizeWindowRND/classes/index.js";
11
+ import { useTheme as _ } from "@mui/material";
12
+ import { useComponentSize as k } from "../../../../../../../../hooks/useComponentSize/index.js";
13
+ import { withSizeProvider as $ } from "../../../../../../../GridLayout/subcomponents/withSizeProvider/index.js";
14
+ import { Responsive as F } from "../../../../../../../GridLayout/subcomponents/Responsive/index.js";
15
+ const U = $(F), ae = (f) => {
16
+ const { areaId: t, size: h } = f, I = a((e) => e.hashAreas[t].layoutItemsIds, r), y = a((e) => e.hashAreas[t].layouts, r), L = a((e) => e.hashAreas[t].breakpoints, r), c = a((e) => e.hashAreas[t].currentLayoutId, r), S = a((e) => e.hashAreas[t].maximizedId, r), z = a((e) => e.hashAreas[t].cols, r), { onBreakpointsLayoutsChange: A, onContainerChange: w } = a(
17
17
  (e) => e.areaActions,
18
- s
19
- ), c = T(), { currentSize: d } = _(f), [r, R] = O(void 0), A = () => {
20
- r && r.classList.add(t.resizing);
18
+ r
19
+ ), d = _(), { currentSize: l } = k(h), [o, C] = P(void 0), R = () => {
20
+ o && o.classList.add(s.resizing);
21
21
  }, H = () => {
22
- r && r.classList.remove(t.resizing);
22
+ o && o.classList.remove(s.resizing);
23
23
  }, G = () => {
24
- r && r.classList.add(t.dragging);
25
- }, w = () => {
26
- r && r.classList.remove(t.dragging);
27
- }, x = (e) => {
28
- e && e !== r && R(e);
29
- }, v = P(() => {
30
- const e = c?.size?.[c?.generalSettings?.isMobile ? "mobile" : "desktop"]?.[d]?.container, m = parseInt(e), i = isNaN(m) ? 32 : m;
24
+ o && o.classList.add(s.dragging);
25
+ }, x = () => {
26
+ o && o.classList.remove(s.dragging);
27
+ }, E = (e) => {
28
+ e && e !== o && C(e);
29
+ }, b = T(() => {
30
+ const e = d?.size?.[d?.generalSettings?.isMobile ? "mobile" : "desktop"]?.[l]?.container, i = parseInt(e), n = isNaN(i) ? 32 : i;
31
31
  return {
32
- xxs: i,
33
- xs: i,
34
- sm: i,
35
- md: i,
36
- lg: i
32
+ xxs: n,
33
+ xs: n,
34
+ sm: n,
35
+ md: n,
36
+ lg: n
37
37
  };
38
- }, [c, d]);
39
- return /* @__PURE__ */ n(
40
- $,
38
+ }, [d, l]);
39
+ return V(() => {
40
+ if (!o || !c)
41
+ return;
42
+ const e = window.requestAnimationFrame(() => {
43
+ o.querySelector(
44
+ `[data-grid-item-id="${c}"]`
45
+ )?.scrollIntoView?.({
46
+ block: "nearest",
47
+ inline: "nearest"
48
+ });
49
+ });
50
+ return () => {
51
+ window.cancelAnimationFrame(e);
52
+ };
53
+ }, [c, o]), /* @__PURE__ */ m(
54
+ U,
41
55
  {
42
- ref: x,
56
+ ref: E,
43
57
  autoSize: !1,
44
58
  compactType: "vertical",
45
59
  measureBeforeMount: !0,
46
60
  resizeHandles: ["nw", "se"],
47
61
  className: D(
48
- l.areaGridLayout,
49
- `${l.areaGridLayout}-${o}`
62
+ u.areaGridLayout,
63
+ `${u.areaGridLayout}-${t}`
50
64
  ),
51
- layouts: I,
52
- onLayoutChange: (e, m) => L(o, e, m),
53
- draggableHandle: `.${t.draggableHandle}`,
54
- draggableCancel: `.${t.draggableCancel}`,
55
- layoutItemRender: (e) => h.indexOf(e.i) === -1 ? /* @__PURE__ */ n(b, {}) : e.type === "placeholder" ? /* @__PURE__ */ n("div", {}) : /* @__PURE__ */ n(N, { windowId: e.i, areaId: o }),
56
- breakpoints: S,
57
- colapsedHeight: v,
58
- rowHeight: E,
65
+ layouts: y,
66
+ onLayoutChange: (e, i) => A(t, e, i),
67
+ draggableHandle: `.${s.draggableHandle}`,
68
+ draggableCancel: `.${s.draggableCancel}`,
69
+ layoutItemRender: (e) => I.indexOf(e.i) === -1 ? /* @__PURE__ */ m(v, {}) : e.type === "placeholder" ? /* @__PURE__ */ m("div", {}) : /* @__PURE__ */ m(N, { windowId: e.i, areaId: t }),
70
+ breakpoints: L,
71
+ colapsedHeight: b,
72
+ rowHeight: M,
59
73
  cols: z,
60
74
  containerMargin: [p, p],
61
75
  containerPadding: [g, g],
62
76
  onContainerChange: (e) => {
63
- C(o, e);
77
+ w(t, e);
64
78
  },
65
79
  preventCollision: !1,
66
- maximizeId: y,
67
- children: /* @__PURE__ */ n(
68
- M,
80
+ maximizeId: S,
81
+ children: /* @__PURE__ */ m(
82
+ O,
69
83
  {
70
- groupId: o,
71
- containerElement: r,
72
- onResizeStart: A,
84
+ groupId: t,
85
+ containerElement: o,
86
+ onResizeStart: R,
73
87
  onResizeStop: H,
74
88
  onDragStart: G,
75
- onDragStop: w
89
+ onDragStop: x
76
90
  }
77
91
  )
78
92
  }
79
93
  );
80
94
  };
81
95
  export {
82
- re as AreaGridLayout
96
+ ae as AreaGridLayout
83
97
  };
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/areas/contexts/AreasContext/store.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAiEjB;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,WAAW,sBAAsB,EACjC,8BAA4B;;;;;;;;CAkyC7B,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/areas/contexts/AreasContext/store.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAiEjB;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,WAAW,sBAAsB,EACjC,8BAA4B;;;;;;;;CA6yC7B,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC"}