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.cjs +187 -157
- package/dist/ziko.js +187 -157
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +152 -122
- package/package.json +8 -8
- package/src/__ziko__/__signature__.js +0 -0
- package/src/app/spa.js +7 -7
- package/src/app/ziko-app.js +1 -1
- package/src/data/converter/svg.js +1 -1
- package/src/math/complex/index.js +6 -17
- package/src/time/animation/index.js +2 -2
- package/src/time/ease/index.js +115 -74
- package/src/ui/__methods__/dom.js +5 -5
- package/src/ui/constructors/UIElement.js +3 -3
- package/src/ui/constructors/UIElementCore.js +3 -3
- package/src/ui/constructors/_m.js.txt +5 -5
- package/src/ui/flex/index.js +1 -1
- package/src/ui/grid/index.js +1 -1
- package/src/ui/logic/switch/index.js +1 -1
- package/src/ui/suspense/index.js +1 -1
- package/src/ui/web-component/index.js +4 -4
- package/types/index.d.ts +2 -0
- package/types/math/complex/index.d.ts +52 -0
- package/types/math/index.d.ts +2 -0
- package/types/math/utils/index.d.ts +1 -0
- package/types/math/utils/mapfun.d.ts +43 -0
- package/types/time/ease/index.d.ts +103 -0
- package/types/time/index.d.ts +1 -0
package/dist/ziko.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*
|
|
3
3
|
Project: ziko.js
|
|
4
4
|
Author: Zakaria Elalaoui
|
|
5
|
-
Date :
|
|
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
|
|
@@ -1340,7 +1340,7 @@ class UIElementCore extends UINode{
|
|
|
1340
1340
|
// // UI.append(...items);
|
|
1341
1341
|
// // }
|
|
1342
1342
|
// // else UI.element=this.element.cloneNode(true);
|
|
1343
|
-
// // return UI.
|
|
1343
|
+
// // return UI.mount(render);
|
|
1344
1344
|
// }
|
|
1345
1345
|
|
|
1346
1346
|
// freeze(freeze){
|
|
@@ -1350,9 +1350,9 @@ class UIElementCore extends UINode{
|
|
|
1350
1350
|
// setTarget(tg) {
|
|
1351
1351
|
// if(this.isBody) return ;
|
|
1352
1352
|
// if (tg?.isUIElement) tg = tg.element;
|
|
1353
|
-
// this.
|
|
1353
|
+
// this.unmount();
|
|
1354
1354
|
// this.target = tg;
|
|
1355
|
-
// this.
|
|
1355
|
+
// this.mount();
|
|
1356
1356
|
// return this;
|
|
1357
1357
|
// }
|
|
1358
1358
|
// describe(label){
|
|
@@ -1658,18 +1658,18 @@ function remove(...ele) {
|
|
|
1658
1658
|
return this;
|
|
1659
1659
|
}
|
|
1660
1660
|
function clear(){
|
|
1661
|
-
this?.items?.forEach(n=>n.
|
|
1661
|
+
this?.items?.forEach(n=>n.unmount());
|
|
1662
1662
|
this.element.innerHTML = "";
|
|
1663
1663
|
return this;
|
|
1664
1664
|
}
|
|
1665
|
-
function
|
|
1665
|
+
function mount(target = this.target) {
|
|
1666
1666
|
if(this.isBody)return ;
|
|
1667
1667
|
if(target?.isUIElement)target=target.element;
|
|
1668
1668
|
this.target=target;
|
|
1669
1669
|
this.target?.appendChild(this.element);
|
|
1670
1670
|
return this;
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1672
|
+
function unmount(){
|
|
1673
1673
|
if(this.cache.parent)this.cache.parent.remove(this);
|
|
1674
1674
|
else if(this.target?.children?.length && [...this.target?.children].includes(this.element)) this.target.removeChild(this.element);
|
|
1675
1675
|
return this;
|
|
@@ -1682,11 +1682,11 @@ function replaceElementWith(new_element){
|
|
|
1682
1682
|
return this
|
|
1683
1683
|
}
|
|
1684
1684
|
function renderAfter(t = 1) {
|
|
1685
|
-
setTimeout(() => this.
|
|
1685
|
+
setTimeout(() => this.mount(), t);
|
|
1686
1686
|
return this;
|
|
1687
1687
|
}
|
|
1688
1688
|
function unrenderAfter(t = 1) {
|
|
1689
|
-
setTimeout(() => this.
|
|
1689
|
+
setTimeout(() => this.unmount(), t);
|
|
1690
1690
|
return this;
|
|
1691
1691
|
}
|
|
1692
1692
|
function after(ui){
|
|
@@ -1707,12 +1707,12 @@ var DomMethods = /*#__PURE__*/Object.freeze({
|
|
|
1707
1707
|
before: before,
|
|
1708
1708
|
clear: clear,
|
|
1709
1709
|
insertAt: insertAt,
|
|
1710
|
+
mount: mount,
|
|
1710
1711
|
prepend: prepend,
|
|
1711
1712
|
remove: remove,
|
|
1712
|
-
render: render,
|
|
1713
1713
|
renderAfter: renderAfter,
|
|
1714
1714
|
replaceElementWith: replaceElementWith,
|
|
1715
|
-
|
|
1715
|
+
unmount: unmount,
|
|
1716
1716
|
unrenderAfter: unrenderAfter
|
|
1717
1717
|
});
|
|
1718
1718
|
|
|
@@ -2417,7 +2417,7 @@ let UIElement$1 = class UIElement extends UIElementCore{
|
|
|
2417
2417
|
// // UI.append(...items);
|
|
2418
2418
|
// // }
|
|
2419
2419
|
// // else UI.element=this.element.cloneNode(true);
|
|
2420
|
-
// // return UI.
|
|
2420
|
+
// // return UI.mount(render);
|
|
2421
2421
|
// }
|
|
2422
2422
|
// [Symbol.iterator]() {
|
|
2423
2423
|
// return this.items[Symbol.iterator]();
|
|
@@ -2439,9 +2439,9 @@ let UIElement$1 = class UIElement extends UIElementCore{
|
|
|
2439
2439
|
// setTarget(tg) {
|
|
2440
2440
|
// if(this.isBody) return ;
|
|
2441
2441
|
// if (tg?.isUIElement) tg = tg.element;
|
|
2442
|
-
// this.
|
|
2442
|
+
// this.unmount();
|
|
2443
2443
|
// this.target = tg;
|
|
2444
|
-
// this.
|
|
2444
|
+
// this.mount();
|
|
2445
2445
|
// return this;
|
|
2446
2446
|
// }
|
|
2447
2447
|
// describe(label){
|
|
@@ -2704,7 +2704,7 @@ class ZikoUIFlex extends UIElement$1 {
|
|
|
2704
2704
|
if (typeof h == "number") h += "%";
|
|
2705
2705
|
this.style({ width: w, height: h });
|
|
2706
2706
|
this.style({ display: "flex" });
|
|
2707
|
-
// this.
|
|
2707
|
+
// this.mount();
|
|
2708
2708
|
}
|
|
2709
2709
|
get isFlex(){
|
|
2710
2710
|
return true;
|
|
@@ -2812,7 +2812,7 @@ class ZikoUISuspense extends UIElement{
|
|
|
2812
2812
|
(async ()=>{
|
|
2813
2813
|
try{
|
|
2814
2814
|
const ui = await callback();
|
|
2815
|
-
fallback_ui.
|
|
2815
|
+
fallback_ui.unmount();
|
|
2816
2816
|
this.append(ui);
|
|
2817
2817
|
// console.log(content)
|
|
2818
2818
|
}
|
|
@@ -2914,19 +2914,19 @@ function define_wc(name, UIElement, props = {}, { mode = 'open'} = {}) {
|
|
|
2914
2914
|
}
|
|
2915
2915
|
|
|
2916
2916
|
connectedCallback() {
|
|
2917
|
-
this.
|
|
2917
|
+
this.mount();
|
|
2918
2918
|
}
|
|
2919
2919
|
|
|
2920
|
-
|
|
2920
|
+
mount() {
|
|
2921
2921
|
this.shadowRoot.innerHTML = '';
|
|
2922
|
-
this.UIElement = UIElement(this.props).
|
|
2922
|
+
this.UIElement = UIElement(this.props).mount(this.shadowRoot);
|
|
2923
2923
|
}
|
|
2924
2924
|
|
|
2925
2925
|
attributeChangedCallback(name, _, newValue) {
|
|
2926
2926
|
Object.assign(this.props, {
|
|
2927
2927
|
[name]: this.mask[name].type(newValue)
|
|
2928
2928
|
});
|
|
2929
|
-
this.
|
|
2929
|
+
this.mount();
|
|
2930
2930
|
}
|
|
2931
2931
|
}
|
|
2932
2932
|
);
|
|
@@ -2940,7 +2940,7 @@ class UISwitch extends UIElement$1{
|
|
|
2940
2940
|
this.init();
|
|
2941
2941
|
}
|
|
2942
2942
|
init(){
|
|
2943
|
-
Object.values(this.cases).filter(n=>n != this.current).forEach(n=>n.
|
|
2943
|
+
Object.values(this.cases).filter(n=>n != this.current).forEach(n=>n.unmount());
|
|
2944
2944
|
super.init(this.current.element);
|
|
2945
2945
|
}
|
|
2946
2946
|
get current(){
|
|
@@ -2967,7 +2967,7 @@ const Switch=({key, cases})=> new UISwitch(key, cases);
|
|
|
2967
2967
|
const svg2str=svg=>(new XMLSerializer()).serializeToString(svg);
|
|
2968
2968
|
const svg2ascii=svg=>btoa(svg2str(svg));
|
|
2969
2969
|
const svg2imgUrl=svg=>'data:image/svg+xml;base64,'+svg2ascii(svg);
|
|
2970
|
-
const svg2img=(svg,render=true)=>tags.img(svg2imgUrl(svg)).
|
|
2970
|
+
const svg2img=(svg,render=true)=>tags.img(svg2imgUrl(svg)).mount(render);
|
|
2971
2971
|
|
|
2972
2972
|
// const obj2str=(object)=>{
|
|
2973
2973
|
// const recursiveToString = (obj) => {
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
const
|
|
4089
|
-
|
|
4090
|
-
const
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
const
|
|
4095
|
-
const
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
const
|
|
4100
|
-
const
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
const
|
|
4107
|
-
const
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
const
|
|
4112
|
-
const
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
const
|
|
4119
|
-
const
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
const
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
const
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
const
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
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
|
|
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
|
-
|
|
4159
|
-
const
|
|
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 =
|
|
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,
|
|
@@ -4827,7 +4857,7 @@ class ZikoApp {
|
|
|
4827
4857
|
this.head && this.setHead(this.head);
|
|
4828
4858
|
this.wrapper && this.setWrapper(this.wrapper);
|
|
4829
4859
|
this.target && this.setTarget(this.target);
|
|
4830
|
-
if(this.wrapper && this.target)this.wrapper.
|
|
4860
|
+
if(this.wrapper && this.target)this.wrapper.mount(this.target);
|
|
4831
4861
|
}
|
|
4832
4862
|
setTarget(target){
|
|
4833
4863
|
if(target instanceof HTMLElement) this.target = target;
|
|
@@ -4903,16 +4933,16 @@ class ZikoSPA extends ZikoApp{
|
|
|
4903
4933
|
...Object.entries(routes)
|
|
4904
4934
|
]);
|
|
4905
4935
|
this.clear();
|
|
4906
|
-
globalThis.onpopstate = this.
|
|
4936
|
+
globalThis.onpopstate = this.mount(location.pathname);
|
|
4907
4937
|
}
|
|
4908
4938
|
clear(){
|
|
4909
4939
|
[...this.routes].forEach(n=>{
|
|
4910
|
-
!isDynamic(n[0]) && n[1]?.isUIElement && n[1].
|
|
4940
|
+
!isDynamic(n[0]) && n[1]?.isUIElement && n[1].unmount();
|
|
4911
4941
|
});
|
|
4912
4942
|
// this.wrapper.clear();
|
|
4913
4943
|
return this;
|
|
4914
4944
|
}
|
|
4915
|
-
|
|
4945
|
+
mount(path){
|
|
4916
4946
|
const [mask, callback] = [...this.routes].find(route=>routesMatcher(route[0],path));
|
|
4917
4947
|
let element ;
|
|
4918
4948
|
if(isDynamic(mask)){
|
|
@@ -4920,13 +4950,13 @@ class ZikoSPA extends ZikoApp{
|
|
|
4920
4950
|
element = callback.call(this,params);
|
|
4921
4951
|
}
|
|
4922
4952
|
else {
|
|
4923
|
-
callback?.isUIElement && callback.
|
|
4953
|
+
callback?.isUIElement && callback.mount(this.wrapper);
|
|
4924
4954
|
if(typeof callback === "function") element = callback();
|
|
4925
4955
|
}
|
|
4926
|
-
if(element?.isUIElement) element.
|
|
4927
|
-
// if(element?.isZikoApp) element.
|
|
4956
|
+
if(element?.isUIElement) element.mount(this.wrapper);
|
|
4957
|
+
// if(element?.isZikoApp) element.mount(this.wrapper);
|
|
4928
4958
|
if(element instanceof Promise){
|
|
4929
|
-
element.then(e=>e.
|
|
4959
|
+
element.then(e=>e.mount(this.wrapper));
|
|
4930
4960
|
}
|
|
4931
4961
|
globalThis.history.pushState({}, "", path);
|
|
4932
4962
|
return this;
|
|
@@ -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;
|