@alicloud/alfa-react 1.4.5 → 1.4.8

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.
@@ -71,7 +71,7 @@ export default function createApplication(loader) {
71
71
  name: name,
72
72
  version: version,
73
73
  manifest: manifest,
74
- container: container || appRef.current,
74
+ container: container,
75
75
  props: customProps,
76
76
  sandbox: sandbox,
77
77
  logger: customLogger,
@@ -86,23 +86,30 @@ export default function createApplication(loader) {
86
86
  };
87
87
  }, []);
88
88
  useEffect(function () {
89
+ var App;
90
+
89
91
  _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
90
- var _yield$loader$registe, App, logger;
92
+ var _app$context$updateBo, _app$context;
93
+
94
+ var _yield$loader$registe, app, logger;
91
95
 
92
96
  return _regeneratorRuntime.wrap(function _callee$(_context) {
93
97
  while (1) {
94
98
  switch (_context.prev = _context.next) {
95
99
  case 0:
96
100
  _context.next = 2;
97
- return loader.register(memoOptions);
101
+ return loader.register(_objectSpread(_objectSpread({}, memoOptions), {}, {
102
+ container: memoOptions.container || appRef.current
103
+ }));
98
104
 
99
105
  case 2:
100
106
  _yield$loader$registe = _context.sent;
101
- App = _yield$loader$registe.app;
107
+ app = _yield$loader$registe.app;
102
108
  logger = _yield$loader$registe.logger;
109
+ App = app;
103
110
 
104
- if (App) {
105
- _context.next = 7;
111
+ if (app) {
112
+ _context.next = 8;
106
113
  break;
107
114
  }
108
115
 
@@ -111,9 +118,9 @@ export default function createApplication(loader) {
111
118
  E_MSG: 'load app failed.'
112
119
  }));
113
120
 
114
- case 7:
121
+ case 8:
115
122
  if (appRef.current) {
116
- _context.next = 9;
123
+ _context.next = 10;
117
124
  break;
118
125
  }
119
126
 
@@ -122,16 +129,18 @@ export default function createApplication(loader) {
122
129
  E_MSG: 'cannot find container.'
123
130
  }));
124
131
 
125
- case 9:
126
- _context.next = 11;
127
- return App.mount(appRef.current, {
132
+ case 10:
133
+ // update body in sandbox context
134
+ (_app$context$updateBo = (_app$context = app.context).updateBody) === null || _app$context$updateBo === void 0 ? void 0 : _app$context$updateBo.call(_app$context, appRef.current);
135
+ _context.next = 13;
136
+ return app.mount(appRef.current, {
128
137
  customProps: customProps
129
138
  });
130
139
 
131
- case 11:
132
- setApp(App);
140
+ case 13:
141
+ setApp(app);
133
142
 
134
- case 12:
143
+ case 14:
135
144
  case "end":
136
145
  return _context.stop();
137
146
  }
@@ -144,7 +153,7 @@ export default function createApplication(loader) {
144
153
  });
145
154
 
146
155
  return function () {
147
- app && app.unmount();
156
+ App && App.unmount();
148
157
  };
149
158
  }, [memoOptions]);
150
159
 
@@ -159,7 +168,7 @@ export default function createApplication(loader) {
159
168
  };
160
169
  return /*#__PURE__*/React.createElement(React.Fragment, null, !app ? /*#__PURE__*/React.createElement(Loading, {
161
170
  loading: loading
162
- }) : null, sandbox && sandbox.disableFakeBody ? /*#__PURE__*/React.createElement(tagName, _objectSpread({
171
+ }) : null, sandbox && sandbox.disableFakeBody && false ? /*#__PURE__*/React.createElement(tagName, _objectSpread({
163
172
  style: style,
164
173
  className: className,
165
174
  ref: appRef
package/es/version.js CHANGED
@@ -1 +1 @@
1
- export var version = '1.4.5';
1
+ export var version = '1.4.8';
@@ -93,7 +93,7 @@ function createApplication(loader) {
93
93
  name: name,
94
94
  version: version,
95
95
  manifest: manifest,
96
- container: container || appRef.current,
96
+ container: container,
97
97
  props: customProps,
98
98
  sandbox: sandbox,
99
99
  logger: customLogger,
@@ -108,23 +108,29 @@ function createApplication(loader) {
108
108
  };
109
109
  }, []);
110
110
  (0, _react.useEffect)(function () {
111
+ var App;
111
112
  (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
112
- var _yield$loader$registe, App, logger;
113
+ var _app$context$updateBo, _app$context;
114
+
115
+ var _yield$loader$registe, app, logger;
113
116
 
114
117
  return _regenerator.default.wrap(function _callee$(_context) {
115
118
  while (1) {
116
119
  switch (_context.prev = _context.next) {
117
120
  case 0:
118
121
  _context.next = 2;
119
- return loader.register(memoOptions);
122
+ return loader.register(_objectSpread(_objectSpread({}, memoOptions), {}, {
123
+ container: memoOptions.container || appRef.current
124
+ }));
120
125
 
121
126
  case 2:
122
127
  _yield$loader$registe = _context.sent;
123
- App = _yield$loader$registe.app;
128
+ app = _yield$loader$registe.app;
124
129
  logger = _yield$loader$registe.logger;
130
+ App = app;
125
131
 
126
- if (App) {
127
- _context.next = 7;
132
+ if (app) {
133
+ _context.next = 8;
128
134
  break;
129
135
  }
130
136
 
@@ -133,9 +139,9 @@ function createApplication(loader) {
133
139
  E_MSG: 'load app failed.'
134
140
  }));
135
141
 
136
- case 7:
142
+ case 8:
137
143
  if (appRef.current) {
138
- _context.next = 9;
144
+ _context.next = 10;
139
145
  break;
140
146
  }
141
147
 
@@ -144,16 +150,18 @@ function createApplication(loader) {
144
150
  E_MSG: 'cannot find container.'
145
151
  }));
146
152
 
147
- case 9:
148
- _context.next = 11;
149
- return App.mount(appRef.current, {
153
+ case 10:
154
+ // update body in sandbox context
155
+ (_app$context$updateBo = (_app$context = app.context).updateBody) === null || _app$context$updateBo === void 0 ? void 0 : _app$context$updateBo.call(_app$context, appRef.current);
156
+ _context.next = 13;
157
+ return app.mount(appRef.current, {
150
158
  customProps: customProps
151
159
  });
152
160
 
153
- case 11:
154
- setApp(App);
161
+ case 13:
162
+ setApp(app);
155
163
 
156
- case 12:
164
+ case 14:
157
165
  case "end":
158
166
  return _context.stop();
159
167
  }
@@ -165,7 +173,7 @@ function createApplication(loader) {
165
173
  });
166
174
  });
167
175
  return function () {
168
- app && app.unmount();
176
+ App && App.unmount();
169
177
  };
170
178
  }, [memoOptions]);
171
179
 
@@ -180,7 +188,7 @@ function createApplication(loader) {
180
188
  };
181
189
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !app ? /*#__PURE__*/_react.default.createElement(_Loading.default, {
182
190
  loading: loading
183
- }) : null, sandbox && sandbox.disableFakeBody ? /*#__PURE__*/_react.default.createElement(tagName, _objectSpread({
191
+ }) : null, sandbox && sandbox.disableFakeBody && false ? /*#__PURE__*/_react.default.createElement(tagName, _objectSpread({
184
192
  style: style,
185
193
  className: className,
186
194
  ref: appRef
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.4.5';
7
+ var version = '1.4.8';
8
8
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/alfa-react",
3
- "version": "1.4.5",
3
+ "version": "1.4.8",
4
4
  "description": "Alfa Framework (React Version)",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -37,10 +37,11 @@
37
37
  "react": "^16.9.0",
38
38
  "react-dom": "^16.9.0",
39
39
  "ts-jest": "^23.10.5",
40
+ "tslib": "^2.4.0",
40
41
  "typescript": "^3.0.3"
41
42
  },
42
43
  "dependencies": {
43
- "@alicloud/alfa-core": "^1.4.5",
44
+ "@alicloud/alfa-core": "^1.4.7",
44
45
  "@alicloud/console-os-loader": "^1.2.3",
45
46
  "@alicloud/widget-utils-console": "^0.1.6",
46
47
  "classnames": "^2.2.6",
@@ -49,5 +50,5 @@
49
50
  "peerDependencies": {
50
51
  "react": "^16 | ^17"
51
52
  },
52
- "gitHead": "9c6fffdb53e1b42c98b80e3f4eb896a3e2ee0c86"
53
+ "gitHead": "5f21e6d8b34324e8962e90760a0537139a33201f"
53
54
  }
@@ -1 +1 @@
1
- export declare const version = "1.4.5";
1
+ export declare const version = "1.4.8";