@estjs/template 0.0.16-beta.2 → 0.0.16-beta.4

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.
@@ -1,4 +1,4 @@
1
- import { getActiveScope, runWithScope, onCleanup, __objRest, createScope, disposeScope, __async } from './chunk-3E4EK64L.dev.esm.js';
1
+ import { getActiveScope, runWithScope, onCleanup, __objRest, createScope, disposeScope, __async } from './chunk-JT6RSDKI.dev.esm.js';
2
2
  import { normalizeClassName, isObject, warn, isSpecialBooleanAttr, isBooleanAttr, includeBooleanAttr, isSymbol, isString, isArray, camelCase, capitalize, isBrowser, error, isPromise, isFunction, isOn, coerceArray } from '@estjs/shared';
3
3
  import { effect, shallowReactive, isSignal, isComputed, signal } from '@estjs/signals';
4
4
 
@@ -544,7 +544,7 @@ function normalizeNode(node) {
544
544
  }
545
545
  function insert(parent, nodeFactory, before) {
546
546
  if (!parent) return;
547
- const ownerScope = getActiveScope();
547
+ const parentScope = getActiveScope();
548
548
  let renderedNodes = [];
549
549
  let isFirstRun = true;
550
550
  const resolveNodes = (raw) => {
@@ -568,8 +568,8 @@ function insert(parent, nodeFactory, before) {
568
568
  renderedNodes = reconcileArrays(parent, renderedNodes, nodes, before);
569
569
  isFirstRun = false;
570
570
  };
571
- if (ownerScope && !ownerScope.isDestroyed) {
572
- runWithScope(ownerScope, executeUpdate);
571
+ if (parentScope && !parentScope.isDestroyed) {
572
+ runWithScope(parentScope, executeUpdate);
573
573
  } else {
574
574
  executeUpdate();
575
575
  }
@@ -770,7 +770,9 @@ var Component = class {
770
770
  if (isFunction(result)) {
771
771
  result = result(this.reactiveProps);
772
772
  }
773
- if (isSignal(result) || isComputed(result)) {
773
+ if (isSignal(result)) {
774
+ result = result.value;
775
+ } else if (isComputed(result)) {
774
776
  result = result.value;
775
777
  }
776
778
  return (_a3 = insert(parentNode, result, beforeNode)) != null ? _a3 : [];
@@ -871,11 +873,12 @@ var Component = class {
871
873
  return () => value(null);
872
874
  }
873
875
  if (isSignal(value)) {
874
- const previousValue = value.value;
875
- value.value = root;
876
+ const ref = value;
877
+ const previousValue = ref.value;
878
+ ref.value = root;
876
879
  return () => {
877
- if (value.value === root) {
878
- value.value = previousValue;
880
+ if (ref.value === root) {
881
+ ref.value = previousValue;
879
882
  }
880
883
  };
881
884
  }
@@ -1301,10 +1304,10 @@ function Portal(props) {
1301
1304
  placeholder[PORTAL_COMPONENT] = true;
1302
1305
  const { children } = props;
1303
1306
  if (children == null) return placeholder;
1304
- const ownerScope = getActiveScope();
1307
+ const parentScope = getActiveScope();
1305
1308
  let innerScope = null;
1306
1309
  const mountAt = (parent, before) => {
1307
- innerScope = createScope(ownerScope);
1310
+ innerScope = createScope(parentScope);
1308
1311
  runWithScope(innerScope, () => {
1309
1312
  insert(parent, () => children, before);
1310
1313
  });