ziko 0.0.12 → 0.0.14

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 (281) hide show
  1. package/dist/ziko.cjs +3069 -2463
  2. package/dist/ziko.js +2993 -2329
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +2984 -2328
  5. package/package.json +39 -12
  6. package/src/__helpers__/index.js +41 -0
  7. package/src/app/accessibility/index.js +0 -0
  8. package/src/app/app.js +46 -0
  9. package/src/app/component/index.js +38 -0
  10. package/src/app/globals/index.js +20 -0
  11. package/src/app/index.js +12 -0
  12. package/src/app/params/index.js +40 -0
  13. package/src/app/router/index.js +67 -0
  14. package/src/app/seo/index.js +43 -0
  15. package/src/app/themes/dark.js +885 -0
  16. package/src/app/themes/index.js +11 -0
  17. package/src/app/themes/light.js +255 -0
  18. package/src/data/api/fetchdom.js +14 -0
  19. package/src/data/api/index.js +4 -0
  20. package/src/data/api/preload.js +11 -0
  21. package/src/data/converter/adoc.js +130 -0
  22. package/src/data/converter/array.js +43 -0
  23. package/src/data/converter/canvas.js +25 -0
  24. package/src/data/converter/csv.js +33 -0
  25. package/src/data/converter/idea.txt +10 -0
  26. package/src/data/converter/index.js +34 -0
  27. package/src/data/converter/json.js +80 -0
  28. package/src/data/converter/markdown.js +95 -0
  29. package/src/data/converter/object.js +70 -0
  30. package/src/data/converter/svg.js +11 -0
  31. package/src/data/decorators.js +0 -0
  32. package/src/data/index.js +74 -0
  33. package/src/data/parser/markdown.js +0 -0
  34. package/src/data/parser/xml.js +47 -0
  35. package/src/data/string/index.js +1 -0
  36. package/src/data/string/patterns.js +12 -0
  37. package/src/data/string/string.js +170 -0
  38. package/src/graphics/canvas/_canvas_offscreen +0 -0
  39. package/src/graphics/canvas/canvas.js +189 -0
  40. package/src/graphics/canvas/elements/Basic/arc.js +43 -0
  41. package/src/graphics/canvas/elements/Basic/image.js +0 -0
  42. package/src/graphics/canvas/elements/Basic/line.js +26 -0
  43. package/src/graphics/canvas/elements/Basic/path.js +0 -0
  44. package/src/graphics/canvas/elements/Basic/points.js +48 -0
  45. package/src/graphics/canvas/elements/Basic/polygon.js +7 -0
  46. package/src/graphics/canvas/elements/Basic/polyline.js +0 -0
  47. package/src/graphics/canvas/elements/Basic/rect.js +46 -0
  48. package/src/graphics/canvas/elements/Basic/text.js +0 -0
  49. package/src/graphics/canvas/elements/Chart/histogram.js +0 -0
  50. package/src/graphics/canvas/elements/Chart/plot.js +0 -0
  51. package/src/graphics/canvas/elements/Chart/scatter.js +2 -0
  52. package/src/graphics/canvas/elements/Chart/stem.js +0 -0
  53. package/src/graphics/canvas/elements/Element.js +115 -0
  54. package/src/graphics/canvas/elements/Groupe.js +0 -0
  55. package/src/graphics/canvas/elements/grid.js +0 -0
  56. package/src/graphics/canvas/elements/index.js +13 -0
  57. package/src/graphics/canvas/filter/index.js +0 -0
  58. package/src/graphics/canvas/index.js +15 -0
  59. package/src/graphics/canvas/paint/index.js +0 -0
  60. package/src/graphics/canvas/utils/color.js +8 -0
  61. package/src/graphics/canvas/utils/floodFill.js +58 -0
  62. package/src/graphics/index.js +69 -0
  63. package/src/graphics/svg/Elements/Basic/circle.js +26 -0
  64. package/src/graphics/svg/Elements/Basic/ellipse.js +21 -0
  65. package/src/graphics/svg/Elements/Basic/foreignObject.js +33 -0
  66. package/src/graphics/svg/Elements/Basic/groupe.js +29 -0
  67. package/src/graphics/svg/Elements/Basic/image.js +33 -0
  68. package/src/graphics/svg/Elements/Basic/line.js +29 -0
  69. package/src/graphics/svg/Elements/Basic/link.js +30 -0
  70. package/src/graphics/svg/Elements/Basic/path.js +59 -0
  71. package/src/graphics/svg/Elements/Basic/polygon.js +32 -0
  72. package/src/graphics/svg/Elements/Basic/polyline.js +4 -0
  73. package/src/graphics/svg/Elements/Basic/rect.js +43 -0
  74. package/src/graphics/svg/Elements/Basic/text.js +26 -0
  75. package/src/graphics/svg/Elements/Derived/grid.js +9 -0
  76. package/src/graphics/svg/Elements/ZikoSvgElement.js +46 -0
  77. package/src/graphics/svg/Elements/index.js +14 -0
  78. package/src/graphics/svg/index.js +2 -0
  79. package/src/graphics/svg/svg.js +115 -0
  80. package/src/index.js +88 -0
  81. package/src/math/absract.js +1 -0
  82. package/src/math/calculus/index.js +1 -0
  83. package/src/math/calculus/special-functions/bessel.js +31 -0
  84. package/src/math/calculus/special-functions/beta.js +38 -0
  85. package/src/math/calculus/special-functions/gamma.js +30 -0
  86. package/src/math/calculus/special-functions/index.js +4 -0
  87. package/src/math/complex/Fractals/julia.js +0 -0
  88. package/src/math/complex/index.js +203 -0
  89. package/src/math/const.js +3 -0
  90. package/src/math/discret/Combinaison/index.js +34 -0
  91. package/src/math/discret/Conversion/index.js +86 -0
  92. package/src/math/discret/Logic/index.js +46 -0
  93. package/src/math/discret/Permutation/index.js +31 -0
  94. package/src/math/discret/Set/index.js +2 -0
  95. package/src/math/discret/Set/power-set.js +15 -0
  96. package/src/math/discret/Set/sub-set.js +10 -0
  97. package/src/math/discret/index.js +23 -0
  98. package/src/math/functions/index.js +182 -0
  99. package/src/math/index.js +189 -0
  100. package/src/math/matrix/Decomposition.js +90 -0
  101. package/src/math/matrix/LinearSystem.js +10 -0
  102. package/src/math/matrix/Matrix.js +717 -0
  103. package/src/math/matrix/index.js +3 -0
  104. package/src/math/numeric/index.js +0 -0
  105. package/src/math/random/index.js +173 -0
  106. package/src/math/signal/__np.py.txt +40 -0
  107. package/src/math/signal/conv.js +175 -0
  108. package/src/math/signal/fft.js +55 -0
  109. package/src/math/signal/filter.js +39 -0
  110. package/src/math/signal/functions.js +146 -0
  111. package/src/math/signal/index.js +110 -0
  112. package/src/math/statistics/Functions/index.js +100 -0
  113. package/src/math/statistics/index.js +16 -0
  114. package/src/math/utils/arithmetic.js +139 -0
  115. package/src/math/utils/checkers.js +29 -0
  116. package/src/math/utils/comparaison.js +1 -0
  117. package/src/math/utils/conversions.js +19 -0
  118. package/src/math/utils/discret.js +51 -0
  119. package/src/math/utils/index.js +102 -0
  120. package/src/math/utils/mapfun.js +50 -0
  121. package/src/reactivity/events/Global/Click.js +56 -0
  122. package/src/reactivity/events/Global/Clipboard.js +84 -0
  123. package/src/reactivity/events/Global/CustomEvent.js +53 -0
  124. package/src/reactivity/events/Global/Drag.js +137 -0
  125. package/src/reactivity/events/Global/Focus.js +56 -0
  126. package/src/reactivity/events/Global/Key.js +104 -0
  127. package/src/reactivity/events/Global/Mouse.js +230 -0
  128. package/src/reactivity/events/Global/Pointer.js +234 -0
  129. package/src/reactivity/events/Global/Swipe.js +147 -0
  130. package/src/reactivity/events/Global/Touch.js +0 -0
  131. package/src/reactivity/events/Global/Wheel.js +44 -0
  132. package/src/reactivity/events/Partiel/Hash.js +44 -0
  133. package/src/reactivity/events/Partiel/Input.js +59 -0
  134. package/src/reactivity/events/Partiel/Media.js +1 -0
  135. package/src/reactivity/events/ZikoEvent.js +91 -0
  136. package/src/reactivity/events/index.js +63 -0
  137. package/src/reactivity/hooks/Contexte/index.js +1 -0
  138. package/src/reactivity/hooks/Contexte/useSuccesifKeys.js +14 -0
  139. package/src/reactivity/hooks/Decorators/index.js +6 -0
  140. package/src/reactivity/hooks/Decorators/time.js +17 -0
  141. package/src/reactivity/hooks/Decorators/type.js +88 -0
  142. package/src/reactivity/hooks/Interactions/index.js +4 -0
  143. package/src/reactivity/hooks/Interactions/useBluetooth.js +48 -0
  144. package/src/reactivity/hooks/Interactions/useChannel.js +50 -0
  145. package/src/reactivity/hooks/Interactions/useEventEmmiter.js +64 -0
  146. package/src/reactivity/hooks/Interactions/useSerial.js +0 -0
  147. package/src/reactivity/hooks/Interactions/useThread.js +44 -0
  148. package/src/reactivity/hooks/Interactions/useUsb.js +0 -0
  149. package/src/reactivity/hooks/Sensors/index.js +2 -0
  150. package/src/reactivity/hooks/Sensors/useBattery.js +36 -0
  151. package/src/reactivity/hooks/Sensors/useCamera.js +0 -0
  152. package/src/reactivity/hooks/Sensors/useGeolocation.js +17 -0
  153. package/src/reactivity/hooks/Sensors/useMicro.js +0 -0
  154. package/src/reactivity/hooks/Sensors/useOrientation.js +0 -0
  155. package/src/reactivity/hooks/Storage/index.js +1 -0
  156. package/src/reactivity/hooks/Storage/useCookie.js +0 -0
  157. package/src/reactivity/hooks/Storage/useIndexedDb.js +0 -0
  158. package/src/reactivity/hooks/Storage/useStorage.js +73 -0
  159. package/src/reactivity/hooks/UI/index.js +5 -0
  160. package/src/reactivity/hooks/UI/useCssLink.js +0 -0
  161. package/src/reactivity/hooks/UI/useCssText.js +21 -0
  162. package/src/reactivity/hooks/UI/useFavIcon.js +38 -0
  163. package/src/reactivity/hooks/UI/useLinearGradient.js +0 -0
  164. package/src/reactivity/hooks/UI/useMediaQuery.js +43 -0
  165. package/src/reactivity/hooks/UI/useRadialGradient.js +0 -0
  166. package/src/reactivity/hooks/UI/useStyle.js +79 -0
  167. package/src/reactivity/hooks/UI/useTheme.js +62 -0
  168. package/src/reactivity/hooks/UI/useTitle.js +30 -0
  169. package/src/reactivity/hooks/index.js +85 -0
  170. package/src/reactivity/hooks/todo.md +26 -0
  171. package/src/reactivity/idea +2 -0
  172. package/src/reactivity/index.js +22 -0
  173. package/src/reactivity/observer/attributes.js +28 -0
  174. package/src/reactivity/observer/children.js +37 -0
  175. package/src/reactivity/observer/index.js +44 -0
  176. package/src/reactivity/observer/intersection.js +44 -0
  177. package/src/reactivity/observer/mutation.js +113 -0
  178. package/src/reactivity/observer/resize.js +47 -0
  179. package/src/reactivity/observer/screen.js +45 -0
  180. package/src/reactivity/observer/screen.js.txt +84 -0
  181. package/src/reactivity/observer/screen.txt +13 -0
  182. package/src/time/animation.js +76 -0
  183. package/src/time/index.js +54 -0
  184. package/src/time/loop.js +87 -0
  185. package/src/time/utils/decorators.js +17 -0
  186. package/src/time/utils/ease.js +144 -0
  187. package/src/time/utils/index.js +18 -0
  188. package/src/time/utils/performance.js +16 -0
  189. package/src/time/utils/ui.js +26 -0
  190. package/src/types.js +71 -0
  191. package/src/user-interface/elements/derived/Flex.js +103 -0
  192. package/src/user-interface/elements/derived/Grid.js +33 -0
  193. package/src/user-interface/elements/derived/elements/Notification.js +0 -0
  194. package/src/user-interface/elements/derived/elements/Popover.js +0 -0
  195. package/src/user-interface/elements/derived/elements/Popup.js +0 -0
  196. package/src/user-interface/elements/derived/elements/Swipper.js +4 -0
  197. package/src/user-interface/elements/derived/elements/Timeline.js +0 -0
  198. package/src/user-interface/elements/derived/elements/Toast.js +0 -0
  199. package/src/user-interface/elements/derived/elements/Treeview.js +0 -0
  200. package/src/user-interface/elements/derived/elements/accordion/accordion.js +45 -0
  201. package/src/user-interface/elements/derived/elements/accordion/collapsible.js +82 -0
  202. package/src/user-interface/elements/derived/elements/accordion/index.js +2 -0
  203. package/src/user-interface/elements/derived/elements/alert/alert.js +80 -0
  204. package/src/user-interface/elements/derived/elements/alert/index.js +1 -0
  205. package/src/user-interface/elements/derived/elements/alert/palette.js +52 -0
  206. package/src/user-interface/elements/derived/elements/carousel/index.js +51 -0
  207. package/src/user-interface/elements/derived/elements/code-note/SubElements.js.txt +105 -0
  208. package/src/user-interface/elements/derived/elements/code-note/code-cell.js +195 -0
  209. package/src/user-interface/elements/derived/elements/code-note/code-note.js +72 -0
  210. package/src/user-interface/elements/derived/elements/code-note/index.js +2 -0
  211. package/src/user-interface/elements/derived/elements/code-note/sub-elements.js +67 -0
  212. package/src/user-interface/elements/derived/elements/columns.js +1 -0
  213. package/src/user-interface/elements/derived/elements/fab.js +0 -0
  214. package/src/user-interface/elements/derived/elements/index.js +9 -0
  215. package/src/user-interface/elements/derived/elements/menu/index.js +1 -0
  216. package/src/user-interface/elements/derived/elements/menu/menu3d.js +260 -0
  217. package/src/user-interface/elements/derived/elements/modal/index.js +92 -0
  218. package/src/user-interface/elements/derived/elements/pagination/breadcrumbs.js +54 -0
  219. package/src/user-interface/elements/derived/elements/pagination/index.js +1 -0
  220. package/src/user-interface/elements/derived/elements/splitter/__ZikoUISplitter__.js +62 -0
  221. package/src/user-interface/elements/derived/elements/splitter/hsplitter.js +40 -0
  222. package/src/user-interface/elements/derived/elements/splitter/index.js +2 -0
  223. package/src/user-interface/elements/derived/elements/splitter/vsplitter.js +40 -0
  224. package/src/user-interface/elements/derived/elements/tabs/index.js +180 -0
  225. package/src/user-interface/elements/derived/index.js +3 -0
  226. package/src/user-interface/elements/primitives/ZikoUIContainerElement.js +127 -0
  227. package/src/user-interface/elements/primitives/ZikoUIElement.js +480 -0
  228. package/src/user-interface/elements/primitives/embaded/html.js +21 -0
  229. package/src/user-interface/elements/primitives/embaded/index.js +3 -0
  230. package/src/user-interface/elements/primitives/embaded/pdf.js +18 -0
  231. package/src/user-interface/elements/primitives/embaded/youtube.js +26 -0
  232. package/src/user-interface/elements/primitives/index.js +8 -0
  233. package/src/user-interface/elements/primitives/io/Form/index.js +42 -0
  234. package/src/user-interface/elements/primitives/io/Form/index.js.txt +104 -0
  235. package/src/user-interface/elements/primitives/io/Inputs/__helpers__.js +52 -0
  236. package/src/user-interface/elements/primitives/io/Inputs/index.js +12 -0
  237. package/src/user-interface/elements/primitives/io/Inputs/input/index.js +99 -0
  238. package/src/user-interface/elements/primitives/io/Inputs/input-camera/index.js +26 -0
  239. package/src/user-interface/elements/primitives/io/Inputs/input-checkbox/index.js +26 -0
  240. package/src/user-interface/elements/primitives/io/Inputs/input-color/index.js +16 -0
  241. package/src/user-interface/elements/primitives/io/Inputs/input-date-time/index.js +3 -0
  242. package/src/user-interface/elements/primitives/io/Inputs/input-date-time/input-date-time.js +14 -0
  243. package/src/user-interface/elements/primitives/io/Inputs/input-date-time/input-date.js +14 -0
  244. package/src/user-interface/elements/primitives/io/Inputs/input-date-time/input-time.js +14 -0
  245. package/src/user-interface/elements/primitives/io/Inputs/input-email-password/index.js +2 -0
  246. package/src/user-interface/elements/primitives/io/Inputs/input-email-password/input-email.js +15 -0
  247. package/src/user-interface/elements/primitives/io/Inputs/input-email-password/input-password.js +14 -0
  248. package/src/user-interface/elements/primitives/io/Inputs/input-file/index.js +1 -0
  249. package/src/user-interface/elements/primitives/io/Inputs/input-file/input-file.js +0 -0
  250. package/src/user-interface/elements/primitives/io/Inputs/input-file/input-image.js +43 -0
  251. package/src/user-interface/elements/primitives/io/Inputs/input-number/index.js +37 -0
  252. package/src/user-interface/elements/primitives/io/Inputs/input-radio/index.js +26 -0
  253. package/src/user-interface/elements/primitives/io/Inputs/input-search/index.js +45 -0
  254. package/src/user-interface/elements/primitives/io/Inputs/input-slider/index.js +34 -0
  255. package/src/user-interface/elements/primitives/io/Select/index.js +20 -0
  256. package/src/user-interface/elements/primitives/io/Textarea/index.js +18 -0
  257. package/src/user-interface/elements/primitives/io/index.js +4 -0
  258. package/src/user-interface/elements/primitives/list/elements.js +0 -0
  259. package/src/user-interface/elements/primitives/list/index.js +139 -0
  260. package/src/user-interface/elements/primitives/media/Audio/index.js +17 -0
  261. package/src/user-interface/elements/primitives/media/Image/figure.js +19 -0
  262. package/src/user-interface/elements/primitives/media/Image/image.js +37 -0
  263. package/src/user-interface/elements/primitives/media/Image/index.js +2 -0
  264. package/src/user-interface/elements/primitives/media/Video/index.js +27 -0
  265. package/src/user-interface/elements/primitives/media/__ZikoUIDynamicMediaELement__.js +47 -0
  266. package/src/user-interface/elements/primitives/media/index.js +3 -0
  267. package/src/user-interface/elements/primitives/misc/index.js +100 -0
  268. package/src/user-interface/elements/primitives/semantic/index.js +82 -0
  269. package/src/user-interface/elements/primitives/table/elements.js +94 -0
  270. package/src/user-interface/elements/primitives/table/index.js +3 -0
  271. package/src/user-interface/elements/primitives/table/table.js +115 -0
  272. package/src/user-interface/elements/primitives/table/utils.js +12 -0
  273. package/src/user-interface/elements/primitives/text/__ZikoUIText__.js +71 -0
  274. package/src/user-interface/elements/primitives/text/heading.js +36 -0
  275. package/src/user-interface/elements/primitives/text/index.js +3 -0
  276. package/src/user-interface/elements/primitives/text/p.js +26 -0
  277. package/src/user-interface/elements/primitives/text/pre.js +0 -0
  278. package/src/user-interface/elements/primitives/text/text.js +81 -0
  279. package/src/user-interface/index.js +190 -0
  280. package/src/user-interface/style/index.js +510 -0
  281. package/src/user-interface/utils/index.js +70 -0
@@ -0,0 +1,103 @@
1
+ import ZikoUIContainerElement from "../primitives/ZikoUIContainerElement.js";
2
+ class ZikoUIFlex extends ZikoUIContainerElement {
3
+ constructor(tag = "div", w = "100%", h = "100%") {
4
+ super(tag ,"Flex");
5
+ this.direction = "cols";
6
+ if (typeof w == "number") w += "%";
7
+ if (typeof h == "number") h += "%";
8
+ this.style({ width: w, height: h });
9
+ this.style({ display: "flex" });
10
+ // this.render();
11
+ }
12
+ get isFlex(){
13
+ return true;
14
+ }
15
+ resp(px,wrap = true) {
16
+ this.wrap(wrap);
17
+ if (this.element.clientWidth < px) this.vertical();
18
+ else this.horizontal();
19
+ return this;
20
+ }
21
+ setSpaceAround() {
22
+ this.style({ justifyContent: "space-around" });
23
+ return this;
24
+ }
25
+ setSpaceBetween() {
26
+ this.style({ justifyContent: "space-between" });
27
+ return this;
28
+ }
29
+ setBaseline() {
30
+ this.style({ alignItems: "baseline" });
31
+ return this;
32
+ }
33
+ gap(g) {
34
+ if (this.direction === "row") this.style({ columnGap: g });
35
+ else if (this.direction === "column") this.style({ rowGap: g });
36
+ return this;
37
+ }
38
+ wrap(value = "wrap") {
39
+ const values = ["no-wrap", "wrap","wrap-reverse"];
40
+ this.style({
41
+ flexWrap: typeof value === "string" ? value : values[+value],
42
+ });
43
+ return this;
44
+ }
45
+ _justifyContent(align = "center") {
46
+ this.style({ justifyContent: align });
47
+ return this;
48
+ }
49
+ vertical(x, y, order=1) {
50
+ set_vertical.call(this,order)
51
+ this.style({
52
+ alignItems: typeof(x)==="number"?map_pos_x.call(this,x):x,
53
+ justifyContent: typeof(y)=="number"?map_pos_y.call(this,y):y
54
+ });
55
+ return this;
56
+ }
57
+ horizontal(x, y, order=1) {
58
+ set_horizontal.call(this,order)
59
+ this.style({
60
+ alignItems: typeof(y)=="number"?map_pos_y.call(this,y):y,
61
+ justifyContent: typeof(x)==="number"?map_pos_x.call(this,x):x
62
+ });
63
+ return this;
64
+ }
65
+ show() {
66
+ this.isHidden = false;
67
+ this.style({ display: "flex" });
68
+ return this;
69
+ }
70
+ }
71
+
72
+ const Flex = (...ZikoUIElement) =>{
73
+ let tag="div";
74
+ if(typeof ZikoUIElement[0]==="string"){
75
+ tag=ZikoUIElement[0];
76
+ ZikoUIElement.pop();
77
+ }
78
+ return new ZikoUIFlex(tag).append(...ZikoUIElement);
79
+ }
80
+ function set_vertical(direction){
81
+ direction == 1
82
+ ? this.style({ flexDirection: "column" })
83
+ : direction == -1 && this.style({ flexDirection: "column-reverse" });
84
+ return this;
85
+ }
86
+ function set_horizontal(direction){
87
+ direction == 1
88
+ ? this.style({ flexDirection: "row" })
89
+ : direction == -1 && this.style({ flexDirection: "row-reverse" });
90
+ return this;
91
+ }
92
+ function map_pos_x(align){
93
+ let pos = ["flex-start", "center", "flex-end"];
94
+ if (typeof align === "number") align = pos[align + 1];
95
+ return align;
96
+ }
97
+ function map_pos_y(align){
98
+ return map_pos_x(-align);
99
+ }
100
+ export{
101
+ Flex,
102
+ ZikoUIFlex
103
+ }
@@ -0,0 +1,33 @@
1
+ import ZikoUIContainerElement from "../primitives/ZikoUIContainerElement.js"
2
+ class ZikoUIGrid extends ZikoUIContainerElement {
3
+ constructor(tag ="div", w = "50vw", h = "50vh") {
4
+ super(tag,"Grid");
5
+ this.direction = "cols";
6
+ if (typeof w == "number") w += "%";
7
+ if (typeof h == "number") h += "%";
8
+ this.style({ border: "1px solid black", width: w, height: h });
9
+ this.style({ display: "grid" });
10
+ // this.render();
11
+ }
12
+ get isGird(){
13
+ return true;
14
+ }
15
+ columns(n) {
16
+ let temp = "";
17
+ for (let i = 0; i < n; i++) temp = temp.concat(" auto");
18
+ this.#templateColumns(temp);
19
+ return this;
20
+ }
21
+ #templateColumns(temp = "auto auto") {
22
+ this.style({ gridTemplateColumns: temp });
23
+ return this;
24
+ }
25
+ gap(w = 10, h = w) {
26
+ if(typeof (w) === "number")w += "px";
27
+ if(typeof (h) === "number")h += "px";
28
+ this.style({gridColumnGap: w,gridRowGap: h});
29
+ return this;
30
+ }
31
+ }
32
+ const Grid = (...ZikoUIElement) => new ZikoUIGrid("div").append(...ZikoUIElement);
33
+ export {Grid,ZikoUIGrid};
@@ -0,0 +1,4 @@
1
+ // Next
2
+ // Previous
3
+ // Vertical
4
+ // Horizontal
@@ -0,0 +1,45 @@
1
+ import ZikoUIContainerElement from "../../../primitives/ZikoUIContainerElement.js";
2
+ // import { Collapsible } from "./Collapsible";
3
+ class ZikoUIAccordion extends ZikoUIContainerElement{
4
+ constructor(...Collapsible){
5
+ super("div", "Accordion")
6
+ this.append(...Collapsible);
7
+ Object.assign(this.cache,{
8
+ autoClose : true
9
+ })
10
+ }
11
+ get isAccordion(){
12
+ return true;
13
+ }
14
+ closeAll(){
15
+ this.items.forEach(n=>n.close());
16
+ return this;
17
+ }
18
+ closeExcept(...Collapsibles){
19
+ this.items.filter(n=>!Collapsibles.includes(n)).forEach(n=>n.close())
20
+ return this;
21
+ }
22
+ open(CollapsibleOrIndex){
23
+ CollapsibleOrIndex.isCollapsible? CollapsibleOrIndex.open(): this.items[CollapsibleOrIndex].open();
24
+ this.closeExcept(CollapsibleOrIndex.isCollapsible? CollapsibleOrIndex: this.items[CollapsibleOrIndex]);
25
+ return this;
26
+ }
27
+ enableAutoClose(){
28
+ this.cache.autoClose = true;
29
+ return this;
30
+ }
31
+ disableAutoClose(){
32
+ this.cache.autoClose = false;
33
+ return this;
34
+ }
35
+ toggleAutoClose(){
36
+ this.cache.autoClose = !this.cache.autoClose;
37
+ }
38
+ }
39
+ const Accordion = (... Collapsible) => new ZikoUIAccordion(...Collapsible);
40
+ // window.Accordion = Accordion
41
+
42
+ export{
43
+ Accordion,
44
+ ZikoUIAccordion
45
+ }
@@ -0,0 +1,82 @@
1
+ import ZikoUIElement from "../../../primitives/ZikoUIElement";
2
+ import { html } from "../../../primitives/misc/index.js";
3
+ import { watchAttr } from "../../../../../reactivity/index.js";
4
+ class ZikoUICollapbsible extends ZikoUIElement{
5
+ constructor(summary,content,openIcon="😁", closeIcon=openIcon){
6
+ super("details","Collapsible")
7
+ Object.assign(this.cache,{
8
+ icons:{
9
+ open : openIcon,
10
+ close : closeIcon
11
+ }
12
+ })
13
+ this.summary=html("summary",summary).style({
14
+ fontSize:"1.1em",
15
+ padding:"0.625rem",
16
+ fontWeight:"bold",
17
+ listStyleType:`"${openIcon}"`,
18
+ cursor:"pointer",
19
+ });
20
+ this.summary[0].style({
21
+ marginLeft:"0.5em",
22
+ })
23
+ this.content=content.style({
24
+ margin:"0.7em",
25
+ });
26
+ this.element?.append(this.summary.element,this.content.element)
27
+ this.style({
28
+ marginBottom:"0.7em",
29
+ })
30
+ watchAttr(this, e=>{
31
+ if(e.target.isOpen){
32
+ e.target.emit("open");
33
+ if(this?.parent?.isAccordion){
34
+ if(this.parent.cache.autoClose)this.parent.closeExcept(this);
35
+ }
36
+ this.summary.style({
37
+ listStyleType:`"${this.cache.icons.close}"`
38
+ })
39
+ }
40
+ else{
41
+ e.target.emit("close");
42
+ this.summary.style({
43
+ listStyleType:`"${this.cache.icons.open}"`
44
+ })
45
+ }
46
+ })
47
+ }
48
+ get isCollapsible(){
49
+ return true;
50
+ }
51
+ get isOpen(){
52
+ return this.element.open;
53
+ }
54
+ open(details=this){
55
+ this.element.open=true;
56
+ this.emit("open",details)
57
+ return this;
58
+ }
59
+ close(){
60
+ this.element.open=false;
61
+ return this;
62
+ }
63
+ onOpen(callback){
64
+ this.on("open", callback)
65
+ return this;
66
+ }
67
+ onClose(callback){
68
+ this.on("close", callback)
69
+ return this;
70
+ }
71
+ toggle(){
72
+ this.element.open=!this.element.open;
73
+ return this;
74
+ }
75
+ }
76
+
77
+
78
+ const Collapsible=(summary, content, openIcon, closeIcon)=>new ZikoUICollapbsible(summary,content,openIcon, closeIcon);
79
+ export{
80
+ Collapsible
81
+ }
82
+
@@ -0,0 +1,2 @@
1
+ export * from "./collapsible.js"
2
+ export * from "./accordion.js"
@@ -0,0 +1,80 @@
1
+ import { Flex,ZikoUIFlex } from "../../Flex.js";
2
+ import { palette } from "./palette.js";
3
+ import { text, h3 } from "../../../primitives/text/index";
4
+ class ZikoUIAlert extends ZikoUIFlex{
5
+ constructor(type, title, content){
6
+ super()
7
+ this.title = h3(title);
8
+ this.icon = text(palette[type].icon).style({
9
+ display: "flex",
10
+ justifyContent:"center",
11
+ borderRadius:"50%",
12
+ minWidth:"30px",
13
+ minHeight:"30px",
14
+ });
15
+ this.content = content;
16
+ this.vertical()
17
+ .size("200px", "auto")
18
+ .style({
19
+ borderRadius:"10px",
20
+ padding:"10px"
21
+ });
22
+ this.append(
23
+ Flex(
24
+ this.title,
25
+ this.icon
26
+ ).size("100%", "40px").style({}).horizontal("space-between",0),
27
+ this.content
28
+ )
29
+ this.useType(type);
30
+ }
31
+ get isAlert(){
32
+ return true;
33
+ }
34
+ useType(type){
35
+ this.style({
36
+ color:palette[type].color,
37
+ background:palette[type].bgColor,
38
+ border: `1px darkblue solid`,
39
+ borderLeft: `15px ${palette[type].borderColor} solid`,
40
+ })
41
+ this.title.style({
42
+ color:palette[type].titleColor
43
+ });
44
+ this.content.st.color(palette[type].titleColor)
45
+ this.icon.setValue(palette[type].icon).style({
46
+ border:`2px ${palette[type].borderColor} solid`,
47
+ alignItems: type==="warning"?"flex-start":"center",
48
+ });
49
+ return this;
50
+ }
51
+ useSuccess(){
52
+ this.useType("success");
53
+ return this;
54
+ }
55
+ useInfo(){
56
+ this.useType("info");
57
+ return this;
58
+ }
59
+ useWarning(){
60
+ this.useType("warning");
61
+ return this;
62
+ }
63
+ useDanger(){
64
+ this.useType("danger");
65
+ return this;
66
+ }
67
+ }
68
+
69
+ const successAlert=(title, content)=>new ZikoUIAlert("success", title, content);
70
+ const infoAlert=(title, content)=>new ZikoUIAlert("info", title, content);
71
+ const warningAlert=(title, content)=>new ZikoUIAlert("warning", title, content);
72
+ const dangerAlert=(title, content)=>new ZikoUIAlert("danger", title, content);
73
+
74
+ export{
75
+ successAlert,
76
+ infoAlert,
77
+ warningAlert,
78
+ dangerAlert
79
+ }
80
+
@@ -0,0 +1 @@
1
+ export * from "./Alert.js"
@@ -0,0 +1,52 @@
1
+ const palette = {
2
+ success: {
3
+ titleColor:"green",
4
+ contentColor: "#35495e",
5
+ bgColor: "#d4edda", // Fixed
6
+ bgColor:"linear-gradient(-225deg, #DFFFCD 0%, #90F9C4 48%, #39F3BB 100%)",
7
+ borderColor: "#28a745", // Fixed
8
+ icon: "✅"
9
+ },
10
+ info: {
11
+ titleColor:"blue",
12
+ contentColor: "#00204a",
13
+ bgColor: "#93deff", // Fixed
14
+ bgColor:"radial-gradient(circle at 10% 20%, rgb(147, 230, 241) 0%, rgb(145, 192, 241) 45.5%)",
15
+ borderColor: "#005689", // Fixed
16
+ icon: "ℹ️"
17
+ },
18
+ warning: {
19
+ titleColor:"#e4663a",
20
+ contentColor: "#45171d",
21
+ bgColor:"#fdffcd",
22
+ bgColor:"radial-gradient(907px at 3.4% 19.8%, rgb(255, 243, 122) 0%, rgb(255, 102, 145) 97.4%)",
23
+ borderColor: "#efd510",
24
+ icon: "⚠️"
25
+ },
26
+ danger: {
27
+ titleColor:"red",
28
+ contentColor: "#721c24",
29
+ bgColor: "#f8d7da", // Fixed
30
+ bgColor:"linear-gradient(90deg, rgb(255, 157, 129) 24.3%, rgb(255, 138, 138) 78.3%)",
31
+ borderColor: "#c50000", // Fixed
32
+ icon: "❌"
33
+ },
34
+ tips: {
35
+ titleColor:null,
36
+ contentColor: null,
37
+ bgColor: null,
38
+ borderColor: null,
39
+ icon: "💡"
40
+ },
41
+ important: {
42
+ titleColor:null,
43
+ contentColor: null,
44
+ bgColor: null,
45
+ borderColor: null,
46
+ icon: "📌"
47
+ },
48
+
49
+ };
50
+ export{
51
+ palette
52
+ }
@@ -0,0 +1,51 @@
1
+ import { ZikoUIFlex } from "../../Flex";
2
+ import { Section } from "../../../primitives/semantic";
3
+ class ZikoUICarousel extends ZikoUIFlex{
4
+ constructor(...ZikoUIElement){
5
+ super()
6
+ this.style({
7
+ position:"relative",
8
+ overflow:"hidden",
9
+ touchAction:"none",
10
+ userSelect:"none"
11
+ });
12
+ this.horizontal("space-around",0);
13
+ this.track = Section(...ZikoUIElement).style({ display: "inline-flex" });
14
+ this.track.size(this.track.children.length * 100 + "vw");
15
+ this.track.setTarget(this);
16
+ this.track.items.map((n) =>
17
+ n.style({ pointerEvents: "none", margin: "auto 10px" })
18
+ );
19
+ this.x0 = null;
20
+ this.tx = 0;
21
+ this.onPtrMove(e=>{
22
+ if(e.isDown){
23
+ let x = e.event.pageX;
24
+ let dx = x - this.x0;
25
+ this.track.st.translateX(
26
+ this.tx + dx,
27
+ 0
28
+ );
29
+ }
30
+ })
31
+ this.onPtrDown(e=>{
32
+ console.log(e.event)
33
+ this.x0 = e.event.pageX;
34
+ const transformMatrix = window
35
+ .getComputedStyle(this.track.element)
36
+ .getPropertyValue("transform");
37
+ if (transformMatrix !== "none") {
38
+ this.tx = +transformMatrix.split(",")[4];
39
+ }
40
+ })
41
+ this.onPtrUp(e=>console.log(e.isDown));
42
+ this.onPtrLeave(e=>{
43
+ // Handle outside up
44
+ });
45
+ }
46
+ get isCarousel(){
47
+ return true;
48
+ }
49
+ }
50
+ const Carousel=(...ZikoUIElement)=>new ZikoUICarousel(...ZikoUIElement);
51
+ export {Carousel}
@@ -0,0 +1,105 @@
1
+ import { html } from "../../../Misc";
2
+ import { Flex } from "../../Flex";
3
+ import { text } from "../../../Text";
4
+ import { ZikoUICodeNote } from "./CodeNote";
5
+ import {EditorView, basicSetup} from "codemirror"
6
+ import {javascript} from "@codemirror/lang-javascript"
7
+ import {keymap} from "@codemirror/view"
8
+ import {indentWithTab} from "@codemirror/commands"
9
+ import { style } from "../../../Utils";
10
+
11
+ // const Input=(codeText="")=>html("code",codeText).style({
12
+ // width:"100%",
13
+ // height:"auto",
14
+ // padding:"10px",
15
+ // boxSizing:"border-box",
16
+ // border: "1px solid #ccc",
17
+ // outline: "none",
18
+ // fontSize: "1rem",
19
+ // fontFamily: "Lucida Console, Courier New, monospace",
20
+ // padding: "1rem 0.5rem",
21
+ // wordBreak:"break-all",
22
+ // background:"#f6f8fa",
23
+ // color:"#0062C3"
24
+ // }).setAttr("contenteditable",true).setAttr("spellcheck",false);
25
+
26
+ const Input = (codeText = "") => {
27
+ // Create the code element with styles
28
+ const inputElement = html("code", codeText)
29
+ .style({
30
+ // width: "100%",
31
+ // height: "auto",
32
+ // padding: "10px",
33
+ // boxSizing: "border-box",
34
+ // border: "1px solid #ccc",
35
+ outline: "none",
36
+ fontSize: "1rem",
37
+ fontFamily: "Lucida Console, Courier New, monospace",
38
+ // padding: "1rem 0.5rem",
39
+ // wordBreak: "break-all",
40
+ // background: "#f6f8fa",
41
+ // color: "#0062C3",
42
+ })
43
+ // .setAttr("contenteditable", true).setAttr("spellcheck", false);
44
+
45
+ // Initialize CodeMirror editor view on the created element
46
+ let editor=new EditorView({
47
+ extensions: [
48
+ basicSetup,
49
+ javascript(),
50
+ keymap.of([indentWithTab])
51
+ ],
52
+ parent: inputElement.element // Use the element for CodeMirror's parent
53
+ });
54
+ window.editor = editor
55
+ // Return the element to be used elsewhere
56
+ return inputElement;
57
+ };
58
+
59
+
60
+ const Output=()=>html("output").style({
61
+ width:"100%",
62
+ height:"auto",
63
+ padding:"5px 0",
64
+ })
65
+ const Left=(ctx)=>Flex(
66
+ text("[ ]")
67
+ ).style({
68
+ width:"50px",
69
+ //height:getComputedStyle(ctx.Input.element).height,
70
+ height:"50px",
71
+ margin:"10px 4px",
72
+ padding:"5px",
73
+ color:"darkblue",
74
+ borderBottom:"4px solid gold",
75
+ }).horizontal(0,0);
76
+ const BTN_STYLE={
77
+ background:"none",
78
+ width:"25px",
79
+ height:"25px",
80
+ fontSize:"1.2rem",
81
+ cursor:"pointer"
82
+ }
83
+ const Right=(ctx)=>Flex(
84
+ text('▶️').style(BTN_STYLE).onClick(e=>{
85
+ if(ctx.parent instanceof ZikoUICodeNote)ctx.parent.setCurrentNote(ctx);
86
+ ctx.execute();
87
+ globalThis.__Ziko__.__Config__.default.target=e.target.parent.parent[1][1];
88
+ }),
89
+ text('📋').style(BTN_STYLE).onClick(()=>{
90
+ navigator.clipboard.writeText(ctx.codeText)
91
+ }),
92
+ text('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
93
+ text('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
94
+ ).style({
95
+ width:"70px",
96
+ height:"50px",
97
+ //background:"cyan",
98
+ margin:"10px 0"
99
+ }).horizontal(0,0).wrap(true);
100
+ export{
101
+ Input,
102
+ Output,
103
+ Right,
104
+ Left
105
+ }