@next-core/brick-kit 2.91.0 → 2.92.1

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.esm.js CHANGED
@@ -3,8 +3,7 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
3
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
4
4
  import _asyncToGenerator$4 from '@babel/runtime/helpers/asyncToGenerator';
5
5
  import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
6
- import * as React from 'react';
7
- import React__default, { useState, useEffect, forwardRef, useRef, useImperativeHandle, useMemo, useContext, createContext } from 'react';
6
+ import React, { useState, useEffect, forwardRef, useRef, useImperativeHandle, useMemo, useContext, createContext } from 'react';
8
7
  import lodash, { set, get, difference, identity, cloneDeep, isNil, sortBy, merge, clamp, uniqueId, orderBy, omit, isEmpty } from 'lodash';
9
8
  import { toPath, computeRealRoutePath, hasOwnProperty, isObject, isEvaluable, transformAndInject, transform, trackContext, scanPermissionActionsInStoryboard, precookFunction, cook, shouldAllowRecursiveEvaluations, preevaluate, inject, deepFreeze, createProviderClass, scanRouteAliasInStoryboard, loadScript, getTemplateDepsOfStoryboard, getDllAndDepsOfStoryboard, asyncProcessStoryboard, prefetchScript, scanBricksInBrickConf, scanProcessorsInAny, getDllAndDepsByResource, resolveContextConcurrently, matchPath, asyncProcessBrick, restoreDynamicTemplates, mapCustomApisToNameAndNamespace, scanCustomApisInStoryboard } from '@next-core/brick-utils';
10
9
  import { http, HttpResponseError, HttpFetchError } from '@next-core/brick-http';
@@ -16,7 +15,7 @@ import yaml from 'js-yaml';
16
15
  import { Modal, message, Empty, ConfigProvider } from 'antd';
17
16
  import { ExclamationCircleOutlined } from '@ant-design/icons';
18
17
  import { withTranslation } from 'react-i18next';
19
- import _extends$1 from '@babel/runtime/helpers/esm/extends';
18
+ import _extends from '@babel/runtime/helpers/esm/extends';
20
19
  import { getIllustration } from '@next-core/illustrations';
21
20
  import _decorate from '@babel/runtime/helpers/decorate';
22
21
 
@@ -3109,8 +3108,8 @@ function handleHttpError(error) {
3109
3108
  }
3110
3109
 
3111
3110
  unauthenticatedConfirmModal = Modal.confirm({
3112
- icon: /*#__PURE__*/React__default.createElement(ExclamationCircleOutlined, null),
3113
- content: /*#__PURE__*/React__default.createElement(LoginTimeoutMessage, null),
3111
+ icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),
3112
+ content: /*#__PURE__*/React.createElement(LoginTimeoutMessage, null),
3114
3113
  okText: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.MODAL_OK)),
3115
3114
  cancelText: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.MODAL_CANCEL)),
3116
3115
  onOk: () => {
@@ -3128,7 +3127,7 @@ function handleHttpError(error) {
3128
3127
 
3129
3128
  return Modal.error({
3130
3129
  title: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.REQUEST_FAILED)),
3131
- content: /*#__PURE__*/React__default.createElement("div", {
3130
+ content: /*#__PURE__*/React.createElement("div", {
3132
3131
  style: {
3133
3132
  whiteSpace: "pre-wrap"
3134
3133
  }
@@ -3137,13 +3136,13 @@ function handleHttpError(error) {
3137
3136
  });
3138
3137
  }
3139
3138
  function LoginTimeoutMessage() {
3140
- React__default.useEffect(() => {
3139
+ React.useEffect(() => {
3141
3140
  // Unset confirm modal when it's destroyed.
3142
3141
  return () => {
3143
3142
  unauthenticatedConfirmModal = undefined;
3144
3143
  };
3145
3144
  }, []);
3146
- return /*#__PURE__*/React__default.createElement("div", null, i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.LOGIN_TIMEOUT_MESSAGE)));
3145
+ return /*#__PURE__*/React.createElement("div", null, i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.LOGIN_TIMEOUT_MESSAGE)));
3147
3146
  }
3148
3147
 
3149
3148
  class WebsocketMessageRequest {
@@ -6253,7 +6252,7 @@ class Kernel {
6253
6252
 
6254
6253
  return _asyncToGenerator$4(function* () {
6255
6254
  var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : BootstrapV2Api_bootstrapV2(_objectSpread({
6256
- appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status",
6255
+ appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status,icons",
6257
6256
  ignoreTemplateFields: "templates",
6258
6257
  ignoreBrickFields: "bricks,processors,providers,editors"
6259
6258
  }, params), {
@@ -9270,6 +9269,8 @@ class Router {
9270
9269
  var _this3 = this;
9271
9270
 
9272
9271
  return _asyncToGenerator$4(function* () {
9272
+ var _apiAnalyzer$getInsta;
9273
+
9273
9274
  _this3.state = "initial";
9274
9275
  _this3.renderId = uniqueId("render-id-");
9275
9276
  resetAllInjected();
@@ -9280,7 +9281,10 @@ class Router {
9280
9281
  }
9281
9282
 
9282
9283
  var history = getHistory();
9283
- history.unblock();
9284
+ history.unblock(); // Create the page tracker before page load.
9285
+ // And the API Analyzer maybe disabled.
9286
+
9287
+ var pageTracker = (_apiAnalyzer$getInsta = apiAnalyzer.getInstance()) === null || _apiAnalyzer$getInsta === void 0 ? void 0 : _apiAnalyzer$getInsta.pageTracker();
9284
9288
  var locationContext = _this3.locationContext = new LocationContext(_this3.kernel, location);
9285
9289
  var storyboard = locationContext.matchStoryboard(_this3.kernel.bootstrapData.storyboards);
9286
9290
 
@@ -9368,7 +9372,8 @@ class Router {
9368
9372
  mountRoutesResult.main = [{
9369
9373
  type: brickPageError,
9370
9374
  properties: {
9371
- error: httpErrorToString(error)
9375
+ error: httpErrorToString(error),
9376
+ code: error instanceof HttpResponseError ? error.response.status : null
9372
9377
  },
9373
9378
  events: {}
9374
9379
  }];
@@ -9476,8 +9481,6 @@ class Router {
9476
9481
  });
9477
9482
 
9478
9483
  if (main.length > 0 || portal.length > 0) {
9479
- var _apiAnalyzer$getInsta;
9480
-
9481
9484
  main.length > 0 && mountTree(main, mountPoints.main);
9482
9485
  portal.length > 0 && mountTree(portal, mountPoints.portal);
9483
9486
  afterMountTree(mountPoints.main);
@@ -9496,9 +9499,8 @@ class Router {
9496
9499
  // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md
9497
9500
 
9498
9501
 
9499
- window.scrollTo(0, 0); // API Analyzer maybe disabled.
9500
-
9501
- (_apiAnalyzer$getInsta = apiAnalyzer.getInstance()) === null || _apiAnalyzer$getInsta === void 0 ? void 0 : _apiAnalyzer$getInsta.pageTracker()(locationContext.getCurrentMatch().path); // analytics page_view event
9502
+ window.scrollTo(0, 0);
9503
+ pageTracker === null || pageTracker === void 0 ? void 0 : pageTracker(locationContext.getCurrentMatch().path); // analytics page_view event
9502
9504
 
9503
9505
  userAnalytics.event("page_view", _objectSpread({
9504
9506
  micro_app_id: _this3.kernel.currentApp.id,
@@ -9629,7 +9631,7 @@ function getRuntime() {
9629
9631
  }
9630
9632
 
9631
9633
  // Ref https://reactjs.org/docs/error-boundaries.html
9632
- class LegacyErrorBoundary extends React__default.Component {
9634
+ class LegacyErrorBoundary extends React.Component {
9633
9635
  constructor(props) {
9634
9636
  super(props);
9635
9637
  this.state = {
@@ -9652,9 +9654,9 @@ class LegacyErrorBoundary extends React__default.Component {
9652
9654
  render() {
9653
9655
  if (this.state.error) {
9654
9656
  // You can render any custom fallback UI
9655
- return /*#__PURE__*/React__default.createElement("div", {
9657
+ return /*#__PURE__*/React.createElement("div", {
9656
9658
  "data-testid": "error-boundary"
9657
- }, /*#__PURE__*/React__default.createElement("h3", null, this.props.t(K.SOMETHING_WENT_WRONG)), /*#__PURE__*/React__default.createElement("p", null, httpErrorToString(this.state.error)));
9659
+ }, /*#__PURE__*/React.createElement("h3", null, this.props.t(K.SOMETHING_WENT_WRONG)), /*#__PURE__*/React.createElement("p", null, httpErrorToString(this.state.error)));
9658
9660
  }
9659
9661
 
9660
9662
  return this.props.children;
@@ -9849,8 +9851,8 @@ function useApplyPageTitle(pageTitle) {
9849
9851
  /** @internal */
9850
9852
 
9851
9853
  function useRecentApps() {
9852
- var [recentApps, setRecentApps] = React__default.useState(getRuntime().getRecentApps());
9853
- React__default.useEffect(() => {
9854
+ var [recentApps, setRecentApps] = React.useState(getRuntime().getRecentApps());
9855
+ React.useEffect(() => {
9854
9856
  var listener = event => {
9855
9857
  setRecentApps(event.detail);
9856
9858
  };
@@ -9884,8 +9886,8 @@ function useCurrentApp() {
9884
9886
 
9885
9887
  function useLocation() {
9886
9888
  var history = getHistory();
9887
- var [location, setLocation] = React__default.useState(history.location);
9888
- React__default.useEffect(() => {
9889
+ var [location, setLocation] = React.useState(history.location);
9890
+ React.useEffect(() => {
9889
9891
  var unlisten = history.listen(location => setLocation(location));
9890
9892
  return unlisten;
9891
9893
  }, [history]);
@@ -10036,7 +10038,7 @@ var handleProxyOfParentTemplate = (brick, tplContextId, tplContext) => {
10036
10038
  * @param props - 属性。
10037
10039
  */
10038
10040
 
10039
- var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBrickAsComponent(_ref2) {
10041
+ var SingleBrickAsComponent = /*#__PURE__*/React.memo(function SingleBrickAsComponent(_ref2) {
10040
10042
  var {
10041
10043
  useBrick,
10042
10044
  data,
@@ -10049,7 +10051,7 @@ var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBri
10049
10051
 
10050
10052
  var template;
10051
10053
  var brick;
10052
- var isBrickAvailable = React__default.useMemo(() => {
10054
+ var isBrickAvailable = React.useMemo(() => {
10053
10055
  if (isObject(useBrick.if) && !isPreEvaluated(useBrick.if)) {
10054
10056
  // eslint-disable-next-line
10055
10057
  console.warn("Currently resolvable-if in `useBrick` is not supported.");
@@ -10063,7 +10065,7 @@ var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBri
10063
10065
 
10064
10066
  return true;
10065
10067
  }, [useBrick, data]);
10066
- var runtimeBrick = React__default.useMemo( /*#__PURE__*/_asyncToGenerator$4(function* () {
10068
+ var runtimeBrick = React.useMemo( /*#__PURE__*/_asyncToGenerator$4(function* () {
10067
10069
  if (!isBrickAvailable) {
10068
10070
  return null;
10069
10071
  } // If the router state is initial, ignore rendering the sub-brick.
@@ -10102,7 +10104,7 @@ var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBri
10102
10104
 
10103
10105
  return brick;
10104
10106
  }), [useBrick, data, isBrickAvailable]);
10105
- var innerRefCallback = React__default.useCallback( /*#__PURE__*/function () {
10107
+ var innerRefCallback = React.useCallback( /*#__PURE__*/function () {
10106
10108
  var _ref5 = _asyncToGenerator$4(function* (element) {
10107
10109
  immediatelyRefCallback === null || immediatelyRefCallback === void 0 ? void 0 : immediatelyRefCallback(element);
10108
10110
 
@@ -10157,24 +10159,24 @@ var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBri
10157
10159
  }
10158
10160
 
10159
10161
  if (template) {
10160
- return /*#__PURE__*/React__default.createElement(template.brick, {
10162
+ return /*#__PURE__*/React.createElement(template.brick, {
10161
10163
  ref: innerRefCallback
10162
10164
  }, ...slotsToChildren(template.slots).map((item, index) => {
10163
- return /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10165
+ return /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
10164
10166
  key: index,
10165
10167
  useBrick: item,
10166
10168
  data: brick.properties
10167
10169
  });
10168
10170
  }));
10169
10171
  } else {
10170
- return /*#__PURE__*/React__default.createElement(useBrick.brick, {
10172
+ return /*#__PURE__*/React.createElement(useBrick.brick, {
10171
10173
  ref: innerRefCallback
10172
10174
  }, ...slotsToChildren(useBrick.slots).map((item, index) => {
10173
10175
  if (useBrick[symbolForTplContextId] && !item[symbolForTplContextId]) {
10174
10176
  item[symbolForTplContextId] = useBrick[symbolForTplContextId];
10175
10177
  }
10176
10178
 
10177
- return /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10179
+ return /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
10178
10180
  key: index,
10179
10181
  useBrick: item,
10180
10182
  data: data
@@ -10210,7 +10212,7 @@ function BrickAsComponent(_ref6) {
10210
10212
  } = _ref6;
10211
10213
 
10212
10214
  if (Array.isArray(useBrick)) {
10213
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, useBrick.map((item, index) => /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10215
+ return /*#__PURE__*/React.createElement(React.Fragment, null, useBrick.map((item, index) => /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
10214
10216
  key: index,
10215
10217
  useBrick: item,
10216
10218
  data: data,
@@ -10218,7 +10220,7 @@ function BrickAsComponent(_ref6) {
10218
10220
  })));
10219
10221
  }
10220
10222
 
10221
- return /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10223
+ return /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
10222
10224
  useBrick: useBrick,
10223
10225
  data: data,
10224
10226
  parentRefForUseBrickInPortal: parentRefForUseBrickInPortal
@@ -10251,7 +10253,7 @@ function transformEvents(data, events) {
10251
10253
  // eslint-disable-next-line react/display-name
10252
10254
 
10253
10255
 
10254
- var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PURE__*/forwardRef(function LegacySingleBrickAsComponent(_ref8, ref) {
10256
+ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function LegacySingleBrickAsComponent(_ref8, ref) {
10255
10257
  var {
10256
10258
  useBrick,
10257
10259
  data,
@@ -10264,7 +10266,7 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PU
10264
10266
 
10265
10267
  var template;
10266
10268
  var brick;
10267
- var isBrickAvailable = React__default.useMemo(() => {
10269
+ var isBrickAvailable = React.useMemo(() => {
10268
10270
  if (isObject(useBrick.if) && !isPreEvaluated(useBrick.if)) {
10269
10271
  // eslint-disable-next-line
10270
10272
  console.warn("Currently resolvable-if in `useBrick` is not supported.");
@@ -10281,7 +10283,7 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PU
10281
10283
  useImperativeHandle(ref, () => {
10282
10284
  return brickRef.current;
10283
10285
  });
10284
- var runtimeBrick = React__default.useMemo( /*#__PURE__*/_asyncToGenerator$4(function* () {
10286
+ var runtimeBrick = React.useMemo( /*#__PURE__*/_asyncToGenerator$4(function* () {
10285
10287
  if (!isBrickAvailable) {
10286
10288
  return null;
10287
10289
  } // If the router state is initial, ignore rendering the sub-brick.
@@ -10322,7 +10324,7 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PU
10322
10324
  listenOnTrackingContext(brick, trackingContextList, runtimeContext);
10323
10325
  return brick;
10324
10326
  }), [useBrick, data, isBrickAvailable]);
10325
- var innerRefCallback = React__default.useCallback( /*#__PURE__*/function () {
10327
+ var innerRefCallback = React.useCallback( /*#__PURE__*/function () {
10326
10328
  var _ref11 = _asyncToGenerator$4(function* (element) {
10327
10329
  brickRef.current = element;
10328
10330
 
@@ -10377,24 +10379,24 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PU
10377
10379
  }
10378
10380
 
10379
10381
  if (template) {
10380
- return /*#__PURE__*/React__default.createElement(template.brick, {
10382
+ return /*#__PURE__*/React.createElement(template.brick, {
10381
10383
  ref: innerRefCallback
10382
10384
  }, ...slotsToChildren(template.slots).map((item, index) => {
10383
- return /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10385
+ return /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
10384
10386
  key: index,
10385
10387
  useBrick: item,
10386
10388
  data: brick.properties
10387
10389
  });
10388
10390
  }));
10389
10391
  } else {
10390
- return /*#__PURE__*/React__default.createElement(useBrick.brick, {
10392
+ return /*#__PURE__*/React.createElement(useBrick.brick, {
10391
10393
  ref: innerRefCallback
10392
10394
  }, ...slotsToChildren(useBrick.slots).map((item, index) => {
10393
10395
  if (useBrick[symbolForTplContextId] && !item[symbolForTplContextId]) {
10394
10396
  item[symbolForTplContextId] = useBrick[symbolForTplContextId];
10395
10397
  }
10396
10398
 
10397
- return /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10399
+ return /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
10398
10400
  key: index,
10399
10401
  useBrick: item,
10400
10402
  data: data
@@ -10454,7 +10456,7 @@ var locale$4 = {
10454
10456
  var TimePicker$1 = locale$4;
10455
10457
 
10456
10458
  var locale$3 = {
10457
- lang: _extends$1({
10459
+ lang: _extends({
10458
10460
  placeholder: '请选择日期',
10459
10461
  yearPlaceholder: '请选择年份',
10460
10462
  quarterPlaceholder: '请选择季度',
@@ -10465,7 +10467,7 @@ var locale$3 = {
10465
10467
  rangeMonthPlaceholder: ['开始月份', '结束月份'],
10466
10468
  rangeWeekPlaceholder: ['开始周', '结束周']
10467
10469
  }, locale$5),
10468
- timePickerLocale: _extends$1({}, TimePicker$1)
10470
+ timePickerLocale: _extends({}, TimePicker$1)
10469
10471
  }; // should add whitespace between char in Button
10470
10472
 
10471
10473
  locale$3.lang.ok = '确 定'; // All settings at:
@@ -10651,7 +10653,7 @@ var locale$1 = {
10651
10653
  var TimePicker = locale$1;
10652
10654
 
10653
10655
  var locale = {
10654
- lang: _extends$1({
10656
+ lang: _extends({
10655
10657
  placeholder: 'Select date',
10656
10658
  yearPlaceholder: 'Select year',
10657
10659
  quarterPlaceholder: 'Select quarter',
@@ -10662,7 +10664,7 @@ var locale = {
10662
10664
  rangeMonthPlaceholder: ['Start month', 'End month'],
10663
10665
  rangeWeekPlaceholder: ['Start week', 'End week']
10664
10666
  }, locale$2),
10665
- timePickerLocale: _extends$1({}, TimePicker)
10667
+ timePickerLocale: _extends({}, TimePicker)
10666
10668
  }; // All settings at:
10667
10669
  // https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
10668
10670
 
@@ -10795,167 +10797,33 @@ var localeValues = {
10795
10797
  };
10796
10798
  var defaultLocale = localeValues;
10797
10799
 
10798
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
10799
-
10800
- var _ref = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
10801
- x1: "5.718%",
10802
- y1: "4.311%",
10803
- x2: "83.05%",
10804
- y2: "88.915%",
10805
- id: "empty-image_svg__a"
10806
- }, /*#__PURE__*/React.createElement("stop", {
10807
- stopColor: "#D4D8E4",
10808
- offset: "0%"
10809
- }), /*#__PURE__*/React.createElement("stop", {
10810
- stopColor: "#A9B0C4",
10811
- offset: "100%"
10812
- })), /*#__PURE__*/React.createElement("linearGradient", {
10813
- x1: "0%",
10814
- y1: "11.08%",
10815
- x2: "80.548%",
10816
- y2: "107.704%",
10817
- id: "empty-image_svg__d"
10818
- }, /*#__PURE__*/React.createElement("stop", {
10819
- stopColor: "#C2C7DA",
10820
- offset: "0%"
10821
- }), /*#__PURE__*/React.createElement("stop", {
10822
- stopColor: "#8F96B3",
10823
- offset: "100%"
10824
- })), /*#__PURE__*/React.createElement("path", {
10825
- d: "M34 36h8a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4h-8a4 4 0 0 1-4-4v-8a4 4 0 0 1 4-4z",
10826
- id: "empty-image_svg__c"
10827
- }), /*#__PURE__*/React.createElement("filter", {
10828
- x: "-37.5%",
10829
- y: "-31.3%",
10830
- width: "187.5%",
10831
- height: "187.5%",
10832
- filterUnits: "objectBoundingBox",
10833
- id: "empty-image_svg__b"
10834
- }, /*#__PURE__*/React.createElement("feOffset", {
10835
- dx: 1,
10836
- dy: 2,
10837
- in: "SourceAlpha",
10838
- result: "shadowOffsetOuter1"
10839
- }), /*#__PURE__*/React.createElement("feGaussianBlur", {
10840
- stdDeviation: 2,
10841
- in: "shadowOffsetOuter1",
10842
- result: "shadowBlurOuter1"
10843
- }), /*#__PURE__*/React.createElement("feComposite", {
10844
- in: "shadowBlurOuter1",
10845
- in2: "SourceAlpha",
10846
- operator: "out",
10847
- result: "shadowBlurOuter1"
10848
- }), /*#__PURE__*/React.createElement("feColorMatrix", {
10849
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.22 0",
10850
- in: "shadowBlurOuter1"
10851
- })), /*#__PURE__*/React.createElement("linearGradient", {
10852
- x1: "41.823%",
10853
- y1: "24.795%",
10854
- x2: "8.813%",
10855
- y2: "86.427%",
10856
- id: "empty-image_svg__g"
10857
- }, /*#__PURE__*/React.createElement("stop", {
10858
- stopColor: "#CCD0DD",
10859
- offset: "0%"
10860
- }), /*#__PURE__*/React.createElement("stop", {
10861
- stopColor: "#9DA3B9",
10862
- offset: "100%"
10863
- })), /*#__PURE__*/React.createElement("path", {
10864
- d: "M59 19a4 4 0 0 1 4 4v7.314L51.686 19H59z",
10865
- id: "empty-image_svg__f"
10866
- }), /*#__PURE__*/React.createElement("filter", {
10867
- x: "-61.9%",
10868
- y: "-79.5%",
10869
- width: "223.7%",
10870
- height: "223.7%",
10871
- filterUnits: "objectBoundingBox",
10872
- id: "empty-image_svg__e"
10873
- }, /*#__PURE__*/React.createElement("feOffset", {
10874
- dy: -2,
10875
- in: "SourceAlpha",
10876
- result: "shadowOffsetOuter1"
10877
- }), /*#__PURE__*/React.createElement("feGaussianBlur", {
10878
- stdDeviation: 2,
10879
- in: "shadowOffsetOuter1",
10880
- result: "shadowBlurOuter1"
10881
- }), /*#__PURE__*/React.createElement("feColorMatrix", {
10882
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0",
10883
- in: "shadowBlurOuter1"
10884
- })));
10885
-
10886
- var _ref2 = /*#__PURE__*/React.createElement("g", {
10887
- fill: "none",
10888
- fillRule: "evenodd"
10889
- }, /*#__PURE__*/React.createElement("path", {
10890
- d: "M61.108 51.8H15.892a2.8 2.8 0 0 0-1.941.782L5.6 60.615V74.2a5.6 5.6 0 0 0 5.6 5.6h54.6a5.6 5.6 0 0 0 5.6-5.6V60.615l-8.35-8.033a2.8 2.8 0 0 0-1.942-.782z",
10891
- fill: "#A6AAC3"
10892
- }), /*#__PURE__*/React.createElement("path", {
10893
- d: "M51.686 19L63 30.314V66.2a2.8 2.8 0 0 1-2.8 2.8H16.8a2.8 2.8 0 0 1-2.8-2.8V25a6 6 0 0 1 6-6h31.686z",
10894
- fill: "url(#empty-image_svg__a)"
10895
- }), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("use", {
10896
- fill: "#000",
10897
- filter: "url(#empty-image_svg__b)",
10898
- xlinkHref: "#empty-image_svg__c"
10899
- }), /*#__PURE__*/React.createElement("path", {
10900
- stroke: "#FFF",
10901
- d: "M42 36.5c.966 0 1.841.392 2.475 1.025A3.489 3.489 0 0 1 45.5 40h0v8c0 .966-.392 1.841-1.025 2.475A3.489 3.489 0 0 1 42 51.5h0-8a3.489 3.489 0 0 1-2.475-1.025A3.489 3.489 0 0 1 30.5 48h0v-8c0-.966.392-1.841 1.025-2.475A3.489 3.489 0 0 1 34 36.5h0z",
10902
- strokeLinejoin: "square",
10903
- fill: "url(#empty-image_svg__d)"
10904
- })), /*#__PURE__*/React.createElement("g", {
10905
- transform: "rotate(180 57.343 24.657)"
10906
- }, /*#__PURE__*/React.createElement("use", {
10907
- fill: "#000",
10908
- filter: "url(#empty-image_svg__e)",
10909
- xlinkHref: "#empty-image_svg__f"
10910
- }), /*#__PURE__*/React.createElement("use", {
10911
- fill: "url(#empty-image_svg__g)",
10912
- xlinkHref: "#empty-image_svg__f"
10913
- })), /*#__PURE__*/React.createElement("path", {
10914
- d: "M82.6 42a.7.7 0 0 1 .7.7v1.399l1.4.001a.7.7 0 0 1 0 1.4l-1.4-.001V46.9a.7.7 0 0 1-1.4 0v-1.401l-1.4.001a.7.7 0 0 1 0-1.4l1.4-.001V42.7a.7.7 0 0 1 .7-.7zM2.1 30.8c.29 0 .525.235.525.525l-.001.874.876.001a.7.7 0 0 1 0 1.4h-.876l.001.875a.525.525 0 1 1-1.05 0l-.001-.875H.7a.7.7 0 0 1 0-1.4l.874-.001.001-.874c0-.29.235-.525.525-.525z",
10915
- fill: "#D6D8E4",
10916
- opacity: 0.3
10917
- }), /*#__PURE__*/React.createElement("path", {
10918
- d: "M8.4 79.8l-.17-.005A2.8 2.8 0 0 1 5.6 77V60.2h12.393l.175-.006c3.802-.04 7.95 5.943 19.61 6.19l.022-.002.022.002c10.856.218 15.009-5.902 19.558-6.175l.227-.009H71.4V77a2.8 2.8 0 0 1-2.63 2.795l-.17.005H8.4z",
10919
- fill: "#D6D8E4"
10920
- }), /*#__PURE__*/React.createElement("path", {
10921
- d: "M21 3.356S24.518 2.509 25.516 0c1.438 2.057 2.18 2.947 3.884 3.338-2.321.692-3.33 1.468-4.123 3.662-.912-2.584-1.741-2.919-4.277-3.644",
10922
- fill: "#D6D8E4",
10923
- opacity: 0.5
10924
- }), /*#__PURE__*/React.createElement("path", {
10925
- d: "M63 10.125S72.382 7.923 75.044 1.4c3.834 5.35 5.81 7.663 10.356 8.68-6.19 1.797-8.878 3.816-10.995 9.52-2.43-6.72-4.643-7.59-11.405-9.475",
10926
- fill: "#D6D8E4",
10927
- opacity: 0.8
10928
- }));
10929
-
10930
- function SvgEmptyImage(props) {
10931
- return /*#__PURE__*/React.createElement("svg", _extends({
10932
- width: 86,
10933
- height: 80,
10934
- viewBox: "0 0 86 80",
10935
- xmlns: "http://www.w3.org/2000/svg",
10936
- xmlnsXlink: "http://www.w3.org/1999/xlink"
10937
- }, props), _ref, _ref2);
10938
- }
10800
+ var emptyImage = "empty-image.397ff6359f4066d8.png";
10939
10801
 
10940
10802
  /**
10941
10803
  * 用于展示空数据的 React 组件。
10942
10804
  */
10943
10805
  function EasyopsEmpty(props) {
10944
- var emptyImage = SvgEmptyImage;
10945
10806
  var illustration = useMemo(() => props.illustration && getIllustration(props.illustration), [props.illustration]);
10946
- var image = props.illustration ? illustration : /*#__PURE__*/React__default.createElement(emptyImage);
10947
- return /*#__PURE__*/React__default.createElement(Empty, {
10807
+ var image = props.illustration ? illustration : getImageUrl(emptyImage);
10808
+ return /*#__PURE__*/React.createElement(Empty, {
10948
10809
  image: image,
10949
10810
  imageStyle: props.imageStyle,
10950
10811
  description: props.description
10951
10812
  });
10952
10813
  }
10814
+
10815
+ function getImageUrl(url) {
10816
+ var _window$CORE_ROOT;
10817
+
10818
+ return "".concat((_window$CORE_ROOT = window.CORE_ROOT) !== null && _window$CORE_ROOT !== void 0 ? _window$CORE_ROOT : "", "assets/").concat(url);
10819
+ }
10953
10820
  /**
10954
10821
  * 调用后获得一个默认的展示空数据的 React 组件。
10955
10822
  */
10956
10823
 
10824
+
10957
10825
  function renderEasyopsEmpty() {
10958
- return /*#__PURE__*/React__default.createElement(EasyopsEmpty, null);
10826
+ return /*#__PURE__*/React.createElement(EasyopsEmpty, null);
10959
10827
  }
10960
10828
 
10961
10829
  var FeatureFlagsContext = /*#__PURE__*/createContext(null);
@@ -11025,7 +10893,7 @@ function useFeatureFlags(name) {
11025
10893
 
11026
10894
  function DisplayByFeatureFlags(props) {
11027
10895
  var featureFlags = useFeatureFlags(props.name);
11028
- return featureFlags.every(flag => !!flag) ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, props.children) : props !== null && props !== void 0 && props.fallback ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, props === null || props === void 0 ? void 0 : props.fallback) : null;
10896
+ return featureFlags.every(flag => !!flag) ? /*#__PURE__*/React.createElement(React.Fragment, null, props.children) : props !== null && props !== void 0 && props.fallback ? /*#__PURE__*/React.createElement(React.Fragment, null, props === null || props === void 0 ? void 0 : props.fallback) : null;
11029
10897
  }
11030
10898
 
11031
10899
  /**
@@ -11035,15 +10903,15 @@ function BrickWrapper(props) {
11035
10903
  var locale = i18next.language && i18next.language.split("-")[0] === "en" ? defaultLocale : zhCN; // istanbul ignore next
11036
10904
 
11037
10905
  var featureFlags = process.env.NODE_ENV === "test" ? {} : getRuntime().getFeatureFlags();
11038
- return /*#__PURE__*/React__default.createElement(ErrorBoundary, null, /*#__PURE__*/React__default.createElement(FeatureFlagsProvider, {
10906
+ return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(FeatureFlagsProvider, {
11039
10907
  value: featureFlags
11040
- }, /*#__PURE__*/React__default.createElement(ConfigProvider, {
10908
+ }, /*#__PURE__*/React.createElement(ConfigProvider, {
11041
10909
  locale: locale,
11042
10910
  autoInsertSpaceInButton: false,
11043
10911
  renderEmpty: () => {
11044
10912
  var _props$wrapperConfig;
11045
10913
 
11046
- return /*#__PURE__*/React__default.createElement(EasyopsEmpty, (_props$wrapperConfig = props.wrapperConfig) === null || _props$wrapperConfig === void 0 ? void 0 : _props$wrapperConfig.empty);
10914
+ return /*#__PURE__*/React.createElement(EasyopsEmpty, (_props$wrapperConfig = props.wrapperConfig) === null || _props$wrapperConfig === void 0 ? void 0 : _props$wrapperConfig.empty);
11047
10915
  }
11048
10916
  }, props.children)));
11049
10917
  }