@alipay/ams-checkout 0.0.1729593469-dev.0 → 0.0.1730107332-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 (126) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/{plugin/component → component}/channel.d.ts +3 -4
  3. package/esm/{plugin/component → component}/channel.js +1 -37
  4. package/esm/component/component.inline.style.d.ts +10 -0
  5. package/esm/{plugin/component → component}/component.inline.style.js +11 -9
  6. package/esm/{plugin/component → component}/component.popup.style.d.ts +15 -6
  7. package/esm/{plugin/component → component}/component.popup.style.js +36 -18
  8. package/esm/{plugin/component → component}/popupWindow.style.js +2 -2
  9. package/esm/config/index.d.ts +7 -7
  10. package/esm/config/index.js +7 -7
  11. package/esm/constant/index.d.ts +7 -6
  12. package/esm/constant/index.js +11 -80
  13. package/esm/foundation/core/index.d.ts +26 -0
  14. package/esm/foundation/core/index.js +335 -0
  15. package/esm/foundation/index.d.ts +71 -0
  16. package/esm/foundation/index.js +42 -0
  17. package/esm/foundation/product-processor/easysafepay/deps.d.ts +17 -0
  18. package/esm/foundation/product-processor/easysafepay/deps.js +11 -0
  19. package/esm/foundation/product-processor/easysafepay/index.d.ts +27 -0
  20. package/esm/foundation/product-processor/easysafepay/index.js +581 -0
  21. package/esm/{core/bus → foundation/service/api-bus}/ability/callback.d.ts +2 -2
  22. package/esm/{core/bus → foundation/service/api-bus}/ability/callback.js +1 -1
  23. package/esm/foundation/service/api-bus/ability/globalData.d.ts +10 -0
  24. package/esm/{core/component/address.js → foundation/service/api-bus/ability/globalData.js} +75 -58
  25. package/esm/foundation/service/api-bus/ability/request.d.ts +10 -0
  26. package/esm/foundation/service/api-bus/ability/request.js +151 -0
  27. package/esm/{core/bus → foundation/service/api-bus}/ability/security.d.ts +6 -4
  28. package/esm/{core/bus → foundation/service/api-bus}/ability/security.js +92 -35
  29. package/esm/{core/bus → foundation/service/api-bus}/ability/tracker.d.ts +4 -4
  30. package/esm/{core/bus → foundation/service/api-bus}/ability/tracker.js +6 -3
  31. package/esm/{core/bus/index.d.ts → foundation/service/api-bus/busManager.d.ts} +17 -15
  32. package/esm/{core/bus/index.js → foundation/service/api-bus/busManager.js} +67 -35
  33. package/esm/foundation/service/api-bus/index.d.ts +20 -0
  34. package/esm/foundation/service/api-bus/index.js +88 -0
  35. package/esm/{core/bus → foundation/service/api-bus}/interface.d.ts +12 -0
  36. package/esm/{core/bus → foundation/service/api-bus}/interface.js +16 -2
  37. package/esm/foundation/service/container/index.d.ts +28 -0
  38. package/esm/foundation/service/container/index.js +257 -0
  39. package/esm/foundation/service/container/popup.d.ts +17 -0
  40. package/esm/{core/component/appPreloadProcessing.js → foundation/service/container/popup.js} +97 -83
  41. package/esm/foundation/service/container/utils.d.ts +7 -0
  42. package/esm/foundation/service/container/utils.js +48 -0
  43. package/esm/foundation/service/event-center.d.ts +74 -0
  44. package/esm/foundation/service/event-center.js +213 -0
  45. package/esm/foundation/service/global-data/index.d.ts +11 -0
  46. package/esm/foundation/service/global-data/index.js +68 -0
  47. package/esm/foundation/service/index.d.ts +19 -0
  48. package/esm/foundation/service/index.js +82 -0
  49. package/esm/foundation/service/log/index.d.ts +43 -0
  50. package/esm/foundation/service/log/index.js +235 -0
  51. package/esm/foundation/service/log/types.d.ts +32 -0
  52. package/esm/foundation/service/requester/deps.d.ts +17 -0
  53. package/esm/foundation/service/requester/deps.js +11 -0
  54. package/esm/foundation/service/requester/requester.d.ts +22 -0
  55. package/esm/foundation/service/requester/requester.js +214 -0
  56. package/esm/foundation/service/security/index.d.ts +28 -0
  57. package/esm/foundation/service/security/index.js +285 -0
  58. package/esm/{util → foundation/service/security}/security.d.ts +2 -2
  59. package/esm/{util → foundation/service/security}/security.js +3 -3
  60. package/esm/foundation/types/index.d.ts +4 -0
  61. package/esm/foundation/types/index.js +4 -0
  62. package/esm/foundation/utils/gray_scale_utils.d.ts +7 -0
  63. package/esm/foundation/utils/gray_scale_utils.js +40 -0
  64. package/esm/foundation/utils/payment_context_utils.d.ts +13 -0
  65. package/esm/foundation/utils/payment_context_utils.js +57 -0
  66. package/esm/foundation/utils/payment_product_utils.d.ts +13 -0
  67. package/esm/foundation/utils/payment_product_utils.js +38 -0
  68. package/esm/foundation/utils/redirect_utils.d.ts +6 -0
  69. package/esm/foundation/utils/redirect_utils.js +99 -0
  70. package/esm/foundation/utils/system_events.d.ts +4 -0
  71. package/esm/foundation/utils/system_events.js +71 -0
  72. package/esm/foundation/utils/web_app_url_utils.d.ts +46 -0
  73. package/esm/foundation/utils/web_app_url_utils.js +112 -0
  74. package/esm/index.d.ts +5 -28
  75. package/esm/index.js +28 -158
  76. package/esm/types/index.d.ts +66 -38
  77. package/esm/types/index.js +63 -59
  78. package/esm/util/index.d.ts +1 -1
  79. package/esm/util/index.js +3 -4
  80. package/package.json +2 -2
  81. package/esm/core/component/address.d.ts +0 -8
  82. package/esm/core/component/appPreloadProcessing.d.ts +0 -1
  83. package/esm/core/component/ckp/index.d.ts +0 -27
  84. package/esm/core/component/ckp/index.js +0 -166
  85. package/esm/core/component/index.d.ts +0 -51
  86. package/esm/core/component/index.js +0 -531
  87. package/esm/core/drop-in/index.d.ts +0 -22
  88. package/esm/core/drop-in/index.js +0 -104
  89. package/esm/core/instance/index.d.ts +0 -89
  90. package/esm/core/instance/index.js +0 -499
  91. package/esm/plugin/applepay/component.d.ts +0 -50
  92. package/esm/plugin/applepay/component.js +0 -339
  93. package/esm/plugin/applepay/index.d.ts +0 -17
  94. package/esm/plugin/applepay/index.js +0 -117
  95. package/esm/plugin/applepay/interface.d.ts +0 -161
  96. package/esm/plugin/applepay/interface.js +0 -69
  97. package/esm/plugin/applepay/service.d.ts +0 -54
  98. package/esm/plugin/applepay/service.js +0 -289
  99. package/esm/plugin/component/cashierApp.d.ts +0 -34
  100. package/esm/plugin/component/cashierApp.js +0 -237
  101. package/esm/plugin/component/component.inline.style.d.ts +0 -10
  102. package/esm/plugin/component/index.d.ts +0 -126
  103. package/esm/plugin/component/index.js +0 -1839
  104. package/esm/plugin/const.d.ts +0 -2
  105. package/esm/plugin/const.js +0 -33
  106. package/esm/plugin/drop-in/index.d.ts +0 -71
  107. package/esm/plugin/drop-in/index.js +0 -324
  108. package/esm/plugin/payment-element/utils.d.ts +0 -2
  109. package/esm/plugin/payment-element/utils.js +0 -6
  110. package/esm/plugin/paypal/index.d.ts +0 -20
  111. package/esm/plugin/paypal/index.js +0 -390
  112. package/esm/plugin/type.d.ts +0 -34
  113. package/esm/plugin/utils.d.ts +0 -6
  114. package/esm/plugin/utils.js +0 -21
  115. package/esm/util/createIframeNode.d.ts +0 -6
  116. package/esm/util/createIframeNode.js +0 -48
  117. package/esm/util/getBackScheme.d.ts +0 -5
  118. package/esm/util/getBackScheme.js +0 -42
  119. package/esm/util/ua/index.d.ts +0 -2
  120. package/esm/util/ua/index.js +0 -2
  121. package/esm/util/ua/isAndroid.d.ts +0 -4
  122. package/esm/util/ua/isAndroid.js +0 -7
  123. package/esm/util/ua/isIOS.d.ts +0 -4
  124. package/esm/util/ua/isIOS.js +0 -7
  125. /package/esm/{plugin/component → component}/popupWindow.style.d.ts +0 -0
  126. /package/esm/{plugin/type.js → foundation/service/log/types.js} +0 -0
@@ -1,237 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- /**
12
- * Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
15
- * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
16
- * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
17
- */
18
- import { elementAppMarmotMap, marmotMap, sdkVersion } from "../../config/index";
19
- import { componentSignEnum, ComponentSignEnumV2 } from "../../types";
20
- import { isDebugLog } from "../../util/debug";
21
- import { queryParse, serialize } from "../../util/index";
22
- import { Logger } from "../../util/logger";
23
- import { getLastAppVersion, getMatchAppVersion, setLastAppVersion } from "../../util/upgrade";
24
- var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
25
- var sendLog = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
26
- try {
27
- var appVersion = getMatchAppVersion(_extendInfo, {
28
- sdkVersion: sdkVersion,
29
- productScene: productScene,
30
- mid: mid
31
- });
32
- if (sendLog) {
33
- var _Logger$getInstance;
34
- (_Logger$getInstance = Logger.getInstance()) === null || _Logger$getInstance === void 0 || _Logger$getInstance.logInfo({
35
- title: 'sdk_event_appUpgradeInfo'
36
- }, {
37
- appUpgradeVersion: appVersion,
38
- appUpgraded: appVersion ? true : false,
39
- isPreload: _extendInfo ? false : true,
40
- extendInfo: _extendInfo,
41
- productScene: productScene,
42
- mid: mid
43
- });
44
- }
45
-
46
- // 没有匹配到版本,查询上次的加载版本
47
- if (!appVersion) {
48
- appVersion = getLastAppVersion(sdkVersion + productScene);
49
- return appVersion;
50
- }
51
- // 不为空时代表是有sessionData,因此要保存当前版本
52
- if (_extendInfo) {
53
- setLastAppVersion(sdkVersion + productScene, appVersion);
54
- }
55
- return appVersion;
56
- } catch (error) {
57
- return '';
58
- }
59
- };
60
- var getFinalProductSceneVersion = function getFinalProductSceneVersion(componentSign, productSceneVersion) {
61
- var _signSupportMap;
62
- var signSupportMap = (_signSupportMap = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_signSupportMap, componentSignEnum.NONE, ['']), componentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), componentSignEnum.AUTO_DEBIT_PAY_WALLET, ['']), componentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), componentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), componentSignEnum.CASHIER_PAYMENT_APM, ['1.0']), componentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), componentSignEnum.EASY_PAY_APM, ['2.0']), componentSignEnum.VAULTING_CARD, ['1.0']), componentSignEnum.ELEMENT_PAYMENT, ['1.0']), _defineProperty(_defineProperty(_signSupportMap, componentSignEnum.ELEMENT_ADDRESS, ['1.0']), componentSignEnum.CHECKOUT_PAYMENT, ['1.0.0']));
63
- var supportProductSceneVersion = signSupportMap[componentSign];
64
- // 从左到右,从旧到新
65
- var isSupport = supportProductSceneVersion.find(function (it) {
66
- return it === productSceneVersion;
67
- });
68
- var finalProductSceneVersion = supportProductSceneVersion[supportProductSceneVersion.length - 1];
69
- return isSupport ? productSceneVersion : finalProductSceneVersion;
70
- };
71
- export var getAppPath = function getAppPath() {
72
- var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'prod';
73
- var appVersion = arguments.length > 1 ? arguments[1] : undefined;
74
- var componentSign = arguments.length > 2 ? arguments[2] : undefined;
75
- var productScene = arguments.length > 3 ? arguments[3] : undefined;
76
- var productSceneVersion = arguments.length > 4 ? arguments[4] : undefined;
77
- var extendInfo = arguments.length > 5 ? arguments[5] : undefined;
78
- var mid = arguments.length > 6 ? arguments[6] : undefined;
79
- var sendLog = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
80
- var _ref = queryParse() || {},
81
- urlTestHost = _ref.host;
82
- var upgradeAppVersion = getAppVersion(extendInfo, productScene, mid, sendLog);
83
- var finalAppVersion = upgradeAppVersion || appVersion;
84
- // 当有升级版本时,更新到全局字段
85
- if (upgradeAppVersion) {
86
- var _Logger$getInstance2;
87
- (_Logger$getInstance2 = Logger.getInstance()) === null || _Logger$getInstance2 === void 0 || _Logger$getInstance2.setMedta({
88
- webAppVersion: finalAppVersion
89
- });
90
- }
91
- if (isDebugLog()) {
92
- console.log('appUpgrade#getAppPath#finalAppVersion', finalAppVersion);
93
- console.log('appUpgrade#getAppPath#extendInfo', extendInfo, mid);
94
- }
95
- var finalProductSceneVersion = getFinalProductSceneVersion(componentSign, productSceneVersion);
96
- // only for test while testurl?host=https://xxxxx.test.html
97
- if (urlTestHost && !['sandbox', 'light_sandbox', 'prod'].includes(environment)) {
98
- return urlTestHost;
99
- }
100
- // 地址应用特殊处理
101
- if (componentSign === componentSignEnum.ELEMENT_ADDRESS) {
102
- return "".concat(elementAppMarmotMap[environment], "/element-address/").concat(finalAppVersion, "/pages/address/index.html");
103
- }
104
- // element应用特殊处理
105
- if (_toConsumableArray(Object.values(ComponentSignEnumV2)).includes(componentSign)) {
106
- // element又分为express_checkout模式和普通模式, express_checkout 模式在扩展参数是返回expressCheckout=true
107
- var isExpressCheckout = false;
108
- try {
109
- // expressCheckout可能出现string(false) JSON.parse再转一次
110
- isExpressCheckout = JSON.parse(JSON.parse(extendInfo).expressCheckout);
111
- } catch (error) {
112
- // 遇到JSON解析错误,默认false
113
- }
114
- if (isExpressCheckout) {
115
- // express_checkout模式走单独映射
116
- return "".concat(elementAppMarmotMap[environment], "/elements/").concat(finalAppVersion, "/pages/express_checkout/index.html");
117
- } else {
118
- return "".concat(elementAppMarmotMap[environment], "/elements/").concat(finalAppVersion, "/pages/").concat(productScene.toLowerCase(), "/index.html");
119
- }
120
- }
121
- return "".concat(marmotMap[environment], "/").concat(componentSign, "/").concat(finalProductSceneVersion, "/index.").concat(finalAppVersion, ".html");
122
- };
123
- export var getAppDomain = function getAppDomain(domainParams) {
124
- var environment = domainParams.environment,
125
- appVersion = domainParams.appVersion,
126
- componentSign = domainParams.componentSign,
127
- productScene = domainParams.productScene,
128
- productSceneVersion = domainParams.productSceneVersion,
129
- extendInfo = domainParams.extendInfo,
130
- mid = domainParams.mid;
131
- var reg = /^https?:\/\/([^/<>\s]+\.?)*/;
132
- var macth = reg.exec(getAppPath(environment, appVersion, componentSign, productScene, productSceneVersion, extendInfo, mid));
133
- return macth && macth[0] || '';
134
- };
135
- export var getIframeUrl = function getIframeUrl(iframeParams) {
136
- var componentSign = iframeParams.componentSign,
137
- _iframeParams$analyti = iframeParams.analytics,
138
- analytics = _iframeParams$analyti === void 0 ? {
139
- enabled: true
140
- } : _iframeParams$analyti,
141
- productScene = iframeParams.productScene,
142
- productSceneVersion = iframeParams.productSceneVersion,
143
- environment = iframeParams.environment,
144
- appVersion = iframeParams.appVersion,
145
- extendInfo = iframeParams.extendInfo,
146
- locale = iframeParams.locale,
147
- instanceId = iframeParams.instanceId,
148
- renderDisplayType = iframeParams.renderDisplayType,
149
- _iframeParams$isPrelo = iframeParams.isPreload,
150
- isPreload = _iframeParams$isPrelo === void 0 ? '' : _iframeParams$isPrelo,
151
- _iframeParams$hostSig = iframeParams.hostSign,
152
- hostSign = _iframeParams$hostSig === void 0 ? '' : _iframeParams$hostSig,
153
- _iframeParams$mid = iframeParams.mid,
154
- mid = _iframeParams$mid === void 0 ? '' : _iframeParams$mid;
155
- var path = getAppPath(environment, appVersion, componentSign, productScene, productSceneVersion, extendInfo || '', mid, true);
156
- var appMatched = getMatchAppVersion(extendInfo, {
157
- sdkVersion: sdkVersion,
158
- productScene: productScene,
159
- mid: mid
160
- }) ? 'true' : 'false';
161
- var _queryParse = queryParse(),
162
- _sandbox = _queryParse._sandbox,
163
- _light_sandbox = _queryParse._light_sandbox,
164
- _queryParse$requestHo = _queryParse.requestHost,
165
- requestHost = _queryParse$requestHo === void 0 ? '' : _queryParse$requestHo,
166
- _queryParse$groupId = _queryParse.groupId,
167
- groupId = _queryParse$groupId === void 0 ? '' : _queryParse$groupId,
168
- LOCAL_MOCK = _queryParse.LOCAL_MOCK,
169
- _displayType = _queryParse._displayType;
170
- var urlParams = Object.assign({}, {
171
- displayType: renderDisplayType,
172
- locale: locale,
173
- instanceId: instanceId,
174
- appMatched: appMatched,
175
- analyticsEnabled: (analytics === null || analytics === void 0 ? void 0 : analytics.enabled) === false ? 'false' : 'true',
176
- sdkVersion: sdkVersion,
177
- refUrl: window.location.href,
178
- _componentStartTime: "".concat(Date.now()),
179
- isPreload: isPreload || '',
180
- hostSign: hostSign || ''
181
- });
182
- if (LOCAL_MOCK) urlParams.LOCAL_MOCK = LOCAL_MOCK;
183
- if (requestHost) urlParams.requestHost = requestHost;
184
- if (groupId) urlParams.groupId = groupId;
185
- if (environment === 'light_sandbox' || _light_sandbox === 'true') urlParams.sandbox = 'true';
186
- if (environment === 'sandbox' || _sandbox === 'true') urlParams.shadow = 'true';
187
- if (_displayType) urlParams.displayType = _displayType;
188
- var locationSearch = serialize(urlParams);
189
- if (isDebugLog()) {
190
- console.log('appUpgrade#getIframeUrl#appMatched', appMatched);
191
- console.log('appUpgrade#getIframeUrl#url', path, locationSearch);
192
- }
193
- return {
194
- path: path,
195
- locationSearch: locationSearch
196
- };
197
- };
198
-
199
- /**
200
- * @description Create iframe
201
- */
202
- export var createIframe = function createIframe(mode, platform) {
203
- var getIframeId = function getIframeId() {
204
- var IdMap = {
205
- dropin: "ams-checkout-dropin-".concat(platform),
206
- component: "ams-checkout-component-".concat(platform)
207
- };
208
- return IdMap[mode] || 'ams-checkout-component';
209
- };
210
- var iframe = document.createElement('iframe');
211
- var iframeId = getIframeId();
212
- var none = '0';
213
- var width = '100%';
214
- iframe.id = iframeId;
215
- iframe.style.height = none;
216
- iframe.style.width = width;
217
- iframe.style.border = none;
218
- iframe.style.opacity = none;
219
- iframe.style.overflow = 'hidden';
220
- // iframe设置支持第三方支付
221
- iframe.allow = 'payment';
222
- return iframe;
223
- };
224
- export var createPreloadIframe = function createPreloadIframe(channelType, version) {
225
- var id = "ams-checkout-component-".concat(channelType, "-").concat(version);
226
- var iframe = document.createElement('iframe');
227
- var iframeId = id;
228
- var none = '1px';
229
- var width = '1px';
230
- iframe.id = iframeId;
231
- iframe.style.height = none;
232
- iframe.style.width = width;
233
- iframe.style.border = none;
234
- iframe.style.opacity = '0';
235
- iframe.style.overflow = 'hidden';
236
- return iframe;
237
- };
@@ -1,10 +0,0 @@
1
- import { componentSignEnum, platformEnum } from '../../types';
2
- interface Options {
3
- componentSign?: componentSignEnum;
4
- type: 'tabs' | 'Accordion';
5
- isExpressCheckout?: boolean;
6
- }
7
- export declare const inlineComponentAddCss: () => void;
8
- export declare const addInlineLoading: (_selector: HTMLDivElement, platform: platformEnum, options: Options) => void;
9
- export declare const createInlineBaseElement: (selector: string) => HTMLDivElement;
10
- export {};
@@ -1,126 +0,0 @@
1
- import type AMSCheckout from '../../core/instance';
2
- import type { eventPayload, eventPayloadContext, IappendIframeNodesParams, IMerchantAppointParam, Iselector } from '../../types';
3
- import { componentSignEnum, DeviceIdParameter, platformEnum, renderDisplayTypeEnum } from '../../types';
4
- type IrenderFuncParams = (context: ComponentApp, selector: Iselector, renderDisplayType: renderDisplayTypeEnum) => Promise<void>;
5
- export default class ComponentApp {
6
- app: null | HTMLIFrameElement;
7
- AMSSDK: AMSCheckout;
8
- platform: platformEnum;
9
- _performanceData: any[];
10
- _loadAppPromiseResolve: ((value: boolean) => void) | null;
11
- _isInitComponent: boolean;
12
- private _globalData?;
13
- private popupApp?;
14
- private appDomain;
15
- private createIframeNode;
16
- private createPreloadIframeNode;
17
- private _selector;
18
- private _appVersion;
19
- private _isRetention;
20
- private _allowSubmitPayCallAhead;
21
- private _actionQueryPromise;
22
- private _actionSubmitPromise;
23
- private _renderParams;
24
- private _componentSign;
25
- private _appLocationSearch;
26
- private _renderDisplayType;
27
- private _multipleCallbackEvents;
28
- private _isAppWebview;
29
- _merchantAppointParam: IMerchantAppointParam;
30
- private _webAppHeartBeatTimeoutFn;
31
- constructor(componentOption?: {
32
- appVersion?: string;
33
- });
34
- /**
35
- * @description Cancel listening and destroy the dom
36
- */
37
- logoutPlugin(): void;
38
- /**
39
- * @description When SDK registers plug-ins, it is a required function to receive SDK instances
40
- */
41
- applyPlugin(AMSSDK: AMSCheckout): void;
42
- private initLoggerMeta;
43
- /**
44
- * @description Set the rendering capability of the cashier plug-in. Different technology stacks have some differences in the packaging and use of rendering functions
45
- */
46
- setRender(renderFunc: IrenderFuncParams): void;
47
- setPreloadRender(renderFunc: any): void;
48
- private initSecurity;
49
- private logDeviceId;
50
- getDeviceIdAndLog(deviceIdParameter?: DeviceIdParameter, isPolling?: boolean): Promise<string>;
51
- /**
52
- * @description render iframe content
53
- */
54
- appendIframeNodes(componentSign: componentSignEnum, renderParams: IappendIframeNodesParams): Promise<void>;
55
- appendPreloadIframeNodes(componentSign: any, productSceneVersion: any): void;
56
- private setParameterDefaultValues;
57
- private renderInlineLoading;
58
- private renderPopupLoading;
59
- _createLoadAppPromise(loadTimeLimit?: number): Promise<unknown>;
60
- /**
61
- * @description Interface request
62
- */
63
- private createActionQueryPromise;
64
- private createSubmitPromise;
65
- private cleanElement;
66
- private createPreloadApp;
67
- /**
68
- * @description Create app
69
- */
70
- private createApp;
71
- private listener;
72
- private resizeListener;
73
- private createDialog;
74
- private getDeviceIdAndCallback;
75
- private getUserAgentAndCallback;
76
- private returnDataAndCallback;
77
- /**
78
- * @description Initialize subscription iframe message
79
- */
80
- private addEventListener;
81
- private removeEventListener;
82
- /**
83
- * @description Processing messages from iframe
84
- */
85
- _handleAppMessage(data: eventPayload): void;
86
- private dismissLoadingFunc;
87
- private handleSizeChanged;
88
- private handleAuthUrlInfo;
89
- private handleRedirect;
90
- private handleDeclareInfo;
91
- private handleDeclarePopWindowCallback;
92
- private handleAppHeartBeat;
93
- private isAppAttached;
94
- private isWindowVisible;
95
- private handleCloseBtnShow;
96
- /**
97
- * @description Send message to SDK
98
- */
99
- dispatchToSDK(event: string, data: any, eventCallbackId?: string): void;
100
- /**
101
- * @description Send message to iframe
102
- */
103
- dispatchToApp(payload: {
104
- context: eventPayloadContext;
105
- }, targetElement?: any): any;
106
- /**
107
- * @description Subscribe to messages from SDK
108
- */
109
- private subscribeFromSDK;
110
- /**
111
- * @description Send rendering events to iframe
112
- */
113
- private sendRenderEvent;
114
- /**
115
- * @description close cashier
116
- */
117
- private cleanContainer;
118
- private hideComponentAnimation;
119
- private closeBtnFunc;
120
- private retentionPopupLeaveFunc;
121
- private removeRetentionPopup;
122
- private showRetentionPopup;
123
- private hideRetentionPopupFunc;
124
- private submitForm;
125
- }
126
- export {};