@alipay/ams-checkout 0.0.1720509876-dev.1 → 0.0.1723203704-dev.1

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 (43) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/config/request.js +3 -3
  3. package/esm/constant/index.d.ts +10 -1
  4. package/esm/constant/index.js +9 -0
  5. package/esm/core/component/address.d.ts +34 -0
  6. package/esm/core/component/address.js +298 -0
  7. package/esm/core/component/appPreloadProcessing.d.ts +1 -0
  8. package/esm/core/component/appPreloadProcessing.js +89 -0
  9. package/esm/core/component/index.d.ts +1 -1
  10. package/esm/core/component/index.js +39 -14
  11. package/esm/core/instance/address.d.ts +76 -0
  12. package/esm/core/instance/address.js +283 -0
  13. package/esm/index.d.ts +12 -1
  14. package/esm/index.js +57 -19
  15. package/esm/plugin/address/cashierApp.d.ts +34 -0
  16. package/esm/plugin/address/cashierApp.js +218 -0
  17. package/esm/plugin/address/channel.d.ts +20 -0
  18. package/esm/plugin/address/channel.js +52 -0
  19. package/esm/plugin/address/component.inline.style.d.ts +11 -0
  20. package/esm/plugin/address/component.inline.style.js +38 -0
  21. package/esm/plugin/address/component.popup.style.d.ts +16 -0
  22. package/esm/plugin/address/component.popup.style.js +174 -0
  23. package/esm/plugin/address/index.d.ts +108 -0
  24. package/esm/plugin/address/index.js +860 -0
  25. package/esm/plugin/address/popupWindow.style.d.ts +8 -0
  26. package/esm/plugin/address/popupWindow.style.js +65 -0
  27. package/esm/plugin/applepay/component.js +1 -1
  28. package/esm/plugin/component/cashierApp.js +21 -5
  29. package/esm/plugin/component/component.inline.style.d.ts +8 -9
  30. package/esm/plugin/component/component.inline.style.js +87 -6
  31. package/esm/plugin/component/index.js +49 -25
  32. package/esm/plugin/component/popupWindow.style.d.ts +5 -2
  33. package/esm/plugin/component/popupWindow.style.js +55 -7
  34. package/esm/plugin/type.d.ts +1 -0
  35. package/esm/types/address.d.ts +92 -0
  36. package/esm/types/address.js +7 -0
  37. package/esm/types/index.d.ts +13 -3
  38. package/esm/types/index.js +5 -0
  39. package/esm/util/index.d.ts +7 -1
  40. package/esm/util/index.js +67 -1
  41. package/esm/util/upgrade.d.ts +4 -4
  42. package/esm/util/upgrade.js +6 -6
  43. package/package.json +1 -1
@@ -0,0 +1,108 @@
1
+ import type AMSCheckout from '../../core/instance/address';
2
+ import type { eventPayload, eventPayloadContext, IMerchantAppointParam, Iselector } from '../../types';
3
+ import { componentSignEnum, DeviceIdParameter, platformEnum, renderDisplayTypeEnum } from '../../types';
4
+ import { IappendAddressIframeNodesParams } from 'src/types/address';
5
+ type IrenderFuncParams = (context: ComponentApp, selector: Iselector, renderDisplayType: renderDisplayTypeEnum) => Promise<void>;
6
+ export default class ComponentApp {
7
+ app: null | HTMLIFrameElement;
8
+ AMSSDK: AMSCheckout;
9
+ platform: platformEnum;
10
+ _performanceData: any[];
11
+ _loadAppPromiseResolve: ((value: boolean) => void) | null;
12
+ _isInitComponent: boolean;
13
+ private _globalData?;
14
+ private popupApp?;
15
+ private appDomain;
16
+ private createIframeNode;
17
+ private createPreloadIframeNode;
18
+ private _selector;
19
+ private _appVersion;
20
+ private _isRetention;
21
+ private _allowSubmitPayCallAhead;
22
+ private _actionQueryPromise;
23
+ private _actionSubmitPromise;
24
+ private _renderParams;
25
+ private _componentSign;
26
+ private _appLocationSearch;
27
+ private _renderDisplayType;
28
+ private _multipleCallbackEvents;
29
+ _merchantAppointParam: IMerchantAppointParam;
30
+ private _webAppHeartBeatTimeoutFn;
31
+ constructor();
32
+ /**
33
+ * @description Cancel listening and destroy the dom
34
+ */
35
+ logoutPlugin(): void;
36
+ /**
37
+ * @description When SDK registers plug-ins, it is a required function to receive SDK instances
38
+ */
39
+ applyPlugin(AMSSDK: AMSCheckout): void;
40
+ private initLoggerMeta;
41
+ /**
42
+ * @description Set the rendering capability of the cashier plug-in. Different technology stacks have some differences in the packaging and use of rendering functions
43
+ */
44
+ setRender(renderFunc: IrenderFuncParams): void;
45
+ setPreloadRender(renderFunc: any): void;
46
+ private initSecurity;
47
+ getDeviceIdAndLog(deviceIdParameter?: DeviceIdParameter, isPolling?: boolean): Promise<string>;
48
+ private logDeviceId;
49
+ /**
50
+ * @description render iframe content
51
+ */
52
+ appendIframeNodes(componentSign: componentSignEnum, renderParams: IappendAddressIframeNodesParams): Promise<void>;
53
+ private showRetentionPopup;
54
+ private closeBtnFunc;
55
+ appendPreloadIframeNodes(componentSign: any, productSceneVersion: any): void;
56
+ private renderInlineLoading;
57
+ private renderPopupLoading;
58
+ _createLoadAppPromise(loadTimeLimit?: number): Promise<unknown>;
59
+ private cleanElement;
60
+ private removeRetentionPopup;
61
+ private hideRetentionPopupFunc;
62
+ private retentionPopupLeaveFunc;
63
+ private handleDeclarePopWindowCallback;
64
+ private createPreloadApp;
65
+ /**
66
+ * @description Create app
67
+ */
68
+ private createApp;
69
+ private listener;
70
+ private resizeListener;
71
+ /**
72
+ * @description Initialize subscription iframe message
73
+ */
74
+ private addEventListener;
75
+ private removeEventListener;
76
+ /**
77
+ * @description Processing messages from iframe
78
+ */
79
+ _handleAppMessage(data: eventPayload): void;
80
+ private dismissLoadingFunc;
81
+ private handleSizeChanged;
82
+ private handleAppHeartBeat;
83
+ private isAppAttached;
84
+ /**
85
+ * @description Send message to SDK
86
+ */
87
+ dispatchToSDK(event: string, data: any, eventCallbackId?: string): void;
88
+ /**
89
+ * @description Send message to iframe
90
+ */
91
+ dispatchToApp(payload: {
92
+ context: eventPayloadContext;
93
+ }, targetElement?: any): any;
94
+ /**
95
+ * @description Subscribe to messages from SDK
96
+ */
97
+ private subscribeFromSDK;
98
+ /**
99
+ * @description Send rendering events to iframe
100
+ */
101
+ private sendRenderEvent;
102
+ /**
103
+ * @description close cashier
104
+ */
105
+ private cleanContainer;
106
+ private hideComponentAnimation;
107
+ }
108
+ export {};