revojs 0.0.77 → 0.0.78

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -592,12 +592,14 @@ function hydrate(scope, parentNode, slot, index, previous) {
592
592
  if (previous$1 && hydration !== previous$1) if (Array.isArray(hydration)) if (Array.isArray(previous$1)) {
593
593
  const range = toRange(previous$1);
594
594
  range.deleteContents();
595
+ range.collapse(true);
595
596
  range.insertNode(toFragment(hydration));
596
597
  } else if (parentNode.contains(previous$1)) parentNode.replaceChild(toFragment(hydration), previous$1);
597
598
  else parentNode.replaceChild(toFragment(hydration), parentNode.childNodes.item(index));
598
599
  else if (Array.isArray(previous$1)) {
599
600
  const range = toRange(previous$1);
600
601
  range.deleteContents();
602
+ range.collapse(true);
601
603
  range.insertNode(hydration);
602
604
  } else if (parentNode.contains(previous$1)) parentNode.replaceChild(hydration, previous$1);
603
605
  else parentNode.replaceChild(hydration, parentNode.childNodes.item(index));
@@ -625,7 +627,11 @@ function hydrate(scope, parentNode, slot, index, previous) {
625
627
  return target.setAttribute(name, set);
626
628
  }
627
629
  });
628
- for (const [index$1, childSlot] of slot.children.entries()) hydrate(scope, hydration, childSlot, index$1, previous);
630
+ let index$1 = 0;
631
+ for (const childSlot of slot.children) {
632
+ const nodes = toArray(hydrate(scope, hydration, childSlot, index$1));
633
+ index$1 += nodes.length || 1;
634
+ }
629
635
  }
630
636
  hydration ??= document.createComment("");
631
637
  if (parentNode.childNodes.item(index) === null) parentNode.appendChild(toFragment(hydration));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revojs",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "type": "module",
5
5
  "repository": "coverbase/revojs",
6
6
  "license": "MIT",