@alicloud/alfa-react 1.4.8 → 1.4.9-alpha.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.
@@ -0,0 +1,4 @@
1
+ import { addRequestInterceptor } from '@alicloud/alfa-core';
2
+ export default function addGlobalRequestInterceptor(interceptor) {
3
+ addRequestInterceptor(interceptor);
4
+ }
@@ -131,7 +131,7 @@ export default function createApplication(loader) {
131
131
 
132
132
  case 10:
133
133
  // update body in sandbox context
134
- (_app$context$updateBo = (_app$context = app.context).updateBody) === null || _app$context$updateBo === void 0 ? void 0 : _app$context$updateBo.call(_app$context, appRef.current);
134
+ (_app$context$updateBo = (_app$context = app.context).updateBody) === null || _app$context$updateBo === void 0 ? void 0 : _app$context$updateBo.call(_app$context, memoOptions.sandbox.disableFakeBody ? document.body : appRef.current);
135
135
  _context.next = 13;
136
136
  return app.mount(appRef.current, {
137
137
  customProps: customProps
@@ -168,7 +168,7 @@ export default function createApplication(loader) {
168
168
  };
169
169
  return /*#__PURE__*/React.createElement(React.Fragment, null, !app ? /*#__PURE__*/React.createElement(Loading, {
170
170
  loading: loading
171
- }) : null, sandbox && sandbox.disableFakeBody && false ? /*#__PURE__*/React.createElement(tagName, _objectSpread({
171
+ }) : null, sandbox && sandbox.disableFakeBody ? /*#__PURE__*/React.createElement(tagName, _objectSpread({
172
172
  style: style,
173
173
  className: className,
174
174
  ref: appRef
package/es/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as createAlfaApp } from './createAlfaApp';
2
2
  export { default as createAlfaWidget } from './createAlfaWidget';
3
- export { eventEmitter as widgetEventEmitter } from './widget/index'; // todo
3
+ export { eventEmitter as widgetEventEmitter } from './widget/index';
4
+ export { default as addGlobalRequestInterceptor } from './addGlobalRequestInterceptor'; // todo
4
5
 
5
6
  export { createEventBus, prefetch } from '@alicloud/alfa-core';
package/es/version.js CHANGED
@@ -1 +1 @@
1
- export var version = '1.4.8';
1
+ export var version = '1.4.9-alpha.2';
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = addGlobalRequestInterceptor;
7
+
8
+ var _alfaCore = require("@alicloud/alfa-core");
9
+
10
+ function addGlobalRequestInterceptor(interceptor) {
11
+ (0, _alfaCore.addRequestInterceptor)(interceptor);
12
+ }
@@ -152,7 +152,7 @@ function createApplication(loader) {
152
152
 
153
153
  case 10:
154
154
  // update body in sandbox context
155
- (_app$context$updateBo = (_app$context = app.context).updateBody) === null || _app$context$updateBo === void 0 ? void 0 : _app$context$updateBo.call(_app$context, appRef.current);
155
+ (_app$context$updateBo = (_app$context = app.context).updateBody) === null || _app$context$updateBo === void 0 ? void 0 : _app$context$updateBo.call(_app$context, memoOptions.sandbox.disableFakeBody ? document.body : appRef.current);
156
156
  _context.next = 13;
157
157
  return app.mount(appRef.current, {
158
158
  customProps: customProps
@@ -188,7 +188,7 @@ function createApplication(loader) {
188
188
  };
189
189
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !app ? /*#__PURE__*/_react.default.createElement(_Loading.default, {
190
190
  loading: loading
191
- }) : null, sandbox && sandbox.disableFakeBody && false ? /*#__PURE__*/_react.default.createElement(tagName, _objectSpread({
191
+ }) : null, sandbox && sandbox.disableFakeBody ? /*#__PURE__*/_react.default.createElement(tagName, _objectSpread({
192
192
  style: style,
193
193
  className: className,
194
194
  ref: appRef
package/lib/index.js CHANGED
@@ -5,6 +5,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ Object.defineProperty(exports, "addGlobalRequestInterceptor", {
9
+ enumerable: true,
10
+ get: function get() {
11
+ return _addGlobalRequestInterceptor.default;
12
+ }
13
+ });
8
14
  Object.defineProperty(exports, "createAlfaApp", {
9
15
  enumerable: true,
10
16
  get: function get() {
@@ -42,4 +48,6 @@ var _createAlfaWidget = _interopRequireDefault(require("./createAlfaWidget"));
42
48
 
43
49
  var _index = require("./widget/index");
44
50
 
51
+ var _addGlobalRequestInterceptor = _interopRequireDefault(require("./addGlobalRequestInterceptor"));
52
+
45
53
  var _alfaCore = require("@alicloud/alfa-core");
package/lib/version.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- var version = '1.4.8';
7
+ var version = '1.4.9-alpha.2';
8
8
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/alfa-react",
3
- "version": "1.4.8",
3
+ "version": "1.4.9-alpha.2",
4
4
  "description": "Alfa Framework (React Version)",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -25,6 +25,7 @@
25
25
  "devDependencies": {
26
26
  "@alicloud/console-toolkit-cli": "^1.0.0",
27
27
  "@alicloud/console-toolkit-preset-wind-component": "^1.0.0",
28
+ "@types/axios": "^0.14.0",
28
29
  "@types/chai": "^4.1.7",
29
30
  "@types/classnames": "^2.2.9",
30
31
  "@types/crypto-js": "^4.0.2",
@@ -41,7 +42,7 @@
41
42
  "typescript": "^3.0.3"
42
43
  },
43
44
  "dependencies": {
44
- "@alicloud/alfa-core": "^1.4.7",
45
+ "@alicloud/alfa-core": "^1.4.9-alpha.2",
45
46
  "@alicloud/console-os-loader": "^1.2.3",
46
47
  "@alicloud/widget-utils-console": "^0.1.6",
47
48
  "classnames": "^2.2.6",
@@ -50,5 +51,5 @@
50
51
  "peerDependencies": {
51
52
  "react": "^16 | ^17"
52
53
  },
53
- "gitHead": "5f21e6d8b34324e8962e90760a0537139a33201f"
54
+ "gitHead": "79ca36eb444681042c6b76a3094327094a48e21b"
54
55
  }
@@ -0,0 +1,2 @@
1
+ import { RequestInterceptor } from '@alicloud/alfa-core/types/utils/interceptors';
2
+ export default function addGlobalRequestInterceptor(interceptor: RequestInterceptor): void;
package/types/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { default as createAlfaApp } from './createAlfaApp';
2
2
  export { default as createAlfaWidget } from './createAlfaWidget';
3
3
  export { eventEmitter as widgetEventEmitter } from './widget/index';
4
+ export { default as addGlobalRequestInterceptor } from './addGlobalRequestInterceptor';
4
5
  export { createEventBus, prefetch } from '@alicloud/alfa-core';
@@ -1 +1 @@
1
- export declare const version = "1.4.8";
1
+ export declare const version = "1.4.9-alpha.2";