chayns-api 3.0.0-beta.0 → 3.0.0-beta.2

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 (66) hide show
  1. package/.babelrc +14 -6
  2. package/dist/cjs/components/ChaynsProvider.js +38 -11
  3. package/dist/cjs/hooks/context.js +1 -2
  4. package/dist/cjs/hooks/geoLocationListener.js +53 -17
  5. package/dist/cjs/hooks/scrollListener.js +151 -45
  6. package/dist/cjs/hooks/useAccessToken.js +35 -11
  7. package/dist/cjs/hooks/useChaynsApiId.js +5 -2
  8. package/dist/cjs/hooks/useCurrentPage.js +7 -2
  9. package/dist/cjs/hooks/useCustomCallbackFunction.js +7 -2
  10. package/dist/cjs/hooks/useCustomData.js +7 -2
  11. package/dist/cjs/hooks/useCustomFunction.js +13 -1
  12. package/dist/cjs/hooks/useDevice.js +7 -2
  13. package/dist/cjs/hooks/useDialogState.js +42 -18
  14. package/dist/cjs/hooks/useEnvironment.js +7 -2
  15. package/dist/cjs/hooks/useFunctions.js +7 -2
  16. package/dist/cjs/hooks/useIsAdminMode.js +6 -3
  17. package/dist/cjs/hooks/useLanguage.js +7 -2
  18. package/dist/cjs/hooks/usePages.js +34 -14
  19. package/dist/cjs/hooks/useParameters.js +7 -2
  20. package/dist/cjs/hooks/useSite.js +7 -2
  21. package/dist/cjs/hooks/useStyleSettings.js +7 -2
  22. package/dist/cjs/hooks/useUser.js +7 -2
  23. package/dist/cjs/hooks/useValues.js +7 -2
  24. package/dist/cjs/hooks/windowMetricsListener.js +71 -25
  25. package/dist/cjs/host/ChaynsHost.js +141 -80
  26. package/dist/cjs/host/iframe/utils/useUpdateData.js +26 -10
  27. package/dist/cjs/host/module/ModuleHost.js +109 -37
  28. package/dist/cjs/types/IChaynsReact.js +4 -1
  29. package/dist/cjs/types/dialog.js +1 -5
  30. package/dist/esm/components/ChaynsProvider.js +38 -11
  31. package/dist/esm/components/withCompatMode.js +6 -0
  32. package/dist/esm/handler/DialogHandler.js +7 -0
  33. package/dist/esm/hooks/context.js +1 -2
  34. package/dist/esm/hooks/geoLocationListener.js +53 -17
  35. package/dist/esm/hooks/scrollListener.js +151 -45
  36. package/dist/esm/hooks/useAccessToken.js +35 -11
  37. package/dist/esm/hooks/useChaynsApiId.js +5 -2
  38. package/dist/esm/hooks/useCurrentPage.js +6 -1
  39. package/dist/esm/hooks/useCustomCallbackFunction.js +6 -1
  40. package/dist/esm/hooks/useCustomData.js +6 -1
  41. package/dist/esm/hooks/useCustomFunction.js +13 -1
  42. package/dist/esm/hooks/useDevice.js +6 -1
  43. package/dist/esm/hooks/useDialogState.js +42 -18
  44. package/dist/esm/hooks/useEnvironment.js +6 -1
  45. package/dist/esm/hooks/useFunctions.js +6 -1
  46. package/dist/esm/hooks/useIsAdminMode.js +5 -2
  47. package/dist/esm/hooks/useLanguage.js +6 -1
  48. package/dist/esm/hooks/usePages.js +34 -14
  49. package/dist/esm/hooks/useParameters.js +6 -1
  50. package/dist/esm/hooks/useSite.js +6 -1
  51. package/dist/esm/hooks/useStyleSettings.js +6 -1
  52. package/dist/esm/hooks/useUser.js +6 -1
  53. package/dist/esm/hooks/useValues.js +6 -1
  54. package/dist/esm/hooks/windowMetricsListener.js +71 -25
  55. package/dist/esm/host/ChaynsHost.js +142 -81
  56. package/dist/esm/host/iframe/utils/useUpdateData.js +26 -10
  57. package/dist/esm/host/module/ModuleHost.js +109 -37
  58. package/dist/esm/host/module/utils/loadComponent.js +4 -0
  59. package/dist/esm/types/IChaynsReact.js +4 -1
  60. package/dist/esm/wrapper/AppWrapper.js +1 -0
  61. package/dist/esm/wrapper/ModuleFederationWrapper.js +2 -0
  62. package/dist/esm/wrapper/SsrWrapper.js +4 -0
  63. package/dist/esm/wrapper/StaticChaynsApi.js +67 -0
  64. package/dist/types/types/IChaynsReact.d.ts +8 -2
  65. package/eslint.config.mjs +6 -0
  66. package/package.json +6 -6
@@ -1,2 +1,7 @@
1
1
  import { useValuesSelector } from './context';
2
- export const useCustomData = () => useValuesSelector(v => v.customData);
2
+ export const useCustomData = () => {
3
+ return useValuesSelector(_temp);
4
+ };
5
+ function _temp(v) {
6
+ return v.customData;
7
+ }
@@ -1,2 +1,14 @@
1
+ import { c as _c } from "react-compiler-runtime";
1
2
  import { useCustomFunctionsSelector } from './context';
2
- export const useCustomFunction = key => useCustomFunctionsSelector(customFunctions => customFunctions[key]);
3
+ export const useCustomFunction = key => {
4
+ const $ = _c(2);
5
+ let t0;
6
+ if ($[0] !== key) {
7
+ t0 = customFunctions => customFunctions[key];
8
+ $[0] = key;
9
+ $[1] = t0;
10
+ } else {
11
+ t0 = $[1];
12
+ }
13
+ return useCustomFunctionsSelector(t0);
14
+ };
@@ -1,2 +1,7 @@
1
1
  import { useValuesSelector } from "./context";
2
- export const useDevice = () => useValuesSelector(v => v.device);
2
+ export const useDevice = () => {
3
+ return useValuesSelector(_temp);
4
+ };
5
+ function _temp(v) {
6
+ return v.device;
7
+ }
@@ -1,22 +1,46 @@
1
+ import { c as _c } from "react-compiler-runtime";
1
2
  import { useFunctionsSelector, useValuesSelector } from './context';
2
3
  export const useDialogState = () => {
3
- const setResult = useFunctionsSelector(f => f.setDialogResult);
4
- const sendData = useFunctionsSelector(f => f.dispatchEventToDialogHost);
5
- const addDataListener = useFunctionsSelector(f => f.addDialogHostEventListener);
6
- const isClosingRequested = useValuesSelector(v => {
7
- var _v$dialog$isClosingRe, _v$dialog;
8
- return (_v$dialog$isClosingRe = (_v$dialog = v.dialog) === null || _v$dialog === void 0 ? void 0 : _v$dialog.isClosingRequested) !== null && _v$dialog$isClosingRe !== void 0 ? _v$dialog$isClosingRe : false;
9
- });
10
- return {
11
- setResult,
12
- sendData,
13
- addDataListener,
14
- isClosingRequested
15
- };
4
+ const $ = _c(5);
5
+ const setResult = useFunctionsSelector(_temp);
6
+ const sendData = useFunctionsSelector(_temp2);
7
+ const addDataListener = useFunctionsSelector(_temp3);
8
+ const isClosingRequested = useValuesSelector(_temp4);
9
+ let t0;
10
+ if ($[0] !== addDataListener || $[1] !== isClosingRequested || $[2] !== sendData || $[3] !== setResult) {
11
+ t0 = {
12
+ setResult,
13
+ sendData,
14
+ addDataListener,
15
+ isClosingRequested
16
+ };
17
+ $[0] = addDataListener;
18
+ $[1] = isClosingRequested;
19
+ $[2] = sendData;
20
+ $[3] = setResult;
21
+ $[4] = t0;
22
+ } else {
23
+ t0 = $[4];
24
+ }
25
+ return t0;
16
26
  };
17
27
  export const useDialogData = () => {
18
- return useValuesSelector(v => {
19
- var _v$dialog2;
20
- return (_v$dialog2 = v.dialog) === null || _v$dialog2 === void 0 ? void 0 : _v$dialog2.dialogInput;
21
- });
22
- };
28
+ return useValuesSelector(_temp5);
29
+ };
30
+ function _temp(f) {
31
+ return f.setDialogResult;
32
+ }
33
+ function _temp2(f_0) {
34
+ return f_0.dispatchEventToDialogHost;
35
+ }
36
+ function _temp3(f_1) {
37
+ return f_1.addDialogHostEventListener;
38
+ }
39
+ function _temp4(v) {
40
+ var _v$dialog$isClosingRe, _v$dialog;
41
+ return (_v$dialog$isClosingRe = (_v$dialog = v.dialog) === null || _v$dialog === void 0 ? void 0 : _v$dialog.isClosingRequested) !== null && _v$dialog$isClosingRe !== void 0 ? _v$dialog$isClosingRe : false;
42
+ }
43
+ function _temp5(v) {
44
+ var _v$dialog2;
45
+ return (_v$dialog2 = v.dialog) === null || _v$dialog2 === void 0 ? void 0 : _v$dialog2.dialogInput;
46
+ }
@@ -1,2 +1,7 @@
1
1
  import { useValuesSelector } from './context';
2
- export const useEnvironment = () => useValuesSelector(v => v.environment);
2
+ export const useEnvironment = () => {
3
+ return useValuesSelector(_temp);
4
+ };
5
+ function _temp(v) {
6
+ return v.environment;
7
+ }
@@ -1,2 +1,7 @@
1
1
  import { useFunctionsSelector } from './context';
2
- export const useFunctions = () => useFunctionsSelector(f => f);
2
+ export const useFunctions = () => {
3
+ return useFunctionsSelector(_temp);
4
+ };
5
+ function _temp(f) {
6
+ return f;
7
+ }
@@ -1,5 +1,8 @@
1
1
  import { useValuesSelector } from './context';
2
- export const useIsAdminMode = () => useValuesSelector(v => {
2
+ export const useIsAdminMode = () => {
3
+ return useValuesSelector(_temp);
4
+ };
5
+ function _temp(v) {
3
6
  var _v$isAdminModeActive;
4
7
  return (_v$isAdminModeActive = v.isAdminModeActive) !== null && _v$isAdminModeActive !== void 0 ? _v$isAdminModeActive : false;
5
- });
8
+ }
@@ -1,2 +1,7 @@
1
1
  import { useValuesSelector } from './context';
2
- export const useLanguage = () => useValuesSelector(v => v.language);
2
+ export const useLanguage = () => {
3
+ return useValuesSelector(_temp);
4
+ };
5
+ function _temp(v) {
6
+ return v.language;
7
+ }
@@ -1,24 +1,38 @@
1
+ import { c as _c } from "react-compiler-runtime";
1
2
  import { moduleWrapper } from '../components/moduleWrapper';
2
3
  import { useValuesSelector } from './context';
3
- export const usePages = ({
4
- siteId
5
- } = {
6
- siteId: undefined
7
- }) => {
8
- const pages = useValuesSelector(v => v.pages);
4
+ export const usePages = t0 => {
5
+ const {
6
+ siteId
7
+ } = t0 === undefined ? {
8
+ siteId: undefined
9
+ } : t0;
10
+ const pages = useValuesSelector(_temp);
9
11
  if (siteId) {
10
12
  pages.filter(tapp => tapp.siteId === siteId);
11
13
  }
12
14
  return pages;
13
15
  };
14
- export const usePage = ({
15
- id,
16
- siteId
17
- }) => {
18
- const pages = useValuesSelector(v => v.pages);
16
+ export const usePage = t0 => {
17
+ const $ = _c(4);
18
+ const {
19
+ id,
20
+ siteId
21
+ } = t0;
22
+ const pages = useValuesSelector(_temp2);
19
23
  if (id) {
20
- var _pages$find;
21
- return (_pages$find = pages.find(x => x.id === id && (!siteId || x.siteId === siteId))) !== null && _pages$find !== void 0 ? _pages$find : null;
24
+ let t1;
25
+ if ($[0] !== id || $[1] !== pages || $[2] !== siteId) {
26
+ var _pages$find;
27
+ t1 = (_pages$find = pages.find(x => x.id === id && (!siteId || x.siteId === siteId))) !== null && _pages$find !== void 0 ? _pages$find : null;
28
+ $[0] = id;
29
+ $[1] = pages;
30
+ $[2] = siteId;
31
+ $[3] = t1;
32
+ } else {
33
+ t1 = $[3];
34
+ }
35
+ return t1;
22
36
  }
23
37
  return null;
24
38
  };
@@ -39,4 +53,10 @@ export const getPage = ({
39
53
  return (_pages$find2 = pages.find(x => x.id === id && (!siteId || x.siteId === siteId))) !== null && _pages$find2 !== void 0 ? _pages$find2 : null;
40
54
  }
41
55
  return (_pages$find3 = pages.find(x => x.id === currentPage.id && x.siteId === currentPage.siteId || !x.siteId)) !== null && _pages$find3 !== void 0 ? _pages$find3 : null;
42
- };
56
+ };
57
+ function _temp(v) {
58
+ return v.pages;
59
+ }
60
+ function _temp2(v) {
61
+ return v.pages;
62
+ }
@@ -1,2 +1,7 @@
1
1
  import { useValuesSelector } from './context';
2
- export const useParameters = () => useValuesSelector(v => v.parameters);
2
+ export const useParameters = () => {
3
+ return useValuesSelector(_temp);
4
+ };
5
+ function _temp(v) {
6
+ return v.parameters;
7
+ }
@@ -1,2 +1,7 @@
1
1
  import { useValuesSelector } from './context';
2
- export const useSite = () => useValuesSelector(v => v.site);
2
+ export const useSite = () => {
3
+ return useValuesSelector(_temp);
4
+ };
5
+ function _temp(v) {
6
+ return v.site;
7
+ }
@@ -1,2 +1,7 @@
1
1
  import { useValuesSelector } from './context';
2
- export const useStyleSettings = () => useValuesSelector(state => state.styleSettings);
2
+ export const useStyleSettings = () => {
3
+ return useValuesSelector(_temp);
4
+ };
5
+ function _temp(state) {
6
+ return state.styleSettings;
7
+ }
@@ -1,3 +1,8 @@
1
1
  import { useValuesSelector } from './context';
2
2
  const empty = {};
3
- export const useUser = () => useValuesSelector(v => v.user || empty);
3
+ export const useUser = () => {
4
+ return useValuesSelector(_temp);
5
+ };
6
+ function _temp(v) {
7
+ return v.user || empty;
8
+ }
@@ -1,2 +1,7 @@
1
1
  import { useValuesSelector } from './context';
2
- export const useValues = () => useValuesSelector(v => v);
2
+ export const useValues = () => {
3
+ return useValuesSelector(_temp);
4
+ };
5
+ function _temp(v) {
6
+ return v;
7
+ }
@@ -1,3 +1,4 @@
1
+ import { c as _c } from "react-compiler-runtime";
1
2
  import { useCallback, useEffect, useRef, useState } from 'react';
2
3
  import { ScreenSize } from '../types/IChaynsReact';
3
4
  import { useFunctionsSelector } from './context';
@@ -13,30 +14,75 @@ export const useWindowMetricsListener = () => {
13
14
  };
14
15
  }, []);
15
16
  };
16
- export const useWindowMetrics = ({
17
- enabled = true
18
- } = {}) => {
19
- const [value, setValue] = useState({
20
- bottomBarHeight: 0,
21
- offsetTop: 0,
22
- pageHeight: 0,
23
- pageWidth: 0,
24
- topBarHeight: 0,
25
- windowHeight: 0,
26
- pageSize: ScreenSize.XS
27
- });
17
+ export const useWindowMetrics = t0 => {
18
+ const $ = _c(10);
19
+ let t1;
20
+ if ($[0] !== t0) {
21
+ t1 = t0 === undefined ? {} : t0;
22
+ $[0] = t0;
23
+ $[1] = t1;
24
+ } else {
25
+ t1 = $[1];
26
+ }
27
+ const {
28
+ enabled: t2
29
+ } = t1;
30
+ const enabled = t2 === undefined ? true : t2;
31
+ let t3;
32
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
33
+ t3 = {
34
+ bottomBarHeight: 0,
35
+ offsetTop: 0,
36
+ pageHeight: 0,
37
+ pageWidth: 0,
38
+ topBarHeight: 0,
39
+ windowHeight: 0,
40
+ pageSize: ScreenSize.XS
41
+ };
42
+ $[2] = t3;
43
+ } else {
44
+ t3 = $[2];
45
+ }
46
+ const [value, setValue] = useState(t3);
28
47
  const addListener = useWindowMetricsListener();
29
- const getWindowMetrics = useFunctionsSelector(f => f.getWindowMetrics);
30
- useEffect(() => {
31
- if (enabled) {
32
- return addListener(v => {
33
- setValue(v);
34
- });
35
- }
36
- return undefined;
37
- }, [enabled, addListener]);
38
- useEffect(() => {
39
- void getWindowMetrics().then(setValue);
40
- }, [getWindowMetrics]);
48
+ const getWindowMetrics = useFunctionsSelector(_temp);
49
+ let t4;
50
+ let t5;
51
+ if ($[3] !== addListener || $[4] !== enabled) {
52
+ t4 = () => {
53
+ if (enabled) {
54
+ return addListener(v => {
55
+ setValue(v);
56
+ });
57
+ }
58
+ };
59
+ t5 = [enabled, addListener];
60
+ $[3] = addListener;
61
+ $[4] = enabled;
62
+ $[5] = t4;
63
+ $[6] = t5;
64
+ } else {
65
+ t4 = $[5];
66
+ t5 = $[6];
67
+ }
68
+ useEffect(t4, t5);
69
+ let t6;
70
+ let t7;
71
+ if ($[7] !== getWindowMetrics) {
72
+ t6 = () => {
73
+ getWindowMetrics().then(setValue);
74
+ };
75
+ t7 = [getWindowMetrics];
76
+ $[7] = getWindowMetrics;
77
+ $[8] = t6;
78
+ $[9] = t7;
79
+ } else {
80
+ t6 = $[8];
81
+ t7 = $[9];
82
+ }
83
+ useEffect(t6, t7);
41
84
  return value;
42
- };
85
+ };
86
+ function _temp(f) {
87
+ return f.getWindowMetrics;
88
+ }
@@ -1,90 +1,151 @@
1
- import React, { startTransition, useEffect, useState } from 'react';
1
+ import { c as _c } from "react-compiler-runtime";
2
+ import React, { useDeferredValue, useSyncExternalStore } from 'react';
2
3
  import HostIframe from './iframe/HostIframe';
3
4
  import ModuleHost from './module/ModuleHost';
4
- const ChaynsHost = ({
5
- type,
6
- iFrameProps,
7
- functions,
8
- customFunctions,
9
- src,
10
- iFrameRef = undefined,
11
- loadingComponent = undefined,
12
- system,
13
- pages,
14
- language,
15
- isAdminModeActive,
16
- site,
17
- user,
18
- currentPage,
19
- device,
20
- parameters,
21
- customData,
22
- environment,
23
- preventStagingReplacement,
24
- dialog,
25
- styleSettings
26
- }) => {
27
- const [isVisible, setIsVisible] = useState(type !== 'client-module' && (type !== 'server-module' || !!(system !== null && system !== void 0 && system.serverUrl)));
28
- useEffect(() => {
29
- if (isVisible) return;
30
- if (typeof startTransition === 'function') {
31
- startTransition(() => {
32
- setIsVisible(true);
33
- });
34
- } else {
35
- setIsVisible(true);
36
- }
37
- }, []);
5
+ const subscribeToHydration = () => () => {};
6
+ const ChaynsHost = t0 => {
7
+ const $ = _c(38);
8
+ const {
9
+ type,
10
+ iFrameProps,
11
+ functions,
12
+ customFunctions,
13
+ src,
14
+ iFrameRef: t1,
15
+ loadingComponent: t2,
16
+ system,
17
+ pages,
18
+ language,
19
+ isAdminModeActive,
20
+ site,
21
+ user,
22
+ currentPage,
23
+ device,
24
+ parameters,
25
+ customData,
26
+ environment,
27
+ preventStagingReplacement,
28
+ dialog,
29
+ styleSettings
30
+ } = t0;
31
+ const iFrameRef = t1 === undefined ? undefined : t1;
32
+ const loadingComponent = t2 === undefined ? undefined : t2;
33
+ const isInitiallyVisible = type !== "client-module" && (type !== "server-module" || !!(system !== null && system !== void 0 && system.serverUrl));
34
+ const isHydrated = useSyncExternalStore(subscribeToHydration, _temp, _temp2);
35
+ const isVisible = useDeferredValue(isInitiallyVisible || isHydrated);
38
36
  if (!isVisible) {
39
37
  return null;
40
38
  }
41
39
  switch (type) {
42
- case 'client-iframe':
43
- case 'server-iframe':
44
- return React.createElement(HostIframe, {
45
- iFrameRef: iFrameRef,
46
- iFrameProps: iFrameProps,
47
- pages: pages,
48
- isAdminModeActive: isAdminModeActive,
49
- site: site,
50
- user: user,
51
- device: device,
52
- currentPage: currentPage,
53
- functions: functions,
54
- customFunctions: customFunctions,
55
- src: src,
56
- postForm: type === 'server-iframe',
57
- language: language,
58
- parameters: parameters,
59
- environment: environment,
60
- customData: customData,
61
- preventStagingReplacement: preventStagingReplacement,
62
- dialog: dialog,
63
- styleSettings: styleSettings
64
- });
65
- case 'client-module':
66
- case 'server-module':
67
- return React.createElement(ModuleHost, {
68
- system: system,
69
- pages: pages,
70
- isAdminModeActive: isAdminModeActive,
71
- site: site,
72
- user: user,
73
- device: device,
74
- currentPage: currentPage,
75
- children: loadingComponent,
76
- functions: functions,
77
- customFunctions: customFunctions,
78
- language: language,
79
- parameters: parameters,
80
- customData: customData,
81
- environment: environment,
82
- preventStagingReplacement: preventStagingReplacement,
83
- dialog: dialog,
84
- styleSettings: styleSettings
85
- });
40
+ case "client-iframe":
41
+ case "server-iframe":
42
+ {
43
+ const t3 = type === "server-iframe";
44
+ let t4;
45
+ if ($[0] !== currentPage || $[1] !== customData || $[2] !== customFunctions || $[3] !== device || $[4] !== dialog || $[5] !== environment || $[6] !== functions || $[7] !== iFrameProps || $[8] !== iFrameRef || $[9] !== isAdminModeActive || $[10] !== language || $[11] !== pages || $[12] !== parameters || $[13] !== preventStagingReplacement || $[14] !== site || $[15] !== src || $[16] !== styleSettings || $[17] !== t3 || $[18] !== user) {
46
+ t4 = React.createElement(HostIframe, {
47
+ iFrameRef: iFrameRef,
48
+ iFrameProps: iFrameProps,
49
+ pages: pages,
50
+ isAdminModeActive: isAdminModeActive,
51
+ site: site,
52
+ user: user,
53
+ device: device,
54
+ currentPage: currentPage,
55
+ functions: functions,
56
+ customFunctions: customFunctions,
57
+ src: src,
58
+ postForm: t3,
59
+ language: language,
60
+ parameters: parameters,
61
+ environment: environment,
62
+ customData: customData,
63
+ preventStagingReplacement: preventStagingReplacement,
64
+ dialog: dialog,
65
+ styleSettings: styleSettings
66
+ });
67
+ $[0] = currentPage;
68
+ $[1] = customData;
69
+ $[2] = customFunctions;
70
+ $[3] = device;
71
+ $[4] = dialog;
72
+ $[5] = environment;
73
+ $[6] = functions;
74
+ $[7] = iFrameProps;
75
+ $[8] = iFrameRef;
76
+ $[9] = isAdminModeActive;
77
+ $[10] = language;
78
+ $[11] = pages;
79
+ $[12] = parameters;
80
+ $[13] = preventStagingReplacement;
81
+ $[14] = site;
82
+ $[15] = src;
83
+ $[16] = styleSettings;
84
+ $[17] = t3;
85
+ $[18] = user;
86
+ $[19] = t4;
87
+ } else {
88
+ t4 = $[19];
89
+ }
90
+ return t4;
91
+ }
92
+ case "client-module":
93
+ case "server-module":
94
+ {
95
+ let t3;
96
+ if ($[20] !== currentPage || $[21] !== customData || $[22] !== customFunctions || $[23] !== device || $[24] !== dialog || $[25] !== environment || $[26] !== functions || $[27] !== isAdminModeActive || $[28] !== language || $[29] !== loadingComponent || $[30] !== pages || $[31] !== parameters || $[32] !== preventStagingReplacement || $[33] !== site || $[34] !== styleSettings || $[35] !== system || $[36] !== user) {
97
+ t3 = React.createElement(ModuleHost, {
98
+ system: system,
99
+ pages: pages,
100
+ isAdminModeActive: isAdminModeActive,
101
+ site: site,
102
+ user: user,
103
+ device: device,
104
+ currentPage: currentPage,
105
+ children: loadingComponent,
106
+ functions: functions,
107
+ customFunctions: customFunctions,
108
+ language: language,
109
+ parameters: parameters,
110
+ customData: customData,
111
+ environment: environment,
112
+ preventStagingReplacement: preventStagingReplacement,
113
+ dialog: dialog,
114
+ styleSettings: styleSettings
115
+ });
116
+ $[20] = currentPage;
117
+ $[21] = customData;
118
+ $[22] = customFunctions;
119
+ $[23] = device;
120
+ $[24] = dialog;
121
+ $[25] = environment;
122
+ $[26] = functions;
123
+ $[27] = isAdminModeActive;
124
+ $[28] = language;
125
+ $[29] = loadingComponent;
126
+ $[30] = pages;
127
+ $[31] = parameters;
128
+ $[32] = preventStagingReplacement;
129
+ $[33] = site;
130
+ $[34] = styleSettings;
131
+ $[35] = system;
132
+ $[36] = user;
133
+ $[37] = t3;
134
+ } else {
135
+ t3 = $[37];
136
+ }
137
+ return t3;
138
+ }
86
139
  default:
87
- return null;
140
+ {
141
+ return null;
142
+ }
88
143
  }
89
144
  };
90
- export default ChaynsHost;
145
+ export default ChaynsHost;
146
+ function _temp() {
147
+ return true;
148
+ }
149
+ function _temp2() {
150
+ return false;
151
+ }
@@ -1,14 +1,30 @@
1
+ import { c as _c } from "react-compiler-runtime";
1
2
  import { useEffect } from 'react';
2
3
  const useUpdateData = (target, type, value) => {
3
- useEffect(() => {
4
- if (target) {
5
- target.dispatchEvent(new CustomEvent('data_update', {
6
- detail: {
7
- type,
8
- value
9
- }
10
- }));
11
- }
12
- }, [target, type, value]);
4
+ const $ = _c(5);
5
+ let t0;
6
+ let t1;
7
+ if ($[0] !== target || $[1] !== type || $[2] !== value) {
8
+ t0 = () => {
9
+ if (target) {
10
+ target.dispatchEvent(new CustomEvent("data_update", {
11
+ detail: {
12
+ type,
13
+ value
14
+ }
15
+ }));
16
+ }
17
+ };
18
+ t1 = [target, type, value];
19
+ $[0] = target;
20
+ $[1] = type;
21
+ $[2] = value;
22
+ $[3] = t0;
23
+ $[4] = t1;
24
+ } else {
25
+ t0 = $[3];
26
+ t1 = $[4];
27
+ }
28
+ useEffect(t0, t1);
13
29
  };
14
30
  export default useUpdateData;