@m4l/components 9.33.1 → 9.33.2-beta-feature-731-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 (52) hide show
  1. package/@types/types.d.ts +11 -0
  2. package/components/MFIsolationApp/MFIsolationApp.d.ts.map +1 -1
  3. package/components/MFIsolationApp/MFIsolationApp.js +85 -81
  4. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts +5 -0
  5. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts.map +1 -0
  6. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.js +14 -0
  7. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts +2 -0
  8. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts.map +1 -0
  9. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts +6 -0
  10. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +1 -0
  11. package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +380 -0
  12. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts +3 -0
  13. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +1 -0
  14. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +344 -0
  15. package/components/extended/ReactSimpleCodeEditor/constants.d.ts +83 -0
  16. package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +1 -0
  17. package/components/extended/ReactSimpleCodeEditor/constants.js +149 -0
  18. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +12 -0
  19. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +1 -0
  20. package/components/extended/ReactSimpleCodeEditor/dictionary.js +8 -0
  21. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts +58 -0
  22. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts.map +1 -0
  23. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.js +1063 -0
  24. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts +6 -0
  25. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts.map +1 -0
  26. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.js +7 -0
  27. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts +6 -0
  28. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts.map +1 -0
  29. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.js +9 -0
  30. package/components/extended/ReactSimpleCodeEditor/index.d.ts +4 -0
  31. package/components/extended/ReactSimpleCodeEditor/index.d.ts.map +1 -0
  32. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +20 -0
  33. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +1 -0
  34. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +4 -0
  35. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +90 -0
  36. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +1 -0
  37. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +73 -0
  38. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts +3 -0
  39. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts.map +1 -0
  40. package/components/extended/ReactSimpleCodeEditor/types.d.ts +460 -0
  41. package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +1 -0
  42. package/components/extended/index.d.ts +1 -0
  43. package/components/extended/index.d.ts.map +1 -1
  44. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts +7 -0
  45. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts.map +1 -0
  46. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.js +6 -0
  47. package/components/hook-form/RHFCodeEditor/index.d.ts +3 -0
  48. package/components/hook-form/RHFCodeEditor/index.d.ts.map +1 -0
  49. package/components/hook-form/index.d.ts +1 -0
  50. package/components/hook-form/index.d.ts.map +1 -1
  51. package/index.js +565 -552
  52. package/package.json +9 -6
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":"MFIsolationApp.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/MFIsolationApp/MFIsolationApp.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAsEjB;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,oDAiLxD"}
1
+ {"version":3,"file":"MFIsolationApp.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/MFIsolationApp/MFIsolationApp.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAuEjB;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,oDAkLxD"}
@@ -1,9 +1,9 @@
1
- import { jsx as o, jsxs as w } from "@emotion/react/jsx-runtime";
2
- import { useMemo as h, useCallback as A, useId as X } from "react";
1
+ import { jsx as o, jsxs as A } from "@emotion/react/jsx-runtime";
2
+ import { useMemo as h, useCallback as _, useId as X } from "react";
3
3
  import { unstable_HistoryRouter as Y } from "react-router-dom";
4
4
  import { createBrowserHistory as oo } from "history";
5
5
  import eo from "eventemitter3";
6
- import _ from "nprogress";
6
+ import P from "nprogress";
7
7
  import { DeviceTypeProvider as to, ThemeSettingsProvider as ro, LocalesProvider as so, getLocaleFromNetwork as io, AppearanceComponentProvider as no } from "@m4l/graphics";
8
8
  import { axiosOperation as ao, EnvironmentProvider as mo, HostToolsProvider as lo, NetworkProvider as po, AuthProvider as co, useAuth as ho, useEnvironment as uo, useNetwork as vo } from "@m4l/core";
9
9
  import { WrapperAppBarContentChildrenStyled as fo, WrapperContentChildrenStyled as Ao } from "./slots/MFIsolationAppSlots.js";
@@ -11,14 +11,15 @@ import { MFIsolationAppErrorBoundary as _o } from "./MFIsolationAppErrorBoundary
11
11
  import Po from "../ToastContainer/helpers/toaster.js";
12
12
  import { ShellObservabilityProvider as Io } from "../../contexts/ShellObservabilityContext/ShellObservabilityContext.js";
13
13
  import { MFAuthApp as bo } from "./subcomponents/MFAuthApp/MFAuthApp.js";
14
+ import { ThemeSettingsHostToolsBridge as go } from "./subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.js";
14
15
  import { BaseModule as yo } from "../BaseModule/BaseModule.js";
15
- import { SettingsLayout as go } from "../SettingsLayout/SettingsLayout.js";
16
- import { ToastContainer as ko } from "../ToastContainer/ToastContainer.js";
17
- import { PopupsProvider as wo } from "../popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.js";
18
- import { AreasProvider as Ro } from "../areas/contexts/AreasContext/index.js";
16
+ import { SettingsLayout as ko } from "../SettingsLayout/SettingsLayout.js";
17
+ import { ToastContainer as wo } from "../ToastContainer/ToastContainer.js";
18
+ import { PopupsProvider as Ro } from "../popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.js";
19
+ import { AreasProvider as So } from "../areas/contexts/AreasContext/index.js";
19
20
  import { AppBarSettings as Fo } from "./subcomponents/AppBarSettings/AppBarSettings.js";
20
21
  import { HostRuntimeProvider as Lo } from "../../contexts/HostRuntimeContext/HostRuntimeContext.js";
21
- import { MFObservabilityProvider as So } from "../WindowBase/contexts/MFObservabilityContext/MFObservabilityContext.js";
22
+ import { MFObservabilityProvider as To } from "../WindowBase/contexts/MFObservabilityContext/MFObservabilityContext.js";
22
23
  const R = oo({ window });
23
24
  function Co(u) {
24
25
  const { children: v, hostRuntime: i, resolveHostRuntime: n } = u, { user: t } = ho(), {
@@ -47,7 +48,7 @@ function Co(u) {
47
48
  ]);
48
49
  return /* @__PURE__ */ o(Lo, { value: f, children: v });
49
50
  }
50
- function Xo(u) {
51
+ function oe(u) {
51
52
  const {
52
53
  children: v,
53
54
  user: i,
@@ -60,33 +61,33 @@ function Xo(u) {
60
61
  host_api_icons: p,
61
62
  hostApiRemote: c,
62
63
  host_api_remote: f,
63
- host_static_assets: F,
64
- environment_assets: L,
65
- moduleId: P,
66
- skeletonFlags: S,
67
- moduleNameField: C,
68
- privileges: E,
69
- componentsDictionary: M,
70
- onLoad: T,
71
- activeAreasNetwork: x = !1,
72
- activeCookiesFromNetwork: H = !1,
64
+ host_static_assets: S,
65
+ environment_assets: F,
66
+ moduleId: I,
67
+ skeletonFlags: L,
68
+ moduleNameField: T,
69
+ privileges: C,
70
+ componentsDictionary: E,
71
+ onLoad: H,
72
+ activeAreasNetwork: M = !1,
73
+ activeCookiesFromNetwork: x = !1,
73
74
  // observedDivRef,
74
- moduleDictionaryLoaded: N,
75
- forcedDeviceType: B,
76
- areasStoreId: I,
77
- areasStoreDevtoolsEnabled: b,
75
+ moduleDictionaryLoaded: B,
76
+ forcedDeviceType: N,
77
+ areasStoreId: b,
78
+ areasStoreDevtoolsEnabled: g,
78
79
  appBarSettings: D = !0,
79
80
  axiosOperation: O = ao,
80
81
  googleMapsApiKey: j,
81
82
  hostRuntime: W,
82
83
  observability: y,
83
84
  resolveHostRuntime: $
84
- } = u, g = a ?? m ?? "", d = c ?? f ?? "", K = l ?? p ?? `${d}/main/icons`, e = h(() => new eo(), []), Z = A(
85
+ } = u, k = a ?? m ?? "", d = c ?? f ?? "", K = l ?? p ?? `${d}/main/icons`, e = h(() => new eo(), []), Z = _(
85
86
  (r, s) => {
86
87
  e.on(r, s);
87
88
  },
88
89
  [e]
89
- ), q = A(
90
+ ), q = _(
90
91
  (r, s) => {
91
92
  if (s === null) {
92
93
  e.removeListener(r);
@@ -95,17 +96,17 @@ function Xo(u) {
95
96
  e.removeListener(r, s);
96
97
  },
97
98
  [e]
98
- ), z = A(
99
+ ), z = _(
99
100
  (r, s) => {
100
101
  e.emit(r, s);
101
102
  },
102
103
  [e]
103
104
  ), G = () => {
104
- _.configure({
105
+ P.configure({
105
106
  showSpinner: !0
106
- }), _.start();
107
+ }), P.start();
107
108
  }, J = () => {
108
- _.done();
109
+ P.done();
109
110
  }, Q = h(
110
111
  () => ({
111
112
  host: "",
@@ -113,19 +114,19 @@ function Xo(u) {
113
114
  domain_token: "lab1",
114
115
  domainToken: "lab1",
115
116
  database: t,
116
- host_api_local: g,
117
- hostApiLocal: g,
117
+ host_api_local: k,
118
+ hostApiLocal: k,
118
119
  host_api_remote: d,
119
120
  hostApiRemote: d,
120
121
  hostRemote: d,
121
- host_static_assets: F,
122
- environment_assets: L,
122
+ host_static_assets: S,
123
+ environment_assets: F,
123
124
  hostApiIcons: K,
124
125
  googleMapsApiKey: j
125
126
  }),
126
127
  // eslint-disable-next-line react-hooks/exhaustive-deps
127
128
  []
128
- ), k = X(), U = Po(k), V = h(
129
+ ), w = X(), U = Po(w), V = h(
129
130
  () => ({
130
131
  history: R,
131
132
  toast: U,
@@ -138,59 +139,62 @@ function Xo(u) {
138
139
  // eslint-disable-next-line react-hooks/exhaustive-deps
139
140
  []
140
141
  );
141
- return /* @__PURE__ */ o(mo, { ...Q, children: /* @__PURE__ */ o(lo, { ...V, children: /* @__PURE__ */ o(po, { axiosOperation: O, children: /* @__PURE__ */ o(Io, { value: y, children: /* @__PURE__ */ o(So, { value: y, children: /* @__PURE__ */ o(
142
+ return /* @__PURE__ */ o(mo, { ...Q, children: /* @__PURE__ */ o(lo, { ...V, children: /* @__PURE__ */ o(po, { axiosOperation: O, children: /* @__PURE__ */ o(Io, { value: y, children: /* @__PURE__ */ o(To, { value: y, children: /* @__PURE__ */ o(
142
143
  Y,
143
144
  {
144
145
  history: R,
145
146
  future: { v7_startTransition: !0, v7_relativeSplatPath: !0 },
146
- children: /* @__PURE__ */ o(to, { forcedDeviceType: B, children: /* @__PURE__ */ o(co, { children: /* @__PURE__ */ o(bo, { user: i, pwd: n, children: /* @__PURE__ */ o(ro, { children: /* @__PURE__ */ o(so, { isMicroFrontEnd: !1, getLocaleFromNetwork: io, children: /* @__PURE__ */ o(
147
- yo,
148
- {
149
- moduleId: P,
150
- privileges: E,
151
- skeletonFlags: S,
152
- componentsDictionary: M,
153
- moduleNameField: C,
154
- moduleDictionaryLoaded: N,
155
- children: /* @__PURE__ */ o(_o, { moduleId: P, children: /* @__PURE__ */ w(no, { children: [
156
- /* @__PURE__ */ o(go, {}),
157
- /* @__PURE__ */ o(ko, { containerId: k }),
158
- " ",
159
- /* @__PURE__ */ o(
160
- Co,
161
- {
162
- hostRuntime: W,
163
- resolveHostRuntime: $,
164
- children: /* @__PURE__ */ o(
165
- wo,
166
- {
167
- baseZindex: 1e3,
168
- storeId: I,
169
- storeDevtoolsEnabled: b,
170
- children: /* @__PURE__ */ o(
171
- Ro,
172
- {
173
- storeId: I,
174
- storeDevtoolsEnabled: b,
175
- onLoad: T,
176
- loadAreasFromNetwork: x,
177
- loadCookiesFromNetwork: H,
178
- children: /* @__PURE__ */ w(fo, { children: [
179
- D && /* @__PURE__ */ o(Fo, {}),
180
- /* @__PURE__ */ o(Ao, { children: v })
181
- ] })
182
- }
183
- )
184
- }
185
- )
186
- }
187
- )
188
- ] }) })
189
- }
190
- ) }) }) }) }) })
147
+ children: /* @__PURE__ */ o(to, { forcedDeviceType: N, children: /* @__PURE__ */ o(co, { children: /* @__PURE__ */ o(bo, { user: i, pwd: n, children: /* @__PURE__ */ A(ro, { children: [
148
+ /* @__PURE__ */ o(go, {}),
149
+ /* @__PURE__ */ o(so, { isMicroFrontEnd: !1, getLocaleFromNetwork: io, children: /* @__PURE__ */ o(
150
+ yo,
151
+ {
152
+ moduleId: I,
153
+ privileges: C,
154
+ skeletonFlags: L,
155
+ componentsDictionary: E,
156
+ moduleNameField: T,
157
+ moduleDictionaryLoaded: B,
158
+ children: /* @__PURE__ */ o(_o, { moduleId: I, children: /* @__PURE__ */ A(no, { children: [
159
+ /* @__PURE__ */ o(ko, {}),
160
+ /* @__PURE__ */ o(wo, { containerId: w }),
161
+ " ",
162
+ /* @__PURE__ */ o(
163
+ Co,
164
+ {
165
+ hostRuntime: W,
166
+ resolveHostRuntime: $,
167
+ children: /* @__PURE__ */ o(
168
+ Ro,
169
+ {
170
+ baseZindex: 1e3,
171
+ storeId: b,
172
+ storeDevtoolsEnabled: g,
173
+ children: /* @__PURE__ */ o(
174
+ So,
175
+ {
176
+ storeId: b,
177
+ storeDevtoolsEnabled: g,
178
+ onLoad: H,
179
+ loadAreasFromNetwork: M,
180
+ loadCookiesFromNetwork: x,
181
+ children: /* @__PURE__ */ A(fo, { children: [
182
+ D && /* @__PURE__ */ o(Fo, {}),
183
+ /* @__PURE__ */ o(Ao, { children: v })
184
+ ] })
185
+ }
186
+ )
187
+ }
188
+ )
189
+ }
190
+ )
191
+ ] }) })
192
+ }
193
+ ) })
194
+ ] }) }) }) })
191
195
  }
192
196
  ) }) }) }) }) });
193
197
  }
194
198
  export {
195
- Xo as MFIsolationApp
199
+ oe as MFIsolationApp
196
200
  };
@@ -0,0 +1,5 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,14 @@
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
+ };
@@ -0,0 +1,2 @@
1
+ export { ThemeSettingsHostToolsBridge } from './ThemeSettingsHostToolsBridge';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,6 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AA6DA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,SAAS,CAAC;AAmDjB;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,oDAmiBhD"}