@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/dist/index.esm.js
CHANGED
|
@@ -287,7 +287,7 @@ function registerBrickTemplate(name, factory) {
|
|
|
287
287
|
var DEFAULT_THEME = "light";
|
|
288
288
|
var theme = DEFAULT_THEME;
|
|
289
289
|
function setTheme(value) {
|
|
290
|
-
if (value !== "dark" && value !== "light") {
|
|
290
|
+
if (value !== "dark" && value !== "light" && value !== "dark-v2") {
|
|
291
291
|
throw new Error("Unsupported theme: ".concat(value));
|
|
292
292
|
}
|
|
293
293
|
|
|
@@ -1877,7 +1877,7 @@ function evaluate(raw) {
|
|
|
1877
1877
|
case "QUERY":
|
|
1878
1878
|
return getDynamicReadOnlyProxy({
|
|
1879
1879
|
get(target, key) {
|
|
1880
|
-
return query.get(key);
|
|
1880
|
+
return query.has(key) ? query.get(key) : undefined;
|
|
1881
1881
|
},
|
|
1882
1882
|
|
|
1883
1883
|
ownKeys() {
|
|
@@ -1889,7 +1889,7 @@ function evaluate(raw) {
|
|
|
1889
1889
|
case "QUERY_ARRAY":
|
|
1890
1890
|
return getDynamicReadOnlyProxy({
|
|
1891
1891
|
get(target, key) {
|
|
1892
|
-
return query.getAll(key);
|
|
1892
|
+
return query.has(key) ? query.getAll(key) : undefined;
|
|
1893
1893
|
},
|
|
1894
1894
|
|
|
1895
1895
|
ownKeys() {
|
|
@@ -1903,6 +1903,11 @@ function evaluate(raw) {
|
|
|
1903
1903
|
getUrl: getUrlBySegueFactory(app, segues)
|
|
1904
1904
|
};
|
|
1905
1905
|
|
|
1906
|
+
case "THEME":
|
|
1907
|
+
return {
|
|
1908
|
+
getTheme
|
|
1909
|
+
};
|
|
1910
|
+
|
|
1906
1911
|
case "SESSION_STORAGE":
|
|
1907
1912
|
return {
|
|
1908
1913
|
getItem: getItemFactory("session")
|
|
@@ -5303,6 +5308,9 @@ function listenerFactory(handler, context, runtimeBrick) {
|
|
|
5303
5308
|
applyTheme(handler.action === "theme.setDarkTheme" ? "dark" : "light");
|
|
5304
5309
|
};
|
|
5305
5310
|
|
|
5311
|
+
case "theme.setTheme":
|
|
5312
|
+
return builtinThemeListenerFactory(handler.args, handler, context);
|
|
5313
|
+
|
|
5306
5314
|
case "mode.setDashboardMode":
|
|
5307
5315
|
case "mode.setDefaultMode":
|
|
5308
5316
|
return event => {
|
|
@@ -5596,6 +5604,19 @@ function builtinAnalyticsListenerFactory(args, ifContainer, context) {
|
|
|
5596
5604
|
};
|
|
5597
5605
|
}
|
|
5598
5606
|
|
|
5607
|
+
function builtinThemeListenerFactory(args, ifContainer, context) {
|
|
5608
|
+
return function (event) {
|
|
5609
|
+
if (!looseCheckIf(ifContainer, _objectSpread(_objectSpread({}, context), {}, {
|
|
5610
|
+
event
|
|
5611
|
+
}))) {
|
|
5612
|
+
return;
|
|
5613
|
+
}
|
|
5614
|
+
|
|
5615
|
+
var [theme] = argsFactory(args, context, event);
|
|
5616
|
+
applyTheme(theme);
|
|
5617
|
+
};
|
|
5618
|
+
}
|
|
5619
|
+
|
|
5599
5620
|
function findRefElement(brick, ref) {
|
|
5600
5621
|
var _getParentTemplate, _getParentTemplate$$$;
|
|
5601
5622
|
|
|
@@ -9155,21 +9176,24 @@ function shouldBeDefaultCollapsed(defaultCollapsed, defaultCollapsedBreakpoint)
|
|
|
9155
9176
|
return defaultCollapsed || defaultCollapsedBreakpoint && document.documentElement.clientWidth < defaultCollapsedBreakpoint;
|
|
9156
9177
|
}
|
|
9157
9178
|
|
|
9158
|
-
var
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
}
|
|
9162
|
-
|
|
9163
|
-
function getUrlRegExp(str) {
|
|
9164
|
-
return new RegExp("".concat(str.replace(/:\w+/g, "[\\w|-]+"), "$"));
|
|
9165
|
-
}
|
|
9166
|
-
|
|
9167
|
-
var isMatchMockUrl = (requestUrl, uri) => {
|
|
9168
|
-
var reg = getUrlRegExp(uri);
|
|
9169
|
-
return reg.test(requestUrl);
|
|
9179
|
+
var mocks = {
|
|
9180
|
+
mockId: null,
|
|
9181
|
+
mockList: []
|
|
9170
9182
|
};
|
|
9171
|
-
|
|
9172
|
-
|
|
9183
|
+
function registerMock(useMocks) {
|
|
9184
|
+
var _useMocks$mockList;
|
|
9185
|
+
|
|
9186
|
+
if (useMocks) mocks = _objectSpread(_objectSpread({}, useMocks), {}, {
|
|
9187
|
+
mockList: (_useMocks$mockList = useMocks.mockList) === null || _useMocks$mockList === void 0 ? void 0 : _useMocks$mockList.map(item => _objectSpread(_objectSpread({}, item), {}, {
|
|
9188
|
+
uri: item.uri.replace(/(easyops\.api\.)(.+)(@\d+\.\d+\.\d+(?=\/))(.+)/, (_match, p1, p2, _p3, p4) => {
|
|
9189
|
+
return "(".concat(p1, ")?").concat(p2, "(@\\d+\\.\\d+\\.\\d+)?").concat(p4, "$");
|
|
9190
|
+
}).replace(/:\w+/g, "[\\w|-]+")
|
|
9191
|
+
}))
|
|
9192
|
+
});
|
|
9193
|
+
}
|
|
9194
|
+
var getMockId = requestUrl => {
|
|
9195
|
+
if (mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl))) return mocks.mockId;
|
|
9196
|
+
return undefined;
|
|
9173
9197
|
};
|
|
9174
9198
|
|
|
9175
9199
|
class Router {
|
|
@@ -9398,7 +9422,7 @@ class Router {
|
|
|
9398
9422
|
};
|
|
9399
9423
|
|
|
9400
9424
|
if (storyboard) {
|
|
9401
|
-
var _currentApp$breadcrum, _currentApp$breadcrum2;
|
|
9425
|
+
var _currentApp$breadcrum, _currentApp$breadcrum2, _currentApp$theme;
|
|
9402
9426
|
|
|
9403
9427
|
if (appChanged && currentApp.id && isLoggedIn()) {
|
|
9404
9428
|
var usedCustomApis = mapCustomApisToNameAndNamespace(scanCustomApisInStoryboard(storyboard));
|
|
@@ -9497,7 +9521,7 @@ class Router {
|
|
|
9497
9521
|
legacy: actualLegacy
|
|
9498
9522
|
});
|
|
9499
9523
|
|
|
9500
|
-
setTheme("light");
|
|
9524
|
+
setTheme((_currentApp$theme = currentApp.theme) !== null && _currentApp$theme !== void 0 ? _currentApp$theme : "light");
|
|
9501
9525
|
setMode("default"); // There is a window to set theme and mode by `lifeCycle.onBeforePageLoad`.
|
|
9502
9526
|
|
|
9503
9527
|
_this3.locationContext.handleBeforePageLoad();
|
|
@@ -10863,17 +10887,27 @@ var localeValues = {
|
|
|
10863
10887
|
};
|
|
10864
10888
|
var defaultLocale = localeValues;
|
|
10865
10889
|
|
|
10866
|
-
var emptyImage = "empty-image.
|
|
10890
|
+
var emptyImage = "empty-image.8e18d87fea570ef0.png";
|
|
10891
|
+
|
|
10892
|
+
var bigEmptyImage = "big-empty-image.397ff6359f4066d8.png";
|
|
10867
10893
|
|
|
10868
10894
|
/**
|
|
10869
10895
|
* 用于展示空数据的 React 组件。
|
|
10870
10896
|
*/
|
|
10871
10897
|
function EasyopsEmpty(props) {
|
|
10898
|
+
var _props$imageStyle;
|
|
10899
|
+
|
|
10872
10900
|
var illustration = useMemo(() => props.illustration && getIllustration(props.illustration), [props.illustration]);
|
|
10873
|
-
|
|
10901
|
+
|
|
10902
|
+
var _emptyImage = props.useBigEmptyImage ? bigEmptyImage : emptyImage;
|
|
10903
|
+
|
|
10904
|
+
var image = props.illustration ? illustration : getImageUrl(_emptyImage);
|
|
10905
|
+
var imageStyle = (_props$imageStyle = props.imageStyle) !== null && _props$imageStyle !== void 0 ? _props$imageStyle : props.useBigEmptyImage ? undefined : {
|
|
10906
|
+
height: "60px"
|
|
10907
|
+
};
|
|
10874
10908
|
return /*#__PURE__*/React.createElement(Empty, {
|
|
10875
10909
|
image: image,
|
|
10876
|
-
imageStyle:
|
|
10910
|
+
imageStyle: imageStyle,
|
|
10877
10911
|
description: props.description
|
|
10878
10912
|
});
|
|
10879
10913
|
}
|
|
@@ -11364,5 +11398,5 @@ var ModalElement = _decorate(null, function (_initialize, _UpdatingElement) {
|
|
|
11364
11398
|
};
|
|
11365
11399
|
}, UpdatingElement);
|
|
11366
11400
|
|
|
11367
|
-
export { BrickAsComponent, BrickWrapper, DisplayByFeatureFlags, EasyopsEmpty, ErrorBoundary, FeatureFlagsProvider, ForwardRefSingleBrickAsComponent, ModalElement, SingleBrickAsComponent, StoryboardFunctionRegistryFactory, UpdatingElement, authenticate, checkIf, checkIfByTransform, createHistory, createRuntime, developHelper, doTransform, event, getAuth, getHistory,
|
|
11401
|
+
export { BrickAsComponent, BrickWrapper, DisplayByFeatureFlags, EasyopsEmpty, ErrorBoundary, FeatureFlagsProvider, ForwardRefSingleBrickAsComponent, ModalElement, SingleBrickAsComponent, StoryboardFunctionRegistryFactory, UpdatingElement, authenticate, checkIf, checkIfByTransform, createHistory, createRuntime, developHelper, doTransform, event, getAuth, getHistory, getMockId, getRuntime, handleHttpError, httpErrorToString, i18nText, initI18n, isLoggedIn, logout, looseCheckIf, looseCheckIfByTransform, looseCheckIfOfComputed, method, preprocessTransformProperties, property, reTransformForDevtools, renderEasyopsEmpty, transformElementProperties, transformIntermediateData, transformProperties, useApplyPageTitle, useCurrentApp, useCurrentMode, useCurrentTheme, useFeatureFlags, useLocation, useRecentApps };
|
|
11368
11402
|
//# sourceMappingURL=index.esm.js.map
|