ziko 0.0.22 → 0.0.23
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 +21 -8
- package/dist/ziko.js +21 -8
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +21 -9
- package/package.json +1 -1
- package/src/app/globals.js +2 -0
- package/src/index.js +2 -1
- package/src/ui/elements/primitives/ZikoUIElement.js +16 -7
- package/src/ui/elements/primitives/hydrate.js +0 -0
- package/starter/bin/index.js +0 -11
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 Jan 04 2025 21:24:21 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
|
|
@@ -4849,7 +4849,7 @@ const Reactivity={
|
|
|
4849
4849
|
};
|
|
4850
4850
|
|
|
4851
4851
|
class ZikoUIElement {
|
|
4852
|
-
constructor(element
|
|
4852
|
+
constructor(element, name="", {el_type="html", useDefaultStyle=false}={}){
|
|
4853
4853
|
this.target = globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body;
|
|
4854
4854
|
if(typeof element === "string") {
|
|
4855
4855
|
switch(el_type){
|
|
@@ -4858,8 +4858,10 @@ class ZikoUIElement {
|
|
|
4858
4858
|
default : throw Error("Not supported")
|
|
4859
4859
|
}
|
|
4860
4860
|
}
|
|
4861
|
+
else {
|
|
4862
|
+
this.target = element.parentElement;
|
|
4863
|
+
}
|
|
4861
4864
|
if(element)this.__ele__ = element;
|
|
4862
|
-
this.uuid=this.constructor.name+"-"+Random.string(10);
|
|
4863
4865
|
this.cache = {
|
|
4864
4866
|
name,
|
|
4865
4867
|
parent:null,
|
|
@@ -4890,23 +4892,30 @@ class ZikoUIElement {
|
|
|
4890
4892
|
resize:null,
|
|
4891
4893
|
intersection:null
|
|
4892
4894
|
};
|
|
4895
|
+
this.uuid = `${this.cache.name}-${Random.string(16)}`;
|
|
4893
4896
|
this.cache.style.linkTo(this);
|
|
4894
|
-
this.style({
|
|
4897
|
+
useDefaultStyle && this.style({
|
|
4895
4898
|
position: "relative",
|
|
4896
4899
|
boxSizing:"border-box",
|
|
4897
4900
|
margin:0,
|
|
4898
4901
|
padding:0,
|
|
4902
|
+
width : "auto",
|
|
4903
|
+
height : "auto"
|
|
4899
4904
|
});
|
|
4900
4905
|
this.items = [];
|
|
4901
|
-
this.size("auto", "auto");
|
|
4902
4906
|
globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
|
|
4903
4907
|
element && globalThis.__Ziko__.__Config__.default.render && this.render();
|
|
4908
|
+
this.setAttr("data-ref", this.uuid);
|
|
4909
|
+
globalThis.__Ziko__.__HYDRATION_MAP__.push({
|
|
4910
|
+
ref : this.uuid,
|
|
4911
|
+
comp : ()=>this
|
|
4912
|
+
});
|
|
4904
4913
|
}
|
|
4905
4914
|
get element(){
|
|
4906
|
-
return this.__ele__
|
|
4915
|
+
return this.__ele__;
|
|
4907
4916
|
}
|
|
4908
4917
|
get isZikoUIElement(){
|
|
4909
|
-
return true
|
|
4918
|
+
return true;
|
|
4910
4919
|
}
|
|
4911
4920
|
get st(){
|
|
4912
4921
|
return this.cache.style;
|
|
@@ -4915,7 +4924,7 @@ class ZikoUIElement {
|
|
|
4915
4924
|
return this.cache.attributes;
|
|
4916
4925
|
}
|
|
4917
4926
|
get evt(){
|
|
4918
|
-
return this.
|
|
4927
|
+
return this.events;
|
|
4919
4928
|
}
|
|
4920
4929
|
get html(){
|
|
4921
4930
|
return this.element.innerHTML;
|
|
@@ -11730,6 +11739,7 @@ function defineParamsGetter(target ){
|
|
|
11730
11739
|
}
|
|
11731
11740
|
|
|
11732
11741
|
const __UI__={};
|
|
11742
|
+
const __HYDRATION_MAP__ = [];
|
|
11733
11743
|
const __Config__={
|
|
11734
11744
|
default:{
|
|
11735
11745
|
target:null,
|
|
@@ -11749,6 +11759,7 @@ const __Config__={
|
|
|
11749
11759
|
var Global = /*#__PURE__*/Object.freeze({
|
|
11750
11760
|
__proto__: null,
|
|
11751
11761
|
__Config__: __Config__,
|
|
11762
|
+
__HYDRATION_MAP__: __HYDRATION_MAP__,
|
|
11752
11763
|
__UI__: __UI__
|
|
11753
11764
|
});
|
|
11754
11765
|
|
|
@@ -11848,6 +11859,7 @@ if ( globalThis.__Ziko__ ) {
|
|
|
11848
11859
|
globalThis.__Ziko__={
|
|
11849
11860
|
...Ziko,
|
|
11850
11861
|
__UI__,
|
|
11862
|
+
__HYDRATION_MAP__,
|
|
11851
11863
|
__Config__,
|
|
11852
11864
|
ExtractAll,
|
|
11853
11865
|
RemoveAll
|
|
@@ -12017,6 +12029,7 @@ exports.ZikoUIXMLWrapper = ZikoUIXMLWrapper;
|
|
|
12017
12029
|
exports.ZikoUseRoot = ZikoUseRoot;
|
|
12018
12030
|
exports.ZikoUseStyle = ZikoUseStyle;
|
|
12019
12031
|
exports.__Config__ = __Config__;
|
|
12032
|
+
exports.__HYDRATION_MAP__ = __HYDRATION_MAP__;
|
|
12020
12033
|
exports.__UI__ = __UI__;
|
|
12021
12034
|
exports.abbrText = abbrText;
|
|
12022
12035
|
exports.abs = abs;
|
package/dist/ziko.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*
|
|
3
3
|
Project: ziko.js
|
|
4
4
|
Author: Zakaria Elalaoui
|
|
5
|
-
Date :
|
|
5
|
+
Date : Sat Jan 04 2025 21:24:21 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
|
|
@@ -4851,7 +4851,7 @@
|
|
|
4851
4851
|
};
|
|
4852
4852
|
|
|
4853
4853
|
class ZikoUIElement {
|
|
4854
|
-
constructor(element
|
|
4854
|
+
constructor(element, name="", {el_type="html", useDefaultStyle=false}={}){
|
|
4855
4855
|
this.target = globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body;
|
|
4856
4856
|
if(typeof element === "string") {
|
|
4857
4857
|
switch(el_type){
|
|
@@ -4860,8 +4860,10 @@
|
|
|
4860
4860
|
default : throw Error("Not supported")
|
|
4861
4861
|
}
|
|
4862
4862
|
}
|
|
4863
|
+
else {
|
|
4864
|
+
this.target = element.parentElement;
|
|
4865
|
+
}
|
|
4863
4866
|
if(element)this.__ele__ = element;
|
|
4864
|
-
this.uuid=this.constructor.name+"-"+Random.string(10);
|
|
4865
4867
|
this.cache = {
|
|
4866
4868
|
name,
|
|
4867
4869
|
parent:null,
|
|
@@ -4892,23 +4894,30 @@
|
|
|
4892
4894
|
resize:null,
|
|
4893
4895
|
intersection:null
|
|
4894
4896
|
};
|
|
4897
|
+
this.uuid = `${this.cache.name}-${Random.string(16)}`;
|
|
4895
4898
|
this.cache.style.linkTo(this);
|
|
4896
|
-
this.style({
|
|
4899
|
+
useDefaultStyle && this.style({
|
|
4897
4900
|
position: "relative",
|
|
4898
4901
|
boxSizing:"border-box",
|
|
4899
4902
|
margin:0,
|
|
4900
4903
|
padding:0,
|
|
4904
|
+
width : "auto",
|
|
4905
|
+
height : "auto"
|
|
4901
4906
|
});
|
|
4902
4907
|
this.items = [];
|
|
4903
|
-
this.size("auto", "auto");
|
|
4904
4908
|
globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
|
|
4905
4909
|
element && globalThis.__Ziko__.__Config__.default.render && this.render();
|
|
4910
|
+
this.setAttr("data-ref", this.uuid);
|
|
4911
|
+
globalThis.__Ziko__.__HYDRATION_MAP__.push({
|
|
4912
|
+
ref : this.uuid,
|
|
4913
|
+
comp : ()=>this
|
|
4914
|
+
});
|
|
4906
4915
|
}
|
|
4907
4916
|
get element(){
|
|
4908
|
-
return this.__ele__
|
|
4917
|
+
return this.__ele__;
|
|
4909
4918
|
}
|
|
4910
4919
|
get isZikoUIElement(){
|
|
4911
|
-
return true
|
|
4920
|
+
return true;
|
|
4912
4921
|
}
|
|
4913
4922
|
get st(){
|
|
4914
4923
|
return this.cache.style;
|
|
@@ -4917,7 +4926,7 @@
|
|
|
4917
4926
|
return this.cache.attributes;
|
|
4918
4927
|
}
|
|
4919
4928
|
get evt(){
|
|
4920
|
-
return this.
|
|
4929
|
+
return this.events;
|
|
4921
4930
|
}
|
|
4922
4931
|
get html(){
|
|
4923
4932
|
return this.element.innerHTML;
|
|
@@ -11732,6 +11741,7 @@
|
|
|
11732
11741
|
}
|
|
11733
11742
|
|
|
11734
11743
|
const __UI__={};
|
|
11744
|
+
const __HYDRATION_MAP__ = [];
|
|
11735
11745
|
const __Config__={
|
|
11736
11746
|
default:{
|
|
11737
11747
|
target:null,
|
|
@@ -11751,6 +11761,7 @@
|
|
|
11751
11761
|
var Global = /*#__PURE__*/Object.freeze({
|
|
11752
11762
|
__proto__: null,
|
|
11753
11763
|
__Config__: __Config__,
|
|
11764
|
+
__HYDRATION_MAP__: __HYDRATION_MAP__,
|
|
11754
11765
|
__UI__: __UI__
|
|
11755
11766
|
});
|
|
11756
11767
|
|
|
@@ -11850,6 +11861,7 @@
|
|
|
11850
11861
|
globalThis.__Ziko__={
|
|
11851
11862
|
...Ziko,
|
|
11852
11863
|
__UI__,
|
|
11864
|
+
__HYDRATION_MAP__,
|
|
11853
11865
|
__Config__,
|
|
11854
11866
|
ExtractAll,
|
|
11855
11867
|
RemoveAll
|
|
@@ -12019,6 +12031,7 @@
|
|
|
12019
12031
|
exports.ZikoUseRoot = ZikoUseRoot;
|
|
12020
12032
|
exports.ZikoUseStyle = ZikoUseStyle;
|
|
12021
12033
|
exports.__Config__ = __Config__;
|
|
12034
|
+
exports.__HYDRATION_MAP__ = __HYDRATION_MAP__;
|
|
12022
12035
|
exports.__UI__ = __UI__;
|
|
12023
12036
|
exports.abbrText = abbrText;
|
|
12024
12037
|
exports.abs = abs;
|