@alipay/ams-checkout 0.0.1694675458-dev.0 → 1.3.1-dev

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