ziko 0.42.0 → 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/dist/ziko.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Sun Aug 24 2025 12:13:24 GMT+0100 (UTC+01:00)
5
+ Date : Sun Aug 24 2025 12:52:45 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
@@ -1150,28 +1150,34 @@
1150
1150
  });
1151
1151
  }
1152
1152
 
1153
- const __UI__={
1154
- __all__(){
1155
- return Object.values(this)
1156
- .filter(Array.isArray)
1157
- .flat();
1158
- },
1159
- querySelectorAll(){
1160
- return this.__all__().filter(n=>n)
1161
- },
1162
- getElementByIndex(index){
1163
- return this.__all__().find(n=>n.ui_index===index);
1164
- },
1165
- getElementById(id){
1166
- return null;
1167
- },
1168
- getElementsByClass(){
1169
-
1170
- },
1171
- getElementsByTagName(){
1172
-
1153
+ class UIStore extends Array {
1154
+ constructor(...args) {
1155
+ super(...args);
1173
1156
  }
1174
- };
1157
+ getItemById(id) {
1158
+ return this.find(n => n.element.id === id);
1159
+ }
1160
+ getItemsByTagName(tag) {
1161
+ return this.filter(n => n.element.tagName.toLowerCase() === tag.toLowerCase());
1162
+ }
1163
+ getElementsByClassName(className) {
1164
+ return this.filter(n => n.element.classList?.contains(className));
1165
+ }
1166
+ querySelector(selector) {
1167
+ const el = globalThis?.document?.querySelector(selector);
1168
+ if (!el) return null;
1169
+ return this.find(ui => ui.element === el) || null;
1170
+ }
1171
+ querySelectorAll(selector) {
1172
+ const els = globalThis?.document?.querySelectorAll(selector);
1173
+ return Array.from(els)
1174
+ .map(el => this.find(ui => ui.element === el))
1175
+ .filter(Boolean);
1176
+ }
1177
+ }
1178
+
1179
+ // create the singleton
1180
+ const __UI__ = new UIStore();
1175
1181
 
1176
1182
  const __Config__ = {
1177
1183
  default:{
@@ -1194,10 +1200,10 @@
1194
1200
  };
1195
1201
 
1196
1202
  const __HYDRATION__ = {
1197
- map : new Map(),
1203
+ store : new Map(),
1198
1204
  index : 0,
1199
- increment : function(){
1200
- return this.index ++
1205
+ register: function(component){
1206
+ this.store.set(this.index++, component);
1201
1207
  }
1202
1208
  };
1203
1209
 
@@ -1205,6 +1211,9 @@
1205
1211
  ui_index : 0,
1206
1212
  get_ui_index:function(){
1207
1213
  return this.ui_index ++
1214
+ },
1215
+ register_ui: function(UIElement){
1216
+
1208
1217
  }
1209
1218
  };
1210
1219
 
@@ -1227,7 +1236,6 @@
1227
1236
  __UI__,
1228
1237
  __HYDRATION__,
1229
1238
  __State__,
1230
- // __HYDRATION_MAP__,
1231
1239
  __Config__,
1232
1240
  __CACHE__,
1233
1241
  };
@@ -2875,7 +2883,7 @@
2875
2883
 
2876
2884
  __init__global__();
2877
2885
  class UIElement extends UINode{
2878
- constructor({element, name ='', type="html", useDefaultStyle=false}={}){
2886
+ constructor({element, name ='', type="html", render = __Ziko__.__Config__.default.render, useDefaultStyle=false}={}){
2879
2887
  super();
2880
2888
  this.target = globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body;
2881
2889
  if(typeof element === "string") {
@@ -2926,8 +2934,8 @@
2926
2934
  resize:null,
2927
2935
  intersection:null
2928
2936
  };
2929
- if(element)Object.assign(this.cache,{element});
2930
- this.uuid = `${this.cache.name}-${Random.string(16)}`;
2937
+ if(element) Object.assign(this.cache,{element});
2938
+ // this.uuid = `${this.cache.name}-${Random.string(16)}`
2931
2939
  this.ui_index = globalThis.__Ziko__.__CACHE__.get_ui_index();
2932
2940
  useDefaultStyle && this.style({
2933
2941
  position: "relative",
@@ -2937,9 +2945,9 @@
2937
2945
  width : "auto",
2938
2946
  height : "auto"
2939
2947
  });
2940
- this.items = [];
2948
+ this.items = new UIStore();
2941
2949
  globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
2942
- element && globalThis.__Ziko__.__Config__.default.render && this?.render?.();
2950
+ element && render && this?.render?.();
2943
2951
  if(
2944
2952
  // globalThis.__Ziko__.__Config__.renderingMode !== "spa"
2945
2953
  // &&
@@ -2948,9 +2956,9 @@
2948
2956
  this.isInteractive()
2949
2957
  ){
2950
2958
  this.setAttr("ziko-hydration-index", globalThis.__Ziko__.__HYDRATION__.index);
2951
- globalThis.__Ziko__.__HYDRATION__.map.set(globalThis.__Ziko__.__HYDRATION__.index, ()=>this);
2952
- globalThis.__Ziko__.__HYDRATION__.increment();
2959
+ globalThis.__Ziko__.__HYDRATION__.register(() => this);
2953
2960
  }
2961
+ globalThis.__Ziko__.__UI__.push(this);
2954
2962
  }
2955
2963
  get element(){
2956
2964
  return this.cache.element;
@@ -3001,14 +3009,13 @@
3001
3009
  return this.element.getBoundingClientRect().left;
3002
3010
  }
3003
3011
  clone(render=false) {
3004
- const UI = new this.constructor();
3005
- UI.__proto__=this.__proto__;
3006
- if(this.items.length){
3007
- const items = [...this.items].map(n=>n.clone());
3008
- UI.append(...items);
3009
- }
3010
- else UI.element=this.element.cloneNode(true);
3011
- return UI.render(render);
3012
+ // UI.__proto__=this.__proto__;
3013
+ // if(this.items.length){
3014
+ // const items = [...this.items].map(n=>n.clone());
3015
+ // UI.append(...items);
3016
+ // }
3017
+ // else UI.element=this.element.cloneNode(true);
3018
+ // return UI.render(render);
3012
3019
  }
3013
3020
  [Symbol.iterator]() {
3014
3021
  return this.items[Symbol.iterator]();
@@ -3027,14 +3034,14 @@
3027
3034
  this.cache.isFrozzen=freeze;
3028
3035
  return this;
3029
3036
  }
3030
- setTarget(tg) {
3031
- if(this.isBody) return ;
3032
- if (tg?.isZikoUIElement) tg = tg.element;
3033
- this.unrender();
3034
- this.target = tg;
3035
- this.render();
3036
- return this;
3037
- }
3037
+ // setTarget(tg) {
3038
+ // if(this.isBody) return ;
3039
+ // if (tg?.isZikoUIElement) tg = tg.element;
3040
+ // this.unrender();
3041
+ // this.target = tg;
3042
+ // this.render();
3043
+ // return this;
3044
+ // }
3038
3045
  describe(label){
3039
3046
  if(label)this.setAttr("aria-label",label);
3040
3047
  }
package/dist/ziko.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Sun Aug 24 2025 12:13:24 GMT+0100 (UTC+01:00)
5
+ Date : Sun Aug 24 2025 12:52:45 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
@@ -1144,28 +1144,34 @@ function defineParamsGetter$1(target ){
1144
1144
  });
1145
1145
  }
1146
1146
 
1147
- const __UI__={
1148
- __all__(){
1149
- return Object.values(this)
1150
- .filter(Array.isArray)
1151
- .flat();
1152
- },
1153
- querySelectorAll(){
1154
- return this.__all__().filter(n=>n)
1155
- },
1156
- getElementByIndex(index){
1157
- return this.__all__().find(n=>n.ui_index===index);
1158
- },
1159
- getElementById(id){
1160
- return null;
1161
- },
1162
- getElementsByClass(){
1163
-
1164
- },
1165
- getElementsByTagName(){
1166
-
1147
+ class UIStore extends Array {
1148
+ constructor(...args) {
1149
+ super(...args);
1167
1150
  }
1168
- };
1151
+ getItemById(id) {
1152
+ return this.find(n => n.element.id === id);
1153
+ }
1154
+ getItemsByTagName(tag) {
1155
+ return this.filter(n => n.element.tagName.toLowerCase() === tag.toLowerCase());
1156
+ }
1157
+ getElementsByClassName(className) {
1158
+ return this.filter(n => n.element.classList?.contains(className));
1159
+ }
1160
+ querySelector(selector) {
1161
+ const el = globalThis?.document?.querySelector(selector);
1162
+ if (!el) return null;
1163
+ return this.find(ui => ui.element === el) || null;
1164
+ }
1165
+ querySelectorAll(selector) {
1166
+ const els = globalThis?.document?.querySelectorAll(selector);
1167
+ return Array.from(els)
1168
+ .map(el => this.find(ui => ui.element === el))
1169
+ .filter(Boolean);
1170
+ }
1171
+ }
1172
+
1173
+ // create the singleton
1174
+ const __UI__ = new UIStore();
1169
1175
 
1170
1176
  const __Config__ = {
1171
1177
  default:{
@@ -1188,10 +1194,10 @@ const __Config__ = {
1188
1194
  };
1189
1195
 
1190
1196
  const __HYDRATION__ = {
1191
- map : new Map(),
1197
+ store : new Map(),
1192
1198
  index : 0,
1193
- increment : function(){
1194
- return this.index ++
1199
+ register: function(component){
1200
+ this.store.set(this.index++, component);
1195
1201
  }
1196
1202
  };
1197
1203
 
@@ -1199,6 +1205,9 @@ const __CACHE__ = {
1199
1205
  ui_index : 0,
1200
1206
  get_ui_index:function(){
1201
1207
  return this.ui_index ++
1208
+ },
1209
+ register_ui: function(UIElement){
1210
+
1202
1211
  }
1203
1212
  };
1204
1213
 
@@ -1221,7 +1230,6 @@ function __init__global__(){
1221
1230
  __UI__,
1222
1231
  __HYDRATION__,
1223
1232
  __State__,
1224
- // __HYDRATION_MAP__,
1225
1233
  __Config__,
1226
1234
  __CACHE__,
1227
1235
  };
@@ -2869,7 +2877,7 @@ const useMediaQuery = (mediaQueryRules,fallback) => new ZikoUseMediaQuery(mediaQ
2869
2877
 
2870
2878
  __init__global__();
2871
2879
  class UIElement extends UINode{
2872
- constructor({element, name ='', type="html", useDefaultStyle=false}={}){
2880
+ constructor({element, name ='', type="html", render = __Ziko__.__Config__.default.render, useDefaultStyle=false}={}){
2873
2881
  super();
2874
2882
  this.target = globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body;
2875
2883
  if(typeof element === "string") {
@@ -2920,8 +2928,8 @@ class UIElement extends UINode{
2920
2928
  resize:null,
2921
2929
  intersection:null
2922
2930
  };
2923
- if(element)Object.assign(this.cache,{element});
2924
- this.uuid = `${this.cache.name}-${Random.string(16)}`;
2931
+ if(element) Object.assign(this.cache,{element});
2932
+ // this.uuid = `${this.cache.name}-${Random.string(16)}`
2925
2933
  this.ui_index = globalThis.__Ziko__.__CACHE__.get_ui_index();
2926
2934
  useDefaultStyle && this.style({
2927
2935
  position: "relative",
@@ -2931,9 +2939,9 @@ class UIElement extends UINode{
2931
2939
  width : "auto",
2932
2940
  height : "auto"
2933
2941
  });
2934
- this.items = [];
2942
+ this.items = new UIStore();
2935
2943
  globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
2936
- element && globalThis.__Ziko__.__Config__.default.render && this?.render?.();
2944
+ element && render && this?.render?.();
2937
2945
  if(
2938
2946
  // globalThis.__Ziko__.__Config__.renderingMode !== "spa"
2939
2947
  // &&
@@ -2942,9 +2950,9 @@ class UIElement extends UINode{
2942
2950
  this.isInteractive()
2943
2951
  ){
2944
2952
  this.setAttr("ziko-hydration-index", globalThis.__Ziko__.__HYDRATION__.index);
2945
- globalThis.__Ziko__.__HYDRATION__.map.set(globalThis.__Ziko__.__HYDRATION__.index, ()=>this);
2946
- globalThis.__Ziko__.__HYDRATION__.increment();
2953
+ globalThis.__Ziko__.__HYDRATION__.register(() => this);
2947
2954
  }
2955
+ globalThis.__Ziko__.__UI__.push(this);
2948
2956
  }
2949
2957
  get element(){
2950
2958
  return this.cache.element;
@@ -2995,14 +3003,13 @@ class UIElement extends UINode{
2995
3003
  return this.element.getBoundingClientRect().left;
2996
3004
  }
2997
3005
  clone(render=false) {
2998
- const UI = new this.constructor();
2999
- UI.__proto__=this.__proto__;
3000
- if(this.items.length){
3001
- const items = [...this.items].map(n=>n.clone());
3002
- UI.append(...items);
3003
- }
3004
- else UI.element=this.element.cloneNode(true);
3005
- return UI.render(render);
3006
+ // UI.__proto__=this.__proto__;
3007
+ // if(this.items.length){
3008
+ // const items = [...this.items].map(n=>n.clone());
3009
+ // UI.append(...items);
3010
+ // }
3011
+ // else UI.element=this.element.cloneNode(true);
3012
+ // return UI.render(render);
3006
3013
  }
3007
3014
  [Symbol.iterator]() {
3008
3015
  return this.items[Symbol.iterator]();
@@ -3021,14 +3028,14 @@ class UIElement extends UINode{
3021
3028
  this.cache.isFrozzen=freeze;
3022
3029
  return this;
3023
3030
  }
3024
- setTarget(tg) {
3025
- if(this.isBody) return ;
3026
- if (tg?.isZikoUIElement) tg = tg.element;
3027
- this.unrender();
3028
- this.target = tg;
3029
- this.render();
3030
- return this;
3031
- }
3031
+ // setTarget(tg) {
3032
+ // if(this.isBody) return ;
3033
+ // if (tg?.isZikoUIElement) tg = tg.element;
3034
+ // this.unrender();
3035
+ // this.target = tg;
3036
+ // this.render();
3037
+ // return this;
3038
+ // }
3032
3039
  describe(label){
3033
3040
  if(label)this.setAttr("aria-label",label);
3034
3041
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.42.0",
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",
@@ -2,5 +2,8 @@ export const __CACHE__ = {
2
2
  ui_index : 0,
3
3
  get_ui_index:function(){
4
4
  return this.ui_index ++
5
+ },
6
+ register_ui: function(UIElement){
7
+
5
8
  }
6
9
  }
@@ -1,8 +1,7 @@
1
1
  export const __HYDRATION__ = {
2
- map : new Map(),
2
+ store : new Map(),
3
3
  index : 0,
4
- increment : function(){
5
- return this.index ++
4
+ register: function(component){
5
+ this.store.set(this.index++, component)
6
6
  }
7
- }
8
- export const __HYDRATION_MAP__ = new Map()
7
+ }
@@ -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,22 +1,28 @@
1
- export const __UI__={
2
- __all__(){
3
- return Object.values(this)
4
- .filter(Array.isArray)
5
- .flat();
6
- },
7
- querySelectorAll(){
8
- return this.__all__().filter(n=>n)
9
- },
10
- getElementByIndex(index){
11
- return this.__all__().find(n=>n.ui_index===index);
12
- },
13
- getElementById(id){
14
- return null;
15
- },
16
- getElementsByClass(){
17
-
18
- },
19
- getElementsByTagName(){
20
-
1
+ export class UIStore extends Array {
2
+ constructor(...args) {
3
+ super(...args);
4
+ }
5
+ getItemById(id) {
6
+ return this.find(n => n.element.id === id);
7
+ }
8
+ getItemsByTagName(tag) {
9
+ return this.filter(n => n.element.tagName.toLowerCase() === tag.toLowerCase());
10
+ }
11
+ getElementsByClassName(className) {
12
+ return this.filter(n => n.element.classList?.contains(className));
21
13
  }
22
- }
14
+ querySelector(selector) {
15
+ const el = globalThis?.document?.querySelector(selector);
16
+ if (!el) return null;
17
+ return this.find(ui => ui.element === el) || null;
18
+ }
19
+ querySelectorAll(selector) {
20
+ const els = globalThis?.document?.querySelectorAll(selector);
21
+ return Array.from(els)
22
+ .map(el => this.find(ui => ui.element === el))
23
+ .filter(Boolean);
24
+ }
25
+ }
26
+
27
+ // create the singleton
28
+ export const __UI__ = new UIStore();
@@ -1,7 +1,7 @@
1
1
  import { defineParamsGetter } from './params.js';
2
2
  import { __UI__ } from './__ui__.js';
3
3
  import { __Config__ } from './__config__.js';
4
- import { __HYDRATION__, __HYDRATION_MAP__ } from './__hydration__.js';
4
+ import { __HYDRATION__ } from './__hydration__.js';
5
5
  import { __CACHE__ } from './__cache__.js';
6
6
  import { __State__ } from './__state__.js';
7
7
  export function __init__global__(){
@@ -10,10 +10,10 @@ export function __init__global__(){
10
10
  __UI__,
11
11
  __HYDRATION__,
12
12
  __State__,
13
- // __HYDRATION_MAP__,
14
13
  __Config__,
15
14
  __CACHE__,
16
15
  };
17
16
  defineParamsGetter(__Ziko__)
18
17
  }
19
18
  }
19
+ export { UIStore } from './__ui__.js'
@@ -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
-
11
10
  import {
12
11
  useCustomEvent,
13
12
  useSwipeEvent,
@@ -16,11 +15,11 @@ import {
16
15
  watchAttr,
17
16
  watchChildren
18
17
  } from "../../reactivity/index.js"
19
- import { Random } from "../../math/index.js";
20
- import {__init__global__} from '../../__ziko__/index.js';
18
+ // import { Random } from "../../math/index.js";
19
+ import {__init__global__, UIStore} from '../../__ziko__/index.js';
21
20
  __init__global__()
22
21
  class UIElement extends UINode{
23
- constructor({element, name ='', type="html", useDefaultStyle=false}={}){
22
+ constructor({element, name ='', type="html", render = __Ziko__.__Config__.default.render, useDefaultStyle=false}={}){
24
23
  super()
25
24
  this.target = globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body;
26
25
  if(typeof element === "string") {
@@ -71,8 +70,8 @@ class UIElement extends UINode{
71
70
  resize:null,
72
71
  intersection:null
73
72
  }
74
- if(element)Object.assign(this.cache,{element});
75
- this.uuid = `${this.cache.name}-${Random.string(16)}`
73
+ if(element) Object.assign(this.cache,{element});
74
+ // this.uuid = `${this.cache.name}-${Random.string(16)}`
76
75
  this.ui_index = globalThis.__Ziko__.__CACHE__.get_ui_index();
77
76
  useDefaultStyle && this.style({
78
77
  position: "relative",
@@ -82,9 +81,9 @@ class UIElement extends UINode{
82
81
  width : "auto",
83
82
  height : "auto"
84
83
  });
85
- this.items = [];
84
+ this.items = new UIStore();
86
85
  globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
87
- element && globalThis.__Ziko__.__Config__.default.render && this?.render?.()
86
+ element && render && this?.render?.()
88
87
  if(
89
88
  // globalThis.__Ziko__.__Config__.renderingMode !== "spa"
90
89
  // &&
@@ -93,9 +92,9 @@ class UIElement extends UINode{
93
92
  this.isInteractive()
94
93
  ){
95
94
  this.setAttr("ziko-hydration-index", globalThis.__Ziko__.__HYDRATION__.index);
96
- globalThis.__Ziko__.__HYDRATION__.map.set(globalThis.__Ziko__.__HYDRATION__.index, ()=>this);
97
- globalThis.__Ziko__.__HYDRATION__.increment()
95
+ globalThis.__Ziko__.__HYDRATION__.register(() => this)
98
96
  }
97
+ globalThis.__Ziko__.__UI__.push(this)
99
98
  }
100
99
  get element(){
101
100
  return this.cache.element;
@@ -146,14 +145,13 @@ class UIElement extends UINode{
146
145
  return this.element.getBoundingClientRect().left;
147
146
  }
148
147
  clone(render=false) {
149
- const UI = new this.constructor();
150
- UI.__proto__=this.__proto__;
151
- if(this.items.length){
152
- const items = [...this.items].map(n=>n.clone());
153
- UI.append(...items);
154
- }
155
- else UI.element=this.element.cloneNode(true);
156
- return UI.render(render);
148
+ // UI.__proto__=this.__proto__;
149
+ // if(this.items.length){
150
+ // const items = [...this.items].map(n=>n.clone());
151
+ // UI.append(...items);
152
+ // }
153
+ // else UI.element=this.element.cloneNode(true);
154
+ // return UI.render(render);
157
155
  }
158
156
  [Symbol.iterator]() {
159
157
  return this.items[Symbol.iterator]();
@@ -172,14 +170,14 @@ class UIElement extends UINode{
172
170
  this.cache.isFrozzen=freeze;
173
171
  return this;
174
172
  }
175
- setTarget(tg) {
176
- if(this.isBody) return ;
177
- if (tg?.isZikoUIElement) tg = tg.element;
178
- this.unrender();
179
- this.target = tg;
180
- this.render();
181
- return this;
182
- }
173
+ // setTarget(tg) {
174
+ // if(this.isBody) return ;
175
+ // if (tg?.isZikoUIElement) tg = tg.element;
176
+ // this.unrender();
177
+ // this.target = tg;
178
+ // this.render();
179
+ // return this;
180
+ // }
183
181
  describe(label){
184
182
  if(label)this.setAttr("aria-label",label)
185
183
  }
@@ -254,4 +252,4 @@ class UIElement extends UINode{
254
252
  }
255
253
 
256
254
  }
257
- 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 : ""})