ziko 0.38.1 → 0.39.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.
@@ -1,9 +1,9 @@
1
- import ZikoUIElement from "../constructors/ZikoUIElement.js";
1
+ import UIElement from "../constructors/UIElement.js";
2
2
  import { HTMLTags, SVGTags } from "./tags-list.js";
3
3
  import { isStateGetter } from "../../hooks/use-state.js";
4
4
  const _h=(tag, type, attributes, ...children)=>{
5
5
  const { name, style, ...attrs } = attributes;
6
- let element = new ZikoUIElement(tag, name, type);
6
+ let element = new UIElement(tag, name, type);
7
7
  style && element.style(style);
8
8
  attrs && element.setAttr(attrs);
9
9
  children && element.append(...children);
@@ -28,18 +28,18 @@ const tags = new Proxy({}, {
28
28
  // }
29
29
  if(
30
30
  ['string', 'number'].includes(typeof args[0])
31
- || args[0] instanceof ZikoUIElement
31
+ || args[0] instanceof UIElement
32
32
  || (typeof args[0] === 'function' && args[0]().isStateGetter())
33
- ) return new ZikoUIElement(tag, tag, {type}).append(...args);
34
- return new ZikoUIElement(tag).setAttr(args.shift()).append(...args)
33
+ ) return new UIElement({element :tag, name : tag, type}).append(...args);
34
+ return new UIElement({element : tag}).setAttr(args.shift()).append(...args)
35
35
  }
36
- // if(SVGTags.includes(tag)) return (...args) => new ZikoUIElement(tag,"",{el_type : "svg"}).append(...args);
36
+ // if(SVGTags.includes(tag)) return (...args) => new UIElement(tag,"",{el_type : "svg"}).append(...args);
37
37
  // return (...args)=>{
38
- // if(!(args[0] instanceof ZikoUIElement) && args[0] instanceof Object){
38
+ // if(!(args[0] instanceof UIElement) && args[0] instanceof Object){
39
39
  // let attributes = args.shift()
40
- // return new ZikoUIElement(tag).setAttr(attributes).append(...args)
40
+ // return new UIElement(tag).setAttr(attributes).append(...args)
41
41
  // }
42
- // return new ZikoUIElement(tag).append(...args);
42
+ // return new UIElement(tag).append(...args);
43
43
  // }
44
44
  // // switch(tag){
45
45
  // case "html" : globalThis?.document?.createElement("html")
@@ -49,7 +49,7 @@ const tags = new Proxy({}, {
49
49
  // case "meta" :
50
50
  // case "srcipt":
51
51
  // case "body" : return null; break;
52
- // default : return new ZikoUIElement(tag);
52
+ // default : return new UIElement(tag);
53
53
  // }
54
54
  }
55
55
  });
@@ -1,5 +1,5 @@
1
- import ZikoUINode from "../constructors/ZikoUINode.js";
2
- class ZikoUIText extends ZikoUINode {
1
+ import UINode from "../constructors/UINode.js";
2
+ class ZikoUIText extends UINode {
3
3
  constructor(...value) {
4
4
  super("span", "text", false, ...value);
5
5
  this.element = globalThis?.document?.createTextNode(...value)
@@ -1,7 +1,7 @@
1
- import ZikoUIElement from "../constructors/ZikoUIElement.js";
2
- class ZikoUIXMLWrapper extends ZikoUIElement{
1
+ import UIElement from "../constructors/UIElement.js";
2
+ class ZikoUIXMLWrapper extends UIElement{
3
3
  constructor(XMLContent, type){
4
- super("div", "")
4
+ super({element : "div", name : ""})
5
5
  this.element.append(type==="svg"?svg2dom(XMLContent):html2dom(XMLContent))
6
6
  }
7
7
  }