oxiui-lib 0.2.0 → 0.2.1
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/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IComponent } from "../types/component.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type {
|
|
3
|
+
CommonProps,
|
|
4
|
+
InputProps,
|
|
5
|
+
IntrinsicElements,
|
|
6
6
|
} from "../types/html.js";
|
|
7
7
|
|
|
8
8
|
export class HTMLRenderer {
|
|
@@ -38,8 +38,7 @@ export class HTMLRenderer {
|
|
|
38
38
|
this.replaceNode(index, newNode);
|
|
39
39
|
this.oldRoot = this.cloneTree(tree);
|
|
40
40
|
this.nodeMap.forEach((e, k) => {
|
|
41
|
-
|
|
42
|
-
if (!this.findByIndex(this.oldRoot!, k)) {
|
|
41
|
+
if (!this.oldRoot || !this.findByIndex(this.oldRoot, k)) {
|
|
43
42
|
this.nodeMap.delete(k);
|
|
44
43
|
}
|
|
45
44
|
});
|
|
@@ -176,7 +175,7 @@ export class HTMLRenderer {
|
|
|
176
175
|
node: IComponent<keyof IntrinsicElements>,
|
|
177
176
|
) {
|
|
178
177
|
if (index === "0") this.replaceRoot(node);
|
|
179
|
-
const oldNode = this.findByIndex(this.oldRoot
|
|
178
|
+
const oldNode = this.oldRoot && this.findByIndex(this.oldRoot, index);
|
|
180
179
|
if (!oldNode) return;
|
|
181
180
|
|
|
182
181
|
const domNode = this.nodeMap.get(oldNode.index);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./html";
|
package/src/index.ts
CHANGED