@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.
Files changed (71) hide show
  1. package/{esm/config/request.d.ts → dist/esm/config/index.d.ts} +1 -0
  2. package/{esm/config/request.js → dist/esm/config/index.js} +3 -1
  3. package/{esm → dist/esm}/constant/index.d.ts +32 -54
  4. package/{esm → dist/esm}/constant/index.js +32 -54
  5. package/dist/esm/core/component/index.d.ts +17 -0
  6. package/dist/esm/core/component/index.js +146 -0
  7. package/{esm → dist/esm}/core/drop-in/index.d.ts +4 -4
  8. package/{esm → dist/esm}/core/drop-in/index.js +3 -3
  9. package/{esm → dist/esm}/core/instance/index.d.ts +23 -6
  10. package/{esm → dist/esm}/core/instance/index.js +75 -31
  11. package/{esm → dist/esm}/index.d.ts +10 -4
  12. package/{esm → dist/esm}/index.js +30 -8
  13. package/dist/esm/plugin/component/appPath.d.ts +2 -0
  14. package/dist/esm/plugin/component/appPath.js +75 -0
  15. package/{esm/plugin/component/component.inline.style.d.ts → dist/esm/plugin/component/component.style.d.ts} +1 -4
  16. package/dist/esm/plugin/component/component.style.js +15 -0
  17. package/{esm → dist/esm}/plugin/component/index.d.ts +45 -36
  18. package/{esm → dist/esm}/plugin/component/index.js +448 -312
  19. package/{esm → dist/esm}/plugin/drop-in/index.d.ts +5 -3
  20. package/{esm → dist/esm}/plugin/drop-in/index.js +3 -3
  21. package/{esm → dist/esm}/request/index.d.ts +2 -2
  22. package/{esm → dist/esm}/request/index.js +9 -9
  23. package/{esm → dist/esm}/request/utils.d.ts +3 -3
  24. package/{esm → dist/esm}/request/utils.js +4 -4
  25. package/dist/esm/service/index.d.ts +2 -0
  26. package/{esm → dist/esm}/types/index.d.ts +43 -109
  27. package/dist/esm/types/index.js +94 -0
  28. package/dist/esm/util/createIframeNode.d.ts +5 -0
  29. package/{esm → dist/esm}/util/createIframeNode.js +8 -8
  30. package/{esm → dist/esm}/util/index.d.ts +4 -6
  31. package/{esm → dist/esm}/util/index.js +7 -26
  32. package/dist/esm/util/mock.js +4 -0
  33. package/dist/umd/ams-checkout.min.js +1 -1
  34. package/package.json +1 -1
  35. package/esm/config/index.d.ts +0 -2
  36. package/esm/config/index.js +0 -17
  37. package/esm/core/component/index.d.ts +0 -31
  38. package/esm/core/component/index.js +0 -202
  39. package/esm/image/skeleton.svg +0 -18
  40. package/esm/plugin/component/cashierApp.d.ts +0 -23
  41. package/esm/plugin/component/cashierApp.js +0 -123
  42. package/esm/plugin/component/component.inline.style.js +0 -38
  43. package/esm/plugin/component/component.popup.style.d.ts +0 -12
  44. package/esm/plugin/component/component.popup.style.js +0 -163
  45. package/esm/service/index.d.ts +0 -2
  46. package/esm/types/index.js +0 -134
  47. package/esm/util/createIframeNode.d.ts +0 -5
  48. package/esm/util/mock.js +0 -3
  49. /package/{esm → dist/esm}/image/cta.svg +0 -0
  50. /package/{esm → dist/esm}/service/index.js +0 -0
  51. /package/{esm → dist/esm}/util/get.d.ts +0 -0
  52. /package/{esm → dist/esm}/util/get.js +0 -0
  53. /package/{esm → dist/esm}/util/intl-callapp/es/browser.d.ts +0 -0
  54. /package/{esm → dist/esm}/util/intl-callapp/es/browser.js +0 -0
  55. /package/{esm → dist/esm}/util/intl-callapp/es/evoke.d.ts +0 -0
  56. /package/{esm → dist/esm}/util/intl-callapp/es/evoke.js +0 -0
  57. /package/{esm → dist/esm}/util/intl-callapp/es/generate.d.ts +0 -0
  58. /package/{esm → dist/esm}/util/intl-callapp/es/generate.js +0 -0
  59. /package/{esm → dist/esm}/util/intl-callapp/es/index.d.ts +0 -0
  60. /package/{esm → dist/esm}/util/intl-callapp/es/index.js +0 -0
  61. /package/{esm → dist/esm}/util/intl-callapp/es/main.d.ts +0 -0
  62. /package/{esm → dist/esm}/util/intl-callapp/es/main.js +0 -0
  63. /package/{esm → dist/esm}/util/intl-callapp/es/openWallet.d.ts +0 -0
  64. /package/{esm → dist/esm}/util/intl-callapp/es/openWallet.js +0 -0
  65. /package/{esm → dist/esm}/util/intl-callapp/es/types.d.ts +0 -0
  66. /package/{esm → dist/esm}/util/intl-callapp/es/types.js +0 -0
  67. /package/{esm → dist/esm}/util/intl-callapp/es/utils/config.d.ts +0 -0
  68. /package/{esm → dist/esm}/util/intl-callapp/es/utils/config.js +0 -0
  69. /package/{esm → dist/esm}/util/intl-callapp/es/utils/index.d.ts +0 -0
  70. /package/{esm → dist/esm}/util/intl-callapp/es/utils/index.js +0 -0
  71. /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 { errorEnum } from "../types";
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: errorEnum.LOGIN,
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: errorEnum.TIMEOUT,
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: errorEnum.GATEWAY,
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() ? maxFontSize : screenWidth * 100 / designSize;
235
- return Math.min(currentFontSize, maxFontSize);
232
+ var currentFontSize = isPC() ? 100 : screenWidth * 100 / 390;
233
+ return currentFontSize;
236
234
  };
237
- var amsSetSize = function amsSetSize(event, dom) {
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
+ };