@lvce-editor/renderer-process 21.4.0 → 21.6.0
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/rendererProcessMain.js +13 -14
- package/package.json +1 -1
|
@@ -695,8 +695,10 @@ const setText$3 = ($Element, value) => {
|
|
|
695
695
|
$Element.nodeValue = value;
|
|
696
696
|
};
|
|
697
697
|
const removeChild = ($Element, index) => {
|
|
698
|
-
const $Child = $Element.
|
|
699
|
-
$Child
|
|
698
|
+
const $Child = $Element.childNodes[index];
|
|
699
|
+
if ($Child) {
|
|
700
|
+
$Child.remove();
|
|
701
|
+
}
|
|
700
702
|
};
|
|
701
703
|
const add$1 = ($Element, nodes, eventMap = {}) => {
|
|
702
704
|
renderInternal($Element, nodes, eventMap, eventMap);
|
|
@@ -705,18 +707,15 @@ const replace = ($Element, nodes, eventMap = {}) => {
|
|
|
705
707
|
// Create a temporary container to render the new nodes
|
|
706
708
|
const $Temp = document.createElement('div');
|
|
707
709
|
renderInternal($Temp, nodes, eventMap, eventMap);
|
|
708
|
-
// Replace the current element with the new
|
|
709
|
-
|
|
710
|
-
if (!$
|
|
711
|
-
//
|
|
712
|
-
|
|
713
|
-
$
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}
|
|
718
|
-
$Element.replaceWith($NewElement);
|
|
719
|
-
return $NewElement;
|
|
710
|
+
// Replace the current element with the new node(s)
|
|
711
|
+
const $NewNode = $Temp.firstChild;
|
|
712
|
+
if (!$NewNode) {
|
|
713
|
+
// No node was created, just remove the old element
|
|
714
|
+
$Element.remove();
|
|
715
|
+
return $Element;
|
|
716
|
+
}
|
|
717
|
+
$Element.replaceWith($NewNode);
|
|
718
|
+
return $NewNode;
|
|
720
719
|
};
|
|
721
720
|
const SetText = 1;
|
|
722
721
|
const Replace = 2;
|