@alicloud/alfa-react 1.5.0-alpha.0 → 1.5.1-alpha.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/es/createAlfaApp.js +1 -0
- package/es/createAlfaWidget.js +1 -0
- package/es/index.js +1 -0
- package/es/version.js +1 -1
- package/lib/createAlfaApp.js +1 -0
- package/lib/createAlfaWidget.js +1 -0
- package/lib/index.js +7 -0
- package/lib/version.js +1 -1
- package/package.json +18 -18
- package/types/createAlfaApp.d.ts +14 -1
- package/types/createAlfaWidget.d.ts +15 -3
- package/types/index.d.ts +1 -0
- package/types/types/index.d.ts +4 -0
- package/types/version.d.ts +1 -1
- package/LICENSE +0 -21
package/es/createAlfaApp.js
CHANGED
|
@@ -31,6 +31,7 @@ function createAlfaApp(option) {
|
|
|
31
31
|
return /*#__PURE__*/React.createElement(ErrorBoundary, props, /*#__PURE__*/React.createElement(Application
|
|
32
32
|
// 兼容历史逻辑,优先使用 option 中的 sandbox 参数
|
|
33
33
|
, _extends({}, passedInOption, {
|
|
34
|
+
style: props.style || passedInOption.style,
|
|
34
35
|
syncHistory: props.syncHistory,
|
|
35
36
|
basename: props.basename,
|
|
36
37
|
sandbox: option.sandbox || props.sandbox,
|
package/es/createAlfaWidget.js
CHANGED
|
@@ -58,6 +58,7 @@ function createAlfaWidget(option) {
|
|
|
58
58
|
// props should not passed in errorBoundary
|
|
59
59
|
React.createElement(ErrorBoundary, props, /*#__PURE__*/React.createElement(Application, _extends({}, passedInOption, {
|
|
60
60
|
// name={name}
|
|
61
|
+
style: props.style || passedInOption.style,
|
|
61
62
|
deps: dependencies || {},
|
|
62
63
|
customProps: _objectSpread({}, props)
|
|
63
64
|
})))
|
package/es/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as Skeleton } from './components/Loading/Skeleton';
|
|
1
2
|
export { default as createAlfaApp, useAlfaApp } from './createAlfaApp';
|
|
2
3
|
export { default as createAlfaWidget, useAlfaWidget } from './createAlfaWidget';
|
|
3
4
|
export { eventEmitter as widgetEventEmitter } from './widget/index';
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var version = '1.5.0
|
|
1
|
+
export var version = '1.5.0';
|
package/lib/createAlfaApp.js
CHANGED
|
@@ -42,6 +42,7 @@ function createAlfaApp(option) {
|
|
|
42
42
|
return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.default, props, /*#__PURE__*/_react.default.createElement(Application
|
|
43
43
|
// 兼容历史逻辑,优先使用 option 中的 sandbox 参数
|
|
44
44
|
, (0, _extends2.default)({}, passedInOption, {
|
|
45
|
+
style: props.style || passedInOption.style,
|
|
45
46
|
syncHistory: props.syncHistory,
|
|
46
47
|
basename: props.basename,
|
|
47
48
|
sandbox: option.sandbox || props.sandbox,
|
package/lib/createAlfaWidget.js
CHANGED
|
@@ -69,6 +69,7 @@ function createAlfaWidget(option) {
|
|
|
69
69
|
// props should not passed in errorBoundary
|
|
70
70
|
_react.default.createElement(_ErrorBoundary.default, props, /*#__PURE__*/_react.default.createElement(Application, (0, _extends2.default)({}, passedInOption, {
|
|
71
71
|
// name={name}
|
|
72
|
+
style: props.style || passedInOption.style,
|
|
72
73
|
deps: dependencies || {},
|
|
73
74
|
customProps: _objectSpread({}, props)
|
|
74
75
|
})))
|
package/lib/index.js
CHANGED
|
@@ -5,6 +5,12 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
Object.defineProperty(exports, "Skeleton", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _Skeleton.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
8
14
|
Object.defineProperty(exports, "addGlobalRequestInterceptor", {
|
|
9
15
|
enumerable: true,
|
|
10
16
|
get: function get() {
|
|
@@ -53,6 +59,7 @@ Object.defineProperty(exports, "widgetEventEmitter", {
|
|
|
53
59
|
return _index.eventEmitter;
|
|
54
60
|
}
|
|
55
61
|
});
|
|
62
|
+
var _Skeleton = _interopRequireDefault(require("./components/Loading/Skeleton"));
|
|
56
63
|
var _createAlfaApp = _interopRequireWildcard(require("./createAlfaApp"));
|
|
57
64
|
var _createAlfaWidget = _interopRequireWildcard(require("./createAlfaWidget"));
|
|
58
65
|
var _index = require("./widget/index");
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/alfa-react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1-alpha.0",
|
|
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
|
+
"prepublish": "npm run version && npm run build && npm run babel && npm run babel:esm && npm run types",
|
|
12
|
+
"build": "breezr build --engine webpack",
|
|
13
|
+
"babel": "breezr build --engine babel",
|
|
14
|
+
"babel:esm": "breezr build --engine babel --es-module",
|
|
15
|
+
"types": "tsc --emitDeclarationOnly -d --declarationDir ./types",
|
|
16
|
+
"storybook": "breezr start-storybook",
|
|
17
|
+
"clean": "rm -rf lib es dist types yarn.lock",
|
|
18
|
+
"start": "breezr start-storybook",
|
|
19
|
+
"precommit": "npm run version",
|
|
20
|
+
"version": "node -p \"'export const version = \\'' + require('./package.json').version + '\\';'\" > src/version.ts && git add src/version.ts"
|
|
21
|
+
},
|
|
10
22
|
"publishConfig": {
|
|
11
23
|
"access": "public"
|
|
12
24
|
},
|
|
@@ -31,28 +43,16 @@
|
|
|
31
43
|
"typescript": "^4.0.0"
|
|
32
44
|
},
|
|
33
45
|
"dependencies": {
|
|
46
|
+
"@alicloud/alfa-core": "workspace:*",
|
|
47
|
+
"@alicloud/console-os-loader": "workspace:*",
|
|
34
48
|
"@alicloud/widget-utils-console": "^0.1.6",
|
|
35
49
|
"axios": "^1.4.0",
|
|
36
50
|
"classnames": "^2.2.6",
|
|
37
51
|
"crypto-js": "^4.1.1",
|
|
38
|
-
"prop-types": "^15.8.1"
|
|
39
|
-
"@alicloud/alfa-core": "1.4.32",
|
|
40
|
-
"@alicloud/console-os-loader": "1.4.30-alpha.0"
|
|
52
|
+
"prop-types": "^15.8.1"
|
|
41
53
|
},
|
|
42
54
|
"peerDependencies": {
|
|
43
55
|
"react": ">=16.0.0"
|
|
44
56
|
},
|
|
45
|
-
"gitHead": "ff9294b1d5e08b14691c8aa2bef098da2857f3df"
|
|
46
|
-
|
|
47
|
-
"prepublish": "npm run version && npm run build && npm run babel && npm run babel:esm && npm run types",
|
|
48
|
-
"build": "breezr build --engine webpack",
|
|
49
|
-
"babel": "breezr build --engine babel",
|
|
50
|
-
"babel:esm": "breezr build --engine babel --es-module",
|
|
51
|
-
"types": "tsc --emitDeclarationOnly -d --declarationDir ./types",
|
|
52
|
-
"storybook": "breezr start-storybook",
|
|
53
|
-
"clean": "rm -rf lib es dist types yarn.lock",
|
|
54
|
-
"start": "breezr start-storybook",
|
|
55
|
-
"precommit": "npm run version",
|
|
56
|
-
"version": "node -p \"'export const version = \\'' + require('./package.json').version + '\\';'\" > src/version.ts && git add src/version.ts"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
57
|
+
"gitHead": "ff9294b1d5e08b14691c8aa2bef098da2857f3df"
|
|
58
|
+
}
|
package/types/createAlfaApp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { AlfaFactoryOption } from './types';
|
|
3
3
|
interface IProps {
|
|
4
4
|
/**
|
|
@@ -11,10 +11,23 @@ interface IProps {
|
|
|
11
11
|
* @returns
|
|
12
12
|
*/
|
|
13
13
|
handleExternalLink?: (url: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* 是否开启路由自动同步,需配合 basename 使用
|
|
16
|
+
*/
|
|
14
17
|
syncHistory?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 子应用路由前缀
|
|
20
|
+
*/
|
|
15
21
|
basename?: string;
|
|
16
22
|
history?: any;
|
|
23
|
+
/**
|
|
24
|
+
* 子应用路由
|
|
25
|
+
*/
|
|
17
26
|
path?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 根节点样式
|
|
29
|
+
*/
|
|
30
|
+
style?: React.CSSProperties;
|
|
18
31
|
}
|
|
19
32
|
declare function createAlfaApp<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => JSX.Element);
|
|
20
33
|
/**
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { AlfaFactoryOption } from './types';
|
|
3
|
-
|
|
3
|
+
interface IProps {
|
|
4
|
+
/**
|
|
5
|
+
* 处理外跳链接
|
|
6
|
+
* @param url
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
handleExternalLink?: (url: string) => void;
|
|
10
|
+
/**
|
|
11
|
+
* 根节点样式
|
|
12
|
+
*/
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
declare function createAlfaWidget<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => JSX.Element);
|
|
4
16
|
/**
|
|
5
17
|
* create memorized app in react function component, just create App after first mounted
|
|
6
18
|
* @param option
|
|
7
19
|
* @returns
|
|
8
20
|
*/
|
|
9
|
-
export declare function useAlfaWidget<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P &
|
|
21
|
+
export declare function useAlfaWidget<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => JSX.Element);
|
|
10
22
|
export default createAlfaWidget;
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as Skeleton } from './components/Loading/Skeleton';
|
|
1
2
|
export { default as createAlfaApp, useAlfaApp } from './createAlfaApp';
|
|
2
3
|
export { default as createAlfaWidget, useAlfaWidget } from './createAlfaWidget';
|
|
3
4
|
export { eventEmitter as widgetEventEmitter } from './widget/index';
|
package/types/types/index.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ export interface AlfaFactoryOption extends IAppConfig {
|
|
|
14
14
|
loading?: boolean | React.ReactChild;
|
|
15
15
|
dependencies?: Record<string, any>;
|
|
16
16
|
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated
|
|
19
|
+
* 根节点样式
|
|
20
|
+
*/
|
|
17
21
|
style?: Record<string, any>;
|
|
18
22
|
unstable_runtime?: {
|
|
19
23
|
css?: Record<string, string>;
|
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.5.0
|
|
1
|
+
export declare const version = "1.5.0";
|
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.
|