@alipay/ams-checkout 0.0.1698679665-dev.0 → 0.0.1698890614-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.
@@ -18,10 +18,7 @@ export declare const getIframeUrl: (iframeParams: {
18
18
  locale: string;
19
19
  instanceId: string;
20
20
  renderDisplayType: renderDisplayTypeEnum;
21
- }) => {
22
- path: string;
23
- locationSearch: string;
24
- };
21
+ }) => string;
25
22
  /**
26
23
  * @description Create iframe
27
24
  */
@@ -99,10 +99,7 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
99
99
  if (environment === 'sandbox' || _sandbox === 'true') urlParams.shadow = 'true';
100
100
  if (_displayType) urlParams.displayType = _displayType;
101
101
  var locationSearch = serialize(urlParams);
102
- return {
103
- path: path,
104
- locationSearch: locationSearch
105
- };
102
+ return "".concat(path, "?").concat(locationSearch);
106
103
  };
107
104
 
108
105
  /**
@@ -19,7 +19,7 @@ export default class ComponentApp {
19
19
  private _actionQueryPromise;
20
20
  private _renderParams;
21
21
  private _componentSign;
22
- private _appLocationSearch;
22
+ private _clickEventName;
23
23
  private _renderDisplayType;
24
24
  constructor();
25
25
  /**
@@ -14,11 +14,12 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
14
14
  * 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
15
15
  * 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.
16
16
  */
17
+ /* eslint-disable no-console */
17
18
  /* eslint-disable @typescript-eslint/no-explicit-any */
18
19
  import { marmotMap } from "../../config/index";
19
20
  import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LISTENER_PREFIX, LOADING_ID, LOADTIME_LIMIT, MOCKUP_ID } from "../../constant";
20
21
  import { queryPaymentInfo } from "../../service";
21
- import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, RedirectType, renderDisplayTypeEnum, SecuritySceneEnum, targetEnum } from "../../types";
22
+ import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, renderDisplayTypeEnum, SecuritySceneEnum, targetEnum, RedirectType } from "../../types";
22
23
  import { getType, isJsonString, isPC } from "../../util";
23
24
  import { isLocalMock } from "../../util/mock";
24
25
  import { getApdidToken, getAppname, getSecurityHost, initSecuritySDK } from "../../util/security";
@@ -46,17 +47,17 @@ var ComponentApp = /*#__PURE__*/function () {
46
47
  _defineProperty(this, "_actionQueryPromise", null);
47
48
  _defineProperty(this, "_renderParams", null);
48
49
  _defineProperty(this, "_componentSign", componentSignEnum.NONE);
49
- _defineProperty(this, "_appLocationSearch", void 0);
50
+ _defineProperty(this, "_clickEventName", void 0);
50
51
  _defineProperty(this, "_renderDisplayType", renderDisplayTypeEnum.popup);
51
- this._appVersion = '1.5.9';
52
+ this._appVersion = '1.6.0';
52
53
  this._isInitComponent = false;
53
54
  this._selector = "#".concat(COMPONENT_SECTION_ID);
54
55
  this.createIframeNode = function () {
55
56
  return Promise.resolve();
56
57
  };
57
58
  this.platform = isPC() ? platformEnum.desktop : platformEnum.mobile;
59
+ this._clickEventName = this.platform === platformEnum.mobile ? 'touchend' : 'click';
58
60
  this._isRetention = true;
59
- this._appLocationSearch = '';
60
61
  this._performanceData.push({
61
62
  key: 'sdk_init',
62
63
  value: Date.now()
@@ -478,21 +479,17 @@ var ComponentApp = /*#__PURE__*/function () {
478
479
  extendInfo: extendInfo
479
480
  });
480
481
  this.app = createIframe(this.AMSSDK.options.mode, this.platform);
481
- var _getIframeUrl = getIframeUrl({
482
- renderDisplayType: renderParams.renderDisplayType,
483
- componentSign: this._componentSign,
484
- analytics: this.AMSSDK.options.analytics,
485
- productSceneVersion: productSceneVersion,
486
- environment: environment,
487
- appVersion: this._appVersion,
488
- extendInfo: extendInfo,
489
- locale: this.AMSSDK.options.locale,
490
- instanceId: this.AMSSDK._instanceId
491
- }),
492
- path = _getIframeUrl.path,
493
- locationSearch = _getIframeUrl.locationSearch;
494
- this._appLocationSearch = locationSearch;
495
- this.app.src = "".concat(path, "?").concat(locationSearch);
482
+ this.app.src = getIframeUrl({
483
+ renderDisplayType: renderParams.renderDisplayType,
484
+ componentSign: this._componentSign,
485
+ analytics: this.AMSSDK.options.analytics,
486
+ productSceneVersion: productSceneVersion,
487
+ environment: environment,
488
+ appVersion: this._appVersion,
489
+ extendInfo: extendInfo,
490
+ locale: this.AMSSDK.options.locale,
491
+ instanceId: this.AMSSDK._instanceId
492
+ });
496
493
 
497
494
  // Subscribe to messages from iframe
498
495
  this.addEventListener();
@@ -538,7 +535,7 @@ var ComponentApp = /*#__PURE__*/function () {
538
535
  var _this$_renderParams3;
539
536
  this._threedData = data;
540
537
  var sessionData = encodeURIComponent((_this$_renderParams3 = this._renderParams) === null || _this$_renderParams3 === void 0 ? void 0 : _this$_renderParams3.sessionData);
541
- var threedPageUrl = "".concat(marmotMap[this.AMSSDK.options.env.environment], "/threedPage/index.html?scene=threedWrapperPage&sessionData=").concat(sessionData, "&").concat(this._appLocationSearch);
538
+ var threedPageUrl = "".concat(marmotMap[this.AMSSDK.options.env.environment], "/threedPage/index.html?scene=threedWrapperPage&sessionData=").concat(sessionData, "&instanceId=").concat(this.AMSSDK._instanceId);
542
539
  this.popupWindow = createModal({
543
540
  device: this.platform,
544
541
  url: threedPageUrl
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@alipay/ams-checkout","version":"0.0.1698679665-dev.0","description":"","author":"","main":"esm/index.js","module":"esm/index.js","typings":"esm/index.d.ts","files":["dist","esm","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"father build","ci":"npm run lint","cov":"jest --coverage","format":"prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"","lint":"eslint ./src","test":"jest"},"dependencies":{"@alipay/jshield-apdid":"^2.0.3","axios":"^1.3.4","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/uuid":"^9.0.0","@typescript-eslint/eslint-plugin":"latest","@typescript-eslint/parser":"^5.60.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","eslint":"^8.36.0","eslint-plugin-prettier":"latest","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.4","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^4.9.5"},"engines":{},"publishConfig":{"access":"public"}}
1
+ {"name":"@alipay/ams-checkout","version":"0.0.1698890614-dev.0","description":"","author":"","main":"esm/index.js","module":"esm/index.js","typings":"esm/index.d.ts","files":["dist","esm","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"father build","ci":"npm run lint","cov":"jest --coverage","format":"prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"","lint":"eslint ./src","test":"jest"},"dependencies":{"@alipay/jshield-apdid":"^2.0.3","axios":"^1.3.4","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/uuid":"^9.0.0","@typescript-eslint/eslint-plugin":"latest","@typescript-eslint/parser":"^5.60.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","eslint":"^8.36.0","eslint-plugin-prettier":"latest","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.4","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^4.9.5"},"engines":{},"publishConfig":{"access":"public"}}