@alipay/ams-checkout 1.3.1-dev → 1.3.2
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/config/index.d.ts +16 -0
- package/{dist/esm → esm}/config/index.js +3 -2
- package/{dist/esm → esm}/core/component/index.js +12 -0
- package/{dist/esm → esm}/plugin/component/cashierApp.d.ts +1 -1
- package/{dist/esm → esm}/plugin/component/cashierApp.js +13 -14
- package/esm/plugin/component/component.style.js +15 -0
- package/{dist/esm → esm}/plugin/component/index.d.ts +1 -0
- package/{dist/esm → esm}/plugin/component/index.js +36 -18
- package/{dist/esm → esm}/request/index.js +2 -3
- package/{dist/esm → esm}/types/index.d.ts +4 -4
- package/{dist/esm → esm}/util/index.js +4 -2
- package/package.json +1 -54
- package/dist/esm/config/index.d.ts +0 -22
- package/dist/esm/plugin/component/component.style.js +0 -15
- /package/{dist/esm → esm}/constant/index.d.ts +0 -0
- /package/{dist/esm → esm}/constant/index.js +0 -0
- /package/{dist/esm → esm}/core/component/index.d.ts +0 -0
- /package/{dist/esm → esm}/core/drop-in/index.d.ts +0 -0
- /package/{dist/esm → esm}/core/drop-in/index.js +0 -0
- /package/{dist/esm → esm}/core/instance/index.d.ts +0 -0
- /package/{dist/esm → esm}/core/instance/index.js +0 -0
- /package/{dist/esm → esm}/image/cta.svg +0 -0
- /package/{dist/esm → esm}/index.d.ts +0 -0
- /package/{dist/esm → esm}/index.js +0 -0
- /package/{dist/esm → esm}/plugin/component/component.style.d.ts +0 -0
- /package/{dist/esm → esm}/plugin/drop-in/index.d.ts +0 -0
- /package/{dist/esm → esm}/plugin/drop-in/index.js +0 -0
- /package/{dist/esm → esm}/request/index.d.ts +0 -0
- /package/{dist/esm → esm}/request/utils.d.ts +0 -0
- /package/{dist/esm → esm}/request/utils.js +0 -0
- /package/{dist/esm → esm}/service/index.d.ts +0 -0
- /package/{dist/esm → esm}/service/index.js +0 -0
- /package/{dist/esm → esm}/types/index.js +0 -0
- /package/{dist/esm → esm}/util/createIframeNode.d.ts +0 -0
- /package/{dist/esm → esm}/util/createIframeNode.js +0 -0
- /package/{dist/esm → esm}/util/get.d.ts +0 -0
- /package/{dist/esm → esm}/util/get.js +0 -0
- /package/{dist/esm → esm}/util/index.d.ts +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/browser.d.ts +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/browser.js +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/evoke.d.ts +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/evoke.js +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/generate.d.ts +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/generate.js +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/index.d.ts +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/index.js +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/main.d.ts +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/main.js +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/openWallet.d.ts +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/openWallet.js +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/types.d.ts +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/types.js +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/utils/config.d.ts +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/utils/config.js +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/utils/index.d.ts +0 -0
- /package/{dist/esm → esm}/util/intl-callapp/es/utils/index.js +0 -0
- /package/{dist/esm → esm}/util/mock.d.ts +0 -0
- /package/{dist/esm → esm}/util/mock.js +0 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
export declare const requestHost: {
|
2
|
+
[key: string]: string;
|
3
|
+
};
|
4
|
+
export declare const clientId = "5J5Y8X4E2Y25GR00690";
|
5
|
+
export declare const tntInstId = "ALIPW3SG";
|
6
|
+
export declare const appId = "ANTOM_PAYMENT_WEB";
|
7
|
+
export declare const sofaId: any;
|
8
|
+
export declare const closeImg = "https://file.page.alipay.net/resource/2023/3/21/3235f64c-84a6-4e33-9567-4cedf0960229.svg";
|
9
|
+
export declare const hostSignMap: (hostSign: string | undefined, env: string) => string;
|
10
|
+
export declare const lightSandboxMap: (operationType: string | undefined, env: string) => {
|
11
|
+
appId: string;
|
12
|
+
sofaId: any;
|
13
|
+
baseURL: string;
|
14
|
+
'Operation-Type': string;
|
15
|
+
};
|
16
|
+
export declare const sdkVersion: string;
|
@@ -5,7 +5,7 @@
|
|
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
|
-
|
8
|
+
import packageJSON from "../../package.json";
|
9
9
|
import { queryParse } from "../util";
|
10
10
|
var _queryParse = queryParse(),
|
11
11
|
_light_sandbox = _queryParse._light_sandbox,
|
@@ -66,4 +66,5 @@ export var lightSandboxMap = function lightSandboxMap() {
|
|
66
66
|
baseURL: '',
|
67
67
|
'Operation-Type': ''
|
68
68
|
};
|
69
|
-
};
|
69
|
+
};
|
70
|
+
export var sdkVersion = packageJSON.version;
|
@@ -19,6 +19,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
19
19
|
import { COMPONENTPLUGINID, ERRORMESSAGE } from "../../constant";
|
20
20
|
import ComponentApp from "../../plugin/component";
|
21
21
|
import { componentNameEnum, mode, networkMode, paymentMethodCategoryTypeEnum, productSceneEnum } from "../../types";
|
22
|
+
import { isPC } from "../../util";
|
22
23
|
import { createIframeNode } from "../../util/createIframeNode";
|
23
24
|
var getComponentSign = function getComponentSign(params) {
|
24
25
|
var _ref = params || {},
|
@@ -43,6 +44,16 @@ var parsePaymentSessionData = function parsePaymentSessionData(paymentSessionDat
|
|
43
44
|
return [{}, paymentSessionData];
|
44
45
|
}
|
45
46
|
};
|
47
|
+
|
48
|
+
// pc easy-pay&2.0 走 1.0 的支付逻辑
|
49
|
+
var resetEasyPaySceneVersion = function resetEasyPaySceneVersion(parseData) {
|
50
|
+
if (isPC() && parseData !== null && parseData !== void 0 && parseData.paymentSessionConfig) {
|
51
|
+
var productScene = parseData.paymentSessionConfig.productScene;
|
52
|
+
if (productScene === productSceneEnum.EASY_PAY) {
|
53
|
+
parseData.paymentSessionConfig.productSceneVersion = '1.0';
|
54
|
+
}
|
55
|
+
}
|
56
|
+
};
|
46
57
|
export var mixinComponentConstructor = function mixinComponentConstructor(options, context) {
|
47
58
|
// Instantiate the plug-in and set render
|
48
59
|
var ComponentPlugin = new ComponentApp();
|
@@ -98,6 +109,7 @@ export var createComponent = /*#__PURE__*/function () {
|
|
98
109
|
_parsePaymentSessionD2 = _slicedToArray(_parsePaymentSessionD, 2),
|
99
110
|
parseData = _parsePaymentSessionD2[0],
|
100
111
|
paymentSessionData = _parsePaymentSessionD2[1];
|
112
|
+
resetEasyPaySceneVersion(parseData);
|
101
113
|
var componentName = typeof componentNameOrParams === 'string' ? componentNameOrParams : getComponentSign(parseData);
|
102
114
|
if (componentName === '') {
|
103
115
|
// eslint-disable-next-line prefer-promise-reject-errors
|
@@ -9,7 +9,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
9
9
|
* 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
|
10
10
|
* 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.
|
11
11
|
*/
|
12
|
-
import
|
12
|
+
import { sdkVersion } from "../../config/index";
|
13
13
|
import { componentNameEnum } from "../../types";
|
14
14
|
import { getViewPort, queryParse, serialize } from "../../util/index";
|
15
15
|
export var getAppPath = function getAppPath() {
|
@@ -20,16 +20,12 @@ export var getAppPath = function getAppPath() {
|
|
20
20
|
var productSceneVersion = arguments.length > 3 ? arguments[3] : undefined;
|
21
21
|
var extendInfo = arguments.length > 4 ? arguments[4] : undefined;
|
22
22
|
var _ref = queryParse() || {},
|
23
|
-
urlTestHost = _ref.host
|
24
|
-
_ref$_appVersion = _ref._appVersion,
|
25
|
-
_appVersion = _ref$_appVersion === void 0 ? '' : _ref$_appVersion;
|
23
|
+
urlTestHost = _ref.host;
|
26
24
|
var host = '';
|
27
25
|
var getAppVersion = function getAppVersion(_extendInfo) {
|
28
26
|
try {
|
29
|
-
// Configure the specified version number
|
30
|
-
if (_appVersion && !['sandbox', 'light_sandbox', 'prod'].includes(environment)) return _appVersion;
|
31
27
|
var info = JSON.parse(_extendInfo);
|
32
|
-
return info.versionMap.web[
|
28
|
+
return info.versionMap.web[sdkVersion].targetWebVerison || appVersion;
|
33
29
|
} catch (error) {
|
34
30
|
return appVersion;
|
35
31
|
}
|
@@ -92,7 +88,8 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
92
88
|
locale = iframeParams.locale,
|
93
89
|
instanceId = iframeParams.instanceId;
|
94
90
|
var path = getAppPath(environment, appVersion, componentName, productSceneVersion, extendInfo || '');
|
95
|
-
var
|
91
|
+
var initialScale = 1;
|
92
|
+
var scale = getViewPort('initial-scale') || initialScale;
|
96
93
|
var _queryParse = queryParse(),
|
97
94
|
_sandbox = _queryParse._sandbox,
|
98
95
|
_light_sandbox = _queryParse._light_sandbox,
|
@@ -107,7 +104,7 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
107
104
|
instanceId: instanceId,
|
108
105
|
sandbox: environment === 'light_sandbox' || _light_sandbox === 'true' ? 'true' : 'false',
|
109
106
|
analyticsEnabled: (analytics === null || analytics === void 0 ? void 0 : analytics.enabled) === false ? 'false' : 'true',
|
110
|
-
sdkVersion:
|
107
|
+
sdkVersion: sdkVersion,
|
111
108
|
refUrl: window.location.href,
|
112
109
|
shadow: environment === 'sandbox' || _sandbox === 'true' ? 'true' : 'false',
|
113
110
|
requestHost: requestHost,
|
@@ -128,13 +125,15 @@ var getIframeId = function getIframeId(UIMode) {
|
|
128
125
|
/**
|
129
126
|
* @description Create iframe
|
130
127
|
*/
|
131
|
-
export var createIframe = function createIframe(
|
128
|
+
export var createIframe = function createIframe(mode) {
|
132
129
|
var iframe = document.createElement('iframe');
|
133
|
-
var iframeId = getIframeId(
|
130
|
+
var iframeId = getIframeId(mode);
|
131
|
+
var none = '0';
|
132
|
+
var width = '100%';
|
134
133
|
iframe.id = iframeId;
|
135
|
-
iframe.style.height =
|
136
|
-
iframe.style.width =
|
137
|
-
iframe.style.border =
|
134
|
+
iframe.style.height = none;
|
135
|
+
iframe.style.width = width;
|
136
|
+
iframe.style.border = none;
|
138
137
|
iframe.style.overflow = 'hidden';
|
139
138
|
return iframe;
|
140
139
|
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
3
|
+
*
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
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
|
+
* 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
|
+
*/
|
8
|
+
|
9
|
+
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: 1px;\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}\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: 8px;\n overflow: hidden;\n transform-origin: 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: translateX(-50%) translateY(-50%) scale(1);\n opacity: 1\n }\n\n 80% {\n opacity: 0\n }\n \n 100% {\n opacity: 0;\n transform: translateX(-50%) translateY(-50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translateX(-50%) translateY(-50%) scale(0.4);\n opacity: 0\n }\n\n 80% {\n opacity: 1\n }\n\n 100% {\n opacity: 1;\n transform: translateX(-50%) translateY(-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-fill-mode: forwards;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\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\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-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-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}\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 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: 600;\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: 600;\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: 600;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\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}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 600;\n text-align: center;\n box-sizing: border-box;\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}\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}\n\n";
|
10
|
+
export function componentAddCSS() {
|
11
|
+
var style = document.createElement('style');
|
12
|
+
style.type = 'text/css';
|
13
|
+
style.innerHTML = componentCss;
|
14
|
+
document.head.appendChild(style);
|
15
|
+
}
|
@@ -24,10 +24,13 @@ import { getDesignFontSize, getType, isJsonString, isPC } from "../../util";
|
|
24
24
|
import { isLocalMock } from "../../util/mock";
|
25
25
|
import { createIframe, getAppDomain, getIframeUrl } from "./cashierApp";
|
26
26
|
import { componentAddCSS } from "./component.style";
|
27
|
+
var _window = window,
|
28
|
+
innerHeight = _window.innerHeight;
|
27
29
|
var amsSetSize = function amsSetSize(event, dom) {
|
28
30
|
try {
|
29
31
|
var _dom = dom || document.getElementById('ams-component-container');
|
30
32
|
_dom.style.fontSize = "".concat(getDesignFontSize(), "px");
|
33
|
+
innerHeight = window.innerHeight;
|
31
34
|
// eslint-disable-next-line no-empty
|
32
35
|
} catch (error) {}
|
33
36
|
};
|
@@ -39,10 +42,9 @@ var addEvent = function addEvent() {
|
|
39
42
|
window.addEventListener('pageShow', amsSetSize);
|
40
43
|
window.addEventListener('DOMContentLoaded', amsSetSize);
|
41
44
|
};
|
42
|
-
var _window = window,
|
43
|
-
innerHeight = _window.innerHeight;
|
44
45
|
var mockupId = 'ams-component-mockup';
|
45
46
|
var loadingId = 'ams-component-loading';
|
47
|
+
var listenerPrefix = '_ams_sdk_component_listener';
|
46
48
|
var ComponentApp = /*#__PURE__*/function () {
|
47
49
|
function ComponentApp() {
|
48
50
|
_classCallCheck(this, ComponentApp);
|
@@ -213,7 +215,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
213
215
|
key: 'sdk_action_query_end',
|
214
216
|
value: Date.now()
|
215
217
|
});
|
216
|
-
if (res && res.success) {
|
218
|
+
if (res !== null && res !== void 0 && res.success) {
|
217
219
|
resolve(res);
|
218
220
|
} else {
|
219
221
|
resolve(res);
|
@@ -304,6 +306,21 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
304
306
|
this.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.NOT_JSON_FORMAT);
|
305
307
|
}
|
306
308
|
}
|
309
|
+
}, {
|
310
|
+
key: "resizeListener",
|
311
|
+
value: function resizeListener() {
|
312
|
+
var cashier = document.getElementById('ams-component-container');
|
313
|
+
cashier.style.transition = 'none';
|
314
|
+
this.dispatchToApp({
|
315
|
+
context: {
|
316
|
+
event: 'renderResize',
|
317
|
+
data: {
|
318
|
+
heightOfVisible: window.innerHeight,
|
319
|
+
widthOfVisible: window.innerWidth
|
320
|
+
}
|
321
|
+
}
|
322
|
+
});
|
323
|
+
}
|
307
324
|
|
308
325
|
/**
|
309
326
|
* @description Initialize subscription iframe message
|
@@ -311,14 +328,17 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
311
328
|
}, {
|
312
329
|
key: "_addEventListener",
|
313
330
|
value: function _addEventListener() {
|
314
|
-
window["
|
331
|
+
window["".concat(listenerPrefix, "_").concat(this.AMSSDK._instanceId)] = this.listener.bind(this);
|
332
|
+
window["".concat(listenerPrefix, "_").concat(this.AMSSDK._instanceId, "_resize")] = this.resizeListener.bind(this);
|
315
333
|
this._removeEventListener();
|
316
|
-
window.addEventListener('message', window["
|
334
|
+
window.addEventListener('message', window["".concat(listenerPrefix, "_").concat(this.AMSSDK._instanceId)]);
|
335
|
+
window.addEventListener('resize', window["".concat(listenerPrefix, "_").concat(this.AMSSDK._instanceId, "_resize")]);
|
317
336
|
}
|
318
337
|
}, {
|
319
338
|
key: "_removeEventListener",
|
320
339
|
value: function _removeEventListener() {
|
321
|
-
window.removeEventListener('message', window["
|
340
|
+
window.removeEventListener('message', window["".concat(listenerPrefix, "_").concat(this.AMSSDK._instanceId)]);
|
341
|
+
window.removeEventListener('resize', window["".concat(listenerPrefix, "_").concat(this.AMSSDK._instanceId, "_resize")]);
|
322
342
|
}
|
323
343
|
|
324
344
|
/**
|
@@ -421,7 +441,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
421
441
|
// size变动时动画
|
422
442
|
setTimeout(function () {
|
423
443
|
cashier.style.transition = 'height 0.28s ease-in-out';
|
424
|
-
},
|
444
|
+
}, 500);
|
425
445
|
}
|
426
446
|
this.app.style.height = "".concat(data.context.data.height, "px");
|
427
447
|
this.app.style.width = '100%';
|
@@ -455,10 +475,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
455
475
|
});
|
456
476
|
};
|
457
477
|
|
458
|
-
//
|
478
|
+
// 支持 target: _blank,新开tab页打开
|
459
479
|
if (_data.target === Target.BLANK) {
|
480
|
+
if (!_data.normalUrl) return failCallback();
|
460
481
|
successCallback('normalUrl', _data.normalUrl);
|
461
|
-
if (!_data.normalUrl) return;
|
462
482
|
window.open(_data.normalUrl);
|
463
483
|
return;
|
464
484
|
}
|
@@ -557,7 +577,13 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
557
577
|
*/
|
558
578
|
}, {
|
559
579
|
key: "dispatchToApp",
|
560
|
-
value: function dispatchToApp(
|
580
|
+
value: function dispatchToApp(payload) {
|
581
|
+
var data = Object.assign({}, payload, {
|
582
|
+
name: messageName.SDK_TO_APP,
|
583
|
+
mode: this.AMSSDK.options.mode,
|
584
|
+
appId: COMPONENTPLUGINID,
|
585
|
+
instanceId: this.AMSSDK._instanceId
|
586
|
+
});
|
561
587
|
if (this.app && this.app.contentWindow) {
|
562
588
|
this.app.contentWindow.postMessage(JSON.stringify(data), this.appDomain);
|
563
589
|
}
|
@@ -605,10 +631,6 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
605
631
|
value: Date.now()
|
606
632
|
});
|
607
633
|
this.dispatchToApp({
|
608
|
-
name: messageName.SDK_TO_APP,
|
609
|
-
mode: this.AMSSDK.options.mode,
|
610
|
-
appId: COMPONENTPLUGINID,
|
611
|
-
instanceId: this.AMSSDK._instanceId,
|
612
634
|
context: {
|
613
635
|
event: 'renderComponent',
|
614
636
|
data: {
|
@@ -624,10 +646,6 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
624
646
|
}
|
625
647
|
});
|
626
648
|
this.dispatchToApp({
|
627
|
-
name: messageName.SDK_TO_APP,
|
628
|
-
mode: this.AMSSDK.options.mode,
|
629
|
-
appId: COMPONENTPLUGINID,
|
630
|
-
instanceId: this.AMSSDK._instanceId,
|
631
649
|
context: {
|
632
650
|
event: 'web-sdk-performance',
|
633
651
|
data: {
|
@@ -15,11 +15,10 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
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
17
|
|
18
|
-
import { appId, hostSignMap, lightSandboxMap, requestHost, sofaId, tntInstId } from "../config";
|
18
|
+
import { appId, hostSignMap, lightSandboxMap, requestHost, sdkVersion, sofaId, tntInstId } from "../config";
|
19
19
|
import { ERROR } from "../types";
|
20
20
|
import { get } from "../util/get";
|
21
21
|
import axios from 'axios';
|
22
|
-
import json from "../../package.json";
|
23
22
|
import { device, fomatGetwayError, isPC, queryParse, safeJson } from "../util";
|
24
23
|
var _queryParse = queryParse(),
|
25
24
|
_sandbox = _queryParse._sandbox;
|
@@ -35,7 +34,7 @@ function requestInstance(options) {
|
|
35
34
|
var _headers = _objectSpread((_objectSpread2 = {
|
36
35
|
appId: lightSandboxConfig.appId || appId,
|
37
36
|
workspaceId: options.env === 'pre' ? 'pre' : 'default'
|
38
|
-
}, _defineProperty(_objectSpread2, "x-cors-".concat(appId.toLowerCase(), "-default"), '1'), _defineProperty(_objectSpread2, "version", '2.0'), _defineProperty(_objectSpread2, 'sofa-group-name', lightSandboxConfig.sofaId || sofaId), _defineProperty(_objectSpread2, 'Operation-Type', lightSandboxConfig['Operation-Type'] || options['Operation-Type'] || ''), _defineProperty(_objectSpread2, 'Client-Time', utcTimestamp), _defineProperty(_objectSpread2, "tntInstId", tntInstId), _defineProperty(_objectSpread2, 'sdk-version',
|
37
|
+
}, _defineProperty(_objectSpread2, "x-cors-".concat(appId.toLowerCase(), "-default"), '1'), _defineProperty(_objectSpread2, "version", '2.0'), _defineProperty(_objectSpread2, 'sofa-group-name', lightSandboxConfig.sofaId || sofaId), _defineProperty(_objectSpread2, 'Operation-Type', lightSandboxConfig['Operation-Type'] || options['Operation-Type'] || ''), _defineProperty(_objectSpread2, 'Client-Time', utcTimestamp), _defineProperty(_objectSpread2, "tntInstId", tntInstId), _defineProperty(_objectSpread2, 'sdk-version', sdkVersion || ''), _objectSpread2), options.headers);
|
39
38
|
// sandbox 影子链路
|
40
39
|
if (_sandbox === 'true' || env === 'sandbox') {
|
41
40
|
_headers['load-test'] = true;
|
@@ -108,19 +108,19 @@ export interface env {
|
|
108
108
|
terminalType: terminalType;
|
109
109
|
environment: string;
|
110
110
|
}
|
111
|
-
export
|
111
|
+
export type callOnError = (state: {
|
112
112
|
errorMessage: string;
|
113
113
|
errorCode: string;
|
114
114
|
stack?: any;
|
115
115
|
}) => void;
|
116
|
-
export
|
116
|
+
export type callonPaymentMethodSelected = (state: {
|
117
117
|
paymentMethodType: string;
|
118
118
|
}) => void;
|
119
|
-
export
|
119
|
+
export type callOnSizeChanged = (state: {
|
120
120
|
width: string;
|
121
121
|
height: string;
|
122
122
|
}) => void;
|
123
|
-
export
|
123
|
+
export type callOnLog = (msg: string) => void;
|
124
124
|
export declare enum messageName {
|
125
125
|
SDK_TO_APP = "SDK_TO_APP",
|
126
126
|
APP_TO_SDK = "APP_TO_SDK",
|
@@ -227,9 +227,11 @@ var queryParse = function queryParse(url) {
|
|
227
227
|
});
|
228
228
|
return qs;
|
229
229
|
};
|
230
|
+
var designSize = 390;
|
231
|
+
var maxFontSize = 130;
|
230
232
|
var getDesignFontSize = function getDesignFontSize() {
|
231
233
|
var screenWidth = document.documentElement.clientWidth;
|
232
|
-
var currentFontSize = isPC() ?
|
233
|
-
return currentFontSize;
|
234
|
+
var currentFontSize = isPC() ? maxFontSize : screenWidth * 100 / designSize;
|
235
|
+
return Math.min(currentFontSize, maxFontSize);
|
234
236
|
};
|
235
237
|
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, device, fomatGetwayError, safeJson, isPC, queryParse, getDesignFontSize };
|
package/package.json
CHANGED
@@ -1,54 +1 @@
|
|
1
|
-
{
|
2
|
-
"name": "@alipay/ams-checkout",
|
3
|
-
"version": "1.3.1-dev",
|
4
|
-
"description": "",
|
5
|
-
"repository": "git@code.alipay.com:antom-sdk/antom-web-sdk.git",
|
6
|
-
"author": "",
|
7
|
-
"main": "dist/esm/index.js",
|
8
|
-
"module": "dist/esm/index.js",
|
9
|
-
"typings": "dist/esm/index.d.ts",
|
10
|
-
"files": [
|
11
|
-
"dist",
|
12
|
-
"LEGAL.md",
|
13
|
-
"LICENSE",
|
14
|
-
"README.md"
|
15
|
-
],
|
16
|
-
"scripts": {
|
17
|
-
"build": "father build",
|
18
|
-
"ci": "npm run lint",
|
19
|
-
"cov": "jest --coverage",
|
20
|
-
"format": "prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"",
|
21
|
-
"lint": "eslint ./src",
|
22
|
-
"test": "jest"
|
23
|
-
},
|
24
|
-
"dependencies": {
|
25
|
-
"axios": "^1.3.4",
|
26
|
-
"uuid": "^9.0.0"
|
27
|
-
},
|
28
|
-
"devDependencies": {
|
29
|
-
"@babel/core": "^7.20.7",
|
30
|
-
"@babel/preset-env": "^7.20.2",
|
31
|
-
"@testing-library/jest-dom": "^5.1.1",
|
32
|
-
"@testing-library/react": "^9.5.0",
|
33
|
-
"@types/jest": "^29.2.4",
|
34
|
-
"@types/uuid": "^9.0.0",
|
35
|
-
"@typescript-eslint/parser": "^5.60.0",
|
36
|
-
"babel-jest": "^29.3.1",
|
37
|
-
"babel-loader": "^9.1.0",
|
38
|
-
"babel-plugin-import": "^1.13.0",
|
39
|
-
"eslint": "^8.36.0",
|
40
|
-
"father": "^4.2.3",
|
41
|
-
"jest": "^29.5.0",
|
42
|
-
"jest-environment-jsdom": "^29.3.1",
|
43
|
-
"prettier": "^2.8.4",
|
44
|
-
"prettier-plugin-organize-imports": "^3.2.3",
|
45
|
-
"prettier-plugin-packagejson": "^2.4.5",
|
46
|
-
"ts-jest": "^29.0.3",
|
47
|
-
"ts-node": "^10.9.1",
|
48
|
-
"typescript": "^4.9.5"
|
49
|
-
},
|
50
|
-
"engines": {},
|
51
|
-
"publishConfig": {
|
52
|
-
"access": "public"
|
53
|
-
}
|
54
|
-
}
|
1
|
+
{"name":"@alipay/ams-checkout","version":"1.3.2","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":{"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/parser":"^5.60.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","eslint":"^8.36.0","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,22 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
3
|
-
*
|
4
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
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
|
-
* 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
|
-
*/
|
8
|
-
export declare const requestHost: {
|
9
|
-
[key: string]: string;
|
10
|
-
};
|
11
|
-
export declare const clientId = "5J5Y8X4E2Y25GR00690";
|
12
|
-
export declare const tntInstId = "ALIPW3SG";
|
13
|
-
export declare const appId = "ANTOM_PAYMENT_WEB";
|
14
|
-
export declare const sofaId: any;
|
15
|
-
export declare const closeImg = "https://file.page.alipay.net/resource/2023/3/21/3235f64c-84a6-4e33-9567-4cedf0960229.svg";
|
16
|
-
export declare const hostSignMap: (hostSign: string | undefined, env: string) => string;
|
17
|
-
export declare const lightSandboxMap: (operationType: string | undefined, env: string) => {
|
18
|
-
appId: string;
|
19
|
-
sofaId: any;
|
20
|
-
baseURL: string;
|
21
|
-
'Operation-Type': string;
|
22
|
-
};
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
3
|
-
*
|
4
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
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
|
-
* 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
|
-
*/
|
8
|
-
|
9
|
-
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 background-color: #ffffff;\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: 1px;\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}\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 background-color: #ffffff;\n border-radius: 8px;\n overflow: hidden;\n transform-origin: 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: translateX(-50%) translateY(-50%) scale(1);\n opacity: 1\n }\n\n 80% {\n opacity: 0\n }\n \n 100% {\n opacity: 0;\n transform: translateX(-50%) translateY(-50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translateX(-50%) translateY(-50%) scale(0.4);\n opacity: 0\n }\n\n 80% {\n opacity: 1\n }\n\n 100% {\n opacity: 1;\n transform: translateX(-50%) translateY(-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 background-color: #ffffff;\n border-radius: 8px;\n overflow: hidden;\n animation-fill-mode: forwards;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\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\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-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-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}\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 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: 600;\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: 600;\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: 600;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\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}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 600;\n text-align: center;\n box-sizing: border-box;\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}\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}\n\n";
|
10
|
-
export function componentAddCSS() {
|
11
|
-
var style = document.createElement('style');
|
12
|
-
style.type = 'text/css';
|
13
|
-
style.innerHTML = componentCss;
|
14
|
-
document.head.appendChild(style);
|
15
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|