@alipay/ams-checkout 2.0.16 → 2.0.17

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.
@@ -1,4 +1,4 @@
1
- import { AMSPOPUP_PREFIX, ANIMATION_TIME, MOCKUP_ID, POPUPLOADING_ID } from "../constant";
1
+ import { AMSPOPUP_PREFIX, ANIMATION_TIME, DEFAULT_IFRAME_COLOR_SCHEME, MOCKUP_ID, POPUPLOADING_ID } from "../constant";
2
2
  import { getDesignFontSize } from "../util";
3
3
  // CSS样式字符串
4
4
  var modalStyles = "\n .".concat(AMSPOPUP_PREFIX, "modal {\n /* \u6DFB\u52A0\u5F39\u7A97\u6837\u5F0F */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* \u8BBE\u7F6E\u5F39\u7A97\u7684\u5C42\u7EA7\u4E3A 9999 */\n overflow: hidden;\n }\n .").concat(AMSPOPUP_PREFIX, "modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* \u8BBE\u7F6E\u5F39\u7A97\u7684\u5C42\u7EA7\u4E3A 9999 */\n overflow: hidden;\n }\n\n .").concat(AMSPOPUP_PREFIX, "overlay {\n /* \u6DFB\u52A0\u8499\u5C42\u6837\u5F0F */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(AMSPOPUP_PREFIX, "fadeIn {\n /* \u6DFB\u52A0\u6DE1\u5165\u52A8\u753B */\n animation: fadeIn ").concat(ANIMATION_TIME, "ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(AMSPOPUP_PREFIX, "fadeOut {\n /* \u6DFB\u52A0\u6DE1\u51FA\u52A8\u753B */\n animation: fadeOut ").concat(ANIMATION_TIME, "ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(AMSPOPUP_PREFIX, "-drawer-enter {\n animation: slideIn ").concat(ANIMATION_TIME, "ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* \u6ED1\u5165\u65F6\u5728\u89C6\u53E3\u5E95\u90E8\u5916 */\n opacity: 0; /* \u521D\u59CB\u900F\u660E\u5EA6\u4E3A 0 */\n }\n to {\n transform: translateY(0); /* \u6ED1\u5165\u7ED3\u675F\u65F6\u5728\u539F\u4F4D\u7F6E */\n opacity: 1; /* \u7ED3\u675F\u65F6\u900F\u660E\u5EA6\u4E3A 1 */\n }\n }\n\n /* \u62BD\u5C49\u4ECE\u5E95\u90E8\u6ED1\u51FA */\n .").concat(AMSPOPUP_PREFIX, "-drawer-exit {\n animation: slideOut ").concat(ANIMATION_TIME, "ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* \u6ED1\u51FA\u65F6\u4ECE\u5F53\u524D\u4F4D\u7F6E\u5F00\u59CB */\n opacity: 1; /* \u521D\u59CB\u900F\u660E\u5EA6\u4E3A 1 */\n }\n to {\n transform: translateY(100%); /* \u6ED1\u51FA\u7ED3\u675F\u65F6\u5728\u89C6\u53E3\u5E95\u90E8\u5916 */\n opacity: 0; /* \u7ED3\u675F\u65F6\u900F\u660E\u5EA6\u4E3A 0 */\n }\n }\n\n /* \u5B9A\u4E49\u6DE1\u5165\u52A8\u753B */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* \u5B9A\u4E49\u6DE1\u51FA\u52A8\u753B */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\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-popup-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-popup-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-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-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-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-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");
@@ -111,6 +111,7 @@ export var createModal = function createModal(_ref2) {
111
111
  iframe.style.border = 'none';
112
112
  iframe.style.width = '100%';
113
113
  iframe.style.height = '100%';
114
+ iframe.style.colorScheme = DEFAULT_IFRAME_COLOR_SCHEME;
114
115
  if (styleConfig) {
115
116
  modal.style.backgroundColor = styleConfig.backgroundColor;
116
117
  iframe.style.backgroundColor = styleConfig.backgroundColor;
@@ -310,6 +310,7 @@ export declare const LISTENER_PREFIX = "_ams_sdk_component_listener";
310
310
  export declare const INLINE_BASE_STYLE_ID = "ams-inline-component-style";
311
311
  export declare const INLINE_IMG_CLASSNAME = "inline-loading";
312
312
  export declare const AMSPOPUP_PREFIX = "ams-popup";
313
+ export declare const DEFAULT_IFRAME_COLOR_SCHEME = "light dark";
313
314
  export declare const LOADTIME_LIMIT = 15000;
314
315
  export declare const POPUP_LOADTIME_LOG_LIMIT = 3000;
315
316
  export declare const ANIMATION_TIME = 300;
@@ -318,6 +318,7 @@ export var LISTENER_PREFIX = '_ams_sdk_component_listener';
318
318
  export var INLINE_BASE_STYLE_ID = 'ams-inline-component-style';
319
319
  export var INLINE_IMG_CLASSNAME = 'inline-loading';
320
320
  export var AMSPOPUP_PREFIX = 'ams-popup';
321
+ export var DEFAULT_IFRAME_COLOR_SCHEME = 'light dark';
321
322
  export var LOADTIME_LIMIT = 15000;
322
323
  export var POPUP_LOADTIME_LOG_LIMIT = 3000;
323
324
  export var ANIMATION_TIME = 300;
@@ -5,7 +5,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
5
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
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
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 { EVENT } from "../../../../constant";
8
+ import { EVENT, DEFAULT_IFRAME_COLOR_SCHEME } from "../../../../constant";
9
9
  import { ServiceProvider } from "./../../../../foundation/service";
10
10
  import { isElementPC, isElementPad } from "../util";
11
11
  import { DisplayTypeEnum, PlatformEnum, ProductSceneEnum } from "./../../../../types";
@@ -49,7 +49,8 @@ export var ContainerController = /*#__PURE__*/function () {
49
49
  selector: selector,
50
50
  appendAliasContainerId: true,
51
51
  iframeStyle: {
52
- display: 'block'
52
+ display: 'block',
53
+ colorScheme: DEFAULT_IFRAME_COLOR_SCHEME
53
54
  }
54
55
  }, processor.generateIframeSrc({
55
56
  link: iframesSrcLink,
@@ -1,4 +1,4 @@
1
- import { COMPONENT_CONTAINER_ID } from "../../../constant";
1
+ import { COMPONENT_CONTAINER_ID, DEFAULT_IFRAME_COLOR_SCHEME } from "../../../constant";
2
2
 
3
3
  /**
4
4
  * @author 谦彧 <zhangmian.zm@alipay.com>
@@ -14,6 +14,7 @@ export var createPreloadIframe = function createPreloadIframe(containerId) {
14
14
  iframe.style.border = none;
15
15
  iframe.style.opacity = '0';
16
16
  iframe.style.overflow = 'hidden';
17
+ iframe.style.colorScheme = DEFAULT_IFRAME_COLOR_SCHEME;
17
18
  return iframe;
18
19
  };
19
20
  export var createIframe = function createIframe(containerId) {
@@ -27,6 +28,7 @@ export var createIframe = function createIframe(containerId) {
27
28
  iframe.style.border = none;
28
29
  iframe.style.opacity = none;
29
30
  iframe.style.overflow = 'hidden';
31
+ iframe.style.colorScheme = DEFAULT_IFRAME_COLOR_SCHEME;
30
32
  return iframe;
31
33
  };
32
34
  export var startSizeChangeAnim = function startSizeChangeAnim(target, height, animationStyleId) {
@@ -15,7 +15,7 @@ import { createLoader } from '@antglobal/create-sdk-loader';
15
15
 
16
16
  import { stageName } from "./stageName";
17
17
  var SDKURL = {
18
- DEV: "https://sdk-dev.marmot-cloud.com/package/ams-checkout/".concat("2.0.16", "/ams-checkout.js"),
18
+ DEV: "https://sdk-dev.marmot-cloud.com/package/ams-checkout/".concat("2.0.17", "/ams-checkout.js"),
19
19
  LOCAL: "http://localhost:3000/ams-checkout.min.js",
20
20
  PROD: 'https://js.antom.com/v2/ams-checkout.js'
21
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "2.0.16",
3
+ "version": "2.0.17",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "exports": {
package/types.d.ts CHANGED
@@ -208,18 +208,8 @@ export declare class AntomSDK extends BaseElementsFactory {
208
208
  * @throws {AntomSDKError} 当无法找到有效的主元素时抛出错误
209
209
  */
210
210
  private extractMainElement;
211
- confirmCardSetup(options: ConfirmCardSetupOptions): Promise<SubmitResult | {
212
- code: string;
213
- message: string;
214
- status: string;
215
- userCancel3D: boolean;
216
- }>;
217
- confirmPayment(options: ConfirmPaymentOptions): Promise<SubmitResult | {
218
- code: string;
219
- message: string;
220
- userCancel3D: boolean;
221
- status: string;
222
- }>;
211
+ confirmCardSetup(options: ConfirmCardSetupOptions): Promise<SubmitResult>;
212
+ confirmPayment(options: ConfirmPaymentOptions): Promise<SubmitResult>;
223
213
  }
224
214
 
225
215
  /**
@@ -23791,14 +23781,21 @@ export declare type SubmitResult = {
23791
23781
  * 查询到的状态
23792
23782
  */
23793
23783
  status: 'SUCCESS' | 'CANCELLED' | 'FAIL' | 'PROCESSING';
23784
+ /* Excluded from this release type: code */
23785
+ /* Excluded from this release type: message */
23794
23786
  /**
23795
- * 查询到的结果码或者错误码, SUCCESS和CANCELLED无该字段
23796
- */
23797
- code?: string;
23798
- /**
23799
- * 查询到的结果消息, 在SUCCESS和CANCELLED无该字段
23787
+ * @description 对结果的详细结果码和结果信息,在status为SUCCESS时无该字段
23800
23788
  */
23801
- message?: string;
23789
+ error?: {
23790
+ /**
23791
+ * 查询到的结果码或者错误码
23792
+ */
23793
+ code?: string;
23794
+ /**
23795
+ * 查询到的结果消息
23796
+ */
23797
+ message?: string;
23798
+ };
23802
23799
  /**
23803
23800
  * 是否是用户手动取消3D
23804
23801
  */
@@ -235,18 +235,8 @@ export declare class AntomSDK extends BaseElementsFactory {
235
235
  * @throws {AntomSDKError} 当无法找到有效的主元素时抛出错误
236
236
  */
237
237
  private extractMainElement;
238
- confirmCardSetup(options: ConfirmCardSetupOptions): Promise<SubmitResult | {
239
- code: string;
240
- message: string;
241
- status: string;
242
- userCancel3D: boolean;
243
- }>;
244
- confirmPayment(options: ConfirmPaymentOptions): Promise<SubmitResult | {
245
- code: string;
246
- message: string;
247
- userCancel3D: boolean;
248
- status: string;
249
- }>;
238
+ confirmCardSetup(options: ConfirmCardSetupOptions): Promise<SubmitResult>;
239
+ confirmPayment(options: ConfirmPaymentOptions): Promise<SubmitResult>;
250
240
  }
251
241
 
252
242
  /**
@@ -24119,13 +24109,30 @@ export declare type SubmitResult = {
24119
24109
  */
24120
24110
  status: 'SUCCESS' | 'CANCELLED' | 'FAIL' | 'PROCESSING';
24121
24111
  /**
24122
- * 查询到的结果码或者错误码, 在SUCCESS和CANCELLED无该字段
24112
+ * 查询到的结果码或者错误码, 在SUCCESS无该字段
24113
+ * @deprecated 已废弃请读取error中的code
24114
+ * @internal
24123
24115
  */
24124
24116
  code?: string;
24125
24117
  /**
24126
- * 查询到的结果消息, 在SUCCESS和CANCELLED无该字段
24118
+ * 查询到的结果消息, 在SUCCESS无该字段
24119
+ * @deprecated 已废弃请读取error中的message
24120
+ * @internal
24127
24121
  */
24128
24122
  message?: string;
24123
+ /**
24124
+ * @description 对结果的详细结果码和结果信息,在status为SUCCESS时无该字段
24125
+ */
24126
+ error?: {
24127
+ /**
24128
+ * 查询到的结果码或者错误码
24129
+ */
24130
+ code?: string;
24131
+ /**
24132
+ * 查询到的结果消息
24133
+ */
24134
+ message?: string;
24135
+ };
24129
24136
  /**
24130
24137
  * 是否是用户手动取消3D
24131
24138
  */