ziko 0.48.1 → 0.48.2

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.cjs 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 : Fri Nov 21 2025 22:08:16 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
@@ -3783,27 +3783,27 @@ class Complex extends ZikoMath{
3783
3783
  this.b=a.b;
3784
3784
  }
3785
3785
  else if(typeof(a)==="object"){
3786
- if(("a" in b && "b" in a)){
3786
+ if(("a" in a && "b" in a)){
3787
3787
  this.a=a.a;
3788
3788
  this.b=a.b;
3789
3789
  }
3790
- else if(("a" in b && "z" in a)){
3790
+ else if(("a" in a && "z" in a)){
3791
3791
  this.a=a.a;
3792
3792
  this.b=sqrt$2((a.z**2)-(a.a**2));
3793
3793
  }
3794
- else if(("a" in b && "phi" in a)){
3794
+ else if(("a" in a && "phi" in a)){
3795
3795
  this.a=a.a;
3796
3796
  this.b=a.a*tan(a.phi);
3797
3797
  }
3798
- else if(("b" in b && "z" in a)){
3798
+ else if(("b" in a && "z" in a)){
3799
3799
  this.b=a.b;
3800
3800
  this.a=sqrt$2((a.z**2)-(a.b**2));
3801
3801
  }
3802
- else if(("b" in b && "phi" in a)){
3802
+ else if(("b" in a && "phi" in a)){
3803
3803
  this.b=b;
3804
3804
  this.a=a.b/tan(a.phi);
3805
3805
  }
3806
- else if(("z" in b && "phi" in a)){
3806
+ else if(("z" in a && "phi" in a)){
3807
3807
  this.a=a.z*cos$2(a.phi);
3808
3808
  this.a=a.z*sin$2(a.phi);
3809
3809
  }
@@ -3942,17 +3942,6 @@ class Complex extends ZikoMath{
3942
3942
  const de=cos$2(this.a*2)+cosh$1(this.b*2);
3943
3943
  return complex(sin$2(2*this.a)/de,sinh$1(2*this.b)/de);
3944
3944
  }
3945
- printInConsole() {
3946
- let string = this.a + " + " + this.b + " * i";
3947
- console.log(string);
3948
- return string;
3949
- }
3950
- print() {
3951
- //return text(this.a + " + i * " + this.b);
3952
- }
3953
- UI() {
3954
- return "<span>" + this.a + " + i * " + this.b + "</span>";
3955
- }
3956
3945
  }
3957
3946
  const complex=(a,b)=>{
3958
3947
  if((a instanceof Array||ArrayBuffer.isView(a)) && (b instanceof Array||ArrayBuffer.isView(a)))return a.map((n,i)=>complex(a[i],b[i]));
@@ -4080,86 +4069,127 @@ const hypot=(...x)=>{
4080
4069
  )
4081
4070
  };
4082
4071
 
4083
- const {PI, sqrt: sqrt$1, cos: cos$1, sin: sin$1, acos, pow} = Math;
4084
-
4085
- const Linear = t => t;
4086
- const InSin = t => 1 - cos$1((t * PI) / 2);
4087
- const OutSin = t => sin$1((t * PI) / 2);
4088
- const InOutSin = t => -(cos$1(PI * t) - 1) / 2;
4089
-
4090
- const InQuad = t => t**2;
4091
- const OutQuad = t => 1 - (1-t)**2;
4092
- const InOutQuad = t => t < 0.5 ? 2 * (t**2) : 1 - (-2 * t + 2)**2 / 2;
4093
-
4094
- const InCubic = t => t**3;
4095
- const OutCubic = t => 1 - (1-t)**3;
4096
- const InOutCubic = t => t < 0.5 ? 4 * (t**3) : 1 - (-2 * t + 2)**3 / 2;
4097
-
4098
- const InQuart = t => t**4;
4099
- const OutQuart = t => 1 - (1-t)**4;
4100
- const InOutQuart = t => t < 0.5 ? 8 * (t**4) : 1 - (-2 * t + 2)**4 / 2;
4101
-
4102
- const InQuint = t => t**5;
4103
- const OutQuint = t => 1 - (1-t)**5;
4104
- const InOutQuint = t => t < 0.5 ? 16 * (t**5) : 1 - (-2 * t + 2)**5 / 2;
4105
-
4106
- const InExpo = t => t === 0 ? 0 : 2**(10*t - 10);
4107
- const OutExpo = t => t === 1 ? 1 : 1 - 2**(-10 * t);
4108
- const InOutExpo = t => t === 0? 0: t === 1? 1: t < 0.5 ? 2**(20 * t - 10) / 2: (2 - 2**(-20 * t + 10)) / 2;
4109
-
4110
- const InCirc = t => 1 - sqrt$1(1 - t**2);
4111
- const OutCirc = t => sqrt$1(1 - (t-1)**2);
4112
- const InOutCirc = t => t < 0.5? (1 - sqrt$1(1 - (2*t)**2)) / 2: (sqrt$1(1 - (-2*t+2)**2) + 1) / 2;
4113
-
4114
- const Arc = t => 1 - sin$1(acos(t));
4115
- const Back = (t, x = 1) => (t**2) * ((x+1)*t - x);
4116
- const Elastic = t => -2*pow(2, 10 * (t - 1)) * cos$1(20 * PI * t / 3 * t);
4117
-
4118
- const InBack = (t, c1 = 1.70158, c3 = c1 + 1) => c3 * pow(t,3)- c1 * (t**2);
4119
- const OutBack = (t, c1 = 1.70158, c3 = c1 + 1) => 1 + c3 * pow(t - 1, 3) + c1 * pow(t - 1, 2);
4120
- 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;
4121
-
4122
- const InElastic = (t, c4 = 2*PI/3) => {
4123
- return t === 0
4124
- ? 0
4125
- : t === 1
4126
- ? 1
4127
- : -pow(2, 10 * t - 10) * sin$1((t * 10 - 10.75) * c4);
4128
- };
4129
-
4130
- const OutElastic = (t, c4 = 2*PI/3) => {
4131
- return t === 0
4132
- ? 0
4133
- : t === 1
4134
- ? 1
4135
- : pow(2, -10 * t) * sin$1((t * 10 - 0.75) * c4) + 1;
4136
- };
4137
- const InOutElastic = (t, c5 = 2 * PI / 4.5) => {
4138
- return t === 0
4139
- ? 0
4140
- : t === 1
4141
- ? 1
4142
- : t < 0.5
4143
- ? -(pow(2, 20 * t - 10) * sin$1((20 * t - 11.125) * c5)) / 2
4144
- : (pow(2, -20 * t + 10) * sin$1((20 * t - 11.125) * c5)) / 2 + 1;
4145
- };
4146
-
4147
- const InBounce = (t, n1 = 7.5625, d1 = 2.75) => 1 - OutBounce(1-t, n1, d1);
4148
- const OutBounce = (t, n1 = 7.5625, d1 = 2.75) => {
4149
- if(t<1/d1) return n1 * t * t;
4150
- if(t < 2 / d1) return n1 * (t -= 1.5 / d1) * t + 0.75;
4151
- if(t < 2.5 / d1) return n1 * (t -= 2.25 / d1) * t + 0.9375;
4072
+ const { PI, sqrt: sqrt$1, cos: cos$1, sin: sin$1, acos, pow } = Math;
4073
+
4074
+ const linear = t => t;
4075
+
4076
+ // --- Sin ---
4077
+ const in_sin = t => 1 - cos$1((t * PI) / 2);
4078
+ const out_sin = t => sin$1((t * PI) / 2);
4079
+ const in_out_sin = t => -(cos$1(PI * t) - 1) / 2;
4080
+
4081
+ // --- Quad ---
4082
+ const in_quad = t => t ** 2;
4083
+ const out_quad = t => 1 - (1 - t) ** 2;
4084
+ const in_out_quad = t =>
4085
+ t < 0.5 ? 2 * (t ** 2) : 1 - (-2 * t + 2) ** 2 / 2;
4086
+
4087
+ // --- Cubic ---
4088
+ const in_cubic = t => t ** 3;
4089
+ const out_cubic = t => 1 - (1 - t) ** 3;
4090
+ const in_out_cubic = t =>
4091
+ t < 0.5 ? 4 * (t ** 3) : 1 - (-2 * t + 2) ** 3 / 2;
4092
+
4093
+ // --- Quart ---
4094
+ const in_quart = t => t ** 4;
4095
+ const out_quart = t => 1 - (1 - t) ** 4;
4096
+ const in_out_quart = t =>
4097
+ t < 0.5 ? 8 * (t ** 4) : 1 - (-2 * t + 2) ** 4 / 2;
4098
+
4099
+ // --- Quint ---
4100
+ const in_quint = t => t ** 5;
4101
+ const out_quint = t => 1 - (1 - t) ** 5;
4102
+ const in_out_quint = t =>
4103
+ t < 0.5 ? 16 * (t ** 5) : 1 - (-2 * t + 2) ** 5 / 2;
4104
+
4105
+ // --- Expo ---
4106
+ const in_expo = t => (t === 0 ? 0 : 2 ** (10 * t - 10));
4107
+ const out_expo = t => (t === 1 ? 1 : 1 - 2 ** (-10 * t));
4108
+ const in_out_expo = t =>
4109
+ t === 0
4110
+ ? 0
4111
+ : t === 1
4112
+ ? 1
4113
+ : t < 0.5
4114
+ ? 2 ** (20 * t - 10) / 2
4115
+ : (2 - 2 ** (-20 * t + 10)) / 2;
4116
+
4117
+ // --- Circ ---
4118
+ const in_circ = t => 1 - sqrt$1(1 - t ** 2);
4119
+ const out_circ = t => sqrt$1(1 - (t - 1) ** 2);
4120
+ const in_out_circ = t =>
4121
+ t < 0.5
4122
+ ? (1 - sqrt$1(1 - (2 * t) ** 2)) / 2
4123
+ : (sqrt$1(1 - (-2 * t + 2) ** 2) + 1) / 2;
4124
+
4125
+ // --- Arc ---
4126
+ const arc = t => 1 - sin$1(acos(t));
4127
+
4128
+ // --- Back ---
4129
+ const back = (t, x = 1) => (t ** 2) * ((x + 1) * t - x);
4130
+
4131
+ // --- Elastic ---
4132
+ const elastic = t =>
4133
+ -2 * pow(2, 10 * (t - 1)) * cos$1((20 * PI * t) / 3 * t);
4134
+
4135
+ // --- Back variations ---
4136
+ const in_back = (t, c1 = 1.70158, c3 = c1 + 1) =>
4137
+ c3 * pow(t, 3) - c1 * (t ** 2);
4138
+
4139
+ const out_back = (t, c1 = 1.70158, c3 = c1 + 1) =>
4140
+ 1 + c3 * pow(t - 1, 3) + c1 * pow(t - 1, 2);
4141
+
4142
+ const in_out_back = (t, c1 = 1.70158, c2 = c1 * 1.525) =>
4143
+ t < 0.5
4144
+ ? (pow(2 * t, 2) * ((c2 + 1) * 2 * t - c2)) / 2
4145
+ : (pow(2 * t - 2, 2) * ((c2 + 1) * (t * 2 - 2) + c2) + 2) / 2;
4146
+
4147
+ // --- Elastic variations ---
4148
+ const in_elastic = (t, c4 = (2 * PI) / 3) =>
4149
+ t === 0
4150
+ ? 0
4151
+ : t === 1
4152
+ ? 1
4153
+ : -pow(2, 10 * t - 10) * sin$1((t * 10 - 10.75) * c4);
4154
+
4155
+ const out_elastic = (t, c4 = (2 * PI) / 3) =>
4156
+ t === 0
4157
+ ? 0
4158
+ : t === 1
4159
+ ? 1
4160
+ : pow(2, -10 * t) * sin$1((t * 10 - 0.75) * c4) + 1;
4161
+
4162
+ const in_out_elastic = (t, c5 = (2 * PI) / 4.5) =>
4163
+ t === 0
4164
+ ? 0
4165
+ : t === 1
4166
+ ? 1
4167
+ : t < 0.5
4168
+ ? -(pow(2, 20 * t - 10) * sin$1((20 * t - 11.125) * c5)) / 2
4169
+ : (pow(2, -20 * t + 10) * sin$1((20 * t - 11.125) * c5)) / 2 + 1;
4170
+
4171
+ // --- Bounce ---
4172
+ const in_bounce = (t, n1 = 7.5625, d1 = 2.75) =>
4173
+ 1 - out_bounce(1 - t, n1, d1);
4174
+
4175
+ const out_bounce = (t, n1 = 7.5625, d1 = 2.75) => {
4176
+ if (t < 1 / d1) return n1 * t * t;
4177
+ if (t < 2 / d1) return n1 * (t -= 1.5 / d1) * t + 0.75;
4178
+ if (t < 2.5 / d1) return n1 * (t -= 2.25 / d1) * t + 0.9375;
4152
4179
  return n1 * (t -= 2.625 / d1) * t + 0.984375;
4153
4180
  };
4154
4181
 
4155
- 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;
4156
-
4182
+ const in_out_bounce = (t, n1 = 7.5625, d1 = 2.75) =>
4183
+ t < 0.5
4184
+ ? out_bounce(1 - 2 * t, n1, d1) / 2
4185
+ : out_bounce(2 * t - 1, n1, d1) / 2;
4157
4186
 
4158
- const Step = (t, steps = 5) => Math.floor(t*steps) / steps;
4159
- const Discret = (t, segments = 5) => Math.ceil(t*segments) / segments;
4187
+ // --- Step / Discrete ---
4188
+ const step = (t, steps = 5) => Math.floor(t * steps) / steps;
4189
+ const discret = (t, segments = 5) => Math.ceil(t * segments) / segments;
4160
4190
 
4161
4191
  class TimeAnimation {
4162
- constructor(callback, { ease = Linear, step = 50, t0 = 0, start = true, duration = 3000 } = {}) {
4192
+ constructor(callback, { ease = linear, step = 50, t0 = 0, start = true, duration = 3000 } = {}) {
4163
4193
  this.callback = callback;
4164
4194
  this.state = {
4165
4195
  isRunning: false,
@@ -5362,59 +5392,23 @@ if(globalThis?.document){
5362
5392
  }
5363
5393
 
5364
5394
  exports.App = App;
5365
- exports.Arc = Arc;
5366
- exports.Back = Back;
5367
5395
  exports.Base = Base;
5368
5396
  exports.Clock = Clock;
5369
5397
  exports.Combinaison = Combinaison;
5370
5398
  exports.Complex = Complex;
5371
- exports.Discret = Discret;
5372
5399
  exports.E = E;
5373
5400
  exports.EPSILON = EPSILON;
5374
- exports.Elastic = Elastic;
5375
5401
  exports.FileBasedRouting = FileBasedRouting;
5376
5402
  exports.Flex = Flex;
5377
5403
  exports.HTMLWrapper = HTMLWrapper;
5378
- exports.InBack = InBack;
5379
- exports.InBounce = InBounce;
5380
- exports.InCirc = InCirc;
5381
- exports.InCubic = InCubic;
5382
- exports.InElastic = InElastic;
5383
- exports.InExpo = InExpo;
5384
- exports.InOutBack = InOutBack;
5385
- exports.InOutBounce = InOutBounce;
5386
- exports.InOutCirc = InOutCirc;
5387
- exports.InOutCubic = InOutCubic;
5388
- exports.InOutElastic = InOutElastic;
5389
- exports.InOutExpo = InOutExpo;
5390
- exports.InOutQuad = InOutQuad;
5391
- exports.InOutQuart = InOutQuart;
5392
- exports.InOutQuint = InOutQuint;
5393
- exports.InOutSin = InOutSin;
5394
- exports.InQuad = InQuad;
5395
- exports.InQuart = InQuart;
5396
- exports.InQuint = InQuint;
5397
- exports.InSin = InSin;
5398
- exports.Linear = Linear;
5399
5404
  exports.Logic = Logic$1;
5400
5405
  exports.Matrix = Matrix;
5401
- exports.OutBack = OutBack;
5402
- exports.OutBounce = OutBounce;
5403
- exports.OutCirc = OutCirc;
5404
- exports.OutCubic = OutCubic;
5405
- exports.OutElastic = OutElastic;
5406
- exports.OutExpo = OutExpo;
5407
- exports.OutQuad = OutQuad;
5408
- exports.OutQuart = OutQuart;
5409
- exports.OutQuint = OutQuint;
5410
- exports.OutSin = OutSin;
5411
5406
  exports.PI = PI$2;
5412
5407
  exports.Permutation = Permutation;
5413
5408
  exports.Random = Random;
5414
5409
  exports.SPA = SPA;
5415
5410
  exports.SVGWrapper = SVGWrapper;
5416
5411
  exports.Scheduler = Scheduler;
5417
- exports.Step = Step;
5418
5412
  exports.Suspense = Suspense;
5419
5413
  exports.Switch = Switch;
5420
5414
  exports.Tick = Tick;
@@ -5455,12 +5449,14 @@ exports.acot = acot;
5455
5449
  exports.add = add;
5456
5450
  exports.animation = animation;
5457
5451
  exports.arange = arange;
5452
+ exports.arc = arc;
5458
5453
  exports.arr2str = arr2str;
5459
5454
  exports.asin = asin;
5460
5455
  exports.asinh = asinh;
5461
5456
  exports.atan = atan;
5462
5457
  exports.atan2 = atan2;
5463
5458
  exports.atanh = atanh;
5459
+ exports.back = back;
5464
5460
  exports.bindCustomEvent = bindCustomEvent;
5465
5461
  exports.bindHashEvent = bindHashEvent;
5466
5462
  exports.bindTouchEvent = bindTouchEvent;
@@ -5492,14 +5488,36 @@ exports.debounce = debounce;
5492
5488
  exports.defineParamsGetter = defineParamsGetter;
5493
5489
  exports.define_wc = define_wc;
5494
5490
  exports.deg2rad = deg2rad;
5491
+ exports.discret = discret;
5495
5492
  exports.div = div;
5496
5493
  exports.e = e;
5494
+ exports.elastic = elastic;
5497
5495
  exports.fact = fact;
5498
5496
  exports.floor = floor;
5499
5497
  exports.geomspace = geomspace;
5500
5498
  exports.getEvent = getEvent;
5501
5499
  exports.hypot = hypot;
5502
5500
  exports.inRange = inRange;
5501
+ exports.in_back = in_back;
5502
+ exports.in_bounce = in_bounce;
5503
+ exports.in_circ = in_circ;
5504
+ exports.in_cubic = in_cubic;
5505
+ exports.in_elastic = in_elastic;
5506
+ exports.in_expo = in_expo;
5507
+ exports.in_out_back = in_out_back;
5508
+ exports.in_out_bounce = in_out_bounce;
5509
+ exports.in_out_circ = in_out_circ;
5510
+ exports.in_out_cubic = in_out_cubic;
5511
+ exports.in_out_elastic = in_out_elastic;
5512
+ exports.in_out_expo = in_out_expo;
5513
+ exports.in_out_quad = in_out_quad;
5514
+ exports.in_out_quart = in_out_quart;
5515
+ exports.in_out_quint = in_out_quint;
5516
+ exports.in_out_sin = in_out_sin;
5517
+ exports.in_quad = in_quad;
5518
+ exports.in_quart = in_quart;
5519
+ exports.in_quint = in_quint;
5520
+ exports.in_sin = in_sin;
5503
5521
  exports.isApproximatlyEqual = isApproximatlyEqual;
5504
5522
  exports.isStateGetter = isStateGetter;
5505
5523
  exports.json2arr = json2arr;
@@ -5511,6 +5529,7 @@ exports.json2xmlFile = json2xmlFile;
5511
5529
  exports.json2yml = json2yml;
5512
5530
  exports.json2ymlFile = json2ymlFile;
5513
5531
  exports.lerp = lerp;
5532
+ exports.linear = linear;
5514
5533
  exports.linspace = linspace;
5515
5534
  exports.ln = ln;
5516
5535
  exports.logspace = logspace;
@@ -5529,6 +5548,16 @@ exports.norm = norm;
5529
5548
  exports.nums = nums;
5530
5549
  exports.obj2str = obj2str;
5531
5550
  exports.ones = ones;
5551
+ exports.out_back = out_back;
5552
+ exports.out_bounce = out_bounce;
5553
+ exports.out_circ = out_circ;
5554
+ exports.out_cubic = out_cubic;
5555
+ exports.out_elastic = out_elastic;
5556
+ exports.out_expo = out_expo;
5557
+ exports.out_quad = out_quad;
5558
+ exports.out_quart = out_quart;
5559
+ exports.out_quint = out_quint;
5560
+ exports.out_sin = out_sin;
5532
5561
  exports.pgcd = pgcd;
5533
5562
  exports.pow = pow$1;
5534
5563
  exports.powerSet = powerSet;
@@ -5546,6 +5575,7 @@ exports.sinh = sinh$1;
5546
5575
  exports.sleep = sleep;
5547
5576
  exports.sqrt = sqrt$2;
5548
5577
  exports.sqrtn = sqrtn;
5578
+ exports.step = step;
5549
5579
  exports.step_fps = step_fps;
5550
5580
  exports.sub = sub;
5551
5581
  exports.subSet = subSet;