@next-core/brick-kit 2.95.1 → 2.99.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 +49 -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 +57 -23
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +57 -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/dist/types/internal/evaluate.d.ts.map +1 -1
- package/dist/types/themeAndMode.d.ts +1 -0
- package/dist/types/themeAndMode.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,55 @@
|
|
|
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.99.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.98.0...@next-core/brick-kit@2.99.0) (2021-12-31)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* dark theme ([c6709a7](https://github.com/easyops-cn/next-core/commit/c6709a7a30a8860a6cb3e0245967c9bcfd5e78f5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* support dark-v2 ([0434b7e](https://github.com/easyops-cn/next-core/commit/0434b7e34c441c28ceb75ba753f46e3cd5ccc5c8))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# [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)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* fix accessing not-existed property of QUERY ([edcf0b1](https://github.com/easyops-cn/next-core/commit/edcf0b168e27f7b89ba2debde5a779c89500a0dd))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* **MockRegistry:** update mocks data ([10fed90](https://github.com/easyops-cn/next-core/commit/10fed9053e62af9cc52d994772343d629f45afac))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# [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)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Features
|
|
48
|
+
|
|
49
|
+
* 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)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
6
55
|
## [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)
|
|
7
56
|
|
|
8
57
|
**Note:** Version bump only for package @next-core/brick-kit
|
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() {
|
|
@@ -1902,6 +1902,11 @@
|
|
|
1902
1902
|
getUrl: getUrlBySegueFactory(app, segues)
|
|
1903
1903
|
};
|
|
1904
1904
|
|
|
1905
|
+
case "THEME":
|
|
1906
|
+
return {
|
|
1907
|
+
getTheme
|
|
1908
|
+
};
|
|
1909
|
+
|
|
1905
1910
|
case "SESSION_STORAGE":
|
|
1906
1911
|
return {
|
|
1907
1912
|
getItem: getItemFactory("session")
|
|
@@ -5302,6 +5307,9 @@
|
|
|
5302
5307
|
applyTheme(handler.action === "theme.setDarkTheme" ? "dark" : "light");
|
|
5303
5308
|
};
|
|
5304
5309
|
|
|
5310
|
+
case "theme.setTheme":
|
|
5311
|
+
return builtinThemeListenerFactory(handler.args, handler, context);
|
|
5312
|
+
|
|
5305
5313
|
case "mode.setDashboardMode":
|
|
5306
5314
|
case "mode.setDefaultMode":
|
|
5307
5315
|
return event => {
|
|
@@ -5595,6 +5603,19 @@
|
|
|
5595
5603
|
};
|
|
5596
5604
|
}
|
|
5597
5605
|
|
|
5606
|
+
function builtinThemeListenerFactory(args, ifContainer, context) {
|
|
5607
|
+
return function (event) {
|
|
5608
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5609
|
+
event
|
|
5610
|
+
}))) {
|
|
5611
|
+
return;
|
|
5612
|
+
}
|
|
5613
|
+
|
|
5614
|
+
var [theme] = argsFactory(args, context, event);
|
|
5615
|
+
applyTheme(theme);
|
|
5616
|
+
};
|
|
5617
|
+
}
|
|
5618
|
+
|
|
5598
5619
|
function findRefElement(brick, ref) {
|
|
5599
5620
|
var _getParentTemplate, _getParentTemplate$$$;
|
|
5600
5621
|
|
|
@@ -9154,21 +9175,24 @@
|
|
|
9154
9175
|
return defaultCollapsed || defaultCollapsedBreakpoint && document.documentElement.clientWidth < defaultCollapsedBreakpoint;
|
|
9155
9176
|
}
|
|
9156
9177
|
|
|
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);
|
|
9178
|
+
var mocks = {
|
|
9179
|
+
mockId: null,
|
|
9180
|
+
mockList: []
|
|
9169
9181
|
};
|
|
9170
|
-
|
|
9171
|
-
|
|
9182
|
+
function registerMock(useMocks) {
|
|
9183
|
+
var _useMocks$mockList;
|
|
9184
|
+
|
|
9185
|
+
if (useMocks) mocks = _objectSpread__default["default"](_objectSpread__default["default"]({}, useMocks), {}, {
|
|
9186
|
+
mockList: (_useMocks$mockList = useMocks.mockList) === null || _useMocks$mockList === void 0 ? void 0 : _useMocks$mockList.map(item => _objectSpread__default["default"](_objectSpread__default["default"]({}, item), {}, {
|
|
9187
|
+
uri: item.uri.replace(/(easyops\.api\.)(.+)(@\d+\.\d+\.\d+(?=\/))(.+)/, (_match, p1, p2, _p3, p4) => {
|
|
9188
|
+
return "(".concat(p1, ")?").concat(p2, "(@\\d+\\.\\d+\\.\\d+)?").concat(p4, "$");
|
|
9189
|
+
}).replace(/:\w+/g, "[\\w|-]+")
|
|
9190
|
+
}))
|
|
9191
|
+
});
|
|
9192
|
+
}
|
|
9193
|
+
var getMockId = requestUrl => {
|
|
9194
|
+
if (mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl))) return mocks.mockId;
|
|
9195
|
+
return undefined;
|
|
9172
9196
|
};
|
|
9173
9197
|
|
|
9174
9198
|
class Router {
|
|
@@ -9397,7 +9421,7 @@
|
|
|
9397
9421
|
};
|
|
9398
9422
|
|
|
9399
9423
|
if (storyboard) {
|
|
9400
|
-
var _currentApp$breadcrum, _currentApp$breadcrum2;
|
|
9424
|
+
var _currentApp$breadcrum, _currentApp$breadcrum2, _currentApp$theme;
|
|
9401
9425
|
|
|
9402
9426
|
if (appChanged && currentApp.id && isLoggedIn()) {
|
|
9403
9427
|
var usedCustomApis = brickUtils.mapCustomApisToNameAndNamespace(brickUtils.scanCustomApisInStoryboard(storyboard));
|
|
@@ -9496,7 +9520,7 @@
|
|
|
9496
9520
|
legacy: actualLegacy
|
|
9497
9521
|
});
|
|
9498
9522
|
|
|
9499
|
-
setTheme("light");
|
|
9523
|
+
setTheme((_currentApp$theme = currentApp.theme) !== null && _currentApp$theme !== void 0 ? _currentApp$theme : "light");
|
|
9500
9524
|
setMode("default"); // There is a window to set theme and mode by `lifeCycle.onBeforePageLoad`.
|
|
9501
9525
|
|
|
9502
9526
|
_this3.locationContext.handleBeforePageLoad();
|
|
@@ -10862,17 +10886,27 @@
|
|
|
10862
10886
|
};
|
|
10863
10887
|
var defaultLocale = localeValues;
|
|
10864
10888
|
|
|
10865
|
-
var emptyImage = "empty-image.
|
|
10889
|
+
var emptyImage = "empty-image.8e18d87fea570ef0.png";
|
|
10890
|
+
|
|
10891
|
+
var bigEmptyImage = "big-empty-image.397ff6359f4066d8.png";
|
|
10866
10892
|
|
|
10867
10893
|
/**
|
|
10868
10894
|
* 用于展示空数据的 React 组件。
|
|
10869
10895
|
*/
|
|
10870
10896
|
function EasyopsEmpty(props) {
|
|
10897
|
+
var _props$imageStyle;
|
|
10898
|
+
|
|
10871
10899
|
var illustration = React.useMemo(() => props.illustration && illustrations.getIllustration(props.illustration), [props.illustration]);
|
|
10872
|
-
|
|
10900
|
+
|
|
10901
|
+
var _emptyImage = props.useBigEmptyImage ? bigEmptyImage : emptyImage;
|
|
10902
|
+
|
|
10903
|
+
var image = props.illustration ? illustration : getImageUrl(_emptyImage);
|
|
10904
|
+
var imageStyle = (_props$imageStyle = props.imageStyle) !== null && _props$imageStyle !== void 0 ? _props$imageStyle : props.useBigEmptyImage ? undefined : {
|
|
10905
|
+
height: "60px"
|
|
10906
|
+
};
|
|
10873
10907
|
return /*#__PURE__*/React__default["default"].createElement(antd.Empty, {
|
|
10874
10908
|
image: image,
|
|
10875
|
-
imageStyle:
|
|
10909
|
+
imageStyle: imageStyle,
|
|
10876
10910
|
description: props.description
|
|
10877
10911
|
});
|
|
10878
10912
|
}
|
|
@@ -11384,7 +11418,7 @@
|
|
|
11384
11418
|
exports.event = event;
|
|
11385
11419
|
exports.getAuth = getAuth;
|
|
11386
11420
|
exports.getHistory = getHistory;
|
|
11387
|
-
exports.
|
|
11421
|
+
exports.getMockId = getMockId;
|
|
11388
11422
|
exports.getRuntime = getRuntime;
|
|
11389
11423
|
exports.handleHttpError = handleHttpError;
|
|
11390
11424
|
exports.httpErrorToString = httpErrorToString;
|