@alicloud/alfa-react 1.4.2 → 1.4.6
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 +6 -6
- package/es/createAlfaWidget.js +2 -2
- package/es/createApplication.js +27 -20
- package/es/version.js +1 -1
- package/lib/createAlfaWidget.js +2 -2
- package/lib/createApplication.js +27 -20
- package/lib/version.js +1 -1
- package/package.json +3 -4
- package/types/components/Loading/Title.d.ts +1 -0
- package/types/createAlfaWidget.d.ts +2 -2
- package/types/createApplication.d.ts +1 -0
- package/types/version.d.ts +1 -1
- package/types/widget.d.ts +1 -0
- package/LICENSE +0 -21
package/es/createAlfaWidget.js
CHANGED
|
@@ -41,7 +41,7 @@ loader.beforeLoad.use( /*#__PURE__*/function () {
|
|
|
41
41
|
}());
|
|
42
42
|
var Application = createApplication(loader);
|
|
43
43
|
|
|
44
|
-
function
|
|
44
|
+
function createAlfaWidget(option) {
|
|
45
45
|
var _ref2 = option || {},
|
|
46
46
|
name = _ref2.name,
|
|
47
47
|
dependencies = _ref2.dependencies;
|
|
@@ -70,4 +70,4 @@ function createAlfaApp(option) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export default
|
|
73
|
+
export default createAlfaWidget;
|
package/es/createApplication.js
CHANGED
|
@@ -62,6 +62,29 @@ export default function createApplication(loader) {
|
|
|
62
62
|
'_console_base_ready_'])
|
|
63
63
|
});
|
|
64
64
|
}, [customSandbox]);
|
|
65
|
+
var memoOptions = useMemo(function () {
|
|
66
|
+
return {
|
|
67
|
+
entry: entry,
|
|
68
|
+
// deprecated
|
|
69
|
+
url: url,
|
|
70
|
+
// deprecated
|
|
71
|
+
name: name,
|
|
72
|
+
version: version,
|
|
73
|
+
manifest: manifest,
|
|
74
|
+
container: container,
|
|
75
|
+
props: customProps,
|
|
76
|
+
sandbox: sandbox,
|
|
77
|
+
logger: customLogger,
|
|
78
|
+
deps: deps,
|
|
79
|
+
env: env,
|
|
80
|
+
beforeMount: beforeMount,
|
|
81
|
+
afterMount: afterMount,
|
|
82
|
+
beforeUnmount: beforeUnmount,
|
|
83
|
+
afterUnmount: afterUnmount,
|
|
84
|
+
beforeUpdate: beforeUpdate,
|
|
85
|
+
locale: locale
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
65
88
|
useEffect(function () {
|
|
66
89
|
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
67
90
|
var _yield$loader$registe, App, logger;
|
|
@@ -71,25 +94,9 @@ export default function createApplication(loader) {
|
|
|
71
94
|
switch (_context.prev = _context.next) {
|
|
72
95
|
case 0:
|
|
73
96
|
_context.next = 2;
|
|
74
|
-
return loader.register({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
name: name,
|
|
78
|
-
version: version,
|
|
79
|
-
manifest: manifest,
|
|
80
|
-
container: container || appRef.current,
|
|
81
|
-
props: customProps,
|
|
82
|
-
sandbox: sandbox,
|
|
83
|
-
logger: customLogger,
|
|
84
|
-
deps: deps,
|
|
85
|
-
env: env,
|
|
86
|
-
beforeMount: beforeMount,
|
|
87
|
-
afterMount: afterMount,
|
|
88
|
-
beforeUnmount: beforeUnmount,
|
|
89
|
-
afterUnmount: afterUnmount,
|
|
90
|
-
beforeUpdate: beforeUpdate,
|
|
91
|
-
locale: locale
|
|
92
|
-
});
|
|
97
|
+
return loader.register(_objectSpread(_objectSpread({}, memoOptions), {}, {
|
|
98
|
+
container: memoOptions.container || appRef.current
|
|
99
|
+
}));
|
|
93
100
|
|
|
94
101
|
case 2:
|
|
95
102
|
_yield$loader$registe = _context.sent;
|
|
@@ -141,7 +148,7 @@ export default function createApplication(loader) {
|
|
|
141
148
|
return function () {
|
|
142
149
|
app && app.unmount();
|
|
143
150
|
};
|
|
144
|
-
}, [
|
|
151
|
+
}, [memoOptions]);
|
|
145
152
|
|
|
146
153
|
if (app) {
|
|
147
154
|
app.update(customProps);
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var version = '1.4.
|
|
1
|
+
export var version = '1.4.6';
|
package/lib/createAlfaWidget.js
CHANGED
|
@@ -61,7 +61,7 @@ loader.beforeLoad.use( /*#__PURE__*/function () {
|
|
|
61
61
|
}());
|
|
62
62
|
var Application = (0, _createApplication.default)(loader);
|
|
63
63
|
|
|
64
|
-
function
|
|
64
|
+
function createAlfaWidget(option) {
|
|
65
65
|
var _ref2 = option || {},
|
|
66
66
|
name = _ref2.name,
|
|
67
67
|
dependencies = _ref2.dependencies;
|
|
@@ -90,5 +90,5 @@ function createAlfaApp(option) {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
var _default =
|
|
93
|
+
var _default = createAlfaWidget;
|
|
94
94
|
exports.default = _default;
|
package/lib/createApplication.js
CHANGED
|
@@ -84,6 +84,29 @@ function createApplication(loader) {
|
|
|
84
84
|
'_console_base_ready_'])
|
|
85
85
|
});
|
|
86
86
|
}, [customSandbox]);
|
|
87
|
+
var memoOptions = (0, _react.useMemo)(function () {
|
|
88
|
+
return {
|
|
89
|
+
entry: entry,
|
|
90
|
+
// deprecated
|
|
91
|
+
url: url,
|
|
92
|
+
// deprecated
|
|
93
|
+
name: name,
|
|
94
|
+
version: version,
|
|
95
|
+
manifest: manifest,
|
|
96
|
+
container: container,
|
|
97
|
+
props: customProps,
|
|
98
|
+
sandbox: sandbox,
|
|
99
|
+
logger: customLogger,
|
|
100
|
+
deps: deps,
|
|
101
|
+
env: env,
|
|
102
|
+
beforeMount: beforeMount,
|
|
103
|
+
afterMount: afterMount,
|
|
104
|
+
beforeUnmount: beforeUnmount,
|
|
105
|
+
afterUnmount: afterUnmount,
|
|
106
|
+
beforeUpdate: beforeUpdate,
|
|
107
|
+
locale: locale
|
|
108
|
+
};
|
|
109
|
+
}, []);
|
|
87
110
|
(0, _react.useEffect)(function () {
|
|
88
111
|
(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
89
112
|
var _yield$loader$registe, App, logger;
|
|
@@ -93,25 +116,9 @@ function createApplication(loader) {
|
|
|
93
116
|
switch (_context.prev = _context.next) {
|
|
94
117
|
case 0:
|
|
95
118
|
_context.next = 2;
|
|
96
|
-
return loader.register({
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
name: name,
|
|
100
|
-
version: version,
|
|
101
|
-
manifest: manifest,
|
|
102
|
-
container: container || appRef.current,
|
|
103
|
-
props: customProps,
|
|
104
|
-
sandbox: sandbox,
|
|
105
|
-
logger: customLogger,
|
|
106
|
-
deps: deps,
|
|
107
|
-
env: env,
|
|
108
|
-
beforeMount: beforeMount,
|
|
109
|
-
afterMount: afterMount,
|
|
110
|
-
beforeUnmount: beforeUnmount,
|
|
111
|
-
afterUnmount: afterUnmount,
|
|
112
|
-
beforeUpdate: beforeUpdate,
|
|
113
|
-
locale: locale
|
|
114
|
-
});
|
|
119
|
+
return loader.register(_objectSpread(_objectSpread({}, memoOptions), {}, {
|
|
120
|
+
container: memoOptions.container || appRef.current
|
|
121
|
+
}));
|
|
115
122
|
|
|
116
123
|
case 2:
|
|
117
124
|
_yield$loader$registe = _context.sent;
|
|
@@ -162,7 +169,7 @@ function createApplication(loader) {
|
|
|
162
169
|
return function () {
|
|
163
170
|
app && app.unmount();
|
|
164
171
|
};
|
|
165
|
-
}, [
|
|
172
|
+
}, [memoOptions]);
|
|
166
173
|
|
|
167
174
|
if (app) {
|
|
168
175
|
app.update(customProps);
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/alfa-react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"description": "Alfa Framework (React Version)",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -37,11 +37,10 @@
|
|
|
37
37
|
"react": "^16.9.0",
|
|
38
38
|
"react-dom": "^16.9.0",
|
|
39
39
|
"ts-jest": "^23.10.5",
|
|
40
|
-
"tslint": "^5.8.0",
|
|
41
40
|
"typescript": "^3.0.3"
|
|
42
41
|
},
|
|
43
42
|
"dependencies": {
|
|
44
|
-
"@alicloud/alfa-core": "^1.4.
|
|
43
|
+
"@alicloud/alfa-core": "^1.4.5",
|
|
45
44
|
"@alicloud/console-os-loader": "^1.2.3",
|
|
46
45
|
"@alicloud/widget-utils-console": "^0.1.6",
|
|
47
46
|
"classnames": "^2.2.6",
|
|
@@ -50,5 +49,5 @@
|
|
|
50
49
|
"peerDependencies": {
|
|
51
50
|
"react": "^16 | ^17"
|
|
52
51
|
},
|
|
53
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "9c6fffdb53e1b42c98b80e3f4eb896a3e2ee0c86"
|
|
54
53
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AlfaFactoryOption } from './types';
|
|
3
|
-
declare function
|
|
4
|
-
export default
|
|
3
|
+
declare function createAlfaWidget<P = any>(option: AlfaFactoryOption): ((props: P) => JSX.Element) | (() => null) | React.MemoExoticComponent<(props: P) => JSX.Element>;
|
|
4
|
+
export default createAlfaWidget;
|
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.4.
|
|
1
|
+
export declare const version = "1.4.6";
|
package/types/widget.d.ts
CHANGED
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2019 Alibaba Cloud
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|