@alicloud/alfa-react 1.6.2-alpha.5 → 1.6.2-alpha.6
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/es/createAlfaWidget.js +3 -2
- package/es/utils/index.js +2 -1
- package/es/version.js +1 -1
- package/lib/createAlfaWidget.js +3 -2
- package/lib/utils/index.js +4 -2
- package/lib/version.js +1 -1
- package/package.json +18 -17
- package/types/utils/index.d.ts +1 -0
- package/types/version.d.ts +1 -1
- package/LICENSE +0 -21
package/es/createAlfaWidget.js
CHANGED
|
@@ -14,6 +14,7 @@ import beforeResolveHook from './hooks/beforeResolveHook';
|
|
|
14
14
|
import beforeLoadHook from './hooks/beforeLoadHook';
|
|
15
15
|
import { isOneConsole } from './helpers/oneConsole';
|
|
16
16
|
import Loading from './components/Loading';
|
|
17
|
+
import { IS_SSR } from './utils';
|
|
17
18
|
var loader = BaseLoader.create();
|
|
18
19
|
loader.beforeResolve.use(beforeResolveHook);
|
|
19
20
|
loader.beforeLoad.use(beforeLoadHook);
|
|
@@ -60,7 +61,7 @@ function createAlfaWidget(option) {
|
|
|
60
61
|
return null;
|
|
61
62
|
};
|
|
62
63
|
var preLoader;
|
|
63
|
-
if (priority === 'high') {
|
|
64
|
+
if (priority === 'high' && !IS_SSR) {
|
|
64
65
|
var p = loader.register(_objectSpread(_objectSpread({}, option), {}, {
|
|
65
66
|
// 必须设置 container,否则沙箱会创建插入一个新的 body
|
|
66
67
|
container: document.body,
|
|
@@ -107,7 +108,7 @@ function createAlfaWidget(option) {
|
|
|
107
108
|
return undefined;
|
|
108
109
|
}, []);
|
|
109
110
|
};
|
|
110
|
-
if (priority === 'low') {
|
|
111
|
+
if (priority === 'low' && !IS_SSR) {
|
|
111
112
|
return function (props) {
|
|
112
113
|
var delayPromise = useDelay();
|
|
113
114
|
|
package/es/utils/index.js
CHANGED
|
@@ -32,4 +32,5 @@ export var setNativeProperty = function setNativeProperty(obj, propertyName, val
|
|
|
32
32
|
// in strict mode, Cannot set property go of [xx] which has only a getter
|
|
33
33
|
if (desc && typeof desc.set === 'undefined') return;
|
|
34
34
|
obj[propertyName] = value;
|
|
35
|
-
};
|
|
35
|
+
};
|
|
36
|
+
export var IS_SSR = typeof document === 'undefined';
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var version = '1.6.2-alpha.
|
|
1
|
+
export var version = '1.6.2-alpha.6';
|
package/lib/createAlfaWidget.js
CHANGED
|
@@ -21,6 +21,7 @@ var _beforeResolveHook = _interopRequireDefault(require("./hooks/beforeResolveHo
|
|
|
21
21
|
var _beforeLoadHook = _interopRequireDefault(require("./hooks/beforeLoadHook"));
|
|
22
22
|
var _oneConsole = require("./helpers/oneConsole");
|
|
23
23
|
var _Loading = _interopRequireDefault(require("./components/Loading"));
|
|
24
|
+
var _utils = require("./utils");
|
|
24
25
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
27
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -71,7 +72,7 @@ function createAlfaWidget(option) {
|
|
|
71
72
|
return null;
|
|
72
73
|
};
|
|
73
74
|
var preLoader;
|
|
74
|
-
if (priority === 'high') {
|
|
75
|
+
if (priority === 'high' && !_utils.IS_SSR) {
|
|
75
76
|
var p = loader.register(_objectSpread(_objectSpread({}, option), {}, {
|
|
76
77
|
// 必须设置 container,否则沙箱会创建插入一个新的 body
|
|
77
78
|
container: document.body,
|
|
@@ -118,7 +119,7 @@ function createAlfaWidget(option) {
|
|
|
118
119
|
return undefined;
|
|
119
120
|
}, []);
|
|
120
121
|
};
|
|
121
|
-
if (priority === 'low') {
|
|
122
|
+
if (priority === 'low' && !_utils.IS_SSR) {
|
|
122
123
|
return function (props) {
|
|
123
124
|
var delayPromise = useDelay();
|
|
124
125
|
|
package/lib/utils/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.setNativeProperty = exports.normalizeName = exports.isOsContext = void 0;
|
|
6
|
+
exports.setNativeProperty = exports.normalizeName = exports.isOsContext = exports.IS_SSR = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* kernel 会为沙箱 context 注入 __IS_CONSOLE_OS_CONTEXT__
|
|
9
9
|
*/
|
|
@@ -41,4 +41,6 @@ var setNativeProperty = function setNativeProperty(obj, propertyName, value) {
|
|
|
41
41
|
if (desc && typeof desc.set === 'undefined') return;
|
|
42
42
|
obj[propertyName] = value;
|
|
43
43
|
};
|
|
44
|
-
exports.setNativeProperty = setNativeProperty;
|
|
44
|
+
exports.setNativeProperty = setNativeProperty;
|
|
45
|
+
var IS_SSR = typeof document === 'undefined';
|
|
46
|
+
exports.IS_SSR = IS_SSR;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/alfa-react",
|
|
3
|
-
"version": "1.6.2-alpha.
|
|
3
|
+
"version": "1.6.2-alpha.6",
|
|
4
4
|
"description": "Alfa Framework (React Version)",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
8
8
|
"author": "pushiming",
|
|
9
9
|
"license": "MIT",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"prepublishOnly": "npm run version && npm run babel && npm run babel:esm && npm run types",
|
|
12
|
+
"pub": "pnpm publish",
|
|
13
|
+
"build": "breezr build --engine webpack",
|
|
14
|
+
"babel": "breezr build --engine babel",
|
|
15
|
+
"babel:esm": "breezr build --engine babel --es-module",
|
|
16
|
+
"types": "tsc --emitDeclarationOnly -d --declarationDir ./types",
|
|
17
|
+
"storybook": "breezr start-storybook",
|
|
18
|
+
"clean": "rm -rf lib es dist types yarn.lock",
|
|
19
|
+
"start": "NODE_OPTIONS=--openssl-legacy-provider breezr start-storybook",
|
|
20
|
+
"precommit": "npm run version",
|
|
21
|
+
"version": "node -p \"'export const version = \\'' + require('./package.json').version + '\\';'\" > src/version.ts && git add src/version.ts"
|
|
22
|
+
},
|
|
10
23
|
"publishConfig": {
|
|
11
24
|
"access": "public"
|
|
12
25
|
},
|
|
@@ -32,31 +45,19 @@
|
|
|
32
45
|
"typescript": "^4.0.0"
|
|
33
46
|
},
|
|
34
47
|
"dependencies": {
|
|
48
|
+
"@alicloud/alfa-core": "workspace:^",
|
|
35
49
|
"@alicloud/console-base-messenger": "^1.18.1",
|
|
50
|
+
"@alicloud/console-os-loader": "workspace:^",
|
|
36
51
|
"@alicloud/widget-utils-console": "^0.1.6",
|
|
37
52
|
"@alicloud/xconsole-context": "^2.4.32",
|
|
38
53
|
"axios": "^0.21.4",
|
|
39
54
|
"classnames": "^2.2.6",
|
|
40
55
|
"crypto-js": "^4.1.1",
|
|
41
56
|
"prop-types": "^15.8.1",
|
|
42
|
-
"react-lazyload": "^3.2.1"
|
|
43
|
-
"@alicloud/alfa-core": "^1.4.37",
|
|
44
|
-
"@alicloud/console-os-loader": "^1.4.42"
|
|
57
|
+
"react-lazyload": "^3.2.1"
|
|
45
58
|
},
|
|
46
59
|
"peerDependencies": {
|
|
47
60
|
"react": ">=16.0.0",
|
|
48
61
|
"react-dom": ">=16.0.0"
|
|
49
|
-
},
|
|
50
|
-
"scripts": {
|
|
51
|
-
"pub": "pnpm publish",
|
|
52
|
-
"build": "breezr build --engine webpack",
|
|
53
|
-
"babel": "breezr build --engine babel",
|
|
54
|
-
"babel:esm": "breezr build --engine babel --es-module",
|
|
55
|
-
"types": "tsc --emitDeclarationOnly -d --declarationDir ./types",
|
|
56
|
-
"storybook": "breezr start-storybook",
|
|
57
|
-
"clean": "rm -rf lib es dist types yarn.lock",
|
|
58
|
-
"start": "NODE_OPTIONS=--openssl-legacy-provider breezr start-storybook",
|
|
59
|
-
"precommit": "npm run version",
|
|
60
|
-
"version": "node -p \"'export const version = \\'' + require('./package.json').version + '\\';'\" > src/version.ts && git add src/version.ts"
|
|
61
62
|
}
|
|
62
|
-
}
|
|
63
|
+
}
|
package/types/utils/index.d.ts
CHANGED
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.6.2-alpha.
|
|
1
|
+
export declare const version = "1.6.2-alpha.6";
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2019 Alibaba Cloud
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|