ziko 0.0.25 → 0.0.27

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.
Files changed (33) hide show
  1. package/README.md +1 -1
  2. package/dist/ziko.cjs +50 -8
  3. package/dist/ziko.js +269 -15
  4. package/dist/ziko.min.js +2 -2
  5. package/dist/ziko.mjs +267 -16
  6. package/package.json +1 -1
  7. package/src/app/globals.js +30 -2
  8. package/src/index.js +2 -1
  9. package/src/math/index.js +1 -0
  10. package/src/reactivity/events/ZikoEvent.js +1 -0
  11. package/src/reactivity/events/click.js +43 -1
  12. package/src/reactivity/events-exp/__Events__.js +47 -0
  13. package/src/reactivity/events-exp/__ZikoEvent__.js +160 -0
  14. package/src/reactivity/events-exp/click.js +19 -0
  15. package/src/reactivity/events-exp/index.js +5 -0
  16. package/src/reactivity/events-exp/key.js +27 -0
  17. package/src/reactivity/events-exp/pointer.js +48 -0
  18. package/src/reactivity/events-exp/utils.js +7 -0
  19. package/src/reactivity/index.js +3 -0
  20. package/src/ui/elements/ZikoUIElement.js +11 -8
  21. package/src/ui/elements/misc/index.js +0 -1
  22. package/src/ui/elements/text/__ZikoUIText__.js +3 -3
  23. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/_themes/dark.js +0 -0
  24. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/_themes/index.js +0 -0
  25. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/_themes/light.js +0 -0
  26. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/app/index.js +0 -0
  27. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/component/index.js +0 -0
  28. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/globals/index.js +0 -0
  29. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/index.js +0 -0
  30. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/params/index.js +0 -0
  31. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/router/index.js +0 -0
  32. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/seo/index.js +0 -0
  33. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/style/index.js +0 -0
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 : Thu Jul 10 2025 11:49:56 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
@@ -1007,6 +1007,11 @@ class Random {
1007
1007
  }
1008
1008
  }
1009
1009
 
1010
+ var __Random__ = /*#__PURE__*/Object.freeze({
1011
+ __proto__: null,
1012
+ Random: Random
1013
+ });
1014
+
1010
1015
  const luDecomposition=matrix=>{
1011
1016
  if(matrix instanceof Matrix)matrix=matrix.arr;
1012
1017
  const n = matrix.length;
@@ -1802,6 +1807,7 @@ class ZikoUIElementStyle{
1802
1807
  function EVENT_CONTROLLER(e,EVENT,setter,push_object){
1803
1808
  this.event=e;
1804
1809
  if(this.cache.preventDefault[EVENT])e.preventDefault();
1810
+ console.log({setter});
1805
1811
  if(setter)setter();
1806
1812
  if(this.cache.stream.enabled[EVENT]&&push_object)this.cache.stream.history[EVENT].push(push_object);
1807
1813
  this.cache.callbacks[EVENT].map(n=>n(this));
@@ -1943,7 +1949,49 @@ class ZikoEventClick extends ZikoEvent{
1943
1949
  return this;
1944
1950
  }
1945
1951
  }
1946
- 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 };
1947
1995
 
1948
1996
  function pointerdown_controller(e){
1949
1997
  EVENT_CONTROLLER.call(
@@ -4560,10 +4608,181 @@ var Hooks = /*#__PURE__*/Object.freeze({
4560
4608
  useType: useType
4561
4609
  });
4562
4610
 
4611
+ const getEvent=(event = "")=>{
4612
+ if(event.startsWith("Ptr"))return `pointer${event.split("Ptr")[1].toLowerCase()}`;
4613
+ return event.toLowerCase()
4614
+ };
4615
+
4616
+ function event_controller(e, event_name, details_setter, customizer, push_object){
4617
+ this.cache.currentEvent = event_name;
4618
+ this.cache.event = e;
4619
+ details_setter?.call(this);
4620
+ if(customizer?.hasOwnProperty("prototype"))customizer?.call(this);
4621
+ else customizer?.call(null, this);
4622
+ if(this.cache.preventDefault[event_name]) e.preventDefault();
4623
+ if(this.cache.stopPropagation[event_name]) e.stopPropagation();
4624
+ if(this.cache.stopImmediatePropagation[event_name]) e.stopImmediatePropagation();
4625
+
4626
+ if(this.cache.stream.enabled[event_name]&&push_object)this.cache.stream.history[event_name].push(push_object);
4627
+ this.cache.callbacks[event_name]?.map(n=>n(this));
4628
+ }
4629
+ class __ZikoEvent__ {
4630
+ constructor(target = null, Events = [], details_setter, customizer){
4631
+ this.target = target;
4632
+ this.cache = {
4633
+ currentEvent : null,
4634
+ event: null,
4635
+ options : {},
4636
+ preventDefault : {},
4637
+ stopPropagation : {},
4638
+ stopImmediatePropagation : {},
4639
+ event_flow : {},
4640
+ paused : {},
4641
+ stream : {
4642
+ enabled : {},
4643
+ clear : {},
4644
+ history : {}
4645
+ },
4646
+ callbacks : {},
4647
+ __controllers__:{}
4648
+ };
4649
+ const events = Events.map(n=>getEvent(n));
4650
+ events.forEach((event,i)=>{
4651
+ Object.assign(this.cache.preventDefault, {[event] : false});
4652
+ Object.assign(this.cache.options, {[event] : {}});
4653
+ Object.assign(this.cache.paused, {[event] : false});
4654
+ Object.assign(this.cache.stream.enabled, {[event] : false});
4655
+ Object.assign(this.cache.stream.clear, {[event] : false});
4656
+ Object.assign(this.cache.stream.history, {[event] : []});
4657
+ Object.assign(this.cache.__controllers__, {[event] : e=>event_controller.call(this, e, event, details_setter, customizer)});
4658
+ Object.assign(this, { [`on${Events[i]}`] : (...callbacks)=> this.__onEvent(event, this.cache.options[event], {}, ...callbacks)});
4659
+ });
4660
+ }
4661
+ get targetElement(){
4662
+ return this.target?.element;
4663
+ }
4664
+ get isParent(){
4665
+ return this.target?.element === this.event.srcElement;
4666
+ }
4667
+ get item(){
4668
+ return this.target.find(n=>n.element == this.event?.srcElement)?.[0];
4669
+ }
4670
+ get currentEvent(){
4671
+ return this.cache.currentEvent;
4672
+ }
4673
+ get event(){
4674
+ return this.cache.event;
4675
+ }
4676
+ setTarget(UI){
4677
+ this.target=UI;
4678
+ return this;
4679
+ }
4680
+ __handle(event, handler, options, dispose){
4681
+ this.targetElement?.addEventListener(event, handler, options);
4682
+ return this;
4683
+ }
4684
+ __onEvent(event, options, dispose, ...callbacks){
4685
+ if(callbacks.length===0){
4686
+ console.log("00");
4687
+ if(this.cache.callbacks[event]){
4688
+ console.log("Call");
4689
+ // this.cache.callbacks.map(n=>e=>n.call(this,e));
4690
+ this.cache.callbacks[event].map(n=>e=>n.call(this,e));
4691
+ }
4692
+ else {
4693
+ return this;
4694
+ }
4695
+ }
4696
+ else this.cache.callbacks[event] = callbacks.map(n=>e=>n.call(this,e));
4697
+ this.__handle(event, this.cache.__controllers__[event],options, dispose);
4698
+ return this;
4699
+ }
4700
+ #override(methode, overrides, defaultValue){
4701
+ if(defaultValue === "default") Object.assign(this.cache[methode], {...this.cache[methode], ...overrides});
4702
+ const all = defaultValue === "default"
4703
+ ? this.cache[methode]
4704
+ : Object.fromEntries(Object.keys(this.cache.preventDefault).map(n=>[n,defaultValue]));
4705
+ Object.assign(this.cache[methode], {...all,...overrides});
4706
+ return this
4707
+ }
4708
+ preventDefault(overrides = {}, defaultValue = "default"){
4709
+ this.#override("preventDefault", overrides, defaultValue);
4710
+ // const all=Object.fromEntries(Object.keys(this.cache.preventDefault).map(n=>[n,defaultValue]))
4711
+ // Object.assign(this.cache.preventDefault, {...all,...overrides});
4712
+ return this;
4713
+ }
4714
+ stopPropagation(overrides = {}, defaultValue = "default"){
4715
+ this.#override("stopPropagation", overrides, defaultValue);
4716
+ return this;
4717
+ }
4718
+ stopImmediatePropagation(overrides = {}, defaultValue = "default"){
4719
+ this.#override("stopImmediatePropagation", overrides, defaultValue);
4720
+ return this;
4721
+ }
4722
+ setEventOptions(event, options){
4723
+ this.pause({[event] : true, }, "default");
4724
+ Object.assign(this.cache.options[getEvent(event)], options);
4725
+ this.resume({[event] : true, }, "default");
4726
+ return this;
4727
+ }
4728
+ pause(overrides = {}, defaultValue = "default"){
4729
+ const all = defaultValue === "default"
4730
+ ? this.cache.stream.enabled
4731
+ : Object.entries(Object.keys(this.cache.stream.enabled).map(n=>[n,defaultValue]));
4732
+ overrides={...all,...overrides};
4733
+ for(let key in overrides){
4734
+ if(overrides[key]){
4735
+ this.targetElement?.removeEventListener(key, this.cache.__controllers__[key], this.cache.options[key]);
4736
+ this.cache.paused[key]=true;
4737
+ }
4738
+ }
4739
+ return this;
4740
+ }
4741
+ resume(overrides = {}, defaultValue = "default"){
4742
+ const all = defaultValue === "default"
4743
+ ? this.cache.stream.enabled
4744
+ : Object.entries(Object.keys(this.cache.stream.enabled).map(n=>[n,defaultValue]));
4745
+ overrides={...all,...overrides};
4746
+ for(let key in overrides){
4747
+ if(overrides[key]){
4748
+ this.targetElement?.addEventListener(key,this.cache.__controllers__[key], this.cache.options[key]);
4749
+ this.cache.paused[key]=false;
4750
+ }
4751
+ }
4752
+ return this;
4753
+ }
4754
+ stream(overrides = {}, defaultValue = "default"){
4755
+ this.cache.stream.t0=Date.now();
4756
+ const all=Object.fromEntries(Object.keys(this.cache.stream.enabled).map(n=>[n,defaultValue]));
4757
+ overrides={...all,...overrides};
4758
+ Object.assign(this.cache.stream.enabled,overrides);
4759
+ return this;
4760
+ }
4761
+ clear(){
4762
+
4763
+ }
4764
+ dispose(overrides = {}, defaultValue = "default"){
4765
+ this.pause(overrides, defaultValue);
4766
+
4767
+ return this;
4768
+ }
4769
+ }
4770
+
4771
+ // export * from "./click.js";
4772
+ // export * from "./key.js";
4773
+ // export * from "./pointer.js"
4774
+
4775
+ var EventsExp = /*#__PURE__*/Object.freeze({
4776
+ __proto__: null,
4777
+ __ZikoEvent__: __ZikoEvent__,
4778
+ getEvent: getEvent
4779
+ });
4780
+
4563
4781
  const Reactivity={
4564
4782
  ...Events,
4565
4783
  ...Observer,
4566
4784
  ...Hooks,
4785
+ ...EventsExp,
4567
4786
  };
4568
4787
 
4569
4788
  class ZikoUIElement {
@@ -4611,6 +4830,7 @@ class ZikoUIElement {
4611
4830
  intersection:null
4612
4831
  };
4613
4832
  this.uuid = `${this.cache.name}-${Random.string(16)}`;
4833
+ this.ui_index = globalThis.__Ziko__.__CACHE__.get_ui_index();
4614
4834
  this.cache.style.linkTo(this);
4615
4835
  useDefaultStyle && this.style({
4616
4836
  position: "relative",
@@ -4623,7 +4843,7 @@ class ZikoUIElement {
4623
4843
  this.items = [];
4624
4844
  globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
4625
4845
  element && globalThis.__Ziko__.__Config__.default.render && this.render();
4626
- this.setAttr("data-ref", this.uuid);
4846
+ this.setAttr("data-ui-index", this.ui_index);
4627
4847
  if(globalThis.__Ziko__.__Config__.renderingMode !== "spa" && !globalThis.__Ziko__.__Config__.isSSC) {
4628
4848
  globalThis.__Ziko__.__HYDRATION_MAP__.set(this.uuid, ()=>this);
4629
4849
  }
@@ -4707,12 +4927,14 @@ class ZikoUIElement {
4707
4927
  }
4708
4928
  for (let i = 0; i < ele.length; i++) {
4709
4929
  if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
4710
- if (ele[i] instanceof ZikoUIElement) {
4930
+ if(ele[i] instanceof Node) ele[i] = new ZikoUIElement(ele[i]);
4931
+ if (ele[i]?.isZikoUIElement) {
4711
4932
  ele[i].cache.parent = this;
4712
4933
  this.element[adder](ele[i].element);
4713
4934
  ele[i].target = this.element;
4714
4935
  this.items[pusher](ele[i]);
4715
- } else if (ele[i] instanceof Object) {
4936
+ }
4937
+ else if (ele[i] instanceof Object) {
4716
4938
  if (ele[i]?.style) this.style(ele[i]?.style);
4717
4939
  if (ele[i]?.attr) {
4718
4940
  Object.entries(ele[i].attr).forEach((n) =>
@@ -4745,7 +4967,7 @@ class ZikoUIElement {
4745
4967
  remove(...ele) {
4746
4968
  const remove = (ele) => {
4747
4969
  if (typeof ele === "number") ele = this.items[ele];
4748
- if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
4970
+ if (ele?.isZikoUIElement) this.element?.removeChild(ele.element);
4749
4971
  this.items = this.items.filter((n) => n !== ele);
4750
4972
  };
4751
4973
  for (let i = 0; i < ele.length; i++) remove(ele[i]);
@@ -4846,7 +5068,7 @@ class ZikoUIElement {
4846
5068
  }
4847
5069
  setTarget(tg) {
4848
5070
  if(this.isBody) return ;
4849
- if (tg instanceof ZikoUIElement) tg = tg.element;
5071
+ if (tg?.isZikoUIElement) tg = tg.element;
4850
5072
  this.unrender();
4851
5073
  this.target = tg;
4852
5074
  this.render();
@@ -4862,7 +5084,7 @@ class ZikoUIElement {
4862
5084
  }
4863
5085
  render(target = this.target) {
4864
5086
  if(this.isBody)return ;
4865
- if(target instanceof ZikoUIElement)target=target.element;
5087
+ if(target?.isZikoUIElement)target=target.element;
4866
5088
  this.target=target;
4867
5089
  this.target?.appendChild(this.element);
4868
5090
  return this;
@@ -4881,12 +5103,12 @@ class ZikoUIElement {
4881
5103
  return this;
4882
5104
  }
4883
5105
  after(ui){
4884
- if(ui instanceof ZikoUIElement) ui=ui.element;
5106
+ if(ui?.isZikoUIElement) ui=ui.element;
4885
5107
  this.element?.after(ui);
4886
5108
  return this;
4887
5109
  }
4888
5110
  before(ui){
4889
- if(ui instanceof ZikoUIElement) ui=ui.element;
5111
+ if(ui?.isZikoUIElement) ui=ui.element;
4890
5112
  this.element?.before(ui);
4891
5113
  return this;
4892
5114
  }
@@ -5191,9 +5413,9 @@ class __ZikoUIText__ extends ZikoUIElement {
5191
5413
 
5192
5414
  if(this.cache.lineBreak)this.element?.appendChild(globalThis.document?.createElement("br"));
5193
5415
  });
5194
- if(this.element?.innerHTML){
5195
- this.element.innerHTML = this.element.innerHTML.replace(/\n/g, '<br>').replace(/(?<!<[^>]+) /g, '&nbsp;');
5196
- }
5416
+ // if(this.element?.innerHTML){
5417
+ // this.element.innerHTML = this.element.innerHTML.replace(/\n/g, '<br>').replace(/(?<!<[^>]+) /g, '&nbsp;');
5418
+ // }
5197
5419
  return this
5198
5420
  }
5199
5421
  setValue(...value) {
@@ -6009,7 +6231,6 @@ class ZikoUIHtmlTag extends ZikoUIElement {
6009
6231
  class ZikoUIBtn extends ZikoUIElement {
6010
6232
  constructor(value = "button") {
6011
6233
  super("button","btn");
6012
- this.element = document?.createElement("button");
6013
6234
  this.setValue(value);
6014
6235
  this.st.cursor("pointer");
6015
6236
  globalThis.__Ziko__.__Config__.default.render && this.render();
@@ -8418,6 +8639,7 @@ const Math$1 = {
8418
8639
  ...__Functions__,
8419
8640
  ...__Complex__,
8420
8641
  ...__Matrix__,
8642
+ ...__Random__,
8421
8643
  ...__Utils__,
8422
8644
  ...__Discrect__,
8423
8645
  // ...__Signal__,
@@ -9053,7 +9275,28 @@ function defineParamsGetter(target ){
9053
9275
  });
9054
9276
  }
9055
9277
 
9056
- const __UI__={};
9278
+ const __UI__={
9279
+ __all__(){
9280
+ return Object.values(this)
9281
+ .filter(Array.isArray)
9282
+ .flat();
9283
+ },
9284
+ querySelectorAll(){
9285
+ return this.__all__().filter(n=>n)
9286
+ },
9287
+ getElementByIndex(index){
9288
+ return this.__all__().find(n=>n.ui_index===index);
9289
+ },
9290
+ getElementById(id){
9291
+ return null;
9292
+ },
9293
+ getElementsByClass(){
9294
+
9295
+ },
9296
+ getElementsByTagName(){
9297
+
9298
+ }
9299
+ };
9057
9300
  const __HYDRATION_MAP__ = new Map();
9058
9301
  const __Config__={
9059
9302
  default:{
@@ -9071,10 +9314,17 @@ const __Config__={
9071
9314
  init:()=>document.documentElement.setAttribute("data-engine","zikojs"),
9072
9315
  renderingMode :"spa",
9073
9316
  isSSC : false,
9317
+ };
9318
+ const __CACHE__ = {
9319
+ ui_index : 0,
9320
+ get_ui_index:function(){
9321
+ return this.ui_index ++
9322
+ }
9074
9323
  };
9075
9324
 
9076
9325
  var Global = /*#__PURE__*/Object.freeze({
9077
9326
  __proto__: null,
9327
+ __CACHE__: __CACHE__,
9078
9328
  __Config__: __Config__,
9079
9329
  __HYDRATION_MAP__: __HYDRATION_MAP__,
9080
9330
  __UI__: __UI__
@@ -9178,6 +9428,7 @@ if ( globalThis.__Ziko__ ) {
9178
9428
  __UI__,
9179
9429
  __HYDRATION_MAP__,
9180
9430
  __Config__,
9431
+ __CACHE__,
9181
9432
  ExtractAll,
9182
9433
  RemoveAll
9183
9434
  };
@@ -9211,4 +9462,4 @@ function RemoveAll(){
9211
9462
  Data.RemoveAll();
9212
9463
  }
9213
9464
 
9214
- export { App$1 as App, Article, Aside, Base, Canvas, Combinaison, Complex, E, EPSILON, Ease, FileBasedRouting, Flex, Footer, Form, Grid$1 as Grid, HTMLWrapper, Header, LinearSystem, Logic$1 as Logic, Main, Matrix, Nav, PI$1 as PI, Permutation, Random, SPA, SVGWrapper, Section, Str, Suspense, Svg, Table$1 as Table, Utils$1 as Utils, ZikoApp, ZikoCustomEvent, ZikoEvent, ZikoEventClick, ZikoEventClipboard, ZikoEventHash, ZikoEventInput, ZikoEventKey, ZikoEventMouse, ZikoEventPointer, ZikoEventSwipe, ZikoEventWheel, ZikoHead$1 as ZikoHead, ZikoJsonStyleSheet, ZikoMutationObserver, ZikoSPA, ZikoUIAbbrText, ZikoUIArticle, ZikoUIAside, ZikoUIAudio, ZikoUIBlockQuote, ZikoUIBr, ZikoUICanvas, ZikoUICodeText, ZikoUIDefintion, ZikoUIElement, ZikoUIFigure, ZikoUIFlex, ZikoUIFooter, ZikoUIForm, ZikoUIGrid, ZikoUIHTMLWrapper, ZikoUIHeader, ZikoUIHeading, ZikoUIHr, ZikoUIHtmlTag, ZikoUIImage, ZikoUIInput, ZikoUIInputCheckbox, ZikoUIInputColor, ZikoUIInputDatalist$1 as ZikoUIInputDatalist, ZikoUIInputDate, ZikoUIInputDateTime, ZikoUIInputEmail, ZikoUIInputImage, ZikoUIInputNumber, ZikoUIInputOption, ZikoUIInputPassword, ZikoUIInputRadio, ZikoUIInputSearch, ZikoUIInputSlider$1 as ZikoUIInputSlider, ZikoUIInputTime, ZikoUILabel, ZikoUILink, ZikoUIMain, ZikoUINav, ZikoUIParagraphe, ZikoUIQuote, ZikoUISVGWrapper, ZikoUISection, ZikoUISelect, ZikoUISubText, ZikoUISupText, ZikoUISuspense, ZikoUISvg, ZikoUIText, ZikoUITextArea, ZikoUIVideo, ZikoUIXMLWrapper, ZikoUseRoot, ZikoUseStyle, __Config__, __HYDRATION_MAP__, __UI__, abbrText, abs, accum, acos, acosh, acot, add, arange, arr2str, asin, asinh, atan, atan2, atanh, audio, bessel, beta, blockQuote, br, brs, btn, cartesianProduct, ceil, checkbox, choleskyDecomposition, clamp, codeText, combinaison, complex, cos, cosh, cot, coth, count, countWords, csc, csv2arr, csv2json, csv2matrix, csv2object, csv2sql, datalist, Ziko as default, defineParamsGetter, deg2rad, dfnText, div, e, fact, figure, floor, gamma, geomspace, h, h1, h2, h3, h4, h5, h6, hTags, hr, hrs, html, hypot, image, inRange, input, inputCamera, inputColor, inputDate, inputDateTime, inputEmail, inputImage, inputNumber, inputPassword, inputTime, isApproximatlyEqual, json2arr, json2css, json2csv, json2csvFile, json2xml, json2xmlFile, json2yml, json2ymlFile, jsonStyleSheet, lerp, li, link, linspace, ln, logspace, luDecomposition, map, mapfun$1 as mapfun, matrix, matrix2, matrix3, matrix4, max, min, modulo, mul, norm, nums, obj2str, ol, ones, p, pgcd, pow, powerSet, ppcm, preload, prod, qrDecomposition, quote, rad2deg, radio, removeExtraSpace, round, s, sTags, search, sec, select, sig, sign, sin, sinc, sinh, slider, sqrt, sqrtn, str, sub, subSet, subText, sum, supText, svg2ascii, svg2img, svg2imgUrl, svg2str, tan, tanh, text, textarea, timeTaken, time_memory_Taken, ul, useAnimation, useChannel$1 as useChannel, useClickEvent, useClipboardEvent, useCustomEvent, useDebounce, useDragEvent, useDropEvent, useEventEmitter, useFavIcon$1 as useFavIcon, useFocusEvent, useFps, useHashEvent, useHead$1 as useHead, useInputEvent, useKeyEvent, useLocaleStorage, useMediaQuery, useMeta$1 as useMeta, useMouseEvent, usePointerEvent, useRoot, useRootValue, useSessionStorage, useStyle, useSuccesifKeys, useSwipeEvent, useThread, useThrottle, useTimeLoop, useTitle$1 as useTitle, useType, useWheelEvent, video, wait, waitForUIElm, waitForUIElmSync, watch, watchAttr, watchChildren, watchIntersection, watchScreen, watchSize, zeros };
9465
+ export { App$1 as App, Article, Aside, Base, Canvas, Combinaison, Complex, E, EPSILON, Ease, FileBasedRouting, Flex, Footer, Form, Grid$1 as Grid, HTMLWrapper, Header, LinearSystem, Logic$1 as Logic, Main, Matrix, Nav, PI$1 as PI, Permutation, Random, SPA, SVGWrapper, Section, Str, Suspense, Svg, Table$1 as Table, Utils$1 as Utils, ZikoApp, ZikoCustomEvent, ZikoEvent, ZikoEventClick, ZikoEventClipboard, ZikoEventHash, ZikoEventInput, ZikoEventKey, ZikoEventMouse, ZikoEventPointer, ZikoEventSwipe, ZikoEventWheel, ZikoHead$1 as ZikoHead, ZikoJsonStyleSheet, ZikoMutationObserver, ZikoSPA, ZikoUIAbbrText, ZikoUIArticle, ZikoUIAside, ZikoUIAudio, ZikoUIBlockQuote, ZikoUIBr, ZikoUICanvas, ZikoUICodeText, ZikoUIDefintion, ZikoUIElement, ZikoUIFigure, ZikoUIFlex, ZikoUIFooter, ZikoUIForm, ZikoUIGrid, ZikoUIHTMLWrapper, ZikoUIHeader, ZikoUIHeading, ZikoUIHr, ZikoUIHtmlTag, ZikoUIImage, ZikoUIInput, ZikoUIInputCheckbox, ZikoUIInputColor, ZikoUIInputDatalist$1 as ZikoUIInputDatalist, ZikoUIInputDate, ZikoUIInputDateTime, ZikoUIInputEmail, ZikoUIInputImage, ZikoUIInputNumber, ZikoUIInputOption, ZikoUIInputPassword, ZikoUIInputRadio, ZikoUIInputSearch, ZikoUIInputSlider$1 as ZikoUIInputSlider, ZikoUIInputTime, ZikoUILabel, ZikoUILink, ZikoUIMain, ZikoUINav, ZikoUIParagraphe, ZikoUIQuote, ZikoUISVGWrapper, ZikoUISection, ZikoUISelect, ZikoUISubText, ZikoUISupText, ZikoUISuspense, ZikoUISvg, ZikoUIText, ZikoUITextArea, ZikoUIVideo, ZikoUIXMLWrapper, ZikoUseRoot, ZikoUseStyle, __CACHE__, __Config__, __HYDRATION_MAP__, __UI__, __ZikoEvent__, abbrText, abs, accum, acos, acosh, acot, add, arange, arr2str, asin, asinh, atan, atan2, atanh, audio, bessel, beta, blockQuote, br, brs, btn, cartesianProduct, ceil, checkbox, choleskyDecomposition, clamp, codeText, combinaison, complex, cos, cosh, cot, coth, count, countWords, csc, csv2arr, csv2json, csv2matrix, csv2object, csv2sql, datalist, Ziko as default, defineParamsGetter, deg2rad, dfnText, div, e, fact, figure, floor, gamma, geomspace, getEvent, h, h1, h2, h3, h4, h5, h6, hTags, hr, hrs, html, hypot, image, inRange, input, inputCamera, inputColor, inputDate, inputDateTime, inputEmail, inputImage, inputNumber, inputPassword, inputTime, isApproximatlyEqual, json2arr, json2css, json2csv, json2csvFile, json2xml, json2xmlFile, json2yml, json2ymlFile, jsonStyleSheet, lerp, li, link, linspace, ln, logspace, luDecomposition, map, mapfun$1 as mapfun, matrix, matrix2, matrix3, matrix4, max, min, modulo, mul, norm, nums, obj2str, ol, ones, p, pgcd, pow, powerSet, ppcm, preload, prod, qrDecomposition, quote, rad2deg, radio, removeExtraSpace, round, s, sTags, search, sec, select, sig, sign, sin, sinc, sinh, slider, sqrt, sqrtn, str, sub, subSet, subText, sum, supText, svg2ascii, svg2img, svg2imgUrl, svg2str, tan, tanh, text, textarea, timeTaken, time_memory_Taken, ul, useAnimation, useChannel$1 as useChannel, useClickEvent, useClipboardEvent, useCustomEvent, useDebounce, useDragEvent, useDropEvent, useEventEmitter, useFavIcon$1 as useFavIcon, useFocusEvent, useFps, useHashEvent, useHead$1 as useHead, useInputEvent, useKeyEvent, useLocaleStorage, useMediaQuery, useMeta$1 as useMeta, useMouseEvent, usePointerEvent, useRoot, useRootValue, useSessionStorage, useStyle, useSuccesifKeys, useSwipeEvent, useThread, useThrottle, useTimeLoop, useTitle$1 as useTitle, useType, useWheelEvent, video, wait, waitForUIElm, waitForUIElmSync, watch, watchAttr, watchChildren, watchIntersection, watchScreen, watchSize, zeros };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
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",
@@ -1,4 +1,25 @@
1
- const __UI__={}
1
+ 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
+
21
+ }
22
+ }
2
23
  const __HYDRATION_MAP__ = new Map()
3
24
  const __Config__={
4
25
  default:{
@@ -17,8 +38,15 @@ const __Config__={
17
38
  renderingMode :"spa",
18
39
  isSSC : false,
19
40
  }
41
+ const __CACHE__ = {
42
+ ui_index : 0,
43
+ get_ui_index:function(){
44
+ return this.ui_index ++
45
+ }
46
+ }
20
47
  export {
21
48
  __UI__,
22
49
  __HYDRATION_MAP__,
23
- __Config__
50
+ __Config__,
51
+ __CACHE__
24
52
  }
package/src/index.js CHANGED
@@ -5,7 +5,7 @@ import Time from "./time";
5
5
  import Data from "./data";
6
6
  import Reactivity from "./reactivity";
7
7
  import Graphics from "./graphics";
8
- import App,{__UI__,__HYDRATION_MAP__, __Config__, defineParamsGetter} from "./app";
8
+ import App,{__UI__,__HYDRATION_MAP__, __Config__, __CACHE__, defineParamsGetter} from "./app";
9
9
 
10
10
  export * from "./math";
11
11
  export * from "./ui";
@@ -47,6 +47,7 @@ if ( globalThis.__Ziko__ ) {
47
47
  __UI__,
48
48
  __HYDRATION_MAP__,
49
49
  __Config__,
50
+ __CACHE__,
50
51
  ExtractAll,
51
52
  RemoveAll
52
53
  };
package/src/math/index.js CHANGED
@@ -13,6 +13,7 @@ const Math = {
13
13
  ...__Functions__,
14
14
  ...__Complex__,
15
15
  ...__Matrix__,
16
+ ...__Random__,
16
17
  ...__Utils__,
17
18
  ...__Discrect__,
18
19
  // ...__Signal__,
@@ -1,6 +1,7 @@
1
1
  function EVENT_CONTROLLER(e,EVENT,setter,push_object){
2
2
  this.event=e
3
3
  if(this.cache.preventDefault[EVENT])e.preventDefault();
4
+ console.log({setter})
4
5
  if(setter)setter();
5
6
  if(this.cache.stream.enabled[EVENT]&&push_object)this.cache.stream.history[EVENT].push(push_object);
6
7
  this.cache.callbacks[EVENT].map(n=>n(this));
@@ -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 };
@@ -0,0 +1,47 @@
1
+ const Events = {
2
+ 'Click' : [
3
+ 'Click',
4
+ 'DblClick'
5
+ ],
6
+ 'Pointer' : [
7
+ 'PtrMove',
8
+ 'PtrDown',
9
+ 'PtrUp',
10
+ 'PtrLeave',
11
+ 'PtrEnter',
12
+ 'PtrOut',
13
+ 'PtrCancel'
14
+ ],
15
+ 'Mouse' : [],
16
+ 'Touch' : [],
17
+ 'Key' : [
18
+ 'KeyDown',
19
+ 'KeyPress',
20
+ 'KeyUp'
21
+ ],
22
+ 'Clipboard':[
23
+ 'Copy',
24
+ 'Cut',
25
+ 'Paste'
26
+ ],
27
+ 'Focus':[
28
+ 'focus',
29
+ 'blur'
30
+ ],
31
+ 'Drag':[
32
+ "Drag",
33
+ "DragStart",
34
+ "DragEnd",
35
+ "Drop"
36
+ ],
37
+ 'Media':[
38
+
39
+ ],
40
+ 'Hash':[
41
+ "HashChange"
42
+ ]
43
+ }
44
+
45
+ export {
46
+ Events
47
+ }