@next-core/brick-kit 2.95.0 → 2.98.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.
- package/CHANGELOG.md +46 -0
- package/dist/assets/{empty-image.397ff6359f4066d8.png → big-empty-image.397ff6359f4066d8.png} +0 -0
- package/dist/assets/empty-image.8e18d87fea570ef0.png +0 -0
- package/dist/index.bundle.js +52 -23
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +52 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/types/EasyopsEmpty/EasyopsEmpty.d.ts +1 -0
- package/dist/types/EasyopsEmpty/EasyopsEmpty.d.ts.map +1 -1
- package/dist/types/core/MockRegistry.d.ts +3 -4
- package/dist/types/core/MockRegistry.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/internal/bindListeners.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.98.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.97.0...@next-core/brick-kit@2.98.0) (2021-12-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* support dark-v2 ([0434b7e](https://github.com/easyops-cn/next-core/commit/0434b7e34c441c28ceb75ba753f46e3cd5ccc5c8))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [2.97.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.96.0...@next-core/brick-kit@2.97.0) (2021-12-29)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* fix accessing not-existed property of QUERY ([edcf0b1](https://github.com/easyops-cn/next-core/commit/edcf0b168e27f7b89ba2debde5a779c89500a0dd))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **MockRegistry:** update mocks data ([10fed90](https://github.com/easyops-cn/next-core/commit/10fed9053e62af9cc52d994772343d629f45afac))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [2.96.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.95.1...@next-core/brick-kit@2.96.0) (2021-12-29)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* some adjustment for EasyopsEmpty's empty image ([cc5af32](https://github.com/easyops-cn/next-core/commit/cc5af32a93d7497ff236c2189e730a3f771d3866)), closes [Refs#MONITOR-2681](https://github.com/Refs/issues/MONITOR-2681)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## [2.95.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.95.0...@next-core/brick-kit@2.95.1) (2021-12-28)
|
|
45
|
+
|
|
46
|
+
**Note:** Version bump only for package @next-core/brick-kit
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
# [2.95.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.94.0...@next-core/brick-kit@2.95.0) (2021-12-28)
|
|
7
53
|
|
|
8
54
|
|
package/dist/assets/{empty-image.397ff6359f4066d8.png → big-empty-image.397ff6359f4066d8.png}
RENAMED
|
File without changes
|
|
Binary file
|
package/dist/index.bundle.js
CHANGED
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
var DEFAULT_THEME = "light";
|
|
287
287
|
var theme = DEFAULT_THEME;
|
|
288
288
|
function setTheme(value) {
|
|
289
|
-
if (value !== "dark" && value !== "light") {
|
|
289
|
+
if (value !== "dark" && value !== "light" && value !== "dark-v2") {
|
|
290
290
|
throw new Error("Unsupported theme: ".concat(value));
|
|
291
291
|
}
|
|
292
292
|
|
|
@@ -1876,7 +1876,7 @@
|
|
|
1876
1876
|
case "QUERY":
|
|
1877
1877
|
return getDynamicReadOnlyProxy({
|
|
1878
1878
|
get(target, key) {
|
|
1879
|
-
return query.get(key);
|
|
1879
|
+
return query.has(key) ? query.get(key) : undefined;
|
|
1880
1880
|
},
|
|
1881
1881
|
|
|
1882
1882
|
ownKeys() {
|
|
@@ -1888,7 +1888,7 @@
|
|
|
1888
1888
|
case "QUERY_ARRAY":
|
|
1889
1889
|
return getDynamicReadOnlyProxy({
|
|
1890
1890
|
get(target, key) {
|
|
1891
|
-
return query.getAll(key);
|
|
1891
|
+
return query.has(key) ? query.getAll(key) : undefined;
|
|
1892
1892
|
},
|
|
1893
1893
|
|
|
1894
1894
|
ownKeys() {
|
|
@@ -5302,6 +5302,9 @@
|
|
|
5302
5302
|
applyTheme(handler.action === "theme.setDarkTheme" ? "dark" : "light");
|
|
5303
5303
|
};
|
|
5304
5304
|
|
|
5305
|
+
case "theme.setTheme":
|
|
5306
|
+
return builtinThemeListenerFactory(handler.args, handler, context);
|
|
5307
|
+
|
|
5305
5308
|
case "mode.setDashboardMode":
|
|
5306
5309
|
case "mode.setDefaultMode":
|
|
5307
5310
|
return event => {
|
|
@@ -5595,6 +5598,19 @@
|
|
|
5595
5598
|
};
|
|
5596
5599
|
}
|
|
5597
5600
|
|
|
5601
|
+
function builtinThemeListenerFactory(args, ifContainer, context) {
|
|
5602
|
+
return function (event) {
|
|
5603
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5604
|
+
event
|
|
5605
|
+
}))) {
|
|
5606
|
+
return;
|
|
5607
|
+
}
|
|
5608
|
+
|
|
5609
|
+
var [theme] = argsFactory(args, context, event);
|
|
5610
|
+
applyTheme(theme);
|
|
5611
|
+
};
|
|
5612
|
+
}
|
|
5613
|
+
|
|
5598
5614
|
function findRefElement(brick, ref) {
|
|
5599
5615
|
var _getParentTemplate, _getParentTemplate$$$;
|
|
5600
5616
|
|
|
@@ -9154,21 +9170,24 @@
|
|
|
9154
9170
|
return defaultCollapsed || defaultCollapsedBreakpoint && document.documentElement.clientWidth < defaultCollapsedBreakpoint;
|
|
9155
9171
|
}
|
|
9156
9172
|
|
|
9157
|
-
var
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
}
|
|
9161
|
-
|
|
9162
|
-
function getUrlRegExp(str) {
|
|
9163
|
-
return new RegExp("".concat(str.replace(/:\w+/g, "[\\w|-]+"), "$"));
|
|
9164
|
-
}
|
|
9165
|
-
|
|
9166
|
-
var isMatchMockUrl = (requestUrl, uri) => {
|
|
9167
|
-
var reg = getUrlRegExp(uri);
|
|
9168
|
-
return reg.test(requestUrl);
|
|
9173
|
+
var mocks = {
|
|
9174
|
+
mockId: null,
|
|
9175
|
+
mockList: []
|
|
9169
9176
|
};
|
|
9170
|
-
|
|
9171
|
-
|
|
9177
|
+
function registerMock(useMocks) {
|
|
9178
|
+
var _useMocks$mockList;
|
|
9179
|
+
|
|
9180
|
+
if (useMocks) mocks = _objectSpread__default["default"](_objectSpread__default["default"]({}, useMocks), {}, {
|
|
9181
|
+
mockList: (_useMocks$mockList = useMocks.mockList) === null || _useMocks$mockList === void 0 ? void 0 : _useMocks$mockList.map(item => _objectSpread__default["default"](_objectSpread__default["default"]({}, item), {}, {
|
|
9182
|
+
uri: item.uri.replace(/(easyops\.api\.)(.+)(@\d+\.\d+\.\d+(?=\/))(.+)/, (_match, p1, p2, _p3, p4) => {
|
|
9183
|
+
return "(".concat(p1, ")?").concat(p2, "(@\\d+\\.\\d+\\.\\d+)?").concat(p4, "$");
|
|
9184
|
+
}).replace(/:\w+/g, "[\\w|-]+")
|
|
9185
|
+
}))
|
|
9186
|
+
});
|
|
9187
|
+
}
|
|
9188
|
+
var getMockId = requestUrl => {
|
|
9189
|
+
if (mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl))) return mocks.mockId;
|
|
9190
|
+
return undefined;
|
|
9172
9191
|
};
|
|
9173
9192
|
|
|
9174
9193
|
class Router {
|
|
@@ -9397,7 +9416,7 @@
|
|
|
9397
9416
|
};
|
|
9398
9417
|
|
|
9399
9418
|
if (storyboard) {
|
|
9400
|
-
var _currentApp$breadcrum, _currentApp$breadcrum2;
|
|
9419
|
+
var _currentApp$breadcrum, _currentApp$breadcrum2, _currentApp$theme;
|
|
9401
9420
|
|
|
9402
9421
|
if (appChanged && currentApp.id && isLoggedIn()) {
|
|
9403
9422
|
var usedCustomApis = brickUtils.mapCustomApisToNameAndNamespace(brickUtils.scanCustomApisInStoryboard(storyboard));
|
|
@@ -9496,7 +9515,7 @@
|
|
|
9496
9515
|
legacy: actualLegacy
|
|
9497
9516
|
});
|
|
9498
9517
|
|
|
9499
|
-
setTheme("light");
|
|
9518
|
+
setTheme((_currentApp$theme = currentApp.theme) !== null && _currentApp$theme !== void 0 ? _currentApp$theme : "light");
|
|
9500
9519
|
setMode("default"); // There is a window to set theme and mode by `lifeCycle.onBeforePageLoad`.
|
|
9501
9520
|
|
|
9502
9521
|
_this3.locationContext.handleBeforePageLoad();
|
|
@@ -10862,17 +10881,27 @@
|
|
|
10862
10881
|
};
|
|
10863
10882
|
var defaultLocale = localeValues;
|
|
10864
10883
|
|
|
10865
|
-
var emptyImage = "empty-image.
|
|
10884
|
+
var emptyImage = "empty-image.8e18d87fea570ef0.png";
|
|
10885
|
+
|
|
10886
|
+
var bigEmptyImage = "big-empty-image.397ff6359f4066d8.png";
|
|
10866
10887
|
|
|
10867
10888
|
/**
|
|
10868
10889
|
* 用于展示空数据的 React 组件。
|
|
10869
10890
|
*/
|
|
10870
10891
|
function EasyopsEmpty(props) {
|
|
10892
|
+
var _props$imageStyle;
|
|
10893
|
+
|
|
10871
10894
|
var illustration = React.useMemo(() => props.illustration && illustrations.getIllustration(props.illustration), [props.illustration]);
|
|
10872
|
-
|
|
10895
|
+
|
|
10896
|
+
var _emptyImage = props.useBigEmptyImage ? bigEmptyImage : emptyImage;
|
|
10897
|
+
|
|
10898
|
+
var image = props.illustration ? illustration : getImageUrl(_emptyImage);
|
|
10899
|
+
var imageStyle = (_props$imageStyle = props.imageStyle) !== null && _props$imageStyle !== void 0 ? _props$imageStyle : props.useBigEmptyImage ? undefined : {
|
|
10900
|
+
height: "60px"
|
|
10901
|
+
};
|
|
10873
10902
|
return /*#__PURE__*/React__default["default"].createElement(antd.Empty, {
|
|
10874
10903
|
image: image,
|
|
10875
|
-
imageStyle:
|
|
10904
|
+
imageStyle: imageStyle,
|
|
10876
10905
|
description: props.description
|
|
10877
10906
|
});
|
|
10878
10907
|
}
|
|
@@ -11384,7 +11413,7 @@
|
|
|
11384
11413
|
exports.event = event;
|
|
11385
11414
|
exports.getAuth = getAuth;
|
|
11386
11415
|
exports.getHistory = getHistory;
|
|
11387
|
-
exports.
|
|
11416
|
+
exports.getMockId = getMockId;
|
|
11388
11417
|
exports.getRuntime = getRuntime;
|
|
11389
11418
|
exports.handleHttpError = handleHttpError;
|
|
11390
11419
|
exports.httpErrorToString = httpErrorToString;
|