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.
- package/dist/ziko.cjs +108 -673
- package/dist/ziko.js +108 -673
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +107 -670
- package/package.json +1 -1
- package/src/events/types/clipboard.d.ts +2 -2
- package/src/events/types/focus.d.ts +2 -2
- package/src/events/types/pointer.d.ts +2 -2
- package/src/reactivity/hooks/UI/index.js +1 -1
- package/src/ui/__methods__/attrs.js +46 -0
- package/src/ui/__methods__/index.js +2 -1
- package/src/ui/__methods__/style.js +14 -0
- package/src/ui/__utils__/index.js +2 -2
- package/src/ui/constructors/{ZikoUIElement.js → UIElement.js} +23 -64
- package/src/ui/constructors/{ZikoUINode.js → UINode.js} +2 -2
- package/src/ui/flex/index.js +8 -8
- package/src/ui/graphics/canvas.js +2 -2
- package/src/ui/graphics/svg.js +2 -2
- package/src/ui/grid/index.js +4 -4
- package/src/ui/index.js +2 -2
- package/src/ui/suspense/index.js +3 -3
- package/src/ui/tags/index.d.ts.txt +125 -125
- package/src/ui/tags/index.js +10 -10
- package/src/ui/text/index.js +2 -2
- package/src/ui/wrapper/index.js +3 -3
package/src/ui/tags/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
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
|
|
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
|
|
31
|
+
|| args[0] instanceof UIElement
|
|
32
32
|
|| (typeof args[0] === 'function' && args[0]().isStateGetter())
|
|
33
|
-
) return new
|
|
34
|
-
return new
|
|
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
|
|
36
|
+
// if(SVGTags.includes(tag)) return (...args) => new UIElement(tag,"",{el_type : "svg"}).append(...args);
|
|
37
37
|
// return (...args)=>{
|
|
38
|
-
// if(!(args[0] instanceof
|
|
38
|
+
// if(!(args[0] instanceof UIElement) && args[0] instanceof Object){
|
|
39
39
|
// let attributes = args.shift()
|
|
40
|
-
// return new
|
|
40
|
+
// return new UIElement(tag).setAttr(attributes).append(...args)
|
|
41
41
|
// }
|
|
42
|
-
// return new
|
|
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
|
|
52
|
+
// default : return new UIElement(tag);
|
|
53
53
|
// }
|
|
54
54
|
}
|
|
55
55
|
});
|
package/src/ui/text/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
class ZikoUIText extends
|
|
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)
|
package/src/ui/wrapper/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
class ZikoUIXMLWrapper extends
|
|
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
|
}
|