@alicloud/alfa-react 1.5.13-alpha.1 → 1.5.13-alpha.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.
@@ -33,6 +33,8 @@ function createAlfaApp(option) {
33
33
  , _extends({}, passedInOption, {
34
34
  style: props.style || passedInOption.style,
35
35
  syncHistory: props.syncHistory,
36
+ syncRegion: props.syncRegion,
37
+ syncResourceGroup: props.syncResourceGroup,
36
38
  onSyncHistory: props.onSyncHistory,
37
39
  basename: props.basename,
38
40
  sandbox: option.sandbox || props.sandbox,
package/es/version.js CHANGED
@@ -1 +1 @@
1
- export var version = '1.5.13-alpha.1';
1
+ export var version = '1.5.13-alpha.2';
@@ -44,6 +44,8 @@ function createAlfaApp(option) {
44
44
  , (0, _extends2.default)({}, passedInOption, {
45
45
  style: props.style || passedInOption.style,
46
46
  syncHistory: props.syncHistory,
47
+ syncRegion: props.syncRegion,
48
+ syncResourceGroup: props.syncResourceGroup,
47
49
  onSyncHistory: props.onSyncHistory,
48
50
  basename: props.basename,
49
51
  sandbox: option.sandbox || props.sandbox,
package/lib/version.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- var version = '1.5.13-alpha.1';
7
+ var version = '1.5.13-alpha.2';
8
8
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/alfa-react",
3
- "version": "1.5.13-alpha.1",
3
+ "version": "1.5.13-alpha.2",
4
4
  "description": "Alfa Framework (React Version)",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -1,23 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { AlfaFactoryOption, CommonProps } from './types';
3
- interface IProps extends CommonProps {
4
- /**
5
- * 是否开启路由自动同步,需配合 basename 使用
6
- */
7
- syncHistory?: boolean;
8
- /**
9
- * 同步子应用路由的回调函数
10
- */
11
- onSyncHistory?: (type: 'replace' | 'push', pathname: string, state: any) => void;
12
- /**
13
- * 子应用路由前缀
14
- */
15
- basename?: string;
16
- history?: any;
17
- /**
18
- * 子应用路由
19
- */
20
- path?: string;
2
+ import { AlfaFactoryOption } from './types';
3
+ import type { IApplicationProps, IApplicationCustomProps } from './createApplication';
4
+ interface IProps extends IApplicationProps, IApplicationCustomProps {
21
5
  }
22
6
  declare function createAlfaApp<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => JSX.Element);
23
7
  /**
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { AlfaFactoryOption, CommonProps } from './types';
3
- interface IProps extends CommonProps {
2
+ import { AlfaFactoryOption } from './types';
3
+ import type { IApplicationCustomProps } from './createApplication';
4
+ interface IProps extends Omit<IApplicationCustomProps, 'consoleBase' | 'path' | 'appConfig'> {
4
5
  }
5
6
  declare function createAlfaWidget<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => JSX.Element);
6
7
  /**
@@ -1,26 +1,63 @@
1
1
  /// <reference types="react" />
2
2
  import { BaseLoader } from '@alicloud/alfa-core';
3
3
  import { AlfaFactoryOption } from './types';
4
- interface IProps<C = any> extends AlfaFactoryOption {
5
- customProps: C & {
6
- consoleBase?: any;
7
- path?: string;
8
- appConfig?: any;
9
- __injectHistory?: any;
10
- __innerStamp?: string;
11
- __historyState?: string;
12
- handleExternalLink?: (href: string) => void;
13
- };
4
+ export interface IApplicationCustomProps {
5
+ /**
6
+ * 根结点样式
7
+ */
8
+ style?: Record<string, any>;
9
+ /**
10
+ * 注入给子应用的 consoleBase 配置
11
+ */
12
+ consoleBase?: any;
13
+ /**
14
+ * 指定子应用 path
15
+ */
16
+ path?: string;
17
+ /**
18
+ * 注入给子应用的运行时配置
19
+ */
20
+ appConfig?: any;
21
+ __injectHistory?: any;
22
+ __innerStamp?: string;
23
+ __historyState?: string;
24
+ /**
25
+ * 处理外部链接跳转
26
+ * @param href
27
+ */
28
+ handleExternalLink?: (href: string) => void;
29
+ }
30
+ export interface IApplicationProps<C = any> extends AlfaFactoryOption {
31
+ customProps: C & IApplicationCustomProps;
32
+ /**
33
+ * 是否开启路由自动同步,需配合 basename 使用
34
+ */
35
+ syncHistory?: boolean;
36
+ /**
37
+ * 是否开启 region 自动同步
38
+ */
14
39
  syncRegion?: boolean;
40
+ /**
41
+ * 是否开启资源组自动同步
42
+ */
15
43
  syncResourceGroup?: boolean;
16
- syncHistory?: boolean;
17
- onSyncHistory?: (type: 'replace' | 'push', path: string, data: any) => void;
44
+ /**
45
+ * 同步子应用路由的回调函数
46
+ */
47
+ onSyncHistory?: (type: 'replace' | 'push', pathname: string, state: any) => void;
48
+ /**
49
+ * 分配给子应用的路由前缀
50
+ */
18
51
  basename?: string;
52
+ /**
53
+ * @deprecated
54
+ * 注入给子应用的 history 实例,不推荐使用
55
+ */
56
+ history?: any;
19
57
  }
20
58
  /**
21
59
  * container for microApp mount
22
60
  * @param loader alfa-core loader
23
61
  * @returns
24
62
  */
25
- export default function createApplication(loader: BaseLoader): <C = any>(props: IProps<C>) => JSX.Element;
26
- export {};
63
+ export default function createApplication(loader: BaseLoader): <C = any>(props: IApplicationProps<C>) => JSX.Element;
@@ -41,26 +41,6 @@ export interface AlfaFactoryOption extends IAppConfig {
41
41
  */
42
42
  fallbackRender?: (error?: Error) => Element;
43
43
  }
44
- export interface CommonProps {
45
- /**
46
- * @deprecated
47
- */
48
- sandbox?: Record<string, any>;
49
- /**
50
- * 处理外跳链接
51
- * @param url
52
- * @returns
53
- */
54
- handleExternalLink?: (url?: string) => void;
55
- /**
56
- * 根节点样式
57
- */
58
- style?: React.CSSProperties;
59
- /**
60
- * render when throw error
61
- */
62
- fallbackRender?: (error?: Error) => Element;
63
- }
64
44
  type ThenArg<T> = T extends PromiseLike<infer U> ? U : T;
65
45
  export type MicroApplication = ThenArg<ReturnType<typeof createMicroApp>>;
66
46
  export interface AlfaEnvConfigDescriptor {
@@ -1 +1 @@
1
- export declare const version = "1.5.13-alpha.1";
1
+ export declare const version = "1.5.13-alpha.2";