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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <img src="docs/assets/zikojs.png" width="200" align="right" alt="zikojs logo">
1
+ <img src="docs/assets/logo-200.svg" width="100" align="right" alt="zikojs logo">
2
2
 
3
3
  *💡 **Zikojs** a versatile JavaScript library offering a rich set of UI components, advanced mathematical utilities,Reactivity,animations,client side routing and graphics capabilities*
4
4
 
package/dist/ziko.cjs 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 : Thu Feb 13 2025 17:40:20 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
@@ -1947,7 +1947,49 @@ class ZikoEventClick extends ZikoEvent{
1947
1947
  return this;
1948
1948
  }
1949
1949
  }
1950
- const useClickEvent=target=>new ZikoEventClick(target);
1950
+ const useClickEvent=target=>new ZikoEventClick(target);
1951
+
1952
+
1953
+ //
1954
+
1955
+
1956
+ // import { ZikoEvent, EVENT_CONTROLLER } from "./ZikoEvent.js";
1957
+
1958
+ // class ZikoEventClick extends ZikoEvent {
1959
+ // constructor(target) {
1960
+ // super(target);
1961
+ // this.event = null;
1962
+ // this.cache = {
1963
+ // prefixe: "",
1964
+ // preventDefault: { click: false, dbclick: false },
1965
+ // paused: { click: false, dbclick: false },
1966
+ // stream: {
1967
+ // enabled: { click: false, dbclick: false },
1968
+ // clear: { click: false, dbclick: false },
1969
+ // history: { click: [], dbclick: [] }
1970
+ // },
1971
+ // callbacks: { click: [], dbclick: [] }
1972
+ // };
1973
+
1974
+ // this.__controller = {};
1975
+ // ["click", "dbclick"].forEach(evt => {
1976
+ // this.__controller[evt] = (e) => EVENT_CONTROLLER.call(this, e, evt, null, null);
1977
+ // });
1978
+ // }
1979
+
1980
+ // onClick(...callbacks) {
1981
+ // return this.__onEvent("click", {}, ...callbacks);
1982
+ // }
1983
+
1984
+ // onDbClick(...callbacks) {
1985
+ // return this.__onEvent("dbclick", {}, ...callbacks);
1986
+ // }
1987
+ // }
1988
+
1989
+ // const useClickEvent = (target) => new ZikoEventClick(target);
1990
+
1991
+ // export default useClickEvent;
1992
+ // export { useClickEvent, ZikoEventClick };
1951
1993
 
1952
1994
  function pointerdown_controller(e){
1953
1995
  EVENT_CONTROLLER.call(
@@ -4711,7 +4753,7 @@ class ZikoUIElement {
4711
4753
  }
4712
4754
  for (let i = 0; i < ele.length; i++) {
4713
4755
  if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
4714
- if (ele[i] instanceof ZikoUIElement) {
4756
+ if (ele[i]?.isZikoUIElement) {
4715
4757
  ele[i].cache.parent = this;
4716
4758
  this.element[adder](ele[i].element);
4717
4759
  ele[i].target = this.element;
@@ -4749,7 +4791,7 @@ class ZikoUIElement {
4749
4791
  remove(...ele) {
4750
4792
  const remove = (ele) => {
4751
4793
  if (typeof ele === "number") ele = this.items[ele];
4752
- if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
4794
+ if (ele?.isZikoUIElement) this.element?.removeChild(ele.element);
4753
4795
  this.items = this.items.filter((n) => n !== ele);
4754
4796
  };
4755
4797
  for (let i = 0; i < ele.length; i++) remove(ele[i]);
@@ -4850,7 +4892,7 @@ class ZikoUIElement {
4850
4892
  }
4851
4893
  setTarget(tg) {
4852
4894
  if(this.isBody) return ;
4853
- if (tg instanceof ZikoUIElement) tg = tg.element;
4895
+ if (tg?.isZikoUIElement) tg = tg.element;
4854
4896
  this.unrender();
4855
4897
  this.target = tg;
4856
4898
  this.render();
@@ -4866,7 +4908,7 @@ class ZikoUIElement {
4866
4908
  }
4867
4909
  render(target = this.target) {
4868
4910
  if(this.isBody)return ;
4869
- if(target instanceof ZikoUIElement)target=target.element;
4911
+ if(target?.isZikoUIElement)target=target.element;
4870
4912
  this.target=target;
4871
4913
  this.target?.appendChild(this.element);
4872
4914
  return this;
@@ -4885,12 +4927,12 @@ class ZikoUIElement {
4885
4927
  return this;
4886
4928
  }
4887
4929
  after(ui){
4888
- if(ui instanceof ZikoUIElement) ui=ui.element;
4930
+ if(ui?.isZikoUIElement) ui=ui.element;
4889
4931
  this.element?.after(ui);
4890
4932
  return this;
4891
4933
  }
4892
4934
  before(ui){
4893
- if(ui instanceof ZikoUIElement) ui=ui.element;
4935
+ if(ui?.isZikoUIElement) ui=ui.element;
4894
4936
  this.element?.before(ui);
4895
4937
  return this;
4896
4938
  }
package/dist/ziko.js 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
@@ -1949,7 +1949,49 @@
1949
1949
  return this;
1950
1950
  }
1951
1951
  }
1952
- const useClickEvent=target=>new ZikoEventClick(target);
1952
+ const useClickEvent=target=>new ZikoEventClick(target);
1953
+
1954
+
1955
+ //
1956
+
1957
+
1958
+ // import { ZikoEvent, EVENT_CONTROLLER } from "./ZikoEvent.js";
1959
+
1960
+ // class ZikoEventClick extends ZikoEvent {
1961
+ // constructor(target) {
1962
+ // super(target);
1963
+ // this.event = null;
1964
+ // this.cache = {
1965
+ // prefixe: "",
1966
+ // preventDefault: { click: false, dbclick: false },
1967
+ // paused: { click: false, dbclick: false },
1968
+ // stream: {
1969
+ // enabled: { click: false, dbclick: false },
1970
+ // clear: { click: false, dbclick: false },
1971
+ // history: { click: [], dbclick: [] }
1972
+ // },
1973
+ // callbacks: { click: [], dbclick: [] }
1974
+ // };
1975
+
1976
+ // this.__controller = {};
1977
+ // ["click", "dbclick"].forEach(evt => {
1978
+ // this.__controller[evt] = (e) => EVENT_CONTROLLER.call(this, e, evt, null, null);
1979
+ // });
1980
+ // }
1981
+
1982
+ // onClick(...callbacks) {
1983
+ // return this.__onEvent("click", {}, ...callbacks);
1984
+ // }
1985
+
1986
+ // onDbClick(...callbacks) {
1987
+ // return this.__onEvent("dbclick", {}, ...callbacks);
1988
+ // }
1989
+ // }
1990
+
1991
+ // const useClickEvent = (target) => new ZikoEventClick(target);
1992
+
1993
+ // export default useClickEvent;
1994
+ // export { useClickEvent, ZikoEventClick };
1953
1995
 
1954
1996
  function pointerdown_controller(e){
1955
1997
  EVENT_CONTROLLER.call(
@@ -4713,7 +4755,7 @@
4713
4755
  }
4714
4756
  for (let i = 0; i < ele.length; i++) {
4715
4757
  if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
4716
- if (ele[i] instanceof ZikoUIElement) {
4758
+ if (ele[i]?.isZikoUIElement) {
4717
4759
  ele[i].cache.parent = this;
4718
4760
  this.element[adder](ele[i].element);
4719
4761
  ele[i].target = this.element;
@@ -4751,7 +4793,7 @@
4751
4793
  remove(...ele) {
4752
4794
  const remove = (ele) => {
4753
4795
  if (typeof ele === "number") ele = this.items[ele];
4754
- if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
4796
+ if (ele?.isZikoUIElement) this.element?.removeChild(ele.element);
4755
4797
  this.items = this.items.filter((n) => n !== ele);
4756
4798
  };
4757
4799
  for (let i = 0; i < ele.length; i++) remove(ele[i]);
@@ -4852,7 +4894,7 @@
4852
4894
  }
4853
4895
  setTarget(tg) {
4854
4896
  if(this.isBody) return ;
4855
- if (tg instanceof ZikoUIElement) tg = tg.element;
4897
+ if (tg?.isZikoUIElement) tg = tg.element;
4856
4898
  this.unrender();
4857
4899
  this.target = tg;
4858
4900
  this.render();
@@ -4868,7 +4910,7 @@
4868
4910
  }
4869
4911
  render(target = this.target) {
4870
4912
  if(this.isBody)return ;
4871
- if(target instanceof ZikoUIElement)target=target.element;
4913
+ if(target?.isZikoUIElement)target=target.element;
4872
4914
  this.target=target;
4873
4915
  this.target?.appendChild(this.element);
4874
4916
  return this;
@@ -4887,12 +4929,12 @@
4887
4929
  return this;
4888
4930
  }
4889
4931
  after(ui){
4890
- if(ui instanceof ZikoUIElement) ui=ui.element;
4932
+ if(ui?.isZikoUIElement) ui=ui.element;
4891
4933
  this.element?.after(ui);
4892
4934
  return this;
4893
4935
  }
4894
4936
  before(ui){
4895
- if(ui instanceof ZikoUIElement) ui=ui.element;
4937
+ if(ui?.isZikoUIElement) ui=ui.element;
4896
4938
  this.element?.before(ui);
4897
4939
  return this;
4898
4940
  }
@@ -5197,9 +5239,9 @@
5197
5239
 
5198
5240
  if(this.cache.lineBreak)this.element?.appendChild(globalThis.document?.createElement("br"));
5199
5241
  });
5200
- if(this.element?.innerHTML){
5201
- this.element.innerHTML = this.element.innerHTML.replace(/\n/g, '<br>').replace(/(?<!<[^>]+) /g, '&nbsp;');
5202
- }
5242
+ // if(this.element?.innerHTML){
5243
+ // this.element.innerHTML = this.element.innerHTML.replace(/\n/g, '<br>').replace(/(?<!<[^>]+) /g, '&nbsp;');
5244
+ // }
5203
5245
  return this
5204
5246
  }
5205
5247
  setValue(...value) {