@m4l/components 9.16.0 → 9.17.1-beta-feature-731-m4l-components-code-editor.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 (108) hide show
  1. package/@types/types.d.ts +11 -0
  2. package/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
  3. package/components/DynamicFilter/DynamicFilter.styles.js +12 -2
  4. package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.d.ts.map +1 -1
  5. package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.js +13 -13
  6. package/components/DynamicSort/DynamicSort.js +5 -5
  7. package/components/DynamicSort/DynamicSort.styles.d.ts.map +1 -1
  8. package/components/DynamicSort/DynamicSort.styles.js +217 -93
  9. package/components/DynamicSort/constants.js +4 -11
  10. package/components/DynamicSort/dictionary.d.ts +2 -0
  11. package/components/DynamicSort/dictionary.d.ts.map +1 -1
  12. package/components/DynamicSort/dictionary.js +10 -8
  13. package/components/DynamicSort/slots/DynamicSortSlots.d.ts +36 -0
  14. package/components/DynamicSort/slots/DynamicSortSlots.d.ts.map +1 -1
  15. package/components/DynamicSort/slots/DynamicSortSlots.js +102 -64
  16. package/components/DynamicSort/slots/SlotsEnum.d.ts +10 -1
  17. package/components/DynamicSort/slots/SlotsEnum.d.ts.map +1 -1
  18. package/components/DynamicSort/slots/SlotsEnum.js +2 -2
  19. package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.d.ts.map +1 -1
  20. package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.js +20 -15
  21. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts +3 -2
  22. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts.map +1 -1
  23. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.js +19 -19
  24. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts +3 -1
  25. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts.map +1 -1
  26. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +86 -16
  27. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +10 -1
  28. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts.map +1 -1
  29. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +29 -9
  30. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts +2 -1
  31. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts.map +1 -1
  32. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +9 -11
  33. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.d.ts +2 -2
  34. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.d.ts.map +1 -1
  35. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.js +21 -21
  36. package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts +2 -1
  37. package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts.map +1 -1
  38. package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.js +2 -2
  39. package/components/DynamicSort/subcomponents/InputSort/InputSort.d.ts +2 -1
  40. package/components/DynamicSort/subcomponents/InputSort/InputSort.d.ts.map +1 -1
  41. package/components/DynamicSort/subcomponents/InputSort/InputSort.js +44 -35
  42. package/components/DynamicSort/subcomponents/InputSort/useInputSort.d.ts +17 -41
  43. package/components/DynamicSort/subcomponents/InputSort/useInputSort.d.ts.map +1 -1
  44. package/components/DynamicSort/subcomponents/InputSort/useInputSort.js +57 -81
  45. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.d.ts +9 -0
  46. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.d.ts.map +1 -0
  47. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.js +85 -0
  48. package/components/DynamicSort/subcomponents/OverflowSortPopover/index.d.ts +3 -0
  49. package/components/DynamicSort/subcomponents/OverflowSortPopover/index.d.ts.map +1 -0
  50. package/components/DynamicSort/subcomponents/OverflowSortPopover/types.d.ts +11 -0
  51. package/components/DynamicSort/subcomponents/OverflowSortPopover/types.d.ts.map +1 -0
  52. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts +16 -1
  53. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
  54. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +52 -30
  55. package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts +5 -4
  56. package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts.map +1 -1
  57. package/components/DynamicSort/subcomponents/SortActions/SortActions.js +35 -32
  58. package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts +4 -3
  59. package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts.map +1 -1
  60. package/components/DynamicSort/subcomponents/SortActions/useSortActions.js +17 -18
  61. package/components/DynamicSort/types.d.ts +4 -0
  62. package/components/DynamicSort/types.d.ts.map +1 -1
  63. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts +6 -0
  64. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +1 -0
  65. package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +247 -0
  66. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts +3 -0
  67. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +1 -0
  68. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +297 -0
  69. package/components/extended/ReactSimpleCodeEditor/constants.d.ts +82 -0
  70. package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +1 -0
  71. package/components/extended/ReactSimpleCodeEditor/constants.js +149 -0
  72. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +11 -0
  73. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +1 -0
  74. package/components/extended/ReactSimpleCodeEditor/dictionary.js +7 -0
  75. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts +59 -0
  76. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts.map +1 -0
  77. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.js +1063 -0
  78. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts +6 -0
  79. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts.map +1 -0
  80. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.js +7 -0
  81. package/components/extended/ReactSimpleCodeEditor/index.d.ts +4 -0
  82. package/components/extended/ReactSimpleCodeEditor/index.d.ts.map +1 -0
  83. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +18 -0
  84. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +1 -0
  85. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +4 -0
  86. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +84 -0
  87. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +1 -0
  88. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +63 -0
  89. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts +3 -0
  90. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts.map +1 -0
  91. package/components/extended/ReactSimpleCodeEditor/storybookRuntime.d.ts +15 -0
  92. package/components/extended/ReactSimpleCodeEditor/storybookRuntime.d.ts.map +1 -0
  93. package/components/extended/ReactSimpleCodeEditor/types.d.ts +127 -0
  94. package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +1 -0
  95. package/components/extended/index.d.ts +1 -0
  96. package/components/extended/index.d.ts.map +1 -1
  97. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts +7 -0
  98. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts.map +1 -0
  99. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.js +6 -0
  100. package/components/hook-form/RHFCodeEditor/index.d.ts +3 -0
  101. package/components/hook-form/RHFCodeEditor/index.d.ts.map +1 -0
  102. package/components/hook-form/index.d.ts +1 -0
  103. package/components/hook-form/index.d.ts.map +1 -1
  104. package/index.js +561 -548
  105. package/package.json +9 -6
  106. package/test/mocks/dictionary-mock.d.ts +3 -0
  107. package/test/mocks/dictionary-mock.d.ts.map +1 -1
  108. package/components/DynamicSort/icons.js +0 -7
package/@types/types.d.ts CHANGED
@@ -373,6 +373,10 @@ import {
373
373
  ReactJsonViewerOwnerState,
374
374
  ReactJsonViewerSlotsType,
375
375
  } from '../components/extended/React-Json-Viewer/types';
376
+ import {
377
+ CodeEditorOwnerState,
378
+ CodeEditorSlotsType,
379
+ } from '../components/extended/ReactSimpleCodeEditor/types';
376
380
  import {
377
381
  ResizableOwnerState as ReactResizableOwnerState,
378
382
  ResizableSlotsType,
@@ -499,6 +503,7 @@ declare module '@mui/material/styles' {
499
503
  M4LFixedSizeList: FixedSizeListSlotsType;
500
504
  M4LVariableSizeList: VariableSizeListSlotsType;
501
505
  M4LReactJsonViewer: ReactJsonViewerSlotsType;
506
+ M4LCodeEditor: CodeEditorSlotsType;
502
507
  M4LResizable: ResizableSlotsType;
503
508
  M4LResizableBox: ResizableBoxSlotsType;
504
509
  M4LImageSelector: ImageSelectorSlotsType;
@@ -614,6 +619,7 @@ declare module '@mui/material/styles' {
614
619
  M4LFixedSizeList: Partial<FixedSizeListOwnerState>;
615
620
  M4LVariableSizeList: Partial<VariableSizeListOwnerState>;
616
621
  M4LReactJsonViewer: Partial<ReactJsonViewerOwnerState>;
622
+ M4LCodeEditor: Partial<CodeEditorOwnerState>;
617
623
  M4LResizable: Partial<ReactResizableOwnerState>;
618
624
  M4LResizableBox: Partial<ResizableBoxOwnerState>;
619
625
  M4LImageSelector: Partial<ImageSelectorOwnerState>;
@@ -1168,6 +1174,11 @@ declare module '@mui/material/styles' {
1168
1174
  styleOverrides?: ComponentsOverrides<Theme>['M4LReactJsonViewer'];
1169
1175
  variants?: ComponentsVariants['M4LReactJsonViewer'];
1170
1176
  };
1177
+ M4LCodeEditor?: {
1178
+ defaultProps?: ComponentsPropsList['M4LCodeEditor'];
1179
+ styleOverrides?: ComponentsOverrides<Theme>['M4LCodeEditor'];
1180
+ variants?: ComponentsVariants['M4LCodeEditor'];
1181
+ };
1171
1182
  M4LResizable?: {
1172
1183
  defaultProps?: ComponentsPropsList['M4LResizable'];
1173
1184
  styleOverrides?: ComponentsOverrides<Theme>['M4LResizable'];
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicFilter.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicFilter/DynamicFilter.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD,eAAO,MAAM,mBAAmB,EAAE,mBAwdjC,CAAC"}
1
+ {"version":3,"file":"DynamicFilter.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicFilter/DynamicFilter.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD,eAAO,MAAM,mBAAmB,EAAE,mBAkejC,CAAC"}
@@ -165,7 +165,13 @@ const n = "dynamic", p = {
165
165
  overflow: "hidden",
166
166
  position: "relative",
167
167
  "& .M4LChip-root": {
168
- borderRadius: r.vars.size.borderRadius.r1,
168
+ // Applied filter chips must use the design-system radius (r1-5 = 6px).
169
+ // This descendant override wins over the base Chip radius by specificity,
170
+ // so it has to set r1-5 explicitly to stay consistent with the design.
171
+ // Los chips de filtro aplicados deben usar el radio del design system
172
+ // (r1-5 = 6px). Este override por descendencia gana por especificidad
173
+ // sobre el radio base del Chip, por eso debe fijar r1-5 explícitamente.
174
+ borderRadius: r.vars.size.borderRadius["r1-5"],
169
175
  ...o(
170
176
  r,
171
177
  a?.size || "medium",
@@ -358,7 +364,11 @@ const n = "dynamic", p = {
358
364
  overflowMoreChip: ({ theme: r, ownerState: a }) => ({
359
365
  flexShrink: 0,
360
366
  cursor: "pointer",
361
- borderRadius: r.vars.size.borderRadius.r1,
367
+ // Match the applied filter chips radius (r1-5 = 6px) so the "More (N)"
368
+ // button is visually consistent with the rest of the chip row.
369
+ // Igualar el radio de los chips aplicados (r1-5 = 6px) para que el botón
370
+ // "More (N)" sea visualmente consistente con el resto de la fila de chips.
371
+ borderRadius: r.vars.size.borderRadius["r1-5"],
362
372
  ...o(
363
373
  r,
364
374
  a?.size || "medium",
@@ -1 +1 @@
1
- {"version":3,"file":"AppliedFilters.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.tsx"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,iBAAS,cAAc,qDAmEtB;AACD,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"AppliedFilters.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.tsx"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,iBAAS,cAAc,qDAyEtB;AACD,eAAe,cAAc,CAAC"}
@@ -5,44 +5,44 @@ import { DICCTIONARY as c } from "../../dictionary.js";
5
5
  import O from "../DynamicFilterBase/useDynamicFilterBase.js";
6
6
  import R from "./useAppliedFilters.js";
7
7
  import { useDynamicFilterStore as D } from "../../store/useDynamicFilterStore.js";
8
- import { AppliedFiltersStyled as f, AppliedFilterInnerContainerStyled as E, ChipWrapperStyled as M, EmptyStateLabelStyled as k, OverflowMoreChipStyled as I } from "../../slots/dynamicFilterSlots.js";
8
+ import { AppliedFiltersStyled as d, AppliedFilterInnerContainerStyled as E, ChipWrapperStyled as M, EmptyStateLabelStyled as k, OverflowMoreChipStyled as I } from "../../slots/dynamicFilterSlots.js";
9
9
  import T from "../AppliedFilterChip/AppliedFilterChip.js";
10
10
  import { Typography as _ } from "../../../extended/mui/Typography/Typography.js";
11
11
  import x from "../FilterActions/FilterActions.js";
12
12
  import P from "../OverflowPopover/OverflowPopover.js";
13
13
  function K() {
14
- const { visibleFilters: i, overflowFilters: r, isSkeleton: d, parentRef: m, containerRef: h, setChipRef: u, setMoreChipRef: y, setActionsRef: v } = R(), { size: l } = O(), { getLabel: n } = g(), C = D((e) => e.actions.openPopoverMenuFields), [t, p] = A(null), F = a((e) => {
14
+ const { visibleFilters: l, overflowFilters: r, isSkeleton: f, parentRef: m, containerRef: h, setChipRef: u, setMoreChipRef: y, setActionsRef: v } = R(), { size: i } = O(), { getLabel: n } = g(), C = D((e) => e.actions.openPopoverMenuFields), [t, p] = A(null), F = a((e) => {
15
15
  p(e.currentTarget);
16
- }, []), w = a(() => {
16
+ }, []), S = a(() => {
17
17
  p(null);
18
18
  }, []);
19
- if (d)
20
- return /* @__PURE__ */ o(f, {});
21
- const S = i.length === 0 && r.length === 0;
22
- return /* @__PURE__ */ s(f, { ref: m, children: [
19
+ if (f)
20
+ return /* @__PURE__ */ o(d, {});
21
+ const w = l.length === 0 && r.length === 0;
22
+ return /* @__PURE__ */ s(d, { ref: m, children: [
23
23
  /* @__PURE__ */ s(E, { ref: h, children: [
24
- i.map((e) => /* @__PURE__ */ o(
24
+ l.map((e) => /* @__PURE__ */ o(
25
25
  M,
26
26
  {
27
27
  ref: (b) => u(e.id, b),
28
- ownerState: { isWarning: e.field.color === "warning" },
28
+ ownerState: { isWarning: e.isSet && e.field.color === "warning" },
29
29
  children: /* @__PURE__ */ o(T, { ...e })
30
30
  },
31
31
  e.id
32
32
  )),
33
- S && /* @__PURE__ */ o(k, { "data-testid": "empty-state-label", component: "span", variant: "body", size: l, color: "inherit", onClick: C, children: n(c.label_no_filters_applied) })
33
+ w && /* @__PURE__ */ o(k, { "data-testid": "empty-state-label", component: "span", variant: "body", size: i, color: "inherit", onClick: C, children: n(c.label_no_filters_applied) })
34
34
  ] }),
35
35
  r.length > 0 && /* @__PURE__ */ o(
36
36
  I,
37
37
  {
38
38
  ref: y,
39
- size: l,
39
+ size: i,
40
40
  variant: "contained",
41
41
  color: t ? "info" : "default",
42
42
  opacity: !0,
43
43
  dataTestId: "overflow-more-chip",
44
44
  ownerState: { selected: !!t },
45
- label: /* @__PURE__ */ o(_, { component: "span", variant: "bodyDens", size: l, color: "inherit", children: `${n(c.label_more)} (${r.length})` }),
45
+ label: /* @__PURE__ */ o(_, { component: "span", variant: "bodyDens", size: i, color: "inherit", children: `${n(c.label_more)} (${r.length})` }),
46
46
  onClick: F
47
47
  }
48
48
  ),
@@ -52,7 +52,7 @@ function K() {
52
52
  {
53
53
  anchorEl: t,
54
54
  filters: r,
55
- onClose: w
55
+ onClose: S
56
56
  }
57
57
  )
58
58
  ] });
@@ -1,13 +1,13 @@
1
1
  import { jsx as r } from "@emotion/react/jsx-runtime";
2
- import { useFlagsPresent as m, CommonFlags as n } from "@m4l/core";
3
- import { forwardRef as a } from "react";
2
+ import { forwardRef as m } from "react";
3
+ import { useFlagsPresent as n, CommonFlags as a } from "@m4l/core";
4
4
  import { DynamicSortProvider as i } from "./store/DynamicSortContext.js";
5
5
  import c from "./subcomponents/DynamicSortBase/DynamicSortBase.js";
6
- const h = a(
6
+ const h = m(
7
7
  (o, s) => {
8
8
  const { className: t, ...e } = o;
9
- return m([
10
- n.FLAG_DICTIONARY_LOADED
9
+ return n([
10
+ a.FLAG_DICTIONARY_LOADED
11
11
  ]) ? /* @__PURE__ */ r(i, { ...e, ref: s, children: /* @__PURE__ */ r(c, { className: t }) }) : null;
12
12
  }
13
13
  );
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicSort.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicSort/DynamicSort.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,eAAO,MAAM,iBAAiB,EAAE,iBA8S/B,CAAC"}
1
+ {"version":3,"file":"DynamicSort.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicSort/DynamicSort.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,eAAO,MAAM,iBAAiB,EAAE,iBAwa/B,CAAC"}