@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.
- package/components/MFLoader/MFLoader.d.ts.map +1 -1
- package/components/MFLoader/MFLoader.js +124 -112
- package/components/MFLoader/hooks/useMFCallbackLifecycle.d.ts +6 -0
- package/components/MFLoader/hooks/useMFCallbackLifecycle.d.ts.map +1 -0
- package/components/MFLoader/hooks/useMFCallbackLifecycle.js +25 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.d.ts.map +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +49 -47
- package/components/areas/components/AreasViewer/test/popupAuthenticationConstants.d.ts +4 -0
- package/components/areas/components/AreasViewer/test/popupAuthenticationConstants.d.ts.map +1 -0
- package/components/areas/contexts/AreasContext/index.d.ts.map +1 -1
- package/components/areas/contexts/AreasContext/index.js +29 -28
- package/components/areas/contexts/AreasContext/tests/mfActionSupport.d.ts +22 -0
- package/components/areas/contexts/AreasContext/tests/mfActionSupport.d.ts.map +1 -0
- package/components/areas/contexts/AreasContext/useMFActionLifecycle.d.ts +4 -0
- package/components/areas/contexts/AreasContext/useMFActionLifecycle.d.ts.map +1 -0
- package/components/areas/contexts/AreasContext/useMFActionLifecycle.js +49 -0
- package/components/extended/mui/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/components/extended/mui/Autocomplete/Autocomplete.js +55 -54
- package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.d.ts.map +1 -1
- package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.js +81 -72
- package/components/extended/mui/Autocomplete/types.d.ts +1 -1
- package/components/extended/mui/Autocomplete/types.d.ts.map +1 -1
- package/components/extended/mui/AutocompleteAsync/AutocompleteAddButton.d.ts +4 -0
- package/components/extended/mui/AutocompleteAsync/AutocompleteAddButton.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/AutocompleteAddButton.js +23 -0
- package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.d.ts +5 -9
- package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.d.ts.map +1 -1
- package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.js +87 -56
- package/components/extended/mui/AutocompleteAsync/constants.d.ts +4 -1
- package/components/extended/mui/AutocompleteAsync/constants.d.ts.map +1 -1
- package/components/extended/mui/AutocompleteAsync/constants.js +24 -12
- package/components/extended/mui/AutocompleteAsync/hooks/useAutocompleteAdd.d.ts +9 -0
- package/components/extended/mui/AutocompleteAsync/hooks/useAutocompleteAdd.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/hooks/useAutocompleteAdd.js +97 -0
- package/components/extended/mui/AutocompleteAsync/hooks/useFetchOptions.d.ts.map +1 -1
- package/components/extended/mui/AutocompleteAsync/hooks/useFetchOptions.js +47 -46
- package/components/extended/mui/AutocompleteAsync/index.d.ts +1 -1
- package/components/extended/mui/AutocompleteAsync/index.d.ts.map +1 -1
- package/components/extended/mui/AutocompleteAsync/reducer/AutocompleteAsyncReducer.d.ts.map +1 -1
- package/components/extended/mui/AutocompleteAsync/reducer/AutocompleteAsyncReducer.js +50 -28
- package/components/extended/mui/AutocompleteAsync/slots/addStyled.d.ts +6 -0
- package/components/extended/mui/AutocompleteAsync/slots/addStyled.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/slots/addStyled.js +19 -0
- package/components/extended/mui/AutocompleteAsync/tests/add/constants.d.ts +5 -0
- package/components/extended/mui/AutocompleteAsync/tests/add/constants.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/tests/add/helpers.d.ts +8 -0
- package/components/extended/mui/AutocompleteAsync/tests/add/helpers.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/tests/add/types.d.ts +20 -0
- package/components/extended/mui/AutocompleteAsync/tests/add/types.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/tests/support/ControlledAsyncField.d.ts +4 -0
- package/components/extended/mui/AutocompleteAsync/tests/support/ControlledAsyncField.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/tests/support/constants.d.ts +8 -0
- package/components/extended/mui/AutocompleteAsync/tests/support/constants.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/tests/support/createDeferred.d.ts +4 -0
- package/components/extended/mui/AutocompleteAsync/tests/support/createDeferred.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/tests/support/mockAutocompleteAnchor.d.ts +3 -0
- package/components/extended/mui/AutocompleteAsync/tests/support/mockAutocompleteAnchor.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/tests/support/types.d.ts +21 -0
- package/components/extended/mui/AutocompleteAsync/tests/support/types.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/types.d.ts +47 -0
- package/components/extended/mui/AutocompleteAsync/types.d.ts.map +1 -1
- package/components/extended/mui/AutocompleteAsync/types.js +4 -2
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts +1 -1
- package/components/hook-form/RHFAutocompleteAsync/index.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/index.d.ts.map +1 -1
- package/components/hook-form/RHFAutocompleteAsync/tests/addConstants.d.ts +3 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/addConstants.d.ts.map +1 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/addHelpers.d.ts +4 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/addHelpers.d.ts.map +1 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/addTypes.d.ts +12 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/addTypes.d.ts.map +1 -0
- package/components/hook-form/index.d.ts +1 -0
- package/components/hook-form/index.d.ts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +235 -222
- package/package.json +5 -5
- package/utils/mfActions/constants.d.ts +6 -0
- package/utils/mfActions/constants.d.ts.map +1 -0
- package/utils/mfActions/constants.js +8 -0
- package/utils/mfActions/index.d.ts +5 -0
- package/utils/mfActions/index.d.ts.map +1 -0
- package/utils/mfActions/mfActions.d.ts +10 -0
- package/utils/mfActions/mfActions.d.ts.map +1 -0
- package/utils/mfActions/mfActions.js +47 -0
- package/utils/mfActions/openMFCallbackAction.d.ts +4 -0
- package/utils/mfActions/openMFCallbackAction.d.ts.map +1 -0
- package/utils/mfActions/openMFCallbackAction.js +36 -0
- package/utils/mfActions/tests/callbackHelpers.d.ts +9 -0
- package/utils/mfActions/tests/callbackHelpers.d.ts.map +1 -0
- package/utils/mfActions/tests/constants.d.ts +6 -0
- package/utils/mfActions/tests/constants.d.ts.map +1 -0
- package/utils/mfActions/tests/helpers.d.ts +4 -0
- package/utils/mfActions/tests/helpers.d.ts.map +1 -0
- package/utils/mfActions/tests/types.d.ts +8 -0
- package/utils/mfActions/tests/types.d.ts.map +1 -0
- package/utils/mfActions/types.d.ts +47 -0
- 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;
|
|
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
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useNetwork as
|
|
4
|
-
import { useHostTheme as
|
|
5
|
-
import { ProggessLoadingMF as
|
|
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 {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
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:
|
|
19
|
-
cache:
|
|
21
|
+
moduleId: H,
|
|
22
|
+
cache: l = !0,
|
|
20
23
|
debugPort: s,
|
|
21
|
-
hostRuntime:
|
|
22
|
-
observability:
|
|
23
|
-
dynamicMFStore:
|
|
24
|
-
windowTools:
|
|
25
|
-
emergeType:
|
|
26
|
-
loggedUser:
|
|
27
|
-
} =
|
|
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:
|
|
30
|
-
activeSwapRef:
|
|
31
|
-
createTelemetryContext:
|
|
32
|
-
emitAbandonedLoadTelemetry:
|
|
33
|
-
emitSwapStartedTelemetry:
|
|
34
|
-
emitSwapFailedTelemetry:
|
|
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
|
-
} =
|
|
37
|
-
cache:
|
|
39
|
+
} = Me({
|
|
40
|
+
cache: l,
|
|
38
41
|
prefix: o,
|
|
39
|
-
mountedScriptRefBridge:
|
|
40
|
-
requestedScriptRefBridge:
|
|
41
|
-
setStatusLoaderRef:
|
|
42
|
-
statusLoaderRef:
|
|
42
|
+
mountedScriptRefBridge: M,
|
|
43
|
+
requestedScriptRefBridge: R,
|
|
44
|
+
setStatusLoaderRef: h,
|
|
45
|
+
statusLoaderRef: g
|
|
43
46
|
}), {
|
|
44
|
-
mountedScript:
|
|
45
|
-
requestedScript:
|
|
46
|
-
isSwappingModule:
|
|
47
|
-
mountedScriptRef:
|
|
48
|
-
requestedScriptRef:
|
|
49
|
-
promoteRequestedScript:
|
|
50
|
-
} =
|
|
51
|
-
activeSwapRef:
|
|
52
|
-
cache:
|
|
53
|
-
createTelemetryContext:
|
|
54
|
-
emitAbandonedLoadTelemetry:
|
|
55
|
-
emitSwapFailedTelemetry:
|
|
56
|
-
emitSwapStartedTelemetry:
|
|
57
|
-
moduleId:
|
|
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
|
-
|
|
62
|
-
const
|
|
63
|
-
statusLoader:
|
|
64
|
-
setStatusLoader:
|
|
65
|
-
loadingProgress:
|
|
66
|
-
tryAgainOnError:
|
|
67
|
-
loadGeneration:
|
|
68
|
-
completedGeneration:
|
|
69
|
-
renderedGeneration:
|
|
70
|
-
} =
|
|
71
|
-
activeHost:
|
|
72
|
-
cache:
|
|
73
|
-
createTelemetryContext:
|
|
74
|
-
environmentIsLocalhost:
|
|
75
|
-
hasValidLocalDebugPort:
|
|
76
|
-
mountedScriptRef:
|
|
77
|
-
networkOperation:
|
|
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:
|
|
80
|
-
requestedScriptRef:
|
|
81
|
-
activeSwapRef:
|
|
82
|
-
emitSwapFailedTelemetry:
|
|
83
|
-
emitSwapStartedTelemetry:
|
|
82
|
+
requestedScript: r,
|
|
83
|
+
requestedScriptRef: T,
|
|
84
|
+
activeSwapRef: F,
|
|
85
|
+
emitSwapFailedTelemetry: f,
|
|
86
|
+
emitSwapStartedTelemetry: y
|
|
84
87
|
});
|
|
85
|
-
|
|
86
|
-
|
|
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:
|
|
90
|
-
windowTools:
|
|
91
|
-
emergeType:
|
|
92
|
-
loggedUser:
|
|
93
|
-
environment:
|
|
94
|
-
hostTools:
|
|
95
|
-
currentLocale:
|
|
96
|
-
hostTheme:
|
|
97
|
-
formatter:
|
|
98
|
-
userPreferences:
|
|
99
|
-
resolvedHostRuntime:
|
|
100
|
-
resolvedObservability:
|
|
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:
|
|
103
|
-
setStatusLoader:
|
|
104
|
-
createTelemetryContext:
|
|
114
|
+
emitSwapFailedTelemetry: f,
|
|
115
|
+
setStatusLoader: C,
|
|
116
|
+
createTelemetryContext: u
|
|
105
117
|
});
|
|
106
|
-
return
|
|
107
|
-
if (
|
|
108
|
-
if (!
|
|
118
|
+
return I(() => {
|
|
119
|
+
if (e === "complete" && A.current === a.current && S.current !== a.current) {
|
|
120
|
+
if (!O(r))
|
|
109
121
|
return;
|
|
110
|
-
|
|
122
|
+
S.current = a.current, w();
|
|
111
123
|
}
|
|
112
124
|
}, [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
125
|
+
A,
|
|
126
|
+
a,
|
|
127
|
+
p,
|
|
116
128
|
o,
|
|
117
|
-
b,
|
|
118
129
|
w,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
O,
|
|
131
|
+
S,
|
|
132
|
+
r,
|
|
133
|
+
e
|
|
134
|
+
]), /* @__PURE__ */ te(ve, { children: [
|
|
135
|
+
/* @__PURE__ */ t(
|
|
136
|
+
P,
|
|
125
137
|
{
|
|
126
|
-
id:
|
|
138
|
+
id: p.divContainerId,
|
|
127
139
|
ownerState: { isVisible: !0 }
|
|
128
140
|
},
|
|
129
|
-
|
|
141
|
+
p.divContainerId
|
|
130
142
|
),
|
|
131
|
-
|
|
132
|
-
|
|
143
|
+
Y ? /* @__PURE__ */ t(
|
|
144
|
+
P,
|
|
133
145
|
{
|
|
134
|
-
id:
|
|
146
|
+
id: r.divContainerId,
|
|
135
147
|
ownerState: { isVisible: !1 }
|
|
136
148
|
},
|
|
137
|
-
|
|
149
|
+
r.divContainerId
|
|
138
150
|
) : null,
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
|
|
145
|
-
|
|
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":"
|
|
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
|
|
2
|
-
import { shallow as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
7
|
-
import { PADDING_GRIDLAYOUT as p, MARGIN_GRIDLAYOUT as f, RESPONSIVE_ROW_HEIGHTS as
|
|
8
|
-
import { MemonizePopupsViewer as
|
|
9
|
-
import { useState as
|
|
10
|
-
import { dragResizeWindowRNDClasses as
|
|
11
|
-
import { useTheme as
|
|
12
|
-
import { useComponentSize as
|
|
13
|
-
import { withSizeProvider as
|
|
14
|
-
import { Responsive as
|
|
15
|
-
const
|
|
16
|
-
const { areaId: r, size: I } = h, y =
|
|
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
|
-
|
|
19
|
-
), d =
|
|
20
|
-
t && t.classList.add(
|
|
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.
|
|
23
|
+
t && t.classList.remove(n.resizing);
|
|
25
24
|
}, v = () => {
|
|
26
|
-
t && t.classList.
|
|
27
|
-
}, x = (
|
|
28
|
-
|
|
29
|
-
}, _ =
|
|
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
|
|
40
|
+
return V(() => {
|
|
40
41
|
if (!t || !c)
|
|
41
42
|
return;
|
|
42
|
-
let e = 0, a =
|
|
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
|
-
|
|
61
|
+
W,
|
|
61
62
|
{
|
|
62
|
-
ref:
|
|
63
|
+
ref: _,
|
|
63
64
|
autoSize: !1,
|
|
64
65
|
compactType: "vertical",
|
|
65
66
|
measureBeforeMount: !0,
|
|
66
67
|
resizeHandles: ["nw", "se"],
|
|
67
|
-
className:
|
|
68
|
+
className: T(
|
|
68
69
|
g.areaGridLayout,
|
|
69
70
|
`${g.areaGridLayout}-${r}`
|
|
70
71
|
),
|
|
71
|
-
layouts:
|
|
72
|
-
onLayoutChange: (e, a) =>
|
|
73
|
-
draggableHandle: `.${
|
|
74
|
-
draggableCancel: `.${
|
|
75
|
-
layoutItemRender: (e) => y.indexOf(e.i) === -1 ? /* @__PURE__ */ m(
|
|
76
|
-
breakpoints:
|
|
77
|
-
colapsedHeight:
|
|
78
|
-
rowHeight:
|
|
79
|
-
cols:
|
|
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
|
-
|
|
84
|
+
C(r, e);
|
|
84
85
|
},
|
|
85
86
|
preventCollision: !1,
|
|
86
|
-
maximizeId:
|
|
87
|
+
maximizeId: w,
|
|
87
88
|
children: /* @__PURE__ */ m(
|
|
88
|
-
|
|
89
|
+
F,
|
|
89
90
|
{
|
|
90
91
|
groupId: r,
|
|
92
|
+
loggedUser: A,
|
|
91
93
|
containerElement: t,
|
|
92
|
-
onResizeStart:
|
|
93
|
-
onResizeStop:
|
|
94
|
-
onDragStart:
|
|
95
|
-
onDragStop:
|
|
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
|
-
|
|
104
|
+
ce as AreaGridLayout
|
|
103
105
|
};
|
|
@@ -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;
|
|
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 {
|
|
9
|
-
|
|
10
|
-
|
|
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:
|
|
13
|
-
loadAreasFromNetwork:
|
|
13
|
+
children: F,
|
|
14
|
+
loadAreasFromNetwork: I,
|
|
14
15
|
loadCookiesFromNetwork: _,
|
|
15
16
|
onLoad: i,
|
|
16
17
|
onReady: c,
|
|
17
18
|
onSelectLayout: l,
|
|
18
|
-
storeId:
|
|
19
|
-
storeDevtoolsEnabled:
|
|
20
|
-
} = A, { events_add_listener:
|
|
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:
|
|
25
|
-
closeAllPopupsByParentId:
|
|
26
|
-
setSelectedPopupId:
|
|
27
|
-
} =
|
|
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:
|
|
33
|
+
storeId: y,
|
|
33
34
|
getLabel: s,
|
|
34
|
-
loadAreasFromNetwork:
|
|
35
|
+
loadAreasFromNetwork: I,
|
|
35
36
|
loadCookiesFromNetwork: _,
|
|
36
|
-
networkOperation:
|
|
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:
|
|
46
|
-
closeAllPopupsByParentId:
|
|
47
|
-
setSelectedPopupId:
|
|
46
|
+
bringPopupOnFront: L,
|
|
47
|
+
closeAllPopupsByParentId: N,
|
|
48
|
+
setSelectedPopupId: O
|
|
48
49
|
}
|
|
49
|
-
},
|
|
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:
|
|
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
|
|
56
|
-
|
|
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 ||
|
|
66
|
-
}, [s]), o(() => (
|
|
67
|
-
|
|
68
|
-
}), []), /* @__PURE__ */ W(
|
|
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
|
-
|
|
72
|
-
|
|
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 @@
|
|
|
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"}
|