ziko 0.42.1 → 0.43.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.42.1",
3
+ "version": "0.43.0",
4
4
  "description": "A versatile JavaScript library offering a rich set of Hyperscript Based UI components, advanced mathematical utilities, interactivity ,animations, client side routing and more ...",
5
5
  "keywords": [
6
6
  "front-end",
@@ -3,7 +3,7 @@ export const __State__ = {
3
3
  index : import.meta.hot?.data?.__Ziko__?.__State__?.index ?? 0,
4
4
  register: function(state){
5
5
  console.log({
6
- hmr : import.meta.hot?.data.__Ziko__.__State__.index,
6
+ // hmr : import.meta.hot?.data.__Ziko__.__State__.index,
7
7
  index : this.index
8
8
  })
9
9
  this.store.set(this.index++, state)
@@ -1,23 +1,23 @@
1
1
  import { isStateGetter } from '../../hooks/use-state.js'
2
2
  export const StyleMethods = {
3
- // style(styles){
4
- // for(let key in styles){
5
- // const value = styles[key];
6
- // if(isStateGetter(value)){
7
- // const getter = value()
8
- // Object.assign(this.element.style, {[key] : getter.value})
9
- // getter._subscribe(
10
- // (newValue) => {
11
- // console.log({newValue})
12
- // Object.assign(this.element.style, {[key] : newValue})
13
- // },
14
- // // this
15
- // );
16
- // }
17
- // else Object.assign(this.element.style, {[key] : value})
18
- // }
19
- // return this;
20
- // },
3
+ style(styles){
4
+ for(let key in styles){
5
+ const value = styles[key];
6
+ if(isStateGetter(value)){
7
+ const getter = value()
8
+ Object.assign(this.element.style, {[key] : getter.value})
9
+ getter._subscribe(
10
+ (newValue) => {
11
+ console.log({newValue})
12
+ Object.assign(this.element.style, {[key] : newValue})
13
+ },
14
+ // this
15
+ );
16
+ }
17
+ else Object.assign(this.element.style, {[key] : value})
18
+ }
19
+ return this;
20
+ },
21
21
  size(width, height){
22
22
  return this.style({width, height})
23
23
  },
@@ -1,4 +1,4 @@
1
- import UIElement from "../constructors/UIElement.js";
1
+ import { UIElement } from "../constructors/UIElement.js";
2
2
  const Id = (a) => document.getElementById(a);
3
3
  const Class = (a) => [...document.getElementsByClassName(a)];
4
4
  const $=(...selector)=>{
@@ -1,4 +1,4 @@
1
- import UINode from "./UINode.js";
1
+ import {UINode} from "./UINode.js";
2
2
  import { register } from "../../__helpers__/register/index.js";
3
3
  import {
4
4
  AttrsMethods,
@@ -7,7 +7,6 @@ import {
7
7
  EventsMethodes,
8
8
  StyleMethods
9
9
  } from "../__methods__/index.js";
10
- import { isStateGetter } from "../../hooks/use-state.js";
11
10
  import {
12
11
  useCustomEvent,
13
12
  useSwipeEvent,
@@ -106,24 +105,6 @@ class UIElement extends UINode{
106
105
  isZikoUIElement(){
107
106
  return true;
108
107
  }
109
- style(styles){
110
- for(let key in styles){
111
- const value = styles[key];
112
- if(isStateGetter(value)){
113
- const getter = value()
114
- Object.assign(this.element.style, {[key] : getter.value})
115
- getter._subscribe(
116
- (newValue) => {
117
- console.log({newValue})
118
- Object.assign(this.element.style, {[key] : newValue})
119
- },
120
- // this
121
- );
122
- }
123
- else Object.assign(this.element.style, {[key] : value})
124
- }
125
- return this;
126
- }
127
108
  get st(){
128
109
  return this.cache.style;
129
110
  }
@@ -271,4 +252,4 @@ class UIElement extends UINode{
271
252
  }
272
253
 
273
254
  }
274
- export default UIElement;
255
+ export { UIElement }
@@ -1,4 +1,4 @@
1
- export default class UINode {
1
+ export class UINode {
2
2
  constructor(node){
3
3
  this.cache = {
4
4
  node
@@ -12,4 +12,4 @@ export default class UINode {
12
12
  }
13
13
  }
14
14
 
15
- globalThis.node = (node) => new UINode(node);
15
+ // globalThis.node = (node) => new UINode(node);
@@ -1,4 +1,4 @@
1
- import UIElement from "../constructors/UIElement.js";
1
+ import { UIElement } from "../constructors/UIElement.js";
2
2
  class ZikoUIFlex extends UIElement {
3
3
  constructor(tag = "div", w = "100%", h = "100%") {
4
4
  super({element : tag , name : "Flex"});
@@ -1,4 +1,4 @@
1
- import UIElement from "../constructors/UIElement.js";
1
+ import {UIElement} from "../constructors/UIElement.js";
2
2
  import {Matrix} from "../../math/matrix/Matrix.js"
3
3
  class ZikoUICanvas extends UIElement{
4
4
  constructor(w,h){
@@ -1,4 +1,4 @@
1
- import UIElement from "../constructors/UIElement.js";
1
+ import {UIElement} from "../constructors/UIElement.js";
2
2
  class ZikoUISvg extends UIElement {
3
3
  constructor(w=360,h=300) {
4
4
  super("svg","svg");
@@ -1,4 +1,4 @@
1
- import UIElement from "../constructors/UIElement.js"
1
+ import {UIElement} from "../constructors/UIElement.js"
2
2
  class ZikoUIGrid extends UIElement {
3
3
  constructor(tag ="div", w = "50vw", h = "50vh") {
4
4
  super({element : tag, name : "Grid"});
package/src/ui/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { default as UIElement } from "./constructors/UIElement.js"
2
- export { default as UINode } from "./constructors/UINode.js"
1
+ export * from "./constructors/UIElement.js"
2
+ export * from "./constructors/UINode.js"
3
3
  export * from './tags/index.js';
4
4
  export * from './text/index.js';
5
5
  export * from './flex/index.js';
@@ -1,4 +1,4 @@
1
- import UIElement from "../constructors/UIElement";
1
+ import {UIElement} from "../constructors/UIElement";
2
2
  class ZikoUISuspense extends UIElement{
3
3
  constructor(fallback_ui, callback){
4
4
  super({element : "div", name : "suspense"})
@@ -1,4 +1,4 @@
1
- import UIElement from "../elements/UIElement.js";
1
+ import {UIElement} from "../elements/UIElement.js";
2
2
  interface HtmlTags {
3
3
  a: UIElement;
4
4
  abbr: UIElement;
@@ -1,6 +1,6 @@
1
- import UIElement from "../constructors/UIElement.js";
1
+ import {UIElement} from "../constructors/UIElement.js";
2
2
  import { HTMLTags, SVGTags } from "./tags-list.js";
3
- import { isStateGetter } from "../../hooks/use-state.js";
3
+ // import { isStateGetter } from "../../hooks/use-state.js";
4
4
  const _h=(tag, type, attributes, ...children)=>{
5
5
  const { name, style, ...attrs } = attributes;
6
6
  let element = new UIElement(tag, name, type);
@@ -1,4 +1,4 @@
1
- import UINode from "../constructors/UINode.js";
1
+ import {UINode} from "../constructors/UINode.js";
2
2
  class ZikoUIText extends UINode {
3
3
  constructor(...value) {
4
4
  super("span", "text", false, ...value);
@@ -1,4 +1,4 @@
1
- import UIElement from "../constructors/UIElement.js";
1
+ import {UIElement} from "../constructors/UIElement.js";
2
2
  class ZikoUIXMLWrapper extends UIElement{
3
3
  constructor(XMLContent, type){
4
4
  super({element : "div", name : ""})