ziko 0.0.25 → 0.0.26

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.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Sun Feb 09 2025 19:26:57 GMT+0100 (UTC+01:00)
5
+ Date : Sat Mar 08 2025 13:43:10 GMT+0000 (UTC)
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
@@ -1943,7 +1943,49 @@ class ZikoEventClick extends ZikoEvent{
1943
1943
  return this;
1944
1944
  }
1945
1945
  }
1946
- const useClickEvent=target=>new ZikoEventClick(target);
1946
+ const useClickEvent=target=>new ZikoEventClick(target);
1947
+
1948
+
1949
+ //
1950
+
1951
+
1952
+ // import { ZikoEvent, EVENT_CONTROLLER } from "./ZikoEvent.js";
1953
+
1954
+ // class ZikoEventClick extends ZikoEvent {
1955
+ // constructor(target) {
1956
+ // super(target);
1957
+ // this.event = null;
1958
+ // this.cache = {
1959
+ // prefixe: "",
1960
+ // preventDefault: { click: false, dbclick: false },
1961
+ // paused: { click: false, dbclick: false },
1962
+ // stream: {
1963
+ // enabled: { click: false, dbclick: false },
1964
+ // clear: { click: false, dbclick: false },
1965
+ // history: { click: [], dbclick: [] }
1966
+ // },
1967
+ // callbacks: { click: [], dbclick: [] }
1968
+ // };
1969
+
1970
+ // this.__controller = {};
1971
+ // ["click", "dbclick"].forEach(evt => {
1972
+ // this.__controller[evt] = (e) => EVENT_CONTROLLER.call(this, e, evt, null, null);
1973
+ // });
1974
+ // }
1975
+
1976
+ // onClick(...callbacks) {
1977
+ // return this.__onEvent("click", {}, ...callbacks);
1978
+ // }
1979
+
1980
+ // onDbClick(...callbacks) {
1981
+ // return this.__onEvent("dbclick", {}, ...callbacks);
1982
+ // }
1983
+ // }
1984
+
1985
+ // const useClickEvent = (target) => new ZikoEventClick(target);
1986
+
1987
+ // export default useClickEvent;
1988
+ // export { useClickEvent, ZikoEventClick };
1947
1989
 
1948
1990
  function pointerdown_controller(e){
1949
1991
  EVENT_CONTROLLER.call(
@@ -4707,7 +4749,7 @@ class ZikoUIElement {
4707
4749
  }
4708
4750
  for (let i = 0; i < ele.length; i++) {
4709
4751
  if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
4710
- if (ele[i] instanceof ZikoUIElement) {
4752
+ if (ele[i]?.isZikoUIElement) {
4711
4753
  ele[i].cache.parent = this;
4712
4754
  this.element[adder](ele[i].element);
4713
4755
  ele[i].target = this.element;
@@ -4745,7 +4787,7 @@ class ZikoUIElement {
4745
4787
  remove(...ele) {
4746
4788
  const remove = (ele) => {
4747
4789
  if (typeof ele === "number") ele = this.items[ele];
4748
- if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
4790
+ if (ele?.isZikoUIElement) this.element?.removeChild(ele.element);
4749
4791
  this.items = this.items.filter((n) => n !== ele);
4750
4792
  };
4751
4793
  for (let i = 0; i < ele.length; i++) remove(ele[i]);
@@ -4846,7 +4888,7 @@ class ZikoUIElement {
4846
4888
  }
4847
4889
  setTarget(tg) {
4848
4890
  if(this.isBody) return ;
4849
- if (tg instanceof ZikoUIElement) tg = tg.element;
4891
+ if (tg?.isZikoUIElement) tg = tg.element;
4850
4892
  this.unrender();
4851
4893
  this.target = tg;
4852
4894
  this.render();
@@ -4862,7 +4904,7 @@ class ZikoUIElement {
4862
4904
  }
4863
4905
  render(target = this.target) {
4864
4906
  if(this.isBody)return ;
4865
- if(target instanceof ZikoUIElement)target=target.element;
4907
+ if(target?.isZikoUIElement)target=target.element;
4866
4908
  this.target=target;
4867
4909
  this.target?.appendChild(this.element);
4868
4910
  return this;
@@ -4881,12 +4923,12 @@ class ZikoUIElement {
4881
4923
  return this;
4882
4924
  }
4883
4925
  after(ui){
4884
- if(ui instanceof ZikoUIElement) ui=ui.element;
4926
+ if(ui?.isZikoUIElement) ui=ui.element;
4885
4927
  this.element?.after(ui);
4886
4928
  return this;
4887
4929
  }
4888
4930
  before(ui){
4889
- if(ui instanceof ZikoUIElement) ui=ui.element;
4931
+ if(ui?.isZikoUIElement) ui=ui.element;
4890
4932
  this.element?.before(ui);
4891
4933
  return this;
4892
4934
  }
@@ -5191,9 +5233,9 @@ class __ZikoUIText__ extends ZikoUIElement {
5191
5233
 
5192
5234
  if(this.cache.lineBreak)this.element?.appendChild(globalThis.document?.createElement("br"));
5193
5235
  });
5194
- if(this.element?.innerHTML){
5195
- this.element.innerHTML = this.element.innerHTML.replace(/\n/g, '<br>').replace(/(?<!<[^>]+) /g, '&nbsp;');
5196
- }
5236
+ // if(this.element?.innerHTML){
5237
+ // this.element.innerHTML = this.element.innerHTML.replace(/\n/g, '<br>').replace(/(?<!<[^>]+) /g, '&nbsp;');
5238
+ // }
5197
5239
  return this
5198
5240
  }
5199
5241
  setValue(...value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "a versatile javaScript framework offering a rich set of UI components, advanced mathematical utilities, reactivity, animations, client side routing and graphics capabilities",
5
5
  "keywords": [
6
6
  "front-end",
@@ -57,4 +57,46 @@ export default useClickEvent;
57
57
  export {
58
58
  useClickEvent,
59
59
  ZikoEventClick
60
- }
60
+ }
61
+
62
+
63
+ //
64
+
65
+
66
+ // import { ZikoEvent, EVENT_CONTROLLER } from "./ZikoEvent.js";
67
+
68
+ // class ZikoEventClick extends ZikoEvent {
69
+ // constructor(target) {
70
+ // super(target);
71
+ // this.event = null;
72
+ // this.cache = {
73
+ // prefixe: "",
74
+ // preventDefault: { click: false, dbclick: false },
75
+ // paused: { click: false, dbclick: false },
76
+ // stream: {
77
+ // enabled: { click: false, dbclick: false },
78
+ // clear: { click: false, dbclick: false },
79
+ // history: { click: [], dbclick: [] }
80
+ // },
81
+ // callbacks: { click: [], dbclick: [] }
82
+ // };
83
+
84
+ // this.__controller = {};
85
+ // ["click", "dbclick"].forEach(evt => {
86
+ // this.__controller[evt] = (e) => EVENT_CONTROLLER.call(this, e, evt, null, null);
87
+ // });
88
+ // }
89
+
90
+ // onClick(...callbacks) {
91
+ // return this.__onEvent("click", {}, ...callbacks);
92
+ // }
93
+
94
+ // onDbClick(...callbacks) {
95
+ // return this.__onEvent("dbclick", {}, ...callbacks);
96
+ // }
97
+ // }
98
+
99
+ // const useClickEvent = (target) => new ZikoEventClick(target);
100
+
101
+ // export default useClickEvent;
102
+ // export { useClickEvent, ZikoEventClick };
@@ -161,7 +161,7 @@ class ZikoUIElement {
161
161
  }
162
162
  for (let i = 0; i < ele.length; i++) {
163
163
  if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
164
- if (ele[i] instanceof ZikoUIElement) {
164
+ if (ele[i]?.isZikoUIElement) {
165
165
  ele[i].cache.parent = this;
166
166
  this.element[adder](ele[i].element);
167
167
  ele[i].target = this.element;
@@ -199,7 +199,7 @@ class ZikoUIElement {
199
199
  remove(...ele) {
200
200
  const remove = (ele) => {
201
201
  if (typeof ele === "number") ele = this.items[ele];
202
- if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
202
+ if (ele?.isZikoUIElement) this.element?.removeChild(ele.element);
203
203
  this.items = this.items.filter((n) => n !== ele);
204
204
  };
205
205
  for (let i = 0; i < ele.length; i++) remove(ele[i]);
@@ -300,7 +300,7 @@ class ZikoUIElement {
300
300
  }
301
301
  setTarget(tg) {
302
302
  if(this.isBody) return ;
303
- if (tg instanceof ZikoUIElement) tg = tg.element;
303
+ if (tg?.isZikoUIElement) tg = tg.element;
304
304
  this.unrender();
305
305
  this.target = tg;
306
306
  this.render();
@@ -316,7 +316,7 @@ class ZikoUIElement {
316
316
  }
317
317
  render(target = this.target) {
318
318
  if(this.isBody)return ;
319
- if(target instanceof ZikoUIElement)target=target.element;
319
+ if(target?.isZikoUIElement)target=target.element;
320
320
  this.target=target;
321
321
  this.target?.appendChild(this.element);
322
322
  return this;
@@ -335,12 +335,12 @@ class ZikoUIElement {
335
335
  return this;
336
336
  }
337
337
  after(ui){
338
- if(ui instanceof ZikoUIElement) ui=ui.element;
338
+ if(ui?.isZikoUIElement) ui=ui.element;
339
339
  this.element?.after(ui)
340
340
  return this;
341
341
  }
342
342
  before(ui){
343
- if(ui instanceof ZikoUIElement) ui=ui.element;
343
+ if(ui?.isZikoUIElement) ui=ui.element;
344
344
  this.element?.before(ui)
345
345
  return this;
346
346
  }
@@ -47,9 +47,9 @@ class __ZikoUIText__ extends ZikoUIElement {
47
47
 
48
48
  if(this.cache.lineBreak)this.element?.appendChild(globalThis.document?.createElement("br"));
49
49
  });
50
- if(this.element?.innerHTML){
51
- this.element.innerHTML = this.element.innerHTML.replace(/\n/g, '<br>').replace(/(?<!<[^>]+) /g, '&nbsp;');
52
- }
50
+ // if(this.element?.innerHTML){
51
+ // this.element.innerHTML = this.element.innerHTML.replace(/\n/g, '<br>').replace(/(?<!<[^>]+) /g, '&nbsp;');
52
+ // }
53
53
  return this
54
54
  }
55
55
  setValue(...value) {