marko 6.0.0-next.3.24 → 6.0.0-next.3.26

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.
@@ -107,21 +107,23 @@ function finishPendingScopes() {
107
107
  }
108
108
  pendingScopes = [];
109
109
  }
110
- var emptyScope = createScope({});
111
- function getEmptyScope(marker) {
112
- emptyScope.___startNode = emptyScope.___endNode = marker;
113
- return emptyScope;
110
+ var emptyBranch = createScope({});
111
+ function getEmptyBranch(marker) {
112
+ emptyBranch.___startNode = emptyBranch.___endNode = marker;
113
+ return emptyBranch;
114
114
  }
115
115
  function destroyBranch(branch) {
116
+ branch.___parentBranch?.___branchScopes?.delete(branch);
117
+ destroyNestedBranches(branch);
118
+ }
119
+ function destroyNestedBranches(branch) {
116
120
  branch.___destroyed = 1;
117
- branch.___branchScopes?.forEach(destroyBranch);
118
- if (branch.___abortScopes) {
119
- for (const scope of branch.___abortScopes) {
120
- for (const id in scope.___abortControllers) {
121
- scope.___abortControllers[id]?.abort();
122
- }
121
+ branch.___branchScopes?.forEach(destroyNestedBranches);
122
+ branch.___abortScopes?.forEach((scope) => {
123
+ for (const id in scope.___abortControllers) {
124
+ scope.___abortControllers[id]?.abort();
123
125
  }
124
- }
126
+ });
125
127
  }
126
128
  function removeAndDestroyBranch(branch) {
127
129
  destroyBranch(branch);
@@ -133,9 +135,9 @@ function removeAndDestroyBranch(branch) {
133
135
  current = next;
134
136
  }
135
137
  }
136
- function insertBefore(scope, parent, nextSibling) {
137
- let current = scope.___startNode;
138
- const stop = scope.___endNode.nextSibling;
138
+ function insertBranchBefore(branch, parent, nextSibling) {
139
+ let current = branch.___startNode;
140
+ const stop = branch.___endNode.nextSibling;
139
141
  while (current !== stop) {
140
142
  const next = current.nextSibling;
141
143
  parent.insertBefore(current, nextSibling);
@@ -240,7 +242,7 @@ function reconcile(parent, oldBranches, newBranches, afterReference) {
240
242
  k = newEnd + 1;
241
243
  nextSibling = k < newBranches.length ? newBranches[k].___startNode : afterReference;
242
244
  do {
243
- insertBefore(newBranches[newStart++], parent, nextSibling);
245
+ insertBranchBefore(newBranches[newStart++], parent, nextSibling);
244
246
  } while (newStart <= newEnd);
245
247
  }
246
248
  } else if (newStart > newEnd) {
@@ -274,7 +276,7 @@ function reconcile(parent, oldBranches, newBranches, afterReference) {
274
276
  }
275
277
  if (oldLength === oldBranches.length && synced === 0) {
276
278
  for (; newStart < newLength; ++newStart) {
277
- insertBefore(newBranches[newStart], parent, afterReference);
279
+ insertBranchBefore(newBranches[newStart], parent, afterReference);
278
280
  }
279
281
  for (; oldStart < oldLength; ++oldStart) {
280
282
  removeAndDestroyBranch(oldBranches[oldStart]);
@@ -297,13 +299,13 @@ function reconcile(parent, oldBranches, newBranches, afterReference) {
297
299
  pos = i + newStart;
298
300
  newBranch = newBranches[pos++];
299
301
  nextSibling = pos < k ? newBranches[pos].___startNode : afterReference;
300
- insertBefore(newBranch, parent, nextSibling);
302
+ insertBranchBefore(newBranch, parent, nextSibling);
301
303
  } else {
302
304
  if (j < 0 || i !== seq[j]) {
303
305
  pos = i + newStart;
304
306
  newBranch = newBranches[pos++];
305
307
  nextSibling = pos < k ? newBranches[pos].___startNode : afterReference;
306
- insertBefore(newBranch, parent, nextSibling);
308
+ insertBranchBefore(newBranch, parent, nextSibling);
307
309
  } else {
308
310
  --j;
309
311
  }
@@ -316,7 +318,7 @@ function reconcile(parent, oldBranches, newBranches, afterReference) {
316
318
  pos = i + newStart;
317
319
  newBranch = newBranches[pos++];
318
320
  nextSibling = pos < k ? newBranches[pos].___startNode : afterReference;
319
- insertBefore(newBranch, parent, nextSibling);
321
+ insertBranchBefore(newBranch, parent, nextSibling);
320
322
  }
321
323
  }
322
324
  }
@@ -565,6 +567,7 @@ var Render = class {
565
567
  if (branchIds.has(scopeId)) {
566
568
  const branch = scope;
567
569
  const parentBranch = branch.___closestBranch;
570
+ branch.___branchDepth = +scopeId;
568
571
  scope.___closestBranch = branch;
569
572
  if (parentBranch) {
570
573
  branch.___parentBranch = parentBranch;
@@ -1250,7 +1253,7 @@ function createBranchScopeWithRenderer(renderer, $global, parentScope) {
1250
1253
  if (true) {
1251
1254
  branch.___renderer = renderer;
1252
1255
  }
1253
- initRenderer(renderer, branch);
1256
+ initBranch(renderer, branch);
1254
1257
  return branch;
1255
1258
  }
1256
1259
  function createBranchScopeWithTagNameOrRenderer(tagNameOrRenderer, $global, parentScope) {
@@ -1271,22 +1274,25 @@ function createBranch($global, ownerScope, parentScope) {
1271
1274
  branch._ = ownerScope;
1272
1275
  branch.___closestBranch = branch;
1273
1276
  if (parentBranch) {
1277
+ branch.___branchDepth = parentBranch.___branchDepth + 1;
1274
1278
  branch.___parentBranch = parentBranch;
1275
1279
  (parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(branch);
1280
+ } else {
1281
+ branch.___branchDepth = 1;
1276
1282
  }
1277
1283
  return branch;
1278
1284
  }
1279
- function initRenderer(renderer, scope) {
1285
+ function initBranch(renderer, branch) {
1280
1286
  const dom = renderer.___clone();
1281
1287
  walk(
1282
1288
  dom.nodeType === 11 /* DocumentFragment */ ? dom.firstChild : dom,
1283
1289
  renderer.___walks,
1284
- scope
1290
+ branch
1285
1291
  );
1286
- scope.___startNode = dom.nodeType === 11 /* DocumentFragment */ ? dom.firstChild : dom;
1287
- scope.___endNode = dom.nodeType === 11 /* DocumentFragment */ ? dom.lastChild : dom;
1292
+ branch.___startNode = dom.nodeType === 11 /* DocumentFragment */ ? dom.firstChild : dom;
1293
+ branch.___endNode = dom.nodeType === 11 /* DocumentFragment */ ? dom.lastChild : dom;
1288
1294
  if (renderer.___setup) {
1289
- queueRender(scope, renderer.___setup);
1295
+ queueRender(branch, renderer.___setup);
1290
1296
  }
1291
1297
  return dom;
1292
1298
  }
@@ -1367,6 +1373,7 @@ var conditional = function conditional2(nodeAccessor, fn, getIntersection) {
1367
1373
  if (newRendererOrOp !== MARK && newRendererOrOp !== CLEAN) {
1368
1374
  const normalizedRenderer = normalizeDynamicRenderer(newRendererOrOp);
1369
1375
  if (isDifferentRenderer(normalizedRenderer, currentRenderer)) {
1376
+ scope[rendererAccessor] = normalizedRenderer;
1370
1377
  setConditionalRenderer(scope, nodeAccessor, normalizedRenderer);
1371
1378
  fn && fn(scope);
1372
1379
  op = DIRTY;
@@ -1378,16 +1385,15 @@ var conditional = function conditional2(nodeAccessor, fn, getIntersection) {
1378
1385
  };
1379
1386
  };
1380
1387
  function setConditionalRenderer(scope, nodeAccessor, newRenderer) {
1381
- const newBranch = newRenderer ? createBranchScopeWithTagNameOrRenderer(newRenderer, scope.$global, scope) : void 0;
1382
- const prevBranch = scope[nodeAccessor + "!" /* ConditionalScope */] || getEmptyScope(scope[nodeAccessor]);
1383
- insertBefore(
1384
- newBranch || getEmptyScope(scope[nodeAccessor]),
1388
+ const prevBranch = scope[nodeAccessor + "!" /* ConditionalScope */] || getEmptyBranch(scope[nodeAccessor]);
1389
+ const newBranch = newRenderer ? createBranchScopeWithTagNameOrRenderer(newRenderer, scope.$global, scope) : getEmptyBranch(scope[nodeAccessor]);
1390
+ insertBranchBefore(
1391
+ newBranch,
1385
1392
  prevBranch.___startNode.parentNode,
1386
1393
  prevBranch.___startNode
1387
1394
  );
1388
1395
  removeAndDestroyBranch(prevBranch);
1389
- scope[nodeAccessor + "(" /* ConditionalRenderer */] = newRenderer;
1390
- scope[nodeAccessor + "!" /* ConditionalScope */] = newBranch;
1396
+ scope[nodeAccessor + "!" /* ConditionalScope */] = newRenderer && newBranch;
1391
1397
  }
1392
1398
  var conditionalOnlyChild = function conditional3(nodeAccessor, fn, getIntersection) {
1393
1399
  const rendererAccessor = nodeAccessor + "(" /* ConditionalRenderer */;
@@ -1420,16 +1426,16 @@ function setConditionalRendererOnlyChild(scope, nodeAccessor, newRenderer) {
1420
1426
  const newBranch = newRenderer ? createBranchScopeWithTagNameOrRenderer(newRenderer, scope.$global, scope) : void 0;
1421
1427
  referenceNode.textContent = "";
1422
1428
  if (newBranch) {
1423
- insertBefore(newBranch, referenceNode, null);
1429
+ insertBranchBefore(newBranch, referenceNode, null);
1424
1430
  }
1425
1431
  prevBranch && destroyBranch(prevBranch);
1426
1432
  scope[nodeAccessor + "!" /* ConditionalScope */] = newBranch;
1427
1433
  }
1428
1434
  var emptyMarkerMap = /* @__PURE__ */ new Map([
1429
- [Symbol(), getEmptyScope(void 0)]
1435
+ [Symbol(), getEmptyBranch(void 0)]
1430
1436
  ]);
1431
1437
  var emptyMarkerArray = [
1432
- /* @__PURE__ */ getEmptyScope(void 0)
1438
+ /* @__PURE__ */ getEmptyBranch(void 0)
1433
1439
  ];
1434
1440
  var emptyMap = /* @__PURE__ */ new Map();
1435
1441
  var emptyArray = [];
@@ -1507,7 +1513,7 @@ function loop(nodeAccessor, renderer, forEach) {
1507
1513
  if (referenceIsMarker) {
1508
1514
  newMap = emptyMarkerMap;
1509
1515
  newArray = emptyMarkerArray;
1510
- getEmptyScope(referenceNode);
1516
+ getEmptyBranch(referenceNode);
1511
1517
  } else {
1512
1518
  oldArray.forEach(destroyBranch);
1513
1519
  referenceNode.textContent = "";
@@ -1519,7 +1525,7 @@ function loop(nodeAccessor, renderer, forEach) {
1519
1525
  if (needsReconciliation) {
1520
1526
  if (referenceIsMarker) {
1521
1527
  if (oldMap === emptyMarkerMap) {
1522
- getEmptyScope(referenceNode);
1528
+ getEmptyBranch(referenceNode);
1523
1529
  }
1524
1530
  const oldLastChild = oldArray[oldArray.length - 1];
1525
1531
  afterReference = oldLastChild.___endNode.nextSibling;
@@ -1658,8 +1664,8 @@ function conditionalClosure(ownerConditionalNodeAccessor, getRenderer, fn, getIn
1658
1664
  return helperSignal;
1659
1665
  }
1660
1666
  var defaultGetOwnerScope = (scope) => scope._;
1661
- function dynamicClosure(ownerValueAccessor, fn, getOwnerScope = defaultGetOwnerScope, getIntersection) {
1662
- const ownerSubscribersAccessor = ownerValueAccessor + "*" /* Subscribers */;
1667
+ function dynamicClosure(fn, getOwnerScope = defaultGetOwnerScope, getIntersection) {
1668
+ const ownerSubscribersAccessor = "?" /* Dynamic */ + accessorId++;
1663
1669
  const _signal = closure(fn, getIntersection);
1664
1670
  const helperSignal = (ownerScope, value2) => {
1665
1671
  const subscribers = ownerScope[ownerSubscribersAccessor];
@@ -1719,7 +1725,7 @@ function effect(id, fn) {
1719
1725
  }
1720
1726
 
1721
1727
  // src/dom/queue.ts
1722
- var pendingRender;
1728
+ var pendingRenders = [];
1723
1729
  var pendingEffects = [];
1724
1730
  var rendering = false;
1725
1731
  function queueSource(scope, signal, value2) {
@@ -1732,30 +1738,22 @@ function queueSource(scope, signal, value2) {
1732
1738
  return value2;
1733
1739
  }
1734
1740
  function queueRender(scope, signal, value2) {
1735
- const nextRender = {
1741
+ let i = pendingRenders.length;
1742
+ const render = {
1736
1743
  ___scope: scope,
1737
1744
  ___signal: signal,
1738
1745
  ___value: value2,
1739
- ___next: void 0
1746
+ ___index: i
1740
1747
  };
1741
- if (!pendingRender) {
1742
- pendingRender = nextRender;
1743
- } else if (comparePendingRenders(pendingRender, nextRender) < 0) {
1744
- if (rendering) {
1745
- throw new Error(
1746
- "attempted to queue a render before the currently executing render"
1747
- );
1748
- }
1749
- nextRender.___next = pendingRender;
1750
- pendingRender = nextRender;
1751
- } else {
1752
- let curRender = pendingRender;
1753
- while (curRender.___next && comparePendingRenders(curRender.___next, nextRender) >= 0) {
1754
- curRender = curRender.___next;
1755
- }
1756
- nextRender.___next = curRender.___next;
1757
- curRender.___next = nextRender;
1748
+ pendingRenders.push(render);
1749
+ while (i) {
1750
+ const parentIndex = i - 1 >> 1;
1751
+ const parent = pendingRenders[parentIndex];
1752
+ if (comparePendingRenders(render, parent) >= 0) break;
1753
+ pendingRenders[i] = parent;
1754
+ i = parentIndex;
1758
1755
  }
1756
+ pendingRenders[i] = render;
1759
1757
  }
1760
1758
  function queueEffect(scope, fn) {
1761
1759
  pendingEffects.push(scope, fn);
@@ -1766,24 +1764,24 @@ function run() {
1766
1764
  rendering = true;
1767
1765
  runRenders();
1768
1766
  } finally {
1769
- pendingRender = void 0;
1767
+ pendingRenders = [];
1768
+ pendingEffects = [];
1770
1769
  rendering = false;
1771
1770
  }
1772
- pendingEffects = [];
1773
1771
  runEffects(effects);
1774
1772
  }
1775
1773
  function prepareEffects(fn) {
1776
- const prevRender = pendingRender;
1774
+ const prevRenders = pendingRenders;
1777
1775
  const prevEffects = pendingEffects;
1778
1776
  const preparedEffects = pendingEffects = [];
1779
- pendingRender = void 0;
1777
+ pendingRenders = [];
1780
1778
  try {
1781
1779
  rendering = true;
1782
1780
  fn();
1783
1781
  runRenders();
1784
1782
  } finally {
1785
1783
  rendering = false;
1786
- pendingRender = prevRender;
1784
+ pendingRenders = prevRenders;
1787
1785
  pendingEffects = prevEffects;
1788
1786
  }
1789
1787
  return preparedEffects;
@@ -1796,21 +1794,42 @@ function runEffects(effects = pendingEffects) {
1796
1794
  }
1797
1795
  }
1798
1796
  function runRenders() {
1799
- while (pendingRender) {
1800
- if (!pendingRender.___scope.___closestBranch?.___destroyed) {
1801
- pendingRender.___signal(pendingRender.___scope, pendingRender.___value);
1797
+ while (pendingRenders.length) {
1798
+ const render = pendingRenders[0];
1799
+ const next = pendingRenders.pop();
1800
+ if (render !== next) {
1801
+ let i = 0;
1802
+ const mid = pendingRenders.length >> 1;
1803
+ const item = pendingRenders[0] = next;
1804
+ while (i < mid) {
1805
+ let bestChild = (i << 1) + 1;
1806
+ const right = bestChild + 1;
1807
+ if (right < pendingRenders.length && comparePendingRenders(
1808
+ pendingRenders[right],
1809
+ pendingRenders[bestChild]
1810
+ ) < 0) {
1811
+ bestChild = right;
1812
+ }
1813
+ if (comparePendingRenders(pendingRenders[bestChild], item) >= 0) {
1814
+ break;
1815
+ } else {
1816
+ pendingRenders[i] = pendingRenders[bestChild];
1817
+ i = bestChild;
1818
+ }
1819
+ }
1820
+ pendingRenders[i] = item;
1821
+ }
1822
+ if (!render.___scope.___closestBranch?.___destroyed) {
1823
+ render.___signal(render.___scope, render.___value);
1802
1824
  }
1803
- pendingRender = pendingRender.___next;
1804
1825
  }
1805
1826
  finishPendingScopes();
1806
1827
  }
1807
1828
  function comparePendingRenders(a, b) {
1808
- const aStart = ownerStartNode(a.___scope);
1809
- const bStart = ownerStartNode(b.___scope);
1810
- return aStart === bStart ? 0 : aStart ? bStart ? aStart.compareDocumentPosition(bStart) & 2 ? -1 : 1 : -1 : 1;
1829
+ return getBranchDepth(a) - getBranchDepth(b) || a.___index - b.___index;
1811
1830
  }
1812
- function ownerStartNode(scope) {
1813
- return (scope.___closestBranch || scope).___startNode;
1831
+ function getBranchDepth(render) {
1832
+ return render.___scope.___closestBranch?.___branchDepth || 0;
1814
1833
  }
1815
1834
 
1816
1835
  // src/dom/abort-signal.ts
@@ -1909,7 +1928,7 @@ var compat = {
1909
1928
  if (!scope) {
1910
1929
  scope = component.scope = createScope(out.global);
1911
1930
  scope._ = renderer.___owner;
1912
- initRenderer(renderer, scope);
1931
+ initBranch(renderer, scope);
1913
1932
  } else {
1914
1933
  applyArgs(scope, MARK);
1915
1934
  existing = true;
@@ -1940,6 +1959,8 @@ var createTemplate = (templateId, ...rendererArgs) => {
1940
1959
  };
1941
1960
  function mount(input = {}, reference, position) {
1942
1961
  let branch, dom;
1962
+ let parentNode = reference;
1963
+ let nextSibling = null;
1943
1964
  let { $global } = input;
1944
1965
  if ($global) {
1945
1966
  ({ $global, ...input } = input);
@@ -1954,28 +1975,26 @@ function mount(input = {}, reference, position) {
1954
1975
  renderId: DEFAULT_RENDER_ID
1955
1976
  };
1956
1977
  }
1957
- const args = this.___args;
1958
- const effects = prepareEffects(() => {
1959
- branch = createScope($global);
1960
- dom = initRenderer(this, branch);
1961
- if (args) {
1962
- args(branch, [input]);
1963
- }
1964
- });
1965
1978
  switch (position) {
1966
1979
  case "beforebegin":
1967
- reference.parentNode.insertBefore(dom, reference);
1980
+ parentNode = reference.parentNode;
1981
+ nextSibling = reference;
1968
1982
  break;
1969
1983
  case "afterbegin":
1970
- reference.insertBefore(dom, reference.firstChild);
1984
+ nextSibling = reference.firstChild;
1971
1985
  break;
1972
1986
  case "afterend":
1973
- reference.parentNode.insertBefore(dom, reference.nextSibling);
1974
- break;
1975
- default:
1976
- reference.appendChild(dom);
1987
+ parentNode = reference.parentNode;
1988
+ nextSibling = reference.nextSibling;
1977
1989
  break;
1978
1990
  }
1991
+ const args = this.___args;
1992
+ const effects = prepareEffects(() => {
1993
+ branch = createScope($global);
1994
+ dom = initBranch(this, branch);
1995
+ args?.(branch, [input]);
1996
+ });
1997
+ parentNode.insertBefore(dom, nextSibling);
1979
1998
  runEffects(effects);
1980
1999
  return {
1981
2000
  update: (newInput) => {
@@ -1486,13 +1486,13 @@ function register2(val, id, scopeId) {
1486
1486
  function nextTagId() {
1487
1487
  const state = $chunk.boundary.state;
1488
1488
  const { $global: $global2 } = state;
1489
- return "s" + $global2.runtimeId + $global2.renderId + (state.tagIndex++).toString(36);
1489
+ return "s" + $global2.runtimeId + $global2.renderId + (state.tagId++).toString(36);
1490
1490
  }
1491
1491
  function nextScopeId() {
1492
- return $chunk.boundary.state.scopeIndex++;
1492
+ return $chunk.boundary.state.scopeId++;
1493
1493
  }
1494
1494
  function peekNextScopeId() {
1495
- return $chunk.boundary.state.scopeIndex;
1495
+ return $chunk.boundary.state.scopeId;
1496
1496
  }
1497
1497
  function peekNextScope() {
1498
1498
  return ensureScopeWithId(peekNextScopeId());
@@ -1815,9 +1815,9 @@ var State2 = class {
1815
1815
  this.nonceAttr = " " + escapeAttrValue($global2.cspNonce + "");
1816
1816
  }
1817
1817
  }
1818
- tagIndex = 0;
1819
- scopeIndex = 0;
1820
- reorderIndex = 0;
1818
+ tagId = 1;
1819
+ scopeId = 1;
1820
+ reorderId = 1;
1821
1821
  hasGlobals = false;
1822
1822
  needsMainRuntime = false;
1823
1823
  hasMainRuntime = false;
@@ -1849,7 +1849,7 @@ var State2 = class {
1849
1849
  const encodeChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789";
1850
1850
  const encodeLen = encodeChars.length;
1851
1851
  const encodeStartLen = encodeLen - 10;
1852
- let index = this.reorderIndex++;
1852
+ let index = this.reorderId++;
1853
1853
  let mod = index % encodeStartLen;
1854
1854
  let id = encodeChars[mod];
1855
1855
  index = (index - mod) / encodeStartLen;
@@ -1406,13 +1406,13 @@ function register2(val, id, scopeId) {
1406
1406
  function nextTagId() {
1407
1407
  const state = $chunk.boundary.state;
1408
1408
  const { $global: $global2 } = state;
1409
- return "s" + $global2.runtimeId + $global2.renderId + (state.tagIndex++).toString(36);
1409
+ return "s" + $global2.runtimeId + $global2.renderId + (state.tagId++).toString(36);
1410
1410
  }
1411
1411
  function nextScopeId() {
1412
- return $chunk.boundary.state.scopeIndex++;
1412
+ return $chunk.boundary.state.scopeId++;
1413
1413
  }
1414
1414
  function peekNextScopeId() {
1415
- return $chunk.boundary.state.scopeIndex;
1415
+ return $chunk.boundary.state.scopeId;
1416
1416
  }
1417
1417
  function peekNextScope() {
1418
1418
  return ensureScopeWithId(peekNextScopeId());
@@ -1735,9 +1735,9 @@ var State2 = class {
1735
1735
  this.nonceAttr = " " + escapeAttrValue($global2.cspNonce + "");
1736
1736
  }
1737
1737
  }
1738
- tagIndex = 0;
1739
- scopeIndex = 0;
1740
- reorderIndex = 0;
1738
+ tagId = 1;
1739
+ scopeId = 1;
1740
+ reorderId = 1;
1741
1741
  hasGlobals = false;
1742
1742
  needsMainRuntime = false;
1743
1743
  hasMainRuntime = false;
@@ -1769,7 +1769,7 @@ var State2 = class {
1769
1769
  const encodeChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789";
1770
1770
  const encodeLen = encodeChars.length;
1771
1771
  const encodeStartLen = encodeLen - 10;
1772
- let index = this.reorderIndex++;
1772
+ let index = this.reorderId++;
1773
1773
  let mod = index % encodeStartLen;
1774
1774
  let id = encodeChars[mod];
1775
1775
  index = (index - mod) / encodeStartLen;
@@ -13,7 +13,7 @@ export type Renderer = {
13
13
  type SetupFn = (scope: Scope) => void;
14
14
  export declare function createBranchScopeWithRenderer(renderer: Renderer, $global: Scope["$global"], parentScope: Scope): BranchScope;
15
15
  export declare function createBranchScopeWithTagNameOrRenderer(tagNameOrRenderer: Renderer | string, $global: Scope["$global"], parentScope: Scope): BranchScope;
16
- export declare function initRenderer(renderer: Renderer, scope: Scope): Node;
16
+ export declare function initBranch(renderer: Renderer, branch: BranchScope): Node;
17
17
  export declare function dynamicTagAttrs(nodeAccessor: Accessor, getContent?: (scope: Scope) => Renderer, inputIsArgs?: boolean): (scope: Scope, attrsOrOp: (() => Record<string, unknown>) | SignalOp) => void;
18
18
  export declare function createRendererWithOwner(template: string, rawWalks?: string, setup?: SetupFn, getArgs?: () => Signal<unknown>): (owner?: Scope) => Renderer;
19
19
  export declare function createRenderer(template: string, walks?: string, setup?: SetupFn, getArgs?: () => Signal<unknown>): Renderer;
@@ -1,7 +1,7 @@
1
1
  import type { BranchScope, Scope } from "../common/types";
2
2
  export declare function createScope($global: Scope["$global"]): Scope;
3
3
  export declare function finishPendingScopes(): void;
4
- export declare function getEmptyScope(marker: Comment): Scope;
4
+ export declare function getEmptyBranch(marker: Comment): BranchScope;
5
5
  export declare function destroyBranch(branch: BranchScope): void;
6
6
  export declare function removeAndDestroyBranch(branch: BranchScope): void;
7
- export declare function insertBefore(scope: Scope, parent: Node & ParentNode, nextSibling: Node | null): void;
7
+ export declare function insertBranchBefore(branch: BranchScope, parent: Node & ParentNode, nextSibling: Node | null): void;
@@ -14,7 +14,7 @@ export declare function intersection(count: number, fn: SignalFn<never>, getInte
14
14
  export declare function closure<T>(fn: SignalFn<T> | 0, getIntersection?: () => Signal<never>): Signal<T>;
15
15
  export declare function loopClosure<T>(ownerLoopNodeAccessor: Accessor, fn: SignalFn<T> | 0, getIntersection?: () => Signal<never>): SignalFn<T>;
16
16
  export declare function conditionalClosure<T>(ownerConditionalNodeAccessor: Accessor, getRenderer: () => Renderer, fn: SignalFn<T> | 0, getIntersection?: () => Signal<never>): SignalFn<T>;
17
- export declare function dynamicClosure<T>(ownerValueAccessor: Accessor, fn: Signal<T> | 0, getOwnerScope?: (scope: Scope) => Scope, getIntersection?: () => Signal<never>): SignalFn<T>;
17
+ export declare function dynamicClosure<T>(fn: Signal<T> | 0, getOwnerScope?: (scope: Scope) => Scope, getIntersection?: () => Signal<never>): SignalFn<T>;
18
18
  export declare function setTagVar(scope: Scope, childAccessor: Accessor, tagVarSignal: Signal<unknown>): void;
19
19
  export declare const tagVarSignal: (scope: Scope, valueOrOp: unknown | SignalOp) => any;
20
20
  export declare function setTagVarChange(scope: Scope, changeHandler: (value: unknown) => void): void;