@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.
- package/dist/{chunk-3E4EK64L.dev.esm.js → chunk-JT6RSDKI.dev.esm.js} +11 -11
- package/dist/chunk-JT6RSDKI.dev.esm.js.map +1 -0
- package/dist/chunk-WWGSC3TY.esm.js +2 -0
- package/dist/chunk-WWGSC3TY.esm.js.map +1 -0
- package/dist/{internal-Bz6h0aPa.d.cts → internal-DSKAj-zW.d.cts} +4 -0
- package/dist/{internal-Bz6h0aPa.d.ts → internal-DSKAj-zW.d.ts} +4 -0
- package/dist/internal.cjs.js +1 -1
- package/dist/internal.cjs.js.map +1 -1
- package/dist/internal.d.cts +2 -1
- package/dist/internal.d.ts +2 -1
- package/dist/internal.dev.cjs.js +9 -9
- package/dist/internal.dev.cjs.js.map +1 -1
- package/dist/internal.dev.esm.js +1 -1
- package/dist/internal.esm.js +1 -1
- package/dist/template.cjs.js +2 -2
- package/dist/template.cjs.js.map +1 -1
- package/dist/template.d.cts +2 -2
- package/dist/template.d.ts +2 -2
- package/dist/template.dev.cjs.js +21 -19
- package/dist/template.dev.cjs.js.map +1 -1
- package/dist/template.dev.esm.js +14 -11
- package/dist/template.dev.esm.js.map +1 -1
- package/dist/template.esm.js +2 -2
- package/dist/template.esm.js.map +1 -1
- package/package.json +7 -3
- package/dist/chunk-3E4EK64L.dev.esm.js.map +0 -1
- package/dist/chunk-IRDMO5MX.esm.js +0 -2
- package/dist/chunk-IRDMO5MX.esm.js.map +0 -1
package/dist/template.dev.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getActiveScope, runWithScope, onCleanup, __objRest, createScope, disposeScope, __async } from './chunk-
|
|
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
|
|
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 (
|
|
572
|
-
runWithScope(
|
|
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)
|
|
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
|
|
875
|
-
|
|
876
|
+
const ref = value;
|
|
877
|
+
const previousValue = ref.value;
|
|
878
|
+
ref.value = root;
|
|
876
879
|
return () => {
|
|
877
|
-
if (
|
|
878
|
-
|
|
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
|
|
1307
|
+
const parentScope = getActiveScope();
|
|
1305
1308
|
let innerScope = null;
|
|
1306
1309
|
const mountAt = (parent, before) => {
|
|
1307
|
-
innerScope = createScope(
|
|
1310
|
+
innerScope = createScope(parentScope);
|
|
1308
1311
|
runWithScope(innerScope, () => {
|
|
1309
1312
|
insert(parent, () => children, before);
|
|
1310
1313
|
});
|