chayns-api 2.1.3-3 → 2.1.5

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 (188) hide show
  1. package/.babelrc +31 -30
  2. package/.eslintrc +17 -17
  3. package/.github/workflows/deploy_docs.yml +28 -28
  4. package/.github/workflows/publish.yml +21 -21
  5. package/LICENSE +21 -21
  6. package/README.md +67 -67
  7. package/dist/cjs/calls/dialogs/chaynsDialog.js +0 -2
  8. package/dist/cjs/calls/dialogs/communication.js +0 -2
  9. package/dist/cjs/calls/dialogs/confirm.js +0 -1
  10. package/dist/cjs/calls/dialogs/date.js +0 -50
  11. package/dist/cjs/calls/dialogs/iFrame.js +1 -1
  12. package/dist/cjs/calls/index.js +1 -162
  13. package/dist/cjs/calls/sendMessage.js +0 -12
  14. package/dist/cjs/calls/visibilityChangeListener.js +0 -7
  15. package/dist/cjs/components/AppDialogWrapper.js +3 -3
  16. package/dist/cjs/components/ChaynsContext.js +1 -1
  17. package/dist/cjs/components/ChaynsProvider.js +6 -10
  18. package/dist/cjs/components/ErrorBoundary.js +1 -1
  19. package/dist/cjs/components/WaitUntil.js +0 -2
  20. package/dist/cjs/components/withCompatMode.js +9 -13
  21. package/dist/cjs/components/withHydrationBoundary.js +2 -2
  22. package/dist/cjs/constants/hydrationContext.js +1 -3
  23. package/dist/cjs/constants/languages.js +1 -1
  24. package/dist/cjs/handler/DialogHandler.js +0 -4
  25. package/dist/cjs/hooks/geoLocationListener.js +0 -7
  26. package/dist/cjs/hooks/scrollListener.js +0 -14
  27. package/dist/cjs/hooks/useAccessToken.js +0 -4
  28. package/dist/cjs/hooks/useCurrentPage.js +0 -3
  29. package/dist/cjs/hooks/useCustomCallbackFunction.js +0 -4
  30. package/dist/cjs/hooks/useCustomData.js +0 -3
  31. package/dist/cjs/hooks/useDevice.js +0 -3
  32. package/dist/cjs/hooks/useDialogState.js +0 -7
  33. package/dist/cjs/hooks/useEnvironment.js +0 -3
  34. package/dist/cjs/hooks/useFunctions.js +0 -3
  35. package/dist/cjs/hooks/useIsAdminMode.js +0 -3
  36. package/dist/cjs/hooks/useLanguage.js +0 -3
  37. package/dist/cjs/hooks/usePages.js +0 -6
  38. package/dist/cjs/hooks/useParameters.js +0 -3
  39. package/dist/cjs/hooks/useSite.js +0 -3
  40. package/dist/cjs/hooks/useUser.js +0 -3
  41. package/dist/cjs/hooks/useValues.js +0 -3
  42. package/dist/cjs/hooks/windowMetricsListener.js +0 -7
  43. package/dist/cjs/host/ChaynsHost.js +3 -4
  44. package/dist/cjs/host/iframe/HostIframe.js +4 -23
  45. package/dist/cjs/host/module/ModuleHost.js +5 -9
  46. package/dist/cjs/host/module/utils/loadComponent.js +4 -5
  47. package/dist/cjs/index.js +1 -1
  48. package/dist/cjs/types/IChaynsReact.js +39 -46
  49. package/dist/cjs/util/appCall.js +0 -2
  50. package/dist/cjs/util/deviceHelper.js +0 -4
  51. package/dist/cjs/util/heightHelper.js +1 -1
  52. package/dist/cjs/util/initModuleFederationSharing.js +2 -6
  53. package/dist/cjs/util/postIframeForm.js +0 -1
  54. package/dist/cjs/util/transferNestedFunctions.js +0 -3
  55. package/dist/cjs/wrapper/AppWrapper.js +6 -20
  56. package/dist/cjs/wrapper/FrameWrapper.js +2 -7
  57. package/dist/cjs/wrapper/ModuleFederationWrapper.js +1 -3
  58. package/dist/cjs/wrapper/StaticChaynsApi.js +1 -1
  59. package/dist/esm/calls/dialogs/chaynsDialog.js +0 -2
  60. package/dist/esm/calls/dialogs/communication.js +0 -2
  61. package/dist/esm/calls/dialogs/confirm.js +0 -1
  62. package/dist/esm/calls/dialogs/date.js +0 -51
  63. package/dist/esm/calls/dialogs/iFrame.js +1 -1
  64. package/dist/esm/calls/index.js +1 -162
  65. package/dist/esm/calls/sendMessage.js +0 -12
  66. package/dist/esm/calls/visibilityChangeListener.js +0 -7
  67. package/dist/esm/components/AppDialogWrapper.js +2 -2
  68. package/dist/esm/components/ChaynsContext.js +1 -1
  69. package/dist/esm/components/ChaynsProvider.js +5 -10
  70. package/dist/esm/components/WaitUntil.js +0 -2
  71. package/dist/esm/components/withCompatMode.js +8 -14
  72. package/dist/esm/components/withHydrationBoundary.js +2 -2
  73. package/dist/esm/constants/hydrationContext.js +1 -3
  74. package/dist/esm/constants/languages.js +1 -1
  75. package/dist/esm/handler/DialogHandler.js +1 -5
  76. package/dist/esm/hooks/geoLocationListener.js +0 -7
  77. package/dist/esm/hooks/scrollListener.js +0 -14
  78. package/dist/esm/hooks/useAccessToken.js +0 -5
  79. package/dist/esm/hooks/useCurrentPage.js +0 -4
  80. package/dist/esm/hooks/useCustomCallbackFunction.js +0 -5
  81. package/dist/esm/hooks/useCustomData.js +0 -4
  82. package/dist/esm/hooks/useDevice.js +0 -3
  83. package/dist/esm/hooks/useDialogState.js +0 -8
  84. package/dist/esm/hooks/useEnvironment.js +0 -3
  85. package/dist/esm/hooks/useFunctions.js +0 -4
  86. package/dist/esm/hooks/useIsAdminMode.js +0 -3
  87. package/dist/esm/hooks/useLanguage.js +0 -3
  88. package/dist/esm/hooks/usePages.js +0 -6
  89. package/dist/esm/hooks/useParameters.js +0 -3
  90. package/dist/esm/hooks/useSite.js +0 -3
  91. package/dist/esm/hooks/useUser.js +0 -3
  92. package/dist/esm/hooks/useValues.js +0 -4
  93. package/dist/esm/hooks/windowMetricsListener.js +0 -7
  94. package/dist/esm/host/ChaynsHost.js +2 -3
  95. package/dist/esm/host/iframe/HostIframe.js +3 -22
  96. package/dist/esm/host/module/ModuleHost.js +4 -8
  97. package/dist/esm/host/module/utils/loadComponent.js +3 -4
  98. package/dist/esm/types/IChaynsReact.js +39 -49
  99. package/dist/esm/util/appCall.js +0 -2
  100. package/dist/esm/util/deviceHelper.js +0 -4
  101. package/dist/esm/util/initModuleFederationSharing.js +1 -5
  102. package/dist/esm/util/postIframeForm.js +0 -1
  103. package/dist/esm/util/transferNestedFunctions.js +0 -2
  104. package/dist/esm/wrapper/AppWrapper.js +6 -20
  105. package/dist/esm/wrapper/FrameWrapper.js +2 -6
  106. package/dist/esm/wrapper/ModuleFederationWrapper.js +1 -3
  107. package/dist/esm/wrapper/SsrWrapper.js +1 -1
  108. package/dist/esm/wrapper/StaticChaynsApi.js +1 -1
  109. package/dist/types/calls/dialogs/alert.d.ts +1 -1
  110. package/dist/types/calls/dialogs/chaynsDialog.d.ts +24 -24
  111. package/dist/types/calls/dialogs/close.d.ts +1 -1
  112. package/dist/types/calls/dialogs/communication.d.ts +3 -3
  113. package/dist/types/calls/dialogs/confirm.d.ts +13 -13
  114. package/dist/types/calls/dialogs/date.d.ts +96 -96
  115. package/dist/types/calls/dialogs/dropUpAlert.d.ts +5 -5
  116. package/dist/types/calls/dialogs/fileSelect.d.ts +16 -16
  117. package/dist/types/calls/dialogs/iFrame.d.ts +10 -10
  118. package/dist/types/calls/dialogs/index.d.ts +14 -14
  119. package/dist/types/calls/dialogs/input.d.ts +15 -15
  120. package/dist/types/calls/dialogs/mediaSelect.d.ts +8 -8
  121. package/dist/types/calls/dialogs/open.d.ts +1 -1
  122. package/dist/types/calls/dialogs/select.d.ts +6 -6
  123. package/dist/types/calls/dialogs/signature.d.ts +7 -7
  124. package/dist/types/calls/dialogs/toast.d.ts +1 -1
  125. package/dist/types/calls/dialogs/utils/callback.d.ts +1 -1
  126. package/dist/types/calls/dialogs/utils/is.d.ts +4 -4
  127. package/dist/types/calls/getUserInfo.d.ts +9 -9
  128. package/dist/types/calls/index.d.ts +255 -255
  129. package/dist/types/calls/sendMessage.d.ts +13 -13
  130. package/dist/types/calls/visibilityChangeListener.d.ts +9 -9
  131. package/dist/types/components/AppDialogWrapper.d.ts +5 -5
  132. package/dist/types/components/ChaynsContext.d.ts +3 -3
  133. package/dist/types/components/ChaynsProvider.d.ts +11 -11
  134. package/dist/types/components/ErrorBoundary.d.ts +13 -13
  135. package/dist/types/components/WaitUntil.d.ts +7 -7
  136. package/dist/types/components/moduleWrapper.d.ts +4 -4
  137. package/dist/types/components/withCompatMode.d.ts +43 -43
  138. package/dist/types/components/withHydrationBoundary.d.ts +24 -24
  139. package/dist/types/constants/hydrationContext.d.ts +6 -6
  140. package/dist/types/constants/index.d.ts +1 -1
  141. package/dist/types/constants/languages.d.ts +12 -12
  142. package/dist/types/handler/DialogHandler.d.ts +24 -24
  143. package/dist/types/helper/apiListenerHelper.d.ts +6 -6
  144. package/dist/types/hooks/context.d.ts +3 -3
  145. package/dist/types/hooks/geoLocationListener.d.ts +18 -18
  146. package/dist/types/hooks/index.d.ts +18 -18
  147. package/dist/types/hooks/scrollListener.d.ts +28 -28
  148. package/dist/types/hooks/useAccessToken.d.ts +6 -6
  149. package/dist/types/hooks/useCurrentPage.d.ts +5 -5
  150. package/dist/types/hooks/useCustomCallbackFunction.d.ts +5 -5
  151. package/dist/types/hooks/useCustomData.d.ts +4 -4
  152. package/dist/types/hooks/useDevice.d.ts +5 -5
  153. package/dist/types/hooks/useDialogState.d.ts +9 -9
  154. package/dist/types/hooks/useEnvironment.d.ts +5 -5
  155. package/dist/types/hooks/useFunctions.d.ts +4 -4
  156. package/dist/types/hooks/useIsAdminMode.d.ts +4 -4
  157. package/dist/types/hooks/useLanguage.d.ts +5 -5
  158. package/dist/types/hooks/usePages.d.ts +18 -18
  159. package/dist/types/hooks/useParameters.d.ts +5 -5
  160. package/dist/types/hooks/useSite.d.ts +5 -5
  161. package/dist/types/hooks/useUser.d.ts +5 -5
  162. package/dist/types/hooks/useValues.d.ts +4 -4
  163. package/dist/types/hooks/windowMetricsListener.d.ts +11 -11
  164. package/dist/types/host/ChaynsHost.d.ts +29 -29
  165. package/dist/types/host/iframe/HostIframe.d.ts +26 -26
  166. package/dist/types/host/iframe/utils/useUpdateData.d.ts +3 -3
  167. package/dist/types/host/module/ModuleHost.d.ts +28 -28
  168. package/dist/types/host/module/utils/loadComponent.d.ts +3 -3
  169. package/dist/types/index.d.ts +20 -20
  170. package/dist/types/types/IChaynsReact.d.ts +898 -899
  171. package/dist/types/types/dialog.d.ts +41 -41
  172. package/dist/types/util/appCall.d.ts +2 -2
  173. package/dist/types/util/bindChaynsApi.d.ts +1 -1
  174. package/dist/types/util/deviceHelper.d.ts +9 -9
  175. package/dist/types/util/heightHelper.d.ts +1 -1
  176. package/dist/types/util/initModuleFederationSharing.d.ts +3 -3
  177. package/dist/types/util/is.d.ts +5 -5
  178. package/dist/types/util/postIframeForm.d.ts +1 -1
  179. package/dist/types/util/transferNestedFunctions.d.ts +1 -1
  180. package/dist/types/util/url.d.ts +1 -1
  181. package/dist/types/wrapper/AppWrapper.d.ts +22 -22
  182. package/dist/types/wrapper/FrameWrapper.d.ts +18 -18
  183. package/dist/types/wrapper/ModuleFederationWrapper.d.ts +13 -13
  184. package/dist/types/wrapper/SsrWrapper.d.ts +14 -14
  185. package/dist/types/wrapper/StaticChaynsApi.d.ts +16 -16
  186. package/package.json +88 -88
  187. package/toolkit.config.js +20 -20
  188. package/tsconfig.json +56 -56
@@ -1,41 +1,41 @@
1
- export interface DialogTextBlock {
2
- headline: string;
3
- text: string;
4
- position: number;
5
- }
6
- export interface WeekDayIntervalObject {
7
- start: number;
8
- end: number;
9
- }
10
- export interface IntervalItem {
11
- start: Date | number;
12
- end: Date | number;
13
- }
14
- export interface SelectDialogItem {
15
- name: string;
16
- value: string | number | Record<string, any> | boolean;
17
- backgroundColor?: string;
18
- className?: string;
19
- url?: string;
20
- isSelected?: boolean;
21
- icon?: string;
22
- }
23
- export interface DialogButtonOld {
24
- text: buttonText | string;
25
- buttonType: buttonType | number;
26
- collapseTime?: number;
27
- textColor?: string;
28
- backgroundColor?: string;
29
- }
30
- declare enum buttonType {
31
- CANCEL = -1,
32
- NEGATIVE = 0,
33
- POSITIVE = 1
34
- }
35
- declare enum buttonText {
36
- CANCEL = "Abbrechen",
37
- NO = "Nein",
38
- OK = "OK",
39
- YES = "Ja"
40
- }
41
- export {};
1
+ export interface DialogTextBlock {
2
+ headline: string;
3
+ text: string;
4
+ position: number;
5
+ }
6
+ export interface WeekDayIntervalObject {
7
+ start: number;
8
+ end: number;
9
+ }
10
+ export interface IntervalItem {
11
+ start: Date | number;
12
+ end: Date | number;
13
+ }
14
+ export interface SelectDialogItem {
15
+ name: string;
16
+ value: string | number | Record<string, any> | boolean;
17
+ backgroundColor?: string;
18
+ className?: string;
19
+ url?: string;
20
+ isSelected?: boolean;
21
+ icon?: string;
22
+ }
23
+ export interface DialogButtonOld {
24
+ text: buttonText | string;
25
+ buttonType: buttonType | number;
26
+ collapseTime?: number;
27
+ textColor?: string;
28
+ backgroundColor?: string;
29
+ }
30
+ declare enum buttonType {
31
+ CANCEL = -1,
32
+ NEGATIVE = 0,
33
+ POSITIVE = 1
34
+ }
35
+ declare enum buttonText {
36
+ CANCEL = "Abbrechen",
37
+ NO = "Nein",
38
+ OK = "OK",
39
+ YES = "Ja"
40
+ }
41
+ export {};
@@ -1,2 +1,2 @@
1
- declare const invokeAppCall: (call: any) => void;
2
- export default invokeAppCall;
1
+ declare const invokeAppCall: (call: any) => void;
2
+ export default invokeAppCall;
@@ -1 +1 @@
1
- export declare const bindChaynsApi: (fun: any) => (values: any, functions: any) => any;
1
+ export declare const bindChaynsApi: (fun: any) => (values: any, functions: any) => any;
@@ -1,9 +1,9 @@
1
- import { ChaynsApiDevice, ScreenSize } from '../types/IChaynsReact';
2
- declare const getDeviceInfo: (userAgent: string, acceptHeader: string, { imei }?: {
3
- imei?: string | undefined;
4
- }) => ChaynsApiDevice;
5
- export declare const getClientDeviceInfo: () => {
6
- isTouch: boolean;
7
- };
8
- export declare const getScreenSize: (width: any) => ScreenSize;
9
- export default getDeviceInfo;
1
+ import { ChaynsApiDevice, ScreenSize } from '../types/IChaynsReact';
2
+ declare const getDeviceInfo: (userAgent: string, acceptHeader: string, { imei }?: {
3
+ imei?: string | undefined;
4
+ }) => ChaynsApiDevice;
5
+ export declare const getClientDeviceInfo: () => {
6
+ isTouch: boolean;
7
+ };
8
+ export declare const getScreenSize: (width: any) => ScreenSize;
9
+ export default getDeviceInfo;
@@ -1 +1 @@
1
- export declare const setTappHeight: (setHeight: (height: number) => Promise<void>) => void;
1
+ export declare const setTappHeight: (setHeight: (height: number) => Promise<void>) => void;
@@ -1,3 +1,3 @@
1
- export declare const initModuleFederationSharing: ({ name }: {
2
- name: any;
3
- }) => void;
1
+ export declare const initModuleFederationSharing: ({ name }: {
2
+ name: any;
3
+ }) => void;
@@ -1,5 +1,5 @@
1
- export declare const isApp: () => boolean;
2
- export declare const isAppCallSupported: ({ minAndroidVersion, minIOSVersion }: {
3
- minAndroidVersion?: number | undefined;
4
- minIOSVersion?: number | undefined;
5
- }) => boolean;
1
+ export declare const isApp: () => boolean;
2
+ export declare const isAppCallSupported: ({ minAndroidVersion, minIOSVersion }: {
3
+ minAndroidVersion?: number | undefined;
4
+ minIOSVersion?: number | undefined;
5
+ }) => boolean;
@@ -1 +1 @@
1
- export default function postIframeForm(url: string, value: string, fieldName: string, frameId: string): Promise<boolean>;
1
+ export default function postIframeForm(url: string, value: string, fieldName: string, frameId: string): Promise<boolean>;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export declare const replaceStagingUrl: (prevent: any, url: any, environment: any) => any;
1
+ export declare const replaceStagingUrl: (prevent: any, url: any, environment: any) => any;
@@ -1,22 +1,22 @@
1
- import { ChaynsReactFunctions, ChaynsReactValues, CleanupCallback, DataChangeCallback, IChaynsReact } from '../types/IChaynsReact';
2
- export declare class AppWrapper implements IChaynsReact {
3
- values: ChaynsReactValues;
4
- accessToken: string;
5
- listeners: (() => void)[];
6
- mapOldApiToNew(retVal: any): ChaynsReactValues;
7
- constructor();
8
- notImplemented(call: string): void;
9
- counter: number;
10
- appCall(action: any, value?: unknown, { callback, awaitResult }?: {
11
- callback: any;
12
- awaitResult?: boolean | undefined;
13
- }): Promise<unknown> | undefined;
14
- functions: ChaynsReactFunctions;
15
- private dialogs;
16
- init(): Promise<undefined>;
17
- getSSRData(): null;
18
- addDataListener(cb: DataChangeCallback): CleanupCallback;
19
- subscribe: (listener: () => void) => () => void;
20
- emitChange: () => void;
21
- getInitialData(): ChaynsReactValues;
22
- }
1
+ import { ChaynsReactFunctions, ChaynsReactValues, CleanupCallback, DataChangeCallback, IChaynsReact } from '../types/IChaynsReact';
2
+ export declare class AppWrapper implements IChaynsReact {
3
+ values: ChaynsReactValues;
4
+ accessToken: string;
5
+ listeners: (() => void)[];
6
+ mapOldApiToNew(retVal: any): ChaynsReactValues;
7
+ constructor();
8
+ notImplemented(call: string): void;
9
+ counter: number;
10
+ appCall(action: any, value?: unknown, { callback, awaitResult }?: {
11
+ callback: any;
12
+ awaitResult?: boolean | undefined;
13
+ }): Promise<unknown> | undefined;
14
+ functions: ChaynsReactFunctions;
15
+ private dialogs;
16
+ init(): Promise<undefined>;
17
+ getSSRData(): null;
18
+ addDataListener(cb: DataChangeCallback): CleanupCallback;
19
+ subscribe: (listener: () => void) => () => void;
20
+ emitChange: () => void;
21
+ getInitialData(): ChaynsReactValues;
22
+ }
@@ -1,18 +1,18 @@
1
- import { ChaynsReactFunctions, ChaynsReactValues, DataChangeCallback, IChaynsReact } from '../types/IChaynsReact';
2
- export declare class FrameWrapper implements IChaynsReact {
3
- private resolve;
4
- private exposedFunctions;
5
- private resizeListener;
6
- ready: Promise<unknown>;
7
- values: ChaynsReactValues;
8
- listeners: (() => void)[];
9
- functions: ChaynsReactFunctions;
10
- initialized: boolean;
11
- constructor();
12
- init(): Promise<void>;
13
- addDataListener(cb: DataChangeCallback): () => void;
14
- subscribe: (listener: () => void) => () => void;
15
- emitChange: () => void;
16
- getSSRData(): null;
17
- getInitialData(): ChaynsReactValues;
18
- }
1
+ import { ChaynsReactFunctions, ChaynsReactValues, DataChangeCallback, IChaynsReact } from '../types/IChaynsReact';
2
+ export declare class FrameWrapper implements IChaynsReact {
3
+ private resolve;
4
+ private exposedFunctions;
5
+ private resizeListener;
6
+ ready: Promise<unknown>;
7
+ values: ChaynsReactValues;
8
+ listeners: (() => void)[];
9
+ functions: ChaynsReactFunctions;
10
+ initialized: boolean;
11
+ constructor();
12
+ init(): Promise<void>;
13
+ addDataListener(cb: DataChangeCallback): () => void;
14
+ subscribe: (listener: () => void) => () => void;
15
+ emitChange: () => void;
16
+ getSSRData(): null;
17
+ getInitialData(): ChaynsReactValues;
18
+ }
@@ -1,13 +1,13 @@
1
- import { ChaynsReactFunctions, ChaynsReactValues, DataChangeCallback, IChaynsReact } from '../types/IChaynsReact';
2
- export declare class ModuleFederationWrapper implements IChaynsReact {
3
- values: ChaynsReactValues;
4
- functions: ChaynsReactFunctions;
5
- listeners: (() => void)[];
6
- constructor(values: ChaynsReactValues, functions: ChaynsReactFunctions);
7
- init(): Promise<undefined>;
8
- addDataListener(cb: DataChangeCallback): () => void;
9
- subscribe: (listener: () => void) => () => void;
10
- emitChange: () => void;
11
- getSSRData(): null;
12
- getInitialData(): ChaynsReactValues;
13
- }
1
+ import { ChaynsReactFunctions, ChaynsReactValues, DataChangeCallback, IChaynsReact } from '../types/IChaynsReact';
2
+ export declare class ModuleFederationWrapper implements IChaynsReact {
3
+ values: ChaynsReactValues;
4
+ functions: ChaynsReactFunctions;
5
+ listeners: (() => void)[];
6
+ constructor(values: ChaynsReactValues, functions: ChaynsReactFunctions);
7
+ init(): Promise<undefined>;
8
+ addDataListener(cb: DataChangeCallback): () => void;
9
+ subscribe: (listener: () => void) => () => void;
10
+ emitChange: () => void;
11
+ getSSRData(): null;
12
+ getInitialData(): ChaynsReactValues;
13
+ }
@@ -1,14 +1,14 @@
1
- import { ChaynsReactFunctions, ChaynsReactValues, CleanupCallback, DataChangeCallback, IChaynsReact } from '../types/IChaynsReact';
2
- export declare class SsrWrapper implements IChaynsReact {
3
- private readonly initialData;
4
- values: ChaynsReactValues;
5
- functions: ChaynsReactFunctions;
6
- listeners: (() => void)[];
7
- constructor(values: ChaynsReactValues, functions: ChaynsReactFunctions);
8
- init(): Promise<undefined>;
9
- addDataListener(cb: DataChangeCallback): CleanupCallback;
10
- subscribe: (listener: () => void) => () => void;
11
- emitChange: () => void;
12
- getSSRData(): ChaynsReactValues;
13
- getInitialData(): ChaynsReactValues;
14
- }
1
+ import { ChaynsReactFunctions, ChaynsReactValues, CleanupCallback, DataChangeCallback, IChaynsReact } from '../types/IChaynsReact';
2
+ export declare class SsrWrapper implements IChaynsReact {
3
+ private readonly initialData;
4
+ values: ChaynsReactValues;
5
+ functions: ChaynsReactFunctions;
6
+ listeners: (() => void)[];
7
+ constructor(values: ChaynsReactValues, functions: ChaynsReactFunctions);
8
+ init(): Promise<undefined>;
9
+ addDataListener(cb: DataChangeCallback): CleanupCallback;
10
+ subscribe: (listener: () => void) => () => void;
11
+ emitChange: () => void;
12
+ getSSRData(): ChaynsReactValues;
13
+ getInitialData(): ChaynsReactValues;
14
+ }
@@ -1,16 +1,16 @@
1
- import { DataChangeCallback } from '../types/IChaynsReact';
2
- declare class StaticChaynsApi {
3
- ready: Promise<void>;
4
- addDataListener: (cb: DataChangeCallback) => () => void;
5
- private _wrapper;
6
- constructor(values: any, functions: any);
7
- getUser: () => any;
8
- getSite: () => any;
9
- getCurrentPage: () => any;
10
- getDevice: () => any;
11
- getLanguage: () => any;
12
- getParameters: () => any;
13
- getPages: () => any;
14
- getEnvironment: () => any;
15
- }
16
- export default StaticChaynsApi;
1
+ import { DataChangeCallback } from '../types/IChaynsReact';
2
+ declare class StaticChaynsApi {
3
+ ready: Promise<void>;
4
+ addDataListener: (cb: DataChangeCallback) => () => void;
5
+ private _wrapper;
6
+ constructor(values: any, functions: any);
7
+ getUser: () => any;
8
+ getSite: () => any;
9
+ getCurrentPage: () => any;
10
+ getDevice: () => any;
11
+ getLanguage: () => any;
12
+ getParameters: () => any;
13
+ getPages: () => any;
14
+ getEnvironment: () => any;
15
+ }
16
+ export default StaticChaynsApi;
package/package.json CHANGED
@@ -1,88 +1,88 @@
1
- {
2
- "name": "chayns-api",
3
- "version": "2.1.3-3",
4
- "description": "new chayns api",
5
- "main": "dist/cjs/index.js",
6
- "module": "dist/esm/index.js",
7
- "types": "dist/types/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "require": "./dist/cjs/index.js",
11
- "import": "./dist/esm/index.js",
12
- "types": "./dist/types/index.d.ts"
13
- }
14
- },
15
- "keywords": [
16
- "chayns",
17
- "chayns-toolkit",
18
- "react"
19
- ],
20
- "scripts": {
21
- "start": "npm run dev",
22
- "build:umd": "chayns-toolkit build",
23
- "build:cjs": "cross-env NODE_ENV=cjs babel src --out-dir dist/cjs --extensions=.ts,.tsx",
24
- "build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --extensions=.ts,.tsx",
25
- "build-docs": "npm i && cd website && npm i && npm run build",
26
- "build:typescript": "tsc",
27
- "watch:cjs": "npm run build:cjs -- --watch",
28
- "watch:esm": "npm run build:esm -- --watch",
29
- "watch:typescript": "tsc -w",
30
- "watch": "concurrently \"npm run watch:cjs\" \"npm run watch:esm\" \"npm run watch:typescript\"",
31
- "dev": "npm link && npm run watch",
32
- "format": "prettier . --write",
33
- "lint": "eslint src",
34
- "prepublishOnly": "npm run build:cjs && npm run build:esm && npm run build:typescript",
35
- "preversion": "npm run build:typescript -- --noEmit --emitDeclarationOnly false"
36
- },
37
- "prettier": {
38
- "proseWrap": "always",
39
- "singleQuote": true,
40
- "tabWidth": 4
41
- },
42
- "eslintConfig": {
43
- "extends": "@chayns-toolkit"
44
- },
45
- "dependencies": {
46
- "@module-federation/enhanced": "^0.6.10",
47
- "@module-federation/runtime": "^0.6.9",
48
- "@types/semver": "^7.5.8",
49
- "comlink": "4.3.1",
50
- "htmlescape": "^1.1.1",
51
- "lodash.throttle": "^4.1.1",
52
- "prop-types": "^15.7.2",
53
- "scheduler": "^0.23.0",
54
- "semaphore-async-await": "^1.5.1",
55
- "ua-parser-js": "^1.0.38",
56
- "use-sync-external-store": "^1.4.0",
57
- "util": "^0.12.5"
58
- },
59
- "devDependencies": {
60
- "@babel/cli": "^7.24.1",
61
- "@babel/core": "^7.24.4",
62
- "@babel/preset-env": "^7.24.4",
63
- "@babel/preset-react": "^7.24.1",
64
- "@babel/preset-typescript": "^7.24.1",
65
- "@chayns-toolkit/eslint-config": "^2.0.0",
66
- "@testing-library/react": "^16.0.1",
67
- "@types/htmlescape": "^1.1.3",
68
- "@types/lodash.throttle": "^4.1.9",
69
- "@types/prop-types": "^15.7.12",
70
- "@types/react": "^18.2.78",
71
- "@types/react-dom": "^18.2.25",
72
- "@types/ua-parser-js": "^0.7.39",
73
- "@typescript-eslint/parser": "^7.6.0",
74
- "chayns-toolkit": "^2.0.9",
75
- "concurrently": "^8.2.2",
76
- "cross-env": "^7.0.3",
77
- "postcss-prefix-selector": "^1.13.0",
78
- "prettier": "^3.2.5",
79
- "prettier-plugin-packagejson": "^2.5.0",
80
- "react": "^18.3.1",
81
- "react-dom": "^18.3.1",
82
- "typescript": "^4.9.5"
83
- },
84
- "peerDependencies": {
85
- "react": "^16.8 || ^17.0.1 || ^18.0.0 || ^19.0.0",
86
- "react-dom": "^16.8 || ^17.0.1 || ^18.0.0 || ^19.0.0"
87
- }
88
- }
1
+ {
2
+ "name": "chayns-api",
3
+ "version": "2.1.5",
4
+ "description": "new chayns api",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "require": "./dist/cjs/index.js",
11
+ "import": "./dist/esm/index.js",
12
+ "types": "./dist/types/index.d.ts"
13
+ }
14
+ },
15
+ "keywords": [
16
+ "chayns",
17
+ "chayns-toolkit",
18
+ "react"
19
+ ],
20
+ "scripts": {
21
+ "start": "npm run dev",
22
+ "build:umd": "chayns-toolkit build",
23
+ "build:cjs": "cross-env NODE_ENV=cjs babel src --out-dir dist/cjs --extensions=.ts,.tsx",
24
+ "build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --extensions=.ts,.tsx",
25
+ "build-docs": "npm i && cd website && npm i && npm run build",
26
+ "build:typescript": "tsc",
27
+ "watch:cjs": "npm run build:cjs -- --watch",
28
+ "watch:esm": "npm run build:esm -- --watch",
29
+ "watch:typescript": "tsc -w",
30
+ "watch": "concurrently \"npm run watch:cjs\" \"npm run watch:esm\" \"npm run watch:typescript\"",
31
+ "dev": "npm link && npm run watch",
32
+ "format": "prettier . --write",
33
+ "lint": "eslint src",
34
+ "prepublishOnly": "npm run build:cjs && npm run build:esm && npm run build:typescript",
35
+ "preversion": "npm run build:typescript -- --noEmit --emitDeclarationOnly false"
36
+ },
37
+ "prettier": {
38
+ "proseWrap": "always",
39
+ "singleQuote": true,
40
+ "tabWidth": 4
41
+ },
42
+ "eslintConfig": {
43
+ "extends": "@chayns-toolkit"
44
+ },
45
+ "dependencies": {
46
+ "@module-federation/enhanced": "^0.6.10",
47
+ "@module-federation/runtime": "^0.6.9",
48
+ "@types/semver": "^7.5.8",
49
+ "comlink": "4.3.1",
50
+ "htmlescape": "^1.1.1",
51
+ "lodash.throttle": "^4.1.1",
52
+ "prop-types": "^15.7.2",
53
+ "scheduler": "^0.23.0",
54
+ "semaphore-async-await": "^1.5.1",
55
+ "ua-parser-js": "^1.0.38",
56
+ "use-sync-external-store": "^1.4.0",
57
+ "util": "^0.12.5"
58
+ },
59
+ "devDependencies": {
60
+ "@babel/cli": "^7.24.1",
61
+ "@babel/core": "^7.24.4",
62
+ "@babel/preset-env": "^7.24.4",
63
+ "@babel/preset-react": "^7.24.1",
64
+ "@babel/preset-typescript": "^7.24.1",
65
+ "@chayns-toolkit/eslint-config": "^2.0.0",
66
+ "@testing-library/react": "^16.0.1",
67
+ "@types/htmlescape": "^1.1.3",
68
+ "@types/lodash.throttle": "^4.1.9",
69
+ "@types/prop-types": "^15.7.12",
70
+ "@types/react": "^18.2.78",
71
+ "@types/react-dom": "^18.2.25",
72
+ "@types/ua-parser-js": "^0.7.39",
73
+ "@typescript-eslint/parser": "^7.6.0",
74
+ "chayns-toolkit": "^2.0.9",
75
+ "concurrently": "^8.2.2",
76
+ "cross-env": "^7.0.3",
77
+ "postcss-prefix-selector": "^1.13.0",
78
+ "prettier": "^3.2.5",
79
+ "prettier-plugin-packagejson": "^2.5.0",
80
+ "react": "^18.3.1",
81
+ "react-dom": "^18.3.1",
82
+ "typescript": "^4.9.5"
83
+ },
84
+ "peerDependencies": {
85
+ "react": "^16.8 || ^17.0.1 || ^18.0.0 || ^19.0.0",
86
+ "react-dom": "^16.8 || ^17.0.1 || ^18.0.0 || ^19.0.0"
87
+ }
88
+ }
package/toolkit.config.js CHANGED
@@ -1,20 +1,20 @@
1
- const path = require('path');
2
-
3
- module.exports = {
4
- development: {
5
- host: "0.0.0.0",
6
- port: 8081,
7
- },
8
- output: {
9
- singleBundle: true,
10
- filename: 'chayns-api.js',
11
- path: path.resolve(__dirname, 'dist'),
12
- },
13
- webpack(config) {
14
- config.output.library = {
15
- name: 'ChaynsApi',
16
- type: 'umd',
17
- }
18
- return config;
19
- }
20
- };
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ development: {
5
+ host: "0.0.0.0",
6
+ port: 8081,
7
+ },
8
+ output: {
9
+ singleBundle: true,
10
+ filename: 'chayns-api.js',
11
+ path: path.resolve(__dirname, 'dist'),
12
+ },
13
+ webpack(config) {
14
+ config.output.library = {
15
+ name: 'ChaynsApi',
16
+ type: 'umd',
17
+ }
18
+ return config;
19
+ }
20
+ };