@next-core/brick-kit 2.136.2 → 2.137.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
@@ -6055,13 +6055,25 @@ var ContractApi_searchSingleContract = /*#__PURE__*/function () {
6055
6055
  }();
6056
6056
 
6057
6057
  var contractsMap = new Map();
6058
- function collectContract(contracts) {
6058
+ var widgetContractMap = new Map();
6059
+
6060
+ var addContract = (contracts, map) => {
6059
6061
  contracts === null || contracts === void 0 ? void 0 : contracts.forEach(contract => {
6060
- contractsMap.set("".concat(contract.namespaceId, ".").concat(contract.name), contract);
6062
+ map.set("".concat(contract.namespaceId, ".").concat(contract.name), contract);
6061
6063
  });
6064
+ };
6065
+
6066
+ function collectContract(contracts) {
6067
+ addContract(contracts, contractsMap);
6068
+ }
6069
+ function collectWidgetContract(contracts) {
6070
+ addContract(contracts, widgetContractMap);
6071
+ }
6072
+ function clearCollectWidgetContract() {
6073
+ widgetContractMap.clear();
6062
6074
  }
6063
6075
  function getContract(name) {
6064
- return contractsMap.get(name);
6076
+ return contractsMap.get(name) || widgetContractMap.get(name);
6065
6077
  }
6066
6078
 
6067
6079
  var flowApiDefinitionPromiseMap = new Map(); // Legacy Custom API: `${namespace}@${name}`
@@ -8406,7 +8418,8 @@ function lowLevelExpandCustomTemplate(template, brickConf, proxyBrick, context,
8406
8418
  var {
8407
8419
  bricks,
8408
8420
  proxy,
8409
- state
8421
+ state,
8422
+ contracts
8410
8423
  } = template;
8411
8424
 
8412
8425
  var {
@@ -8422,6 +8435,11 @@ function lowLevelExpandCustomTemplate(template, brickConf, proxyBrick, context,
8422
8435
  proxyBrick.proxy = proxyCopy;
8423
8436
  proxyBrick.proxyRefs = new Map();
8424
8437
  proxyBrick.stateNames = state === null || state === void 0 ? void 0 : state.map(item => item.name);
8438
+
8439
+ if (contracts) {
8440
+ collectWidgetContract(contracts);
8441
+ }
8442
+
8425
8443
  var refToBrickConf = collectRefsInTemplate(template); // Reversed proxies are used for expand storyboard before rendering page.
8426
8444
 
8427
8445
  var reversedProxies = {
@@ -11926,6 +11944,7 @@ class Router {
11926
11944
  _this3.renderId = uniqueId("render-id-");
11927
11945
  resetAllInjected();
11928
11946
  clearPollTimeout();
11947
+ clearCollectWidgetContract();
11929
11948
 
11930
11949
  if (_this3.locationContext) {
11931
11950
  _this3.locationContext.resolver.resetRefreshQueue();