@alicloud/alfa-react 1.4.0-alpha.8 → 1.4.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.
- package/dist/index.js +6 -6
- package/es/createAlfaApp.js +11 -1
- package/es/version.js +1 -1
- package/es/widget/getWidgetConfigById.js +3 -3
- package/es/widget/getWidgetDeps.js +27 -25
- package/es/widget/getWidgetVersionById.js +71 -12
- package/es/widget.js +1 -1
- package/lib/createAlfaApp.d.ts +4 -1
- package/lib/createAlfaApp.js +11 -1
- package/lib/hooks/beforeLoadHook.d.ts +1 -1
- package/lib/hooks/beforeResolveHook.d.ts +1 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/utils/getConsoleConfig.d.ts +1 -21
- package/lib/utils/getConsoleGlobal.d.ts +1 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/widget/getWidgetConfigById.d.ts +2 -2
- package/lib/widget/getWidgetConfigById.js +3 -3
- package/lib/widget/getWidgetDeps.js +27 -25
- package/lib/widget/getWidgetVersionById.js +71 -13
- package/lib/widget.js +1 -1
- package/package.json +12 -10
- package/types/components/ErrorBoundary/ErrorPanel.d.ts +6 -0
- package/types/components/ErrorBoundary/index.d.ts +17 -0
- package/types/components/Loading/Paragraph.d.ts +14 -0
- package/types/components/Loading/Skeleton.d.ts +19 -0
- package/types/components/Loading/Title.d.ts +8 -0
- package/types/components/Loading/index.d.ts +4 -0
- package/types/components/Loading/style.d.ts +2 -0
- package/types/createAlfaApp.d.ts +7 -0
- package/types/createAlfaWidget.d.ts +4 -0
- package/types/createApplication.d.ts +12 -0
- package/types/hooks/beforeLoadHook.d.ts +3 -0
- package/types/hooks/beforeResolveHook.d.ts +3 -0
- package/types/index.d.ts +4 -0
- package/types/types/index.d.ts +91 -0
- package/types/utils/getConsoleConfig.d.ts +21 -0
- package/types/utils/getConsoleGlobal.d.ts +2 -0
- package/types/utils/index.d.ts +1 -0
- package/types/version.d.ts +1 -0
- package/types/widget/emitter.d.ts +8 -0
- package/types/widget/env.d.ts +4 -0
- package/types/widget/getWidgetConfigById.d.ts +2 -0
- package/types/widget/getWidgetDeps.d.ts +2 -0
- package/types/widget/getWidgetVersionById.d.ts +6 -0
- package/types/widget/index.d.ts +4 -0
- package/types/widget.d.ts +2 -0
|
@@ -11,17 +11,21 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
11
11
|
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
13
|
|
|
14
|
-
var _axios = _interopRequireDefault(require("axios"));
|
|
15
|
-
|
|
16
14
|
var _template = _interopRequireDefault(require("lodash/template"));
|
|
17
15
|
|
|
16
|
+
var _alfaCore = require("@alicloud/alfa-core");
|
|
17
|
+
|
|
18
18
|
var _env = require("./env");
|
|
19
19
|
|
|
20
|
+
var _ALIYUN_CONSOLE_CONFI;
|
|
21
|
+
|
|
20
22
|
var cachedRelease = null;
|
|
21
23
|
exports.cachedRelease = cachedRelease;
|
|
22
24
|
var WIDGET_ENTRY_URL = 'https://g.alicdn.com/${id}/${version}/index.js';
|
|
25
|
+
var uid = (_ALIYUN_CONSOLE_CONFI = window.ALIYUN_CONSOLE_CONFIG) === null || _ALIYUN_CONSOLE_CONFI === void 0 ? void 0 : _ALIYUN_CONSOLE_CONFI.MAIN_ACCOUNT_PK;
|
|
23
26
|
|
|
24
27
|
var normalizeEntryUrl = function normalizeEntryUrl(id, version, resourceUrl) {
|
|
28
|
+
if (!version) throw new Error('No Version for Widget');
|
|
25
29
|
var gitRepoId = id.replace('@ali/', '').replace('widget-', 'widget/');
|
|
26
30
|
return (0, _template.default)(resourceUrl)({
|
|
27
31
|
id: gitRepoId,
|
|
@@ -31,13 +35,15 @@ var normalizeEntryUrl = function normalizeEntryUrl(id, version, resourceUrl) {
|
|
|
31
35
|
|
|
32
36
|
var getWidgetVersionById = /*#__PURE__*/function () {
|
|
33
37
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(option) {
|
|
34
|
-
var
|
|
38
|
+
var _release$distTags, _release$distTags2, _release$nextVersion;
|
|
39
|
+
|
|
40
|
+
var name, _option$central, central, env, Release, version, entryUrl, _resp, _cachedRelease$option, _cachedRelease$option2, latestVersion, _nextVersion, gray, resp, release, nextVersion, sampling;
|
|
35
41
|
|
|
36
42
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
37
43
|
while (1) {
|
|
38
44
|
switch (_context.prev = _context.next) {
|
|
39
45
|
case 0:
|
|
40
|
-
_option$central = option.central, central = _option$central === void 0 ? true : _option$central, env = option.env;
|
|
46
|
+
name = option.name, _option$central = option.central, central = _option$central === void 0 ? true : _option$central, env = option.env;
|
|
41
47
|
Release = central ? _env.ENV[env || (0, _env.getConsoleEnv)()] : _env.DIS_ENV[env || (0, _env.getConsoleEnv)()];
|
|
42
48
|
|
|
43
49
|
if (option.version) {
|
|
@@ -59,26 +65,78 @@ var getWidgetVersionById = /*#__PURE__*/function () {
|
|
|
59
65
|
});
|
|
60
66
|
|
|
61
67
|
case 6:
|
|
68
|
+
if (!central) {
|
|
69
|
+
_context.next = 12;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
|
|
62
73
|
if (cachedRelease) {
|
|
63
|
-
_context.next =
|
|
74
|
+
_context.next = 12;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
_context.next = 10;
|
|
79
|
+
return _alfaCore.request.get(Release.releaseUrl);
|
|
80
|
+
|
|
81
|
+
case 10:
|
|
82
|
+
_resp = _context.sent;
|
|
83
|
+
|
|
84
|
+
if (_resp && _resp.data) {
|
|
85
|
+
exports.cachedRelease = cachedRelease = _resp.data;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
case 12:
|
|
89
|
+
if (!cachedRelease) {
|
|
90
|
+
_context.next = 19;
|
|
64
91
|
break;
|
|
65
92
|
}
|
|
66
93
|
|
|
67
|
-
|
|
68
|
-
|
|
94
|
+
latestVersion = cachedRelease[option.name][option.version].latest;
|
|
95
|
+
_nextVersion = (_cachedRelease$option = cachedRelease[option.name][option.version].next) === null || _cachedRelease$option === void 0 ? void 0 : _cachedRelease$option.version;
|
|
96
|
+
gray = (_cachedRelease$option2 = cachedRelease[option.name][option.version].next) === null || _cachedRelease$option2 === void 0 ? void 0 : _cachedRelease$option2.gray;
|
|
97
|
+
version = uid && Number(uid.substring(uid.length - 2)) < gray ? _nextVersion : latestVersion;
|
|
98
|
+
entryUrl = normalizeEntryUrl(option.name, version, Release.resourceUrl || WIDGET_ENTRY_URL);
|
|
99
|
+
return _context.abrupt("return", {
|
|
100
|
+
version: version,
|
|
101
|
+
entryUrl: entryUrl
|
|
102
|
+
});
|
|
69
103
|
|
|
70
|
-
case
|
|
104
|
+
case 19:
|
|
105
|
+
_context.next = 21;
|
|
106
|
+
return _alfaCore.request.get((0, _template.default)(Release.releaseUrl)({
|
|
107
|
+
id: name
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
case 21:
|
|
71
111
|
resp = _context.sent;
|
|
72
|
-
exports.cachedRelease = cachedRelease = resp.data;
|
|
73
112
|
|
|
74
|
-
|
|
75
|
-
|
|
113
|
+
if (!(!resp || !resp.data)) {
|
|
114
|
+
_context.next = 24;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
throw new Error('Cannot get Release');
|
|
119
|
+
|
|
120
|
+
case 24:
|
|
121
|
+
release = resp.data;
|
|
122
|
+
nextVersion = (_release$distTags = release['dist-tags']) === null || _release$distTags === void 0 ? void 0 : _release$distTags["".concat(option.version, "-next")];
|
|
123
|
+
version = (_release$distTags2 = release['dist-tags']) === null || _release$distTags2 === void 0 ? void 0 : _release$distTags2[option.version]; // has gray version
|
|
124
|
+
|
|
125
|
+
if (nextVersion && release !== null && release !== void 0 && (_release$nextVersion = release['next-versions']) !== null && _release$nextVersion !== void 0 && _release$nextVersion[nextVersion] && uid) {
|
|
126
|
+
sampling = release['next-versions'][nextVersion].featureStatus.sampling || 0;
|
|
127
|
+
|
|
128
|
+
if (sampling * 100 > Number(uid.substring(uid.length - 2))) {
|
|
129
|
+
version = nextVersion;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
entryUrl = normalizeEntryUrl(option.name, version, Release.resourceUrl || WIDGET_ENTRY_URL);
|
|
76
134
|
return _context.abrupt("return", {
|
|
77
135
|
version: version,
|
|
78
|
-
entryUrl:
|
|
136
|
+
entryUrl: entryUrl
|
|
79
137
|
});
|
|
80
138
|
|
|
81
|
-
case
|
|
139
|
+
case 30:
|
|
82
140
|
case "end":
|
|
83
141
|
return _context.stop();
|
|
84
142
|
}
|
package/lib/widget.js
CHANGED
|
@@ -82,7 +82,7 @@ function createCWSWidget(option) {
|
|
|
82
82
|
deps = _context.sent;
|
|
83
83
|
return _context.abrupt("return", (0, _consoleOsLoader.loadBundle)({
|
|
84
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'),
|
|
85
|
+
url: (option.url || url || '').replace('index.js', option !== null && option !== void 0 && option.alfaLoader ? 'index.alfa.js' : 'index.js'),
|
|
86
86
|
deps: _objectSpread(_objectSpread({}, deps), option.dependencies),
|
|
87
87
|
xmlrequest: !option.alfaLoader,
|
|
88
88
|
context: {
|
package/package.json
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/alfa-react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
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
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",
|
|
11
18
|
"start": "breezr start-storybook",
|
|
12
19
|
"precommit": "npm run version",
|
|
13
|
-
"
|
|
14
|
-
"babel": "breezr build --engine babel && tsc --emitDeclarationOnly -d --declarationDir ./lib",
|
|
15
|
-
"babel:esm": "breezr build --engine babel --es-module",
|
|
16
|
-
"build": "breezr build --engine webpack",
|
|
17
|
-
"clean": "rm -rf lib yarn.lock",
|
|
18
|
-
"version": "node -p \"'export const version = \\'' + require('./package.json').version + '\\';'\" > src/version.ts"
|
|
20
|
+
"version": "node -p \"'export const version = \\'' + require('./package.json').version + '\\';'\" > src/version.ts && git add src/version.ts"
|
|
19
21
|
},
|
|
20
22
|
"publishConfig": {
|
|
21
23
|
"access": "public"
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
"typescript": "^3.0.3"
|
|
40
42
|
},
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"@alicloud/alfa-core": "^1.4.
|
|
44
|
+
"@alicloud/alfa-core": "^1.4.2",
|
|
43
45
|
"@alicloud/console-os-loader": "^1.2.3",
|
|
44
46
|
"@alicloud/widget-utils-console": "^0.1.6",
|
|
45
47
|
"classnames": "^2.2.6",
|
|
@@ -48,5 +50,5 @@
|
|
|
48
50
|
"peerDependencies": {
|
|
49
51
|
"react": "^16 | ^17"
|
|
50
52
|
},
|
|
51
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "4002ebf858ac10d0625ffa85aa08014ade3b6326"
|
|
52
54
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ErrorInfo } from 'react';
|
|
2
|
+
import { AlfaLogger } from '@alicloud/alfa-core';
|
|
3
|
+
interface IProps {
|
|
4
|
+
fallbackRender?: (error?: Error) => Element;
|
|
5
|
+
appDidCatch?: (error?: Error, info?: ErrorInfo) => void;
|
|
6
|
+
logger?: AlfaLogger;
|
|
7
|
+
}
|
|
8
|
+
interface State {
|
|
9
|
+
hasError: boolean;
|
|
10
|
+
error?: Error;
|
|
11
|
+
}
|
|
12
|
+
declare class ErrorBoundary extends React.Component<IProps, State> {
|
|
13
|
+
constructor(props: IProps);
|
|
14
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
15
|
+
render(): {} | null | undefined;
|
|
16
|
+
}
|
|
17
|
+
export default ErrorBoundary;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type widthUnit = number | string;
|
|
3
|
+
export interface SkeletonParagraphProps {
|
|
4
|
+
prefixCls?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: object;
|
|
7
|
+
width?: widthUnit | widthUnit[];
|
|
8
|
+
rows?: number;
|
|
9
|
+
}
|
|
10
|
+
declare class Paragraph extends React.Component<SkeletonParagraphProps, {}> {
|
|
11
|
+
private getWidth;
|
|
12
|
+
render(): JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export default Paragraph;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SkeletonTitleProps } from './Title';
|
|
3
|
+
import { SkeletonParagraphProps } from './Paragraph';
|
|
4
|
+
export interface SkeletonProps {
|
|
5
|
+
active?: boolean;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
prefixCls?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
title?: SkeletonTitleProps | boolean;
|
|
11
|
+
paragraph?: SkeletonParagraphProps | boolean;
|
|
12
|
+
}
|
|
13
|
+
declare class Skeleton extends React.Component<SkeletonProps, any> {
|
|
14
|
+
static defaultProps: Partial<SkeletonProps>;
|
|
15
|
+
componentDidMount(): void;
|
|
16
|
+
renderSkeleton: () => {} | null | undefined;
|
|
17
|
+
render(): {} | null | undefined;
|
|
18
|
+
}
|
|
19
|
+
export default Skeleton;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n.-os-skeleton * {\n box-sizing: border-box;\n}\n.-os-skeleton {\n box-sizing: border-box;\n display: table;\n width: 100%;\n padding: 24px;\n}\n\n.-os-skeleton-header {\n display: table-cell;\n padding-right: 16px;\n vertical-align: top\n}\n\n\n.-os-skeleton-content {\n display: table-cell;\n width: 100%;\n vertical-align: top\n}\n\n.-os-skeleton-content .-os-skeleton-title {\n width: 100%;\n height: 16px;\n margin-top: 16px;\n background: #f2f2f2\n}\n\n.-os-skeleton-content .-os-skeleton-title+.-os-skeleton-paragraph {\n margin-top: 24px\n}\n\n.-os-skeleton-content .-os-skeleton-paragraph {\n padding: 0\n}\n\n.-os-skeleton-content .-os-skeleton-paragraph>li {\n width: 100%;\n height: 16px;\n list-style: none;\n background: #f2f2f2\n}\n\n.-os-skeleton-content .-os-skeleton-paragraph>li:last-child:not(:first-child):not(:nth-child(2)) {\n width: 61%\n}\n\n.-os-skeleton-content .-os-skeleton-paragraph>li+li {\n margin-top: 16px\n}\n\n.-os-skeleton.-os-skeleton-active .-os-skeleton-content .-os-skeleton-title,.-os-skeleton.-os-skeleton-active .-os-skeleton-content .-os-skeleton-paragraph>li {\n background: -webkit-gradient(linear, left top, right top, color-stop(25%, #f2f2f2), color-stop(37%, #e6e6e6), color-stop(63%, #f2f2f2));\n background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);\n background-size: 400% 100%;\n -webkit-animation: os-skeleton-loading 1.4s ease infinite;\n animation: os-skeleton-loading 1.4s ease infinite\n}\n\n\n@-webkit-keyframes os-skeleton-loading {\n 0% {\n background-position: 100% 50%\n }\n\n 100% {\n background-position: 0 50%\n }\n}\n\n@keyframes os-skeleton-loading {\n 0% {\n background-position: 100% 50%\n }\n\n 100% {\n background-position: 0 50%\n }\n}\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AlfaFactoryOption } from './types';
|
|
3
|
+
declare function createAlfaApp<P = any>(option: AlfaFactoryOption): (() => null) | React.MemoExoticComponent<(props: P & {
|
|
4
|
+
history: any;
|
|
5
|
+
sandbox: {};
|
|
6
|
+
}) => JSX.Element>;
|
|
7
|
+
export default createAlfaApp;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AlfaFactoryOption } from './types';
|
|
3
|
+
declare function createAlfaApp<P = any>(option: AlfaFactoryOption): ((props: P) => JSX.Element) | (() => null) | React.MemoExoticComponent<(props: P) => JSX.Element>;
|
|
4
|
+
export default createAlfaApp;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseLoader } from '@alicloud/alfa-core';
|
|
2
|
+
import { AlfaFactoryOption } from './types';
|
|
3
|
+
interface IProps<C = any> extends AlfaFactoryOption {
|
|
4
|
+
customProps: C;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* container for microApp mount
|
|
8
|
+
* @param loader alfa-core loader
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export default function createApplication(loader: BaseLoader): <C = any>(props: IProps<C>) => JSX.Element;
|
|
12
|
+
export {};
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'React';
|
|
3
|
+
import { createMicroApp, IAppConfig } from '@alicloud/alfa-core';
|
|
4
|
+
export interface AlfaVersion {
|
|
5
|
+
entry: string;
|
|
6
|
+
}
|
|
7
|
+
declare type Version = string;
|
|
8
|
+
export interface AlfaReleaseConfig {
|
|
9
|
+
versions: Record<Version, AlfaVersion>;
|
|
10
|
+
'dist-tag': Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export declare type EnvEnum = 'prod' | 'local' | 'pre' | 'daily';
|
|
13
|
+
export interface AlfaFactoryOption extends IAppConfig {
|
|
14
|
+
loading?: boolean | React.ReactChild;
|
|
15
|
+
dependencies?: Record<string, any>;
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: Record<string, any>;
|
|
18
|
+
unstable_runtime?: {
|
|
19
|
+
css?: Record<string, string>;
|
|
20
|
+
js?: Record<string, string>;
|
|
21
|
+
};
|
|
22
|
+
runtimeVersion?: string;
|
|
23
|
+
fallbackRender?: (error: Error) => Element;
|
|
24
|
+
}
|
|
25
|
+
declare type OmitKeys = 'manifest';
|
|
26
|
+
export interface WidgetFactoryOption extends Omit<AlfaFactoryOption, OmitKeys> {
|
|
27
|
+
runtimeVersion?: string;
|
|
28
|
+
alfaLoader?: boolean;
|
|
29
|
+
theme?: string;
|
|
30
|
+
central?: boolean;
|
|
31
|
+
host?: string;
|
|
32
|
+
configHost?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface AlfaEnvConfigDescriptor {
|
|
35
|
+
releaseUrl: string;
|
|
36
|
+
configUrl?: string;
|
|
37
|
+
cdnBackupUrl?: string;
|
|
38
|
+
resourceUrl?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface AlfaEnvConfig {
|
|
41
|
+
daily: AlfaEnvConfigDescriptor;
|
|
42
|
+
local: AlfaEnvConfigDescriptor;
|
|
43
|
+
pre: AlfaEnvConfigDescriptor;
|
|
44
|
+
prod: AlfaEnvConfigDescriptor;
|
|
45
|
+
}
|
|
46
|
+
export interface WidgetReleaseConfig {
|
|
47
|
+
[id: string]: {
|
|
48
|
+
[version: string]: {
|
|
49
|
+
latest: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface WidgetCWSConfig {
|
|
54
|
+
conf: {
|
|
55
|
+
[channel: string]: {
|
|
56
|
+
[key: string]: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
features: {
|
|
60
|
+
[channel: string]: {
|
|
61
|
+
[key: string]: boolean;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
links: {
|
|
65
|
+
[channel: string]: {
|
|
66
|
+
[key: string]: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
locales: {
|
|
70
|
+
[locale: string]: {
|
|
71
|
+
messages: {
|
|
72
|
+
[key: string]: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface WidgetRuntime {
|
|
78
|
+
react: any;
|
|
79
|
+
reactDom: any;
|
|
80
|
+
axios: any;
|
|
81
|
+
'prop-types': any;
|
|
82
|
+
'@ali/wind': any;
|
|
83
|
+
'@ali/wind-utils-console': any;
|
|
84
|
+
'@ali/wind-intl': any;
|
|
85
|
+
'@ali/wind-intl/lib/Provider': any;
|
|
86
|
+
'@ali/wind-intl/lib/withRcIntl': any;
|
|
87
|
+
'@ali/widget-utils-console': any;
|
|
88
|
+
}
|
|
89
|
+
declare type ThenArg<T> = T extends PromiseLike<infer U> ? U : T;
|
|
90
|
+
export declare type MicroApplication = ThenArg<ReturnType<typeof createMicroApp>>;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AlfaConfig } from '@alicloud/alfa-core';
|
|
2
|
+
export declare const getConsoleConfig: (configData: AlfaConfig, consoleConfig: any) => Promise<{
|
|
3
|
+
CHANNEL_LINKS: Partial<Record<string, string>>;
|
|
4
|
+
CHANNEL_FEATURE_STATUS: Record<string, {
|
|
5
|
+
status: boolean;
|
|
6
|
+
attribute: {
|
|
7
|
+
customAttrs: Record<string, unknown>;
|
|
8
|
+
regions: string[] | {
|
|
9
|
+
region: string[];
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
FEATURE_STATUS: Partial<Record<string, boolean>>;
|
|
14
|
+
fEnv?: "pre" | "local" | "prod" | "daily" | undefined;
|
|
15
|
+
LOCALE?: string | undefined;
|
|
16
|
+
CHANNEL?: string | undefined;
|
|
17
|
+
SEC_TOKEN?: string | undefined;
|
|
18
|
+
portalType?: string | undefined;
|
|
19
|
+
MAIN_ACCOUNT_PK?: string | undefined;
|
|
20
|
+
CURRENT_PK?: string | undefined;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const normalizeName: (name: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const version = "1.4.2";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
declare class WidgetEventEmitter extends EventEmitter {
|
|
4
|
+
refersh(widgetId: string): boolean;
|
|
5
|
+
refershWidget(widgetId: string): boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: WidgetEventEmitter;
|
|
8
|
+
export default _default;
|