@alipay/ams-checkout 1.25.1 → 1.26.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.
Files changed (55) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/component/channel.js +1 -1
  3. package/esm/component/component.popup.style.d.ts +2 -0
  4. package/esm/component/component.popup.style.js +15 -2
  5. package/esm/config/index.d.ts +7 -7
  6. package/esm/config/index.js +7 -7
  7. package/esm/constant/index.d.ts +4 -0
  8. package/esm/constant/index.js +4 -0
  9. package/esm/core/bus/index.d.ts +3 -3
  10. package/esm/core/bus/index.js +14 -14
  11. package/esm/core/component/appPreloadProcessing.js +2 -2
  12. package/esm/core/component/ckp/index.js +6 -3
  13. package/esm/core/component/element/index.js +5 -4
  14. package/esm/core/component/element/type.d.ts +3 -2
  15. package/esm/core/component/element/type.js +1 -0
  16. package/esm/core/component/index.js +6 -10
  17. package/esm/core/instance/index.js +3 -3
  18. package/esm/foundation/core/index.d.ts +1 -0
  19. package/esm/foundation/core/index.js +25 -12
  20. package/esm/foundation/product-processor/easysafepay/index.js +17 -16
  21. package/esm/foundation/service/api-bus/busManager.d.ts +3 -3
  22. package/esm/foundation/service/api-bus/busManager.js +14 -14
  23. package/esm/foundation/service/container/index.d.ts +2 -0
  24. package/esm/foundation/service/container/index.js +31 -1
  25. package/esm/foundation/service/event-center.d.ts +3 -2
  26. package/esm/foundation/service/event-center.js +29 -9
  27. package/esm/foundation/service/log/index.d.ts +2 -2
  28. package/esm/foundation/service/log/index.js +23 -8
  29. package/esm/foundation/service/log/keys.d.ts +13 -0
  30. package/esm/foundation/service/log/keys.js +103 -0
  31. package/esm/foundation/service/log/processor.d.ts +9 -0
  32. package/esm/foundation/service/log/processor.js +148 -0
  33. package/esm/foundation/service/log/types.d.ts +1 -1
  34. package/esm/foundation/service/requester/requester.js +3 -0
  35. package/esm/foundation/service/security/index.js +6 -8
  36. package/esm/foundation/utils/redirect_utils.js +1 -2
  37. package/esm/index.js +1 -1
  38. package/esm/plugin/applepay/component.js +10 -8
  39. package/esm/plugin/applepay/index.js +10 -6
  40. package/esm/plugin/applepay/service.js +24 -16
  41. package/esm/plugin/component/cashierApp.js +3 -3
  42. package/esm/plugin/component/channel.js +1 -1
  43. package/esm/plugin/component/component.popup.style.d.ts +8 -0
  44. package/esm/plugin/component/component.popup.style.js +22 -2
  45. package/esm/plugin/component/index.d.ts +2 -0
  46. package/esm/plugin/component/index.js +66 -27
  47. package/esm/plugin/paypal/index.js +1 -1
  48. package/esm/service/index.js +4 -2
  49. package/esm/util/getBackScheme.js +1 -2
  50. package/esm/util/index.js +4 -8
  51. package/esm/util/logger.d.ts +3 -3
  52. package/esm/util/logger.js +49 -13
  53. package/esm/util/spm-map.d.ts +172 -0
  54. package/esm/util/spm-map.js +172 -0
  55. package/package.json +1 -1
@@ -0,0 +1,148 @@
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ 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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
+ import { LogComplianceExtendKeys, KEYS } from "./keys";
9
+ export var LogComplianceProcessor = /*#__PURE__*/function () {
10
+ function LogComplianceProcessor() {
11
+ _classCallCheck(this, LogComplianceProcessor);
12
+ }
13
+ _createClass(LogComplianceProcessor, null, [{
14
+ key: "extractComplianceParams",
15
+ value: function extractComplianceParams(eventName, params, errorLogCallback) {
16
+ var _this = this;
17
+ try {
18
+ // 触发防抖上报
19
+ logDebounceTracker.track(function () {
20
+ _this.flushAbnormalInfo(errorLogCallback);
21
+ });
22
+ // 事件名检测
23
+ var isSpmId = eventName ? eventName.includes('.') : false;
24
+ if (!isSpmId) {
25
+ // 非SPM,说明是未做映射的,需要加到埋点里面
26
+ this.reportHasAbnormalEventName(eventName);
27
+ }
28
+ var newParams = {};
29
+ // 逐个字段检查
30
+ for (var _i = 0, _Object$keys = Object.keys(params); _i < _Object$keys.length; _i++) {
31
+ var key = _Object$keys[_i];
32
+ // 如果当前字段不在合规表中,说明是未合规字段,剔除并且上报异常
33
+ if (key in LogComplianceExtendKeys.complianceExtParams) {
34
+ newParams[key] = "".concat(params[key]);
35
+ } else {
36
+ // 如果当前字段不在合规表中,说明是未合规字段,剔除并且上报异常
37
+ this.reportHasIllegalExtendInfoKey(eventName, key);
38
+ }
39
+ }
40
+ return newParams;
41
+ } catch (error) {
42
+ console.error(error);
43
+ return {};
44
+ }
45
+ }
46
+ }, {
47
+ key: "reportHasAbnormalEventName",
48
+ value: function reportHasAbnormalEventName(eventName) {
49
+ this.abnormalEventNameSet.add(eventName);
50
+ }
51
+ }, {
52
+ key: "reportHasIllegalExtendInfoKey",
53
+ value: function reportHasIllegalExtendInfoKey(eventName, key) {
54
+ if (!this.nonComplianceEventKeys[eventName]) {
55
+ this.nonComplianceEventKeys[eventName] = new Set();
56
+ }
57
+ this.nonComplianceEventKeys[eventName].add(key);
58
+ }
59
+ }, {
60
+ key: "flushAbnormalInfo",
61
+ value: function flushAbnormalInfo(errorLogCallback) {
62
+ try {
63
+ var _this$abnormalEventNa;
64
+ if (((_this$abnormalEventNa = this.abnormalEventNameSet) === null || _this$abnormalEventNa === void 0 ? void 0 : _this$abnormalEventNa.size) > 0) {
65
+ // 不正常的事件名按|分割
66
+ // Abnormal event use event name with divider "|"
67
+ var abnormalEventNames = Array.from(this.abnormalEventNameSet).join('|');
68
+ errorLogCallback && errorLogCallback({
69
+ title: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_NAME.spmId
70
+ }, {
71
+ eventAlias: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_NAME.alias,
72
+ errorMessage: abnormalEventNames
73
+ });
74
+ this.abnormalEventNameSet.clear();
75
+ }
76
+ // process nonComplianceEventKeys
77
+ // eg: if sdk_event_createComponent has key1,key2,key3
78
+ // sdk_event_createComponent>key1+key2+key3|otherEventName>key1+key2+key3
79
+ var nonComplianceEventKeysList = [];
80
+ if (Object.keys(this.nonComplianceEventKeys).length === 0) {
81
+ return;
82
+ }
83
+ for (var eventName in this.nonComplianceEventKeys) {
84
+ var keys = this.nonComplianceEventKeys[eventName];
85
+ var keyStr = "".concat(eventName, ">").concat(Array.from(keys).join('+'));
86
+ nonComplianceEventKeysList.push(keyStr);
87
+ }
88
+ var nonComplianceEventKeysLogString = nonComplianceEventKeysList.join('|');
89
+ errorLogCallback && errorLogCallback({
90
+ title: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_EXT_INFO.spmId
91
+ }, {
92
+ eventAlias: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_EXT_INFO.alias,
93
+ errorMessage: nonComplianceEventKeysLogString
94
+ });
95
+ this.nonComplianceEventKeys = {};
96
+ } catch (error) {
97
+ console.error(error);
98
+ }
99
+ }
100
+ }]);
101
+ return LogComplianceProcessor;
102
+ }();
103
+ // 记录不正常的事件名
104
+ _defineProperty(LogComplianceProcessor, "abnormalEventNameSet", new Set());
105
+ // 记录不合规的扩展字段,KEY是事件名,VALUE是非合规扩展字段列表
106
+ _defineProperty(LogComplianceProcessor, "nonComplianceEventKeys", {});
107
+ var LogDebounceTracker = /*#__PURE__*/function () {
108
+ function LogDebounceTracker() {
109
+ var debounceTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5000;
110
+ _classCallCheck(this, LogDebounceTracker);
111
+ _defineProperty(this, "timeoutId", void 0);
112
+ _defineProperty(this, "debounceTime", void 0);
113
+ this.timeoutId = null;
114
+ this.debounceTime = debounceTime;
115
+ }
116
+ _createClass(LogDebounceTracker, [{
117
+ key: "track",
118
+ value: function track(callback) {
119
+ this.debounce(callback);
120
+ }
121
+
122
+ // 防抖实现
123
+ }, {
124
+ key: "debounce",
125
+ value: function debounce(callback) {
126
+ var _this2 = this;
127
+ if (this.timeoutId) {
128
+ clearTimeout(this.timeoutId);
129
+ }
130
+ this.timeoutId = setTimeout(function () {
131
+ _this2.report(callback);
132
+ _this2.reset();
133
+ }, this.debounceTime);
134
+ }
135
+ }, {
136
+ key: "report",
137
+ value: function report(callback) {
138
+ callback && callback();
139
+ }
140
+ }, {
141
+ key: "reset",
142
+ value: function reset() {
143
+ this.timeoutId = null;
144
+ }
145
+ }]);
146
+ return LogDebounceTracker;
147
+ }();
148
+ var logDebounceTracker = new LogDebounceTracker();
@@ -20,7 +20,7 @@ export interface LogMetaData {
20
20
  firstLogTime?: number;
21
21
  fsDuration?: number;
22
22
  instanceId?: string;
23
- storageId?: string;
23
+ deviceId?: string;
24
24
  renderDisplayType?: string;
25
25
  merchantId?: string;
26
26
  productScene?: string;
@@ -80,6 +80,7 @@ export var RequesterService = /*#__PURE__*/function () {
80
80
  errorMessage = (resData === null || resData === void 0 ? void 0 : resData.errorMessage) || (handleGetWayError === null || handleGetWayError === void 0 ? void 0 : handleGetWayError.errorMessage);
81
81
  errorCode = handleGetWayError === null || handleGetWayError === void 0 ? void 0 : handleGetWayError.errorCode;
82
82
  this.reportRequestTimeCost({
83
+ title: 'a3753.b101271.c388193.d521387',
83
84
  name: options === null || options === void 0 ? void 0 : options['Operation-Type'],
84
85
  label: 'request',
85
86
  time: Date.now() - startTime,
@@ -95,6 +96,7 @@ export var RequesterService = /*#__PURE__*/function () {
95
96
  }));
96
97
  case 20:
97
98
  this.reportRequestTimeCost({
99
+ title: 'a3753.b101271.c388193.d521387',
98
100
  name: options === null || options === void 0 ? void 0 : options['Operation-Type'],
99
101
  label: 'request',
100
102
  time: Date.now() - startTime,
@@ -116,6 +118,7 @@ export var RequesterService = /*#__PURE__*/function () {
116
118
  timeoutCode = _context.t0 !== null && _context.t0 !== void 0 && (_error$message = _context.t0.message) !== null && _error$message !== void 0 && _error$message.includes('timeout') ? errorEnum.TIMEOUT : '';
117
119
  _errorCode = (_error === null || _error === void 0 ? void 0 : _error.errorCode) || timeoutCode;
118
120
  this.reportRequestTimeCost({
121
+ title: 'a3753.b101271.c388193.d521387',
119
122
  name: options === null || options === void 0 ? void 0 : options['Operation-Type'],
120
123
  label: 'request',
121
124
  time: Date.now() - startTime,
@@ -169,8 +169,8 @@ export var SecurityService = /*#__PURE__*/function () {
169
169
  _this2.logger.logError({
170
170
  title: 'sdk_error_securitySdkInitTimeout'
171
171
  }, {
172
- product: _this2.productScene,
173
- sign: isPre ? 'Active initialization' : 'SDK internal initialization'
172
+ productScene: _this2.productScene,
173
+ eventMessage: isPre ? 'Active initialization' : 'SDK internal initialization'
174
174
  }).send();
175
175
  reject();
176
176
  }, timeout);
@@ -182,7 +182,7 @@ export var SecurityService = /*#__PURE__*/function () {
182
182
  _this2.logger.logInfo({
183
183
  title: "sdk_event_securitySdk".concat(sdkAction, "Success")
184
184
  }, isPre ? {
185
- product: _this2.productScene
185
+ productScene: _this2.productScene
186
186
  } : undefined).send();
187
187
  resolve();
188
188
  }, function (msg) {
@@ -190,7 +190,7 @@ export var SecurityService = /*#__PURE__*/function () {
190
190
  title: 'sdk_error_securitySdkInitFailed',
191
191
  msg: msg || undefined
192
192
  }, {
193
- product: _this2.productScene,
193
+ productScene: _this2.productScene,
194
194
  sign: isPre ? 'Active initialization' : 'SDK internal initialization'
195
195
  }).send();
196
196
  reject();
@@ -215,15 +215,13 @@ export var SecurityService = /*#__PURE__*/function () {
215
215
  this.logger.logInfo({
216
216
  title: 'sdk_event_securitySdkGetTokenSuccess'
217
217
  }, {
218
- deviceId: deviceId,
219
- time: time
218
+ eventMessage: time
220
219
  }).send();
221
220
  } else {
222
221
  this.logger.logInfo({
223
222
  title: 'sdk_error_securitySdkGetTokenFailed'
224
223
  }, {
225
- deviceId: deviceId,
226
- time: time
224
+ eventMessage: time
227
225
  }).send();
228
226
  }
229
227
  }
@@ -240,8 +240,7 @@ function logBackScheme(logger, userAgent, scheme) {
240
240
  logger.logInfo({
241
241
  title: 'a3753.b101271.c377460'
242
242
  }, {
243
- userAgent: userAgent,
244
- backScheme: scheme
243
+ eventMessage: scheme
245
244
  });
246
245
  }
247
246
  }
package/esm/index.js CHANGED
@@ -98,7 +98,7 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout3) {
98
98
  logger.logError({
99
99
  title: 'performance_optimization_get_previousChannel_error'
100
100
  }, {
101
- error: error
101
+ errorMessage: error
102
102
  });
103
103
  }
104
104
  return _super4.call(this, _options, currentChannelType);
@@ -82,13 +82,15 @@ var ApplePayComponent = /*#__PURE__*/function () {
82
82
  name: 'APPLE_PAY',
83
83
  title: ApplePayComponentEvent.sdk_event_applePaymentResult
84
84
  }, {
85
- biz: 'sdk',
86
- type: 'funnel',
87
- success: eventCodeEnum.SDK_PAYMENT_SUCCESSFUL === (state === null || state === void 0 ? void 0 : state.code),
85
+ eventSource: 'sdk',
86
+ processResult: eventCodeEnum.SDK_PAYMENT_SUCCESSFUL === (state === null || state === void 0 ? void 0 : state.code),
88
87
  code: state === null || state === void 0 ? void 0 : state.code,
89
- errorCode: state === null || state === void 0 || (_state$result = state.result) === null || _state$result === void 0 ? void 0 : _state$result.errorCode,
88
+ extSdkError: state === null || state === void 0 || (_state$result = state.result) === null || _state$result === void 0 ? void 0 : _state$result.errorCode,
90
89
  errorMessage: state === null || state === void 0 || (_state$result2 = state.result) === null || _state$result2 === void 0 ? void 0 : _state$result2.errorMessage,
91
- recurring: this.isRecurring
90
+ eventMessage: JSON.stringify({
91
+ type: 'funnel',
92
+ recurring: this.isRecurring
93
+ })
92
94
  }).send();
93
95
  (_this$_options = this._options) === null || _this$_options === void 0 || _this$_options.onEventCallback(state);
94
96
  }
@@ -118,7 +120,7 @@ var ApplePayComponent = /*#__PURE__*/function () {
118
120
  msg: 'Abnormal paymentSessionData'
119
121
  }, {
120
122
  type: 'error',
121
- biz: 'sdk'
123
+ eventSource: 'sdk'
122
124
  }).send();
123
125
  return;
124
126
  }
@@ -259,7 +261,7 @@ var ApplePayComponent = /*#__PURE__*/function () {
259
261
  title: 'submitPayStatus',
260
262
  msg: res === null || res === void 0 ? void 0 : res.errorStatus
261
263
  }, {
262
- biz: 'sdk'
264
+ eventSource: 'sdk'
263
265
  }).send();
264
266
  if (res !== null && res !== void 0 && res.success || (res === null || res === void 0 ? void 0 : res.errorStatus) === 'U') {
265
267
  return Promise.resolve(res);
@@ -302,7 +304,7 @@ var ApplePayComponent = /*#__PURE__*/function () {
302
304
  msg: error
303
305
  }, {
304
306
  type: 'error',
305
- biz: 'sdk'
307
+ eventSource: 'sdk'
306
308
  }).send();
307
309
  if (_this._isFinish) {
308
310
  return;
@@ -57,10 +57,12 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
57
57
  name: 'APPLE_PAY',
58
58
  title: ApplePayComponentEvent.sdk_event_appleAvailable
59
59
  }, {
60
- biz: 'sdk',
61
- type: 'funnel',
62
- success: canMakePayments,
63
- recurring: subPaymentMethod === 'ApplePayRecurringPayment'
60
+ eventSource: 'sdk',
61
+ processResult: canMakePayments,
62
+ eventMessage: JSON.stringify({
63
+ type: 'funnel',
64
+ recurring: subPaymentMethod === 'ApplePayRecurringPayment'
65
+ })
64
66
  }).send();
65
67
  }
66
68
  }, {
@@ -88,8 +90,10 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
88
90
  name: 'APPLE_PAY',
89
91
  title: ApplePayComponentEvent.sdk_event_appleDestroyComponent
90
92
  }, {
91
- biz: 'sdk',
92
- type: 'funnel'
93
+ eventSource: 'sdk',
94
+ eventMessage: JSON.stringify({
95
+ type: 'funnel'
96
+ })
93
97
  }).send();
94
98
  }
95
99
  }, {
@@ -62,10 +62,12 @@ var ApplePayService = /*#__PURE__*/function () {
62
62
  name: 'APPLE_PAY',
63
63
  title: ApplePayComponentEvent.sdk_event_appleCreateComponent
64
64
  }, {
65
- biz: 'sdk',
66
- type: 'funnel',
67
- success: success,
68
- recurring: _this.isRecurring
65
+ eventSource: 'sdk',
66
+ processResult: success,
67
+ eventMessage: JSON.stringify({
68
+ type: 'funnel',
69
+ recurring: _this.isRecurring
70
+ })
69
71
  }).send();
70
72
  });
71
73
  _defineProperty(this, "onpaymentauthorized", function (event) {
@@ -98,10 +100,12 @@ var ApplePayService = /*#__PURE__*/function () {
98
100
  name: 'APPLE_PAY',
99
101
  title: ApplePayComponentEvent.sdk_event_appleSubmitToken
100
102
  }, {
101
- biz: 'sdk',
102
- type: 'funnel',
103
- success: success,
104
- recurring: _this.isRecurring
103
+ eventSource: 'sdk',
104
+ processResult: success,
105
+ eventMessage: JSON.stringify({
106
+ type: 'funnel',
107
+ recurring: _this.isRecurring
108
+ })
105
109
  }).send();
106
110
  });
107
111
  /**
@@ -122,10 +126,12 @@ var ApplePayService = /*#__PURE__*/function () {
122
126
  name: 'APPLE_PAY',
123
127
  title: ApplePayComponentEvent.sdk_event_appleCreateComponent
124
128
  }, {
125
- biz: 'sdk',
126
- type: 'funnel',
127
- success: ApplePaySession !== null,
128
- recurring: _this.isRecurring
129
+ eventSource: 'sdk',
130
+ processResult: ApplePaySession !== null,
131
+ eventMessage: JSON.stringify({
132
+ type: 'funnel',
133
+ recurring: _this.isRecurring
134
+ })
129
135
  }).send();
130
136
  if (!ApplePaySession) {
131
137
  _this.logError(eventCodeEnum.SDK_PAYMENT_ERROR, "ApplePaySession is only support in Safari");
@@ -200,10 +206,12 @@ var ApplePayService = /*#__PURE__*/function () {
200
206
  name: 'APPLE_PAY',
201
207
  title: ApplePayComponentEvent.sdk_event_appleShowPaymentSheet
202
208
  }, {
203
- biz: 'sdk',
204
- type: 'funnel',
205
- success: true,
206
- recurring: recurringInfo !== null
209
+ eventSource: 'sdk',
210
+ processResult: true,
211
+ eventMessage: JSON.stringify({
212
+ type: 'funnel',
213
+ recurring: recurringInfo !== null
214
+ })
207
215
  }).send();
208
216
  });
209
217
  this.logger = logger;
@@ -35,11 +35,11 @@ var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
35
35
  title: 'sdk_event_appUpgradeInfo'
36
36
  }, {
37
37
  appUpgradeVersion: appVersion,
38
- appUpgraded: appVersion ? true : false,
38
+ processResult: appVersion ? true : false,
39
39
  isPreload: _extendInfo ? false : true,
40
- extendInfo: _extendInfo,
40
+ config: _extendInfo,
41
41
  productScene: productScene,
42
- mid: mid
42
+ merchantId: mid
43
43
  });
44
44
  }
45
45
 
@@ -7,7 +7,7 @@ export function getChannelBehavior(paymentSessionMetaData) {
7
7
  submitPayInSdk: true,
8
8
  createIframeNode: true,
9
9
  loadApp: true,
10
- allowClickOutsideClose: true,
10
+ allowClickOutsideClose: false,
11
11
  buildSubmitPayExtParams: function buildSubmitPayExtParams(params) {
12
12
  var callBackUrl = getDoubleFaUrl(params);
13
13
  return {
@@ -2,12 +2,20 @@ import { PlatformEnum } from '../../types';
2
2
  export declare const componentAddCSS: () => void;
3
3
  export declare const createBaseElement: (platform: PlatformEnum, closeBtnFunc: () => void) => HTMLDivElement;
4
4
  export declare const createCloseBtn: (platform: PlatformEnum, closeBtnFunc: () => void) => void;
5
+ export declare const createMaskCloseButton: (platform: PlatformEnum, closeBtnFunc: () => void) => void;
6
+ /**
7
+ * 弹出离开挽留弹窗
8
+ * @param platform
9
+ * @param remainBtnFunc
10
+ * @param leaveBtnFunc
11
+ */
5
12
  export declare const createRetentionPopup: (platform: PlatformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
6
13
  export declare const hideRetentionPopup: () => void;
7
14
  export declare const removeRetentionPopup: (platform: PlatformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
8
15
  export declare const createMockup: (options: {
9
16
  platform: PlatformEnum;
10
17
  onClickOutside: () => void;
18
+ closeBtnFunc: () => void;
11
19
  }) => void;
12
20
  export declare const addPopupLoading: () => void;
13
21
  export declare const handleDeclareInfo: ({ closeDialogData }: {
@@ -5,10 +5,10 @@
5
5
  * 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
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
- import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../../constant";
8
+ import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../../constant";
9
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\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");
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\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-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\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\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.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\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\n");
12
12
  export var componentAddCSS = function componentAddCSS() {
13
13
  var style = document.createElement('style');
14
14
  style.type = 'text/css';
@@ -47,6 +47,25 @@ export var createCloseBtn = function createCloseBtn(platform, closeBtnFunc) {
47
47
  });
48
48
  if (container) container.appendChild(closeBlock);
49
49
  };
50
+ export var createMaskCloseButton = function createMaskCloseButton(platform, closeBtnFunc) {
51
+ var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
52
+ var closeBtnHTML = "<div class='".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-btn'>\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z\" fill=\"#EEEEEE\"/>\n</svg>\n </div>");
53
+ var closeBlock = document.createElement('div');
54
+ closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-").concat(platform), "".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
55
+ closeBlock.id = COMPONENT_CLOSE_MASK_BLOCK_ID;
56
+ closeBlock.innerHTML = closeBtnHTML;
57
+ closeBlock.addEventListener(clickEventName, function () {
58
+ closeBtnFunc();
59
+ });
60
+ document.body.appendChild(closeBlock);
61
+ };
62
+
63
+ /**
64
+ * 弹出离开挽留弹窗
65
+ * @param platform
66
+ * @param remainBtnFunc
67
+ * @param leaveBtnFunc
68
+ */
50
69
  export var createRetentionPopup = function createRetentionPopup(platform, remainBtnFunc, leaveBtnFunc) {
51
70
  var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
52
71
  // retention popup
@@ -109,6 +128,7 @@ export var createMockup = function createMockup(options) {
109
128
  options === null || options === void 0 || (_options$onClickOutsi = options.onClickOutside) === null || _options$onClickOutsi === void 0 || _options$onClickOutsi.call(options);
110
129
  });
111
130
  body.appendChild(mockup);
131
+ createMaskCloseButton(options === null || options === void 0 ? void 0 : options.platform, options === null || options === void 0 ? void 0 : options.closeBtnFunc);
112
132
  };
113
133
  export var addPopupLoading = function addPopupLoading() {
114
134
  var loading = document.createElement('div');
@@ -85,6 +85,7 @@ export default class ComponentApp {
85
85
  _handleAppMessage(data: EventPayload): void;
86
86
  private logEventCallback;
87
87
  private dismissLoadingFunc;
88
+ private updateMaskCloseBtn;
88
89
  private handleSizeChanged;
89
90
  private handleAuthUrlInfo;
90
91
  private handleRedirect;
@@ -94,6 +95,7 @@ export default class ComponentApp {
94
95
  private isAppAttached;
95
96
  private isWindowVisible;
96
97
  private handleCloseBtnShow;
98
+ private handleMaskCloseBtnShow;
97
99
  /**
98
100
  * @description Send message to SDK
99
101
  */