@alicloud/alfa-react 1.4.8 → 1.4.10
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/index.js +5 -5
- package/es/addGlobalRequestInterceptor.js +4 -0
- package/es/createApplication.js +2 -2
- package/es/index.js +2 -1
- package/es/utils/getConsoleConfig.js +3 -3
- package/es/version.js +1 -1
- package/lib/addGlobalRequestInterceptor.js +12 -0
- package/lib/createApplication.js +2 -2
- package/lib/index.js +8 -0
- package/lib/utils/getConsoleConfig.js +3 -3
- package/lib/version.js +1 -1
- package/package.json +4 -3
- package/types/addGlobalRequestInterceptor.d.ts +2 -0
- package/types/index.d.ts +1 -0
- package/types/version.d.ts +1 -1
package/es/createApplication.js
CHANGED
|
@@ -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
|
|
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';
|
|
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';
|
|
@@ -28,13 +28,13 @@ var processFeatures = function processFeatures(features) {
|
|
|
28
28
|
blockList = feature.blockList,
|
|
29
29
|
whiteList = feature.whiteList;
|
|
30
30
|
|
|
31
|
-
if (enableBlockList && blockList.includes(md5Uid)) {
|
|
31
|
+
if (enableBlockList && blockList !== null && blockList !== void 0 && blockList.includes(md5Uid)) {
|
|
32
32
|
newFeatures[key] = false;
|
|
33
|
-
} else if (enableWhiteList && whiteList.includes(md5Uid)) {
|
|
33
|
+
} else if (enableWhiteList && whiteList !== null && whiteList !== void 0 && whiteList.includes(md5Uid)) {
|
|
34
34
|
newFeatures[key] = true;
|
|
35
35
|
} else if (enableSampling) {
|
|
36
36
|
var gray = uid.substring(uid.length - 2);
|
|
37
|
-
if (Number(gray) >= sampling * 100 || sampling === 0) newFeatures[key] = false;
|
|
37
|
+
if (Number(gray) >= (sampling !== null && sampling !== void 0 ? sampling : 0) * 100 || sampling === 0) newFeatures[key] = false;
|
|
38
38
|
newFeatures[key] = true;
|
|
39
39
|
} else {
|
|
40
40
|
newFeatures[key] = false;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var version = '1.4.
|
|
1
|
+
export var version = '1.4.10';
|
|
@@ -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
|
+
}
|
package/lib/createApplication.js
CHANGED
|
@@ -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
|
|
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");
|
|
@@ -39,13 +39,13 @@ var processFeatures = function processFeatures(features) {
|
|
|
39
39
|
blockList = feature.blockList,
|
|
40
40
|
whiteList = feature.whiteList;
|
|
41
41
|
|
|
42
|
-
if (enableBlockList && blockList.includes(md5Uid)) {
|
|
42
|
+
if (enableBlockList && blockList !== null && blockList !== void 0 && blockList.includes(md5Uid)) {
|
|
43
43
|
newFeatures[key] = false;
|
|
44
|
-
} else if (enableWhiteList && whiteList.includes(md5Uid)) {
|
|
44
|
+
} else if (enableWhiteList && whiteList !== null && whiteList !== void 0 && whiteList.includes(md5Uid)) {
|
|
45
45
|
newFeatures[key] = true;
|
|
46
46
|
} else if (enableSampling) {
|
|
47
47
|
var gray = uid.substring(uid.length - 2);
|
|
48
|
-
if (Number(gray) >= sampling * 100 || sampling === 0) newFeatures[key] = false;
|
|
48
|
+
if (Number(gray) >= (sampling !== null && sampling !== void 0 ? sampling : 0) * 100 || sampling === 0) newFeatures[key] = false;
|
|
49
49
|
newFeatures[key] = true;
|
|
50
50
|
} else {
|
|
51
51
|
newFeatures[key] = false;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/alfa-react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.10",
|
|
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.
|
|
45
|
+
"@alicloud/alfa-core": "^1.4.10",
|
|
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": "
|
|
54
|
+
"gitHead": "0620b74fc9e6f4c84015e725fd7e61f282eda333"
|
|
54
55
|
}
|
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';
|
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.4.
|
|
1
|
+
export declare const version = "1.4.10";
|