@marko/runtime-tags 6.1.0 → 6.1.2
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/debug/dom.js +15 -17
- package/dist/debug/dom.mjs +15 -17
- package/dist/debug/html.js +9 -1
- package/dist/debug/html.mjs +9 -1
- package/dist/dom.js +15 -15
- package/dist/dom.mjs +15 -15
- package/dist/html.js +6 -1
- package/dist/html.mjs +6 -1
- package/dist/translator/index.js +6 -2
- package/dist/translator/util/sections.d.ts +1 -1
- package/package.json +1 -1
package/dist/debug/dom.js
CHANGED
|
@@ -302,7 +302,7 @@ function _let(id, fn) {
|
|
|
302
302
|
}
|
|
303
303
|
function _const(valueAccessor, fn) {
|
|
304
304
|
return (scope, value) => {
|
|
305
|
-
if (
|
|
305
|
+
if (scope["#Creating"] || scope[valueAccessor] !== value) {
|
|
306
306
|
scope[valueAccessor] = value;
|
|
307
307
|
fn?.(scope);
|
|
308
308
|
}
|
|
@@ -1144,11 +1144,10 @@ function _lifecycle(scope, thisObj, index = 0) {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
function removeChildNodes(startNode, endNode) {
|
|
1146
1146
|
const stop = endNode.nextSibling;
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
current = next;
|
|
1147
|
+
while (startNode !== stop) {
|
|
1148
|
+
const next = startNode.nextSibling;
|
|
1149
|
+
startNode.remove();
|
|
1150
|
+
startNode = next;
|
|
1152
1151
|
}
|
|
1153
1152
|
}
|
|
1154
1153
|
function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
|
|
@@ -1158,11 +1157,10 @@ function toInsertNode(startNode, endNode) {
|
|
|
1158
1157
|
if (startNode === endNode) return startNode;
|
|
1159
1158
|
const parent = new DocumentFragment();
|
|
1160
1159
|
const stop = endNode.nextSibling;
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
current = next;
|
|
1160
|
+
while (startNode !== stop) {
|
|
1161
|
+
const next = startNode.nextSibling;
|
|
1162
|
+
parent.appendChild(startNode);
|
|
1163
|
+
startNode = next;
|
|
1166
1164
|
}
|
|
1167
1165
|
return parent;
|
|
1168
1166
|
}
|
|
@@ -1493,7 +1491,7 @@ function byFirstArg(name) {
|
|
|
1493
1491
|
//#endregion
|
|
1494
1492
|
//#region src/dom/queue.ts
|
|
1495
1493
|
let pendingRenders = [];
|
|
1496
|
-
let pendingRendersLookup =
|
|
1494
|
+
let pendingRendersLookup = {};
|
|
1497
1495
|
let asyncRendersLookup;
|
|
1498
1496
|
const caughtError = /* @__PURE__ */ new WeakSet();
|
|
1499
1497
|
const placeholderShown = /* @__PURE__ */ new WeakSet();
|
|
@@ -1503,7 +1501,7 @@ let rendering;
|
|
|
1503
1501
|
const scopeKeyOffset = 1e3;
|
|
1504
1502
|
function queueRender(scope, signal, signalKey, value, scopeKey = scope["#Id"]) {
|
|
1505
1503
|
const key = scopeKey * scopeKeyOffset + signalKey;
|
|
1506
|
-
let render = signalKey >= 0 && pendingRendersLookup
|
|
1504
|
+
let render = signalKey >= 0 && pendingRendersLookup[key];
|
|
1507
1505
|
if (render) render["value"] = value;
|
|
1508
1506
|
else {
|
|
1509
1507
|
queuePendingRender(render = {
|
|
@@ -1512,7 +1510,7 @@ function queueRender(scope, signal, signalKey, value, scopeKey = scope["#Id"]) {
|
|
|
1512
1510
|
["signal"]: signal,
|
|
1513
1511
|
["value"]: value
|
|
1514
1512
|
});
|
|
1515
|
-
signalKey >= 0 && pendingRendersLookup
|
|
1513
|
+
signalKey >= 0 && (pendingRendersLookup[key] = render);
|
|
1516
1514
|
}
|
|
1517
1515
|
}
|
|
1518
1516
|
function queuePendingRender(render) {
|
|
@@ -1531,7 +1529,7 @@ function queueEffect(scope, fn) {
|
|
|
1531
1529
|
}
|
|
1532
1530
|
function run() {
|
|
1533
1531
|
const effects = pendingEffects;
|
|
1534
|
-
asyncRendersLookup =
|
|
1532
|
+
asyncRendersLookup = {};
|
|
1535
1533
|
try {
|
|
1536
1534
|
rendering = 1;
|
|
1537
1535
|
runRenders();
|
|
@@ -1550,7 +1548,7 @@ function prepareEffects(fn) {
|
|
|
1550
1548
|
const preparedEffects = pendingEffects = [];
|
|
1551
1549
|
pendingRenders = [];
|
|
1552
1550
|
asyncRendersLookup = pendingRendersLookup;
|
|
1553
|
-
pendingRendersLookup =
|
|
1551
|
+
pendingRendersLookup = {};
|
|
1554
1552
|
try {
|
|
1555
1553
|
rendering = 1;
|
|
1556
1554
|
fn();
|
|
@@ -1623,7 +1621,7 @@ function _enable_catch() {
|
|
|
1623
1621
|
let branch = render["scope"]["#ClosestBranch"];
|
|
1624
1622
|
while (branch) {
|
|
1625
1623
|
if (branch["#PendingRenders"]) {
|
|
1626
|
-
asyncRendersLookup
|
|
1624
|
+
asyncRendersLookup[render["key"]] = render;
|
|
1627
1625
|
return branch["#PendingRenders"].push(render);
|
|
1628
1626
|
}
|
|
1629
1627
|
branch = branch["#ParentBranch"];
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -300,7 +300,7 @@ function _let(id, fn) {
|
|
|
300
300
|
}
|
|
301
301
|
function _const(valueAccessor, fn) {
|
|
302
302
|
return (scope, value) => {
|
|
303
|
-
if (
|
|
303
|
+
if (scope["#Creating"] || scope[valueAccessor] !== value) {
|
|
304
304
|
scope[valueAccessor] = value;
|
|
305
305
|
fn?.(scope);
|
|
306
306
|
}
|
|
@@ -1142,11 +1142,10 @@ function _lifecycle(scope, thisObj, index = 0) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
function removeChildNodes(startNode, endNode) {
|
|
1144
1144
|
const stop = endNode.nextSibling;
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
current = next;
|
|
1145
|
+
while (startNode !== stop) {
|
|
1146
|
+
const next = startNode.nextSibling;
|
|
1147
|
+
startNode.remove();
|
|
1148
|
+
startNode = next;
|
|
1150
1149
|
}
|
|
1151
1150
|
}
|
|
1152
1151
|
function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
|
|
@@ -1156,11 +1155,10 @@ function toInsertNode(startNode, endNode) {
|
|
|
1156
1155
|
if (startNode === endNode) return startNode;
|
|
1157
1156
|
const parent = new DocumentFragment();
|
|
1158
1157
|
const stop = endNode.nextSibling;
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
current = next;
|
|
1158
|
+
while (startNode !== stop) {
|
|
1159
|
+
const next = startNode.nextSibling;
|
|
1160
|
+
parent.appendChild(startNode);
|
|
1161
|
+
startNode = next;
|
|
1164
1162
|
}
|
|
1165
1163
|
return parent;
|
|
1166
1164
|
}
|
|
@@ -1491,7 +1489,7 @@ function byFirstArg(name) {
|
|
|
1491
1489
|
//#endregion
|
|
1492
1490
|
//#region src/dom/queue.ts
|
|
1493
1491
|
let pendingRenders = [];
|
|
1494
|
-
let pendingRendersLookup =
|
|
1492
|
+
let pendingRendersLookup = {};
|
|
1495
1493
|
let asyncRendersLookup;
|
|
1496
1494
|
const caughtError = /* @__PURE__ */ new WeakSet();
|
|
1497
1495
|
const placeholderShown = /* @__PURE__ */ new WeakSet();
|
|
@@ -1501,7 +1499,7 @@ let rendering;
|
|
|
1501
1499
|
const scopeKeyOffset = 1e3;
|
|
1502
1500
|
function queueRender(scope, signal, signalKey, value, scopeKey = scope["#Id"]) {
|
|
1503
1501
|
const key = scopeKey * scopeKeyOffset + signalKey;
|
|
1504
|
-
let render = signalKey >= 0 && pendingRendersLookup
|
|
1502
|
+
let render = signalKey >= 0 && pendingRendersLookup[key];
|
|
1505
1503
|
if (render) render["value"] = value;
|
|
1506
1504
|
else {
|
|
1507
1505
|
queuePendingRender(render = {
|
|
@@ -1510,7 +1508,7 @@ function queueRender(scope, signal, signalKey, value, scopeKey = scope["#Id"]) {
|
|
|
1510
1508
|
["signal"]: signal,
|
|
1511
1509
|
["value"]: value
|
|
1512
1510
|
});
|
|
1513
|
-
signalKey >= 0 && pendingRendersLookup
|
|
1511
|
+
signalKey >= 0 && (pendingRendersLookup[key] = render);
|
|
1514
1512
|
}
|
|
1515
1513
|
}
|
|
1516
1514
|
function queuePendingRender(render) {
|
|
@@ -1529,7 +1527,7 @@ function queueEffect(scope, fn) {
|
|
|
1529
1527
|
}
|
|
1530
1528
|
function run() {
|
|
1531
1529
|
const effects = pendingEffects;
|
|
1532
|
-
asyncRendersLookup =
|
|
1530
|
+
asyncRendersLookup = {};
|
|
1533
1531
|
try {
|
|
1534
1532
|
rendering = 1;
|
|
1535
1533
|
runRenders();
|
|
@@ -1548,7 +1546,7 @@ function prepareEffects(fn) {
|
|
|
1548
1546
|
const preparedEffects = pendingEffects = [];
|
|
1549
1547
|
pendingRenders = [];
|
|
1550
1548
|
asyncRendersLookup = pendingRendersLookup;
|
|
1551
|
-
pendingRendersLookup =
|
|
1549
|
+
pendingRendersLookup = {};
|
|
1552
1550
|
try {
|
|
1553
1551
|
rendering = 1;
|
|
1554
1552
|
fn();
|
|
@@ -1621,7 +1619,7 @@ function _enable_catch() {
|
|
|
1621
1619
|
let branch = render["scope"]["#ClosestBranch"];
|
|
1622
1620
|
while (branch) {
|
|
1623
1621
|
if (branch["#PendingRenders"]) {
|
|
1624
|
-
asyncRendersLookup
|
|
1622
|
+
asyncRendersLookup[render["key"]] = render;
|
|
1625
1623
|
return branch["#PendingRenders"].push(render);
|
|
1626
1624
|
}
|
|
1627
1625
|
branch = branch["#ParentBranch"];
|
package/dist/debug/html.js
CHANGED
|
@@ -746,12 +746,20 @@ function writeReferenceOr(state, write, val, parent, accessor) {
|
|
|
746
746
|
}
|
|
747
747
|
function writeRegistered(state, val, parent, accessor, registered) {
|
|
748
748
|
if (parent && registered.scope) {
|
|
749
|
+
if (!state.refs.has(registered.scope)) {
|
|
750
|
+
state.buf.push(registered.access + "(");
|
|
751
|
+
writeProp(state, registered.scope, null, "");
|
|
752
|
+
state.buf.push(")");
|
|
753
|
+
const scopeRef = state.refs.get(registered.scope);
|
|
754
|
+
if (scopeRef) ensureId(state, scopeRef);
|
|
755
|
+
return true;
|
|
756
|
+
}
|
|
749
757
|
const fnRef = new Reference(parent, accessor, state.flush, state.buf.length);
|
|
750
758
|
fnRef.registered = registered;
|
|
751
759
|
state.refs.set(val, fnRef);
|
|
752
760
|
state.registered.push(fnRef);
|
|
753
761
|
addAssignment(fnRef, ensureId(state, parent) + toAccess(accessor));
|
|
754
|
-
return
|
|
762
|
+
return false;
|
|
755
763
|
} else state.buf.push(registered.access);
|
|
756
764
|
return true;
|
|
757
765
|
}
|
package/dist/debug/html.mjs
CHANGED
|
@@ -744,12 +744,20 @@ function writeReferenceOr(state, write, val, parent, accessor) {
|
|
|
744
744
|
}
|
|
745
745
|
function writeRegistered(state, val, parent, accessor, registered) {
|
|
746
746
|
if (parent && registered.scope) {
|
|
747
|
+
if (!state.refs.has(registered.scope)) {
|
|
748
|
+
state.buf.push(registered.access + "(");
|
|
749
|
+
writeProp(state, registered.scope, null, "");
|
|
750
|
+
state.buf.push(")");
|
|
751
|
+
const scopeRef = state.refs.get(registered.scope);
|
|
752
|
+
if (scopeRef) ensureId(state, scopeRef);
|
|
753
|
+
return true;
|
|
754
|
+
}
|
|
747
755
|
const fnRef = new Reference(parent, accessor, state.flush, state.buf.length);
|
|
748
756
|
fnRef.registered = registered;
|
|
749
757
|
state.refs.set(val, fnRef);
|
|
750
758
|
state.registered.push(fnRef);
|
|
751
759
|
addAssignment(fnRef, ensureId(state, parent) + toAccess(accessor));
|
|
752
|
-
return
|
|
760
|
+
return false;
|
|
753
761
|
} else state.buf.push(registered.access);
|
|
754
762
|
return true;
|
|
755
763
|
}
|
package/dist/dom.js
CHANGED
|
@@ -52,7 +52,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
52
52
|
};
|
|
53
53
|
}, _for_of = /* @__PURE__ */ loop(([all, by = bySecondArg], cb) => {
|
|
54
54
|
typeof by == "string" ? forOf(all, (item, i) => cb(item[by], [item, i])) : forOf(all, (item, i) => cb(by(item, i), [item, i]));
|
|
55
|
-
}), _for_in = /* @__PURE__ */ loop(([obj, by = byFirstArg], cb) => forIn(obj, (key, value) => cb(by(key, value), [key, value]))), _for_to = /* @__PURE__ */ loop(([to, from, step, by = byFirstArg], cb) => forTo(to, from, step, (v) => cb(by(v), [v]))), _for_until = /* @__PURE__ */ loop(([until, from, step, by = byFirstArg], cb) => forUntil(until, from, step, (v) => cb(by(v), [v]))), pendingRenders = [], pendingRendersLookup =
|
|
55
|
+
}), _for_in = /* @__PURE__ */ loop(([obj, by = byFirstArg], cb) => forIn(obj, (key, value) => cb(by(key, value), [key, value]))), _for_to = /* @__PURE__ */ loop(([to, from, step, by = byFirstArg], cb) => forTo(to, from, step, (v) => cb(by(v), [v]))), _for_until = /* @__PURE__ */ loop(([until, from, step, by = byFirstArg], cb) => forUntil(until, from, step, (v) => cb(by(v), [v]))), pendingRenders = [], pendingRendersLookup = {}, asyncRendersLookup, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingScopes = [], rendering, runEffects = ((effects) => {
|
|
56
56
|
for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
|
|
57
57
|
}), runRender = (render) => render.c(render.b, render.d), catchEnabled, classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
58
58
|
patchDynamicTag,
|
|
@@ -264,7 +264,7 @@ function _let(id, fn) {
|
|
|
264
264
|
}
|
|
265
265
|
function _const(valueAccessor, fn) {
|
|
266
266
|
return valueAccessor = decodeAccessor(valueAccessor), (scope, value) => {
|
|
267
|
-
(
|
|
267
|
+
(scope.H || scope[valueAccessor] !== value) && (scope[valueAccessor] = value, fn?.(scope));
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
270
|
function _or(id, fn, defaultPending = 1, scopeIdAccessor = "L") {
|
|
@@ -802,10 +802,10 @@ function _lifecycle(scope, thisObj, index = 0) {
|
|
|
802
802
|
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[accessor] = thisObj, thisObj.onMount?.(), $signal(scope, accessor).onabort = () => thisObj.onDestroy?.());
|
|
803
803
|
}
|
|
804
804
|
function removeChildNodes(startNode, endNode) {
|
|
805
|
-
let stop = endNode.nextSibling
|
|
806
|
-
for (;
|
|
807
|
-
let next =
|
|
808
|
-
|
|
805
|
+
let stop = endNode.nextSibling;
|
|
806
|
+
for (; startNode !== stop;) {
|
|
807
|
+
let next = startNode.nextSibling;
|
|
808
|
+
startNode.remove(), startNode = next;
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
|
|
@@ -813,10 +813,10 @@ function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
|
|
|
813
813
|
}
|
|
814
814
|
function toInsertNode(startNode, endNode) {
|
|
815
815
|
if (startNode === endNode) return startNode;
|
|
816
|
-
let parent = new DocumentFragment(), stop = endNode.nextSibling
|
|
817
|
-
for (;
|
|
818
|
-
let next =
|
|
819
|
-
parent.appendChild(
|
|
816
|
+
let parent = new DocumentFragment(), stop = endNode.nextSibling;
|
|
817
|
+
for (; startNode !== stop;) {
|
|
818
|
+
let next = startNode.nextSibling;
|
|
819
|
+
parent.appendChild(startNode), startNode = next;
|
|
820
820
|
}
|
|
821
821
|
return parent;
|
|
822
822
|
}
|
|
@@ -962,13 +962,13 @@ function byFirstArg(name) {
|
|
|
962
962
|
//#endregion
|
|
963
963
|
//#region src/dom/queue.ts
|
|
964
964
|
function queueRender(scope, signal, signalKey, value, scopeKey = scope.L) {
|
|
965
|
-
let key = scopeKey * 1e3 + signalKey, render = signalKey >= 0 && pendingRendersLookup
|
|
965
|
+
let key = scopeKey * 1e3 + signalKey, render = signalKey >= 0 && pendingRendersLookup[key];
|
|
966
966
|
render ? render.d = value : (queuePendingRender(render = {
|
|
967
967
|
a: key,
|
|
968
968
|
b: scope,
|
|
969
969
|
c: signal,
|
|
970
970
|
d: value
|
|
971
|
-
}), signalKey >= 0 && pendingRendersLookup
|
|
971
|
+
}), signalKey >= 0 && (pendingRendersLookup[key] = render));
|
|
972
972
|
}
|
|
973
973
|
function queuePendingRender(render) {
|
|
974
974
|
let i = pendingRenders.push(render) - 1;
|
|
@@ -984,7 +984,7 @@ function queueEffect(scope, fn) {
|
|
|
984
984
|
}
|
|
985
985
|
function run() {
|
|
986
986
|
let effects = pendingEffects;
|
|
987
|
-
asyncRendersLookup =
|
|
987
|
+
asyncRendersLookup = {};
|
|
988
988
|
try {
|
|
989
989
|
rendering = 1, runRenders();
|
|
990
990
|
} finally {
|
|
@@ -994,7 +994,7 @@ function run() {
|
|
|
994
994
|
}
|
|
995
995
|
function prepareEffects(fn) {
|
|
996
996
|
let prevRenders = pendingRenders, prevEffects = pendingEffects, prevLookup = asyncRendersLookup, preparedEffects = pendingEffects = [];
|
|
997
|
-
pendingRenders = [], asyncRendersLookup = pendingRendersLookup, pendingRendersLookup =
|
|
997
|
+
pendingRenders = [], asyncRendersLookup = pendingRendersLookup, pendingRendersLookup = {};
|
|
998
998
|
try {
|
|
999
999
|
rendering = 1, fn(), runRenders();
|
|
1000
1000
|
} finally {
|
|
@@ -1037,7 +1037,7 @@ function _enable_catch() {
|
|
|
1037
1037
|
try {
|
|
1038
1038
|
let branch = render.b.F;
|
|
1039
1039
|
for (; branch;) {
|
|
1040
|
-
if (branch.W) return asyncRendersLookup
|
|
1040
|
+
if (branch.W) return asyncRendersLookup[render.a] = render, branch.W.push(render);
|
|
1041
1041
|
branch = branch.N;
|
|
1042
1042
|
}
|
|
1043
1043
|
runRender(render);
|
package/dist/dom.mjs
CHANGED
|
@@ -52,7 +52,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
52
52
|
};
|
|
53
53
|
}, _for_of = /* @__PURE__ */ loop(([all, by = bySecondArg], cb) => {
|
|
54
54
|
typeof by == "string" ? forOf(all, (item, i) => cb(item[by], [item, i])) : forOf(all, (item, i) => cb(by(item, i), [item, i]));
|
|
55
|
-
}), _for_in = /* @__PURE__ */ loop(([obj, by = byFirstArg], cb) => forIn(obj, (key, value) => cb(by(key, value), [key, value]))), _for_to = /* @__PURE__ */ loop(([to, from, step, by = byFirstArg], cb) => forTo(to, from, step, (v) => cb(by(v), [v]))), _for_until = /* @__PURE__ */ loop(([until, from, step, by = byFirstArg], cb) => forUntil(until, from, step, (v) => cb(by(v), [v]))), pendingRenders = [], pendingRendersLookup =
|
|
55
|
+
}), _for_in = /* @__PURE__ */ loop(([obj, by = byFirstArg], cb) => forIn(obj, (key, value) => cb(by(key, value), [key, value]))), _for_to = /* @__PURE__ */ loop(([to, from, step, by = byFirstArg], cb) => forTo(to, from, step, (v) => cb(by(v), [v]))), _for_until = /* @__PURE__ */ loop(([until, from, step, by = byFirstArg], cb) => forUntil(until, from, step, (v) => cb(by(v), [v]))), pendingRenders = [], pendingRendersLookup = {}, asyncRendersLookup, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingScopes = [], rendering, runEffects = ((effects) => {
|
|
56
56
|
for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
|
|
57
57
|
}), runRender = (render) => render.c(render.b, render.d), catchEnabled, classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
58
58
|
patchDynamicTag,
|
|
@@ -263,7 +263,7 @@ function _let(id, fn) {
|
|
|
263
263
|
}
|
|
264
264
|
function _const(valueAccessor, fn) {
|
|
265
265
|
return valueAccessor = decodeAccessor(valueAccessor), (scope, value) => {
|
|
266
|
-
(
|
|
266
|
+
(scope.H || scope[valueAccessor] !== value) && (scope[valueAccessor] = value, fn?.(scope));
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
269
|
function _or(id, fn, defaultPending = 1, scopeIdAccessor = "L") {
|
|
@@ -801,10 +801,10 @@ function _lifecycle(scope, thisObj, index = 0) {
|
|
|
801
801
|
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[accessor] = thisObj, thisObj.onMount?.(), $signal(scope, accessor).onabort = () => thisObj.onDestroy?.());
|
|
802
802
|
}
|
|
803
803
|
function removeChildNodes(startNode, endNode) {
|
|
804
|
-
let stop = endNode.nextSibling
|
|
805
|
-
for (;
|
|
806
|
-
let next =
|
|
807
|
-
|
|
804
|
+
let stop = endNode.nextSibling;
|
|
805
|
+
for (; startNode !== stop;) {
|
|
806
|
+
let next = startNode.nextSibling;
|
|
807
|
+
startNode.remove(), startNode = next;
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
810
|
function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
|
|
@@ -812,10 +812,10 @@ function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
|
|
|
812
812
|
}
|
|
813
813
|
function toInsertNode(startNode, endNode) {
|
|
814
814
|
if (startNode === endNode) return startNode;
|
|
815
|
-
let parent = new DocumentFragment(), stop = endNode.nextSibling
|
|
816
|
-
for (;
|
|
817
|
-
let next =
|
|
818
|
-
parent.appendChild(
|
|
815
|
+
let parent = new DocumentFragment(), stop = endNode.nextSibling;
|
|
816
|
+
for (; startNode !== stop;) {
|
|
817
|
+
let next = startNode.nextSibling;
|
|
818
|
+
parent.appendChild(startNode), startNode = next;
|
|
819
819
|
}
|
|
820
820
|
return parent;
|
|
821
821
|
}
|
|
@@ -961,13 +961,13 @@ function byFirstArg(name) {
|
|
|
961
961
|
//#endregion
|
|
962
962
|
//#region src/dom/queue.ts
|
|
963
963
|
function queueRender(scope, signal, signalKey, value, scopeKey = scope.L) {
|
|
964
|
-
let key = scopeKey * 1e3 + signalKey, render = signalKey >= 0 && pendingRendersLookup
|
|
964
|
+
let key = scopeKey * 1e3 + signalKey, render = signalKey >= 0 && pendingRendersLookup[key];
|
|
965
965
|
render ? render.d = value : (queuePendingRender(render = {
|
|
966
966
|
a: key,
|
|
967
967
|
b: scope,
|
|
968
968
|
c: signal,
|
|
969
969
|
d: value
|
|
970
|
-
}), signalKey >= 0 && pendingRendersLookup
|
|
970
|
+
}), signalKey >= 0 && (pendingRendersLookup[key] = render));
|
|
971
971
|
}
|
|
972
972
|
function queuePendingRender(render) {
|
|
973
973
|
let i = pendingRenders.push(render) - 1;
|
|
@@ -983,7 +983,7 @@ function queueEffect(scope, fn) {
|
|
|
983
983
|
}
|
|
984
984
|
function run() {
|
|
985
985
|
let effects = pendingEffects;
|
|
986
|
-
asyncRendersLookup =
|
|
986
|
+
asyncRendersLookup = {};
|
|
987
987
|
try {
|
|
988
988
|
rendering = 1, runRenders();
|
|
989
989
|
} finally {
|
|
@@ -993,7 +993,7 @@ function run() {
|
|
|
993
993
|
}
|
|
994
994
|
function prepareEffects(fn) {
|
|
995
995
|
let prevRenders = pendingRenders, prevEffects = pendingEffects, prevLookup = asyncRendersLookup, preparedEffects = pendingEffects = [];
|
|
996
|
-
pendingRenders = [], asyncRendersLookup = pendingRendersLookup, pendingRendersLookup =
|
|
996
|
+
pendingRenders = [], asyncRendersLookup = pendingRendersLookup, pendingRendersLookup = {};
|
|
997
997
|
try {
|
|
998
998
|
rendering = 1, fn(), runRenders();
|
|
999
999
|
} finally {
|
|
@@ -1036,7 +1036,7 @@ function _enable_catch() {
|
|
|
1036
1036
|
try {
|
|
1037
1037
|
let branch = render.b.F;
|
|
1038
1038
|
for (; branch;) {
|
|
1039
|
-
if (branch.W) return asyncRendersLookup
|
|
1039
|
+
if (branch.W) return asyncRendersLookup[render.a] = render, branch.W.push(render);
|
|
1040
1040
|
branch = branch.N;
|
|
1041
1041
|
}
|
|
1042
1042
|
runRender(render);
|
package/dist/html.js
CHANGED
|
@@ -599,8 +599,13 @@ function writeReferenceOr(state, write, val, parent, accessor) {
|
|
|
599
599
|
}
|
|
600
600
|
function writeRegistered(state, val, parent, accessor, registered) {
|
|
601
601
|
if (parent && registered.scope) {
|
|
602
|
+
if (!state.refs.has(registered.scope)) {
|
|
603
|
+
state.buf.push(registered.access + "("), writeProp(state, registered.scope, null, ""), state.buf.push(")");
|
|
604
|
+
let scopeRef = state.refs.get(registered.scope);
|
|
605
|
+
return scopeRef && ensureId(state, scopeRef), !0;
|
|
606
|
+
}
|
|
602
607
|
let fnRef = new Reference(parent, accessor, state.flush, state.buf.length);
|
|
603
|
-
return fnRef.registered = registered, state.refs.set(val, fnRef), state.registered.push(fnRef), addAssignment(fnRef, ensureId(state, parent) + toAccess(accessor)), !
|
|
608
|
+
return fnRef.registered = registered, state.refs.set(val, fnRef), state.registered.push(fnRef), addAssignment(fnRef, ensureId(state, parent) + toAccess(accessor)), !1;
|
|
604
609
|
} else state.buf.push(registered.access);
|
|
605
610
|
return !0;
|
|
606
611
|
}
|
package/dist/html.mjs
CHANGED
|
@@ -598,8 +598,13 @@ function writeReferenceOr(state, write, val, parent, accessor) {
|
|
|
598
598
|
}
|
|
599
599
|
function writeRegistered(state, val, parent, accessor, registered) {
|
|
600
600
|
if (parent && registered.scope) {
|
|
601
|
+
if (!state.refs.has(registered.scope)) {
|
|
602
|
+
state.buf.push(registered.access + "("), writeProp(state, registered.scope, null, ""), state.buf.push(")");
|
|
603
|
+
let scopeRef = state.refs.get(registered.scope);
|
|
604
|
+
return scopeRef && ensureId(state, scopeRef), !0;
|
|
605
|
+
}
|
|
601
606
|
let fnRef = new Reference(parent, accessor, state.flush, state.buf.length);
|
|
602
|
-
return fnRef.registered = registered, state.refs.set(val, fnRef), state.registered.push(fnRef), addAssignment(fnRef, ensureId(state, parent) + toAccess(accessor)), !
|
|
607
|
+
return fnRef.registered = registered, state.refs.set(val, fnRef), state.registered.push(fnRef), addAssignment(fnRef, ensureId(state, parent) + toAccess(accessor)), !1;
|
|
603
608
|
} else state.buf.push(registered.access);
|
|
604
609
|
return !0;
|
|
605
610
|
}
|
package/dist/translator/index.js
CHANGED
|
@@ -1535,8 +1535,12 @@ function getNodeContentType(path, extraMember, contentInfo) {
|
|
|
1535
1535
|
function getSectionRegisterReasons(section) {
|
|
1536
1536
|
if (section.isBranch) return false;
|
|
1537
1537
|
const { downstreamBinding } = section;
|
|
1538
|
-
if (downstreamBinding)
|
|
1539
|
-
|
|
1538
|
+
if (downstreamBinding) {
|
|
1539
|
+
const downstreamReasons = getAllSerializeReasonsForBinding(downstreamBinding.binding, downstreamBinding.properties);
|
|
1540
|
+
if (!downstreamReasons) return false;
|
|
1541
|
+
if (isReasonDynamic(downstreamReasons) && !section.serializeReason && !section.serializeReasons.size && !section.parent?.serializeReason && !section.parent?.serializeReasons.size) return false;
|
|
1542
|
+
return downstreamReasons;
|
|
1543
|
+
} else if (downstreamBinding === false) return false;
|
|
1540
1544
|
return true;
|
|
1541
1545
|
}
|
|
1542
1546
|
function isImmediateOwner(section, binding) {
|
|
@@ -75,7 +75,7 @@ export declare const getBranchRendererArgs: (section: Section) => [template?: t.
|
|
|
75
75
|
export declare function forEachSection(fn: (section: Section) => void): void;
|
|
76
76
|
export declare function forEachSectionReverse(fn: (section: Section) => void): void;
|
|
77
77
|
export declare function getNodeContentType(path: t.NodePath<t.Statement>, extraMember: "startType" | "endType", contentInfo?: Section["content"]): ContentType | null;
|
|
78
|
-
export declare function getSectionRegisterReasons(section: Section): false | SerializeReason
|
|
78
|
+
export declare function getSectionRegisterReasons(section: Section): false | SerializeReason;
|
|
79
79
|
export declare function isImmediateOwner(section: Section, binding: Binding): boolean;
|
|
80
80
|
export declare function isDirectClosure(section: Section, closure: Binding): boolean;
|
|
81
81
|
export declare function isDynamicClosure(section: Section, closure: Binding): boolean;
|