@alicloud/alfa-react 1.4.40-alpha.0 → 1.4.40
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/LICENSE +21 -0
- package/es/components/ErrorBoundary/ErrorPanel.js +0 -2
- package/es/components/ErrorBoundary/index.js +7 -19
- package/es/components/Loading/Paragraph.js +9 -25
- package/es/components/Loading/Skeleton.js +14 -46
- package/es/components/Loading/Title.js +3 -8
- package/es/components/Loading/index.js +0 -2
- package/es/createAlfaApp.js +6 -10
- package/es/createAlfaWidget.js +16 -28
- package/es/createApplication.js +142 -188
- package/es/hooks/beforeLoadHook.js +60 -81
- package/es/hooks/beforeResolveHook.js +24 -29
- package/es/index.js +2 -2
- package/es/types/base.js +0 -9
- package/es/utils/counter.js +1 -3
- package/es/utils/getConsoleConfig.js +13 -32
- package/es/utils/getConsoleGlobal.js +6 -13
- package/es/utils/index.js +2 -1
- package/es/version.js +1 -1
- package/es/widget/emitter.js +2 -11
- package/es/widget/env.js +2 -4
- package/es/widget/getWidgetConfigById.js +19 -27
- package/es/widget/getWidgetDeps.js +104 -130
- package/es/widget/getWidgetVersionById.js +79 -106
- package/es/widget.js +45 -58
- package/lib/addGlobalRequestInterceptor.js +0 -2
- package/lib/components/ErrorBoundary/ErrorPanel.js +0 -5
- package/lib/components/ErrorBoundary/index.js +7 -25
- package/lib/components/Loading/Paragraph.js +9 -32
- package/lib/components/Loading/Skeleton.js +14 -60
- package/lib/components/Loading/Title.js +3 -14
- package/lib/components/Loading/index.js +0 -6
- package/lib/createAlfaApp.js +6 -24
- package/lib/createAlfaWidget.js +16 -45
- package/lib/createApplication.js +142 -199
- package/lib/hooks/beforeLoadHook.js +60 -88
- package/lib/hooks/beforeResolveHook.js +21 -33
- package/lib/index.js +0 -9
- package/lib/types/base.js +0 -14
- package/lib/utils/counter.js +1 -4
- package/lib/utils/getConsoleConfig.js +12 -37
- package/lib/utils/getConsoleGlobal.js +6 -18
- package/lib/utils/index.js +2 -5
- package/lib/version.js +1 -1
- package/lib/widget/emitter.js +2 -16
- package/lib/widget/env.js +2 -6
- package/lib/widget/getWidgetConfigById.js +19 -36
- package/lib/widget/getWidgetDeps.js +103 -146
- package/lib/widget/getWidgetVersionById.js +79 -113
- package/lib/widget/index.js +0 -8
- package/lib/widget.js +45 -72
- package/package.json +22 -19
- package/types/components/ErrorBoundary/index.d.ts +1 -1
- package/types/components/Loading/Paragraph.d.ts +2 -2
- package/types/components/Loading/Skeleton.d.ts +2 -2
- package/types/components/Loading/Title.d.ts +2 -2
- package/types/components/Loading/index.d.ts +1 -1
- package/types/createAlfaApp.d.ts +3 -3
- package/types/createAlfaWidget.d.ts +3 -3
- package/types/createApplication.d.ts +2 -2
- package/types/types/index.d.ts +5 -5
- package/types/utils/getConsoleConfig.d.ts +4 -2
- package/types/utils/getConsoleGlobal.d.ts +3 -1
- package/types/version.d.ts +1 -1
- package/types/widget/getWidgetDeps.d.ts +1 -1
- package/types/widget.d.ts +2 -2
- package/dist/index.js +0 -21
- package/es/app.js +0 -194
- package/es/hooks/afterLoadHook.js +0 -69
- package/lib/app.d.ts +0 -3
- package/lib/app.js +0 -223
- package/lib/components/ErrorBoundary/ErrorPanel.d.ts +0 -6
- package/lib/components/ErrorBoundary/index.d.ts +0 -17
- package/lib/components/Loading/Paragraph.d.ts +0 -14
- package/lib/components/Loading/Skeleton.d.ts +0 -19
- package/lib/components/Loading/Title.d.ts +0 -8
- package/lib/components/Loading/index.d.ts +0 -4
- package/lib/components/Loading/style.d.ts +0 -2
- package/lib/createAlfaApp.d.ts +0 -7
- package/lib/createAlfaWidget.d.ts +0 -4
- package/lib/createApplication.d.ts +0 -12
- package/lib/hooks/afterLoadHook.d.ts +0 -3
- package/lib/hooks/afterLoadHook.js +0 -84
- package/lib/hooks/beforeLoadHook.d.ts +0 -3
- package/lib/hooks/beforeResolveHook.d.ts +0 -3
- package/lib/index.d.ts +0 -4
- package/lib/types/base.d.ts +0 -11
- package/lib/types/index.d.ts +0 -91
- package/lib/utils/getConsoleConfig.d.ts +0 -1
- package/lib/utils/getConsoleGlobal.d.ts +0 -1
- package/lib/utils/index.d.ts +0 -1
- package/lib/version.d.ts +0 -1
- package/lib/widget/emitter.d.ts +0 -8
- package/lib/widget/env.d.ts +0 -4
- package/lib/widget/getWidgetConfigById.d.ts +0 -2
- package/lib/widget/getWidgetDeps.d.ts +0 -2
- package/lib/widget/getWidgetVersionById.d.ts +0 -6
- package/lib/widget/index.d.ts +0 -4
- package/lib/widget.d.ts +0 -2
package/lib/widget.js
CHANGED
|
@@ -1,102 +1,75 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.createCWSWidget = createCWSWidget;
|
|
11
|
-
|
|
12
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
-
|
|
16
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
-
|
|
18
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
|
-
|
|
20
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
14
|
var _consoleOsLoader = require("@alicloud/console-os-loader");
|
|
23
|
-
|
|
24
15
|
var _index = require("./widget/index");
|
|
25
|
-
|
|
26
16
|
var _ErrorBoundary = _interopRequireDefault(require("./components/ErrorBoundary"));
|
|
27
|
-
|
|
28
17
|
var _Loading = _interopRequireDefault(require("./components/Loading"));
|
|
29
|
-
|
|
30
18
|
var _utils = require("./utils");
|
|
31
|
-
|
|
32
19
|
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); }
|
|
33
|
-
|
|
34
20
|
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; }
|
|
35
|
-
|
|
36
21
|
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; }
|
|
37
|
-
|
|
38
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
|
-
|
|
40
23
|
function createCWSWidget(option) {
|
|
41
24
|
var AlfaWidget = /*#__PURE__*/(0, _react.lazy)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
42
25
|
var url, config, _yield$getWidgetVersi, version, entryUrl, deps;
|
|
43
|
-
|
|
44
26
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
45
|
-
while (1) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
27
|
+
while (1) switch (_context.prev = _context.next) {
|
|
28
|
+
case 0:
|
|
29
|
+
url = option.url;
|
|
30
|
+
config = {
|
|
31
|
+
links: {},
|
|
32
|
+
features: {},
|
|
33
|
+
locales: {},
|
|
34
|
+
conf: {}
|
|
35
|
+
};
|
|
36
|
+
if (url) {
|
|
37
|
+
_context.next = 12;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
_context.next = 5;
|
|
41
|
+
return (0, _index.getWidgetVersionById)(option);
|
|
42
|
+
case 5:
|
|
43
|
+
_yield$getWidgetVersi = _context.sent;
|
|
44
|
+
version = _yield$getWidgetVersi.version;
|
|
45
|
+
entryUrl = _yield$getWidgetVersi.entryUrl;
|
|
46
|
+
url = entryUrl;
|
|
47
|
+
_context.next = 11;
|
|
48
|
+
return (0, _index.getWidgetConfigById)(_objectSpread(_objectSpread({}, option), {}, {
|
|
49
|
+
version: version
|
|
50
|
+
}));
|
|
51
|
+
case 11:
|
|
52
|
+
config = _context.sent;
|
|
53
|
+
case 12:
|
|
54
|
+
_context.next = 14;
|
|
55
|
+
return (0, _index.getWidgetDeps)(config, option);
|
|
56
|
+
case 14:
|
|
57
|
+
deps = _context.sent;
|
|
58
|
+
return _context.abrupt("return", (0, _consoleOsLoader.loadBundle)({
|
|
59
|
+
id: (0, _utils.normalizeName)(option.name),
|
|
60
|
+
url: (option.url || url || '').replace('index.js', option !== null && option !== void 0 && option.alfaLoader ? 'index.alfa.js' : 'index.js'),
|
|
61
|
+
deps: _objectSpread(_objectSpread({}, deps), option.dependencies),
|
|
62
|
+
xmlrequest: !option.alfaLoader,
|
|
63
|
+
context: {
|
|
64
|
+
window: window,
|
|
65
|
+
location: location,
|
|
66
|
+
history: history,
|
|
67
|
+
document: document
|
|
59
68
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
case 5:
|
|
65
|
-
_yield$getWidgetVersi = _context.sent;
|
|
66
|
-
version = _yield$getWidgetVersi.version;
|
|
67
|
-
entryUrl = _yield$getWidgetVersi.entryUrl;
|
|
68
|
-
url = entryUrl;
|
|
69
|
-
_context.next = 11;
|
|
70
|
-
return (0, _index.getWidgetConfigById)(_objectSpread(_objectSpread({}, option), {}, {
|
|
71
|
-
version: version
|
|
72
|
-
}));
|
|
73
|
-
|
|
74
|
-
case 11:
|
|
75
|
-
config = _context.sent;
|
|
76
|
-
|
|
77
|
-
case 12:
|
|
78
|
-
_context.next = 14;
|
|
79
|
-
return (0, _index.getWidgetDeps)(config, option);
|
|
80
|
-
|
|
81
|
-
case 14:
|
|
82
|
-
deps = _context.sent;
|
|
83
|
-
return _context.abrupt("return", (0, _consoleOsLoader.loadBundle)({
|
|
84
|
-
id: (0, _utils.normalizeName)(option.name),
|
|
85
|
-
url: (option.url || url || '').replace('index.js', option !== null && option !== void 0 && option.alfaLoader ? 'index.alfa.js' : 'index.js'),
|
|
86
|
-
deps: _objectSpread(_objectSpread({}, deps), option.dependencies),
|
|
87
|
-
xmlrequest: !option.alfaLoader,
|
|
88
|
-
context: {
|
|
89
|
-
window: window,
|
|
90
|
-
location: location,
|
|
91
|
-
history: history,
|
|
92
|
-
document: document
|
|
93
|
-
}
|
|
94
|
-
}));
|
|
95
|
-
|
|
96
|
-
case 16:
|
|
97
|
-
case "end":
|
|
98
|
-
return _context.stop();
|
|
99
|
-
}
|
|
69
|
+
}));
|
|
70
|
+
case 16:
|
|
71
|
+
case "end":
|
|
72
|
+
return _context.stop();
|
|
100
73
|
}
|
|
101
74
|
}, _callee);
|
|
102
75
|
})));
|
package/package.json
CHANGED
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/alfa-react",
|
|
3
|
-
"version": "1.4.40
|
|
3
|
+
"version": "1.4.40",
|
|
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
|
-
},
|
|
22
10
|
"publishConfig": {
|
|
23
11
|
"access": "public"
|
|
24
12
|
},
|
|
@@ -31,6 +19,7 @@
|
|
|
31
19
|
"@types/crypto-js": "^4.0.2",
|
|
32
20
|
"@types/jest": "^23.3.13",
|
|
33
21
|
"@types/lodash": "^4.14.176",
|
|
22
|
+
"@types/prop-types": "^15.7.5",
|
|
34
23
|
"@types/react": "^16.9.2",
|
|
35
24
|
"@types/react-dom": "^16.9.0",
|
|
36
25
|
"@types/single-spa-react": "^2.8.3",
|
|
@@ -39,17 +28,31 @@
|
|
|
39
28
|
"react-dom": "^16.9.0",
|
|
40
29
|
"ts-jest": "^23.10.5",
|
|
41
30
|
"tslib": "^2.4.0",
|
|
42
|
-
"typescript": "^
|
|
31
|
+
"typescript": "^4.0.0"
|
|
43
32
|
},
|
|
44
33
|
"dependencies": {
|
|
45
|
-
"@alicloud/alfa-core": "^1.4.30-alpha.0",
|
|
46
|
-
"@alicloud/console-os-loader": "^1.4.30-alpha.0",
|
|
47
34
|
"@alicloud/widget-utils-console": "^0.1.6",
|
|
35
|
+
"axios": "^1.4.0",
|
|
48
36
|
"classnames": "^2.2.6",
|
|
49
|
-
"crypto-js": "^4.1.1"
|
|
37
|
+
"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"
|
|
50
41
|
},
|
|
51
42
|
"peerDependencies": {
|
|
52
43
|
"react": ">=16.0.0"
|
|
53
44
|
},
|
|
54
|
-
"gitHead": "ff9294b1d5e08b14691c8aa2bef098da2857f3df"
|
|
55
|
-
|
|
45
|
+
"gitHead": "ff9294b1d5e08b14691c8aa2bef098da2857f3df",
|
|
46
|
+
"scripts": {
|
|
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
|
+
}
|
|
@@ -12,6 +12,6 @@ interface State {
|
|
|
12
12
|
declare class ErrorBoundary extends React.Component<IProps, State> {
|
|
13
13
|
constructor(props: IProps);
|
|
14
14
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
15
|
-
render():
|
|
15
|
+
render(): React.ReactNode;
|
|
16
16
|
}
|
|
17
17
|
export default ErrorBoundary;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
type widthUnit = number | string;
|
|
3
3
|
export interface SkeletonParagraphProps {
|
|
4
4
|
prefixCls?: string;
|
|
5
5
|
className?: string;
|
|
@@ -9,6 +9,6 @@ export interface SkeletonParagraphProps {
|
|
|
9
9
|
}
|
|
10
10
|
declare class Paragraph extends React.Component<SkeletonParagraphProps, {}> {
|
|
11
11
|
private getWidth;
|
|
12
|
-
render(): JSX.Element;
|
|
12
|
+
render(): React.JSX.Element;
|
|
13
13
|
}
|
|
14
14
|
export default Paragraph;
|
|
@@ -13,7 +13,7 @@ export interface SkeletonProps {
|
|
|
13
13
|
declare class Skeleton extends React.Component<SkeletonProps, any> {
|
|
14
14
|
static defaultProps: Partial<SkeletonProps>;
|
|
15
15
|
componentDidMount(): void;
|
|
16
|
-
renderSkeleton: () =>
|
|
17
|
-
render():
|
|
16
|
+
renderSkeleton: () => React.ReactNode;
|
|
17
|
+
render(): React.ReactNode;
|
|
18
18
|
}
|
|
19
19
|
export default Skeleton;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
export interface SkeletonTitleProps {
|
|
3
3
|
prefixCls?: string;
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: object;
|
|
6
6
|
width?: number | string;
|
|
7
7
|
}
|
|
8
|
-
declare const Title: ({ prefixCls, className, width, style }: SkeletonTitleProps) => JSX.Element;
|
|
8
|
+
declare const Title: ({ prefixCls, className, width, style }: SkeletonTitleProps) => React.JSX.Element;
|
|
9
9
|
export default Title;
|
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
|
/**
|
|
@@ -10,11 +10,11 @@ interface IProps {
|
|
|
10
10
|
history?: any;
|
|
11
11
|
path?: string;
|
|
12
12
|
}
|
|
13
|
-
declare function createAlfaApp<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => JSX.Element);
|
|
13
|
+
declare function createAlfaApp<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => React.JSX.Element);
|
|
14
14
|
/**
|
|
15
15
|
* create memorized app in react function component, just create App after first mounted
|
|
16
16
|
* @param option
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
|
-
export declare function useAlfaApp<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => JSX.Element);
|
|
19
|
+
export declare function useAlfaApp<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => React.JSX.Element);
|
|
20
20
|
export default createAlfaApp;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { AlfaFactoryOption } from './types';
|
|
3
|
-
declare function createAlfaWidget<P = any>(option: AlfaFactoryOption): ((
|
|
3
|
+
declare function createAlfaWidget<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & {}) => React.JSX.Element);
|
|
4
4
|
/**
|
|
5
5
|
* create memorized app in react function component, just create App after first mounted
|
|
6
6
|
* @param option
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
export declare function useAlfaWidget<P = any>(option: AlfaFactoryOption): ((
|
|
9
|
+
export declare function useAlfaWidget<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & {}) => React.JSX.Element);
|
|
10
10
|
export default createAlfaWidget;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { BaseLoader } from '@alicloud/alfa-core';
|
|
3
3
|
import { AlfaFactoryOption } from './types';
|
|
4
4
|
interface IProps<C = any> extends AlfaFactoryOption {
|
|
@@ -16,5 +16,5 @@ interface IProps<C = any> extends AlfaFactoryOption {
|
|
|
16
16
|
* @param loader alfa-core loader
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
|
-
export default function createApplication(loader: BaseLoader): <C = any>(props: IProps<C>) => JSX.Element;
|
|
19
|
+
export default function createApplication(loader: BaseLoader): <C = any>(props: IProps<C>) => React.JSX.Element;
|
|
20
20
|
export {};
|
package/types/types/index.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { createMicroApp, IAppConfig } from '@alicloud/alfa-core';
|
|
|
4
4
|
export interface AlfaVersion {
|
|
5
5
|
entry: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type Version = string;
|
|
8
8
|
export interface AlfaReleaseConfig {
|
|
9
9
|
versions: Record<Version, AlfaVersion>;
|
|
10
10
|
'dist-tag': Record<string, string>;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type EnvEnum = 'prod' | 'local' | 'pre' | 'daily';
|
|
13
13
|
export interface AlfaFactoryOption extends IAppConfig {
|
|
14
14
|
loading?: boolean | React.ReactChild;
|
|
15
15
|
dependencies?: Record<string, any>;
|
|
@@ -30,7 +30,7 @@ export interface AlfaFactoryOption extends IAppConfig {
|
|
|
30
30
|
runtimeVersion?: string;
|
|
31
31
|
fallbackRender?: (error: Error) => Element;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
type OmitKeys = 'manifest';
|
|
34
34
|
export interface WidgetFactoryOption extends Omit<AlfaFactoryOption, OmitKeys> {
|
|
35
35
|
runtimeVersion?: string;
|
|
36
36
|
alfaLoader?: boolean;
|
|
@@ -94,6 +94,6 @@ export interface WidgetRuntime {
|
|
|
94
94
|
'@ali/wind-intl/lib/withRcIntl': any;
|
|
95
95
|
'@ali/widget-utils-console': any;
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
export
|
|
97
|
+
type ThenArg<T> = T extends PromiseLike<infer U> ? U : T;
|
|
98
|
+
export type MicroApplication = ThenArg<ReturnType<typeof createMicroApp>>;
|
|
99
99
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AlfaConfig } from '@alicloud/alfa-core';
|
|
2
2
|
export declare const getConsoleConfig: (configData: AlfaConfig, consoleConfig: any) => Promise<{
|
|
3
|
-
CHANNEL_LINKS: {
|
|
3
|
+
CHANNEL_LINKS: {
|
|
4
|
+
[x: string]: string | undefined;
|
|
5
|
+
};
|
|
4
6
|
CHANNEL_FEATURE_STATUS: {
|
|
5
7
|
[x: string]: {
|
|
6
8
|
status: boolean;
|
|
@@ -23,7 +25,7 @@ export declare const getConsoleConfig: (configData: AlfaConfig, consoleConfig: a
|
|
|
23
25
|
FEATURE_STATUS: {
|
|
24
26
|
[x: string]: boolean | undefined;
|
|
25
27
|
};
|
|
26
|
-
fEnv?: "
|
|
28
|
+
fEnv?: import("@alicloud/alfa-core").AlfaEnvEnum | undefined;
|
|
27
29
|
LOCALE?: string | undefined;
|
|
28
30
|
CHANNEL?: string | undefined;
|
|
29
31
|
SEC_TOKEN?: string | undefined;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { AlfaConfig, IWin } from '@alicloud/alfa-core';
|
|
2
|
-
export declare const getConsoleGlobal: (configData: AlfaConfig, global: IWin['ALIYUN_CONSOLE_GLOBAL']) => Promise<{
|
|
2
|
+
export declare const getConsoleGlobal: (configData: AlfaConfig, global: IWin['ALIYUN_CONSOLE_GLOBAL']) => Promise<{
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
}>;
|
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.4.40
|
|
1
|
+
export declare const version = "1.4.40";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { WidgetCWSConfig, WidgetRuntime, WidgetFactoryOption } from '../types';
|
|
2
|
-
export declare const getWidgetDeps: (config: WidgetCWSConfig, option?: WidgetFactoryOption
|
|
2
|
+
export declare const getWidgetDeps: (config: WidgetCWSConfig, option?: WidgetFactoryOption) => Promise<WidgetRuntime>;
|
package/types/widget.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { WidgetFactoryOption } from './types';
|
|
3
|
-
export declare function createCWSWidget<T>(option: WidgetFactoryOption): (props: T) => JSX.Element;
|
|
3
|
+
export declare function createCWSWidget<T>(option: WidgetFactoryOption): (props: T) => React.JSX.Element;
|