@next-core/brick-kit 2.104.4 → 2.104.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.104.5](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.104.4...@next-core/brick-kit@2.104.5) (2022-02-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * fix re-render of useBrick of tpl ([7cbd0d8](https://github.com/easyops-cn/next-core/commit/7cbd0d83517afdb1eef9fafb5e803655f3e698b9))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.104.4](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.104.3...@next-core/brick-kit@2.104.4) (2022-02-15)
7
18
 
8
19
 
@@ -10519,7 +10519,7 @@
10519
10519
  return false;
10520
10520
  }
10521
10521
 
10522
- function handleProxyOfCustomTemplate(brick, reRun) {
10522
+ function handleProxyOfCustomTemplate(brick) {
10523
10523
  // Ignore non-tpl bricks.
10524
10524
  if (!brick.proxyRefs) {
10525
10525
  return;
@@ -10533,17 +10533,18 @@
10533
10533
 
10534
10534
  return (_brick$proxyRefs$get$ = brick.proxyRefs.get(ref).brick) === null || _brick$proxyRefs$get$ === void 0 ? void 0 : _brick$proxyRefs$get$.element;
10535
10535
  }
10536
- } // For usages of `targetRef: "..."`.
10537
- // `tpl.$$getElementByRef(ref)` will return the ref element inside a custom template.
10536
+ }
10538
10537
 
10538
+ var firstRun = !node.$$getElementByRef; // For usages of `targetRef: "..."`.
10539
+ // `tpl.$$getElementByRef(ref)` will return the ref element inside a custom template.
10539
10540
 
10540
- if (!reRun) {
10541
+ if (firstRun) {
10541
10542
  Object.defineProperty(node, "$$getElementByRef", {
10542
10543
  value: getElementByRef
10543
10544
  });
10544
10545
  }
10545
10546
 
10546
- if (!reRun && brick.stateNames) {
10547
+ if (firstRun && brick.stateNames) {
10547
10548
  (function () {
10548
10549
  // Define properties from state for tpl.
10549
10550
  var getState = () => getCustomTemplateContext(brick.tplContextId).state;
@@ -11203,7 +11204,7 @@
11203
11204
  handleProxyOfCustomTemplate(_objectSpread__default["default"](_objectSpread__default["default"]({}, tplBrick), {}, {
11204
11205
  proxyRefs: singleRefBrickProxyMap,
11205
11206
  proxy: getFilterProxy(tplBrick.proxy, brick.ref)
11206
- }), true);
11207
+ }));
11207
11208
  setRealProperties(tplBrick.element, tplBrick.properties || {});
11208
11209
  }
11209
11210
  }