@alipay/ams-checkout 0.0.1758505806-dev.5 → 0.0.1758607092-dev.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.
@@ -6,10 +6,10 @@ export declare const sdkVersion: string;
6
6
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
7
7
  * TODO 这里考虑直接换成packagejson.version
8
8
  */
9
- export declare const AMSCheckoutAppVersion = "1.44.0";
10
- export declare const AMSAutoDebitAppVersion = "1.44.0";
11
- export declare const AMSEasyPayAppVersion = "1.44.0";
12
- export declare const AMSCashierPaymentAppVersion = "1.44.0";
13
- export declare const AMSVaultingAppVersion = "1.44.0";
14
- export declare const AMSPaymentElementAppVersion = "1.44.0";
15
- export declare const ADDRESSElementAppVersion = "1.44.0";
9
+ export declare const AMSCheckoutAppVersion = "1.43.1";
10
+ export declare const AMSAutoDebitAppVersion = "1.43.1";
11
+ export declare const AMSEasyPayAppVersion = "1.43.1";
12
+ export declare const AMSCashierPaymentAppVersion = "1.43.1";
13
+ export declare const AMSVaultingAppVersion = "1.43.1";
14
+ export declare const AMSPaymentElementAppVersion = "1.43.1";
15
+ export declare const ADDRESSElementAppVersion = "1.43.1";
@@ -36,10 +36,10 @@ export var sdkVersion = json.version;
36
36
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
37
37
  * TODO 这里考虑直接换成packagejson.version
38
38
  */
39
- export var AMSCheckoutAppVersion = '1.44.0'; // 兜底版本号
40
- export var AMSAutoDebitAppVersion = '1.44.0'; // 代扣
41
- export var AMSEasyPayAppVersion = '1.44.0'; // easypay
42
- export var AMSCashierPaymentAppVersion = '1.44.0'; // 收银台(卡、apm)
43
- export var AMSVaultingAppVersion = '1.44.0'; // 绑卡
44
- export var AMSPaymentElementAppVersion = '1.44.0'; // payment element
45
- export var ADDRESSElementAppVersion = '1.44.0'; // address element
39
+ export var AMSCheckoutAppVersion = '1.43.1'; // 兜底版本号
40
+ export var AMSAutoDebitAppVersion = '1.43.1'; // 代扣
41
+ export var AMSEasyPayAppVersion = '1.43.1'; // easypay
42
+ export var AMSCashierPaymentAppVersion = '1.43.1'; // 收银台(卡、apm)
43
+ export var AMSVaultingAppVersion = '1.43.1'; // 绑卡
44
+ export var AMSPaymentElementAppVersion = '1.43.1'; // payment element
45
+ export var ADDRESSElementAppVersion = '1.43.1'; // address element
@@ -240,16 +240,41 @@ export var ContainerService = /*#__PURE__*/function () {
240
240
  }, {
241
241
  key: "updateMaskCloseBtn",
242
242
  value: function updateMaskCloseBtn(data) {
243
- var maskCloseBtn = document.getElementById("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID));
244
- if (maskCloseBtn) {
245
- if (this.displayInfo.platform === 'desktop') {
246
- var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
247
- var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
248
- maskCloseBtn.style.top = "".concat((windowHeight - data.height) / 2 - 42, "px");
249
- maskCloseBtn.style.right = "".concat((windowWidth - data.width) / 2 + 18, "px");
250
- } else {
251
- maskCloseBtn.style.bottom = "".concat(data.height + 2, "px");
252
- }
243
+ var CLOSE_BUTTON_OFFSET_Y = 40;
244
+ var amsComponentContainer = document.getElementById(COMPONENT_CONTAINER_ID);
245
+ var maskCloseBtn = document.getElementById(COMPONENT_CLOSE_MASK_BLOCK_ID);
246
+ if (!maskCloseBtn) return;
247
+
248
+ // Position relative to container, more accurate
249
+ var updateRelativeToContainer = function updateRelativeToContainer() {
250
+ if (!amsComponentContainer || !maskCloseBtn) return;
251
+ var rect = amsComponentContainer.getBoundingClientRect();
252
+ var top = rect.top - CLOSE_BUTTON_OFFSET_Y;
253
+ var left = rect.left + rect.width - maskCloseBtn.offsetWidth;
254
+ maskCloseBtn.style.top = "".concat(top, "px");
255
+ maskCloseBtn.style.left = "".concat(left, "px");
256
+ };
257
+
258
+ // Position relative to window (Old logic)
259
+ var updateRelativeToWindow = function updateRelativeToWindow() {
260
+ if (!maskCloseBtn) return;
261
+ var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
262
+ var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
263
+ maskCloseBtn.style.top = "".concat((windowHeight - data.height) / 2 - 42, "px");
264
+ maskCloseBtn.style.right = "".concat((windowWidth - data.width) / 2 + 18, "px");
265
+ };
266
+ if (amsComponentContainer) {
267
+ updateRelativeToContainer();
268
+ var events = ['animationend'];
269
+ events.forEach(function (event) {
270
+ var handler = function handler() {
271
+ updateRelativeToContainer();
272
+ amsComponentContainer.removeEventListener(event, handler);
273
+ };
274
+ amsComponentContainer.addEventListener(event, handler);
275
+ });
276
+ } else {
277
+ updateRelativeToWindow();
253
278
  }
254
279
  }
255
280
  }, {
@@ -297,6 +297,7 @@ export var ApplePaySdk = /*#__PURE__*/function () {
297
297
  title: 'a3753.b103030.c386485.d507498'
298
298
  });
299
299
  }
300
+ _this.abortSession();
300
301
  reject({
301
302
  errorCode: APPLEPAYERRORENUM.APPLE_PAY_CANCEL
302
303
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1758505806-dev.5",
3
+ "version": "0.0.1758607092-dev.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",
@@ -16,8 +16,8 @@
16
16
  "scripts": {
17
17
  "build": "father build",
18
18
  "build:w": "father dev",
19
- "ci": "tnpm run cov",
20
- "cov": "jest --coverage --silent",
19
+ "ci": "npm run lint",
20
+ "cov": "jest --coverage",
21
21
  "dev": "father dev",
22
22
  "format": "prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"",
23
23
  "lint": "eslint ./src",
@@ -47,7 +47,6 @@
47
47
  "uuid": "^9.0.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@ali/ci": "^4.72.0",
51
50
  "@babel/core": "^7.20.7",
52
51
  "@babel/preset-env": "^7.20.2",
53
52
  "@commitlint/cli": "^17.3.0",
@@ -56,13 +55,13 @@
56
55
  "@testing-library/react": "^9.5.0",
57
56
  "@types/jest": "^29.2.4",
58
57
  "@types/uuid": "^9.0.0",
59
- "@typescript-eslint/eslint-plugin": "^6.21.0",
60
- "@typescript-eslint/parser": "^6.21.0",
58
+ "@typescript-eslint/eslint-plugin": "latest",
59
+ "@typescript-eslint/parser": "^5.60.0",
61
60
  "babel-jest": "^29.3.1",
62
61
  "babel-loader": "^9.1.0",
63
62
  "babel-plugin-import": "^1.13.0",
64
- "eslint": "^8.56.0",
65
- "eslint-plugin-prettier": "^5.1.3",
63
+ "eslint": "^8.36.0",
64
+ "eslint-plugin-prettier": "latest",
66
65
  "father": "^4.2.3",
67
66
  "jest": "^29.5.0",
68
67
  "jest-environment-jsdom": "^29.3.1",
@@ -78,9 +77,5 @@
78
77
  },
79
78
  "publishConfig": {
80
79
  "access": "public"
81
- },
82
- "ci": {
83
- "resourceClass": "L",
84
- "type": "aci"
85
80
  }
86
81
  }