@m4l/components 9.24.1-beta-feature-731-code-editor.1 → 9.25.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 (83) hide show
  1. package/@types/types.d.ts +0 -11
  2. package/components/MFIsolationApp/MFIsolationApp.d.ts.map +1 -1
  3. package/components/MFIsolationApp/MFIsolationApp.js +76 -80
  4. package/components/datagrids/Datagrid.styles.d.ts.map +1 -1
  5. package/components/datagrids/Datagrid.styles.js +25 -0
  6. package/components/datagrids/slots/DataGridEnum.d.ts +3 -1
  7. package/components/datagrids/slots/DataGridEnum.d.ts.map +1 -1
  8. package/components/datagrids/slots/DataGridEnum.js +1 -1
  9. package/components/datagrids/slots/DataGridSlot.d.ts +6 -0
  10. package/components/datagrids/slots/DataGridSlot.d.ts.map +1 -1
  11. package/components/datagrids/slots/DataGridSlot.js +73 -65
  12. package/components/datagrids/views/CardsView/CardsView.d.ts +2 -1
  13. package/components/datagrids/views/CardsView/CardsView.d.ts.map +1 -1
  14. package/components/datagrids/views/CardsView/CardsView.js +96 -76
  15. package/components/datagrids/views/CardsView/hooks/useCardsPerRow/index.d.ts +2 -0
  16. package/components/datagrids/views/CardsView/hooks/useCardsPerRow/index.d.ts.map +1 -0
  17. package/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.d.ts +9 -0
  18. package/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.d.ts.map +1 -0
  19. package/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.js +19 -0
  20. package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/index.d.ts +3 -0
  21. package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/index.d.ts.map +1 -0
  22. package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/types.d.ts +26 -0
  23. package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/types.d.ts.map +1 -0
  24. package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/useCardsVirtualizer.d.ts +17 -0
  25. package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/useCardsVirtualizer.d.ts.map +1 -0
  26. package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/useCardsVirtualizer.js +23 -0
  27. package/components/datagrids/views/CardsView/subcomponents/CardRow/CardRow.d.ts +1 -1
  28. package/components/datagrids/views/CardsView/subcomponents/CardRow/CardRow.d.ts.map +1 -1
  29. package/components/datagrids/views/CardsView/subcomponents/CardRow/CardRow.js +49 -50
  30. package/components/datagrids/views/CardsView/subcomponents/CardRow/types.d.ts +4 -2
  31. package/components/datagrids/views/CardsView/subcomponents/CardRow/types.d.ts.map +1 -1
  32. package/components/extended/index.d.ts +0 -1
  33. package/components/extended/index.d.ts.map +1 -1
  34. package/components/hook-form/index.d.ts +0 -1
  35. package/components/hook-form/index.d.ts.map +1 -1
  36. package/index.js +559 -572
  37. package/package.json +8 -11
  38. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts +0 -5
  39. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts.map +0 -1
  40. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.js +0 -14
  41. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts +0 -2
  42. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts.map +0 -1
  43. package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.js +0 -24
  44. package/components/datagrids/views/CardsView/subcomponents/CardRow/subcomponents/LazyLoadCard/LazyLoadCard.js +0 -33
  45. package/components/datagrids/views/CardsView/subcomponents/CardRow/subcomponents/LazyLoadCard/subcomponents/IntersectCard/IntersectCard.js +0 -36
  46. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts +0 -6
  47. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +0 -1
  48. package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +0 -405
  49. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts +0 -3
  50. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +0 -1
  51. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +0 -371
  52. package/components/extended/ReactSimpleCodeEditor/constants.d.ts +0 -83
  53. package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +0 -1
  54. package/components/extended/ReactSimpleCodeEditor/constants.js +0 -149
  55. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +0 -11
  56. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +0 -1
  57. package/components/extended/ReactSimpleCodeEditor/dictionary.js +0 -7
  58. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts +0 -58
  59. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts.map +0 -1
  60. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.js +0 -1063
  61. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts +0 -6
  62. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts.map +0 -1
  63. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.js +0 -7
  64. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts +0 -6
  65. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts.map +0 -1
  66. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.js +0 -9
  67. package/components/extended/ReactSimpleCodeEditor/index.d.ts +0 -4
  68. package/components/extended/ReactSimpleCodeEditor/index.d.ts.map +0 -1
  69. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +0 -19
  70. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +0 -1
  71. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +0 -4
  72. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +0 -88
  73. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +0 -1
  74. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +0 -70
  75. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts +0 -3
  76. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts.map +0 -1
  77. package/components/extended/ReactSimpleCodeEditor/types.d.ts +0 -459
  78. package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +0 -1
  79. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts +0 -7
  80. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts.map +0 -1
  81. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.js +0 -6
  82. package/components/hook-form/RHFCodeEditor/index.d.ts +0 -3
  83. package/components/hook-form/RHFCodeEditor/index.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.24.1-beta-feature-731-code-editor.1",
3
+ "version": "9.25.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -46,31 +46,28 @@
46
46
  "fast-equals": "5.4.0",
47
47
  "lodash-es": "4.17.23",
48
48
  "@textea/json-viewer": "4.0.1",
49
- "prismjs": "1.30.0",
50
- "prism-react-renderer": "2.4.1",
51
49
  "react-dom": "19.2.4",
52
50
  "react-helmet-async": "2.0.5",
53
51
  "@hookform/resolvers": "2.9.11",
54
52
  "nprogress": "0.2.0",
55
53
  "react-transition-group": "4.4.5",
56
- "react-color": "2.19.3",
57
- "@mui/x-date-pickers": "6.20.2",
58
- "react-rnd": "10.5.2",
54
+ "date-fns": "2.30.0",
59
55
  "react-draggable": "4.5.0",
60
56
  "react-dropzone": "14.4.1",
61
- "date-fns": "2.30.0",
62
57
  "react-spinners": "0.13.8",
63
- "react-resizable-panels": "2.1.9",
64
- "react-simple-code-editor": "0.14.1",
58
+ "react-rnd": "10.5.2",
59
+ "react-color": "2.19.3",
60
+ "@mui/x-date-pickers": "6.20.2",
65
61
  "chart.js": "4.5.1",
66
62
  "chartjs-chart-error-bars": "4.4.5",
67
63
  "qrcode.react": "3.2.0",
64
+ "react-resizable-panels": "2.1.9",
65
+ "simplebar-react": "3.2.6",
68
66
  "react-data-grid": "7.0.0-beta.47",
69
67
  "react-dnd": "16.0.1",
70
68
  "react-dnd-html5-backend": "16.0.1",
71
- "simplebar-react": "3.2.6",
72
- "react-resizable": "3.1.3",
73
69
  "react-window": "1.8.11",
70
+ "react-resizable": "3.1.3",
74
71
  "@tanstack/react-virtual": "3.13.23"
75
72
  }
76
73
  }
@@ -1,5 +0,0 @@
1
- /**
2
- * Register the isolation host-tools emitter inside the shared theme settings store.
3
- */
4
- export declare function ThemeSettingsHostToolsBridge(): null;
5
- //# sourceMappingURL=ThemeSettingsHostToolsBridge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThemeSettingsHostToolsBridge.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,4BAA4B,SAe3C"}
@@ -1,14 +0,0 @@
1
- import { useEffect as s } from "react";
2
- import { useHostTools as r } from "@m4l/core";
3
- import { useThemeSettingsStore as i } from "@m4l/graphics";
4
- function f() {
5
- const { events_emit: e } = r(), t = i(
6
- (o) => o.settingsActions.registerHostToolsEventsEmit
7
- );
8
- return s(() => (t(e), () => {
9
- t(void 0);
10
- }), [e, t]), null;
11
- }
12
- export {
13
- f as ThemeSettingsHostToolsBridge
14
- };
@@ -1,2 +0,0 @@
1
- export { ThemeSettingsHostToolsBridge } from './ThemeSettingsHostToolsBridge';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC"}
@@ -1,24 +0,0 @@
1
- function s(e, r, n = "data-attribute", l = "data-row-key", c = !0) {
2
- if (!e) {
3
- console.warn("scrollToRowElement: containerElement is null");
4
- return;
5
- }
6
- try {
7
- const o = n === "class" ? `.${l}-${r}` : `[${l}="${r}"]`, t = e.querySelector(o);
8
- if (!t) {
9
- console.warn(
10
- `scrollToRowElement: No element found with selector "${o}"`
11
- );
12
- return;
13
- }
14
- t.scrollIntoView({
15
- behavior: c ? "smooth" : "auto",
16
- block: "end"
17
- });
18
- } catch (o) {
19
- console.error("scrollToRowElement: Error scrolling", o);
20
- }
21
- }
22
- export {
23
- s as scrollToRowElement
24
- };
@@ -1,33 +0,0 @@
1
- import { jsx as e, Fragment as a } from "@emotion/react/jsx-runtime";
2
- import { useState as b } from "react";
3
- import { IntersectCard as w } from "./subcomponents/IntersectCard/IntersectCard.js";
4
- const l = () => typeof window < "u" && "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype;
5
- function f(r) {
6
- const {
7
- children: t,
8
- enableIntersectionObserver: n = !0,
9
- threshold: i = 100,
10
- minHeight: o = 120,
11
- rowKey: s
12
- } = r, [c, d] = b(
13
- !(n && l())
14
- );
15
- return /* @__PURE__ */ e(a, { children: c ? (
16
- // Contenido real: se renderiza cuando es visible o cuando no se usa observer
17
- t
18
- ) : (
19
- // Placeholder: elemento centinela que detecta cuándo debe cargar el contenido
20
- /* @__PURE__ */ e(
21
- w,
22
- {
23
- setIsVisible: d,
24
- threshold: i,
25
- minHeight: o,
26
- rowKey: s
27
- }
28
- )
29
- ) });
30
- }
31
- export {
32
- f as LazyLoadCard
33
- };
@@ -1,36 +0,0 @@
1
- import { jsx as u } from "@emotion/react/jsx-runtime";
2
- import { useState as a, useRef as m, useEffect as b } from "react";
3
- import { styled as I } from "@mui/material/styles";
4
- const d = (e) => {
5
- e.forEach((t) => {
6
- t.isIntersecting && t.target?.setIsVisible(!0);
7
- });
8
- }, n = {}, g = (e) => (n[e] = n[e] || new IntersectionObserver(d, {
9
- rootMargin: e + "px"
10
- }), n[e]), l = I("div")(
11
- ({ minHeight: e }) => ({
12
- minHeight: `${e}px`,
13
- width: "100%"
14
- })
15
- );
16
- function x(e) {
17
- const { setIsVisible: t, threshold: o, minHeight: c = 120, rowKey: f } = e, [r] = a(
18
- g(o)
19
- ), i = m(null);
20
- return b(() => {
21
- const s = i.current;
22
- return r && s && (s.setIsVisible = t, r.observe(s)), () => {
23
- r && s && r.unobserve(s);
24
- };
25
- }, [r, t]), /* @__PURE__ */ u(
26
- l,
27
- {
28
- ref: i,
29
- minHeight: c,
30
- "data-row-key": f
31
- }
32
- );
33
- }
34
- export {
35
- x as IntersectCard
36
- };
@@ -1,6 +0,0 @@
1
- import { CodeEditorProps } from './types';
2
- /**
3
- * Render a syntax-highlighted code editor with optional self-managed fallback state.
4
- */
5
- export declare function CodeEditor(props: CodeEditorProps): import("@emotion/react/jsx-runtime").JSX.Element;
6
- //# sourceMappingURL=CodeEditor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AAuEA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,SAAS,CAAC;AAqFjB;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,oDAqiBhD"}
@@ -1,405 +0,0 @@
1
- import { jsx as r, jsxs as M } from "@emotion/react/jsx-runtime";
2
- import { useHostTools as mt, useModuleDictionary as Et, useModuleSkeleton as ft, EmitEvents as Re } from "@m4l/core";
3
- import A from "clsx";
4
- import { useId as Ct, useState as C, useRef as _e, useMemo as d, useEffect as y, useLayoutEffect as yt, useCallback as p } from "react";
5
- import { useTheme as pt } from "@mui/material/styles";
6
- import { getPropDataTestId as I, getNameDataTestId as St } from "../../../test/getNameDataTestId.js";
7
- import { CODE_EDITOR_DEFAULT_MAX_LINES as Rt, CODE_EDITOR_DEFAULT_MIN_LINES as _t, CODE_EDITOR_RESIZE_HANDLE_SIZE_PX as W, CODE_EDITOR_DEFAULT_LANGUAGE as Tt, CODE_EDITOR_READ_ONLY_LABEL as Dt, CODE_EDITOR_LINE_HEIGHT_BY_SIZE as Ht, CODE_EDITOR_CLASSES as L, CODE_EDITOR_KEY_COMPONENT as S, CODE_EDITOR_PADDING_PX as Te, CODE_EDITOR_LANGUAGE_CHIP_ICON_INSTANCE_ID as vt } from "./constants.js";
8
- import { CODE_EDITOR_DICTIONARY as De } from "./dictionary.js";
9
- import { resolveCodeEditorLanguageIcon as It } from "./helpers/languageIcon.js";
10
- import { getCodeEditorLineCount as Lt, ensureCodeEditorRuntimeDependencies as bt, createCodeEditorPrismTheme as xt, resolveCodeEditorLanguageTemplate as zt, validateCodeEditorSyntax as Ot, highlightCode as Nt } from "./helpers/highlighting.js";
11
- import { SkeletonStyled as Mt, BodyResizeShellStyled as At, RootStyled as Bt, HeaderStyled as Vt, LanguageChipStyled as Pt, LanguageChipIconStyled as kt, HeaderBadgesStyled as Gt, ReadOnlyChipStyled as wt, BodyStyled as Ut, LineNumbersStyled as Ft, LineNumberStyled as Yt, EditorScrollerStyled as Xt, PlaceholderStyled as Zt, EditorStyled as jt } from "./slots/CodeEditorSlots.js";
12
- import { CodeEditorSlots as R } from "./slots/CodeEditorEnum.js";
13
- import { buildEnableResizing as qt, buildDefaultResizeHandleClasses as $t, buildDefaultResizeHandleStyles as Kt } from "../../DragResizeWindowRND/helpers/resizeHandles.js";
14
- function Q(t) {
15
- return t === "dark" ? "dark" : "light";
16
- }
17
- function Jt(t, n) {
18
- return t.length !== n.length ? !1 : t.every((i, s) => i === n[s]);
19
- }
20
- function Ie(t, n, i) {
21
- const s = i ? Te : Te * 2;
22
- return t * n + s;
23
- }
24
- function Qt(t, n, i) {
25
- return Ie(t, n, i);
26
- }
27
- function He(t, n) {
28
- return t + n;
29
- }
30
- function ve(t, n) {
31
- return t + (n ? W : 0);
32
- }
33
- function Wt(t, n, i) {
34
- return Math.max(
35
- Math.round(t - n - W),
36
- i
37
- );
38
- }
39
- function mn(t) {
40
- const {
41
- className: n,
42
- customLanguages: i,
43
- dataTestId: s,
44
- defaultValue: Le,
45
- disabled: g = !1,
46
- editorClassName: be,
47
- error: xe = !1,
48
- highlightTheme: ee,
49
- id: ze,
50
- insertSpaces: Oe,
51
- languageIcon: Ne,
52
- languageLabel: Me,
53
- languageTemplate: c,
54
- languageText: Ae,
55
- maxLines: Be = Rt,
56
- minLines: b = _t,
57
- onBlur: Ve,
58
- onChange: B,
59
- placeholder: V,
60
- preClassName: Pe,
61
- readOnly: m = !1,
62
- readOnlyLabel: ke,
63
- resizable: l = !0,
64
- runtimeDependencies: _,
65
- showLineNumbers: te = !1,
66
- showPlaceholder: ne = !0,
67
- size: P = "medium",
68
- syntaxValidator: k,
69
- skeleton: Ge = !1,
70
- textareaClassName: we,
71
- validateSyntax: oe = !1,
72
- value: T,
73
- variant: Ue = "outlined",
74
- ...x
75
- } = t, Fe = Ct(), Ye = ze || Fe, G = pt(), { events_add_listener: ae, events_remove_listener: re } = mt(), { getLabel: Xe } = Et(), Ze = ft() || Ge, D = B === void 0, [w, je] = C(0), U = _e([]), ie = _e(null), [F, le] = C(
76
- () => Q(G.palette.mode)
77
- ), [qe, se] = C(
78
- T ?? Le ?? ""
79
- ), [z, de] = C(0), [Y, O] = C(!1), [X, ce] = C(null), ue = d(() => _ ? Array.isArray(_) ? _ : [_] : [], [_]);
80
- Jt(
81
- U.current,
82
- ue
83
- ) || (U.current = ue);
84
- const Z = U.current, u = D ? qe : T ?? "", $e = ne && u.length === 0 && !!V, j = Ht[P], he = Lt(u), ge = Math.max(he, b), q = Math.max(b, Be), me = Math.min(ge, q), $ = he >= q, Ee = Ie(
85
- me,
86
- j,
87
- $
88
- ), N = Qt(
89
- b,
90
- j,
91
- $
92
- ), Ke = l ? Math.max(X ?? Ee, N) : Ee, Je = d(
93
- () => qt(l, ["s"]),
94
- [l]
95
- ), Qe = d(
96
- () => $t(),
97
- []
98
- ), We = d(() => {
99
- const e = Kt();
100
- return {
101
- ...e,
102
- bottom: {
103
- ...e.bottom,
104
- bottom: "0px",
105
- height: `${W}px`,
106
- left: "0px",
107
- right: "0px"
108
- }
109
- };
110
- }, []), et = d(() => ({
111
- display: "block",
112
- position: "relative"
113
- }), []);
114
- y(() => {
115
- D && T !== void 0 && se(T);
116
- }, [D, T]), y(() => {
117
- le(Q(G.palette.mode));
118
- }, [G.palette.mode]), y(() => {
119
- const e = (a) => {
120
- le(Q(a));
121
- };
122
- return ae(
123
- Re.EMMIT_EVENT_HOST_THEME_CHANGE,
124
- e
125
- ), () => {
126
- re(
127
- Re.EMMIT_EVENT_HOST_THEME_CHANGE,
128
- e
129
- );
130
- };
131
- }, [ae, re]), y(() => {
132
- if (!Z.length)
133
- return;
134
- let e = !0;
135
- return bt(Z).catch(() => {
136
- }).then(() => {
137
- e && je((a) => a + 1);
138
- }), () => {
139
- e = !1;
140
- };
141
- }, [Z]), y(() => {
142
- !l && X !== null && ce(null);
143
- }, [X, l]), y(() => {
144
- (!l || g) && Y && O(!1);
145
- }, [g, Y, l]);
146
- const fe = d(
147
- () => ee ?? xt(F),
148
- [F, ee]
149
- ), E = d(
150
- () => zt(c),
151
- [c, w]
152
- ), H = Ae ?? E?.languageText ?? Tt, K = Me ?? E?.languageLabel, Ce = !!K, tt = It(
153
- Ne ?? E?.languageIcon
154
- ), J = m ? Xe(De.readOnly) : void 0, ye = ke ?? (J && J !== De.readOnly ? J : Dt), h = Ce || m;
155
- yt(() => {
156
- if (!h) {
157
- de(0);
158
- return;
159
- }
160
- const e = Math.round(ie.current?.offsetHeight ?? 0);
161
- de((a) => a === e ? a : e);
162
- }, [h, K, m, ye, P]);
163
- const nt = He(
164
- Ke,
165
- h ? z : 0
166
- ), ot = He(
167
- N,
168
- h ? z : 0
169
- ), at = ve(
170
- nt,
171
- l
172
- ), rt = ve(
173
- ot,
174
- l
175
- ), v = d(() => {
176
- if (k)
177
- return k({
178
- code: u,
179
- languageTemplate: E ?? c,
180
- languageText: H
181
- });
182
- if (oe)
183
- return Ot({
184
- code: u,
185
- languageTemplate: E ?? c,
186
- languageText: H
187
- });
188
- }, [
189
- c,
190
- E,
191
- H,
192
- u,
193
- w,
194
- k,
195
- oe
196
- ]), pe = xe || !!v && !v.isValid, f = v && !v.isValid ? v.errorRange : void 0, it = d(() => {
197
- if (!f)
198
- return /* @__PURE__ */ new Set();
199
- const e = f.start.line, a = f.end?.line ?? e;
200
- return new Set(
201
- Array.from(
202
- { length: Math.max(a - e + 1, 1) },
203
- (Se, gt) => e + gt
204
- )
205
- );
206
- }, [f]), o = {
207
- colorMode: F,
208
- disabled: g,
209
- error: pe,
210
- isLineCapped: $,
211
- isEmpty: u.length === 0,
212
- isPlaceholderVisible: $e,
213
- isResizeHandleActive: Y,
214
- lineHeight: j,
215
- maxLines: q,
216
- minLines: b,
217
- readOnly: m,
218
- resizable: l,
219
- showLineNumbers: te,
220
- size: P,
221
- variant: Ue,
222
- visibleLineCount: me
223
- }, lt = p(
224
- (e) => Nt({
225
- code: e,
226
- customLanguages: i,
227
- languageTemplate: c,
228
- languageText: H,
229
- prismTheme: fe,
230
- syntaxErrorRange: f
231
- }),
232
- [
233
- i,
234
- c,
235
- fe,
236
- H,
237
- w,
238
- f
239
- ]
240
- ), st = p(
241
- (e) => {
242
- D && se(e), B?.(e);
243
- },
244
- [B, D]
245
- ), dt = p(() => {
246
- O(!0);
247
- }, []), ct = p(() => {
248
- O(!0);
249
- }, []), ut = p(
250
- (e, a, Se) => {
251
- O(!1), ce(
252
- Wt(
253
- Se.offsetHeight,
254
- h ? z : 0,
255
- N
256
- )
257
- );
258
- },
259
- [h, z, N]
260
- ), ht = p(
261
- (e) => {
262
- if (g || e.target instanceof Element && e.target.closest("textarea"))
263
- return;
264
- e.currentTarget.querySelector("textarea")?.focus();
265
- },
266
- [g]
267
- );
268
- return Ze ? /* @__PURE__ */ r(Mt, { ownerState: o }) : /* @__PURE__ */ r(
269
- At,
270
- {
271
- ownerState: o,
272
- disableDragging: !0,
273
- dragAxis: "none",
274
- enableResizing: Je,
275
- minHeight: rt,
276
- onResize: ct,
277
- onResizeStart: dt,
278
- onResizeStop: ut,
279
- resizeHandleClasses: Qe,
280
- resizeHandleStyles: We,
281
- size: { width: "100%", height: at },
282
- style: et,
283
- ...I(
284
- S,
285
- R.bodyResizeShell,
286
- s
287
- ),
288
- children: /* @__PURE__ */ M(
289
- Bt,
290
- {
291
- ownerState: o,
292
- "aria-disabled": o.disabled || void 0,
293
- className: A(L.root, n),
294
- ...I(S, R.root, s),
295
- children: [
296
- h ? /* @__PURE__ */ M(
297
- Vt,
298
- {
299
- ref: ie,
300
- ownerState: o,
301
- className: L.header,
302
- children: [
303
- Ce ? /* @__PURE__ */ r(
304
- Pt,
305
- {
306
- label: K,
307
- size: "small",
308
- variant: "outlined",
309
- color: "default",
310
- startIcon: /* @__PURE__ */ r(
311
- kt,
312
- {
313
- ...I(
314
- S,
315
- R.languageChipIcon,
316
- vt
317
- ),
318
- children: /* @__PURE__ */ r(tt, { fontSize: "small" })
319
- }
320
- )
321
- }
322
- ) : null,
323
- /* @__PURE__ */ r(Gt, { ownerState: o, children: m ? /* @__PURE__ */ r(
324
- wt,
325
- {
326
- label: ye,
327
- size: "small"
328
- }
329
- ) : null })
330
- ]
331
- }
332
- ) : null,
333
- /* @__PURE__ */ M(
334
- Ut,
335
- {
336
- ownerState: o,
337
- onClick: ht,
338
- ...I(S, R.body, s),
339
- children: [
340
- te ? /* @__PURE__ */ r(Ft, { ownerState: o, "aria-hidden": "true", children: Array.from({ length: ge }, (e, a) => a + 1).map(
341
- (e) => /* @__PURE__ */ r(
342
- Yt,
343
- {
344
- ownerState: o,
345
- "data-code-editor-error-line": it.has(e) || void 0,
346
- children: e
347
- },
348
- `code-editor-line-${e}`
349
- )
350
- ) }) : null,
351
- /* @__PURE__ */ M(Xt, { ownerState: o, children: [
352
- ne && o.isEmpty && V ? /* @__PURE__ */ r(
353
- Zt,
354
- {
355
- ownerState: o,
356
- ...I(
357
- S,
358
- R.placeholder,
359
- s
360
- ),
361
- children: V
362
- }
363
- ) : null,
364
- /* @__PURE__ */ r(
365
- jt,
366
- {
367
- ...x,
368
- ownerState: o,
369
- "aria-label": x["aria-label"] ?? "Code editor",
370
- "aria-invalid": x["aria-invalid"] ?? (pe || void 0),
371
- className: A(L.editor, be),
372
- "data-testid": St(
373
- S,
374
- R.textarea,
375
- s
376
- ),
377
- disabled: g,
378
- highlight: lt,
379
- insertSpaces: Oe,
380
- onBlur: Ve,
381
- onValueChange: st,
382
- preClassName: A(L.pre, Pe),
383
- readOnly: m,
384
- tabSize: x.tabSize,
385
- textareaClassName: A(
386
- L.textarea,
387
- we
388
- ),
389
- textareaId: Ye,
390
- value: u
391
- }
392
- )
393
- ] })
394
- ]
395
- }
396
- )
397
- ]
398
- }
399
- )
400
- }
401
- );
402
- }
403
- export {
404
- mn as CodeEditor
405
- };
@@ -1,3 +0,0 @@
1
- import { CodeEditorStyles } from './types';
2
- export declare const codeEditorStyles: CodeEditorStyles;
3
- //# sourceMappingURL=CodeEditor.styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,eAAO,MAAM,gBAAgB,EAAE,gBA2Z9B,CAAC"}