@alipay/ams-checkout 0.0.1694675458-dev.0 → 1.3.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.
- package/{esm/config/request.d.ts → dist/esm/config/index.d.ts} +1 -0
- package/{esm/config/request.js → dist/esm/config/index.js} +3 -1
- package/{esm → dist/esm}/constant/index.d.ts +32 -54
- package/{esm → dist/esm}/constant/index.js +32 -54
- package/dist/esm/core/component/index.d.ts +17 -0
- package/dist/esm/core/component/index.js +146 -0
- package/{esm → dist/esm}/core/drop-in/index.d.ts +4 -4
- package/{esm → dist/esm}/core/drop-in/index.js +3 -3
- package/{esm → dist/esm}/core/instance/index.d.ts +23 -6
- package/{esm → dist/esm}/core/instance/index.js +75 -31
- package/{esm → dist/esm}/index.d.ts +10 -4
- package/{esm → dist/esm}/index.js +30 -8
- package/dist/esm/plugin/component/appPath.d.ts +2 -0
- package/dist/esm/plugin/component/appPath.js +75 -0
- package/{esm/plugin/component/component.inline.style.d.ts → dist/esm/plugin/component/component.style.d.ts} +1 -4
- package/dist/esm/plugin/component/component.style.js +15 -0
- package/{esm → dist/esm}/plugin/component/index.d.ts +45 -36
- package/{esm → dist/esm}/plugin/component/index.js +448 -312
- package/{esm → dist/esm}/plugin/drop-in/index.d.ts +5 -3
- package/{esm → dist/esm}/plugin/drop-in/index.js +3 -3
- package/{esm → dist/esm}/request/index.d.ts +2 -2
- package/{esm → dist/esm}/request/index.js +9 -9
- package/{esm → dist/esm}/request/utils.d.ts +3 -3
- package/{esm → dist/esm}/request/utils.js +4 -4
- package/dist/esm/service/index.d.ts +2 -0
- package/{esm → dist/esm}/types/index.d.ts +43 -109
- package/dist/esm/types/index.js +94 -0
- package/dist/esm/util/createIframeNode.d.ts +5 -0
- package/{esm → dist/esm}/util/createIframeNode.js +8 -8
- package/{esm → dist/esm}/util/index.d.ts +4 -6
- package/{esm → dist/esm}/util/index.js +7 -26
- package/dist/esm/util/mock.js +4 -0
- package/dist/umd/ams-checkout.min.js +1 -1
- package/package.json +1 -1
- package/esm/config/index.d.ts +0 -2
- package/esm/config/index.js +0 -17
- package/esm/core/component/index.d.ts +0 -31
- package/esm/core/component/index.js +0 -202
- package/esm/image/skeleton.svg +0 -18
- package/esm/plugin/component/cashierApp.d.ts +0 -23
- package/esm/plugin/component/cashierApp.js +0 -123
- package/esm/plugin/component/component.inline.style.js +0 -38
- package/esm/plugin/component/component.popup.style.d.ts +0 -12
- package/esm/plugin/component/component.popup.style.js +0 -163
- package/esm/service/index.d.ts +0 -2
- package/esm/types/index.js +0 -134
- package/esm/util/createIframeNode.d.ts +0 -5
- package/esm/util/mock.js +0 -3
- /package/{esm → dist/esm}/image/cta.svg +0 -0
- /package/{esm → dist/esm}/service/index.js +0 -0
- /package/{esm → dist/esm}/util/get.d.ts +0 -0
- /package/{esm → dist/esm}/util/get.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/browser.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/browser.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/evoke.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/evoke.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/generate.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/generate.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/index.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/index.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/main.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/main.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/openWallet.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/openWallet.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/types.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/types.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/utils/config.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/utils/config.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/utils/index.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/utils/index.js +0 -0
- /package/{esm → dist/esm}/util/mock.d.ts +0 -0
@@ -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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
7
7
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
8
|
-
import {
|
8
|
+
import { ERROR } from "../types";
|
9
9
|
import { get } from "./get";
|
10
10
|
|
11
11
|
/**
|
@@ -174,7 +174,7 @@ var fomatGetwayError = function fomatGetwayError(headers, traceId) {
|
|
174
174
|
return {
|
175
175
|
success: false,
|
176
176
|
traceId: traceId,
|
177
|
-
errorCode:
|
177
|
+
errorCode: ERROR.LOGIN,
|
178
178
|
resultStatus: resultStatus
|
179
179
|
};
|
180
180
|
}
|
@@ -183,7 +183,7 @@ var fomatGetwayError = function fomatGetwayError(headers, traceId) {
|
|
183
183
|
return {
|
184
184
|
success: false,
|
185
185
|
traceId: traceId,
|
186
|
-
errorCode:
|
186
|
+
errorCode: ERROR.TIMEOUT,
|
187
187
|
resultStatus: resultStatus
|
188
188
|
};
|
189
189
|
}
|
@@ -193,7 +193,7 @@ var fomatGetwayError = function fomatGetwayError(headers, traceId) {
|
|
193
193
|
return {
|
194
194
|
success: false,
|
195
195
|
traceId: traceId,
|
196
|
-
errorCode:
|
196
|
+
errorCode: ERROR.GATEWAY,
|
197
197
|
errorMessage: decodeURIComponent(tips || ''),
|
198
198
|
result: {
|
199
199
|
resultStatus: resultStatus || '',
|
@@ -227,28 +227,9 @@ var queryParse = function queryParse(url) {
|
|
227
227
|
});
|
228
228
|
return qs;
|
229
229
|
};
|
230
|
-
var designSize = 390;
|
231
|
-
var maxFontSize = 130;
|
232
230
|
var getDesignFontSize = function getDesignFontSize() {
|
233
231
|
var screenWidth = document.documentElement.clientWidth;
|
234
|
-
var currentFontSize = isPC() ?
|
235
|
-
return
|
232
|
+
var currentFontSize = isPC() ? 100 : screenWidth * 100 / 390;
|
233
|
+
return currentFontSize;
|
236
234
|
};
|
237
|
-
|
238
|
-
try {
|
239
|
-
var componentContainerId = 'ams-component-container';
|
240
|
-
var _dom = dom || document.getElementById(componentContainerId);
|
241
|
-
_dom.style.fontSize = "".concat(getDesignFontSize(), "px");
|
242
|
-
innerHeight = window.innerHeight;
|
243
|
-
// eslint-disable-next-line no-empty
|
244
|
-
} catch (error) {}
|
245
|
-
};
|
246
|
-
var addSetFontSizeEvent = function addSetFontSizeEvent() {
|
247
|
-
window.removeEventListener('resize', amsSetSize);
|
248
|
-
window.removeEventListener('pageShow', amsSetSize);
|
249
|
-
window.removeEventListener('DOMContentLoaded', amsSetSize);
|
250
|
-
window.addEventListener('resize', amsSetSize);
|
251
|
-
window.addEventListener('pageShow', amsSetSize);
|
252
|
-
window.addEventListener('DOMContentLoaded', amsSetSize);
|
253
|
-
};
|
254
|
-
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, device, fomatGetwayError, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent };
|
235
|
+
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, device, fomatGetwayError, safeJson, isPC, queryParse, getDesignFontSize };
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export var isLocalMock = function isLocalMock() {
|
2
|
+
var _window, _window$process, _window$process$env;
|
3
|
+
return ((_window = window) === null || _window === void 0 ? void 0 : (_window$process = _window.process) === null || _window$process === void 0 ? void 0 : (_window$process$env = _window$process.env) === null || _window$process$env === void 0 ? void 0 : _window$process$env.NODE_ENV) === 'MOCK' && window.location.href.indexOf('LOCAL_MOCK=1') > -1;
|
4
|
+
};
|