ziko 0.0.23 → 0.0.24

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 (156) hide show
  1. package/dist/ziko.cjs +78 -2817
  2. package/dist/ziko.js +78 -2817
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +76 -2755
  5. package/package.json +1 -1
  6. package/src/app/globals.js +4 -2
  7. package/src/data/converter/index.js +2 -6
  8. package/src/graphics/canvas/index.js +176 -2
  9. package/src/graphics/canvas/utils/floodFill.js +0 -1
  10. package/src/graphics/svg/index.js +69 -2
  11. package/src/reactivity/hooks/index.js +1 -1
  12. package/src/ui/elements/{primitives/ZikoUIElement.js → ZikoUIElement.js} +8 -9
  13. package/src/ui/elements/derived ( To Be Moved)/index.js +12 -0
  14. package/src/ui/elements/{derived/flex → flex}/index.js +2 -2
  15. package/src/ui/elements/{derived/grid → grid}/index.js +2 -2
  16. package/src/ui/elements/{primitives/index.js → index.js} +3 -1
  17. package/src/ui/elements/{primitives/io → io}/Form/index.js +1 -1
  18. package/src/ui/elements/{primitives/io → io}/Inputs/__helpers__.js +1 -1
  19. package/src/ui/elements/{primitives/io → io}/Inputs/input/index.js +1 -1
  20. package/src/ui/elements/{primitives/list → list}/index.js +2 -3
  21. package/src/ui/elements/{primitives/misc → misc}/index.js +2 -3
  22. package/src/ui/elements/{primitives/semantic → semantic}/index.js +8 -8
  23. package/src/ui/elements/{primitives/table → table}/table.js +1 -1
  24. package/src/ui/elements/{primitives/text → text}/__ZikoUIText__.js +3 -4
  25. package/src/ui/index.js +21 -21
  26. package/src/ui/utils/index.js +1 -1
  27. package/src/data/parser/markdown.js +0 -0
  28. package/src/graphics/canvas/canvas.js +0 -176
  29. package/src/graphics/svg/svg.js +0 -69
  30. package/src/reactivity/hooks/Interactions/useSerial.js +0 -0
  31. package/src/types.js +0 -73
  32. package/src/ui/elements/derived/index.js +0 -12
  33. package/src/ui/elements/primitives/ZikoUIContainerElement.js +0 -123
  34. /package/src/{global → _global (To Be Replaced )}/_themes/dark.js +0 -0
  35. /package/src/{global → _global (To Be Replaced )}/_themes/index.js +0 -0
  36. /package/src/{global → _global (To Be Replaced )}/_themes/light.js +0 -0
  37. /package/src/{global → _global (To Be Replaced )}/app/index.js +0 -0
  38. /package/src/{global → _global (To Be Replaced )}/component/index.js +0 -0
  39. /package/src/{global → _global (To Be Replaced )}/globals/index.js +0 -0
  40. /package/src/{global → _global (To Be Replaced )}/index.js +0 -0
  41. /package/src/{global → _global (To Be Replaced )}/params/index.js +0 -0
  42. /package/src/{global → _global (To Be Replaced )}/router/index.js +0 -0
  43. /package/src/{global → _global (To Be Replaced )}/seo/index.js +0 -0
  44. /package/src/{global → _global (To Be Replaced )}/style/index.js +0 -0
  45. /package/src/data/converter/{adoc.js → __(To Be Moved)adoc.js} +0 -0
  46. /package/src/data/converter/{markdown.js → __(To Be Moved)markdown.js} +0 -0
  47. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/arc.js +0 -0
  48. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/image.js +0 -0
  49. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/line.js +0 -0
  50. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/path.js +0 -0
  51. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/points.js +0 -0
  52. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/polygon.js +0 -0
  53. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/polyline.js +0 -0
  54. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/rect.js +0 -0
  55. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/text.js +0 -0
  56. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Chart/histogram.js +0 -0
  57. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Chart/plot.js +0 -0
  58. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Chart/scatter.js +0 -0
  59. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Chart/stem.js +0 -0
  60. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Element.js +0 -0
  61. /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/index.js +0 -0
  62. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/circle.js +0 -0
  63. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/ellipse.js +0 -0
  64. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/foreign-object.js +0 -0
  65. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/groupe.js +0 -0
  66. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/image.js +0 -0
  67. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/index.js +0 -0
  68. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/line.js +0 -0
  69. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/link.js +0 -0
  70. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/path.js +0 -0
  71. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/polygon.js +0 -0
  72. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/polyline.js +0 -0
  73. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/rect.js +0 -0
  74. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/text.js +0 -0
  75. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Derived/grid.js +0 -0
  76. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Derived/index.js +0 -0
  77. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/index.js +0 -0
  78. /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/ziko-svg-element.js +0 -0
  79. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/index.js +0 -0
  80. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useBattery.js +0 -0
  81. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useCamera.js +0 -0
  82. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useGeolocation.js +0 -0
  83. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useMicro.js +0 -0
  84. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useOrientation.js +0 -0
  85. /package/src/ui/elements/{derived → derived ( To Be Moved)}/accordion/accordion.js +0 -0
  86. /package/src/ui/elements/{derived → derived ( To Be Moved)}/accordion/collapsible.js +0 -0
  87. /package/src/ui/elements/{derived → derived ( To Be Moved)}/accordion/index.js +0 -0
  88. /package/src/ui/elements/{derived → derived ( To Be Moved)}/alert/alert.js +0 -0
  89. /package/src/ui/elements/{derived → derived ( To Be Moved)}/alert/index.js +0 -0
  90. /package/src/ui/elements/{derived → derived ( To Be Moved)}/alert/palette.js +0 -0
  91. /package/src/ui/elements/{derived → derived ( To Be Moved)}/carousel/index.js +0 -0
  92. /package/src/ui/elements/{derived → derived ( To Be Moved)}/code-note/SubElements.js.txt +0 -0
  93. /package/src/ui/elements/{derived → derived ( To Be Moved)}/code-note/code-cell.js +0 -0
  94. /package/src/ui/elements/{derived → derived ( To Be Moved)}/code-note/code-note.js +0 -0
  95. /package/src/ui/elements/{derived → derived ( To Be Moved)}/code-note/index.js +0 -0
  96. /package/src/ui/elements/{derived → derived ( To Be Moved)}/code-note/sub-elements.js +0 -0
  97. /package/src/ui/elements/{derived → derived ( To Be Moved)}/menu/index.js +0 -0
  98. /package/src/ui/elements/{derived → derived ( To Be Moved)}/menu/menu3d.js +0 -0
  99. /package/src/ui/elements/{derived → derived ( To Be Moved)}/modal/index.js +0 -0
  100. /package/src/ui/elements/{derived → derived ( To Be Moved)}/pagination/breadcrumbs.js +0 -0
  101. /package/src/ui/elements/{derived → derived ( To Be Moved)}/pagination/index.js +0 -0
  102. /package/src/ui/elements/{derived → derived ( To Be Moved)}/slider/__ZikoUISlider__.js +0 -0
  103. /package/src/ui/elements/{derived → derived ( To Be Moved)}/slider/hSlider.js +0 -0
  104. /package/src/ui/elements/{derived → derived ( To Be Moved)}/slider/index.js +0 -0
  105. /package/src/ui/elements/{derived → derived ( To Be Moved)}/slider/vSlider.js +0 -0
  106. /package/src/ui/elements/{derived → derived ( To Be Moved)}/splitter/__ZikoUISplitter__.js +0 -0
  107. /package/src/ui/elements/{derived → derived ( To Be Moved)}/splitter/hsplitter.js +0 -0
  108. /package/src/ui/elements/{derived → derived ( To Be Moved)}/splitter/index.js +0 -0
  109. /package/src/ui/elements/{derived → derived ( To Be Moved)}/splitter/vsplitter.js +0 -0
  110. /package/src/ui/elements/{derived → derived ( To Be Moved)}/tabs/index.js +0 -0
  111. /package/src/ui/elements/{primitives/embaded → embaded}/html.js +0 -0
  112. /package/src/ui/elements/{primitives/embaded → embaded}/index.js +0 -0
  113. /package/src/ui/elements/{primitives/embaded → embaded}/pdf.js +0 -0
  114. /package/src/ui/elements/{primitives/embaded → embaded}/youtube.js +0 -0
  115. /package/src/ui/elements/{primitives/hydrate.js → hydrate.js} +0 -0
  116. /package/src/ui/elements/{primitives/io → io}/Form/index.js.txt +0 -0
  117. /package/src/ui/elements/{primitives/io → io}/Inputs/index.js +0 -0
  118. /package/src/ui/elements/{primitives/io → io}/Inputs/input-camera/index.js +0 -0
  119. /package/src/ui/elements/{primitives/io → io}/Inputs/input-checkbox/index.js +0 -0
  120. /package/src/ui/elements/{primitives/io → io}/Inputs/input-color/index.js +0 -0
  121. /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/index.js +0 -0
  122. /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-date-time.js +0 -0
  123. /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-date.js +0 -0
  124. /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-time.js +0 -0
  125. /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/index.js +0 -0
  126. /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/input-email.js +0 -0
  127. /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/input-password.js +0 -0
  128. /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/index.js +0 -0
  129. /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/input-file.js +0 -0
  130. /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/input-image.js +0 -0
  131. /package/src/ui/elements/{primitives/io → io}/Inputs/input-number/index.js +0 -0
  132. /package/src/ui/elements/{primitives/io → io}/Inputs/input-radio/index.js +0 -0
  133. /package/src/ui/elements/{primitives/io → io}/Inputs/input-search/index.js +0 -0
  134. /package/src/ui/elements/{primitives/io → io}/Inputs/input-slider/index.js +0 -0
  135. /package/src/ui/elements/{primitives/io → io}/Select/index.js +0 -0
  136. /package/src/ui/elements/{primitives/io → io}/Textarea/index.js +0 -0
  137. /package/src/ui/elements/{primitives/io → io}/index.js +0 -0
  138. /package/src/ui/elements/{primitives/list → list}/elements.js +0 -0
  139. /package/src/ui/elements/{primitives/media → media}/Audio/index.js +0 -0
  140. /package/src/ui/elements/{primitives/media → media}/Image/figure.js +0 -0
  141. /package/src/ui/elements/{primitives/media → media}/Image/image.js +0 -0
  142. /package/src/ui/elements/{primitives/media → media}/Image/index.js +0 -0
  143. /package/src/ui/elements/{primitives/media → media}/Video/index.js +0 -0
  144. /package/src/ui/elements/{primitives/media → media}/__ZikoUIDynamicMediaELement__.js +0 -0
  145. /package/src/ui/elements/{primitives/media → media}/index.js +0 -0
  146. /package/src/ui/elements/{primitives/misc → misc}/hyperscript.js +0 -0
  147. /package/src/ui/elements/{primitives/misc → misc}/suspense.js +0 -0
  148. /package/src/ui/elements/{primitives/misc → misc}/xml-wrapper.js +0 -0
  149. /package/src/ui/elements/{primitives/table → table}/elements.js +0 -0
  150. /package/src/ui/elements/{primitives/table → table}/index.js +0 -0
  151. /package/src/ui/elements/{primitives/table → table}/utils.js +0 -0
  152. /package/src/ui/elements/{primitives/text → text}/heading.js +0 -0
  153. /package/src/ui/elements/{primitives/text → text}/index.js +0 -0
  154. /package/src/ui/elements/{primitives/text → text}/p.js +0 -0
  155. /package/src/ui/elements/{primitives/text → text}/pre.js +0 -0
  156. /package/src/ui/elements/{primitives/text → text}/text.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "a versatile javaScript framework offering a rich set of UI components, advanced mathematical utilities, reactivity, animations, client side routing and graphics capabilities",
5
5
  "keywords": [
6
6
  "front-end",
@@ -1,5 +1,5 @@
1
1
  const __UI__={}
2
- const __HYDRATION_MAP__ = []
2
+ const __HYDRATION_MAP__ = new Map()
3
3
  const __Config__={
4
4
  default:{
5
5
  target:null,
@@ -13,7 +13,9 @@ const __Config__={
13
13
  const values=Object.values(pairs);
14
14
  for(let i=0;i<keys.length;i++)this.default[keys[i]]=values[i];
15
15
  },
16
- init:()=>document.documentElement.setAttribute("data-engine","zikojs")
16
+ init:()=>document.documentElement.setAttribute("data-engine","zikojs"),
17
+ renderingMode :"spa",
18
+ isSSC : false,
17
19
  }
18
20
  export {
19
21
  __UI__,
@@ -1,9 +1,5 @@
1
- export {
2
- markdown2html
3
- } from "./markdown.js";
4
- export {
5
- adoc2html
6
- } from "./adoc.js";
1
+ // export { markdown2html } from "./markdown.js";
2
+ // export { adoc2html } from "./adoc.js";
7
3
  export {
8
4
  csv2arr,
9
5
  csv2matrix,
@@ -1,2 +1,176 @@
1
- export * from "./canvas";
2
- export * from "./elements"
1
+ import { ZikoUIElement } from "../../ui/index.js";
2
+ import {Matrix} from "../../math/matrix/index.js"
3
+ // import { convolute } from "../../math/signal/conv.js";
4
+ class ZikoUICanvas extends ZikoUIElement{
5
+ constructor(w,h){
6
+ super("canvas","canvas");
7
+ this.ctx = this.element?.getContext("2d");
8
+ this.style({
9
+ border:"1px red solid",
10
+ })
11
+ this.transformMatrix=new Matrix([
12
+ [1,0,0],
13
+ [0,1,0],
14
+ [0,0,1]
15
+ ])
16
+ this.axisMatrix=new Matrix([
17
+ [-10,-10],
18
+ [10,10]
19
+ ])
20
+ // setTimeout(()=>this.resize(w,h),0);
21
+ requestAnimationFrame(()=>this.resize(w,h),0);
22
+ this.on("sizeupdated",()=>this.adjust())
23
+ }
24
+ get Xmin(){
25
+ return this.axisMatrix[0][0];
26
+ }
27
+ get Ymin(){
28
+ return this.axisMatrix[0][1];
29
+ }
30
+ get Xmax(){
31
+ return this.axisMatrix[1][0];
32
+ }
33
+ get Ymax(){
34
+ return this.axisMatrix[1][1];
35
+ }
36
+ get ImageData(){
37
+ return this.ctx.getImageData(0,0,c.Width,c.Height);
38
+ }
39
+ draw(all=true){
40
+ if(all){
41
+ this.clear();
42
+ this.items.forEach(element => {
43
+ element.parent=this;
44
+ element.draw(this.ctx)
45
+ });
46
+ }
47
+ else {
48
+ this.items.at(-1).parent=this;
49
+ this.items.at(-1).draw(this.ctx);
50
+ }
51
+ this.maintain();
52
+ return this;
53
+ }
54
+ applyTransformMatrix(){
55
+ this.ctx.setTransform(
56
+ this.transformMatrix[0][0],
57
+ this.transformMatrix[1][0],
58
+ this.transformMatrix[0][1],
59
+ this.transformMatrix[1][1],
60
+ this.transformMatrix[0][2],
61
+ this.transformMatrix[1][2],
62
+ );
63
+ return this;
64
+ }
65
+ resize(w,h){
66
+ this.size(w,h)
67
+ this.lineWidth();
68
+ this.view(this.axisMatrix[0][0], this.axisMatrix[0][1], this.axisMatrix[1][0], this.axisMatrix[1][1]);
69
+ this.emit("sizeupdated");
70
+ return this;
71
+ }
72
+ adjust(){
73
+ this.element.width =this.element?.getBoundingClientRect().width;
74
+ this.element.height =this.element?.getBoundingClientRect().height;
75
+ this.view(this.axisMatrix[0][0], this.axisMatrix[0][1], this.axisMatrix[1][0], this.axisMatrix[1][1]);
76
+ return this;
77
+ }
78
+ view(xMin,yMin,xMax,yMax){
79
+ this.transformMatrix[0][0]=this.width/(xMax-xMin); // scaleX
80
+ this.transformMatrix[1][1]=-this.height/(yMax-yMin); // scaleY
81
+ this.transformMatrix[0][2]=this.width/2;
82
+ this.transformMatrix[1][2]=this.height/2;
83
+ this.axisMatrix=new Matrix([
84
+ [xMin,yMin],
85
+ [xMax,yMax]
86
+ ])
87
+
88
+ this.applyTransformMatrix();
89
+ this.clear();
90
+ this.lineWidth(1);
91
+ this.draw();
92
+ return this;
93
+ }
94
+ reset(){
95
+ this.ctx.setTransform(1,0,0,0,0,0);
96
+ return this;
97
+ }
98
+ append(element){
99
+ this.items.push(element);
100
+ this.draw(false);
101
+ return this;
102
+ }
103
+ background(color){
104
+ this.ctx.fillStyle = color;
105
+ this.ctx.setTransform(1, 0, 0, 1, 0, 0);
106
+ this.ctx.fillRect(0, 0, this.width, this.height);
107
+ this.applyTransformMatrix();
108
+ this.draw();
109
+ }
110
+ lineWidth(w){
111
+ this.ctx.lineWidth=w/this.transformMatrix[0][0];
112
+ return this
113
+ }
114
+ getImageData(x=0,y=0,w=this.width,h=this.height){
115
+ return this.ctx.getImageData(x,y,w,h);
116
+ }
117
+ clear(){
118
+ this.ctx.setTransform(1, 0, 0, 1, 0, 0);
119
+ this.ctx.clearRect(0, 0, this.width, this.height);
120
+ this.applyTransformMatrix();
121
+ return this;
122
+ }
123
+ clone(){
124
+ console.log(this.width)
125
+ const canvas=new ZikoUICanvas();
126
+ canvas.items=this.items;
127
+ canvas.transformMatrix=this.transformMatrix;
128
+ canvas.axisMatrix=this.axisMatrix;
129
+ Object.assign(canvas.cache,{...this.cache});
130
+ //waitForUIElm(this)
131
+ //console.log(element)
132
+ this.size(this.element.style.width,this.element.style.width);
133
+ this.applyTransformMatrix();
134
+ this.draw();
135
+ this.adjust();
136
+ return canvas;
137
+ }
138
+ toImage() {
139
+ this.img = document?.createElement("img");
140
+ this.img.src = this.element?.toDataURL("image/png");
141
+ return this;
142
+ }
143
+ toBlob() {
144
+ var canvas = this.element;
145
+ canvas.toBlob(function (blob) {
146
+ var newImg = document?.createElement("img"),
147
+ url = URL.createObjectURL(blob);
148
+ newImg.onload = function () {
149
+ URL.revokeObjectURL(url);
150
+ };
151
+ newImg.src = url;
152
+ console.log(newImg);
153
+ });
154
+ }
155
+ zoomIn(){
156
+
157
+ }
158
+ zoomOut(){
159
+
160
+ }
161
+ undo(n){
162
+
163
+ }
164
+ redo(n){
165
+
166
+ }
167
+ stream(){
168
+
169
+ }
170
+ }
171
+
172
+ const Canvas=(w,h)=>new ZikoUICanvas(w,h);
173
+ export{
174
+ ZikoUICanvas,
175
+ Canvas
176
+ }
@@ -4,7 +4,6 @@ const floodFill=(parent, imageData, newColor, x, y)=>{
4
4
  const baseColor = parent.getColorAtPixel(imageData, x, y);
5
5
  let operator = { x, y };
6
6
 
7
- // Check if base color and new color are the same
8
7
  if (parent.colorMatch(baseColor, newColor)) {
9
8
  return;
10
9
  }
@@ -1,2 +1,69 @@
1
- export * from "./svg.js"
2
- export * from "./elements/index.js"
1
+ import { ZikoUIElement } from "../../ui/index.js";
2
+ class ZikoUISvg extends ZikoUIElement {
3
+ constructor(w=360,h=300) {
4
+ super("svg","svg");
5
+ //this.cache={};
6
+ // this.setAttr("width",w);
7
+ // this.setAttr("height",h);
8
+ // this.setAttr({
9
+ // width : w,
10
+ // height : h
11
+ // })
12
+ this.style({border:"1px black solid"});
13
+ //this.view(-w/2,-h/2,w/2,h/2);
14
+ this.size(w, h)
15
+ this.view(-10,-10,10,10);
16
+ }
17
+ size(w, h){
18
+ this.setAttr({
19
+ width : w,
20
+ height : h
21
+ });
22
+ return this
23
+ }
24
+ view(x1,y1,x2,y2){
25
+ let width=Math.abs(x2-x1);
26
+ let height=Math.abs(y2-y1);
27
+ this.setAttr("viewBox",[x1,y1,width,height].join(" "));
28
+ this.st.scaleY(-1);
29
+ return this;
30
+ }
31
+ add(...svgElement){
32
+ for(let i=0;i<svgElement.length;i++){
33
+ this.element.append(svgElement[i].element);
34
+ this.items.push(svgElement[i])
35
+ }
36
+ this.maintain()
37
+ return this;
38
+ }
39
+ remove(...svgElement){
40
+ for(let i=0;i<svgElement.length;i++){
41
+ this.element?.removeChild(svgElement[i].element);
42
+ this.items=this.items.filter(n=>!svgElement)
43
+ }
44
+ this.maintain();
45
+ return this;
46
+ }
47
+ mask(){
48
+
49
+ }
50
+ toString(){
51
+ return (new XMLSerializer()).serializeToString(this.element);
52
+ }
53
+ btoa(){
54
+ return btoa(this.toString())
55
+ }
56
+ toImg(){
57
+ return 'data:image/svg+xml;base64,'+this.btoa()
58
+ }
59
+ toImg2(){
60
+ return "data:image/svg+xml;charset=utf8,"+this.toString().replaceAll("<","%3C").replaceAll(">","%3E").replaceAll("#","%23").replaceAll('"',"'");
61
+ }
62
+
63
+ }
64
+
65
+ const Svg =(w,h)=>new ZikoUISvg(w,h);
66
+ export{
67
+ Svg,
68
+ ZikoUISvg,
69
+ }
@@ -2,7 +2,7 @@ export * from "./contexte"
2
2
  export * from "./decorators"
3
3
  export * from "./head"
4
4
  export * from "./interactions"
5
- export * from "./sensors"
5
+ // export * from "./sensors"
6
6
  export * from "./storage"
7
7
  export * from "./ui"
8
8
  // export * from "./window"
@@ -1,5 +1,5 @@
1
- import { ZikoUseStyle } from "../../../reactivity/hooks/UI/useStyle.js";
2
- import { ZikoUIElementStyle } from "../../style/index.js";
1
+ import { ZikoUseStyle } from "../../reactivity/hooks/UI/useStyle.js";
2
+ import { ZikoUIElementStyle } from "../style/index.js";
3
3
  import {
4
4
  usePointerEvent,
5
5
  useMouseEvent,
@@ -16,9 +16,9 @@ import {
16
16
  watchSize,
17
17
  watchAttr,
18
18
  watchChildren
19
- } from "../../../reactivity/index.js"
20
- import { Random } from "../../../math/index.js";
21
- import { Str } from "../../../data/index.js";
19
+ } from "../../reactivity/index.js"
20
+ import { Random } from "../../math/index.js";
21
+ import { Str } from "../../data/index.js";
22
22
  import { text } from "./text/text.js";
23
23
  class ZikoUIElement {
24
24
  constructor(element, name="", {el_type="html", useDefaultStyle=false}={}){
@@ -78,10 +78,9 @@ class ZikoUIElement {
78
78
  globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
79
79
  element && globalThis.__Ziko__.__Config__.default.render && this.render()
80
80
  this.setAttr("data-ref", this.uuid);
81
- globalThis.__Ziko__.__HYDRATION_MAP__.push({
82
- ref : this.uuid,
83
- comp : ()=>this
84
- })
81
+ if(globalThis.__Ziko__.__Config__.renderingMode !== "spa" && !globalThis.__Ziko__.__Config__.isSSC) {
82
+ globalThis.__Ziko__.__HYDRATION_MAP__.set(this.uuid, ()=>this)
83
+ }
85
84
  }
86
85
  get element(){
87
86
  return this.__ele__;
@@ -0,0 +1,12 @@
1
+ export * from "./flex";
2
+ export * from "./grid";
3
+ // export * from "./accordion";
4
+ // export * from "./carousel";
5
+ // export * from "./code-note";
6
+ // export * from "./tabs";
7
+ // export * from "./alert";
8
+ // export * from "./splitter";
9
+ // export * from "./pagination";
10
+ // export * from "./menu";
11
+ // export * from "./modal"
12
+ // export * from "./slider"
@@ -1,5 +1,5 @@
1
- import ZikoUIContainerElement from "../../primitives/ZikoUIContainerElement.js";
2
- class ZikoUIFlex extends ZikoUIContainerElement {
1
+ import ZikoUIElement from "../ZikoUIElement.js";
2
+ class ZikoUIFlex extends ZikoUIElement {
3
3
  constructor(tag = "div", w = "100%", h = "100%") {
4
4
  super(tag ,"Flex");
5
5
  this.direction = "cols";
@@ -1,5 +1,5 @@
1
- import ZikoUIContainerElement from "../../primitives/ZikoUIContainerElement"
2
- class ZikoUIGrid extends ZikoUIContainerElement {
1
+ import ZikoUIElement from "../ZikoUIElement"
2
+ class ZikoUIGrid extends ZikoUIElement {
3
3
  constructor(tag ="div", w = "50vw", h = "50vh") {
4
4
  super(tag,"Grid");
5
5
  this.direction = "cols";
@@ -5,4 +5,6 @@ export * from "./semantic/index.js";
5
5
  export * from "./embaded/index.js";
6
6
  export * from "./table/index.js";
7
7
  export * from "./media/index.js";
8
- export * from "./misc/index.js";
8
+ export * from "./misc/index.js";
9
+ export * from "./flex/index.js"
10
+ export * from "./grid/index.js"
@@ -1,4 +1,4 @@
1
- import { ZikoUIFlex } from "../../../derived/flex";
1
+ import { ZikoUIFlex } from "../../flex/index.js";
2
2
  class ZikoUIForm extends ZikoUIFlex{
3
3
  constructor(...items){
4
4
  super("form", "Form");
@@ -1,5 +1,5 @@
1
1
  import ZikoUIElement from "../../ZikoUIElement.js";
2
- import { Random } from "../../../../../math/index.js";
2
+ import { Random } from "../../../../math/index.js";
3
3
  class ZikoUILabel extends ZikoUIElement{
4
4
  constructor(){
5
5
  super();
@@ -1,5 +1,5 @@
1
1
  import ZikoUIElement from "../../../ZikoUIElement.js";
2
- import { useInputEvent } from "../../../../../../reactivity/index.js";
2
+ import { useInputEvent } from "../../../../../reactivity/index.js";
3
3
  class ZikoUIInput extends ZikoUIElement {
4
4
  constructor(type, name , value = "", datalist) {
5
5
  super("input", "input");
@@ -1,7 +1,6 @@
1
1
  import ZikoUIElement from "../ZikoUIElement.js";
2
- import ZikoUIContainerElement from "../ZikoUIContainerElement.js";
3
2
  import {text} from "../text/index.js";
4
- class ZikoUILI extends ZikoUIContainerElement{
3
+ class ZikoUILI extends ZikoUIElement{
5
4
  constructor(UI){
6
5
  super("li","li");
7
6
  this.append(UI);
@@ -10,7 +9,7 @@ class ZikoUILI extends ZikoUIContainerElement{
10
9
  return true;
11
10
  }
12
11
  }
13
- class ZikoUIList extends ZikoUIContainerElement {
12
+ class ZikoUIList extends ZikoUIElement {
14
13
  constructor(element,name) {
15
14
  super(element,name);
16
15
  delete this.append;
@@ -1,6 +1,5 @@
1
1
  import ZikoUIElement from "../ZikoUIElement.js";
2
- import ZikoUIContainerElement from "../ZikoUIContainerElement.js";
3
- class ZikoUIHtmlTag extends ZikoUIContainerElement {
2
+ class ZikoUIHtmlTag extends ZikoUIElement {
4
3
  constructor(element) {
5
4
  super(element,"html");
6
5
  }
@@ -53,7 +52,7 @@ class ZikoUIBr extends ZikoUIElement {
53
52
  return true
54
53
  }
55
54
  }
56
- class ZikoUILink extends ZikoUIContainerElement{
55
+ class ZikoUILink extends ZikoUIElement{
57
56
  constructor(href){
58
57
  super("a","link");
59
58
  Object.assign(this.cache,{
@@ -1,5 +1,5 @@
1
- import ZikoUIContainerElement from "../ZikoUIContainerElement.js";
2
- class ZikoUIMain extends ZikoUIContainerElement{
1
+ import ZikoUIElement from "../ZikoUIElement";
2
+ class ZikoUIMain extends ZikoUIElement{
3
3
  constructor(){
4
4
  super("main","Main");
5
5
  }
@@ -7,7 +7,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
7
7
  return true
8
8
  }
9
9
  }
10
- class ZikoUIHeader extends ZikoUIContainerElement{
10
+ class ZikoUIHeader extends ZikoUIElement{
11
11
  constructor(){
12
12
  super("header","Header");
13
13
  }
@@ -15,7 +15,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
15
15
  return true
16
16
  }
17
17
  }
18
- class ZikoUINav extends ZikoUIContainerElement{
18
+ class ZikoUINav extends ZikoUIElement{
19
19
  constructor(){
20
20
  super("nav","Nav");
21
21
  }
@@ -23,7 +23,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
23
23
  return true
24
24
  }
25
25
  }
26
- class ZikoUISection extends ZikoUIContainerElement{
26
+ class ZikoUISection extends ZikoUIElement{
27
27
  constructor(){
28
28
  super("section","Section");
29
29
  this.style({position:"relative"})
@@ -32,7 +32,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
32
32
  return true
33
33
  }
34
34
  }
35
- class ZikoUIArticle extends ZikoUIContainerElement{
35
+ class ZikoUIArticle extends ZikoUIElement{
36
36
  constructor(){
37
37
  super("article","Article");
38
38
  }
@@ -40,7 +40,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
40
40
  return true
41
41
  }
42
42
  }
43
- class ZikoUIAside extends ZikoUIContainerElement{
43
+ class ZikoUIAside extends ZikoUIElement{
44
44
  constructor(){
45
45
  super("aside","Aside");
46
46
  }
@@ -48,7 +48,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
48
48
  return true
49
49
  }
50
50
  }
51
- class ZikoUIFooter extends ZikoUIContainerElement{
51
+ class ZikoUIFooter extends ZikoUIElement{
52
52
  constructor(){
53
53
  super("footer","Footer");
54
54
  this.element=document?.createElement("footer");
@@ -1,6 +1,6 @@
1
1
  import ZikoUIElement from "../ZikoUIElement.js"
2
2
  import { tbody,caption,ZikoUICaption,thead} from "./elements.js";
3
- import { matrix } from "../../../../math/matrix/index.js";
3
+ import { matrix } from "../../../math/matrix/index.js";
4
4
  import { MatrixToTableUI } from "./utils.js";
5
5
  class ZikoUITable extends ZikoUIElement {
6
6
  constructor(body,{caption=null,head=null,foot=null}={}){
@@ -1,5 +1,4 @@
1
1
  import ZikoUIElement from "../ZikoUIElement.js";
2
- import ZikoContainerElement from "../ZikoUIContainerElement.js";
3
2
  import {
4
3
  ZikoUISubText,
5
4
  ZikoUISupText
@@ -7,12 +6,12 @@ import {
7
6
  import {
8
7
  Complex,
9
8
  Matrix
10
- } from "../../../../math/index.js";
9
+ } from "../../../math/index.js";
11
10
  import {
12
11
  arr2str,
13
12
  obj2str
14
- } from "../../../../data/index.js";
15
- class __ZikoUIText__ extends ZikoContainerElement {
13
+ } from "../../../data/index.js";
14
+ class __ZikoUIText__ extends ZikoUIElement {
16
15
  constructor(tag, name, lineBreak,...value) {
17
16
  super(tag, name);
18
17
  this.addValue(...value);
package/src/ui/index.js CHANGED
@@ -1,26 +1,26 @@
1
- export * from "./elements/primitives/text";
2
- export * from "./elements/primitives/list";
3
- export * from "./elements/primitives/io";
4
- export * from "./elements/primitives/media";
5
- export * from "./elements/primitives/table";
6
- export * from "./elements/primitives/semantic";
7
- export * from "./elements/primitives/misc";
8
- export * from "./elements/derived";
1
+ export * from "./elements/text";
2
+ export * from "./elements/list";
3
+ export * from "./elements/io";
4
+ export * from "./elements/media";
5
+ export * from "./elements/table";
6
+ export * from "./elements/semantic";
7
+ export * from "./elements/misc";
8
+ export * from "./elements/flex";
9
+ export * from "./elements/grid";
9
10
 
10
- import * as Text from "./elements/primitives/text";
11
- import * as List from "./elements/primitives/list";
12
- import * as Io from "./elements/primitives/io";
13
- import * as Media from "./elements/primitives/media";
14
- import * as Table from "./elements/primitives/table";
15
- import * as Semantic from "./elements/primitives/semantic";
16
- import * as Misc from "./elements/primitives/misc";
17
- import * as Derived from "./elements/derived";
11
+ import * as Text from "./elements/text";
12
+ import * as List from "./elements/list";
13
+ import * as Io from "./elements/io";
14
+ import * as Media from "./elements/media";
15
+ import * as Table from "./elements/table";
16
+ import * as Semantic from "./elements/semantic";
17
+ import * as Misc from "./elements/misc";
18
+ import * as Flex from "./elements/flex";
19
+ import * as Grid from "./elements/grid";
18
20
 
19
- import ZikoUIElement from "./elements/primitives/ZikoUIElement";
20
- import ZikoUIContainerElement from "./elements/primitives/ZikoUIContainerElement";
21
+ import ZikoUIElement from "./elements/ZikoUIElement";
21
22
 
22
23
  export{
23
- ZikoUIContainerElement,
24
24
  ZikoUIElement
25
25
  }
26
26
  const UI = {
@@ -31,8 +31,8 @@ const UI = {
31
31
  ...Table,
32
32
  ...Semantic,
33
33
  ...Misc,
34
- ...Derived,
34
+ ...Flex,
35
+ ...Grid,
35
36
  ZikoUIElement,
36
- ZikoUIContainerElement
37
37
  }
38
38
  export default UI;
@@ -1,4 +1,4 @@
1
- import ZikoUIElement from "../elements/primitives/ZikoUIElement.js";
1
+ import ZikoUIElement from "../elements/ZikoUIElement.js";
2
2
  const Id = (a) => document.getElementById(a);
3
3
  const Class = (a) => [...document.getElementsByClassName(a)];
4
4
  const $=(...selector)=>{
File without changes