@next-core/brick-kit 2.106.2 → 2.107.2

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
@@ -3134,6 +3134,12 @@ class Runtime {
3134
3134
  getCurrentRoute() {
3135
3135
  return kernel.currentRoute;
3136
3136
  }
3137
+ /* istanbul ignore next */
3138
+
3139
+
3140
+ getNavConfig() {
3141
+ return kernel.router.getNavConfig();
3142
+ }
3137
3143
 
3138
3144
  getMicroApps() {
3139
3145
  var {
@@ -9657,6 +9663,8 @@ class Router {
9657
9663
 
9658
9664
  _defineProperty$1(this, "featureFlags", void 0);
9659
9665
 
9666
+ _defineProperty$1(this, "navConfig", void 0);
9667
+
9660
9668
  this.kernel = kernel;
9661
9669
  this.featureFlags = this.kernel.getFeatureFlags();
9662
9670
  var history = getHistory();
@@ -9980,33 +9988,37 @@ class Router {
9980
9988
 
9981
9989
  if (barsHidden || getRuntimeMisc().isInIframeOfLegacyConsole) {
9982
9990
  _this3.kernel.toggleBars(false);
9983
- } else if (_this3.kernel.currentLayout === "console") {
9984
- var _menuBar$menu, _menuBar$menu2;
9985
-
9991
+ } else {
9986
9992
  yield constructMenu(menuBar, _this3.locationContext.getCurrentContext(), _this3.kernel);
9987
9993
 
9988
- if (shouldBeDefaultCollapsed((_menuBar$menu = menuBar.menu) === null || _menuBar$menu === void 0 ? void 0 : _menuBar$menu.defaultCollapsed, (_menuBar$menu2 = menuBar.menu) === null || _menuBar$menu2 === void 0 ? void 0 : _menuBar$menu2.defaultCollapsedBreakpoint)) {
9989
- _this3.kernel.menuBar.collapse(true);
9994
+ if (_this3.kernel.currentLayout === "console") {
9995
+ var _menuBar$menu, _menuBar$menu2;
9990
9996
 
9991
- _this3.defaultCollapsed = true;
9992
- } else {
9993
- if (_this3.defaultCollapsed) {
9994
- _this3.kernel.menuBar.collapse(false);
9997
+ if (shouldBeDefaultCollapsed((_menuBar$menu = menuBar.menu) === null || _menuBar$menu === void 0 ? void 0 : _menuBar$menu.defaultCollapsed, (_menuBar$menu2 = menuBar.menu) === null || _menuBar$menu2 === void 0 ? void 0 : _menuBar$menu2.defaultCollapsedBreakpoint)) {
9998
+ _this3.kernel.menuBar.collapse(true);
9999
+
10000
+ _this3.defaultCollapsed = true;
10001
+ } else {
10002
+ if (_this3.defaultCollapsed) {
10003
+ _this3.kernel.menuBar.collapse(false);
10004
+ }
10005
+
10006
+ _this3.defaultCollapsed = false;
9995
10007
  }
9996
10008
 
9997
- _this3.defaultCollapsed = false;
9998
- }
10009
+ if (actualLegacy === "iframe") {
10010
+ // Do not modify breadcrumb in iframe mode,
10011
+ // it will be *popped* from iframe automatically.
10012
+ delete appBar.breadcrumb;
10013
+ }
9999
10014
 
10000
- if (actualLegacy === "iframe") {
10001
- // Do not modify breadcrumb in iframe mode,
10002
- // it will be *popped* from iframe automatically.
10003
- delete appBar.breadcrumb;
10015
+ mountStaticNode(_this3.kernel.menuBar.element, menuBar);
10016
+ mountStaticNode(_this3.kernel.appBar.element, appBar);
10004
10017
  }
10005
-
10006
- mountStaticNode(_this3.kernel.menuBar.element, menuBar);
10007
- mountStaticNode(_this3.kernel.appBar.element, appBar);
10008
10018
  }
10009
10019
 
10020
+ _this3.setNavConfig(mountRoutesResult);
10021
+
10010
10022
  _this3.kernel.toggleLegacyIframe(actualLegacy === "iframe");
10011
10023
 
10012
10024
  menuInBg.forEach(brick => {
@@ -10080,6 +10092,20 @@ class Router {
10080
10092
  devtoolsHookEmit("rendered");
10081
10093
  })();
10082
10094
  }
10095
+
10096
+ setNavConfig(mountResult) {
10097
+ this.navConfig = {
10098
+ breadcrumb: mountResult.appBar.breadcrumb,
10099
+ menu: mountResult.menuBar.menu,
10100
+ subMenu: mountResult.menuBar.subMenu
10101
+ };
10102
+ }
10103
+ /* istanbul ignore next */
10104
+
10105
+
10106
+ getNavConfig() {
10107
+ return this.navConfig;
10108
+ }
10083
10109
  /* istanbul ignore next */
10084
10110
 
10085
10111
 
@@ -12044,7 +12070,7 @@ function EmptySvg(props) {
12044
12070
  y1: "4.31113823%",
12045
12071
  x2: "82.851613%",
12046
12072
  y2: "88.6978534%",
12047
- id: "linearGradient-1"
12073
+ id: createNewId("linearGradient-1")
12048
12074
  }, /*#__PURE__*/React.createElement("stop", {
12049
12075
  stopColor: "#545454",
12050
12076
  offset: "0%"
@@ -12056,7 +12082,7 @@ function EmptySvg(props) {
12056
12082
  y1: "4.31113823%",
12057
12083
  x2: "84.2061777%",
12058
12084
  y2: "88.6978534%",
12059
- id: "linearGradient-2"
12085
+ id: createNewId("linearGradient-2")
12060
12086
  }, /*#__PURE__*/React.createElement("stop", {
12061
12087
  stopColor: "#515151",
12062
12088
  offset: "0%"
@@ -12065,14 +12091,14 @@ function EmptySvg(props) {
12065
12091
  offset: "100%"
12066
12092
  })), /*#__PURE__*/React.createElement("path", {
12067
12093
  d: "M34.9133489,37.0960187 L43.4004684,37.0960187 C45.6096074,37.0960187 47.4004684,38.8868797 47.4004684,41.0960187 L47.4004684,49.5831382 C47.4004684,51.7922772 45.6096074,53.5831382 43.4004684,53.5831382 L34.9133489,53.5831382 C32.7042099,53.5831382 30.9133489,51.7922772 30.9133489,49.5831382 L30.9133489,41.0960187 C30.9133489,38.8868797 32.7042099,37.0960187 34.9133489,37.0960187 Z",
12068
- id: "path-3"
12094
+ id: createNewId("path-3")
12069
12095
  }), /*#__PURE__*/React.createElement("filter", {
12070
12096
  x: "-36.4%",
12071
12097
  y: "-30.3%",
12072
12098
  width: "184.9%",
12073
12099
  height: "184.9%",
12074
12100
  filterUnits: "objectBoundingBox",
12075
- id: "filter-4"
12101
+ id: createNewId("path-4")
12076
12102
  }, /*#__PURE__*/React.createElement("feOffset", {
12077
12103
  dx: "1",
12078
12104
  dy: "2",
@@ -12096,7 +12122,7 @@ function EmptySvg(props) {
12096
12122
  y1: "24.7954546%",
12097
12123
  x2: "8.8126561%",
12098
12124
  y2: "86.4269134%",
12099
- id: "linearGradient-5"
12125
+ id: createNewId("linearGradient-5")
12100
12126
  }, /*#__PURE__*/React.createElement("stop", {
12101
12127
  stopColor: "#676767",
12102
12128
  offset: "0%"
@@ -12105,14 +12131,14 @@ function EmptySvg(props) {
12105
12131
  offset: "100%"
12106
12132
  })), /*#__PURE__*/React.createElement("path", {
12107
12133
  d: "M60.9180328,19.5784543 C63.1271718,19.5784543 64.9180328,21.3693153 64.9180328,23.5784543 L64.9180328,31.2366083 L53.2598788,19.5784543 L60.9180328,19.5784543 Z",
12108
- id: "path-6"
12134
+ id: createNewId("path-6")
12109
12135
  }), /*#__PURE__*/React.createElement("filter", {
12110
12136
  x: "-60.0%",
12111
12137
  y: "-77.2%",
12112
12138
  width: "220.1%",
12113
12139
  height: "220.1%",
12114
12140
  filterUnits: "objectBoundingBox",
12115
- id: "filter-7"
12141
+ id: createNewId("filter-7")
12116
12142
  }, /*#__PURE__*/React.createElement("feOffset", {
12117
12143
  dx: "0",
12118
12144
  dy: "-2",
@@ -12140,25 +12166,25 @@ function EmptySvg(props) {
12140
12166
  transform: "translate(345.000000, 239.000000)"
12141
12167
  }, /*#__PURE__*/React.createElement("path", {
12142
12168
  d: "M63.0027562,53.3770492 L16.3415061,53.3770492 C15.617696,53.3770492 14.9220071,53.6573421 14.4003686,54.1591332 L5.7704918,62.4606569 L5.7704918,62.4606569 L5.7704918,76.6295082 C5.7704918,79.7223028 8.2776972,82.2295082 11.3704918,82.2295082 L67.9737705,82.2295082 C71.0665651,82.2295082 73.5737705,79.7223028 73.5737705,76.6295082 L73.5737705,62.4606569 L73.5737705,62.4606569 L64.9438937,54.1591332 C64.4222552,53.6573421 63.7265663,53.3770492 63.0027562,53.3770492 Z",
12143
- id: "Fill-3",
12169
+ id: createNewId("Fill-3"),
12144
12170
  fill: "#313131"
12145
12171
  }), /*#__PURE__*/React.createElement("path", {
12146
12172
  d: "M53.2598788,19.5784543 L64.9180328,31.2366083 L64.9180328,68.3007026 C64.9180328,69.8470999 63.6644301,71.1007026 62.1180328,71.1007026 L17.2262295,71.1007026 C15.6798322,71.1007026 14.4262295,69.8470999 14.4262295,68.3007026 L14.4262295,25.5784543 C14.4262295,22.2647458 17.112521,19.5784543 20.4262295,19.5784543 L53.2598788,19.5784543 Z",
12147
12173
  id: "\u5F62\u72B6\u7ED3\u5408",
12148
- fill: "url(#linearGradient-1)"
12174
+ fill: "url(#".concat(createNewId("linearGradient-1"), ")")
12149
12175
  }), /*#__PURE__*/React.createElement("g", {
12150
12176
  id: "\u77E9\u5F62\u5907\u4EFD"
12151
12177
  }, /*#__PURE__*/React.createElement("use", {
12152
12178
  fill: "black",
12153
12179
  fillOpacity: "1",
12154
- filter: "url(#filter-4)",
12155
- xlinkHref: "#path-3"
12180
+ filter: "url(#".concat(createNewId("filter-4"), ")"),
12181
+ xlinkHref: "#".concat(createNewId("path-3"))
12156
12182
  }), /*#__PURE__*/React.createElement("path", {
12157
12183
  stroke: "#858585",
12158
12184
  strokeWidth: "1",
12159
12185
  d: "M43.4004684,37.5960187 C44.3669667,37.5960187 45.2419667,37.9877696 45.8753421,38.621145 C46.5087175,39.2545204 46.9004684,40.1295204 46.9004684,41.0960187 L46.9004684,41.0960187 L46.9004684,49.5831382 C46.9004684,50.5496365 46.5087175,51.4246365 45.8753421,52.0580119 C45.2419667,52.6913873 44.3669667,53.0831382 43.4004684,53.0831382 L43.4004684,53.0831382 L34.9133489,53.0831382 C33.9468506,53.0831382 33.0718506,52.6913873 32.4384752,52.0580119 C31.8050998,51.4246365 31.4133489,50.5496365 31.4133489,49.5831382 L31.4133489,49.5831382 L31.4133489,41.0960187 C31.4133489,40.1295204 31.8050998,39.2545204 32.4384752,38.621145 C33.0718506,37.9877696 33.9468506,37.5960187 34.9133489,37.5960187 L34.9133489,37.5960187 Z",
12160
12186
  strokeLinejoin: "round",
12161
- fill: "url(#linearGradient-2)",
12187
+ fill: "url(#".concat(createNewId("linearGradient-2"), ")"),
12162
12188
  fillRule: "evenodd"
12163
12189
  })), /*#__PURE__*/React.createElement("g", {
12164
12190
  id: "\u5F62\u72B6\u7ED3\u5408",
@@ -12166,12 +12192,12 @@ function EmptySvg(props) {
12166
12192
  }, /*#__PURE__*/React.createElement("use", {
12167
12193
  fill: "black",
12168
12194
  fillOpacity: "1",
12169
- filter: "url(#filter-7)",
12170
- xlinkHref: "#path-6"
12195
+ filter: "url(#".concat(createNewId("filter-7"), ")"),
12196
+ xlinkHref: "#".concat(createNewId("path-6"))
12171
12197
  }), /*#__PURE__*/React.createElement("use", {
12172
- fill: "url(#linearGradient-5)",
12198
+ fill: "url(#".concat(createNewId("linearGradient-5"), ")"),
12173
12199
  fillRule: "evenodd",
12174
- xlinkHref: "#path-6"
12200
+ xlinkHref: "#".concat(createNewId("path-6"))
12175
12201
  })), /*#__PURE__*/React.createElement("path", {
12176
12202
  d: "M85.1360656,43.2786885 C85.5226649,43.2786885 85.8360656,43.5920892 85.8360656,43.9786885 L85.8355082,45.4416885 L87.3,45.442623 C87.6865993,45.442623 88,45.7560236 88,46.142623 L88,46.1852459 C88,46.5718452 87.6865993,46.8852459 87.3,46.8852459 L85.8355082,46.8846885 L85.8360656,48.3491803 C85.8360656,48.7357797 85.5226649,49.0491803 85.1360656,49.0491803 L85.0934426,49.0491803 C84.7068433,49.0491803 84.3934426,48.7357797 84.3934426,48.3491803 L84.3925082,46.8846885 L82.9295082,46.8852459 C82.5429089,46.8852459 82.2295082,46.5718452 82.2295082,46.1852459 L82.2295082,46.142623 C82.2295082,45.7560236 82.5429089,45.442623 82.9295082,45.442623 L84.3925082,45.4416885 L84.3934426,43.9786885 C84.3934426,43.5920892 84.7068433,43.2786885 85.0934426,43.2786885 L85.1360656,43.2786885 Z",
12177
12203
  id: "\u5F62\u72B6\u7ED3\u5408",
@@ -12205,7 +12231,7 @@ function EmptySvg(props) {
12205
12231
  y1: "5.98667004%",
12206
12232
  x2: "83.0501817%",
12207
12233
  y2: "88.9150948%",
12208
- id: "linearGradient-1"
12234
+ id: createNewId("linearGradient-1")
12209
12235
  }, /*#__PURE__*/React.createElement("stop", {
12210
12236
  stopColor: "#595959",
12211
12237
  offset: "0%"
@@ -12217,7 +12243,7 @@ function EmptySvg(props) {
12217
12243
  y1: "4.31113823%",
12218
12244
  x2: "84.4129339%",
12219
12245
  y2: "88.9150948%",
12220
- id: "linearGradient-2"
12246
+ id: createNewId("linearGradient-2")
12221
12247
  }, /*#__PURE__*/React.createElement("stop", {
12222
12248
  stopColor: "#646464",
12223
12249
  offset: "0%"
@@ -12226,14 +12252,14 @@ function EmptySvg(props) {
12226
12252
  offset: "100%"
12227
12253
  })), /*#__PURE__*/React.createElement("path", {
12228
12254
  d: "M23.6721311,23.6065574 L26.1639344,23.6065574 C28.3730734,23.6065574 30.1639344,25.3974184 30.1639344,27.6065574 L30.1639344,30.0983607 C30.1639344,32.3074997 28.3730734,34.0983607 26.1639344,34.0983607 L23.6721311,34.0983607 C21.4629921,34.0983607 19.6721311,32.3074997 19.6721311,30.0983607 L19.6721311,27.6065574 C19.6721311,25.3974184 21.4629921,23.6065574 23.6721311,23.6065574 Z",
12229
- id: "path-3"
12255
+ id: createNewId("path-3")
12230
12256
  }), /*#__PURE__*/React.createElement("filter", {
12231
12257
  x: "-57.2%",
12232
12258
  y: "-47.7%",
12233
12259
  width: "233.4%",
12234
12260
  height: "233.4%",
12235
12261
  filterUnits: "objectBoundingBox",
12236
- id: "filter-4"
12262
+ id: createNewId("filter-4")
12237
12263
  }, /*#__PURE__*/React.createElement("feOffset", {
12238
12264
  dx: "1",
12239
12265
  dy: "2",
@@ -12257,7 +12283,7 @@ function EmptySvg(props) {
12257
12283
  y1: "24.7954546%",
12258
12284
  x2: "8.8126561%",
12259
12285
  y2: "86.4269134%",
12260
- id: "linearGradient-5"
12286
+ id: createNewId("linearGradient-5")
12261
12287
  }, /*#__PURE__*/React.createElement("stop", {
12262
12288
  stopColor: "#848484",
12263
12289
  offset: "0%"
@@ -12266,14 +12292,14 @@ function EmptySvg(props) {
12266
12292
  offset: "100%"
12267
12293
  })), /*#__PURE__*/React.createElement("path", {
12268
12294
  d: "M37.3114754,12.4590164 C39.5206144,12.4590164 41.3114754,14.2498774 41.3114754,16.4590164 L41.3114754,19.8778416 L33.8926502,12.4590164 L37.3114754,12.4590164 Z",
12269
- id: "path-6"
12295
+ id: createNewId("path-6")
12270
12296
  }), /*#__PURE__*/React.createElement("filter", {
12271
12297
  x: "-94.4%",
12272
12298
  y: "-121.3%",
12273
12299
  width: "288.7%",
12274
12300
  height: "288.7%",
12275
12301
  filterUnits: "objectBoundingBox",
12276
- id: "filter-7"
12302
+ id: createNewId("filter-7")
12277
12303
  }, /*#__PURE__*/React.createElement("feOffset", {
12278
12304
  dx: "0",
12279
12305
  dy: "-2",
@@ -12304,25 +12330,25 @@ function EmptySvg(props) {
12304
12330
  transform: "translate(147.000000, 183.000000)"
12305
12331
  }, /*#__PURE__*/React.createElement("path", {
12306
12332
  d: "M39.6824378,33.9672131 L10.8093655,33.9672131 C10.0855554,33.9672131 9.38986655,34.247506 8.86822799,34.7492971 L3.67213115,39.7476907 L3.67213115,39.7476907 L3.67213115,46.7278689 C3.67213115,49.8206635 6.17933655,52.3278689 9.27213115,52.3278689 L41.2196721,52.3278689 C44.3124667,52.3278689 46.8196721,49.8206635 46.8196721,46.7278689 L46.8196721,39.7476907 L46.8196721,39.7476907 L41.6235753,34.7492971 C41.1019367,34.247506 40.4062478,33.9672131 39.6824378,33.9672131 Z",
12307
- id: "Fill-3",
12333
+ id: createNewId("Fill-3"),
12308
12334
  fill: "#3E3E3E"
12309
12335
  }), /*#__PURE__*/React.createElement("path", {
12310
12336
  d: "M33.8926502,12.4590164 L41.3114754,19.8778416 L41.3114754,42.4459016 C41.3114754,43.9922989 40.0578727,45.2459016 38.5114754,45.2459016 L11.9803279,45.2459016 C10.4339306,45.2459016 9.18032787,43.9922989 9.18032787,42.4459016 L9.18032787,18.4590164 C9.18032787,15.1453079 11.8666194,12.4590164 15.1803279,12.4590164 L33.8926502,12.4590164 Z",
12311
12337
  id: "\u5F62\u72B6\u7ED3\u5408",
12312
- fill: "url(#linearGradient-1)"
12338
+ fill: "url(#".concat(createNewId("linearGradient-1"), ")")
12313
12339
  }), /*#__PURE__*/React.createElement("g", {
12314
12340
  id: "\u77E9\u5F62\u5907\u4EFD"
12315
12341
  }, /*#__PURE__*/React.createElement("use", {
12316
12342
  fill: "black",
12317
12343
  fillOpacity: "1",
12318
- filter: "url(#filter-4)",
12319
- xlinkHref: "#path-3"
12344
+ filter: "url(#".concat(createNewId("filter-4"), ")"),
12345
+ xlinkHref: "#".concat(createNewId("path-3"))
12320
12346
  }), /*#__PURE__*/React.createElement("path", {
12321
12347
  stroke: "#919191",
12322
12348
  strokeWidth: "1",
12323
12349
  d: "M26.1639344,24.1065574 C27.1304327,24.1065574 28.0054327,24.4983082 28.6388082,25.1316836 C29.2721836,25.7650591 29.6639344,26.6400591 29.6639344,27.6065574 L29.6639344,27.6065574 L29.6639344,30.0983607 C29.6639344,31.064859 29.2721836,31.939859 28.6388082,32.5732344 C28.0054327,33.2066098 27.1304327,33.5983607 26.1639344,33.5983607 L26.1639344,33.5983607 L23.6721311,33.5983607 C22.7056328,33.5983607 21.8306328,33.2066098 21.1972574,32.5732344 C20.563882,31.939859 20.1721311,31.064859 20.1721311,30.0983607 L20.1721311,30.0983607 L20.1721311,27.6065574 C20.1721311,26.6400591 20.563882,25.7650591 21.1972574,25.1316836 C21.8306328,24.4983082 22.7056328,24.1065574 23.6721311,24.1065574 L23.6721311,24.1065574 Z",
12324
12350
  strokeLinejoin: "round",
12325
- fill: "url(#linearGradient-2)",
12351
+ fill: "url(#".concat(createNewId("linearGradient-2"), ")"),
12326
12352
  fillRule: "evenodd"
12327
12353
  })), /*#__PURE__*/React.createElement("g", {
12328
12354
  id: "\u5F62\u72B6\u7ED3\u5408",
@@ -12330,12 +12356,12 @@ function EmptySvg(props) {
12330
12356
  }, /*#__PURE__*/React.createElement("use", {
12331
12357
  fill: "black",
12332
12358
  fillOpacity: "1",
12333
- filter: "url(#filter-7)",
12334
- xlinkHref: "#path-6"
12359
+ filter: "url(#".concat(createNewId("filter-7"), ")"),
12360
+ xlinkHref: "#".concat(createNewId("path-6"))
12335
12361
  }), /*#__PURE__*/React.createElement("use", {
12336
- fill: "url(#linearGradient-5)",
12362
+ fill: "url(#".concat(createNewId("linearGradient-5"), ")"),
12337
12363
  fillRule: "evenodd",
12338
- xlinkHref: "#path-6"
12364
+ xlinkHref: "#".concat(createNewId("path-6"))
12339
12365
  })), /*#__PURE__*/React.createElement("path", {
12340
12366
  d: "M54.1639344,27.5409836 C54.4174422,27.5409836 54.6229508,27.7464922 54.6229508,28 L54.6228689,28.9179836 L55.5409836,28.9180328 C55.7944914,28.9180328 56,29.1235414 56,29.3770492 C56,29.6305569 55.7944914,29.8360656 55.5409836,29.8360656 L54.6228689,29.8359836 L54.6229508,30.7540984 C54.6229508,31.0076061 54.4174422,31.2131148 54.1639344,31.2131148 C53.9104267,31.2131148 53.704918,31.0076061 53.704918,30.7540984 L53.7048689,29.8359836 L52.7868852,29.8360656 C52.5333775,29.8360656 52.3278689,29.6305569 52.3278689,29.3770492 C52.3278689,29.1235414 52.5333775,28.9180328 52.7868852,28.9180328 L53.7048689,28.9179836 L53.704918,28 C53.704918,27.7464922 53.9104267,27.5409836 54.1639344,27.5409836 Z",
12341
12367
  id: "\u5F62\u72B6\u7ED3\u5408",