@alicloud/alfa-react 1.5.14 → 1.5.16
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/es/createApplication.js +3 -1
- package/es/hooks/beforeLoadHook.js +3 -3
- package/es/utils/getConsoleConfig.js +5 -5
- package/es/version.js +1 -1
- package/lib/createApplication.js +3 -1
- package/lib/hooks/beforeLoadHook.js +3 -3
- package/lib/utils/getConsoleConfig.js +5 -5
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/types/hooks/beforeLoadHook.d.ts +5 -1
- package/types/types/index.d.ts +4 -0
- package/types/utils/getConsoleConfig.d.ts +1 -1
- package/types/version.d.ts +1 -1
package/es/createApplication.js
CHANGED
|
@@ -98,6 +98,7 @@ export default function createApplication(loader) {
|
|
|
98
98
|
syncRegion = props.syncRegion,
|
|
99
99
|
syncResourceGroup = props.syncResourceGroup,
|
|
100
100
|
basename = props.basename,
|
|
101
|
+
channel = props.channel,
|
|
101
102
|
onSyncHistory = props.onSyncHistory;
|
|
102
103
|
var handleExternalLink = customProps.handleExternalLink;
|
|
103
104
|
var _useState = useState(null),
|
|
@@ -221,7 +222,8 @@ export default function createApplication(loader) {
|
|
|
221
222
|
locale: locale,
|
|
222
223
|
noCache: noCache,
|
|
223
224
|
// 用户自定义 manifest 且未传入 dynamicConfig 时,默认值为 false,否则为 true
|
|
224
|
-
dynamicConfig: typeof dynamicConfig === 'boolean' ? dynamicConfig : !manifest
|
|
225
|
+
dynamicConfig: typeof dynamicConfig === 'boolean' ? dynamicConfig : !manifest,
|
|
226
|
+
channel: channel
|
|
225
227
|
};
|
|
226
228
|
}, []);
|
|
227
229
|
useEffect(function () {
|
|
@@ -13,11 +13,11 @@ function afterLoadHook(_x) {
|
|
|
13
13
|
}
|
|
14
14
|
function _afterLoadHook() {
|
|
15
15
|
_afterLoadHook = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(appConfig) {
|
|
16
|
-
var app, logger, sandbox, dynamicConfig, defaultConsoleConfig, defaultConsoleGlobal, CONFIG_START_TIME, CONFIG_END_TIME, configData, _yield$Promise$all, _yield$Promise$all2, consoleConfig, consoleGlobal, messages, i18nMessages, overrides;
|
|
16
|
+
var app, logger, sandbox, dynamicConfig, channel, defaultConsoleConfig, defaultConsoleGlobal, CONFIG_START_TIME, CONFIG_END_TIME, configData, _yield$Promise$all, _yield$Promise$all2, consoleConfig, consoleGlobal, messages, i18nMessages, overrides;
|
|
17
17
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
18
18
|
while (1) switch (_context.prev = _context.next) {
|
|
19
19
|
case 0:
|
|
20
|
-
app = appConfig.app, logger = appConfig.logger, sandbox = appConfig.sandbox, dynamicConfig = appConfig.dynamicConfig;
|
|
20
|
+
app = appConfig.app, logger = appConfig.logger, sandbox = appConfig.sandbox, dynamicConfig = appConfig.dynamicConfig, channel = appConfig.channel;
|
|
21
21
|
defaultConsoleConfig = window.ALIYUN_CONSOLE_CONFIG || {};
|
|
22
22
|
defaultConsoleGlobal = window.ALIYUN_CONSOLE_GLOBAL || {};
|
|
23
23
|
CONFIG_START_TIME = Date.now();
|
|
@@ -31,7 +31,7 @@ function _afterLoadHook() {
|
|
|
31
31
|
case 8:
|
|
32
32
|
configData = _context.sent;
|
|
33
33
|
_context.next = 11;
|
|
34
|
-
return Promise.all([getConsoleConfig(configData, defaultConsoleConfig), getConsoleGlobal(configData, defaultConsoleGlobal), getI18nMessages(appConfig)]);
|
|
34
|
+
return Promise.all([getConsoleConfig(configData, defaultConsoleConfig, channel), getConsoleGlobal(configData, defaultConsoleGlobal), getI18nMessages(appConfig)]);
|
|
35
35
|
case 11:
|
|
36
36
|
_yield$Promise$all = _context.sent;
|
|
37
37
|
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
|
|
@@ -65,9 +65,9 @@ var processChannelFeatures = function processChannelFeatures(allChannelFeatures,
|
|
|
65
65
|
return newChannelFeatures;
|
|
66
66
|
}, {});
|
|
67
67
|
};
|
|
68
|
-
var mergeConfigDataWithConsoleConfig = function mergeConfigDataWithConsoleConfig(configData, consoleConfig) {
|
|
68
|
+
var mergeConfigDataWithConsoleConfig = function mergeConfigDataWithConsoleConfig(configData, consoleConfig, passInChannel) {
|
|
69
69
|
var _window, _window$ALIYUN_CONSOL, _configData$ALL_CHANN;
|
|
70
|
-
var channel = ((_window = window) === null || _window === void 0 ? void 0 : (_window$ALIYUN_CONSOL = _window.ALIYUN_CONSOLE_CONFIG) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.CHANNEL) || 'OFFICIAL';
|
|
70
|
+
var channel = passInChannel || ((_window = window) === null || _window === void 0 ? void 0 : (_window$ALIYUN_CONSOL = _window.ALIYUN_CONSOLE_CONFIG) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.CHANNEL) || 'OFFICIAL';
|
|
71
71
|
var channelLinks = (_configData$ALL_CHANN = configData.ALL_CHANNEL_LINKS) === null || _configData$ALL_CHANN === void 0 ? void 0 : _configData$ALL_CHANN[channel];
|
|
72
72
|
var channelFeatures = configData.ALL_CHANNEL_FEATURE_STATUS;
|
|
73
73
|
var features = configData.ALL_FEATURE_STATUS;
|
|
@@ -78,18 +78,18 @@ var mergeConfigDataWithConsoleConfig = function mergeConfigDataWithConsoleConfig
|
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
80
|
export var getConsoleConfig = /*#__PURE__*/function () {
|
|
81
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(configData, consoleConfig) {
|
|
81
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(configData, consoleConfig, channel) {
|
|
82
82
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
83
83
|
while (1) switch (_context.prev = _context.next) {
|
|
84
84
|
case 0:
|
|
85
|
-
return _context.abrupt("return", mergeConfigDataWithConsoleConfig(configData, consoleConfig));
|
|
85
|
+
return _context.abrupt("return", mergeConfigDataWithConsoleConfig(configData, consoleConfig, channel));
|
|
86
86
|
case 1:
|
|
87
87
|
case "end":
|
|
88
88
|
return _context.stop();
|
|
89
89
|
}
|
|
90
90
|
}, _callee);
|
|
91
91
|
}));
|
|
92
|
-
return function getConsoleConfig(_x, _x2) {
|
|
92
|
+
return function getConsoleConfig(_x, _x2, _x3) {
|
|
93
93
|
return _ref.apply(this, arguments);
|
|
94
94
|
};
|
|
95
95
|
}();
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var version = '1.5.
|
|
1
|
+
export var version = '1.5.16';
|
package/lib/createApplication.js
CHANGED
|
@@ -108,6 +108,7 @@ function createApplication(loader) {
|
|
|
108
108
|
syncRegion = props.syncRegion,
|
|
109
109
|
syncResourceGroup = props.syncResourceGroup,
|
|
110
110
|
basename = props.basename,
|
|
111
|
+
channel = props.channel,
|
|
111
112
|
onSyncHistory = props.onSyncHistory;
|
|
112
113
|
var handleExternalLink = customProps.handleExternalLink;
|
|
113
114
|
var _useState = (0, _react.useState)(null),
|
|
@@ -231,7 +232,8 @@ function createApplication(loader) {
|
|
|
231
232
|
locale: locale,
|
|
232
233
|
noCache: noCache,
|
|
233
234
|
// 用户自定义 manifest 且未传入 dynamicConfig 时,默认值为 false,否则为 true
|
|
234
|
-
dynamicConfig: typeof dynamicConfig === 'boolean' ? dynamicConfig : !manifest
|
|
235
|
+
dynamicConfig: typeof dynamicConfig === 'boolean' ? dynamicConfig : !manifest,
|
|
236
|
+
channel: channel
|
|
235
237
|
};
|
|
236
238
|
}, []);
|
|
237
239
|
(0, _react.useEffect)(function () {
|
|
@@ -20,11 +20,11 @@ function afterLoadHook(_x) {
|
|
|
20
20
|
}
|
|
21
21
|
function _afterLoadHook() {
|
|
22
22
|
_afterLoadHook = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(appConfig) {
|
|
23
|
-
var app, logger, sandbox, dynamicConfig, defaultConsoleConfig, defaultConsoleGlobal, CONFIG_START_TIME, CONFIG_END_TIME, configData, _yield$Promise$all, _yield$Promise$all2, consoleConfig, consoleGlobal, messages, i18nMessages, overrides;
|
|
23
|
+
var app, logger, sandbox, dynamicConfig, channel, defaultConsoleConfig, defaultConsoleGlobal, CONFIG_START_TIME, CONFIG_END_TIME, configData, _yield$Promise$all, _yield$Promise$all2, consoleConfig, consoleGlobal, messages, i18nMessages, overrides;
|
|
24
24
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
25
25
|
while (1) switch (_context.prev = _context.next) {
|
|
26
26
|
case 0:
|
|
27
|
-
app = appConfig.app, logger = appConfig.logger, sandbox = appConfig.sandbox, dynamicConfig = appConfig.dynamicConfig;
|
|
27
|
+
app = appConfig.app, logger = appConfig.logger, sandbox = appConfig.sandbox, dynamicConfig = appConfig.dynamicConfig, channel = appConfig.channel;
|
|
28
28
|
defaultConsoleConfig = window.ALIYUN_CONSOLE_CONFIG || {};
|
|
29
29
|
defaultConsoleGlobal = window.ALIYUN_CONSOLE_GLOBAL || {};
|
|
30
30
|
CONFIG_START_TIME = Date.now();
|
|
@@ -38,7 +38,7 @@ function _afterLoadHook() {
|
|
|
38
38
|
case 8:
|
|
39
39
|
configData = _context.sent;
|
|
40
40
|
_context.next = 11;
|
|
41
|
-
return Promise.all([(0, _getConsoleConfig.getConsoleConfig)(configData, defaultConsoleConfig), (0, _getConsoleGlobal.getConsoleGlobal)(configData, defaultConsoleGlobal), (0, _alfaCore.getI18nMessages)(appConfig)]);
|
|
41
|
+
return Promise.all([(0, _getConsoleConfig.getConsoleConfig)(configData, defaultConsoleConfig, channel), (0, _getConsoleGlobal.getConsoleGlobal)(configData, defaultConsoleGlobal), (0, _alfaCore.getI18nMessages)(appConfig)]);
|
|
42
42
|
case 11:
|
|
43
43
|
_yield$Promise$all = _context.sent;
|
|
44
44
|
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 3);
|
|
@@ -71,9 +71,9 @@ var processChannelFeatures = function processChannelFeatures(allChannelFeatures,
|
|
|
71
71
|
return newChannelFeatures;
|
|
72
72
|
}, {});
|
|
73
73
|
};
|
|
74
|
-
var mergeConfigDataWithConsoleConfig = function mergeConfigDataWithConsoleConfig(configData, consoleConfig) {
|
|
74
|
+
var mergeConfigDataWithConsoleConfig = function mergeConfigDataWithConsoleConfig(configData, consoleConfig, passInChannel) {
|
|
75
75
|
var _window, _window$ALIYUN_CONSOL, _configData$ALL_CHANN;
|
|
76
|
-
var channel = ((_window = window) === null || _window === void 0 ? void 0 : (_window$ALIYUN_CONSOL = _window.ALIYUN_CONSOLE_CONFIG) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.CHANNEL) || 'OFFICIAL';
|
|
76
|
+
var channel = passInChannel || ((_window = window) === null || _window === void 0 ? void 0 : (_window$ALIYUN_CONSOL = _window.ALIYUN_CONSOLE_CONFIG) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.CHANNEL) || 'OFFICIAL';
|
|
77
77
|
var channelLinks = (_configData$ALL_CHANN = configData.ALL_CHANNEL_LINKS) === null || _configData$ALL_CHANN === void 0 ? void 0 : _configData$ALL_CHANN[channel];
|
|
78
78
|
var channelFeatures = configData.ALL_CHANNEL_FEATURE_STATUS;
|
|
79
79
|
var features = configData.ALL_FEATURE_STATUS;
|
|
@@ -84,18 +84,18 @@ var mergeConfigDataWithConsoleConfig = function mergeConfigDataWithConsoleConfig
|
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
var getConsoleConfig = /*#__PURE__*/function () {
|
|
87
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(configData, consoleConfig) {
|
|
87
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(configData, consoleConfig, channel) {
|
|
88
88
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
89
89
|
while (1) switch (_context.prev = _context.next) {
|
|
90
90
|
case 0:
|
|
91
|
-
return _context.abrupt("return", mergeConfigDataWithConsoleConfig(configData, consoleConfig));
|
|
91
|
+
return _context.abrupt("return", mergeConfigDataWithConsoleConfig(configData, consoleConfig, channel));
|
|
92
92
|
case 1:
|
|
93
93
|
case "end":
|
|
94
94
|
return _context.stop();
|
|
95
95
|
}
|
|
96
96
|
}, _callee);
|
|
97
97
|
}));
|
|
98
|
-
return function getConsoleConfig(_x, _x2) {
|
|
98
|
+
return function getConsoleConfig(_x, _x2, _x3) {
|
|
99
99
|
return _ref.apply(this, arguments);
|
|
100
100
|
};
|
|
101
101
|
}();
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/alfa-react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.16",
|
|
4
4
|
"description": "Alfa Framework (React Version)",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"@alicloud/console-base-messenger": "^1.18.1",
|
|
35
35
|
"@alicloud/widget-utils-console": "^0.1.6",
|
|
36
36
|
"@alicloud/xconsole-context": "^2.4.32",
|
|
37
|
-
"axios": "^
|
|
37
|
+
"axios": "^0.21.4",
|
|
38
38
|
"classnames": "^2.2.6",
|
|
39
39
|
"crypto-js": "^4.1.1",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
|
-
"@alicloud/alfa-core": "^1.4.
|
|
41
|
+
"@alicloud/alfa-core": "^1.4.34",
|
|
42
42
|
"@alicloud/console-os-loader": "^1.4.34"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { IAppConfig } from '@alicloud/alfa-core';
|
|
2
|
-
declare function afterLoadHook(appConfig: IAppConfig
|
|
2
|
+
declare function afterLoadHook(appConfig: IAppConfig & {
|
|
3
|
+
channel?: string;
|
|
4
|
+
}): Promise<IAppConfig<any> & {
|
|
5
|
+
channel?: string | undefined;
|
|
6
|
+
}>;
|
|
3
7
|
export default afterLoadHook;
|
package/types/types/index.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ export interface AlfaReleaseConfig {
|
|
|
11
11
|
}
|
|
12
12
|
export type EnvEnum = 'prod' | 'local' | 'pre' | 'daily';
|
|
13
13
|
export interface AlfaFactoryOption extends IAppConfig {
|
|
14
|
+
/**
|
|
15
|
+
* oneConsole 渠道
|
|
16
|
+
*/
|
|
17
|
+
channel?: string;
|
|
14
18
|
loading?: boolean | React.ReactChild;
|
|
15
19
|
dependencies?: Record<string, any>;
|
|
16
20
|
className?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AlfaConfig } from '@alicloud/alfa-core';
|
|
2
|
-
export declare const getConsoleConfig: (configData: AlfaConfig, consoleConfig: any) => Promise<{
|
|
2
|
+
export declare const getConsoleConfig: (configData: AlfaConfig, consoleConfig: any, channel?: string) => Promise<{
|
|
3
3
|
CHANNEL_LINKS: {
|
|
4
4
|
[x: string]: string | undefined;
|
|
5
5
|
};
|
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.5.
|
|
1
|
+
export declare const version = "1.5.16";
|