@m4l/components 9.80.0 → 9.80.1-beta-docs-autocomplete-async-with-add-mf-sync.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 (98) hide show
  1. package/components/MFLoader/MFLoader.d.ts.map +1 -1
  2. package/components/MFLoader/MFLoader.js +124 -112
  3. package/components/MFLoader/hooks/useMFCallbackLifecycle.d.ts +6 -0
  4. package/components/MFLoader/hooks/useMFCallbackLifecycle.d.ts.map +1 -0
  5. package/components/MFLoader/hooks/useMFCallbackLifecycle.js +25 -0
  6. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.d.ts.map +1 -1
  7. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +49 -47
  8. package/components/areas/components/AreasViewer/test/popupAuthenticationConstants.d.ts +4 -0
  9. package/components/areas/components/AreasViewer/test/popupAuthenticationConstants.d.ts.map +1 -0
  10. package/components/areas/contexts/AreasContext/index.d.ts.map +1 -1
  11. package/components/areas/contexts/AreasContext/index.js +29 -28
  12. package/components/areas/contexts/AreasContext/tests/mfActionSupport.d.ts +22 -0
  13. package/components/areas/contexts/AreasContext/tests/mfActionSupport.d.ts.map +1 -0
  14. package/components/areas/contexts/AreasContext/useMFActionLifecycle.d.ts +4 -0
  15. package/components/areas/contexts/AreasContext/useMFActionLifecycle.d.ts.map +1 -0
  16. package/components/areas/contexts/AreasContext/useMFActionLifecycle.js +49 -0
  17. package/components/extended/mui/Autocomplete/Autocomplete.d.ts.map +1 -1
  18. package/components/extended/mui/Autocomplete/Autocomplete.js +55 -54
  19. package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.d.ts.map +1 -1
  20. package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.js +81 -72
  21. package/components/extended/mui/Autocomplete/types.d.ts +1 -1
  22. package/components/extended/mui/Autocomplete/types.d.ts.map +1 -1
  23. package/components/extended/mui/AutocompleteAsync/AutocompleteAddButton.d.ts +4 -0
  24. package/components/extended/mui/AutocompleteAsync/AutocompleteAddButton.d.ts.map +1 -0
  25. package/components/extended/mui/AutocompleteAsync/AutocompleteAddButton.js +23 -0
  26. package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.d.ts +5 -9
  27. package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.d.ts.map +1 -1
  28. package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.js +87 -56
  29. package/components/extended/mui/AutocompleteAsync/constants.d.ts +4 -1
  30. package/components/extended/mui/AutocompleteAsync/constants.d.ts.map +1 -1
  31. package/components/extended/mui/AutocompleteAsync/constants.js +24 -12
  32. package/components/extended/mui/AutocompleteAsync/hooks/useAutocompleteAdd.d.ts +9 -0
  33. package/components/extended/mui/AutocompleteAsync/hooks/useAutocompleteAdd.d.ts.map +1 -0
  34. package/components/extended/mui/AutocompleteAsync/hooks/useAutocompleteAdd.js +97 -0
  35. package/components/extended/mui/AutocompleteAsync/hooks/useFetchOptions.d.ts.map +1 -1
  36. package/components/extended/mui/AutocompleteAsync/hooks/useFetchOptions.js +47 -46
  37. package/components/extended/mui/AutocompleteAsync/index.d.ts +1 -1
  38. package/components/extended/mui/AutocompleteAsync/index.d.ts.map +1 -1
  39. package/components/extended/mui/AutocompleteAsync/reducer/AutocompleteAsyncReducer.d.ts.map +1 -1
  40. package/components/extended/mui/AutocompleteAsync/reducer/AutocompleteAsyncReducer.js +50 -28
  41. package/components/extended/mui/AutocompleteAsync/slots/addStyled.d.ts +6 -0
  42. package/components/extended/mui/AutocompleteAsync/slots/addStyled.d.ts.map +1 -0
  43. package/components/extended/mui/AutocompleteAsync/slots/addStyled.js +19 -0
  44. package/components/extended/mui/AutocompleteAsync/tests/add/constants.d.ts +5 -0
  45. package/components/extended/mui/AutocompleteAsync/tests/add/constants.d.ts.map +1 -0
  46. package/components/extended/mui/AutocompleteAsync/tests/add/helpers.d.ts +8 -0
  47. package/components/extended/mui/AutocompleteAsync/tests/add/helpers.d.ts.map +1 -0
  48. package/components/extended/mui/AutocompleteAsync/tests/add/types.d.ts +20 -0
  49. package/components/extended/mui/AutocompleteAsync/tests/add/types.d.ts.map +1 -0
  50. package/components/extended/mui/AutocompleteAsync/tests/support/ControlledAsyncField.d.ts +4 -0
  51. package/components/extended/mui/AutocompleteAsync/tests/support/ControlledAsyncField.d.ts.map +1 -0
  52. package/components/extended/mui/AutocompleteAsync/tests/support/constants.d.ts +8 -0
  53. package/components/extended/mui/AutocompleteAsync/tests/support/constants.d.ts.map +1 -0
  54. package/components/extended/mui/AutocompleteAsync/tests/support/createDeferred.d.ts +4 -0
  55. package/components/extended/mui/AutocompleteAsync/tests/support/createDeferred.d.ts.map +1 -0
  56. package/components/extended/mui/AutocompleteAsync/tests/support/mockAutocompleteAnchor.d.ts +3 -0
  57. package/components/extended/mui/AutocompleteAsync/tests/support/mockAutocompleteAnchor.d.ts.map +1 -0
  58. package/components/extended/mui/AutocompleteAsync/tests/support/types.d.ts +21 -0
  59. package/components/extended/mui/AutocompleteAsync/tests/support/types.d.ts.map +1 -0
  60. package/components/extended/mui/AutocompleteAsync/types.d.ts +47 -0
  61. package/components/extended/mui/AutocompleteAsync/types.d.ts.map +1 -1
  62. package/components/extended/mui/AutocompleteAsync/types.js +4 -2
  63. package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts +1 -1
  64. package/components/hook-form/RHFAutocompleteAsync/index.d.ts +1 -0
  65. package/components/hook-form/RHFAutocompleteAsync/index.d.ts.map +1 -1
  66. package/components/hook-form/RHFAutocompleteAsync/tests/addConstants.d.ts +3 -0
  67. package/components/hook-form/RHFAutocompleteAsync/tests/addConstants.d.ts.map +1 -0
  68. package/components/hook-form/RHFAutocompleteAsync/tests/addHelpers.d.ts +4 -0
  69. package/components/hook-form/RHFAutocompleteAsync/tests/addHelpers.d.ts.map +1 -0
  70. package/components/hook-form/RHFAutocompleteAsync/tests/addTypes.d.ts +12 -0
  71. package/components/hook-form/RHFAutocompleteAsync/tests/addTypes.d.ts.map +1 -0
  72. package/components/hook-form/index.d.ts +1 -0
  73. package/components/hook-form/index.d.ts.map +1 -1
  74. package/index.d.ts +1 -0
  75. package/index.d.ts.map +1 -1
  76. package/index.js +235 -222
  77. package/package.json +5 -5
  78. package/utils/mfActions/constants.d.ts +6 -0
  79. package/utils/mfActions/constants.d.ts.map +1 -0
  80. package/utils/mfActions/constants.js +8 -0
  81. package/utils/mfActions/index.d.ts +5 -0
  82. package/utils/mfActions/index.d.ts.map +1 -0
  83. package/utils/mfActions/mfActions.d.ts +10 -0
  84. package/utils/mfActions/mfActions.d.ts.map +1 -0
  85. package/utils/mfActions/mfActions.js +47 -0
  86. package/utils/mfActions/openMFCallbackAction.d.ts +4 -0
  87. package/utils/mfActions/openMFCallbackAction.d.ts.map +1 -0
  88. package/utils/mfActions/openMFCallbackAction.js +36 -0
  89. package/utils/mfActions/tests/callbackHelpers.d.ts +9 -0
  90. package/utils/mfActions/tests/callbackHelpers.d.ts.map +1 -0
  91. package/utils/mfActions/tests/constants.d.ts +6 -0
  92. package/utils/mfActions/tests/constants.d.ts.map +1 -0
  93. package/utils/mfActions/tests/helpers.d.ts +4 -0
  94. package/utils/mfActions/tests/helpers.d.ts.map +1 -0
  95. package/utils/mfActions/tests/types.d.ts +8 -0
  96. package/utils/mfActions/tests/types.d.ts.map +1 -0
  97. package/utils/mfActions/types.d.ts +47 -0
  98. package/utils/mfActions/types.d.ts.map +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"MFLoader.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/MFLoader/MFLoader.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,aAAa,EAAU,MAAM,SAAS,CAAC;AAehD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,oDAoP5C;AACD,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"MFLoader.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/MFLoader/MFLoader.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,aAAa,EAAU,MAAM,SAAS,CAAC;AAiBhD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,oDAgQ5C;AACD,eAAe,QAAQ,CAAC"}
@@ -1,146 +1,158 @@
1
- import { jsxs as ee, jsx as r } from "@emotion/react/jsx-runtime";
2
- import { useRef as c, useEffect as te } from "react";
3
- import { useNetwork as re, useEnvironment as oe, useHostTools as se, useUserPreferences as ne, resolveLocalLoopbackOrigin as ie } from "@m4l/core";
4
- import { useHostTheme as ce, useFormatter as de, useLocales as ae } from "@m4l/graphics";
5
- import { ProggessLoadingMF as le } from "./subcomponents/ProggessLoadingMF/index.js";
1
+ import { jsxs as te, jsx as t } from "@emotion/react/jsx-runtime";
2
+ import { useRef as d, useEffect as I } from "react";
3
+ import { useNetwork as oe, useEnvironment as se, useHostTools as ne, useUserPreferences as ie, resolveLocalLoopbackOrigin as ce } from "@m4l/core";
4
+ import { useHostTheme as ae, useFormatter as de, useLocales as le } from "@m4l/graphics";
5
+ import { ProggessLoadingMF as me } from "./subcomponents/ProggessLoadingMF/index.js";
6
6
  import { LoadingError as ue } from "../LoadingError/LoadingError.js";
7
- import { useHostRuntime as me } from "../../contexts/HostRuntimeContext/HostRuntimeContext.js";
8
- import { useShellObservability as pe } from "../../contexts/ShellObservabilityContext/ShellObservabilityContext.js";
9
- import { projectMFHostRuntimeTools as fe } from "./helpers/projectMFHostRuntimeTools/projectMFHostRuntimeTools.js";
10
- import { useMFTelemetry as Le } from "./hooks/useMFTelemetry/useMFTelemetry.js";
11
- import { useMFSwap as Se } from "./hooks/useMFSwap/useMFSwap.js";
12
- import { useMFLifecycle as he } from "./hooks/useMFLifecycle/useMFLifecycle.js";
13
- import { useMFRender as ge } from "./hooks/useMFRender/useMFRender.js";
14
- import { MFLoaderRootStyled as ve, MFLoaderMountContainerStyled as T, MFLoaderOverlayStyled as O } from "./slots/MFLoaderSlots.js";
15
- function je(I) {
7
+ import { useMFCallbackLifecycle as fe } from "./hooks/useMFCallbackLifecycle.js";
8
+ import { useHostRuntime as pe } from "../../contexts/HostRuntimeContext/HostRuntimeContext.js";
9
+ import { useShellObservability as Se } from "../../contexts/ShellObservabilityContext/ShellObservabilityContext.js";
10
+ import { projectMFHostRuntimeTools as Le } from "./helpers/projectMFHostRuntimeTools/projectMFHostRuntimeTools.js";
11
+ import { useMFTelemetry as Me } from "./hooks/useMFTelemetry/useMFTelemetry.js";
12
+ import { useMFSwap as Re } from "./hooks/useMFSwap/useMFSwap.js";
13
+ import { useMFLifecycle as ge } from "./hooks/useMFLifecycle/useMFLifecycle.js";
14
+ import { MF_ACTION_CALLBACKS_PARAM as he, MF_ACTION_REQUEST_PARAM as Fe } from "../../utils/mfActions/constants.js";
15
+ import { useMFRender as ye } from "./hooks/useMFRender/useMFRender.js";
16
+ import { MFLoaderRootStyled as ve, MFLoaderMountContainerStyled as P, MFLoaderOverlayStyled as _ } from "./slots/MFLoaderSlots.js";
17
+ import { isMFActionRequest as be, completeMFAction as Te } from "../../utils/mfActions/mfActions.js";
18
+ function Ve(E) {
16
19
  const {
17
20
  prefix: o,
18
- moduleId: C,
19
- cache: d = !0,
21
+ moduleId: H,
22
+ cache: l = !0,
20
23
  debugPort: s,
21
- hostRuntime: H,
22
- observability: P,
23
- dynamicMFStore: x,
24
- windowTools: E,
25
- emergeType: q,
26
- loggedUser: j
27
- } = I, k = me(), G = pe(), V = fe(H ?? k), A = P ?? G, { hostThemeOptions: B, fnComponentsOverrides: N } = ce(), { networkOperation: U } = re(), n = oe(), $ = se(), D = ne(), z = de(), J = { hostThemeOptions: B, fnComponentsOverrides: N }, p = c(null), f = c(null), L = c("progress"), S = c(
24
+ hostRuntime: q,
25
+ observability: x,
26
+ dynamicMFStore: n,
27
+ windowTools: i,
28
+ emergeType: k,
29
+ loggedUser: N
30
+ } = E, j = pe(), B = Se(), G = Le(q ?? j), U = x ?? B, { hostThemeOptions: V, fnComponentsOverrides: $ } = ae(), { networkOperation: D } = oe(), c = se(), m = ne(), K = ie(), Q = de(), z = { hostThemeOptions: V, fnComponentsOverrides: $ }, M = d(null), R = d(null), g = d("progress"), h = d(
28
31
  null
29
- ), { currentLocale: K } = ae(), Q = !n.isLocalhost || Number.isInteger(s) && s > 0, {
30
- activeSwapRef: h,
31
- createTelemetryContext: a,
32
- emitAbandonedLoadTelemetry: W,
33
- emitSwapStartedTelemetry: g,
34
- emitSwapFailedTelemetry: l,
32
+ ), { currentLocale: J } = le(), W = !c.isLocalhost || Number.isInteger(s) && s > 0, {
33
+ activeSwapRef: F,
34
+ createTelemetryContext: u,
35
+ emitAbandonedLoadTelemetry: X,
36
+ emitSwapStartedTelemetry: y,
37
+ emitSwapFailedTelemetry: f,
35
38
  reportLoaderError: v
36
- } = Le({
37
- cache: d,
39
+ } = Me({
40
+ cache: l,
38
41
  prefix: o,
39
- mountedScriptRefBridge: p,
40
- requestedScriptRefBridge: f,
41
- setStatusLoaderRef: S,
42
- statusLoaderRef: L
42
+ mountedScriptRefBridge: M,
43
+ requestedScriptRefBridge: R,
44
+ setStatusLoaderRef: h,
45
+ statusLoaderRef: g
43
46
  }), {
44
- mountedScript: u,
45
- requestedScript: e,
46
- isSwappingModule: X,
47
- mountedScriptRef: R,
48
- requestedScriptRef: y,
49
- promoteRequestedScript: b
50
- } = Se({
51
- activeSwapRef: h,
52
- cache: d,
53
- createTelemetryContext: a,
54
- emitAbandonedLoadTelemetry: W,
55
- emitSwapFailedTelemetry: l,
56
- emitSwapStartedTelemetry: g,
57
- moduleId: C,
47
+ mountedScript: p,
48
+ requestedScript: r,
49
+ isSwappingModule: Y,
50
+ mountedScriptRef: b,
51
+ requestedScriptRef: T,
52
+ promoteRequestedScript: w
53
+ } = Re({
54
+ activeSwapRef: F,
55
+ cache: l,
56
+ createTelemetryContext: u,
57
+ emitAbandonedLoadTelemetry: X,
58
+ emitSwapFailedTelemetry: f,
59
+ emitSwapStartedTelemetry: y,
60
+ moduleId: H,
58
61
  prefix: o,
59
62
  reportLoaderError: v
60
63
  });
61
- p.current = R, f.current = y;
62
- const Y = n.isLocalhost ? ie(s) : `https://${window.location.host}/mf/${e.moduleId}`, {
63
- statusLoader: t,
64
- setStatusLoader: F,
65
- loadingProgress: Z,
66
- tryAgainOnError: _,
67
- loadGeneration: i,
68
- completedGeneration: M,
69
- renderedGeneration: m
70
- } = he({
71
- activeHost: Y,
72
- cache: d,
73
- createTelemetryContext: a,
74
- environmentIsLocalhost: n.isLocalhost,
75
- hasValidLocalDebugPort: Q,
76
- mountedScriptRef: R,
77
- networkOperation: U,
64
+ M.current = b, R.current = T;
65
+ const Z = c.isLocalhost ? ce(s) : `https://${window.location.host}/mf/${r.moduleId}`, {
66
+ statusLoader: e,
67
+ setStatusLoader: C,
68
+ loadingProgress: ee,
69
+ tryAgainOnError: re,
70
+ loadGeneration: a,
71
+ completedGeneration: A,
72
+ renderedGeneration: S
73
+ } = ge({
74
+ activeHost: Z,
75
+ cache: l,
76
+ createTelemetryContext: u,
77
+ environmentIsLocalhost: c.isLocalhost,
78
+ hasValidLocalDebugPort: W,
79
+ mountedScriptRef: b,
80
+ networkOperation: D,
78
81
  prefix: o,
79
- requestedScript: e,
80
- requestedScriptRef: y,
81
- activeSwapRef: h,
82
- emitSwapFailedTelemetry: l,
83
- emitSwapStartedTelemetry: g
82
+ requestedScript: r,
83
+ requestedScriptRef: T,
84
+ activeSwapRef: F,
85
+ emitSwapFailedTelemetry: f,
86
+ emitSwapStartedTelemetry: y
84
87
  });
85
- L.current = t, S.current = F;
86
- const { renderMicroFrontend: w } = ge({
88
+ g.current = e, h.current = C, fe(
89
+ n?.getState().dynamicMFParameters?.[he],
90
+ e === "error",
91
+ i.close
92
+ ), I(() => {
93
+ if (e !== "error")
94
+ return;
95
+ const L = n?.getState().dynamicMFParameters?.[Fe];
96
+ be(L) && (Te(m, L, { status: "failed", errorCode: "mf_load_failed" }), i?.close(!1));
97
+ }, [e, n, m, i]);
98
+ const { renderMicroFrontend: O } = ye({
87
99
  prefix: o,
88
100
  debugPort: s,
89
- dynamicMFStore: x,
90
- windowTools: E,
91
- emergeType: q,
92
- loggedUser: j,
93
- environment: n,
94
- hostTools: $,
95
- currentLocale: K,
96
- hostTheme: J,
97
- formatter: z,
98
- userPreferences: D,
99
- resolvedHostRuntime: V,
100
- resolvedObservability: A,
101
+ dynamicMFStore: n,
102
+ windowTools: i,
103
+ emergeType: k,
104
+ loggedUser: N,
105
+ environment: c,
106
+ hostTools: m,
107
+ currentLocale: J,
108
+ hostTheme: z,
109
+ formatter: Q,
110
+ userPreferences: K,
111
+ resolvedHostRuntime: G,
112
+ resolvedObservability: U,
101
113
  reportLoaderError: v,
102
- emitSwapFailedTelemetry: l,
103
- setStatusLoader: F,
104
- createTelemetryContext: a
114
+ emitSwapFailedTelemetry: f,
115
+ setStatusLoader: C,
116
+ createTelemetryContext: u
105
117
  });
106
- return te(() => {
107
- if (t === "complete" && M.current === i.current && m.current !== i.current) {
108
- if (!w(e))
118
+ return I(() => {
119
+ if (e === "complete" && A.current === a.current && S.current !== a.current) {
120
+ if (!O(r))
109
121
  return;
110
- m.current = i.current, b();
122
+ S.current = a.current, w();
111
123
  }
112
124
  }, [
113
- M,
114
- i,
115
- u,
125
+ A,
126
+ a,
127
+ p,
116
128
  o,
117
- b,
118
129
  w,
119
- m,
120
- e,
121
- t
122
- ]), /* @__PURE__ */ ee(ve, { children: [
123
- /* @__PURE__ */ r(
124
- T,
130
+ O,
131
+ S,
132
+ r,
133
+ e
134
+ ]), /* @__PURE__ */ te(ve, { children: [
135
+ /* @__PURE__ */ t(
136
+ P,
125
137
  {
126
- id: u.divContainerId,
138
+ id: p.divContainerId,
127
139
  ownerState: { isVisible: !0 }
128
140
  },
129
- u.divContainerId
141
+ p.divContainerId
130
142
  ),
131
- X ? /* @__PURE__ */ r(
132
- T,
143
+ Y ? /* @__PURE__ */ t(
144
+ P,
133
145
  {
134
- id: e.divContainerId,
146
+ id: r.divContainerId,
135
147
  ownerState: { isVisible: !1 }
136
148
  },
137
- e.divContainerId
149
+ r.divContainerId
138
150
  ) : null,
139
- t === "progress" ? /* @__PURE__ */ r(O, { children: /* @__PURE__ */ r(le, { loadingProgress: Z }) }) : null,
140
- t === "error" ? /* @__PURE__ */ r(O, { children: /* @__PURE__ */ r(ue, { status: t, action: _ }) }) : null
151
+ e === "progress" ? /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(me, { loadingProgress: ee }) }) : null,
152
+ e === "error" ? /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(ue, { status: e, action: re }) }) : null
141
153
  ] });
142
154
  }
143
155
  export {
144
- je as MFLoader,
145
- je as default
156
+ Ve as MFLoader,
157
+ Ve as default
146
158
  };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Deliver local loader lifecycle results without subscribing to or publishing host action events.
3
+ * Entrega el ciclo de vida local sin suscribirse ni publicar eventos de acción del host.
4
+ */
5
+ export declare function useMFCallbackLifecycle(value: unknown, failed: boolean, close: (guard?: boolean) => void): void;
6
+ //# sourceMappingURL=useMFCallbackLifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMFCallbackLifecycle.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/MFLoader/hooks/useMFCallbackLifecycle.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,QAwBvG"}
@@ -0,0 +1,25 @@
1
+ import { useRef as i, useEffect as c } from "react";
2
+ function f(n) {
3
+ return !n || typeof n != "object" ? !1 : "onOpened" in n && typeof n.onOpened == "function" && "onClosed" in n && typeof n.onClosed == "function" && "onLoadError" in n && typeof n.onLoadError == "function";
4
+ }
5
+ function d(n, t, e) {
6
+ const o = f(n) ? n : void 0, r = i(void 0);
7
+ c(() => {
8
+ if (o)
9
+ return r.current = o, o.onOpened(), () => {
10
+ r.current = void 0, queueMicrotask(() => {
11
+ r.current !== o && o.onClosed();
12
+ });
13
+ };
14
+ }, [o]), c(() => {
15
+ if (!(!t || !o))
16
+ try {
17
+ o.onLoadError();
18
+ } finally {
19
+ e(!1);
20
+ }
21
+ }, [o, t, e]);
22
+ }
23
+ export {
24
+ d as useMFCallbackLifecycle
25
+ };
@@ -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;AAc1C;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,eAAe,qDA8KpD,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":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAc1C;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,eAAe,qDAgLpD,CAAC"}
@@ -1,32 +1,33 @@
1
- import { jsx as m, Fragment as b } from "@emotion/react/jsx-runtime";
2
- import { shallow as i } from "zustand/shallow";
3
- import { Window as M } from "../Window/Window.js";
4
- import { useAreasStore as n } from "../../../../../../hooks/useAreas/index.js";
1
+ import { jsx as m, Fragment as M } from "@emotion/react/jsx-runtime";
2
+ import { shallow as s } from "zustand/shallow";
3
+ import { useAuth as N } from "@m4l/core";
4
+ import { Window as O } from "../Window/Window.js";
5
+ import { useAreasStore as i } from "../../../../../../hooks/useAreas/index.js";
5
6
  import { areasViewerClasses as g } from "../../../../classes/index.js";
6
- import N from "clsx";
7
- import { PADDING_GRIDLAYOUT as p, MARGIN_GRIDLAYOUT as f, RESPONSIVE_ROW_HEIGHTS as O } from "../../../../../../contexts/AreasContext/helpers/helper.js";
8
- import { MemonizePopupsViewer as T } from "../../../../../../../popups/components/PopupsViewer/PopupsViewer.js";
9
- import { useState as D, useMemo as F, useEffect as P } from "react";
10
- import { dragResizeWindowRNDClasses as s } from "../../../../../../../DragResizeWindowRND/classes/index.js";
11
- import { useTheme as V } from "@mui/material";
12
- import { useComponentSize as k } from "../../../../../../../../hooks/useComponentSize/index.js";
13
- import { withSizeProvider as U } from "../../../../../../../GridLayout/subcomponents/withSizeProvider/index.js";
14
- import { Responsive as $ } from "../../../../../../../GridLayout/subcomponents/Responsive/index.js";
15
- const Y = U($), q = 10, ne = (h) => {
16
- const { areaId: r, size: I } = h, y = n((e) => e.hashAreas[r].layoutItemsIds, i), A = n((e) => e.hashAreas[r].layouts, i), L = n((e) => e.hashAreas[r].breakpoints, i), c = n((e) => e.hashAreas[r].currentLayoutId, i), S = n((e) => e.hashAreas[r].maximizedId, i), w = n((e) => e.hashAreas[r].cols, i), { onBreakpointsLayoutsChange: R, onContainerChange: z } = n(
7
+ import T from "clsx";
8
+ import { PADDING_GRIDLAYOUT as p, MARGIN_GRIDLAYOUT as f, RESPONSIVE_ROW_HEIGHTS as D } from "../../../../../../contexts/AreasContext/helpers/helper.js";
9
+ import { MemonizePopupsViewer as F } from "../../../../../../../popups/components/PopupsViewer/PopupsViewer.js";
10
+ import { useState as P, useMemo as U, useEffect as V } from "react";
11
+ import { dragResizeWindowRNDClasses as n } from "../../../../../../../DragResizeWindowRND/classes/index.js";
12
+ import { useTheme as k } from "@mui/material";
13
+ import { useComponentSize as $ } from "../../../../../../../../hooks/useComponentSize/index.js";
14
+ import { withSizeProvider as Y } from "../../../../../../../GridLayout/subcomponents/withSizeProvider/index.js";
15
+ import { Responsive as q } from "../../../../../../../GridLayout/subcomponents/Responsive/index.js";
16
+ const W = Y(q), B = 10, ce = (h) => {
17
+ const { areaId: r, size: I } = h, { user: A } = N(), y = i((e) => e.hashAreas[r].layoutItemsIds, s), L = i((e) => e.hashAreas[r].layouts, s), S = i((e) => e.hashAreas[r].breakpoints, s), c = i((e) => e.hashAreas[r].currentLayoutId, s), w = i((e) => e.hashAreas[r].maximizedId, s), R = i((e) => e.hashAreas[r].cols, s), { onBreakpointsLayoutsChange: z, onContainerChange: C } = i(
17
18
  (e) => e.areaActions,
18
- i
19
- ), d = V(), { currentSize: l } = k(I), [t, C] = D(void 0), H = () => {
20
- t && t.classList.add(s.resizing);
21
- }, E = () => {
22
- t && t.classList.remove(s.resizing);
19
+ s
20
+ ), d = k(), { currentSize: l } = $(I), [t, H] = P(void 0), E = () => {
21
+ t && t.classList.add(n.resizing);
23
22
  }, G = () => {
24
- t && t.classList.add(s.dragging);
23
+ t && t.classList.remove(n.resizing);
25
24
  }, v = () => {
26
- t && t.classList.remove(s.dragging);
27
- }, x = (e) => {
28
- e && e !== t && C(e);
29
- }, _ = F(() => {
25
+ t && t.classList.add(n.dragging);
26
+ }, x = () => {
27
+ t && t.classList.remove(n.dragging);
28
+ }, _ = (e) => {
29
+ e && e !== t && H(e);
30
+ }, b = U(() => {
30
31
  const e = d?.size?.[d?.generalSettings?.isMobile ? "mobile" : "desktop"]?.[l]?.container, a = parseInt(e), o = isNaN(a) ? 32 : a;
31
32
  return {
32
33
  xxs: o,
@@ -36,10 +37,10 @@ const Y = U($), q = 10, ne = (h) => {
36
37
  lg: o
37
38
  };
38
39
  }, [d, l]);
39
- return P(() => {
40
+ return V(() => {
40
41
  if (!t || !c)
41
42
  return;
42
- let e = 0, a = q;
43
+ let e = 0, a = B;
43
44
  const o = () => {
44
45
  const u = t.querySelector(
45
46
  `[data-grid-item-id="${c}"]`
@@ -57,47 +58,48 @@ const Y = U($), q = 10, ne = (h) => {
57
58
  window.cancelAnimationFrame(e);
58
59
  };
59
60
  }, [c, t]), /* @__PURE__ */ m(
60
- Y,
61
+ W,
61
62
  {
62
- ref: x,
63
+ ref: _,
63
64
  autoSize: !1,
64
65
  compactType: "vertical",
65
66
  measureBeforeMount: !0,
66
67
  resizeHandles: ["nw", "se"],
67
- className: N(
68
+ className: T(
68
69
  g.areaGridLayout,
69
70
  `${g.areaGridLayout}-${r}`
70
71
  ),
71
- layouts: A,
72
- onLayoutChange: (e, a) => R(r, e, a),
73
- draggableHandle: `.${s.draggableHandle}`,
74
- draggableCancel: `.${s.draggableCancel}`,
75
- layoutItemRender: (e) => y.indexOf(e.i) === -1 ? /* @__PURE__ */ m(b, {}) : e.type === "placeholder" ? /* @__PURE__ */ m("div", {}) : /* @__PURE__ */ m(M, { windowId: e.i, areaId: r }),
76
- breakpoints: L,
77
- colapsedHeight: _,
78
- rowHeight: O,
79
- cols: w,
72
+ layouts: L,
73
+ onLayoutChange: (e, a) => z(r, e, a),
74
+ draggableHandle: `.${n.draggableHandle}`,
75
+ draggableCancel: `.${n.draggableCancel}`,
76
+ layoutItemRender: (e) => y.indexOf(e.i) === -1 ? /* @__PURE__ */ m(M, {}) : e.type === "placeholder" ? /* @__PURE__ */ m("div", {}) : /* @__PURE__ */ m(O, { windowId: e.i, areaId: r }),
77
+ breakpoints: S,
78
+ colapsedHeight: b,
79
+ rowHeight: D,
80
+ cols: R,
80
81
  containerMargin: [f, f],
81
82
  containerPadding: [p, p],
82
83
  onContainerChange: (e) => {
83
- z(r, e);
84
+ C(r, e);
84
85
  },
85
86
  preventCollision: !1,
86
- maximizeId: S,
87
+ maximizeId: w,
87
88
  children: /* @__PURE__ */ m(
88
- T,
89
+ F,
89
90
  {
90
91
  groupId: r,
92
+ loggedUser: A,
91
93
  containerElement: t,
92
- onResizeStart: H,
93
- onResizeStop: E,
94
- onDragStart: G,
95
- onDragStop: v
94
+ onResizeStart: E,
95
+ onResizeStop: G,
96
+ onDragStart: v,
97
+ onDragStop: x
96
98
  }
97
99
  )
98
100
  }
99
101
  );
100
102
  };
101
103
  export {
102
- ne as AreaGridLayout
104
+ ce as AreaGridLayout
103
105
  };
@@ -0,0 +1,4 @@
1
+ import { UserAuth } from '@m4l/core';
2
+ export declare const POPUP_AUTH_FIRST_USER: UserAuth;
3
+ export declare const POPUP_AUTH_NEXT_USER: UserAuth;
4
+ //# sourceMappingURL=popupAuthenticationConstants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popupAuthenticationConstants.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/areas/components/AreasViewer/test/popupAuthenticationConstants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,eAAO,MAAM,qBAAqB,EAAE,QAOnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAOlC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/areas/contexts/AreasContext/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAKlD,QAAA,MAAM,YAAY;;;;;;;;UAAyC,CAAC;AAC5D;;GAEG;AACH,iBAAS,aAAa,CAAC,KAAK,EAAE,kBAAkB,oDAqH/C;AACD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/areas/contexts/AreasContext/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAMlD,QAAA,MAAM,YAAY;;;;;;;;UAAyC,CAAC;AAC5D;;GAEG;AACH,iBAAS,aAAa,CAAC,KAAK,EAAE,kBAAkB,oDAsH/C;AACD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
@@ -5,35 +5,36 @@ import { shallow as u } from "zustand/shallow";
5
5
  import { useFirstRender as B } from "@m4l/graphics";
6
6
  import { useHostTools as V, useModuleDictionary as j, useNetwork as q, useFlagsStore as z, CommonFlags as J, EmitEvents as S } from "@m4l/core";
7
7
  import { createAreasStore as K } from "./store.js";
8
- import { usePopupsStore as Q } from "../../../popups/components/PopupsProvider/hooks/usePopupsStore.js";
9
- const U = x(null);
10
- function se(A) {
8
+ import { useMFActionLifecycle as Q } from "./useMFActionLifecycle.js";
9
+ import { usePopupsStore as U } from "../../../popups/components/PopupsProvider/hooks/usePopupsStore.js";
10
+ const X = x(null);
11
+ function ae(A) {
11
12
  const {
12
- children: I,
13
- loadAreasFromNetwork: F,
13
+ children: F,
14
+ loadAreasFromNetwork: I,
14
15
  loadCookiesFromNetwork: _,
15
16
  onLoad: i,
16
17
  onReady: c,
17
18
  onSelectLayout: l,
18
- storeId: P,
19
- storeDevtoolsEnabled: k
20
- } = A, { events_add_listener: v, events_remove_listener: y } = V(), { getLabel: s } = j(), { networkOperation: M } = q(), g = B([s]), { addFlag: w } = z((e) => e.flagsActions), r = d(null), {
19
+ storeId: y,
20
+ storeDevtoolsEnabled: M
21
+ } = A, { events_add_listener: P, events_remove_listener: k } = V(), { getLabel: s } = j(), { networkOperation: v } = q(), g = B([s]), { addFlag: w } = z((e) => e.flagsActions), r = d(null), {
21
22
  addPopup: R,
22
23
  removePopup: H,
23
24
  closePopupsByGroupId: C,
24
- bringPopupOnFront: N,
25
- closeAllPopupsByParentId: O,
26
- setSelectedPopupId: T
27
- } = Q(
25
+ bringPopupOnFront: L,
26
+ closeAllPopupsByParentId: N,
27
+ setSelectedPopupId: O
28
+ } = U(
28
29
  (e) => e.popupsActions,
29
30
  u
30
31
  );
31
32
  r.current || (r.current = K({
32
- storeId: P,
33
+ storeId: y,
33
34
  getLabel: s,
34
- loadAreasFromNetwork: F,
35
+ loadAreasFromNetwork: I,
35
36
  loadCookiesFromNetwork: _,
36
- networkOperation: M,
37
+ networkOperation: v,
37
38
  ownerState: {
38
39
  status: "init",
39
40
  readyForHooks: !1
@@ -42,18 +43,18 @@ function se(A) {
42
43
  addPopup: R,
43
44
  removePopup: H,
44
45
  removePopupsByGroupId: C,
45
- bringPopupOnFront: N,
46
- closeAllPopupsByParentId: O,
47
- setSelectedPopupId: T
46
+ bringPopupOnFront: L,
47
+ closeAllPopupsByParentId: N,
48
+ setSelectedPopupId: O
48
49
  }
49
- }, k), r.current?.getState().areasActions.init());
50
- const t = a(r.current, (e) => e.ownerState?.status, u), p = a(r.current, (e) => e.ownerState?.readyForHooks, u), n = a(r.current, (e) => e.currentModuleId), f = d(""), m = d(!1), { setHandlerGetLabel: b, setExternalState: D } = a(
50
+ }, M), r.current?.getState().areasActions.init()), Q(r.current);
51
+ const t = a(r.current, (e) => e.ownerState?.status, u), p = a(r.current, (e) => e.ownerState?.readyForHooks, u), n = a(r.current, (e) => e.currentModuleId), f = d(""), m = d(!1), { setHandlerGetLabel: T, setExternalState: b } = a(
51
52
  r.current,
52
53
  (e) => e.areasActions,
53
54
  u
54
55
  ), E = h((e) => {
55
- const G = r.current?.getState().currentAreaId, L = r.current?.getState().areasIds;
56
- G && L && r.current?.getState().areaActions.addWindow(e);
56
+ const D = r.current?.getState().currentAreaId, G = r.current?.getState().areasIds;
57
+ D && G && r.current?.getState().areaActions.addWindow(e);
57
58
  }, []);
58
59
  return o(() => {
59
60
  t === "loaded" && (i && i(), w(J.FLAG_AREAS_LOADED));
@@ -62,12 +63,12 @@ function se(A) {
62
63
  }, [c, p, t]), o(() => {
63
64
  t === "loaded" && n !== f.current && (l && l(n), f.current = n);
64
65
  }, [n, t]), o(() => {
65
- g || b(s);
66
- }, [s]), o(() => (v(S.EMMIT_EVENT_HOST_EMERGE_WINDOW, E), D({ readyForHooks: !0 }), () => {
67
- y(S.EMMIT_EVENT_HOST_EMERGE_WINDOW, E);
68
- }), []), /* @__PURE__ */ W(U.Provider, { value: r.current, children: I });
66
+ g || T(s);
67
+ }, [s]), o(() => (P(S.EMMIT_EVENT_HOST_EMERGE_WINDOW, E), b({ readyForHooks: !0 }), () => {
68
+ k(S.EMMIT_EVENT_HOST_EMERGE_WINDOW, E);
69
+ }), []), /* @__PURE__ */ W(X.Provider, { value: r.current, children: F });
69
70
  }
70
71
  export {
71
- U as AreasContext,
72
- se as AreasProvider
72
+ X as AreasContext,
73
+ ae as AreasProvider
73
74
  };
@@ -0,0 +1,22 @@
1
+ /** Wire the real logical and visual popup registries without rendering geometry-dependent UI. */
2
+ export declare function createActionAreasStores(): {
3
+ store: Omit<Omit<import('zustand').StoreApi<import('../types').AreasStoreStateWithActions>, "setState"> & {
4
+ setState<A extends string | {
5
+ type: unknown;
6
+ }>(partial: import('../types').AreasStoreStateWithActions | Partial<import('../types').AreasStoreStateWithActions> | ((state: import('../types').AreasStoreStateWithActions) => import('../types').AreasStoreStateWithActions | Partial<import('../types').AreasStoreStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
7
+ }, "setState"> & {
8
+ setState(nextStateOrUpdater: import('../types').AreasStoreStateWithActions | Partial<import('../types').AreasStoreStateWithActions> | ((state: import('immer/dist/internal.js').WritableDraft<import('../types').AreasStoreStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
9
+ type: unknown;
10
+ } | undefined): void;
11
+ };
12
+ popups: Omit<Omit<import('zustand').StoreApi<import('../../../../popups/components/PopupsProvider/contexts/PopupsContext/types').PopupsProviderStoreStateWithActions>, "setState"> & {
13
+ setState<A extends string | {
14
+ type: unknown;
15
+ }>(partial: import('../../../../popups/components/PopupsProvider/contexts/PopupsContext/types').PopupsProviderStoreStateWithActions | Partial<import('../../../../popups/components/PopupsProvider/contexts/PopupsContext/types').PopupsProviderStoreStateWithActions> | ((state: import('../../../../popups/components/PopupsProvider/contexts/PopupsContext/types').PopupsProviderStoreStateWithActions) => import('../../../../popups/components/PopupsProvider/contexts/PopupsContext/types').PopupsProviderStoreStateWithActions | Partial<import('../../../../popups/components/PopupsProvider/contexts/PopupsContext/types').PopupsProviderStoreStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
16
+ }, "setState"> & {
17
+ setState(nextStateOrUpdater: import('../../../../popups/components/PopupsProvider/contexts/PopupsContext/types').PopupsProviderStoreStateWithActions | Partial<import('../../../../popups/components/PopupsProvider/contexts/PopupsContext/types').PopupsProviderStoreStateWithActions> | ((state: import('immer/dist/internal.js').WritableDraft<import('../../../../popups/components/PopupsProvider/contexts/PopupsContext/types').PopupsProviderStoreStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
18
+ type: unknown;
19
+ } | undefined): void;
20
+ };
21
+ };
22
+ //# sourceMappingURL=mfActionSupport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfActionSupport.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/areas/contexts/AreasContext/tests/mfActionSupport.ts"],"names":[],"mappings":"AAIA,iGAAiG;AACjG,wBAAgB,uBAAuB;;;;;;;;;;;;;;;;;;;EAoBtC"}
@@ -0,0 +1,4 @@
1
+ import { AreasStore } from './store';
2
+ /** Settle correlated actions from actual registry removal, preserving existing close guards. */
3
+ export declare function useMFActionLifecycle(store: AreasStore): void;
4
+ //# sourceMappingURL=useMFActionLifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMFActionLifecycle.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/areas/contexts/AreasContext/useMFActionLifecycle.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,gGAAgG;AAChG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,QAgErD"}