@alipay/ams-checkout 1.4.0 → 1.5.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/dist/umd/ams-checkout.min.js +1 -1
- package/esm/constant/index.d.ts +53 -32
- package/esm/constant/index.js +53 -32
- package/esm/core/component/index.d.ts +23 -9
- package/esm/core/component/index.js +145 -43
- package/esm/core/drop-in/index.d.ts +4 -4
- package/esm/core/drop-in/index.js +3 -3
- package/esm/core/instance/index.d.ts +6 -15
- package/esm/core/instance/index.js +31 -53
- package/esm/image/skeleton.svg +18 -0
- package/esm/index.d.ts +4 -10
- package/esm/index.js +8 -30
- package/esm/plugin/component/cashierApp.d.ts +1 -1
- package/esm/plugin/component/cashierApp.js +16 -15
- package/esm/plugin/component/{component.style.d.ts → component.inline.style.d.ts} +4 -1
- package/esm/plugin/component/component.inline.style.js +38 -0
- package/esm/plugin/component/component.popup.style.d.ts +12 -0
- package/esm/plugin/component/component.popup.style.js +163 -0
- package/esm/plugin/component/index.d.ts +29 -32
- package/esm/plugin/component/index.js +225 -333
- package/esm/plugin/drop-in/index.d.ts +3 -5
- package/esm/plugin/drop-in/index.js +3 -3
- package/esm/request/index.d.ts +2 -2
- package/esm/request/index.js +3 -3
- package/esm/request/utils.d.ts +3 -3
- package/esm/request/utils.js +4 -4
- package/esm/service/index.d.ts +2 -2
- package/esm/types/index.d.ts +71 -34
- package/esm/types/index.js +84 -47
- package/esm/util/createIframeNode.d.ts +3 -3
- package/esm/util/createIframeNode.js +8 -8
- package/esm/util/index.d.ts +6 -4
- package/esm/util/index.js +22 -5
- package/esm/util/mock.js +1 -2
- package/package.json +1 -1
- package/esm/plugin/component/component.style.js +0 -15
@@ -1,11 +1,15 @@
|
|
1
1
|
import type AMSCheckout from '../../core/instance';
|
2
|
-
import type { IappendIframeNodesParams,
|
3
|
-
import {
|
2
|
+
import type { eventPlayload, IappendIframeNodesParams, Iselector } from '../../types';
|
3
|
+
import { componentSignEnum, platformEnum, renderDisplayTypeEnum } from '../../types';
|
4
|
+
type IrenderFuncParams = (context: ComponentApp, selector: Iselector, renderDisplayType: renderDisplayTypeEnum) => Promise<void>;
|
4
5
|
export default class ComponentApp {
|
5
6
|
app: any;
|
6
|
-
appDomain: string;
|
7
7
|
AMSSDK: AMSCheckout;
|
8
|
-
platform:
|
8
|
+
platform: platformEnum;
|
9
|
+
_performanceData: any[];
|
10
|
+
_loadAppPromiseResolve: ((value: Boolean) => void) | null;
|
11
|
+
_isInitComponent: boolean;
|
12
|
+
private appDomain;
|
9
13
|
private createIframeNode;
|
10
14
|
private _selector;
|
11
15
|
private _appVersion;
|
@@ -13,9 +17,8 @@ export default class ComponentApp {
|
|
13
17
|
private _actionQueryPromise;
|
14
18
|
private _renderParams;
|
15
19
|
private _componentSign;
|
16
|
-
private _performanceData;
|
17
|
-
private _isInitComponent;
|
18
20
|
private _clickEventName;
|
21
|
+
private _renderDisplayType;
|
19
22
|
constructor();
|
20
23
|
/**
|
21
24
|
* @description Cancel listening and destroy the dom
|
@@ -28,16 +31,19 @@ export default class ComponentApp {
|
|
28
31
|
/**
|
29
32
|
* @description Set the rendering capability of the cashier plug-in. Different technology stacks have some differences in the packaging and use of rendering functions
|
30
33
|
*/
|
31
|
-
setRender(
|
34
|
+
setRender(renderFunc: IrenderFuncParams): void;
|
32
35
|
/**
|
33
36
|
* @description render iframe content
|
34
37
|
*/
|
35
|
-
appendIframeNodes(componentSign: componentSignEnum, renderParams: IappendIframeNodesParams): Promise<void
|
38
|
+
appendIframeNodes(componentSign: componentSignEnum, renderParams: IappendIframeNodesParams): Promise<void>;
|
39
|
+
private renderInlineLoading;
|
40
|
+
private renderPopupLoading;
|
41
|
+
_createLoadAppPromise(): Promise<unknown>;
|
36
42
|
/**
|
37
43
|
* @description Interface request
|
38
44
|
*/
|
39
45
|
private createActionQueryPromise;
|
40
|
-
private
|
46
|
+
private cleanElement;
|
41
47
|
/**
|
42
48
|
* @description Create app
|
43
49
|
*/
|
@@ -47,12 +53,12 @@ export default class ComponentApp {
|
|
47
53
|
/**
|
48
54
|
* @description Initialize subscription iframe message
|
49
55
|
*/
|
50
|
-
private
|
51
|
-
private
|
56
|
+
private addEventListener;
|
57
|
+
private removeEventListener;
|
52
58
|
/**
|
53
59
|
* @description Processing messages from iframe
|
54
60
|
*/
|
55
|
-
|
61
|
+
_handleAppMessage(data: eventPlayload): void;
|
56
62
|
private handleSizeChanged;
|
57
63
|
private handleRedirect;
|
58
64
|
private handleDeclareInfo;
|
@@ -60,11 +66,16 @@ export default class ComponentApp {
|
|
60
66
|
/**
|
61
67
|
* @description Send message to SDK
|
62
68
|
*/
|
63
|
-
|
69
|
+
dispatchToSDK(event: string, data: any): void;
|
64
70
|
/**
|
65
71
|
* @description Send message to iframe
|
66
72
|
*/
|
67
|
-
|
73
|
+
dispatchToApp(payload: {
|
74
|
+
context: {
|
75
|
+
event: string;
|
76
|
+
data: any;
|
77
|
+
};
|
78
|
+
}): any;
|
68
79
|
/**
|
69
80
|
* @description Subscribe to messages from SDK
|
70
81
|
*/
|
@@ -73,30 +84,16 @@ export default class ComponentApp {
|
|
73
84
|
* @description Send rendering events to iframe
|
74
85
|
*/
|
75
86
|
private sendRenderEvent;
|
76
|
-
private showLoading;
|
77
|
-
/**
|
78
|
-
* @description show cashier
|
79
|
-
*/
|
80
|
-
private showCashier;
|
81
87
|
/**
|
82
88
|
* @description close cashier
|
83
89
|
*/
|
84
|
-
private
|
85
|
-
private
|
90
|
+
private cleanContainer;
|
91
|
+
private hideComponentAnimation;
|
86
92
|
private closeBtnFunc;
|
87
|
-
/**
|
88
|
-
* @description create mount node
|
89
|
-
*/
|
90
|
-
private createMountElement;
|
91
|
-
private createCloseBtn;
|
92
|
-
private createRetentionPopup;
|
93
93
|
private retentionPopupLeaveFunc;
|
94
94
|
private removeRetentionPopup;
|
95
95
|
private showRetentionPopup;
|
96
|
-
private
|
97
|
-
/**
|
98
|
-
* @description create mockup
|
99
|
-
*/
|
100
|
-
private createMockup;
|
96
|
+
private hideRetentionPopupFunc;
|
101
97
|
private submitForm;
|
102
98
|
}
|
99
|
+
export {};
|