@alicloud/alfa-react 1.5.1-alpha.2 → 1.5.1-alpha.4

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.
@@ -2,11 +2,11 @@ import React from 'react';
2
2
  var padding = 24;
3
3
  var containerBackground = '#fcebea';
4
4
  var containerStyle = {
5
+ display: 'none',
5
6
  background: containerBackground,
6
7
  padding: padding
7
8
  };
8
9
  var commonErrorStyle = {
9
- display: 'none',
10
10
  lineHeight: '22px',
11
11
  color: '#d93026',
12
12
  fontSize: 14
@@ -97,9 +97,11 @@ export default function createApplication(loader) {
97
97
  setReleaseVersion = _useState6[1];
98
98
  $syncHistory.current = syncHistory;
99
99
  $basename.current = basename;
100
- if (customProps.__innerStamp) console.warn('Please do not use __innerStamp which used in internal.');
100
+
101
+ // if (customProps.__innerStamp) console.warn('Please do not use __innerStamp which used in internal.');
101
102
  // 更新标记,保证每次更新都会更新
102
103
  customProps.__innerStamp = (+new Date()).toString(36);
104
+ customProps.__historyState = history.state;
103
105
  if (customProps.path) customProps.path = addLeftSlash(customProps.path);
104
106
 
105
107
  // 受控模式锁定一些参数
@@ -174,6 +176,12 @@ export default function createApplication(loader) {
174
176
  popstateEvent.state = history.state;
175
177
  (_App = App) === null || _App === void 0 ? void 0 : (_App$context$baseFram = _App.context.baseFrame) === null || _App$context$baseFram === void 0 ? void 0 : (_App$context$baseFram2 = _App$context$baseFram.contentWindow) === null || _App$context$baseFram2 === void 0 ? void 0 : _App$context$baseFram2.dispatchEvent(popstateEvent);
176
178
  };
179
+
180
+ /**
181
+ * 因为要兼容历史逻辑,所以这段逻辑并不会执行
182
+ * react-router 的路由监听 callback 会先执行并更新子应用内部路由
183
+ * @returns
184
+ */
177
185
  var updateAppHistory = function updateAppHistory() {
178
186
  if (App) {
179
187
  var nextPath = peelPath(App.context.location);
package/es/version.js CHANGED
@@ -1 +1 @@
1
- export var version = '1.5.1-alpha.2';
1
+ export var version = '1.5.1-alpha.4';
@@ -9,11 +9,11 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var padding = 24;
10
10
  var containerBackground = '#fcebea';
11
11
  var containerStyle = {
12
+ display: 'none',
12
13
  background: containerBackground,
13
14
  padding: padding
14
15
  };
15
16
  var commonErrorStyle = {
16
- display: 'none',
17
17
  lineHeight: '22px',
18
18
  color: '#d93026',
19
19
  fontSize: 14
@@ -107,9 +107,11 @@ function createApplication(loader) {
107
107
  setReleaseVersion = _useState6[1];
108
108
  $syncHistory.current = syncHistory;
109
109
  $basename.current = basename;
110
- if (customProps.__innerStamp) console.warn('Please do not use __innerStamp which used in internal.');
110
+
111
+ // if (customProps.__innerStamp) console.warn('Please do not use __innerStamp which used in internal.');
111
112
  // 更新标记,保证每次更新都会更新
112
113
  customProps.__innerStamp = (+new Date()).toString(36);
114
+ customProps.__historyState = history.state;
113
115
  if (customProps.path) customProps.path = addLeftSlash(customProps.path);
114
116
 
115
117
  // 受控模式锁定一些参数
@@ -184,6 +186,12 @@ function createApplication(loader) {
184
186
  popstateEvent.state = history.state;
185
187
  (_App = App) === null || _App === void 0 ? void 0 : (_App$context$baseFram = _App.context.baseFrame) === null || _App$context$baseFram === void 0 ? void 0 : (_App$context$baseFram2 = _App$context$baseFram.contentWindow) === null || _App$context$baseFram2 === void 0 ? void 0 : _App$context$baseFram2.dispatchEvent(popstateEvent);
186
188
  };
189
+
190
+ /**
191
+ * 因为要兼容历史逻辑,所以这段逻辑并不会执行
192
+ * react-router 的路由监听 callback 会先执行并更新子应用内部路由
193
+ * @returns
194
+ */
187
195
  var updateAppHistory = function updateAppHistory() {
188
196
  if (App) {
189
197
  var nextPath = peelPath(App.context.location);
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.1-alpha.2';
7
+ var version = '1.5.1-alpha.4';
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.1-alpha.2",
3
+ "version": "1.5.1-alpha.4",
4
4
  "description": "Alfa Framework (React Version)",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -36,8 +36,8 @@
36
36
  "classnames": "^2.2.6",
37
37
  "crypto-js": "^4.1.1",
38
38
  "prop-types": "^15.8.1",
39
- "@alicloud/console-os-loader": "1.4.30-alpha.0",
40
- "@alicloud/alfa-core": "1.4.32"
39
+ "@alicloud/alfa-core": "1.4.32",
40
+ "@alicloud/console-os-loader": "1.4.30-alpha.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": ">=16.0.0"
@@ -7,6 +7,7 @@ interface IProps<C = any> extends AlfaFactoryOption {
7
7
  path?: string;
8
8
  __injectHistory?: any;
9
9
  __innerStamp?: string;
10
+ __historyState?: string;
10
11
  handleExternalLink?: (href: string) => void;
11
12
  };
12
13
  syncHistory?: boolean;
@@ -1 +1 @@
1
- export declare const version = "1.5.1-alpha.2";
1
+ export declare const version = "1.5.1-alpha.4";