@alicloud/alfa-react 1.5.0-alpha.0 → 1.5.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.
@@ -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,
@@ -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-alpha.0';
1
+ export var version = '1.5.0';
@@ -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,
@@ -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
@@ -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.0-alpha.0';
7
+ var version = '1.5.0';
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.0-alpha.0",
3
+ "version": "1.5.0",
4
4
  "description": "Alfa Framework (React Version)",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
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
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { AlfaFactoryOption } from './types';
3
- declare function createAlfaWidget<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & {}) => JSX.Element);
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 & {}) => JSX.Element);
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';
@@ -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>;
@@ -1 +1 @@
1
- export declare const version = "1.5.0-alpha.0";
1
+ export declare const version = "1.5.0";