@next-core/brick-kit 2.84.2 → 2.87.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/dist/index.esm.js CHANGED
@@ -5,7 +5,7 @@ import _asyncToGenerator$4 from '@babel/runtime/helpers/asyncToGenerator';
5
5
  import _defineProperty$2 from '@babel/runtime/helpers/defineProperty';
6
6
  import * as React from 'react';
7
7
  import React__default, { useState, useEffect, forwardRef, useRef, useImperativeHandle, useMemo, useContext, createContext } from 'react';
8
- import lodash, { isEmpty, set, get, difference, cloneDeep, isNil, sortBy, merge, clamp, uniqueId, orderBy, omit } from 'lodash';
8
+ import lodash, { set, get, difference, cloneDeep, isNil, sortBy, merge, clamp, uniqueId, orderBy, omit, isEmpty } from 'lodash';
9
9
  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
10
  import { http, HttpResponseError, HttpFetchError } from '@next-core/brick-http';
11
11
  import i18next from 'i18next';
@@ -211,115 +211,67 @@ function getBasePath() {
211
211
  return basePath;
212
212
  }
213
213
 
214
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
214
+ function compareVersions(v1, v2) {
215
+ // validate input and split into segments
216
+ var n1 = validateAndParse(v1);
217
+ var n2 = validateAndParse(v2); // pop off the patch
215
218
 
216
- var compareVersions$1 = {exports: {}};
219
+ var p1 = n1.pop();
220
+ var p2 = n2.pop(); // validate numbers
217
221
 
218
- /* global define */
222
+ var r = compareSegments(n1, n2);
223
+ if (r !== 0) return r; // validate pre-release
219
224
 
220
- (function (module, exports) {
221
- (function (root, factory) {
222
- /* istanbul ignore next */
223
- {
224
- module.exports = factory();
225
- }
226
- })(commonjsGlobal, function () {
227
- var semver = /^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
228
-
229
- function indexOrEnd(str, q) {
230
- return str.indexOf(q) === -1 ? str.length : str.indexOf(q);
231
- }
232
-
233
- function split(v) {
234
- var c = v.replace(/^v/, '').replace(/\+.*$/, '');
235
- var patchIndex = indexOrEnd(c, '-');
236
- var arr = c.substring(0, patchIndex).split('.');
237
- arr.push(c.substring(patchIndex + 1));
238
- return arr;
239
- }
240
-
241
- function tryParse(v) {
242
- return isNaN(Number(v)) ? v : Number(v);
243
- }
244
-
245
- function validate(version) {
246
- if (typeof version !== 'string') {
247
- throw new TypeError('Invalid argument expected string');
248
- }
249
-
250
- if (!semver.test(version)) {
251
- throw new Error('Invalid argument not valid semver (\'' + version + '\' received)');
252
- }
253
- }
254
-
255
- function compareVersions(v1, v2) {
256
- [v1, v2].forEach(validate);
257
- var s1 = split(v1);
258
- var s2 = split(v2);
259
-
260
- for (var i = 0; i < Math.max(s1.length - 1, s2.length - 1); i++) {
261
- var n1 = parseInt(s1[i] || 0, 10);
262
- var n2 = parseInt(s2[i] || 0, 10);
263
- if (n1 > n2) return 1;
264
- if (n2 > n1) return -1;
265
- }
225
+ if (p1 && p2) {
226
+ return compareSegments(p1.split('.'), p2.split('.'));
227
+ } else if (p1 || p2) {
228
+ return p1 ? -1 : 1;
229
+ }
266
230
 
267
- var sp1 = s1[s1.length - 1];
268
- var sp2 = s2[s2.length - 1];
231
+ return 0;
232
+ }
233
+ var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
269
234
 
270
- if (sp1 && sp2) {
271
- var p1 = sp1.split('.').map(tryParse);
272
- var p2 = sp2.split('.').map(tryParse);
235
+ var validateAndParse = v => {
236
+ if (typeof v !== 'string') {
237
+ throw new TypeError('Invalid argument expected string');
238
+ }
273
239
 
274
- for (i = 0; i < Math.max(p1.length, p2.length); i++) {
275
- if (p1[i] === undefined || typeof p2[i] === 'string' && typeof p1[i] === 'number') return -1;
276
- if (p2[i] === undefined || typeof p1[i] === 'string' && typeof p2[i] === 'number') return 1;
277
- if (p1[i] > p2[i]) return 1;
278
- if (p2[i] > p1[i]) return -1;
279
- }
280
- } else if (sp1 || sp2) {
281
- return sp1 ? -1 : 1;
282
- }
240
+ var match = v.match(semver);
283
241
 
284
- return 0;
285
- }
286
- var allowedOperators = ['>', '>=', '=', '<', '<='];
287
- var operatorResMap = {
288
- '>': [1],
289
- '>=': [0, 1],
290
- '=': [0],
291
- '<=': [-1, 0],
292
- '<': [-1]
293
- };
242
+ if (!match) {
243
+ throw new Error("Invalid argument not valid semver ('".concat(v, "' received)"));
244
+ }
294
245
 
295
- function validateOperator(op) {
296
- if (typeof op !== 'string') {
297
- throw new TypeError('Invalid operator type, expected string but got ' + typeof op);
298
- }
246
+ match.shift();
247
+ return match;
248
+ };
299
249
 
300
- if (allowedOperators.indexOf(op) === -1) {
301
- throw new TypeError('Invalid operator, expected one of ' + allowedOperators.join('|'));
302
- }
303
- }
250
+ var isWildcard = s => s === '*' || s === 'x' || s === 'X';
304
251
 
305
- compareVersions.validate = function (version) {
306
- return typeof version === 'string' && semver.test(version);
307
- };
252
+ var tryParse = v => {
253
+ var n = parseInt(v, 10);
254
+ return isNaN(n) ? v : n;
255
+ };
308
256
 
309
- compareVersions.compare = function (v1, v2, operator) {
310
- // Validate operator
311
- validateOperator(operator); // since result of compareVersions can only be -1 or 0 or 1
312
- // a simple map can be used to replace switch
257
+ var forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];
313
258
 
314
- var res = compareVersions(v1, v2);
315
- return operatorResMap[operator].indexOf(res) > -1;
316
- };
259
+ var compareStrings = (a, b) => {
260
+ if (isWildcard(a) || isWildcard(b)) return 0;
261
+ var [ap, bp] = forceType(tryParse(a), tryParse(b));
262
+ if (ap > bp) return 1;
263
+ if (ap < bp) return -1;
264
+ return 0;
265
+ };
317
266
 
318
- return compareVersions;
319
- });
320
- })(compareVersions$1);
267
+ var compareSegments = (a, b) => {
268
+ for (var i = 0; i < Math.max(a.length, b.length); i++) {
269
+ var r = compareStrings(a[i] || 0, b[i] || 0);
270
+ if (r !== 0) return r;
271
+ }
321
272
 
322
- var compareVersions = compareVersions$1.exports;
273
+ return 0;
274
+ };
323
275
 
324
276
  var brickTemplateRegistry = new Map();
325
277
  function registerBrickTemplate(name, factory) {
@@ -590,7 +542,9 @@ function supplyIndividual(variableName) {
590
542
  return Object.fromEntries(Object.entries(lodash).filter(entry => !shouldOmitInLodash.has(entry[0])));
591
543
 
592
544
  case "moment":
593
- return Object.assign((...args) => moment(...args), Object.fromEntries(Object.entries(moment).filter(entry => !shouldOmitInMoment.has(entry[0]))));
545
+ return Object.assign(function () {
546
+ return moment(...arguments);
547
+ }, Object.fromEntries(Object.entries(moment).filter(entry => !shouldOmitInMoment.has(entry[0]))));
594
548
 
595
549
  case "PIPES":
596
550
  return pipes;
@@ -616,7 +570,13 @@ function supplyIndividual(variableName) {
616
570
  }
617
571
 
618
572
  function delegateMethods(target, methods) {
619
- return Object.fromEntries(methods.map(method => [method, (...args) => target[method].apply(target, args)]));
573
+ return Object.fromEntries(methods.map(method => [method, function () {
574
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
575
+ args[_key] = arguments[_key];
576
+ }
577
+
578
+ return target[method].apply(target, args);
579
+ }]));
620
580
  }
621
581
  /**
622
582
  * Pass `ignoreSlashes` as `true` to encode all tagged expressions
@@ -645,7 +605,11 @@ function delegateMethods(target, methods) {
645
605
 
646
606
 
647
607
  function tagUrlFactory(ignoreSlashes) {
648
- return function (strings, ...partials) {
608
+ return function (strings) {
609
+ for (var _len2 = arguments.length, partials = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
610
+ partials[_key2 - 1] = arguments[_key2];
611
+ }
612
+
649
613
  var result = [];
650
614
  strings.forEach((str, index) => {
651
615
  result.push(str);
@@ -704,23 +668,24 @@ function getUrlBySegueFactory(app, segues) {
704
668
  };
705
669
  }
706
670
 
707
- function getUrlByImageFactory(images) {
708
- return function getUrlByImage(name) {
709
- if (isEmpty(images)) {
710
- // eslint-disable-next-line no-console
711
- console.warn("no images uploaded, please upload image first");
712
- return;
671
+ function imagesFactory(app) {
672
+ return {
673
+ get(name) {
674
+ var _window$PUBLIC_ROOT;
675
+
676
+ return app.isBuildPush ? "api/gateway/object_store.object_store.GetObject/api/v1/objectStore/bucket/next-builder/object/".concat(name) : "".concat((_window$PUBLIC_ROOT = window.PUBLIC_ROOT) !== null && _window$PUBLIC_ROOT !== void 0 ? _window$PUBLIC_ROOT : "", "micro-apps/").concat(app.id, "/images/").concat(name);
713
677
  }
714
678
 
715
- var find = images === null || images === void 0 ? void 0 : images.find(item => item.name === name);
679
+ };
680
+ }
681
+ function widgetImagesFactory(widgetId) {
682
+ return {
683
+ get(name) {
684
+ var _window$PUBLIC_ROOT2;
716
685
 
717
- if (!(find !== null && find !== void 0 && find.url)) {
718
- // eslint-disable-next-line no-console
719
- console.warn("the name of the image was not found:", name);
720
- return;
686
+ return "".concat((_window$PUBLIC_ROOT2 = window.PUBLIC_ROOT) !== null && _window$PUBLIC_ROOT2 !== void 0 ? _window$PUBLIC_ROOT2 : "", "bricks/").concat(widgetId, "/dist/assets/").concat(name);
721
687
  }
722
688
 
723
- return find.url;
724
689
  };
725
690
  }
726
691
 
@@ -761,7 +726,9 @@ function resetAllInjected() {
761
726
  }
762
727
  function cloneDeepWithInjectedMark(value) {
763
728
  if (isObject(value) && !isPreEvaluated(value)) {
764
- var clone = Array.isArray(value) ? value.map(item => cloneDeepWithInjectedMark(item)) : Object.fromEntries(Object.entries(value).map(([k, v]) => {
729
+ var clone = Array.isArray(value) ? value.map(item => cloneDeepWithInjectedMark(item)) : Object.fromEntries(Object.entries(value).map(_ref => {
730
+ var [k, v] = _ref;
731
+
765
732
  /**
766
733
  * object.entries会丢失symbol属性
767
734
  * 对useBrick做特殊处理
@@ -984,7 +951,9 @@ function doTransform(data, to, options) {
984
951
  return to.map(item => doTransform(data, item, nextOptions));
985
952
  }
986
953
 
987
- return Object.fromEntries(Object.entries(to).map(([k, v]) => {
954
+ return Object.fromEntries(Object.entries(to).map(_ref => {
955
+ var [k, v] = _ref;
956
+
988
957
  if (Array.isArray(options === null || options === void 0 ? void 0 : options.trackingContextList) && isEvaluable(v)) {
989
958
  var contextNames = trackContext(v);
990
959
 
@@ -1329,7 +1298,11 @@ function _validatePermissions() {
1329
1298
  return _validatePermissions.apply(this, arguments);
1330
1299
  }
1331
1300
 
1332
- function checkPermissions(...actions) {
1301
+ function checkPermissions() {
1302
+ for (var _len = arguments.length, actions = new Array(_len), _key = 0; _key < _len; _key++) {
1303
+ actions[_key] = arguments[_key];
1304
+ }
1305
+
1333
1306
  for (var action of actions) {
1334
1307
  // Only **exclusively authorized** permissions are ok.
1335
1308
  // Those scenarios below will fail:
@@ -1402,9 +1375,10 @@ function i18nText(data) {
1402
1375
  /** @internal */
1403
1376
 
1404
1377
  /** @internal */
1405
- function StoryboardFunctionRegistryFactory({
1406
- collectCoverage
1407
- } = {}) {
1378
+ function StoryboardFunctionRegistryFactory() {
1379
+ var {
1380
+ collectCoverage
1381
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1408
1382
  var registeredFunctions = new Map(); // Use `Proxy` with a frozen target, to make a readonly function registry.
1409
1383
 
1410
1384
  var storyboardFunctions = new Proxy(Object.freeze({}), {
@@ -1527,10 +1501,12 @@ function getCookErrorConstructor(error) {
1527
1501
  return possibleErrorConstructs.has(error.constructor) ? error.constructor : TypeError;
1528
1502
  } // `raw` should always be asserted to `isEvaluable` or `isPreEvaluated`.
1529
1503
 
1530
- function evaluate(raw, // string or pre-evaluated object.
1531
- runtimeContext = {}, options = {}) {
1504
+ function evaluate(raw) {
1532
1505
  var _runtimeContext$overr;
1533
1506
 
1507
+ var runtimeContext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1508
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1509
+
1534
1510
  if (options.isReEvaluation && !(typeof raw === "string" && isEvaluable(raw))) {
1535
1511
  devtoolsHookEmit("re-evaluation", {
1536
1512
  id: options.evaluationId,
@@ -1620,7 +1596,6 @@ runtimeContext = {}, options = {}) {
1620
1596
  flags,
1621
1597
  hash,
1622
1598
  segues,
1623
- images,
1624
1599
  storyboardContext
1625
1600
  } = _internalApiGetCurrentContext();
1626
1601
 
@@ -1674,10 +1649,12 @@ runtimeContext = {}, options = {}) {
1674
1649
  };
1675
1650
  }
1676
1651
 
1677
- if (attemptToVisitGlobals.has("IMAGES")) {
1678
- globalVariables.IMAGES = {
1679
- getUrl: getUrlByImageFactory(images)
1680
- };
1652
+ if (attemptToVisitGlobals.has("IMG")) {
1653
+ globalVariables.IMG = imagesFactory(app);
1654
+ }
1655
+
1656
+ if (attemptToVisitGlobals.has("__WIDGET_IMG__")) {
1657
+ globalVariables.__WIDGET_IMG__ = widgetImagesFactory;
1681
1658
  }
1682
1659
 
1683
1660
  if (attemptToVisitGlobals.has("I18N")) {
@@ -1689,15 +1666,19 @@ runtimeContext = {}, options = {}) {
1689
1666
  }
1690
1667
 
1691
1668
  if (attemptToVisitGlobals.has("CTX")) {
1692
- globalVariables.CTX = Object.fromEntries(Array.from(storyboardContext.entries()).map(([name, item]) => {
1669
+ globalVariables.CTX = Object.fromEntries(Array.from(storyboardContext.entries()).map(_ref => {
1693
1670
  var _item$brick$element;
1694
1671
 
1672
+ var [name, item] = _ref;
1695
1673
  return [name, item.type === "brick-property" ? (_item$brick$element = item.brick.element) === null || _item$brick$element === void 0 ? void 0 : _item$brick$element[item.prop] : item.value];
1696
1674
  }));
1697
1675
  }
1698
1676
 
1699
1677
  if (attemptToVisitGlobals.has("PROCESSORS")) {
1700
- globalVariables.PROCESSORS = Object.fromEntries(Array.from(customProcessorRegistry.entries()).map(([namespace, registry]) => [namespace, Object.fromEntries(registry.entries())]));
1678
+ globalVariables.PROCESSORS = Object.fromEntries(Array.from(customProcessorRegistry.entries()).map(_ref2 => {
1679
+ var [namespace, registry] = _ref2;
1680
+ return [namespace, Object.fromEntries(registry.entries())];
1681
+ }));
1701
1682
  }
1702
1683
 
1703
1684
  if (attemptToVisitGlobals.has("PERMISSIONS")) {
@@ -1821,7 +1802,10 @@ var computeRealValue = (value, context, injectDeep, internalOptions) => {
1821
1802
  return value.map(v => computeRealValue(v, context, injectDeep, nextOptions));
1822
1803
  }
1823
1804
 
1824
- return Object.fromEntries(Object.entries(value).map(([k, v]) => [computeRealValue(k, context, false), computeRealValue(v, context, injectDeep, getNextInternalOptions(internalOptions, false, k))]));
1805
+ return Object.fromEntries(Object.entries(value).map(_ref => {
1806
+ var [k, v] = _ref;
1807
+ return [computeRealValue(k, context, false), computeRealValue(v, context, injectDeep, getNextInternalOptions(internalOptions, false, k))];
1808
+ }));
1825
1809
  };
1826
1810
  function setProperties(bricks, properties, context, injectDeep) {
1827
1811
  var realProps = computeRealProperties(properties, context, injectDeep);
@@ -2010,7 +1994,7 @@ function _checkIf(rawIf, ctx, fn) {
2010
1994
  return true;
2011
1995
  }
2012
1996
 
2013
- var _excluded$3 = ["children"],
1997
+ var _excluded$4 = ["children"],
2014
1998
  _excluded2$1 = ["items", "app"];
2015
1999
  var symbolAppId = Symbol("appId");
2016
2000
  // Caching menu requests to avoid flicker.
@@ -2222,7 +2206,7 @@ function computeMenuItemsWithOverrideApp(items, context, kernel) {
2222
2206
  var {
2223
2207
  children
2224
2208
  } = _ref,
2225
- rest = _objectWithoutProperties(_ref, _excluded$3);
2209
+ rest = _objectWithoutProperties(_ref, _excluded$4);
2226
2210
 
2227
2211
  return _objectSpread(_objectSpread({}, yield computeRealValueWithOverrideApp(rest, rest[symbolAppId], context, kernel)), {}, {
2228
2212
  children: children && (yield computeMenuItemsWithOverrideApp(children, context, kernel))
@@ -2302,7 +2286,9 @@ var overriddenGlobals = ["APP", "I18N"];
2302
2286
  * we have to override app in context when computing real values.
2303
2287
  */
2304
2288
 
2305
- function requireOverrideApp(data, memo = new WeakSet()) {
2289
+ function requireOverrideApp(data) {
2290
+ var memo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new WeakSet();
2291
+
2306
2292
  if (typeof data === "string") {
2307
2293
  if (isEvaluable(data)) {
2308
2294
  if (overriddenGlobals.some(key => data.includes(key))) {
@@ -2504,10 +2490,11 @@ class Runtime {
2504
2490
  return kernel.currentRoute;
2505
2491
  }
2506
2492
 
2507
- getMicroApps({
2508
- excludeInstalling = false,
2509
- includeInternal = false
2510
- } = {}) {
2493
+ getMicroApps() {
2494
+ var {
2495
+ excludeInstalling = false,
2496
+ includeInternal = false
2497
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2511
2498
  var apps = kernel.bootstrapData.microApps;
2512
2499
 
2513
2500
  if (excludeInstalling) {
@@ -2784,7 +2771,7 @@ function _internalApiLoadDynamicBricksInBrickConf(brickConf) {
2784
2771
  return kernel.loadDynamicBricksInBrickConf(brickConf);
2785
2772
  }
2786
2773
 
2787
- var _excluded$2 = ["extraQuery", "clear", "keepHash"];
2774
+ var _excluded$3 = ["extraQuery", "clear", "keepHash"];
2788
2775
  function historyExtended(browserHistory) {
2789
2776
  var {
2790
2777
  push: originalPush,
@@ -2792,13 +2779,15 @@ function historyExtended(browserHistory) {
2792
2779
  } = browserHistory;
2793
2780
 
2794
2781
  function updateQueryFactory(method) {
2795
- return function updateQuery(query, options = {}) {
2782
+ return function updateQuery(query) {
2783
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2784
+
2796
2785
  var {
2797
2786
  extraQuery,
2798
2787
  clear,
2799
2788
  keepHash
2800
2789
  } = options,
2801
- state = _objectWithoutProperties(options, _excluded$2);
2790
+ state = _objectWithoutProperties(options, _excluded$3);
2802
2791
 
2803
2792
  var urlSearchParams = new URLSearchParams(clear ? "" : browserHistory.location.search);
2804
2793
  var params = {};
@@ -4513,7 +4502,13 @@ class MessageDispatcher {
4513
4502
  }
4514
4503
 
4515
4504
  getTopicByChannel(channel) {
4516
- return [...this.channels.entries()].filter(([, v]) => v === channel).map(([v]) => v)[0];
4505
+ return [...this.channels.entries()].filter(_ref => {
4506
+ var [, v] = _ref;
4507
+ return v === channel;
4508
+ }).map(_ref2 => {
4509
+ var [v] = _ref2;
4510
+ return v;
4511
+ })[0];
4517
4512
  }
4518
4513
 
4519
4514
  send(data) {
@@ -4638,19 +4633,22 @@ class MessageDispatcher {
4638
4633
  }
4639
4634
 
4640
4635
  var timeoutIdList = new Set();
4641
- function startPoll(task, {
4642
- progress,
4643
- success,
4644
- error,
4645
- finally: finallyCallback
4646
- }, {
4647
- interval,
4648
- leadingRequestDelay,
4649
- continueOnError,
4650
- delegateLoadingBar,
4651
- expectPollEnd,
4652
- expectPollStopImmediately
4653
- }) {
4636
+ function startPoll(task, _ref, _ref2) {
4637
+ var {
4638
+ progress,
4639
+ success,
4640
+ error,
4641
+ finally: finallyCallback
4642
+ } = _ref;
4643
+ var {
4644
+ interval,
4645
+ leadingRequestDelay,
4646
+ continueOnError,
4647
+ delegateLoadingBar,
4648
+ expectPollEnd,
4649
+ expectPollStopImmediately
4650
+ } = _ref2;
4651
+
4654
4652
  var currentRenderId = _internalApiGetRouterRenderId();
4655
4653
 
4656
4654
  var currentTimeoutId;
@@ -4780,15 +4778,16 @@ function _getArgsOfCustomApi() {
4780
4778
  return _getArgsOfCustomApi.apply(this, arguments);
4781
4779
  }
4782
4780
 
4783
- function getApiArgsFromApiProfile({
4784
- uri,
4785
- method,
4786
- name,
4787
- namespace,
4788
- responseWrapper,
4789
- version,
4790
- isFileType
4791
- }, originalArgs) {
4781
+ function getApiArgsFromApiProfile(_ref, originalArgs) {
4782
+ var {
4783
+ uri,
4784
+ method,
4785
+ name,
4786
+ namespace,
4787
+ responseWrapper,
4788
+ version,
4789
+ isFileType
4790
+ } = _ref;
4792
4791
  var fileName;
4793
4792
 
4794
4793
  if (isFileType) {
@@ -4894,7 +4893,8 @@ function _fetchFlowApiDefinition2() {
4894
4893
  }
4895
4894
 
4896
4895
  function bindListeners(brick, eventsMap, context) {
4897
- Object.entries(eventsMap).forEach(([eventType, handlers]) => {
4896
+ Object.entries(eventsMap).forEach(_ref => {
4897
+ var [eventType, handlers] = _ref;
4898
4898
  [].concat(handlers).forEach(handler => {
4899
4899
  var listener = listenerFactory(handler, context, {
4900
4900
  element: brick
@@ -5095,7 +5095,7 @@ function listenerFactory(handler, context, runtimeBrick) {
5095
5095
 
5096
5096
  function usingProviderFactory(handler, context, runtimeBrick) {
5097
5097
  return /*#__PURE__*/function () {
5098
- var _ref = _asyncToGenerator$4(function* (event) {
5098
+ var _ref2 = _asyncToGenerator$4(function* (event) {
5099
5099
  if (!looseCheckIf(handler, _objectSpread(_objectSpread({}, context), {}, {
5100
5100
  event
5101
5101
  }))) {
@@ -5113,7 +5113,7 @@ function usingProviderFactory(handler, context, runtimeBrick) {
5113
5113
  });
5114
5114
 
5115
5115
  return function (_x) {
5116
- return _ref.apply(this, arguments);
5116
+ return _ref2.apply(this, arguments);
5117
5117
  };
5118
5118
  }();
5119
5119
  }
@@ -5420,7 +5420,7 @@ function _brickCallback() {
5420
5420
  }
5421
5421
 
5422
5422
  var task = /*#__PURE__*/function () {
5423
- var _ref2 = _asyncToGenerator$4(function* () {
5423
+ var _ref3 = _asyncToGenerator$4(function* () {
5424
5424
  var computedArgs = argsFactory(handler.args, context, event, options);
5425
5425
 
5426
5426
  if (isUseProviderHandler(handler)) {
@@ -5431,7 +5431,7 @@ function _brickCallback() {
5431
5431
  });
5432
5432
 
5433
5433
  return function task() {
5434
- return _ref2.apply(this, arguments);
5434
+ return _ref3.apply(this, arguments);
5435
5435
  };
5436
5436
  }();
5437
5437
 
@@ -5574,7 +5574,8 @@ function builtinWebStorageListenerFactory(storageType, method, args, ifContainer
5574
5574
  };
5575
5575
  }
5576
5576
 
5577
- function argsFactory(args, context, event, options = {}) {
5577
+ function argsFactory(args, context, event) {
5578
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
5578
5579
  return Array.isArray(args) ? computeRealValue(args, _objectSpread(_objectSpread({}, context), {}, {
5579
5580
  event
5580
5581
  }), true) : options.useEventAsDefault ? [event] : options.useEventDetailAsDefault ? [event.detail] : [];
@@ -5884,7 +5885,8 @@ function processBootstrapResponse(bootstrapResponse) {
5884
5885
  // Prefix to avoid conflict between brick package's i18n namespace.
5885
5886
  var ns = "$tmp-".concat(app.id); // Support any languages in `app.locales`.
5886
5887
 
5887
- Object.entries(app.locales).forEach(([lang, resources]) => {
5888
+ Object.entries(app.locales).forEach(_ref => {
5889
+ var [lang, resources] = _ref;
5888
5890
  i18next.addResourceBundle(lang, ns, resources);
5889
5891
  }); // Use `app.name` as the fallback `app.localeName`.
5890
5892
 
@@ -5914,11 +5916,12 @@ function CustomApi(_x, _x2, _x3) {
5914
5916
  }
5915
5917
 
5916
5918
  function _CustomApi() {
5917
- _CustomApi = _asyncToGenerator$4(function* ({
5918
- url,
5919
- method = "GET",
5920
- responseWrapper = true
5921
- }, data, options) {
5919
+ _CustomApi = _asyncToGenerator$4(function* (_ref, data, options) {
5920
+ var {
5921
+ url,
5922
+ method = "GET",
5923
+ responseWrapper = true
5924
+ } = _ref;
5922
5925
  var isSimpleRequest = ["get", "delete", "head"].includes(method.toLowerCase());
5923
5926
 
5924
5927
  if (isSimpleRequest) {
@@ -5958,6 +5961,69 @@ function initAnalytics() {
5958
5961
  }
5959
5962
  }
5960
5963
 
5964
+ var _excluded$2 = ["feature_flags"];
5965
+ function standaloneBootstrap() {
5966
+ return _standaloneBootstrap.apply(this, arguments);
5967
+ }
5968
+
5969
+ function _standaloneBootstrap() {
5970
+ _standaloneBootstrap = _asyncToGenerator$4(function* () {
5971
+ var [bootstrapResult, confString] = yield Promise.all([http.get(window.BOOTSTRAP_FILE), http.get("".concat(window.APP_ROOT, "conf.yaml"), {
5972
+ responseType: "text"
5973
+ })]);
5974
+ var conf;
5975
+
5976
+ try {
5977
+ conf = confString ? yaml.safeLoad(confString, {
5978
+ schema: yaml.JSON_SCHEMA,
5979
+ json: true
5980
+ }) : undefined;
5981
+ } catch (error) {
5982
+ // eslint-disable-next-line no-console
5983
+ console.error("Parse conf.yaml failed", error);
5984
+ throw new Error("Invalid conf.yaml");
5985
+ }
5986
+
5987
+ var settings;
5988
+
5989
+ if (conf) {
5990
+ var {
5991
+ sys_settings,
5992
+ user_config,
5993
+ user_config_by_apps
5994
+ } = conf;
5995
+
5996
+ if (sys_settings) {
5997
+ var {
5998
+ feature_flags: featureFlags
5999
+ } = sys_settings,
6000
+ rest = _objectWithoutProperties(sys_settings, _excluded$2);
6001
+
6002
+ settings = _objectSpread({
6003
+ featureFlags
6004
+ }, rest);
6005
+ }
6006
+
6007
+ if (user_config && bootstrapResult.storyboards.length === 1) {
6008
+ bootstrapResult.storyboards[0].app.userConfig = user_config;
6009
+ } else if (user_config_by_apps) {
6010
+ for (var {
6011
+ app
6012
+ } of bootstrapResult.storyboards) {
6013
+ if (hasOwnProperty(user_config_by_apps, app.id)) {
6014
+ app.userConfig = user_config_by_apps[app.id];
6015
+ }
6016
+ }
6017
+ }
6018
+ }
6019
+
6020
+ return _objectSpread(_objectSpread({}, bootstrapResult), {}, {
6021
+ settings
6022
+ });
6023
+ });
6024
+ return _standaloneBootstrap.apply(this, arguments);
6025
+ }
6026
+
5961
6027
  class Kernel {
5962
6028
  constructor() {
5963
6029
  _defineProperty$2(this, "mountPoints", void 0);
@@ -6002,8 +6068,6 @@ class Kernel {
6002
6068
 
6003
6069
  _defineProperty$2(this, "allMagicBrickConfigMapPromise", Promise.resolve(new Map()));
6004
6070
 
6005
- _defineProperty$2(this, "nextAppMeta", void 0);
6006
-
6007
6071
  _defineProperty$2(this, "allRelatedAppsPromise", Promise.resolve([]));
6008
6072
 
6009
6073
  _defineProperty$2(this, "allMicroAppApiOrchestrationPromise", Promise.resolve(new Map()));
@@ -6128,17 +6192,17 @@ class Kernel {
6128
6192
  var _this3 = this;
6129
6193
 
6130
6194
  return _asyncToGenerator$4(function* () {
6131
- var data = yield window.STANDALONE_MICRO_APPS ? http.get(window.BOOTSTRAP_FILE, {
6132
- interceptorParams
6133
- }) : bootstrap(_objectSpread({
6195
+ var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : bootstrap(_objectSpread({
6134
6196
  brief: true
6135
6197
  }, params), {
6136
6198
  interceptorParams
6137
6199
  });
6138
- var bootstrapResponse = Object.assign({
6200
+
6201
+ var bootstrapResponse = _objectSpread({
6139
6202
  templatePackages: []
6140
6203
  }, data); // Merge `app.defaultConfig` and `app.userConfig` to `app.config`.
6141
6204
 
6205
+
6142
6206
  processBootstrapResponse(bootstrapResponse);
6143
6207
  _this3.bootstrapData = _objectSpread(_objectSpread({}, bootstrapResponse), {}, {
6144
6208
  microApps: bootstrapResponse.storyboards.map(storyboard => storyboard.app).filter(Boolean)
@@ -6195,7 +6259,8 @@ class Kernel {
6195
6259
  // Prefix to avoid conflict between brick package's i18n namespace.
6196
6260
  var i18nNamespace = "$app-".concat(storyboard.app.id); // Support any language in `meta.i18n`.
6197
6261
 
6198
- Object.entries(storyboard.meta.i18n).forEach(([lang, resources]) => {
6262
+ Object.entries(storyboard.meta.i18n).forEach(_ref => {
6263
+ var [lang, resources] = _ref;
6199
6264
  i18next.addResourceBundle(lang, i18nNamespace, resources);
6200
6265
  });
6201
6266
  }
@@ -6341,10 +6406,11 @@ class Kernel {
6341
6406
  */
6342
6407
 
6343
6408
 
6344
- unsetBars({
6345
- appChanged,
6346
- legacy
6347
- } = {}) {
6409
+ unsetBars() {
6410
+ var {
6411
+ appChanged,
6412
+ legacy
6413
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6348
6414
  this.toggleBars(true);
6349
6415
 
6350
6416
  if (this.currentLayout !== "console") {
@@ -6669,10 +6735,10 @@ function loadScriptOfBricksOrTemplates(src) {
6669
6735
  }
6670
6736
 
6671
6737
  /*! (c) Andrea Giammarchi - ISC */
6672
- var self$1 = {};
6738
+ var self = {};
6673
6739
 
6674
6740
  try {
6675
- self$1.EventTarget = new EventTarget().constructor;
6741
+ self.EventTarget = new EventTarget().constructor;
6676
6742
  } catch (EventTarget) {
6677
6743
  (function (Object, wm) {
6678
6744
  var create = Object.create;
@@ -6713,7 +6779,7 @@ try {
6713
6779
  }
6714
6780
  }
6715
6781
  });
6716
- self$1.EventTarget = EventTarget;
6782
+ self.EventTarget = EventTarget;
6717
6783
 
6718
6784
  function EventTarget() {
6719
6785
 
@@ -6737,7 +6803,7 @@ try {
6737
6803
  })(Object, new WeakMap());
6738
6804
  }
6739
6805
 
6740
- var EventTarget$1 = self$1.EventTarget;
6806
+ var EventTarget$1 = self.EventTarget;
6741
6807
 
6742
6808
  /** @internal */
6743
6809
 
@@ -6916,7 +6982,9 @@ function getSubStoryboardByRoute(storyboard, matcher) {
6916
6982
  function getSubBrick(brickConf) {
6917
6983
  if (isObject(brickConf.slots)) {
6918
6984
  return _objectSpread(_objectSpread({}, brickConf), {}, {
6919
- slots: Object.fromEntries(Object.entries(brickConf.slots).map(([slotId, slotConf]) => {
6985
+ slots: Object.fromEntries(Object.entries(brickConf.slots).map(_ref => {
6986
+ var [slotId, slotConf] = _ref;
6987
+
6920
6988
  if (slotConf.type === "routes") {
6921
6989
  return [slotId, _objectSpread(_objectSpread({}, slotConf), {}, {
6922
6990
  routes: getSubRoutes(slotConf.routes)
@@ -7007,13 +7075,14 @@ function propertyMergeAll(mergeBase, object) {
7007
7075
  throw new TypeError("unsupported mergeType: \"".concat(mergeBase.mergeType, "\""));
7008
7076
  }
7009
7077
 
7010
- function propertyMergeAllOfArray({
7011
- baseValue,
7012
- context,
7013
- proxies
7014
- }, object) {
7078
+ function propertyMergeAllOfArray(_ref, object) {
7015
7079
  var _, _proxy$mergeArgs;
7016
7080
 
7081
+ var {
7082
+ baseValue,
7083
+ context,
7084
+ proxies
7085
+ } = _ref;
7017
7086
  // Use an approach like template-literal's quasis:
7018
7087
  // `quasi0${0}quais1${1}quasi2...`
7019
7088
  // Every quasi can be merged with multiple items.
@@ -7066,11 +7135,12 @@ function propertyMergeAllOfArray({
7066
7135
  return quasis.flatMap((item, index) => index < computedBaseValue.length ? item.concat(computedBaseValue[index]) : item);
7067
7136
  }
7068
7137
 
7069
- function propertyMergeAllOfObject({
7070
- baseValue,
7071
- proxies,
7072
- context
7073
- }, object) {
7138
+ function propertyMergeAllOfObject(_ref2, object) {
7139
+ var {
7140
+ baseValue,
7141
+ proxies,
7142
+ context
7143
+ } = _ref2;
7074
7144
  var computedBaseValue = isObject(baseValue) ? computeRealValue(baseValue, context, true) : {};
7075
7145
  return proxies.reduce((acc, proxy) => {
7076
7146
  switch (proxy.mergeMethod) {
@@ -7269,9 +7339,10 @@ function expandBrickInTemplate(brickConfInTemplate, proxyContext) {
7269
7339
  parentTemplate = proxyContext.proxyBrick;
7270
7340
  }
7271
7341
 
7272
- var slots = Object.fromEntries(Object.entries(slotsInTemplate !== null && slotsInTemplate !== void 0 ? slotsInTemplate : {}).map(([slotName, slotConf]) => {
7342
+ var slots = Object.fromEntries(Object.entries(slotsInTemplate !== null && slotsInTemplate !== void 0 ? slotsInTemplate : {}).map(_ref => {
7273
7343
  var _slotConf$bricks;
7274
7344
 
7345
+ var [slotName, slotConf] = _ref;
7275
7346
  return [slotName, {
7276
7347
  type: "bricks",
7277
7348
  bricks: ((_slotConf$bricks = slotConf.bricks) !== null && _slotConf$bricks !== void 0 ? _slotConf$bricks : []).map(item => expandBrickInTemplate(item, proxyContext))
@@ -7280,7 +7351,9 @@ function expandBrickInTemplate(brickConfInTemplate, proxyContext) {
7280
7351
 
7281
7352
  var walkUseBrickInProperties = properties => {
7282
7353
  if (!properties) return;
7283
- Object.entries(properties).forEach(([key, value]) => {
7354
+ Object.entries(properties).forEach(_ref2 => {
7355
+ var [key, value] = _ref2;
7356
+
7284
7357
  if (isObject(value)) {
7285
7358
  if (key === "useBrick") {
7286
7359
  if (Array.isArray(value)) {
@@ -7326,7 +7399,10 @@ function expandBrickInTemplate(brickConfInTemplate, proxyContext) {
7326
7399
 
7327
7400
 
7328
7401
  if (reversedProxies.mergeBases.has(ref)) {
7329
- Object.assign(computedPropsFromProxy, Object.fromEntries(Array.from(reversedProxies.mergeBases.get(ref).entries()).map(([mergeProperty, mergeBase]) => [mergeProperty, propertyMergeAll(mergeBase, templateProperties !== null && templateProperties !== void 0 ? templateProperties : {})]).filter(item => item[1] !== undefined)));
7402
+ Object.assign(computedPropsFromProxy, Object.fromEntries(Array.from(reversedProxies.mergeBases.get(ref).entries()).map(_ref3 => {
7403
+ var [mergeProperty, mergeBase] = _ref3;
7404
+ return [mergeProperty, propertyMergeAll(mergeBase, templateProperties !== null && templateProperties !== void 0 ? templateProperties : {})];
7405
+ }).filter(item => item[1] !== undefined)));
7330
7406
  } // Use an approach like template-literal's quasis:
7331
7407
  // `quasi0${0}quais1${1}quasi2...`
7332
7408
  // Every quasi (indexed by `refPosition`) can be slotted with multiple bricks.
@@ -7534,7 +7610,9 @@ function handleProxyOfCustomTemplate(brick) {
7534
7610
 
7535
7611
 
7536
7612
  if (refElement.$$proxyEvents) {
7537
- refElement.$$proxyEvents = refElement.$$proxyEvents.filter(([proxyEvent, event, listener]) => {
7613
+ refElement.$$proxyEvents = refElement.$$proxyEvents.filter(_ref => {
7614
+ var [proxyEvent, event, listener] = _ref;
7615
+
7538
7616
  if (proxyEvent === eventType) {
7539
7617
  refElement.removeEventListener(event, listener);
7540
7618
  return false;
@@ -7563,8 +7641,8 @@ function handleProxyOfCustomTemplate(brick) {
7563
7641
 
7564
7642
  if (refElement) {
7565
7643
  Object.defineProperty(node, method, {
7566
- value: function (...args) {
7567
- return refElement[methodRef.refMethod](...args);
7644
+ value: function () {
7645
+ return refElement[methodRef.refMethod](...arguments);
7568
7646
  }
7569
7647
  });
7570
7648
  }
@@ -7738,19 +7816,17 @@ class LocationContext {
7738
7816
  this.messageDispatcher = getMessageDispatcher();
7739
7817
  }
7740
7818
 
7741
- getContext({
7742
- match,
7743
- tplContextId
7744
- }) {
7745
- var _this$kernel$nextAppM;
7746
-
7819
+ getContext(_ref) {
7820
+ var {
7821
+ match,
7822
+ tplContextId
7823
+ } = _ref;
7747
7824
  var auth = getAuth();
7748
7825
  var context = {
7749
7826
  hash: this.location.hash,
7750
7827
  query: this.query,
7751
7828
  match,
7752
7829
  app: this.kernel.nextApp,
7753
- images: (_this$kernel$nextAppM = this.kernel.nextAppMeta) === null || _this$kernel$nextAppM === void 0 ? void 0 : _this$kernel$nextAppM.images,
7754
7830
  sys: _objectSpread({
7755
7831
  org: auth.org,
7756
7832
  username: auth.username,
@@ -8092,6 +8168,8 @@ class LocationContext {
8092
8168
  } else {
8093
8169
  mountRoutesResult.appBar.breadcrumb = [...mountRoutesResult.appBar.breadcrumb, ...breadcrumb.items];
8094
8170
  }
8171
+
8172
+ if (hasOwnProperty(breadcrumb, "noCurrentApp")) mountRoutesResult.appBar.noCurrentApp = breadcrumb.noCurrentApp;
8095
8173
  }
8096
8174
  })();
8097
8175
  }
@@ -8171,12 +8249,14 @@ class LocationContext {
8171
8249
  })();
8172
8250
  }
8173
8251
 
8174
- mountBrick(brickConf, match, slotId, mountRoutesResult, tplStack = []) {
8175
- var _this8 = this;
8252
+ mountBrick(brickConf, match, slotId, mountRoutesResult) {
8253
+ var _arguments = arguments,
8254
+ _this8 = this;
8176
8255
 
8177
8256
  return _asyncToGenerator$4(function* () {
8178
8257
  var _this8$kernel$nextApp;
8179
8258
 
8259
+ var tplStack = _arguments.length > 4 && _arguments[4] !== undefined ? _arguments[4] : [];
8180
8260
  var tplContextId = brickConf[symbolForTplContextId];
8181
8261
 
8182
8262
  var context = _this8.getContext({
@@ -8231,7 +8311,8 @@ class LocationContext {
8231
8311
  });
8232
8312
 
8233
8313
  if (brickConf[symbolForComputedPropsFromProxy]) {
8234
- Object.entries(brickConf[symbolForComputedPropsFromProxy]).forEach(([propName, propValue]) => {
8314
+ Object.entries(brickConf[symbolForComputedPropsFromProxy]).forEach(_ref2 => {
8315
+ var [propName, propValue] = _ref2;
8235
8316
  set(brick.properties, propName, propValue);
8236
8317
  });
8237
8318
  }
@@ -8260,8 +8341,11 @@ class LocationContext {
8260
8341
 
8261
8342
  var useBrickList = [];
8262
8343
 
8263
- var walkUseBrickInProperties = (properties = {}) => {
8264
- Object.entries(properties).forEach(([key, value]) => {
8344
+ var walkUseBrickInProperties = function () {
8345
+ var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8346
+ Object.entries(properties).forEach(_ref3 => {
8347
+ var [key, value] = _ref3;
8348
+
8265
8349
  // 在测试环境发现有人写成 useBrick: true, 故做了一个兼容处理, 防止报错
8266
8350
  if (key === "useBrick" && isObject(value)) {
8267
8351
  useBrickList.push(value);
@@ -8564,11 +8648,13 @@ function makeProviderRefreshable(providerBrick) {
8564
8648
  // },
8565
8649
  $refresh: {
8566
8650
  value: function () {
8567
- var _ref = _asyncToGenerator$4(function* ({
8568
- ignoreErrors,
8569
- throwErrors,
8570
- $$scheduled
8571
- } = {}) {
8651
+ var _ref = _asyncToGenerator$4(function* () {
8652
+ var {
8653
+ ignoreErrors,
8654
+ throwErrors,
8655
+ $$scheduled
8656
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8657
+
8572
8658
  if ($$scheduled && providerBrick[keyOfIntervalStopped]) {
8573
8659
  return;
8574
8660
  }
@@ -8577,20 +8663,21 @@ function makeProviderRefreshable(providerBrick) {
8577
8663
 
8578
8664
  try {
8579
8665
  yield Promise.all(this.$$dependents.map( /*#__PURE__*/function () {
8580
- var _ref2 = _asyncToGenerator$4(function* ({
8581
- brick,
8582
- method,
8583
- args,
8584
- field,
8585
- transform,
8586
- transformFrom,
8587
- transformMapArray,
8588
- onReject,
8589
- ref,
8590
- intermediateTransform,
8591
- intermediateTransformFrom,
8592
- intermediateTransformMapArray
8593
- }) {
8666
+ var _ref3 = _asyncToGenerator$4(function* (_ref2) {
8667
+ var {
8668
+ brick,
8669
+ method,
8670
+ args,
8671
+ field,
8672
+ transform,
8673
+ transformFrom,
8674
+ transformMapArray,
8675
+ onReject,
8676
+ ref,
8677
+ intermediateTransform,
8678
+ intermediateTransformFrom,
8679
+ intermediateTransformMapArray
8680
+ } = _ref2;
8594
8681
  var cacheKey = JSON.stringify({
8595
8682
  method,
8596
8683
  args
@@ -8646,7 +8733,7 @@ function makeProviderRefreshable(providerBrick) {
8646
8733
  });
8647
8734
 
8648
8735
  return function (_x) {
8649
- return _ref2.apply(this, arguments);
8736
+ return _ref3.apply(this, arguments);
8650
8737
  };
8651
8738
  }()));
8652
8739
  } catch (error) {
@@ -9161,7 +9248,6 @@ class Router {
9161
9248
  var appChanged = previousApp && currentApp ? previousApp.id !== currentApp.id : previousApp !== currentApp;
9162
9249
  var legacy = currentApp ? currentApp.legacy : undefined;
9163
9250
  _this3.kernel.nextApp = currentApp;
9164
- _this3.kernel.nextAppMeta = storyboard === null || storyboard === void 0 ? void 0 : storyboard.meta;
9165
9251
  var layoutType = (currentApp === null || currentApp === void 0 ? void 0 : currentApp.layoutType) || "console";
9166
9252
  devtoolsHookEmit("rendering");
9167
9253
  unmountTree(mountPoints.bg);
@@ -9843,10 +9929,15 @@ var handleProxyOfParentTemplate = (brick, tplContextId, tplContext) => {
9843
9929
  var proxyBrick = tplBrick.proxyRefs.get(brick.ref);
9844
9930
 
9845
9931
  if (proxyBrick) {
9846
- var getFilterProxy = (proxy = {}, ref) => {
9932
+ var getFilterProxy = function () {
9933
+ var proxy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9934
+ var ref = arguments.length > 1 ? arguments[1] : undefined;
9935
+
9847
9936
  var getFilterByRef = (obj, ref) => {
9848
9937
  if (!obj) return;
9849
- return Object.fromEntries(Object.entries(obj).filter(([k, v]) => {
9938
+ return Object.fromEntries(Object.entries(obj).filter(_ref => {
9939
+ var [k, v] = _ref;
9940
+
9850
9941
  if (v.ref === ref) {
9851
9942
  return [k, v];
9852
9943
  }
@@ -9903,13 +9994,15 @@ var handleProxyOfParentTemplate = (brick, tplContextId, tplContext) => {
9903
9994
  * @param props - 属性。
9904
9995
  */
9905
9996
 
9906
- var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBrickAsComponent({
9907
- useBrick,
9908
- data,
9909
- parentRefForUseBrickInPortal,
9910
- refCallback,
9911
- immediatelyRefCallback
9912
- }) {
9997
+ var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBrickAsComponent(_ref2) {
9998
+ var {
9999
+ useBrick,
10000
+ data,
10001
+ parentRefForUseBrickInPortal,
10002
+ refCallback,
10003
+ immediatelyRefCallback
10004
+ } = _ref2;
10005
+
9913
10006
  var tplContext = _internalApiGetTplContext();
9914
10007
 
9915
10008
  var template;
@@ -9948,7 +10041,8 @@ var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBri
9948
10041
  }); // 设置 properties refProperty值
9949
10042
 
9950
10043
  if (useBrick[symbolForComputedPropsFromProxy]) {
9951
- Object.entries(useBrick[symbolForComputedPropsFromProxy]).forEach(([propName, propValue]) => {
10044
+ Object.entries(useBrick[symbolForComputedPropsFromProxy]).forEach(_ref4 => {
10045
+ var [propName, propValue] = _ref4;
9952
10046
  set(brick.properties, propName, propValue);
9953
10047
  });
9954
10048
  }
@@ -9967,7 +10061,7 @@ var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBri
9967
10061
  return brick;
9968
10062
  }), [useBrick, data, isBrickAvailable]);
9969
10063
  var innerRefCallback = React__default.useCallback( /*#__PURE__*/function () {
9970
- var _ref2 = _asyncToGenerator$4(function* (element) {
10064
+ var _ref5 = _asyncToGenerator$4(function* (element) {
9971
10065
  immediatelyRefCallback === null || immediatelyRefCallback === void 0 ? void 0 : immediatelyRefCallback(element);
9972
10066
 
9973
10067
  if (element) {
@@ -10012,7 +10106,7 @@ var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBri
10012
10106
  });
10013
10107
 
10014
10108
  return function (_x) {
10015
- return _ref2.apply(this, arguments);
10109
+ return _ref5.apply(this, arguments);
10016
10110
  };
10017
10111
  }(), [runtimeBrick, useBrick, data, refCallback, immediatelyRefCallback, parentRefForUseBrickInPortal]);
10018
10112
 
@@ -10066,11 +10160,13 @@ var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBri
10066
10160
  * @param props - 属性。
10067
10161
  */
10068
10162
 
10069
- function BrickAsComponent({
10070
- useBrick,
10071
- data,
10072
- parentRefForUseBrickInPortal
10073
- }) {
10163
+ function BrickAsComponent(_ref6) {
10164
+ var {
10165
+ useBrick,
10166
+ data,
10167
+ parentRefForUseBrickInPortal
10168
+ } = _ref6;
10169
+
10074
10170
  if (Array.isArray(useBrick)) {
10075
10171
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, useBrick.map((item, index) => /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10076
10172
  key: index,
@@ -10092,11 +10188,14 @@ function slotsToChildren(slots) {
10092
10188
  return [];
10093
10189
  }
10094
10190
 
10095
- return Object.entries(slots).flatMap(([slot, slotConf]) => Array.isArray(slotConf.bricks) ? slotConf.bricks.map(child => _objectSpread(_objectSpread({}, child), {}, {
10096
- properties: _objectSpread(_objectSpread({}, child.properties), {}, {
10097
- slot
10098
- })
10099
- })) : []);
10191
+ return Object.entries(slots).flatMap(_ref7 => {
10192
+ var [slot, slotConf] = _ref7;
10193
+ return Array.isArray(slotConf.bricks) ? slotConf.bricks.map(child => _objectSpread(_objectSpread({}, child), {}, {
10194
+ properties: _objectSpread(_objectSpread({}, child.properties), {}, {
10195
+ slot
10196
+ })
10197
+ })) : [];
10198
+ });
10100
10199
  }
10101
10200
 
10102
10201
  function transformEvents(data, events) {
@@ -10110,12 +10209,13 @@ function transformEvents(data, events) {
10110
10209
  // eslint-disable-next-line react/display-name
10111
10210
 
10112
10211
 
10113
- var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PURE__*/forwardRef(function LegacySingleBrickAsComponent({
10114
- useBrick,
10115
- data,
10116
- parentRefForUseBrickInPortal,
10117
- refCallback
10118
- }, ref) {
10212
+ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PURE__*/forwardRef(function LegacySingleBrickAsComponent(_ref8, ref) {
10213
+ var {
10214
+ useBrick,
10215
+ data,
10216
+ parentRefForUseBrickInPortal,
10217
+ refCallback
10218
+ } = _ref8;
10119
10219
  var brickRef = useRef();
10120
10220
 
10121
10221
  var tplContext = _internalApiGetTplContext();
@@ -10160,7 +10260,8 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PU
10160
10260
  }); // 设置 properties refProperty值
10161
10261
 
10162
10262
  if (useBrick[symbolForComputedPropsFromProxy]) {
10163
- Object.entries(useBrick[symbolForComputedPropsFromProxy]).forEach(([propName, propValue]) => {
10263
+ Object.entries(useBrick[symbolForComputedPropsFromProxy]).forEach(_ref10 => {
10264
+ var [propName, propValue] = _ref10;
10164
10265
  set(brick.properties, propName, propValue);
10165
10266
  });
10166
10267
  }
@@ -10180,7 +10281,7 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PU
10180
10281
  return brick;
10181
10282
  }), [useBrick, data, isBrickAvailable]);
10182
10283
  var innerRefCallback = React__default.useCallback( /*#__PURE__*/function () {
10183
- var _ref4 = _asyncToGenerator$4(function* (element) {
10284
+ var _ref11 = _asyncToGenerator$4(function* (element) {
10184
10285
  brickRef.current = element;
10185
10286
 
10186
10287
  if (element) {
@@ -10225,7 +10326,7 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PU
10225
10326
  });
10226
10327
 
10227
10328
  return function (_x2) {
10228
- return _ref4.apply(this, arguments);
10329
+ return _ref11.apply(this, arguments);
10229
10330
  };
10230
10331
  }(), [runtimeBrick, useBrick, data, refCallback, parentRefForUseBrickInPortal]);
10231
10332
 
@@ -10943,8 +11044,8 @@ function attributeNameForProperty(name, options) {
10943
11044
  * ```
10944
11045
  */
10945
11046
  class UpdatingElement extends HTMLElement {
10946
- constructor(...args) {
10947
- super(...args);
11047
+ constructor() {
11048
+ super(...arguments);
10948
11049
 
10949
11050
  _defineProperty$2(this, "_hasRequestedRender", false);
10950
11051
  }
@@ -11171,8 +11272,8 @@ _defineProperty$2(UpdatingElement, "__dev_only_definedEvents", new Set());
11171
11272
 
11172
11273
  var ModalElement = _decorate(null, function (_initialize, _UpdatingElement) {
11173
11274
  class ModalElement extends _UpdatingElement {
11174
- constructor(...args) {
11175
- super(...args);
11275
+ constructor() {
11276
+ super(...arguments);
11176
11277
 
11177
11278
  _initialize(this);
11178
11279
  }