ziko 0.48.1 → 0.49.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.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Mon Nov 10 2025 12:43:12 GMT+0100 (UTC+01:00)
5
+ Date : Sat Nov 22 2025 13:34:29 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
@@ -1338,7 +1338,7 @@ class UIElementCore extends UINode{
1338
1338
  // // UI.append(...items);
1339
1339
  // // }
1340
1340
  // // else UI.element=this.element.cloneNode(true);
1341
- // // return UI.render(render);
1341
+ // // return UI.mount(render);
1342
1342
  // }
1343
1343
 
1344
1344
  // freeze(freeze){
@@ -1348,9 +1348,9 @@ class UIElementCore extends UINode{
1348
1348
  // setTarget(tg) {
1349
1349
  // if(this.isBody) return ;
1350
1350
  // if (tg?.isUIElement) tg = tg.element;
1351
- // this.unrender();
1351
+ // this.unmount();
1352
1352
  // this.target = tg;
1353
- // this.render();
1353
+ // this.mount();
1354
1354
  // return this;
1355
1355
  // }
1356
1356
  // describe(label){
@@ -1656,18 +1656,18 @@ function remove(...ele) {
1656
1656
  return this;
1657
1657
  }
1658
1658
  function clear(){
1659
- this?.items?.forEach(n=>n.unrender());
1659
+ this?.items?.forEach(n=>n.unmount());
1660
1660
  this.element.innerHTML = "";
1661
1661
  return this;
1662
1662
  }
1663
- function render(target = this.target) {
1663
+ function mount(target = this.target) {
1664
1664
  if(this.isBody)return ;
1665
1665
  if(target?.isUIElement)target=target.element;
1666
1666
  this.target=target;
1667
1667
  this.target?.appendChild(this.element);
1668
1668
  return this;
1669
1669
  }
1670
- function unrender(){
1670
+ function unmount(){
1671
1671
  if(this.cache.parent)this.cache.parent.remove(this);
1672
1672
  else if(this.target?.children?.length && [...this.target?.children].includes(this.element)) this.target.removeChild(this.element);
1673
1673
  return this;
@@ -1680,11 +1680,11 @@ function replaceElementWith(new_element){
1680
1680
  return this
1681
1681
  }
1682
1682
  function renderAfter(t = 1) {
1683
- setTimeout(() => this.render(), t);
1683
+ setTimeout(() => this.mount(), t);
1684
1684
  return this;
1685
1685
  }
1686
1686
  function unrenderAfter(t = 1) {
1687
- setTimeout(() => this.unrender(), t);
1687
+ setTimeout(() => this.unmount(), t);
1688
1688
  return this;
1689
1689
  }
1690
1690
  function after(ui){
@@ -1705,12 +1705,12 @@ var DomMethods = /*#__PURE__*/Object.freeze({
1705
1705
  before: before,
1706
1706
  clear: clear,
1707
1707
  insertAt: insertAt,
1708
+ mount: mount,
1708
1709
  prepend: prepend,
1709
1710
  remove: remove,
1710
- render: render,
1711
1711
  renderAfter: renderAfter,
1712
1712
  replaceElementWith: replaceElementWith,
1713
- unrender: unrender,
1713
+ unmount: unmount,
1714
1714
  unrenderAfter: unrenderAfter
1715
1715
  });
1716
1716
 
@@ -2415,7 +2415,7 @@ let UIElement$1 = class UIElement extends UIElementCore{
2415
2415
  // // UI.append(...items);
2416
2416
  // // }
2417
2417
  // // else UI.element=this.element.cloneNode(true);
2418
- // // return UI.render(render);
2418
+ // // return UI.mount(render);
2419
2419
  // }
2420
2420
  // [Symbol.iterator]() {
2421
2421
  // return this.items[Symbol.iterator]();
@@ -2437,9 +2437,9 @@ let UIElement$1 = class UIElement extends UIElementCore{
2437
2437
  // setTarget(tg) {
2438
2438
  // if(this.isBody) return ;
2439
2439
  // if (tg?.isUIElement) tg = tg.element;
2440
- // this.unrender();
2440
+ // this.unmount();
2441
2441
  // this.target = tg;
2442
- // this.render();
2442
+ // this.mount();
2443
2443
  // return this;
2444
2444
  // }
2445
2445
  // describe(label){
@@ -2702,7 +2702,7 @@ class ZikoUIFlex extends UIElement$1 {
2702
2702
  if (typeof h == "number") h += "%";
2703
2703
  this.style({ width: w, height: h });
2704
2704
  this.style({ display: "flex" });
2705
- // this.render();
2705
+ // this.mount();
2706
2706
  }
2707
2707
  get isFlex(){
2708
2708
  return true;
@@ -2810,7 +2810,7 @@ class ZikoUISuspense extends UIElement{
2810
2810
  (async ()=>{
2811
2811
  try{
2812
2812
  const ui = await callback();
2813
- fallback_ui.unrender();
2813
+ fallback_ui.unmount();
2814
2814
  this.append(ui);
2815
2815
  // console.log(content)
2816
2816
  }
@@ -2912,19 +2912,19 @@ function define_wc(name, UIElement, props = {}, { mode = 'open'} = {}) {
2912
2912
  }
2913
2913
 
2914
2914
  connectedCallback() {
2915
- this.render();
2915
+ this.mount();
2916
2916
  }
2917
2917
 
2918
- render() {
2918
+ mount() {
2919
2919
  this.shadowRoot.innerHTML = '';
2920
- this.UIElement = UIElement(this.props).render(this.shadowRoot);
2920
+ this.UIElement = UIElement(this.props).mount(this.shadowRoot);
2921
2921
  }
2922
2922
 
2923
2923
  attributeChangedCallback(name, _, newValue) {
2924
2924
  Object.assign(this.props, {
2925
2925
  [name]: this.mask[name].type(newValue)
2926
2926
  });
2927
- this.render();
2927
+ this.mount();
2928
2928
  }
2929
2929
  }
2930
2930
  );
@@ -2938,7 +2938,7 @@ class UISwitch extends UIElement$1{
2938
2938
  this.init();
2939
2939
  }
2940
2940
  init(){
2941
- Object.values(this.cases).filter(n=>n != this.current).forEach(n=>n.unrender());
2941
+ Object.values(this.cases).filter(n=>n != this.current).forEach(n=>n.unmount());
2942
2942
  super.init(this.current.element);
2943
2943
  }
2944
2944
  get current(){
@@ -2965,7 +2965,7 @@ const Switch=({key, cases})=> new UISwitch(key, cases);
2965
2965
  const svg2str=svg=>(new XMLSerializer()).serializeToString(svg);
2966
2966
  const svg2ascii=svg=>btoa(svg2str(svg));
2967
2967
  const svg2imgUrl=svg=>'data:image/svg+xml;base64,'+svg2ascii(svg);
2968
- const svg2img=(svg,render=true)=>tags.img(svg2imgUrl(svg)).render(render);
2968
+ const svg2img=(svg,render=true)=>tags.img(svg2imgUrl(svg)).mount(render);
2969
2969
 
2970
2970
  // const obj2str=(object)=>{
2971
2971
  // const recursiveToString = (obj) => {
@@ -3781,27 +3781,27 @@ class Complex extends ZikoMath{
3781
3781
  this.b=a.b;
3782
3782
  }
3783
3783
  else if(typeof(a)==="object"){
3784
- if(("a" in b && "b" in a)){
3784
+ if(("a" in a && "b" in a)){
3785
3785
  this.a=a.a;
3786
3786
  this.b=a.b;
3787
3787
  }
3788
- else if(("a" in b && "z" in a)){
3788
+ else if(("a" in a && "z" in a)){
3789
3789
  this.a=a.a;
3790
3790
  this.b=sqrt$2((a.z**2)-(a.a**2));
3791
3791
  }
3792
- else if(("a" in b && "phi" in a)){
3792
+ else if(("a" in a && "phi" in a)){
3793
3793
  this.a=a.a;
3794
3794
  this.b=a.a*tan(a.phi);
3795
3795
  }
3796
- else if(("b" in b && "z" in a)){
3796
+ else if(("b" in a && "z" in a)){
3797
3797
  this.b=a.b;
3798
3798
  this.a=sqrt$2((a.z**2)-(a.b**2));
3799
3799
  }
3800
- else if(("b" in b && "phi" in a)){
3800
+ else if(("b" in a && "phi" in a)){
3801
3801
  this.b=b;
3802
3802
  this.a=a.b/tan(a.phi);
3803
3803
  }
3804
- else if(("z" in b && "phi" in a)){
3804
+ else if(("z" in a && "phi" in a)){
3805
3805
  this.a=a.z*cos$2(a.phi);
3806
3806
  this.a=a.z*sin$2(a.phi);
3807
3807
  }
@@ -3940,17 +3940,6 @@ class Complex extends ZikoMath{
3940
3940
  const de=cos$2(this.a*2)+cosh$1(this.b*2);
3941
3941
  return complex(sin$2(2*this.a)/de,sinh$1(2*this.b)/de);
3942
3942
  }
3943
- printInConsole() {
3944
- let string = this.a + " + " + this.b + " * i";
3945
- console.log(string);
3946
- return string;
3947
- }
3948
- print() {
3949
- //return text(this.a + " + i * " + this.b);
3950
- }
3951
- UI() {
3952
- return "<span>" + this.a + " + i * " + this.b + "</span>";
3953
- }
3954
3943
  }
3955
3944
  const complex=(a,b)=>{
3956
3945
  if((a instanceof Array||ArrayBuffer.isView(a)) && (b instanceof Array||ArrayBuffer.isView(a)))return a.map((n,i)=>complex(a[i],b[i]));
@@ -4078,86 +4067,127 @@ const hypot=(...x)=>{
4078
4067
  )
4079
4068
  };
4080
4069
 
4081
- const {PI, sqrt: sqrt$1, cos: cos$1, sin: sin$1, acos, pow} = Math;
4082
-
4083
- const Linear = t => t;
4084
- const InSin = t => 1 - cos$1((t * PI) / 2);
4085
- const OutSin = t => sin$1((t * PI) / 2);
4086
- const InOutSin = t => -(cos$1(PI * t) - 1) / 2;
4087
-
4088
- const InQuad = t => t**2;
4089
- const OutQuad = t => 1 - (1-t)**2;
4090
- const InOutQuad = t => t < 0.5 ? 2 * (t**2) : 1 - (-2 * t + 2)**2 / 2;
4091
-
4092
- const InCubic = t => t**3;
4093
- const OutCubic = t => 1 - (1-t)**3;
4094
- const InOutCubic = t => t < 0.5 ? 4 * (t**3) : 1 - (-2 * t + 2)**3 / 2;
4095
-
4096
- const InQuart = t => t**4;
4097
- const OutQuart = t => 1 - (1-t)**4;
4098
- const InOutQuart = t => t < 0.5 ? 8 * (t**4) : 1 - (-2 * t + 2)**4 / 2;
4099
-
4100
- const InQuint = t => t**5;
4101
- const OutQuint = t => 1 - (1-t)**5;
4102
- const InOutQuint = t => t < 0.5 ? 16 * (t**5) : 1 - (-2 * t + 2)**5 / 2;
4103
-
4104
- const InExpo = t => t === 0 ? 0 : 2**(10*t - 10);
4105
- const OutExpo = t => t === 1 ? 1 : 1 - 2**(-10 * t);
4106
- const InOutExpo = t => t === 0? 0: t === 1? 1: t < 0.5 ? 2**(20 * t - 10) / 2: (2 - 2**(-20 * t + 10)) / 2;
4107
-
4108
- const InCirc = t => 1 - sqrt$1(1 - t**2);
4109
- const OutCirc = t => sqrt$1(1 - (t-1)**2);
4110
- const InOutCirc = t => t < 0.5? (1 - sqrt$1(1 - (2*t)**2)) / 2: (sqrt$1(1 - (-2*t+2)**2) + 1) / 2;
4111
-
4112
- const Arc = t => 1 - sin$1(acos(t));
4113
- const Back = (t, x = 1) => (t**2) * ((x+1)*t - x);
4114
- const Elastic = t => -2*pow(2, 10 * (t - 1)) * cos$1(20 * PI * t / 3 * t);
4115
-
4116
- const InBack = (t, c1 = 1.70158, c3 = c1 + 1) => c3 * pow(t,3)- c1 * (t**2);
4117
- const OutBack = (t, c1 = 1.70158, c3 = c1 + 1) => 1 + c3 * pow(t - 1, 3) + c1 * pow(t - 1, 2);
4118
- const InOutBack = (t, c1 = 1.70158, c2 = c1 * 1.525) => t < 0.5 ? (pow(2 * t, 2) * ((c2 + 1) * 2 * t - c2)) / 2 : (pow(2 * t - 2, 2) * ((c2 + 1) * (t * 2 - 2) + c2) + 2) / 2;
4119
-
4120
- const InElastic = (t, c4 = 2*PI/3) => {
4121
- return t === 0
4122
- ? 0
4123
- : t === 1
4124
- ? 1
4125
- : -pow(2, 10 * t - 10) * sin$1((t * 10 - 10.75) * c4);
4126
- };
4127
-
4128
- const OutElastic = (t, c4 = 2*PI/3) => {
4129
- return t === 0
4130
- ? 0
4131
- : t === 1
4132
- ? 1
4133
- : pow(2, -10 * t) * sin$1((t * 10 - 0.75) * c4) + 1;
4134
- };
4135
- const InOutElastic = (t, c5 = 2 * PI / 4.5) => {
4136
- return t === 0
4137
- ? 0
4138
- : t === 1
4139
- ? 1
4140
- : t < 0.5
4141
- ? -(pow(2, 20 * t - 10) * sin$1((20 * t - 11.125) * c5)) / 2
4142
- : (pow(2, -20 * t + 10) * sin$1((20 * t - 11.125) * c5)) / 2 + 1;
4143
- };
4144
-
4145
- const InBounce = (t, n1 = 7.5625, d1 = 2.75) => 1 - OutBounce(1-t, n1, d1);
4146
- const OutBounce = (t, n1 = 7.5625, d1 = 2.75) => {
4147
- if(t<1/d1) return n1 * t * t;
4148
- if(t < 2 / d1) return n1 * (t -= 1.5 / d1) * t + 0.75;
4149
- if(t < 2.5 / d1) return n1 * (t -= 2.25 / d1) * t + 0.9375;
4070
+ const { PI, sqrt: sqrt$1, cos: cos$1, sin: sin$1, acos, pow } = Math;
4071
+
4072
+ const linear = t => t;
4073
+
4074
+ // --- Sin ---
4075
+ const in_sin = t => 1 - cos$1((t * PI) / 2);
4076
+ const out_sin = t => sin$1((t * PI) / 2);
4077
+ const in_out_sin = t => -(cos$1(PI * t) - 1) / 2;
4078
+
4079
+ // --- Quad ---
4080
+ const in_quad = t => t ** 2;
4081
+ const out_quad = t => 1 - (1 - t) ** 2;
4082
+ const in_out_quad = t =>
4083
+ t < 0.5 ? 2 * (t ** 2) : 1 - (-2 * t + 2) ** 2 / 2;
4084
+
4085
+ // --- Cubic ---
4086
+ const in_cubic = t => t ** 3;
4087
+ const out_cubic = t => 1 - (1 - t) ** 3;
4088
+ const in_out_cubic = t =>
4089
+ t < 0.5 ? 4 * (t ** 3) : 1 - (-2 * t + 2) ** 3 / 2;
4090
+
4091
+ // --- Quart ---
4092
+ const in_quart = t => t ** 4;
4093
+ const out_quart = t => 1 - (1 - t) ** 4;
4094
+ const in_out_quart = t =>
4095
+ t < 0.5 ? 8 * (t ** 4) : 1 - (-2 * t + 2) ** 4 / 2;
4096
+
4097
+ // --- Quint ---
4098
+ const in_quint = t => t ** 5;
4099
+ const out_quint = t => 1 - (1 - t) ** 5;
4100
+ const in_out_quint = t =>
4101
+ t < 0.5 ? 16 * (t ** 5) : 1 - (-2 * t + 2) ** 5 / 2;
4102
+
4103
+ // --- Expo ---
4104
+ const in_expo = t => (t === 0 ? 0 : 2 ** (10 * t - 10));
4105
+ const out_expo = t => (t === 1 ? 1 : 1 - 2 ** (-10 * t));
4106
+ const in_out_expo = t =>
4107
+ t === 0
4108
+ ? 0
4109
+ : t === 1
4110
+ ? 1
4111
+ : t < 0.5
4112
+ ? 2 ** (20 * t - 10) / 2
4113
+ : (2 - 2 ** (-20 * t + 10)) / 2;
4114
+
4115
+ // --- Circ ---
4116
+ const in_circ = t => 1 - sqrt$1(1 - t ** 2);
4117
+ const out_circ = t => sqrt$1(1 - (t - 1) ** 2);
4118
+ const in_out_circ = t =>
4119
+ t < 0.5
4120
+ ? (1 - sqrt$1(1 - (2 * t) ** 2)) / 2
4121
+ : (sqrt$1(1 - (-2 * t + 2) ** 2) + 1) / 2;
4122
+
4123
+ // --- Arc ---
4124
+ const arc = t => 1 - sin$1(acos(t));
4125
+
4126
+ // --- Back ---
4127
+ const back = (t, x = 1) => (t ** 2) * ((x + 1) * t - x);
4128
+
4129
+ // --- Elastic ---
4130
+ const elastic = t =>
4131
+ -2 * pow(2, 10 * (t - 1)) * cos$1((20 * PI * t) / 3 * t);
4132
+
4133
+ // --- Back variations ---
4134
+ const in_back = (t, c1 = 1.70158, c3 = c1 + 1) =>
4135
+ c3 * pow(t, 3) - c1 * (t ** 2);
4136
+
4137
+ const out_back = (t, c1 = 1.70158, c3 = c1 + 1) =>
4138
+ 1 + c3 * pow(t - 1, 3) + c1 * pow(t - 1, 2);
4139
+
4140
+ const in_out_back = (t, c1 = 1.70158, c2 = c1 * 1.525) =>
4141
+ t < 0.5
4142
+ ? (pow(2 * t, 2) * ((c2 + 1) * 2 * t - c2)) / 2
4143
+ : (pow(2 * t - 2, 2) * ((c2 + 1) * (t * 2 - 2) + c2) + 2) / 2;
4144
+
4145
+ // --- Elastic variations ---
4146
+ const in_elastic = (t, c4 = (2 * PI) / 3) =>
4147
+ t === 0
4148
+ ? 0
4149
+ : t === 1
4150
+ ? 1
4151
+ : -pow(2, 10 * t - 10) * sin$1((t * 10 - 10.75) * c4);
4152
+
4153
+ const out_elastic = (t, c4 = (2 * PI) / 3) =>
4154
+ t === 0
4155
+ ? 0
4156
+ : t === 1
4157
+ ? 1
4158
+ : pow(2, -10 * t) * sin$1((t * 10 - 0.75) * c4) + 1;
4159
+
4160
+ const in_out_elastic = (t, c5 = (2 * PI) / 4.5) =>
4161
+ t === 0
4162
+ ? 0
4163
+ : t === 1
4164
+ ? 1
4165
+ : t < 0.5
4166
+ ? -(pow(2, 20 * t - 10) * sin$1((20 * t - 11.125) * c5)) / 2
4167
+ : (pow(2, -20 * t + 10) * sin$1((20 * t - 11.125) * c5)) / 2 + 1;
4168
+
4169
+ // --- Bounce ---
4170
+ const in_bounce = (t, n1 = 7.5625, d1 = 2.75) =>
4171
+ 1 - out_bounce(1 - t, n1, d1);
4172
+
4173
+ const out_bounce = (t, n1 = 7.5625, d1 = 2.75) => {
4174
+ if (t < 1 / d1) return n1 * t * t;
4175
+ if (t < 2 / d1) return n1 * (t -= 1.5 / d1) * t + 0.75;
4176
+ if (t < 2.5 / d1) return n1 * (t -= 2.25 / d1) * t + 0.9375;
4150
4177
  return n1 * (t -= 2.625 / d1) * t + 0.984375;
4151
4178
  };
4152
4179
 
4153
- const InOutBounce = (t, n1 = 7.5625, d1 = 2.75) => t < 0.5 ? OutBounce(1 - 2 * t, n1, d1)/2 : OutBounce(2 * t - 1, n1, d1)/2;
4154
-
4180
+ const in_out_bounce = (t, n1 = 7.5625, d1 = 2.75) =>
4181
+ t < 0.5
4182
+ ? out_bounce(1 - 2 * t, n1, d1) / 2
4183
+ : out_bounce(2 * t - 1, n1, d1) / 2;
4155
4184
 
4156
- const Step = (t, steps = 5) => Math.floor(t*steps) / steps;
4157
- const Discret = (t, segments = 5) => Math.ceil(t*segments) / segments;
4185
+ // --- Step / Discrete ---
4186
+ const step = (t, steps = 5) => Math.floor(t * steps) / steps;
4187
+ const discret = (t, segments = 5) => Math.ceil(t * segments) / segments;
4158
4188
 
4159
4189
  class TimeAnimation {
4160
- constructor(callback, { ease = Linear, step = 50, t0 = 0, start = true, duration = 3000 } = {}) {
4190
+ constructor(callback, { ease = linear, step = 50, t0 = 0, start = true, duration = 3000 } = {}) {
4161
4191
  this.callback = callback;
4162
4192
  this.state = {
4163
4193
  isRunning: false,
@@ -4825,7 +4855,7 @@ class ZikoApp {
4825
4855
  this.head && this.setHead(this.head);
4826
4856
  this.wrapper && this.setWrapper(this.wrapper);
4827
4857
  this.target && this.setTarget(this.target);
4828
- if(this.wrapper && this.target)this.wrapper.render(this.target);
4858
+ if(this.wrapper && this.target)this.wrapper.mount(this.target);
4829
4859
  }
4830
4860
  setTarget(target){
4831
4861
  if(target instanceof HTMLElement) this.target = target;
@@ -4901,16 +4931,16 @@ class ZikoSPA extends ZikoApp{
4901
4931
  ...Object.entries(routes)
4902
4932
  ]);
4903
4933
  this.clear();
4904
- globalThis.onpopstate = this.render(location.pathname);
4934
+ globalThis.onpopstate = this.mount(location.pathname);
4905
4935
  }
4906
4936
  clear(){
4907
4937
  [...this.routes].forEach(n=>{
4908
- !isDynamic(n[0]) && n[1]?.isUIElement && n[1].unrender();
4938
+ !isDynamic(n[0]) && n[1]?.isUIElement && n[1].unmount();
4909
4939
  });
4910
4940
  // this.wrapper.clear();
4911
4941
  return this;
4912
4942
  }
4913
- render(path){
4943
+ mount(path){
4914
4944
  const [mask, callback] = [...this.routes].find(route=>routesMatcher(route[0],path));
4915
4945
  let element ;
4916
4946
  if(isDynamic(mask)){
@@ -4918,13 +4948,13 @@ class ZikoSPA extends ZikoApp{
4918
4948
  element = callback.call(this,params);
4919
4949
  }
4920
4950
  else {
4921
- callback?.isUIElement && callback.render(this.wrapper);
4951
+ callback?.isUIElement && callback.mount(this.wrapper);
4922
4952
  if(typeof callback === "function") element = callback();
4923
4953
  }
4924
- if(element?.isUIElement) element.render(this.wrapper);
4925
- // if(element?.isZikoApp) element.render(this.wrapper);
4954
+ if(element?.isUIElement) element.mount(this.wrapper);
4955
+ // if(element?.isZikoApp) element.mount(this.wrapper);
4926
4956
  if(element instanceof Promise){
4927
- element.then(e=>e.render(this.wrapper));
4957
+ element.then(e=>e.mount(this.wrapper));
4928
4958
  }
4929
4959
  globalThis.history.pushState({}, "", path);
4930
4960
  return this;
@@ -5359,4 +5389,4 @@ if(globalThis?.document){
5359
5389
  document?.addEventListener("DOMContentLoaded", __Ziko__.__Config__.init());
5360
5390
  }
5361
5391
 
5362
- export { App, Arc, Back, Base, Clock, Combinaison, Complex, Discret, E, EPSILON, Elastic, FileBasedRouting, Flex, HTMLWrapper, InBack, InBounce, InCirc, InCubic, InElastic, InExpo, InOutBack, InOutBounce, InOutCirc, InOutCubic, InOutElastic, InOutExpo, InOutQuad, InOutQuart, InOutQuint, InOutSin, InQuad, InQuart, InQuint, InSin, Linear, Logic$1 as Logic, Matrix, OutBack, OutBounce, OutCirc, OutCubic, OutElastic, OutExpo, OutQuad, OutQuart, OutQuint, OutSin, PI$2 as PI, Permutation, Random, SPA, SVGWrapper, Scheduler, Step, Suspense, Switch, Tick, TimeAnimation, TimeLoop, TimeScheduler, UIElement$1 as UIElement, UIHTMLWrapper, UINode, UISVGWrapper, UISwitch, UIView, Utils, View, ZikoApp, ZikoEventClick, ZikoEventClipboard, ZikoEventCustom, ZikoEventDrag, ZikoEventFocus, ZikoEventHash, ZikoEventKey, ZikoEventMouse, ZikoEventPointer, ZikoEventTouch, ZikoEventWheel, ZikoSPA, ZikoUIFlex, ZikoUISuspense, ZikoUIText, ZikoUseRoot, __ZikoEvent__, abs, accum, acos$1 as acos, acosh, acot, add, animation, arange, arr2str, asin, asinh, atan, atan2, atanh, bindCustomEvent, bindHashEvent, bindTouchEvent, bind_click_event, bind_clipboard_event, bind_drag_event, bind_focus_event, bind_key_event, bind_mouse_event, bind_pointer_event, bind_wheel_event, cartesianProduct, ceil, clamp, clock, combinaison, complex, cos$2 as cos, cosh$1 as cosh, cot, coth, csc, csv2arr, csv2json, csv2matrix, csv2object, csv2sql, debounce, defineParamsGetter, define_wc, deg2rad, div, e, fact, floor, geomspace, getEvent, hypot, inRange, isApproximatlyEqual, isStateGetter, json2arr, json2css, json2csv, json2csvFile, json2xml, json2xmlFile, json2yml, json2ymlFile, lerp, linspace, ln, logspace, loop, map$1 as map, mapfun$1 as mapfun, matrix, matrix2, matrix3, matrix4, max, min, modulo, mul, norm, nums, obj2str, ones, pgcd, pow$1 as pow, powerSet, ppcm, preload, prod, rad2deg, round, sec, sig, sign, sin$2 as sin, sinc, sinh$1 as sinh, sleep, sqrt$2 as sqrt, sqrtn, step_fps, sub, subSet, sum, svg2ascii, svg2img, svg2imgUrl, svg2str, tags, tan, tanh, text, throttle, tick, timeTaken, time_memory_Taken, timeout, useChannel, useDerived, useEventEmitter, useLocaleStorage, useReactive, useRoot, useSessionStorage, useState, useThread, wait, waitForUIElm, waitForUIElmSync, zeros };
5392
+ export { App, Base, Clock, Combinaison, Complex, E, EPSILON, FileBasedRouting, Flex, HTMLWrapper, Logic$1 as Logic, Matrix, PI$2 as PI, Permutation, Random, SPA, SVGWrapper, Scheduler, Suspense, Switch, Tick, TimeAnimation, TimeLoop, TimeScheduler, UIElement$1 as UIElement, UIHTMLWrapper, UINode, UISVGWrapper, UISwitch, UIView, Utils, View, ZikoApp, ZikoEventClick, ZikoEventClipboard, ZikoEventCustom, ZikoEventDrag, ZikoEventFocus, ZikoEventHash, ZikoEventKey, ZikoEventMouse, ZikoEventPointer, ZikoEventTouch, ZikoEventWheel, ZikoSPA, ZikoUIFlex, ZikoUISuspense, ZikoUIText, ZikoUseRoot, __ZikoEvent__, abs, accum, acos$1 as acos, acosh, acot, add, animation, arange, arc, arr2str, asin, asinh, atan, atan2, atanh, back, bindCustomEvent, bindHashEvent, bindTouchEvent, bind_click_event, bind_clipboard_event, bind_drag_event, bind_focus_event, bind_key_event, bind_mouse_event, bind_pointer_event, bind_wheel_event, cartesianProduct, ceil, clamp, clock, combinaison, complex, cos$2 as cos, cosh$1 as cosh, cot, coth, csc, csv2arr, csv2json, csv2matrix, csv2object, csv2sql, debounce, defineParamsGetter, define_wc, deg2rad, discret, div, e, elastic, fact, floor, geomspace, getEvent, hypot, inRange, in_back, in_bounce, in_circ, in_cubic, in_elastic, in_expo, in_out_back, in_out_bounce, in_out_circ, in_out_cubic, in_out_elastic, in_out_expo, in_out_quad, in_out_quart, in_out_quint, in_out_sin, in_quad, in_quart, in_quint, in_sin, isApproximatlyEqual, isStateGetter, json2arr, json2css, json2csv, json2csvFile, json2xml, json2xmlFile, json2yml, json2ymlFile, lerp, linear, linspace, ln, logspace, loop, map$1 as map, mapfun$1 as mapfun, matrix, matrix2, matrix3, matrix4, max, min, modulo, mul, norm, nums, obj2str, ones, out_back, out_bounce, out_circ, out_cubic, out_elastic, out_expo, out_quad, out_quart, out_quint, out_sin, pgcd, pow$1 as pow, powerSet, ppcm, preload, prod, rad2deg, round, sec, sig, sign, sin$2 as sin, sinc, sinh$1 as sinh, sleep, sqrt$2 as sqrt, sqrtn, step, step_fps, sub, subSet, sum, svg2ascii, svg2img, svg2imgUrl, svg2str, tags, tan, tanh, text, throttle, tick, timeTaken, time_memory_Taken, timeout, useChannel, useDerived, useEventEmitter, useLocaleStorage, useReactive, useRoot, useSessionStorage, useState, useThread, wait, waitForUIElm, waitForUIElmSync, zeros };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.48.1",
3
+ "version": "0.49.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",
@@ -24,16 +24,17 @@
24
24
  "types",
25
25
  "LICENCE"
26
26
  ],
27
- "types": "./types/global.d.ts",
28
27
  "exports": {
29
- "./*": "./src/*",
28
+ "./*": {
29
+ "import" : "./src/*/index.js",
30
+ "types" : "./types/*/index.d.ts"
31
+ },
30
32
  ".": {
31
33
  "import": "./dist/ziko.mjs",
32
- "require": "./dist/ziko.cjs"
33
- },
34
- "./math": {
35
- "import": "./src/math/index.js"
34
+ "require": "./dist/ziko.cjs",
35
+ "types" : "./types/index.d.ts"
36
36
  },
37
+
37
38
  "./helpers": {
38
39
  "import": "./src/__helpers__.js"
39
40
  },
@@ -59,7 +60,6 @@
59
60
  "./src": "./src/index.js",
60
61
  "./html": {},
61
62
  "./app": {},
62
- "./time": {},
63
63
  "./components": {}
64
64
  },
65
65
  "sideEffects" : true,
File without changes
package/src/app/spa.js CHANGED
@@ -9,16 +9,16 @@ class ZikoSPA extends ZikoApp{
9
9
  ...Object.entries(routes)
10
10
  ]);
11
11
  this.clear();
12
- globalThis.onpopstate = this.render(location.pathname);
12
+ globalThis.onpopstate = this.mount(location.pathname);
13
13
  }
14
14
  clear(){
15
15
  [...this.routes].forEach(n=>{
16
- !isDynamic(n[0]) && n[1]?.isUIElement && n[1].unrender()
16
+ !isDynamic(n[0]) && n[1]?.isUIElement && n[1].unmount()
17
17
  })
18
18
  // this.wrapper.clear();
19
19
  return this;
20
20
  }
21
- render(path){
21
+ mount(path){
22
22
  const [mask, callback] = [...this.routes].find(route=>routesMatcher(route[0],path));
23
23
  let element ;
24
24
  if(isDynamic(mask)){
@@ -26,13 +26,13 @@ class ZikoSPA extends ZikoApp{
26
26
  element = callback.call(this,params)
27
27
  }
28
28
  else {
29
- callback?.isUIElement && callback.render(this.wrapper);
29
+ callback?.isUIElement && callback.mount(this.wrapper);
30
30
  if(typeof callback === "function") element = callback();
31
31
  }
32
- if(element?.isUIElement) element.render(this.wrapper);
33
- // if(element?.isZikoApp) element.render(this.wrapper);
32
+ if(element?.isUIElement) element.mount(this.wrapper);
33
+ // if(element?.isZikoApp) element.mount(this.wrapper);
34
34
  if(element instanceof Promise){
35
- element.then(e=>e.render(this.wrapper))
35
+ element.then(e=>e.mount(this.wrapper))
36
36
  }
37
37
  globalThis.history.pushState({}, "", path);
38
38
  return this;
@@ -13,7 +13,7 @@ class ZikoApp {
13
13
  this.head && this.setHead(this.head);
14
14
  this.wrapper && this.setWrapper(this.wrapper);
15
15
  this.target && this.setTarget(this.target);
16
- if(this.wrapper && this.target)this.wrapper.render(this.target);
16
+ if(this.wrapper && this.target)this.wrapper.mount(this.target);
17
17
  }
18
18
  setTarget(target){
19
19
  if(target instanceof HTMLElement) this.target = target;
@@ -2,7 +2,7 @@ import { tags } from "../../ui"
2
2
  const svg2str=svg=>(new XMLSerializer()).serializeToString(svg);
3
3
  const svg2ascii=svg=>btoa(svg2str(svg));
4
4
  const svg2imgUrl=svg=>'data:image/svg+xml;base64,'+svg2ascii(svg);
5
- const svg2img=(svg,render=true)=>tags.img(svg2imgUrl(svg)).render(render);
5
+ const svg2img=(svg,render=true)=>tags.img(svg2imgUrl(svg)).mount(render);
6
6
  export{
7
7
  svg2str,
8
8
  svg2ascii,
@@ -23,27 +23,27 @@ class Complex extends ZikoMath{
23
23
  this.b=a.b;
24
24
  }
25
25
  else if(typeof(a)==="object"){
26
- if(("a" in b && "b" in a)){
26
+ if(("a" in a && "b" in a)){
27
27
  this.a=a.a;
28
28
  this.b=a.b;
29
29
  }
30
- else if(("a" in b && "z" in a)){
30
+ else if(("a" in a && "z" in a)){
31
31
  this.a=a.a;
32
32
  this.b=sqrt((a.z**2)-(a.a**2));
33
33
  }
34
- else if(("a" in b && "phi" in a)){
34
+ else if(("a" in a && "phi" in a)){
35
35
  this.a=a.a;
36
36
  this.b=a.a*tan(a.phi);
37
37
  }
38
- else if(("b" in b && "z" in a)){
38
+ else if(("b" in a && "z" in a)){
39
39
  this.b=a.b;
40
40
  this.a=sqrt((a.z**2)-(a.b**2));
41
41
  }
42
- else if(("b" in b && "phi" in a)){
42
+ else if(("b" in a && "phi" in a)){
43
43
  this.b=b;
44
44
  this.a=a.b/tan(a.phi);
45
45
  }
46
- else if(("z" in b && "phi" in a)){
46
+ else if(("z" in a && "phi" in a)){
47
47
  this.a=a.z*cos(a.phi);
48
48
  this.a=a.z*sin(a.phi);
49
49
  }
@@ -182,17 +182,6 @@ class Complex extends ZikoMath{
182
182
  const de=cos(this.a*2)+cosh(this.b*2);
183
183
  return complex(sin(2*this.a)/de,sinh(2*this.b)/de);
184
184
  }
185
- printInConsole() {
186
- let string = this.a + " + " + this.b + " * i";
187
- console.log(string);
188
- return string;
189
- }
190
- print() {
191
- //return text(this.a + " + i * " + this.b);
192
- }
193
- UI() {
194
- return "<span>" + this.a + " + i * " + this.b + "</span>";
195
- }
196
185
  }
197
186
  const complex=(a,b)=>{
198
187
  if((a instanceof Array||ArrayBuffer.isView(a)) && (b instanceof Array||ArrayBuffer.isView(a)))return a.map((n,i)=>complex(a[i],b[i]));
@@ -1,8 +1,8 @@
1
- import { Linear } from "../ease/index.js";
1
+ import { linear } from "../ease/index.js";
2
2
  import { map } from "../../math/utils/index.js";
3
3
 
4
4
  class TimeAnimation {
5
- constructor(callback, { ease = Linear, step = 50, t0 = 0, start = true, duration = 3000 } = {}) {
5
+ constructor(callback, { ease = linear, step = 50, t0 = 0, start = true, duration = 3000 } = {}) {
6
6
  this.callback = callback;
7
7
  this.state = {
8
8
  isRunning: false,