@alipay/ams-checkout 1.23.0 → 1.25.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/component/channel.d.ts +19 -0
- package/esm/component/channel.js +87 -0
- package/esm/component/component.inline.style.d.ts +10 -0
- package/esm/component/component.inline.style.js +121 -0
- package/esm/component/component.popup.style.d.ts +23 -0
- package/esm/component/component.popup.style.js +190 -0
- package/esm/component/popupWindow.style.d.ts +11 -0
- package/esm/component/popupWindow.style.js +121 -0
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +10 -10
- package/esm/constant/index.d.ts +9 -5
- package/esm/constant/index.js +12 -78
- package/esm/core/component/ckp/index.js +6 -5
- package/esm/core/component/element/components/address.d.ts +19 -0
- package/esm/core/component/element/components/address.js +68 -0
- package/esm/core/component/element/components/auth.d.ts +17 -0
- package/esm/core/component/element/components/auth.js +60 -0
- package/esm/core/component/element/components/payment.d.ts +19 -0
- package/esm/core/component/element/components/payment.js +74 -0
- package/esm/core/component/element/index.d.ts +47 -0
- package/esm/core/component/element/index.js +816 -0
- package/esm/core/component/element/mock.d.ts +4 -0
- package/esm/core/component/element/mock.js +491 -0
- package/esm/core/component/element/type.d.ts +190 -0
- package/esm/core/component/element/type.js +35 -0
- package/esm/core/component/element/utils.d.ts +13 -0
- package/esm/core/component/element/utils.js +6 -0
- package/esm/core/component/index.d.ts +4 -4
- package/esm/core/component/index.js +14 -14
- package/esm/core/drop-in/index.js +2 -2
- package/esm/core/instance/index.js +9 -9
- package/esm/foundation/core/index.d.ts +26 -0
- package/esm/foundation/core/index.js +366 -0
- package/esm/foundation/index.d.ts +75 -0
- package/esm/foundation/index.js +42 -0
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +18 -0
- package/esm/foundation/product-processor/easysafepay/deps.js +12 -0
- package/esm/foundation/product-processor/easysafepay/index.d.ts +26 -0
- package/esm/foundation/product-processor/easysafepay/index.js +463 -0
- package/esm/foundation/service/api-bus/ability/callback.d.ts +9 -0
- package/esm/foundation/service/api-bus/ability/callback.js +55 -0
- package/esm/foundation/service/api-bus/ability/globalData.d.ts +10 -0
- package/esm/foundation/service/api-bus/ability/globalData.js +89 -0
- package/esm/foundation/service/api-bus/ability/request.d.ts +10 -0
- package/esm/foundation/service/api-bus/ability/request.js +151 -0
- package/esm/foundation/service/api-bus/ability/security.d.ts +12 -0
- package/esm/foundation/service/api-bus/ability/security.js +161 -0
- package/esm/foundation/service/api-bus/ability/tracker.d.ts +9 -0
- package/esm/foundation/service/api-bus/ability/tracker.js +80 -0
- package/esm/foundation/service/api-bus/busManager.d.ts +127 -0
- package/esm/foundation/service/api-bus/busManager.js +398 -0
- package/esm/foundation/service/api-bus/index.d.ts +20 -0
- package/esm/foundation/service/api-bus/index.js +88 -0
- package/esm/foundation/service/api-bus/interface.d.ts +48 -0
- package/esm/foundation/service/api-bus/interface.js +54 -0
- package/esm/foundation/service/container/index.d.ts +30 -0
- package/esm/foundation/service/container/index.js +298 -0
- package/esm/foundation/service/container/popup.d.ts +17 -0
- package/esm/foundation/service/container/popup.js +103 -0
- package/esm/foundation/service/container/utils.d.ts +7 -0
- package/esm/foundation/service/container/utils.js +48 -0
- package/esm/foundation/service/event-center.d.ts +76 -0
- package/esm/foundation/service/event-center.js +243 -0
- package/esm/foundation/service/global-data/index.d.ts +11 -0
- package/esm/foundation/service/global-data/index.js +68 -0
- package/esm/foundation/service/index.d.ts +19 -0
- package/esm/foundation/service/index.js +82 -0
- package/esm/foundation/service/log/index.d.ts +43 -0
- package/esm/foundation/service/log/index.js +235 -0
- package/esm/foundation/service/log/types.d.ts +32 -0
- package/esm/foundation/service/log/types.js +1 -0
- package/esm/foundation/service/requester/deps.d.ts +17 -0
- package/esm/foundation/service/requester/deps.js +11 -0
- package/esm/foundation/service/requester/requester.d.ts +22 -0
- package/esm/foundation/service/requester/requester.js +214 -0
- package/esm/foundation/service/security/index.d.ts +28 -0
- package/esm/foundation/service/security/index.js +286 -0
- package/esm/foundation/service/security/security.d.ts +33 -0
- package/esm/foundation/service/security/security.js +182 -0
- package/esm/foundation/utils/gray_scale_utils.d.ts +7 -0
- package/esm/foundation/utils/gray_scale_utils.js +40 -0
- package/esm/foundation/utils/payment_context_utils.d.ts +13 -0
- package/esm/foundation/utils/payment_context_utils.js +57 -0
- package/esm/foundation/utils/payment_product_utils.d.ts +13 -0
- package/esm/foundation/utils/payment_product_utils.js +38 -0
- package/esm/foundation/utils/redirect_utils.d.ts +11 -0
- package/esm/foundation/utils/redirect_utils.js +263 -0
- package/esm/foundation/utils/system_events.d.ts +4 -0
- package/esm/foundation/utils/system_events.js +66 -0
- package/esm/foundation/utils/web_app_url_utils.d.ts +46 -0
- package/esm/foundation/utils/web_app_url_utils.js +112 -0
- package/esm/index.d.ts +12 -6
- package/esm/index.js +75 -64
- package/esm/plugin/applepay/component.js +3 -3
- package/esm/plugin/applepay/service.d.ts +2 -2
- package/esm/plugin/applepay/service.js +2 -2
- package/esm/plugin/component/cashierApp.d.ts +7 -5
- package/esm/plugin/component/cashierApp.js +15 -8
- package/esm/plugin/component/channel.d.ts +4 -4
- package/esm/plugin/component/component.inline.style.d.ts +4 -4
- package/esm/plugin/component/component.inline.style.js +10 -8
- package/esm/plugin/component/component.popup.style.d.ts +6 -6
- package/esm/plugin/component/component.popup.style.js +6 -6
- package/esm/plugin/component/index.d.ts +8 -7
- package/esm/plugin/component/index.js +160 -103
- package/esm/plugin/const.js +5 -5
- package/esm/plugin/drop-in/index.d.ts +5 -5
- package/esm/plugin/drop-in/index.js +7 -7
- package/esm/plugin/type.d.ts +3 -3
- package/esm/service/element.d.ts +4 -0
- package/esm/service/element.js +51 -0
- package/esm/service/index.d.ts +1 -0
- package/esm/service/index.js +2 -0
- package/esm/types/index.d.ts +247 -39
- package/esm/types/index.js +109 -59
- package/esm/util/createIframeNode.d.ts +2 -2
- package/esm/util/createIframeNode.js +3 -3
- package/esm/util/getBackScheme.js +95 -3
- package/esm/util/security.d.ts +2 -2
- package/esm/util/security.js +2 -2
- package/package.json +2 -1
- package/esm/util/ua/index.d.ts +0 -2
- package/esm/util/ua/index.js +0 -2
- package/esm/util/ua/isAndroid.d.ts +0 -4
- package/esm/util/ua/isAndroid.js +0 -7
- package/esm/util/ua/isIOS.d.ts +0 -4
- package/esm/util/ua/isIOS.js +0 -7
package/esm/index.js
CHANGED
@@ -21,14 +21,18 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
21
21
|
* 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
|
22
22
|
* 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.
|
23
23
|
*/
|
24
|
-
import { AMSAutoDebitAppVersion, AMSCashierPaymentAppVersion, AMSCheckoutAppVersion,
|
25
|
-
import { AMSComponent } from "./core/component/index";
|
24
|
+
import { ADDRESSElementAppVersion, AMSAutoDebitAppVersion, AMSCashierPaymentAppVersion, AMSCheckoutAppVersion, AMSPaymentElementAppVersion, AMSVaultingAppVersion } from "./config/index";
|
26
25
|
import { AddressComponent } from "./core/component/address";
|
27
|
-
import {
|
28
|
-
import {
|
26
|
+
import { ElementComponent } from "./core/component/element";
|
27
|
+
import { AMSComponent } from "./core/component/index";
|
28
|
+
import { ComponentSignEnum, DisplayTypeEnum } from "./types";
|
29
|
+
import { ProductSceneEnum } from "./types/index";
|
30
|
+
import { LogConfig, Logger } from "./util/logger";
|
29
31
|
var logger = new Logger(LogConfig, true);
|
30
32
|
export { AMSCheckoutPage } from "./core/component/ckp";
|
31
33
|
export * from "./types";
|
34
|
+
import { AntomSDKCore } from "./foundation/core";
|
35
|
+
import { EasySafePayProcessor } from "./foundation/product-processor/easysafepay";
|
32
36
|
export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
|
33
37
|
_inherits(AMSCheckout, _AMSComponent);
|
34
38
|
var _super = _createSuper(AMSCheckout);
|
@@ -50,10 +54,10 @@ export var AMSAutoDebit = /*#__PURE__*/function (_AMSCheckout) {
|
|
50
54
|
function AMSAutoDebit(options) {
|
51
55
|
_classCallCheck(this, AMSAutoDebit);
|
52
56
|
var _options = Object.assign({}, options, {
|
53
|
-
product:
|
57
|
+
product: ProductSceneEnum.AUTO_DEBIT,
|
54
58
|
appVersion: AMSAutoDebitAppVersion
|
55
59
|
});
|
56
|
-
return _super2.call(this, _options, [
|
60
|
+
return _super2.call(this, _options, [ComponentSignEnum.AUTO_DEBIT_WALLET]);
|
57
61
|
}
|
58
62
|
return _createClass(AMSAutoDebit);
|
59
63
|
}(AMSCheckout);
|
@@ -63,64 +67,32 @@ export var AMSAutoDebitPay = /*#__PURE__*/function (_AMSCheckout2) {
|
|
63
67
|
function AMSAutoDebitPay(options) {
|
64
68
|
_classCallCheck(this, AMSAutoDebitPay);
|
65
69
|
var _options = Object.assign({}, options, {
|
66
|
-
product:
|
70
|
+
product: ProductSceneEnum.AUTO_DEBIT_PAY
|
67
71
|
});
|
68
|
-
return _super3.call(this, _options, [
|
72
|
+
return _super3.call(this, _options, [ComponentSignEnum.AUTO_DEBIT_PAY_WALLET]);
|
69
73
|
}
|
70
74
|
return _createClass(AMSAutoDebitPay);
|
71
75
|
}(AMSCheckout);
|
72
|
-
export var
|
73
|
-
_inherits(
|
74
|
-
var _super4 = _createSuper(
|
75
|
-
function AMSEasyPay(options) {
|
76
|
-
_classCallCheck(this, AMSEasyPay);
|
77
|
-
var _options = Object.assign({}, options, {
|
78
|
-
product: productSceneEnum.EASY_PAY,
|
79
|
-
appVersion: AMSEasyPayAppVersion
|
80
|
-
});
|
81
|
-
var currentProductSceneVersion = '1.0';
|
82
|
-
try {
|
83
|
-
var previousChannelStr = localStorage.getItem('antom_checkout_previousChannel');
|
84
|
-
var previousChannel = JSON.parse(previousChannelStr) || {};
|
85
|
-
var _ref = previousChannel || {},
|
86
|
-
_ref$channelType = _ref.channelType,
|
87
|
-
channelType = _ref$channelType === void 0 ? '' : _ref$channelType,
|
88
|
-
_ref$productSceneVers = _ref.productSceneVersion,
|
89
|
-
productSceneVersion = _ref$productSceneVers === void 0 ? '1.0' : _ref$productSceneVers;
|
90
|
-
if (channelType === componentSignEnum.EASY_PAY_WALLET) {
|
91
|
-
currentProductSceneVersion = productSceneVersion;
|
92
|
-
}
|
93
|
-
} catch (error) {
|
94
|
-
logger.logError({
|
95
|
-
title: 'performance_optimization_get_previousChannel_error'
|
96
|
-
}, {
|
97
|
-
error: error
|
98
|
-
});
|
99
|
-
}
|
100
|
-
return _super4.call(this, _options, [componentSignEnum.EASY_PAY_WALLET], currentProductSceneVersion);
|
101
|
-
}
|
102
|
-
return _createClass(AMSEasyPay);
|
103
|
-
}(AMSCheckout);
|
104
|
-
export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout4) {
|
105
|
-
_inherits(AMSCashierPayment, _AMSCheckout4);
|
106
|
-
var _super5 = _createSuper(AMSCashierPayment);
|
76
|
+
export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout3) {
|
77
|
+
_inherits(AMSCashierPayment, _AMSCheckout3);
|
78
|
+
var _super4 = _createSuper(AMSCashierPayment);
|
107
79
|
function AMSCashierPayment(options) {
|
108
80
|
_classCallCheck(this, AMSCashierPayment);
|
109
81
|
var _options = Object.assign({}, options, {
|
110
|
-
product:
|
82
|
+
product: ProductSceneEnum.CASHIER_PAYMENT,
|
111
83
|
appVersion: AMSCashierPaymentAppVersion
|
112
84
|
});
|
113
85
|
var currentChannelType;
|
114
86
|
try {
|
115
87
|
var previousChannelStr = localStorage.getItem('antom_checkout_previousChannel');
|
116
88
|
var previousChannel = JSON.parse(previousChannelStr) || {};
|
117
|
-
var
|
118
|
-
|
119
|
-
channelType =
|
120
|
-
if ([
|
89
|
+
var _ref = previousChannel || {},
|
90
|
+
_ref$channelType = _ref.channelType,
|
91
|
+
channelType = _ref$channelType === void 0 ? '' : _ref$channelType;
|
92
|
+
if ([ComponentSignEnum.CASHIER_PAYMENT_CARD, ComponentSignEnum.CASHIER_PAYMENT_APM, ComponentSignEnum.CASHIER_PAYMENT_BANK].includes(channelType)) {
|
121
93
|
currentChannelType = [channelType];
|
122
94
|
} else {
|
123
|
-
currentChannelType = [
|
95
|
+
currentChannelType = [ComponentSignEnum.CASHIER_PAYMENT_CARD, ComponentSignEnum.CASHIER_PAYMENT_APM];
|
124
96
|
}
|
125
97
|
} catch (error) {
|
126
98
|
logger.logError({
|
@@ -129,47 +101,86 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout4) {
|
|
129
101
|
error: error
|
130
102
|
});
|
131
103
|
}
|
132
|
-
return
|
104
|
+
return _super4.call(this, _options, currentChannelType);
|
133
105
|
}
|
134
106
|
return _createClass(AMSCashierPayment);
|
135
107
|
}(AMSCheckout);
|
136
|
-
export var AMSVaulting = /*#__PURE__*/function (
|
137
|
-
_inherits(AMSVaulting,
|
138
|
-
var
|
108
|
+
export var AMSVaulting = /*#__PURE__*/function (_AMSCheckout4) {
|
109
|
+
_inherits(AMSVaulting, _AMSCheckout4);
|
110
|
+
var _super5 = _createSuper(AMSVaulting);
|
139
111
|
function AMSVaulting(options) {
|
140
112
|
_classCallCheck(this, AMSVaulting);
|
141
113
|
var _options = Object.assign({}, options, {
|
142
|
-
product:
|
114
|
+
product: ProductSceneEnum.VAULTING,
|
143
115
|
appVersion: AMSVaultingAppVersion
|
144
116
|
});
|
145
|
-
return
|
117
|
+
return _super5.call(this, _options, [ComponentSignEnum.CASHIER_PAYMENT_CARD]);
|
146
118
|
}
|
147
119
|
return _createClass(AMSVaulting);
|
148
120
|
}(AMSCheckout);
|
149
|
-
export var AntomElement = /*#__PURE__*/function (
|
150
|
-
_inherits(AntomElement,
|
151
|
-
var
|
121
|
+
export var AntomElement = /*#__PURE__*/function (_AMSCheckout5) {
|
122
|
+
_inherits(AntomElement, _AMSCheckout5);
|
123
|
+
var _super6 = _createSuper(AntomElement);
|
152
124
|
function AntomElement(options) {
|
153
125
|
_classCallCheck(this, AntomElement);
|
154
126
|
var _options = Object.assign({}, options, {
|
155
|
-
product:
|
127
|
+
product: ProductSceneEnum.ELEMENT_PAYMENT,
|
156
128
|
appVersion: AMSPaymentElementAppVersion
|
157
129
|
});
|
158
|
-
return
|
130
|
+
return _super6.call(this, _options, [ComponentSignEnum.ELEMENT_PAYMENT]);
|
159
131
|
}
|
160
132
|
return _createClass(AntomElement);
|
161
133
|
}(AMSCheckout);
|
162
134
|
export var AddressElement = /*#__PURE__*/function (_AddressComponent) {
|
163
135
|
_inherits(AddressElement, _AddressComponent);
|
164
|
-
var
|
136
|
+
var _super7 = _createSuper(AddressElement);
|
165
137
|
function AddressElement(options) {
|
166
138
|
_classCallCheck(this, AddressElement);
|
167
139
|
var _options = Object.assign({}, options, {
|
168
|
-
product:
|
140
|
+
product: ProductSceneEnum.ELEMENT_ADDRESS,
|
169
141
|
appVersion: ADDRESSElementAppVersion
|
170
142
|
});
|
171
|
-
return
|
143
|
+
return _super7.call(this, _options);
|
172
144
|
}
|
173
145
|
return _createClass(AddressElement);
|
174
146
|
}(AddressComponent);
|
175
|
-
export
|
147
|
+
export var Element = /*#__PURE__*/function (_ElementComponent) {
|
148
|
+
_inherits(Element, _ElementComponent);
|
149
|
+
var _super8 = _createSuper(Element);
|
150
|
+
function Element(options) {
|
151
|
+
_classCallCheck(this, Element);
|
152
|
+
var _options = Object.assign({}, options, {
|
153
|
+
product: ProductSceneEnum.ELEMENT_PAYMENT,
|
154
|
+
environment: options.environment
|
155
|
+
});
|
156
|
+
return _super8.call(this, _options);
|
157
|
+
}
|
158
|
+
return _createClass(Element);
|
159
|
+
}(ElementComponent);
|
160
|
+
export default AMSCheckout;
|
161
|
+
export var AMSEasyPay = /*#__PURE__*/function () {
|
162
|
+
function AMSEasyPay(options) {
|
163
|
+
_classCallCheck(this, AMSEasyPay);
|
164
|
+
_defineProperty(this, "core", void 0);
|
165
|
+
this.core = new AntomSDKCore();
|
166
|
+
this.core.registerProcessor(ProductSceneEnum.EASY_PAY, '', new EasySafePayProcessor());
|
167
|
+
this.core.init(options, ProductSceneEnum.EASY_PAY);
|
168
|
+
}
|
169
|
+
_createClass(AMSEasyPay, [{
|
170
|
+
key: "createComponent",
|
171
|
+
value: function createComponent(params) {
|
172
|
+
this.core.startBizFlow({
|
173
|
+
submitPayRequestExtra: {
|
174
|
+
notRedirectAfterComplete: params.notRedirectAfterComplete,
|
175
|
+
merchantAppointParam: params.merchantAppointParam
|
176
|
+
},
|
177
|
+
paymentSession: params.sessionData || params.paymentSessionData,
|
178
|
+
displayInfo: {
|
179
|
+
type: DisplayTypeEnum.popup
|
180
|
+
},
|
181
|
+
isAppWebview: params.isAppWebview
|
182
|
+
});
|
183
|
+
}
|
184
|
+
}]);
|
185
|
+
return AMSEasyPay;
|
186
|
+
}();
|
@@ -15,7 +15,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
15
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
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
17
|
*/
|
18
|
-
import {
|
18
|
+
import { EnvironmentEnum, eventCodeEnum, ProductSceneEnum } from "../../types";
|
19
19
|
import ApplePayService from "./service";
|
20
20
|
import { getApplePayPaymentSession, submitPayInfo } from "../../service";
|
21
21
|
import { BusManager, BusMessage } from "../../core/bus";
|
@@ -46,9 +46,9 @@ var ApplePayComponent = /*#__PURE__*/function () {
|
|
46
46
|
_defineProperty(this, "isRecurring", false);
|
47
47
|
this.logger = logger;
|
48
48
|
this._options = Object.assign({
|
49
|
-
environment:
|
49
|
+
environment: EnvironmentEnum.prod
|
50
50
|
}, options, {
|
51
|
-
product:
|
51
|
+
product: ProductSceneEnum.CARD_APPLE_PAY
|
52
52
|
});
|
53
53
|
this._applePayService = new ApplePayService(logger);
|
54
54
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
* 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.
|
7
7
|
*/
|
8
8
|
import { IGetMerchantSession, ICompletePaymentAuthorized, ICompleteApplePay, ILogError } from './interface';
|
9
|
-
import { ApplePaySubTypeEnum,
|
9
|
+
import { ApplePaySubTypeEnum, IPaymentSessionMetaData } from '../../types';
|
10
10
|
import type { Logger } from '../../util/logger';
|
11
11
|
/**
|
12
12
|
* Apple Pay Service
|
@@ -49,6 +49,6 @@ declare class ApplePayService {
|
|
49
49
|
/**
|
50
50
|
* Start Pay
|
51
51
|
*/
|
52
|
-
startPay: (param:
|
52
|
+
startPay: (param: IPaymentSessionMetaData) => void;
|
53
53
|
}
|
54
54
|
export default ApplePayService;
|
@@ -1,16 +1,17 @@
|
|
1
|
-
import {
|
2
|
-
export declare const getAppPath: (environment: string, appVersion: string, componentSign:
|
1
|
+
import { ComponentSignEnum, Ianalytics, DisplayTypeEnum } from '../../types';
|
2
|
+
export declare const getAppPath: (environment: string, appVersion: string, componentSign: ComponentSignEnum, productScene: string, productSceneVersion: string, extendInfo: string, mid: string, sendLog?: boolean, elementLink?: string) => any;
|
3
3
|
export declare const getAppDomain: (domainParams: {
|
4
4
|
environment: string;
|
5
5
|
appVersion: string;
|
6
|
-
componentSign:
|
6
|
+
componentSign: ComponentSignEnum;
|
7
7
|
productScene: string;
|
8
8
|
productSceneVersion: string;
|
9
9
|
extendInfo: string;
|
10
10
|
mid: string;
|
11
|
+
elementLink: string;
|
11
12
|
}) => string;
|
12
13
|
export declare const getIframeUrl: (iframeParams: {
|
13
|
-
componentSign:
|
14
|
+
componentSign: ComponentSignEnum;
|
14
15
|
analytics?: Ianalytics;
|
15
16
|
productScene: string;
|
16
17
|
productSceneVersion: string;
|
@@ -19,9 +20,10 @@ export declare const getIframeUrl: (iframeParams: {
|
|
19
20
|
extendInfo?: string;
|
20
21
|
locale?: string;
|
21
22
|
instanceId: string;
|
22
|
-
renderDisplayType:
|
23
|
+
renderDisplayType: DisplayTypeEnum;
|
23
24
|
isPreload?: string;
|
24
25
|
hostSign?: string;
|
26
|
+
elementLink?: string;
|
25
27
|
mid?: string;
|
26
28
|
}) => {
|
27
29
|
path: string;
|
@@ -16,7 +16,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
16
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
17
|
*/
|
18
18
|
import { elementAppMarmotMap, marmotMap, sdkVersion } from "../../config/index";
|
19
|
-
import {
|
19
|
+
import { ComponentSignEnum, ComponentSignEnumV2 } from "../../types";
|
20
20
|
import { isDebugLog } from "../../util/debug";
|
21
21
|
import { queryParse, serialize } from "../../util/index";
|
22
22
|
import { Logger } from "../../util/logger";
|
@@ -59,8 +59,8 @@ var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
|
|
59
59
|
};
|
60
60
|
var getFinalProductSceneVersion = function getFinalProductSceneVersion(componentSign, productSceneVersion) {
|
61
61
|
var _signSupportMap;
|
62
|
-
var signSupportMap = (_signSupportMap = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_signSupportMap,
|
63
|
-
var supportProductSceneVersion = signSupportMap[componentSign];
|
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
64
|
// 从左到右,从旧到新
|
65
65
|
var isSupport = supportProductSceneVersion.find(function (it) {
|
66
66
|
return it === productSceneVersion;
|
@@ -77,6 +77,7 @@ export var getAppPath = function getAppPath() {
|
|
77
77
|
var extendInfo = arguments.length > 5 ? arguments[5] : undefined;
|
78
78
|
var mid = arguments.length > 6 ? arguments[6] : undefined;
|
79
79
|
var sendLog = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
80
|
+
var elementLink = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : '';
|
80
81
|
var _ref = queryParse() || {},
|
81
82
|
urlTestHost = _ref.host;
|
82
83
|
var upgradeAppVersion = getAppVersion(extendInfo, productScene, mid, sendLog);
|
@@ -94,11 +95,14 @@ export var getAppPath = function getAppPath() {
|
|
94
95
|
}
|
95
96
|
var finalProductSceneVersion = getFinalProductSceneVersion(componentSign, productSceneVersion);
|
96
97
|
// only for test while testurl?host=https://xxxxx.test.html
|
98
|
+
if (elementLink) {
|
99
|
+
return elementLink;
|
100
|
+
}
|
97
101
|
if (urlTestHost && !['sandbox', 'light_sandbox', 'prod'].includes(environment)) {
|
98
102
|
return urlTestHost;
|
99
103
|
}
|
100
104
|
// 地址应用特殊处理
|
101
|
-
if (componentSign ===
|
105
|
+
if (componentSign === ComponentSignEnum.ELEMENT_ADDRESS) {
|
102
106
|
return "".concat(elementAppMarmotMap[environment], "/element-address/").concat(finalAppVersion, "/pages/address/index.html");
|
103
107
|
}
|
104
108
|
// element应用特殊处理
|
@@ -127,9 +131,10 @@ export var getAppDomain = function getAppDomain(domainParams) {
|
|
127
131
|
productScene = domainParams.productScene,
|
128
132
|
productSceneVersion = domainParams.productSceneVersion,
|
129
133
|
extendInfo = domainParams.extendInfo,
|
130
|
-
mid = domainParams.mid
|
134
|
+
mid = domainParams.mid,
|
135
|
+
elementLink = domainParams.elementLink;
|
131
136
|
var reg = /^https?:\/\/([^/<>\s]+\.?)*/;
|
132
|
-
var macth = reg.exec(getAppPath(environment, appVersion, componentSign, productScene, productSceneVersion, extendInfo, mid));
|
137
|
+
var macth = reg.exec(getAppPath(environment, appVersion, componentSign, productScene, productSceneVersion, extendInfo, mid, false, elementLink));
|
133
138
|
return macth && macth[0] || '';
|
134
139
|
};
|
135
140
|
export var getIframeUrl = function getIframeUrl(iframeParams) {
|
@@ -151,8 +156,10 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
151
156
|
_iframeParams$hostSig = iframeParams.hostSign,
|
152
157
|
hostSign = _iframeParams$hostSig === void 0 ? '' : _iframeParams$hostSig,
|
153
158
|
_iframeParams$mid = iframeParams.mid,
|
154
|
-
mid = _iframeParams$mid === void 0 ? '' : _iframeParams$mid
|
155
|
-
|
159
|
+
mid = _iframeParams$mid === void 0 ? '' : _iframeParams$mid,
|
160
|
+
_iframeParams$element = iframeParams.elementLink,
|
161
|
+
elementLink = _iframeParams$element === void 0 ? '' : _iframeParams$element;
|
162
|
+
var path = getAppPath(environment, appVersion, componentSign, productScene, productSceneVersion, extendInfo || '', mid, true, elementLink);
|
156
163
|
var appMatched = getMatchAppVersion(extendInfo, {
|
157
164
|
sdkVersion: sdkVersion,
|
158
165
|
productScene: productScene,
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type {
|
2
|
-
type IChannelBehavior = {
|
1
|
+
import type { EventPayload, IPaymentSessionMetaData } from '../../types';
|
2
|
+
export type IChannelBehavior = {
|
3
3
|
usePaymentSessionAsQueryResult: boolean;
|
4
4
|
submitPayInSdk: boolean;
|
5
5
|
createIframeNode: boolean;
|
@@ -15,7 +15,7 @@ type GetDoubleFaParams = {
|
|
15
15
|
env: string;
|
16
16
|
sdkVersion: string;
|
17
17
|
};
|
18
|
-
export declare function getChannelBehavior(paymentSessionMetaData?:
|
18
|
+
export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData): IChannelBehavior | undefined;
|
19
19
|
export declare function getDoubleFaUrl(params: GetDoubleFaParams): string;
|
20
|
-
export declare const handleGooglePay: (data:
|
20
|
+
export declare const handleGooglePay: (data: EventPayload) => Promise<unknown>;
|
21
21
|
export {};
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import {
|
1
|
+
import { ComponentSignEnum, PlatformEnum } from '../../types';
|
2
2
|
interface Options {
|
3
|
-
componentSign?:
|
3
|
+
componentSign?: ComponentSignEnum;
|
4
4
|
type: 'tabs' | 'Accordion';
|
5
5
|
isExpressCheckout?: boolean;
|
6
6
|
}
|
7
7
|
export declare const inlineComponentAddCss: () => void;
|
8
|
-
export declare const addInlineLoading: (_selector: HTMLDivElement, platform:
|
9
|
-
export declare const createInlineBaseElement: (selector: string) => HTMLDivElement;
|
8
|
+
export declare const addInlineLoading: (_selector: HTMLDivElement, platform: PlatformEnum, options: Options) => void;
|
9
|
+
export declare const createInlineBaseElement: (selector: string, containerId?: string, selectorId?: string) => HTMLDivElement;
|
10
10
|
export {};
|
@@ -6,7 +6,7 @@
|
|
6
6
|
* 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.
|
7
7
|
*/
|
8
8
|
import { COMPONENT_CONTAINER_ID, COMPONENT_IFRAME_TAG_ID, INLINE_BASE_STYLE_ID, INLINE_IMG_CLASSNAME, LOADING_ID } from "../../constant";
|
9
|
-
import {
|
9
|
+
import { ComponentSignEnum, PlatformEnum } from "../../types";
|
10
10
|
import { amsSetSize } from "../../util";
|
11
11
|
// border-radius: 8px;
|
12
12
|
var inlineComponentCss = "#".concat(COMPONENT_IFRAME_TAG_ID, "-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(COMPONENT_IFRAME_TAG_ID, "-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(COMPONENT_CONTAINER_ID, "-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(LOADING_ID, "{\n width: 100%;\n flex: 1;\n}\n.").concat(INLINE_IMG_CLASSNAME, "{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(INLINE_IMG_CLASSNAME, "-mobile{\n padding: 0 0.16em;\n}\n.").concat(INLINE_IMG_CLASSNAME, "-desktop{}\n");
|
@@ -18,7 +18,7 @@ export var inlineComponentAddCss = function inlineComponentAddCss() {
|
|
18
18
|
document.head.appendChild(style);
|
19
19
|
};
|
20
20
|
/**
|
21
|
-
* @description
|
21
|
+
* @description ComponentSignEnum.ELEMENT_PAYMENT特殊处理
|
22
22
|
* @param {Options['type']} type
|
23
23
|
*/
|
24
24
|
var renderElementPayment = function renderElementPayment(type) {
|
@@ -95,25 +95,27 @@ var renderElementPayment = function renderElementPayment(type) {
|
|
95
95
|
export var addInlineLoading = function addInlineLoading(_selector, platform, options) {
|
96
96
|
var loading = document.createElement('div');
|
97
97
|
loading.id = LOADING_ID;
|
98
|
-
if (options.componentSign ===
|
98
|
+
if (options.componentSign === ComponentSignEnum.ELEMENT_PAYMENT) {
|
99
99
|
if (options.isExpressCheckout) {
|
100
100
|
loading.innerHTML = '';
|
101
101
|
} else {
|
102
102
|
loading.innerHTML = renderElementPayment(options === null || options === void 0 ? void 0 : options.type);
|
103
103
|
}
|
104
|
-
} else if (platform ===
|
104
|
+
} else if (platform === PlatformEnum.desktop) loading.innerHTML = "<svg class=\"".concat(INLINE_IMG_CLASSNAME, " ").concat(INLINE_IMG_CLASSNAME, "-").concat(platform, "\" width=\"740\" height=\"360\" viewBox=\"0 0 740 360\" fill=\"none\" xmlns=\"\">\n <rect width=\"740\" height=\"360\" rx=\"12\" fill=\"#F6F6F6\"/>\n <rect opacity=\"0.7\" x=\"44\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"94\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"144\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z\" fill=\"#E1E6ED\"/>\n </g>\n </svg>");else if (platform === PlatformEnum.mobile) loading.innerHTML = "<svg class=\"".concat(INLINE_IMG_CLASSNAME, " ").concat(INLINE_IMG_CLASSNAME, "-").concat(platform, "\" width=\"358\" height=\"186\" viewBox=\"0 0 358 186\" fill=\"none\" xmlns=\"\">\n <g clip-path=\"url(#clip0_2543_91192)\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n <g clip-path=\"url(#clip1_2543_91192)\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n <rect width=\"358\" height=\"40\" fill=\"white\"/>\n <rect opacity=\"0.7\" x=\"4\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"54\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"104\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <g clip-path=\"url(#clip2_2543_91192)\">\n <rect width=\"358\" height=\"120\" transform=\"translate(0 66)\" fill=\"white\"/>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z\" fill=\"#E1E6ED\"/>\n </g>\n <g clip-path=\"url(#clip3_2543_91192)\">\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z\" fill=\"#E1E6ED\"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id=\"clip0_2543_91192\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n </clipPath>\n <clipPath id=\"clip1_2543_91192\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n </clipPath>\n <clipPath id=\"clip2_2543_91192\">\n <rect width=\"358\" height=\"120\" fill=\"white\" transform=\"translate(0 66)\"/>\n </clipPath>\n <clipPath id=\"clip3_2543_91192\">\n <rect width=\"358\" height=\"92\" fill=\"white\" transform=\"translate(0 94)\"/>\n </clipPath>\n </defs>\n </svg>\n ");
|
105
105
|
if (_selector) _selector.appendChild(loading);
|
106
106
|
var loadingDom = document.getElementById(LOADING_ID);
|
107
107
|
amsSetSize(null, loadingDom);
|
108
108
|
};
|
109
109
|
export var createInlineBaseElement = function createInlineBaseElement(selector) {
|
110
|
+
var containerId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : COMPONENT_CONTAINER_ID;
|
111
|
+
var selectorId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
110
112
|
var inlineBaseStyle = document.getElementById(INLINE_BASE_STYLE_ID);
|
111
113
|
if (!inlineBaseStyle) inlineComponentAddCss();
|
112
|
-
if (document.getElementById(
|
114
|
+
if (document.getElementById(selectorId ? selectorId : containerId)) return;
|
113
115
|
var amsComponentContainer = document.createElement('div');
|
114
|
-
amsComponentContainer.className = "".concat(
|
115
|
-
amsComponentContainer.id =
|
116
|
-
var selectorDom = document.querySelector(selector);
|
116
|
+
amsComponentContainer.className = "".concat(containerId, "-inline");
|
117
|
+
amsComponentContainer.id = selectorId ? selectorId : containerId;
|
118
|
+
var selectorDom = document.querySelector("".concat(selector));
|
117
119
|
if (selectorDom) selectorDom.appendChild(amsComponentContainer);
|
118
120
|
return amsComponentContainer;
|
119
121
|
};
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import {
|
1
|
+
import { PlatformEnum } from '../../types';
|
2
2
|
export declare const componentAddCSS: () => void;
|
3
|
-
export declare const createBaseElement: (platform:
|
4
|
-
export declare const createCloseBtn: (platform:
|
5
|
-
export declare const createRetentionPopup: (platform:
|
3
|
+
export declare const createBaseElement: (platform: PlatformEnum, closeBtnFunc: () => void) => HTMLDivElement;
|
4
|
+
export declare const createCloseBtn: (platform: PlatformEnum, closeBtnFunc: () => void) => void;
|
5
|
+
export declare const createRetentionPopup: (platform: PlatformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
|
6
6
|
export declare const hideRetentionPopup: () => void;
|
7
|
-
export declare const removeRetentionPopup: (platform:
|
7
|
+
export declare const removeRetentionPopup: (platform: PlatformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
|
8
8
|
export declare const createMockup: (options: {
|
9
|
-
platform:
|
9
|
+
platform: PlatformEnum;
|
10
10
|
onClickOutside: () => void;
|
11
11
|
}) => void;
|
12
12
|
export declare const addPopupLoading: () => void;
|
@@ -6,9 +6,9 @@
|
|
6
6
|
* 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.
|
7
7
|
*/
|
8
8
|
import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../../constant";
|
9
|
-
import {
|
9
|
+
import { PlatformEnum } from "../../types";
|
10
10
|
import { addSetFontSizeEvent, amsSetSize, getDesignFontSize } from "../../util";
|
11
|
-
var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n
|
11
|
+
var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
|
12
12
|
export var componentAddCSS = function componentAddCSS() {
|
13
13
|
var style = document.createElement('style');
|
14
14
|
style.type = 'text/css';
|
@@ -34,7 +34,7 @@ export var createBaseElement = function createBaseElement(platform, closeBtnFunc
|
|
34
34
|
return amsComponentContainer;
|
35
35
|
};
|
36
36
|
export var createCloseBtn = function createCloseBtn(platform, closeBtnFunc) {
|
37
|
-
var clickEventName = platform ===
|
37
|
+
var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
|
38
38
|
var container = document.getElementById(COMPONENT_CONTAINER_ID);
|
39
39
|
// close btn
|
40
40
|
var closeBtnHTML = "<img class='".concat(COMPONENT_CLOSE_BLOCK_ID, "-btn-").concat(platform, "' src=\"").concat(closeImg, "\"/>");
|
@@ -48,7 +48,7 @@ export var createCloseBtn = function createCloseBtn(platform, closeBtnFunc) {
|
|
48
48
|
if (container) container.appendChild(closeBlock);
|
49
49
|
};
|
50
50
|
export var createRetentionPopup = function createRetentionPopup(platform, remainBtnFunc, leaveBtnFunc) {
|
51
|
-
var clickEventName = platform ===
|
51
|
+
var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
|
52
52
|
// retention popup
|
53
53
|
var retentionPopup = document.createElement('div');
|
54
54
|
retentionPopup.id = COMPONENT_RETENTION_ID;
|
@@ -78,7 +78,7 @@ export var hideRetentionPopup = function hideRetentionPopup() {
|
|
78
78
|
};
|
79
79
|
export var removeRetentionPopup = function removeRetentionPopup(platform, remainBtnFunc, leaveBtnFunc) {
|
80
80
|
var _document$getElementB;
|
81
|
-
var clickEventName = platform ===
|
81
|
+
var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
|
82
82
|
var remainBtn = document.getElementById("".concat(COMPONENT_RETENTION_ID, "-remain"));
|
83
83
|
if (remainBtn) {
|
84
84
|
remainBtn.removeEventListener(clickEventName, remainBtnFunc);
|
@@ -90,7 +90,7 @@ export var removeRetentionPopup = function removeRetentionPopup(platform, remain
|
|
90
90
|
(_document$getElementB = document.getElementById(COMPONENT_RETENTION_ID)) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
91
91
|
};
|
92
92
|
export var createMockup = function createMockup(options) {
|
93
|
-
var clickEventName = (options === null || options === void 0 ? void 0 : options.platform) ===
|
93
|
+
var clickEventName = (options === null || options === void 0 ? void 0 : options.platform) === PlatformEnum.mobile ? 'touchend' : 'click';
|
94
94
|
var body = document.getElementsByTagName('body')[0];
|
95
95
|
body.style.overflow = 'hidden';
|
96
96
|
var mockup = document.createElement('div');
|