@alicloud/alfa-react 1.4.0 → 1.4.1
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/version.js +1 -1
- package/lib/hooks/beforeLoadHook.d.ts +1 -1
- package/lib/hooks/beforeResolveHook.d.ts +1 -1
- package/lib/utils/getConsoleConfig.d.ts +1 -21
- package/lib/utils/getConsoleGlobal.d.ts +1 -2
- package/lib/version.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
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var version = '1.4.
|
|
1
|
+
export var version = '1.4.1';
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
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
|
-
}>;
|
|
1
|
+
export declare const getConsoleConfig: (configData: any, consoleConfig: any) => Promise<any>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const getConsoleGlobal: (configData: AlfaConfig, global: IWin['ALIYUN_CONSOLE_GLOBAL']) => Promise<{}>;
|
|
1
|
+
export declare const getConsoleGlobal: (configData: any, global: any) => Promise<any>;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/alfa-react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
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.1",
|
|
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": "9794f150a8182d256c27f3407b7e2a91d48eae78"
|
|
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.1";
|
|
@@ -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;
|