@alipay/ams-checkout 0.0.1693912790-dev.2 → 0.0.1693912790-dev.4

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 (38) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/constant/index.d.ts +53 -32
  3. package/esm/constant/index.js +53 -32
  4. package/esm/core/component/index.d.ts +23 -9
  5. package/esm/core/component/index.js +145 -43
  6. package/esm/core/drop-in/index.d.ts +4 -4
  7. package/esm/core/drop-in/index.js +3 -3
  8. package/esm/core/instance/index.d.ts +6 -15
  9. package/esm/core/instance/index.js +31 -53
  10. package/esm/image/skeleton.svg +18 -0
  11. package/esm/index.d.ts +4 -10
  12. package/esm/index.js +8 -30
  13. package/esm/plugin/component/cashierApp.d.ts +1 -1
  14. package/esm/plugin/component/cashierApp.js +16 -15
  15. package/esm/plugin/component/{component.style.d.ts → component.inline.style.d.ts} +4 -1
  16. package/esm/plugin/component/component.inline.style.js +38 -0
  17. package/esm/plugin/component/component.popup.style.d.ts +12 -0
  18. package/esm/plugin/component/component.popup.style.js +163 -0
  19. package/esm/plugin/component/index.d.ts +29 -32
  20. package/esm/plugin/component/index.js +263 -352
  21. package/esm/plugin/drop-in/index.d.ts +3 -5
  22. package/esm/plugin/drop-in/index.js +3 -3
  23. package/esm/request/index.d.ts +2 -2
  24. package/esm/request/index.js +5 -5
  25. package/esm/request/utils.d.ts +3 -3
  26. package/esm/request/utils.js +4 -4
  27. package/esm/service/index.d.ts +2 -2
  28. package/esm/types/index.d.ts +72 -34
  29. package/esm/types/index.js +84 -47
  30. package/esm/util/createIframeNode.d.ts +3 -3
  31. package/esm/util/createIframeNode.js +8 -8
  32. package/esm/util/index.d.ts +6 -4
  33. package/esm/util/index.js +22 -5
  34. package/esm/util/mock.js +1 -2
  35. package/esm/util/security.d.ts +12 -7
  36. package/esm/util/security.js +86 -17
  37. package/package.json +1 -1
  38. 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, IcreateComponent } from '../../types';
3
- import { CashierSdkActionQueryResult, componentSignEnum } from '../../types';
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: 'desktop' | 'mobile';
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,17 +31,20 @@ 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(createIframeNode: (context: ComponentApp, params: IcreateComponent) => Promise<void>): void;
34
+ setRender(renderFunc: IrenderFuncParams): void;
32
35
  initAPSecurity(): void;
33
36
  /**
34
37
  * @description render iframe content
35
38
  */
36
- appendIframeNodes(componentSign: componentSignEnum, renderParams: IappendIframeNodesParams): Promise<void | [void, CashierSdkActionQueryResult]>;
39
+ appendIframeNodes(componentSign: componentSignEnum, renderParams: IappendIframeNodesParams): Promise<void>;
40
+ private renderInlineLoading;
41
+ private renderPopupLoading;
42
+ _createLoadAppPromise(): Promise<unknown>;
37
43
  /**
38
44
  * @description Interface request
39
45
  */
40
46
  private createActionQueryPromise;
41
- private cleanApp;
47
+ private cleanElement;
42
48
  /**
43
49
  * @description Create app
44
50
  */
@@ -48,12 +54,12 @@ export default class ComponentApp {
48
54
  /**
49
55
  * @description Initialize subscription iframe message
50
56
  */
51
- private _addEventListener;
52
- private _removeEventListener;
57
+ private addEventListener;
58
+ private removeEventListener;
53
59
  /**
54
60
  * @description Processing messages from iframe
55
61
  */
56
- private _handleAppMessage;
62
+ _handleAppMessage(data: eventPlayload): void;
57
63
  private handleSizeChanged;
58
64
  private handleRedirect;
59
65
  private handleDeclareInfo;
@@ -61,11 +67,16 @@ export default class ComponentApp {
61
67
  /**
62
68
  * @description Send message to SDK
63
69
  */
64
- private dispatchToSDK;
70
+ dispatchToSDK(event: string, data: any): void;
65
71
  /**
66
72
  * @description Send message to iframe
67
73
  */
68
- private dispatchToApp;
74
+ dispatchToApp(payload: {
75
+ context: {
76
+ event: string;
77
+ data: any;
78
+ };
79
+ }): any;
69
80
  /**
70
81
  * @description Subscribe to messages from SDK
71
82
  */
@@ -74,30 +85,16 @@ export default class ComponentApp {
74
85
  * @description Send rendering events to iframe
75
86
  */
76
87
  private sendRenderEvent;
77
- private showLoading;
78
- /**
79
- * @description show cashier
80
- */
81
- private showCashier;
82
88
  /**
83
89
  * @description close cashier
84
90
  */
85
- private closeCashier;
86
- private hideComponentAndCleanDom;
91
+ private cleanContainer;
92
+ private hideComponentAnimation;
87
93
  private closeBtnFunc;
88
- /**
89
- * @description create mount node
90
- */
91
- private createMountElement;
92
- private createCloseBtn;
93
- private createRetentionPopup;
94
94
  private retentionPopupLeaveFunc;
95
95
  private removeRetentionPopup;
96
96
  private showRetentionPopup;
97
- private hideRetentionPopup;
98
- /**
99
- * @description create mockup
100
- */
101
- private createMockup;
97
+ private hideRetentionPopupFunc;
102
98
  private submitForm;
103
99
  }
100
+ export {};