ziko 0.64.0 → 0.66.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.
Files changed (45) hide show
  1. package/dist/ziko.cjs +5 -145
  2. package/dist/ziko.js +5 -145
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +6 -145
  5. package/package.json +1 -1
  6. package/src/--reactivity-deprecated/idea +1 -2
  7. package/src/data/api/fetchdom.js +27 -27
  8. package/src/data/api/index.js +4 -4
  9. package/src/hooks/index.d.ts +11 -0
  10. package/src/hooks/use-derived.d.ts +14 -0
  11. package/src/hooks/use-event-emitter.d.ts +46 -0
  12. package/src/hooks/use-favicon.d.ts +41 -0
  13. package/src/hooks/use-ipc.d.ts +12 -0
  14. package/src/hooks/use-media-query.d.ts +24 -0
  15. package/src/hooks/use-reactive.d.ts +14 -0
  16. package/src/hooks/use-root.d.ts +15 -0
  17. package/src/hooks/use-state.d.ts +25 -0
  18. package/src/hooks/use-storage.d.ts +47 -0
  19. package/src/hooks/use-thread.d.ts +33 -0
  20. package/src/hooks/use-title.d.ts +37 -0
  21. package/src/index.d.ts +5 -0
  22. package/src/math/complex/index.d.ts +54 -0
  23. package/src/math/functions/index.d.ts +140 -0
  24. package/src/math/functions/logic/index.d.ts +11 -0
  25. package/src/math/functions/mapfun/index.d.ts +87 -0
  26. package/src/math/functions/utils/index.d.ts +1 -0
  27. package/src/math/functions/utils/mapfun.d.ts +43 -0
  28. package/src/math/index.d.ts +5 -0
  29. package/src/time/clocks/clock.d.ts +28 -0
  30. package/src/time/clocks/index.d.ts +3 -0
  31. package/src/time/clocks/scheduler.d.ts +42 -0
  32. package/src/time/clocks/tick.d.ts +26 -0
  33. package/src/time/decorators/index.d.ts +9 -0
  34. package/src/time/delay/index.d.ts +12 -0
  35. package/src/time/ease/index.d.ts +103 -0
  36. package/src/time/index.d.ts +4 -0
  37. package/src/time/loop/index.d.ts +50 -0
  38. package/src/ui/__methods__/utils/index.js +1 -1
  39. package/src/ui/constructors/UIElement.js +0 -92
  40. package/src/ui/constructors/UIElementCore.d.ts +59 -0
  41. package/src/ui/constructors/UIElementCore.js +0 -9
  42. package/src/ui/constructors/UINode.d.ts +11 -0
  43. package/src/ui/constructors/UINode.js +1 -1
  44. package/src/ui/web-component/index.d.ts +14 -0
  45. package/src/ui/web-component/index.js +2 -2
package/dist/ziko.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Wed Feb 11 2026 14:01:19 GMT+0100 (UTC+01:00)
5
+ Date : Sat Feb 14 2026 15:12:05 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
@@ -1857,7 +1857,7 @@ class UINode {
1857
1857
  node
1858
1858
  };
1859
1859
  }
1860
- isZikoUINode(){
1860
+ isUINode(){
1861
1861
  return true
1862
1862
  }
1863
1863
  get node(){
@@ -2212,7 +2212,6 @@ class UIElementCore extends UINode{
2212
2212
  isRoot:false,
2213
2213
  isHidden: false,
2214
2214
  isFrozzen:false,
2215
- legacyParent : null,
2216
2215
  attributes: {},
2217
2216
  filters: {},
2218
2217
  temp:{}
@@ -2235,14 +2234,6 @@ class UIElementCore extends UINode{
2235
2234
  intersection:null
2236
2235
  };
2237
2236
  if(element) Object.assign(this.cache,{element});
2238
- // useDefaultStyle && this.style({
2239
- // position: "relative",
2240
- // boxSizing:"border-box",
2241
- // margin:0,
2242
- // padding:0,
2243
- // width : "auto",
2244
- // height : "auto"
2245
- // });
2246
2237
  this.items = new UIStore();
2247
2238
  globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
2248
2239
  element && render && this?.render?.();
@@ -2442,7 +2433,7 @@ async function __addItem__(adder, pusher, ...ele) {
2442
2433
  }
2443
2434
  }
2444
2435
  if (typeof globalThis?.Node === "function" && ele[i] instanceof globalThis?.Node) ele[i] = new this.constructor(ele[i]);
2445
- if (ele[i]?.isZikoUINode) {
2436
+ if (ele[i]?.isUINode) {
2446
2437
  ele[i].cache.parent = this;
2447
2438
  this.element?.[adder](ele[i].element);
2448
2439
  ele[i].target = this.element;
@@ -3346,19 +3337,9 @@ var StyleMethods = /*#__PURE__*/Object.freeze({
3346
3337
  style: style$1
3347
3338
  });
3348
3339
 
3349
- // import {
3350
- // // useCustomEvent,
3351
- // // useSwipeEvent,
3352
- // // watchIntersection,
3353
- // // watchSize,
3354
- // // watchAttr,
3355
- // // watchChildren
3356
- // } from "../../--reactivity-deprecated/events/custom-event.js"
3357
3340
  let UIElement$1 = class UIElement extends UIElementCore{
3358
3341
  constructor({element, name ='', type='html', render = __Ziko__.__Config__.default.render}={}){
3359
3342
  super();
3360
- // console.log({type})
3361
- // console.log(this)
3362
3343
  register_to_class(
3363
3344
  this,
3364
3345
  LifecycleMethods,
@@ -3369,7 +3350,6 @@ let UIElement$1 = class UIElement extends UIElementCore{
3369
3350
  EventsMethodes
3370
3351
  );
3371
3352
 
3372
- // console.log(EventsMethodes)
3373
3353
  if(element)this.init(element, name, type, render);
3374
3354
  }
3375
3355
  get element(){
@@ -3387,9 +3367,6 @@ let UIElement$1 = class UIElement extends UIElementCore{
3387
3367
  if(directive)this.element.setAttribute('data-hydration-directive', directive);
3388
3368
  return this;
3389
3369
  }
3390
- // isUIElement(){
3391
- // return true;
3392
- // }
3393
3370
  get st(){
3394
3371
  return this.cache.style;
3395
3372
  }
@@ -3429,84 +3406,6 @@ let UIElement$1 = class UIElement extends UIElementCore{
3429
3406
  get left(){
3430
3407
  return this.element.getBoundingClientRect().left;
3431
3408
  }
3432
- // clone(render=false) {
3433
- // // UI.__proto__=this.__proto__;
3434
- // // if(this.items.length){
3435
- // // const items = [...this.items].map(n=>n.clone());
3436
- // // UI.append(...items);
3437
- // // }
3438
- // // else UI.element=this.element.cloneNode(true);
3439
- // // return UI.mount(render);
3440
- // }
3441
- // [Symbol.iterator]() {
3442
- // return this.items[Symbol.iterator]();
3443
- // }
3444
- // maintain() {
3445
- // for (let i = 0; i < this.items.length; i++) {
3446
- // Object.defineProperty(this, i, {
3447
- // value: this.items[i],
3448
- // writable: true,
3449
- // configurable: true,
3450
- // enumerable: false
3451
- // });
3452
- // }
3453
- // }
3454
- // freeze(freeze){
3455
- // this.cache.isFrozzen=freeze;
3456
- // return this;
3457
- // }
3458
- // setTarget(tg) {
3459
- // if(this.isBody) return ;
3460
- // if (tg?.isUIElement) tg = tg.element;
3461
- // this.unmount();
3462
- // this.target = tg;
3463
- // this.mount();
3464
- // return this;
3465
- // }
3466
- // describe(label){
3467
- // if(label)this.setAttr("aria-label",label)
3468
- // }
3469
- // get children() {
3470
- // return [...this.element.children];
3471
- // }
3472
- // get cloneElement() {
3473
- // return this.element.cloneNode(true);
3474
- // }
3475
- // setClasses(...value) {
3476
- // this.setAttr("class", value.join(" "));
3477
- // return this;
3478
- // }
3479
- // get classes(){
3480
- // const classes=this.element.getAttribute("class");
3481
- // return classes===null?[]:classes.split(" ");
3482
- // }
3483
- // addClass() {
3484
- // /*this.setAttr("class", value);
3485
- // return this;*/
3486
- // }
3487
- // setId(id) {
3488
- // this.setAttr("id", id);
3489
- // return this;
3490
- // }
3491
- // get id() {
3492
- // return this.element.getAttribute("id");
3493
- // }
3494
- // To Fix
3495
- // onKeysDown({keys=[],callback}={}){
3496
- // if(!this.events.key)this.events.key = useKeyEvent(this);
3497
- // this.events.key.handleSuccessifKeys({keys,callback});
3498
- // return this;
3499
- // }
3500
- // watchAttr(callback){
3501
- // if(!this.observer.attr)this.observer.attr = watchAttr(this,callback);
3502
- // return this;
3503
- // }
3504
- // watchChildren(callback){
3505
- // if(!this.observer.children)this.observer.children = watchChildren(this,callback);
3506
- // return this;
3507
- // }
3508
- // watchSize(callback)Remplaced By on onViewResize
3509
- // watchIntersection(callback,config) Remplaced By onViewEnter and onViewExit
3510
3409
 
3511
3410
  };
3512
3411
 
@@ -3975,7 +3874,7 @@ function svg2dom(svgString) {
3975
3874
 
3976
3875
  const SVGWrapper = (content) => new UISVGWrapper(content);
3977
3876
 
3978
- function define_wc(name, UIElement, props = {}, { mode = 'open'} = {}) {
3877
+ function define_wc(name, UI_Constructor, props = {}, { mode = 'open'} = {}) {
3979
3878
  if (globalThis.customElements?.get(name)) {
3980
3879
  console.warn(`Custom element "${name}" is already defined`);
3981
3880
  return;
@@ -4007,7 +3906,7 @@ function define_wc(name, UIElement, props = {}, { mode = 'open'} = {}) {
4007
3906
 
4008
3907
  render() {
4009
3908
  this.shadowRoot.innerHTML = '';
4010
- const item = UIElement(this.props);
3909
+ const item = UI_Constructor(this.props);
4011
3910
  if(item instanceof Array) item.forEach(n => n.mount(this.shadowRoot));
4012
3911
  else item.mount(this.shadowRoot);
4013
3912
  }
@@ -4608,44 +4507,6 @@ const timeTaken = callback => {
4608
4507
  return r;
4609
4508
  };
4610
4509
 
4611
- const preload=(url)=>{
4612
- const xhr = new XMLHttpRequest();
4613
- xhr.open("GET", url, false);
4614
- xhr.send();
4615
- if (xhr.status === 200) {
4616
- return xhr.responseText;
4617
- } else {
4618
- throw new Error(`Failed to fetch data from ${url}. Status: ${xhr.status}`);
4619
- }
4620
- };
4621
-
4622
- async function fetchdom(url='https://github.com/zakarialaoui10') {
4623
- try {
4624
- const response = await fetch(url);
4625
- if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
4626
- const html = await response.text();
4627
- const dom = new DOMParser().parseFromString(html, 'text/html');
4628
- return dom.documentElement;
4629
- } catch (err) {
4630
- console.error('Failed to fetch DOM:', err);
4631
- throw err;
4632
- }
4633
- }
4634
-
4635
- function fetchdomSync(url='https://github.com/zakarialaoui10') {
4636
- try {
4637
- const data = preload(url);
4638
- const dom = new DOMParser().parseFromString(data, 'text/html');
4639
- return dom.documentElement;
4640
- } catch (err) {
4641
- console.error('Failed to fetch DOM synchronously:', err);
4642
- throw err;
4643
- }
4644
- }
4645
-
4646
- globalThis.fetchdom=fetchdom;
4647
- globalThis.fetchdomSync=fetchdomSync;
4648
-
4649
4510
  const csv2arr = (csv, delimiter = ",")=>csv.trim().trimEnd().split("\n").map(n=>n.split(delimiter));
4650
4511
  const csv2matrix = (csv, delimiter = ",")=>new Matrix(csv2arr(csv,delimiter));
4651
4512
  const csv2object = (csv, delimiter = ",") => {
@@ -5665,7 +5526,6 @@ exports.percentile = percentile;
5665
5526
  exports.pgcd = pgcd;
5666
5527
  exports.pow = pow$1;
5667
5528
  exports.ppcm = ppcm;
5668
- exports.preload = preload;
5669
5529
  exports.rad2deg = rad2deg;
5670
5530
  exports.remove_class = remove_class;
5671
5531
  exports.round = round;
package/dist/ziko.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Wed Feb 11 2026 14:01:19 GMT+0100 (UTC+01:00)
5
+ Date : Sat Feb 14 2026 15:12:05 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
@@ -1861,7 +1861,7 @@
1861
1861
  node
1862
1862
  };
1863
1863
  }
1864
- isZikoUINode(){
1864
+ isUINode(){
1865
1865
  return true
1866
1866
  }
1867
1867
  get node(){
@@ -2216,7 +2216,6 @@
2216
2216
  isRoot:false,
2217
2217
  isHidden: false,
2218
2218
  isFrozzen:false,
2219
- legacyParent : null,
2220
2219
  attributes: {},
2221
2220
  filters: {},
2222
2221
  temp:{}
@@ -2239,14 +2238,6 @@
2239
2238
  intersection:null
2240
2239
  };
2241
2240
  if(element) Object.assign(this.cache,{element});
2242
- // useDefaultStyle && this.style({
2243
- // position: "relative",
2244
- // boxSizing:"border-box",
2245
- // margin:0,
2246
- // padding:0,
2247
- // width : "auto",
2248
- // height : "auto"
2249
- // });
2250
2241
  this.items = new UIStore();
2251
2242
  globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
2252
2243
  element && render && this?.render?.();
@@ -2446,7 +2437,7 @@
2446
2437
  }
2447
2438
  }
2448
2439
  if (typeof globalThis?.Node === "function" && ele[i] instanceof globalThis?.Node) ele[i] = new this.constructor(ele[i]);
2449
- if (ele[i]?.isZikoUINode) {
2440
+ if (ele[i]?.isUINode) {
2450
2441
  ele[i].cache.parent = this;
2451
2442
  this.element?.[adder](ele[i].element);
2452
2443
  ele[i].target = this.element;
@@ -3350,19 +3341,9 @@
3350
3341
  style: style$1
3351
3342
  });
3352
3343
 
3353
- // import {
3354
- // // useCustomEvent,
3355
- // // useSwipeEvent,
3356
- // // watchIntersection,
3357
- // // watchSize,
3358
- // // watchAttr,
3359
- // // watchChildren
3360
- // } from "../../--reactivity-deprecated/events/custom-event.js"
3361
3344
  let UIElement$1 = class UIElement extends UIElementCore{
3362
3345
  constructor({element, name ='', type='html', render = __Ziko__.__Config__.default.render}={}){
3363
3346
  super();
3364
- // console.log({type})
3365
- // console.log(this)
3366
3347
  register_to_class(
3367
3348
  this,
3368
3349
  LifecycleMethods,
@@ -3373,7 +3354,6 @@
3373
3354
  EventsMethodes
3374
3355
  );
3375
3356
 
3376
- // console.log(EventsMethodes)
3377
3357
  if(element)this.init(element, name, type, render);
3378
3358
  }
3379
3359
  get element(){
@@ -3391,9 +3371,6 @@
3391
3371
  if(directive)this.element.setAttribute('data-hydration-directive', directive);
3392
3372
  return this;
3393
3373
  }
3394
- // isUIElement(){
3395
- // return true;
3396
- // }
3397
3374
  get st(){
3398
3375
  return this.cache.style;
3399
3376
  }
@@ -3433,84 +3410,6 @@
3433
3410
  get left(){
3434
3411
  return this.element.getBoundingClientRect().left;
3435
3412
  }
3436
- // clone(render=false) {
3437
- // // UI.__proto__=this.__proto__;
3438
- // // if(this.items.length){
3439
- // // const items = [...this.items].map(n=>n.clone());
3440
- // // UI.append(...items);
3441
- // // }
3442
- // // else UI.element=this.element.cloneNode(true);
3443
- // // return UI.mount(render);
3444
- // }
3445
- // [Symbol.iterator]() {
3446
- // return this.items[Symbol.iterator]();
3447
- // }
3448
- // maintain() {
3449
- // for (let i = 0; i < this.items.length; i++) {
3450
- // Object.defineProperty(this, i, {
3451
- // value: this.items[i],
3452
- // writable: true,
3453
- // configurable: true,
3454
- // enumerable: false
3455
- // });
3456
- // }
3457
- // }
3458
- // freeze(freeze){
3459
- // this.cache.isFrozzen=freeze;
3460
- // return this;
3461
- // }
3462
- // setTarget(tg) {
3463
- // if(this.isBody) return ;
3464
- // if (tg?.isUIElement) tg = tg.element;
3465
- // this.unmount();
3466
- // this.target = tg;
3467
- // this.mount();
3468
- // return this;
3469
- // }
3470
- // describe(label){
3471
- // if(label)this.setAttr("aria-label",label)
3472
- // }
3473
- // get children() {
3474
- // return [...this.element.children];
3475
- // }
3476
- // get cloneElement() {
3477
- // return this.element.cloneNode(true);
3478
- // }
3479
- // setClasses(...value) {
3480
- // this.setAttr("class", value.join(" "));
3481
- // return this;
3482
- // }
3483
- // get classes(){
3484
- // const classes=this.element.getAttribute("class");
3485
- // return classes===null?[]:classes.split(" ");
3486
- // }
3487
- // addClass() {
3488
- // /*this.setAttr("class", value);
3489
- // return this;*/
3490
- // }
3491
- // setId(id) {
3492
- // this.setAttr("id", id);
3493
- // return this;
3494
- // }
3495
- // get id() {
3496
- // return this.element.getAttribute("id");
3497
- // }
3498
- // To Fix
3499
- // onKeysDown({keys=[],callback}={}){
3500
- // if(!this.events.key)this.events.key = useKeyEvent(this);
3501
- // this.events.key.handleSuccessifKeys({keys,callback});
3502
- // return this;
3503
- // }
3504
- // watchAttr(callback){
3505
- // if(!this.observer.attr)this.observer.attr = watchAttr(this,callback);
3506
- // return this;
3507
- // }
3508
- // watchChildren(callback){
3509
- // if(!this.observer.children)this.observer.children = watchChildren(this,callback);
3510
- // return this;
3511
- // }
3512
- // watchSize(callback)Remplaced By on onViewResize
3513
- // watchIntersection(callback,config) Remplaced By onViewEnter and onViewExit
3514
3413
 
3515
3414
  };
3516
3415
 
@@ -3979,7 +3878,7 @@
3979
3878
 
3980
3879
  const SVGWrapper = (content) => new UISVGWrapper(content);
3981
3880
 
3982
- function define_wc(name, UIElement, props = {}, { mode = 'open'} = {}) {
3881
+ function define_wc(name, UI_Constructor, props = {}, { mode = 'open'} = {}) {
3983
3882
  if (globalThis.customElements?.get(name)) {
3984
3883
  console.warn(`Custom element "${name}" is already defined`);
3985
3884
  return;
@@ -4011,7 +3910,7 @@
4011
3910
 
4012
3911
  render() {
4013
3912
  this.shadowRoot.innerHTML = '';
4014
- const item = UIElement(this.props);
3913
+ const item = UI_Constructor(this.props);
4015
3914
  if(item instanceof Array) item.forEach(n => n.mount(this.shadowRoot));
4016
3915
  else item.mount(this.shadowRoot);
4017
3916
  }
@@ -4612,44 +4511,6 @@
4612
4511
  return r;
4613
4512
  };
4614
4513
 
4615
- const preload=(url)=>{
4616
- const xhr = new XMLHttpRequest();
4617
- xhr.open("GET", url, false);
4618
- xhr.send();
4619
- if (xhr.status === 200) {
4620
- return xhr.responseText;
4621
- } else {
4622
- throw new Error(`Failed to fetch data from ${url}. Status: ${xhr.status}`);
4623
- }
4624
- };
4625
-
4626
- async function fetchdom(url='https://github.com/zakarialaoui10') {
4627
- try {
4628
- const response = await fetch(url);
4629
- if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
4630
- const html = await response.text();
4631
- const dom = new DOMParser().parseFromString(html, 'text/html');
4632
- return dom.documentElement;
4633
- } catch (err) {
4634
- console.error('Failed to fetch DOM:', err);
4635
- throw err;
4636
- }
4637
- }
4638
-
4639
- function fetchdomSync(url='https://github.com/zakarialaoui10') {
4640
- try {
4641
- const data = preload(url);
4642
- const dom = new DOMParser().parseFromString(data, 'text/html');
4643
- return dom.documentElement;
4644
- } catch (err) {
4645
- console.error('Failed to fetch DOM synchronously:', err);
4646
- throw err;
4647
- }
4648
- }
4649
-
4650
- globalThis.fetchdom=fetchdom;
4651
- globalThis.fetchdomSync=fetchdomSync;
4652
-
4653
4514
  const csv2arr = (csv, delimiter = ",")=>csv.trim().trimEnd().split("\n").map(n=>n.split(delimiter));
4654
4515
  const csv2matrix = (csv, delimiter = ",")=>new Matrix(csv2arr(csv,delimiter));
4655
4516
  const csv2object = (csv, delimiter = ",") => {
@@ -5669,7 +5530,6 @@
5669
5530
  exports.pgcd = pgcd;
5670
5531
  exports.pow = pow$1;
5671
5532
  exports.ppcm = ppcm;
5672
- exports.preload = preload;
5673
5533
  exports.rad2deg = rad2deg;
5674
5534
  exports.remove_class = remove_class;
5675
5535
  exports.round = round;