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,6 +1,6 @@
1
1
  {
2
2
  "name": "oxiui-lib",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "module": "src/index.ts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,8 +1,8 @@
1
1
  import type { IComponent } from "../types/component.js";
2
- import {
3
- type CommonProps,
4
- type InputProps,
5
- type IntrinsicElements,
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
- // clean map
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!, index);
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
@@ -1,3 +1,4 @@
1
1
  export * from "./core/elements";
2
+ export * from "./core/renderers";
2
3
  export * from "./core/scheduler";
3
4
  export * from "./core/signals";