ziko 0.0.2 → 0.0.5

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 (235) hide show
  1. package/README.md +11 -15
  2. package/core/App/Globals/index.js +18 -0
  3. package/{src → core}/App/app.js +10 -1
  4. package/{src → core}/App/index.js +1 -0
  5. package/{src → core}/Graphics/Canvas/canvas.js +1 -1
  6. package/{src → core}/Reactivity/Events/Global/CustomEvent.js +2 -2
  7. package/core/Reactivity/Events/Global/Mouse.js +230 -0
  8. package/core/Reactivity/Events/Global/Wheel.js +44 -0
  9. package/core/Reactivity/Events/Partiel/Hash.js +44 -0
  10. package/core/Reactivity/Events/Partiel/MediaEvent.js +1 -0
  11. package/{src → core}/Reactivity/Events/index.js +12 -3
  12. package/{src → core}/UI/CustomElement/Elements/Accordion/index.js +2 -2
  13. package/{src → core}/UI/CustomElement/Elements/CodeNote/CodeCell.js +1 -1
  14. package/{src → core}/UI/CustomElement/Elements/CodeNote/SubElements.js +4 -4
  15. package/{src → core}/UI/CustomElement/Flex.js +22 -22
  16. package/{src → core}/UI/Inputs/Primitives/btn.js +1 -2
  17. package/{src → core}/UI/Inputs/Primitives/inputs.js +0 -10
  18. package/{src → core}/UI/Inputs/Primitives/select.js +0 -1
  19. package/{src → core}/UI/Inputs/Primitives/textarea.js +0 -1
  20. package/{src → core}/UI/List/index.js +0 -3
  21. package/{src → core}/UI/Media/Audio/index.js +14 -2
  22. package/{src → core}/UI/Media/Image/figure.js +0 -1
  23. package/{src → core}/UI/Media/Image/image.js +0 -1
  24. package/{src → core}/UI/Media/Video/index.js +13 -1
  25. package/{src → core}/UI/Misc/index.js +5 -9
  26. package/{src → core}/UI/Semantic/index.js +0 -7
  27. package/{src → core}/UI/Table/table.js +0 -1
  28. package/{src → core}/UI/Text/heading.js +0 -1
  29. package/{src → core}/UI/Text/p.js +0 -1
  30. package/{src → core}/UI/Text/text.js +0 -1
  31. package/{src → core}/UI/ZikoUIElement.js +55 -30
  32. package/{src → core}/UI/index.js +3 -3
  33. package/core/__proto__/String.js +0 -0
  34. package/{src → core}/index.js +3 -1
  35. package/dist/ziko.cjs +491 -134
  36. package/dist/ziko.js +491 -134
  37. package/dist/ziko.min.js +2 -2
  38. package/dist/ziko.mjs +490 -134
  39. package/package.json +9 -9
  40. package/wrapper/react/index.jsx +16 -0
  41. package/wrapper/react/readme.md +19 -0
  42. package/wrapper/vue/ZikoUI.vue +17 -0
  43. package/src/App/Globals/index.js +0 -3
  44. package/starter/bin/index.js +0 -10
  45. /package/{src → core}/App/Accessibility/index.js +0 -0
  46. /package/{src → core}/App/Globals/__Target__.js +0 -0
  47. /package/{src → core}/App/Globals/__UI__.js +0 -0
  48. /package/{src → core}/App/Globals/__init__.js +0 -0
  49. /package/{src → core}/App/Router/index.js +0 -0
  50. /package/{src → core}/App/Seo/index.js +0 -0
  51. /package/{src → core}/App/Themes/dark.js +0 -0
  52. /package/{src → core}/App/Themes/index.js +0 -0
  53. /package/{src → core}/App/Themes/light.js +0 -0
  54. /package/{src → core}/Data/Api/fetchdom.js +0 -0
  55. /package/{src → core}/Data/Api/index.js +0 -0
  56. /package/{src → core}/Data/Api/preload.js +0 -0
  57. /package/{src → core}/Data/Converter/canvas.js +0 -0
  58. /package/{src → core}/Data/Converter/csv.js +0 -0
  59. /package/{src → core}/Data/Converter/index.js +0 -0
  60. /package/{src → core}/Data/Converter/json.js +0 -0
  61. /package/{src → core}/Data/Converter/markdown.js +0 -0
  62. /package/{src → core}/Data/Converter/svg.js +0 -0
  63. /package/{src → core}/Data/Parser/markdown.js +0 -0
  64. /package/{src → core}/Data/Parser/xml.js +0 -0
  65. /package/{src → core}/Data/Strings/index.js +0 -0
  66. /package/{src → core}/Data/decorators.js +0 -0
  67. /package/{src → core}/Data/index.js +0 -0
  68. /package/{src → core}/Graphics/Canvas/Elements/Basic/arc.js +0 -0
  69. /package/{src → core}/Graphics/Canvas/Elements/Basic/image.js +0 -0
  70. /package/{src → core}/Graphics/Canvas/Elements/Basic/line.js +0 -0
  71. /package/{src → core}/Graphics/Canvas/Elements/Basic/path.js +0 -0
  72. /package/{src → core}/Graphics/Canvas/Elements/Basic/points.js +0 -0
  73. /package/{src → core}/Graphics/Canvas/Elements/Basic/polygon.js +0 -0
  74. /package/{src → core}/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
  75. /package/{src → core}/Graphics/Canvas/Elements/Basic/rect.js +0 -0
  76. /package/{src → core}/Graphics/Canvas/Elements/Basic/text.js +0 -0
  77. /package/{src → core}/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
  78. /package/{src → core}/Graphics/Canvas/Elements/Chart/plot.js +0 -0
  79. /package/{src → core}/Graphics/Canvas/Elements/Chart/scatter.js +0 -0
  80. /package/{src → core}/Graphics/Canvas/Elements/Chart/stem.js +0 -0
  81. /package/{src → core}/Graphics/Canvas/Elements/Element.js +0 -0
  82. /package/{src → core}/Graphics/Canvas/Elements/Groupe.js +0 -0
  83. /package/{src → core}/Graphics/Canvas/Elements/grid.js +0 -0
  84. /package/{src → core}/Graphics/Canvas/Elements/index.js +0 -0
  85. /package/{src → core}/Graphics/Canvas/Filter/index.js +0 -0
  86. /package/{src → core}/Graphics/Canvas/Paint/index.js +0 -0
  87. /package/{src → core}/Graphics/Canvas/Utils/color.js +0 -0
  88. /package/{src → core}/Graphics/Canvas/Utils/floodFill.js +0 -0
  89. /package/{src → core}/Graphics/Canvas/_canvas_offscreen +0 -0
  90. /package/{src → core}/Graphics/Canvas/index.js +0 -0
  91. /package/{src → core}/Graphics/Svg/Elements/ZikoSvgElement.js +0 -0
  92. /package/{src → core}/Graphics/Svg/Elements/circle.js +0 -0
  93. /package/{src → core}/Graphics/Svg/Elements/ellipse.js +0 -0
  94. /package/{src → core}/Graphics/Svg/Elements/foreignObject.js +0 -0
  95. /package/{src → core}/Graphics/Svg/Elements/grid.js +0 -0
  96. /package/{src → core}/Graphics/Svg/Elements/groupe.js +0 -0
  97. /package/{src → core}/Graphics/Svg/Elements/image.js +0 -0
  98. /package/{src → core}/Graphics/Svg/Elements/line.js +0 -0
  99. /package/{src → core}/Graphics/Svg/Elements/path.js +0 -0
  100. /package/{src → core}/Graphics/Svg/Elements/polygon.js +0 -0
  101. /package/{src → core}/Graphics/Svg/Elements/polyline.js +0 -0
  102. /package/{src → core}/Graphics/Svg/Elements/rect.js +0 -0
  103. /package/{src → core}/Graphics/Svg/Elements/text.js +0 -0
  104. /package/{src → core}/Graphics/Svg/index.js +0 -0
  105. /package/{src → core}/Graphics/Svg/svg.js +0 -0
  106. /package/{src → core}/Graphics/index.js +0 -0
  107. /package/{src → core}/Math/Calculus/Special Functions/bessel.js +0 -0
  108. /package/{src → core}/Math/Calculus/Special Functions/beta.js +0 -0
  109. /package/{src → core}/Math/Calculus/Special Functions/gamma.js +0 -0
  110. /package/{src → core}/Math/Calculus/Special Functions/index.js +0 -0
  111. /package/{src → core}/Math/Calculus/index.js +0 -0
  112. /package/{src → core}/Math/Complex/Fractals/julia.js +0 -0
  113. /package/{src → core}/Math/Complex/index.js +0 -0
  114. /package/{src → core}/Math/Discret/Combinaison/index.js +0 -0
  115. /package/{src → core}/Math/Discret/Conversion/index.js +0 -0
  116. /package/{src → core}/Math/Discret/Logic/index.js +0 -0
  117. /package/{src → core}/Math/Discret/Permutation/index.js +0 -0
  118. /package/{src → core}/Math/Discret/Set/index.js +0 -0
  119. /package/{src → core}/Math/Discret/Set/powerSet.js +0 -0
  120. /package/{src → core}/Math/Discret/Set/subSet.js +0 -0
  121. /package/{src → core}/Math/Discret/index.js +0 -0
  122. /package/{src → core}/Math/Functions/index.js +0 -0
  123. /package/{src → core}/Math/Matrix/Decomposition.js +0 -0
  124. /package/{src → core}/Math/Matrix/LinearSystem.js +0 -0
  125. /package/{src → core}/Math/Matrix/Matrix.js +0 -0
  126. /package/{src → core}/Math/Matrix/index.js +0 -0
  127. /package/{src → core}/Math/Numeric/index.js +0 -0
  128. /package/{src → core}/Math/Random/index.js +0 -0
  129. /package/{src → core}/Math/Signal/__np.py.txt +0 -0
  130. /package/{src → core}/Math/Signal/conv.js +0 -0
  131. /package/{src → core}/Math/Signal/fft.js +0 -0
  132. /package/{src → core}/Math/Signal/filter.js +0 -0
  133. /package/{src → core}/Math/Signal/functions.js +0 -0
  134. /package/{src → core}/Math/Signal/index.js +0 -0
  135. /package/{src → core}/Math/Statistics/Functions/index.js +0 -0
  136. /package/{src → core}/Math/Statistics/index.js +0 -0
  137. /package/{src → core}/Math/Utils/arithmetic.js +0 -0
  138. /package/{src → core}/Math/Utils/checkers.js +0 -0
  139. /package/{src → core}/Math/Utils/comparaison.js +0 -0
  140. /package/{src → core}/Math/Utils/conversions.js +0 -0
  141. /package/{src → core}/Math/Utils/discret.js +0 -0
  142. /package/{src → core}/Math/Utils/index.js +0 -0
  143. /package/{src → core}/Math/Utils/mapfun.js +0 -0
  144. /package/{src → core}/Math/absract.js +0 -0
  145. /package/{src → core}/Math/const.js +0 -0
  146. /package/{src → core}/Math/index.js +0 -0
  147. /package/{src → core}/Reactivity/Events/Global/Click.js +0 -0
  148. /package/{src → core}/Reactivity/Events/Global/Clipboard.js +0 -0
  149. /package/{src → core}/Reactivity/Events/Global/Drag.js +0 -0
  150. /package/{src → core}/Reactivity/Events/Global/Focus.js +0 -0
  151. /package/{src → core}/Reactivity/Events/Global/Key.js +0 -0
  152. /package/{src → core}/Reactivity/Events/Global/Pointer.js +0 -0
  153. /package/{src/Reactivity/Use/Interactions/useSerial.js → core/Reactivity/Events/Global/Touch.js} +0 -0
  154. /package/{src → core}/Reactivity/Events/Partiel/Input.js +0 -0
  155. /package/{src → core}/Reactivity/Events/ZikoEvent.js +0 -0
  156. /package/{src → core}/Reactivity/Observer/index.js +0 -0
  157. /package/{src → core}/Reactivity/Observer/intersection.js +0 -0
  158. /package/{src → core}/Reactivity/Observer/mutation.js +0 -0
  159. /package/{src → core}/Reactivity/Observer/resize.js +0 -0
  160. /package/{src → core}/Reactivity/Use/Contexte/index.js +0 -0
  161. /package/{src → core}/Reactivity/Use/Contexte/useSuccesifKeys.js +0 -0
  162. /package/{src → core}/Reactivity/Use/Decorators/index.js +0 -0
  163. /package/{src → core}/Reactivity/Use/Interactions/index.js +0 -0
  164. /package/{src → core}/Reactivity/Use/Interactions/useBluetooth.js +0 -0
  165. /package/{src → core}/Reactivity/Use/Interactions/useChannel.js +0 -0
  166. /package/{src → core}/Reactivity/Use/Interactions/useEventEmmiter.js +0 -0
  167. /package/{src/Reactivity/Use/Interactions/useUsb.js → core/Reactivity/Use/Interactions/useSerial.js} +0 -0
  168. /package/{src → core}/Reactivity/Use/Interactions/useThread.js +0 -0
  169. /package/{src/Reactivity/Use/Sensors/useCamera.js → core/Reactivity/Use/Interactions/useUsb.js} +0 -0
  170. /package/{src → core}/Reactivity/Use/Sensors/index.js +0 -0
  171. /package/{src → core}/Reactivity/Use/Sensors/useBattery.js +0 -0
  172. /package/{src/Reactivity/Use/Sensors/useMicro.js → core/Reactivity/Use/Sensors/useCamera.js} +0 -0
  173. /package/{src → core}/Reactivity/Use/Sensors/useGeolocation.js +0 -0
  174. /package/{src/Reactivity/Use/Sensors/useOrientation.js → core/Reactivity/Use/Sensors/useMicro.js} +0 -0
  175. /package/{src/Reactivity/Use/Storage/useCookie.js → core/Reactivity/Use/Sensors/useOrientation.js} +0 -0
  176. /package/{src → core}/Reactivity/Use/Storage/index.js +0 -0
  177. /package/{src/Reactivity/Use/Storage/useIndexedDb.js → core/Reactivity/Use/Storage/useCookie.js} +0 -0
  178. /package/{src/Reactivity/Use/UI/useCssLink.js → core/Reactivity/Use/Storage/useIndexedDb.js} +0 -0
  179. /package/{src → core}/Reactivity/Use/Storage/useStorage.js +0 -0
  180. /package/{src → core}/Reactivity/Use/UI/index.js +0 -0
  181. /package/{src/Reactivity/Use/UI/useLinearGradient.js → core/Reactivity/Use/UI/useCssLink.js} +0 -0
  182. /package/{src → core}/Reactivity/Use/UI/useCssText.js +0 -0
  183. /package/{src → core}/Reactivity/Use/UI/useFavIcon.js +0 -0
  184. /package/{src/Reactivity/Use/UI/useRadialGradient.js → core/Reactivity/Use/UI/useLinearGradient.js} +0 -0
  185. /package/{src → core}/Reactivity/Use/UI/useMediaQuery.js +0 -0
  186. /package/{src/UI/CustomElement/Elements/FAB.js → core/Reactivity/Use/UI/useRadialGradient.js} +0 -0
  187. /package/{src → core}/Reactivity/Use/UI/useStyle.js +0 -0
  188. /package/{src → core}/Reactivity/Use/UI/useTheme.js +0 -0
  189. /package/{src → core}/Reactivity/Use/UI/useTitle.js +0 -0
  190. /package/{src → core}/Reactivity/Use/index.js +0 -0
  191. /package/{src → core}/Reactivity/Use/todo.md +0 -0
  192. /package/{src → core}/Reactivity/index.js +0 -0
  193. /package/{src → core}/Time/animation.js +0 -0
  194. /package/{src → core}/Time/index.js +0 -0
  195. /package/{src → core}/Time/loop.js +0 -0
  196. /package/{src → core}/Time/utils/decorators.js +0 -0
  197. /package/{src → core}/Time/utils/ease.js +0 -0
  198. /package/{src → core}/Time/utils/index.js +0 -0
  199. /package/{src → core}/Time/utils/performance.js +0 -0
  200. /package/{src → core}/Time/utils/ui.js +0 -0
  201. /package/{src → core}/UI/CustomElement/Elements/Carousel/index.js +0 -0
  202. /package/{src → core}/UI/CustomElement/Elements/CodeNote/CodeNote.js +0 -0
  203. /package/{src → core}/UI/CustomElement/Elements/CodeNote/index.js +0 -0
  204. /package/{src → core}/UI/CustomElement/Elements/Columns.js +0 -0
  205. /package/{src/UI/CustomElement/Elements/Menu.js → core/UI/CustomElement/Elements/FAB.js} +0 -0
  206. /package/{src/UI/CustomElement/Elements/Notification.js → core/UI/CustomElement/Elements/Menu.js} +0 -0
  207. /package/{src/UI/CustomElement/Elements/Popover.js → core/UI/CustomElement/Elements/Notification.js} +0 -0
  208. /package/{src/UI/CustomElement/Elements/Popup.js → core/UI/CustomElement/Elements/Popover.js} +0 -0
  209. /package/{src/UI/CustomElement/Elements/Timeline.js → core/UI/CustomElement/Elements/Popup.js} +0 -0
  210. /package/{src → core}/UI/CustomElement/Elements/Swipper.js +0 -0
  211. /package/{src → core}/UI/CustomElement/Elements/Tabs/index.js +0 -0
  212. /package/{src/UI/CustomElement/Elements/Toast.js → core/UI/CustomElement/Elements/Timeline.js} +0 -0
  213. /package/{src/UI/CustomElement/Elements/Treeview.js → core/UI/CustomElement/Elements/Toast.js} +0 -0
  214. /package/{src/UI/List/elements.js → core/UI/CustomElement/Elements/Treeview.js} +0 -0
  215. /package/{src → core}/UI/CustomElement/Elements/index.js +0 -0
  216. /package/{src → core}/UI/CustomElement/Grid.js +0 -0
  217. /package/{src → core}/UI/CustomElement/index.js +0 -0
  218. /package/{src → core}/UI/Embaded/index.js +0 -0
  219. /package/{src → core}/UI/Inputs/Primitives/elements.js +0 -0
  220. /package/{src → core}/UI/Inputs/camera.js +0 -0
  221. /package/{src → core}/UI/Inputs/index.js +0 -0
  222. /package/{src/UI/Text/pre.js → core/UI/List/elements.js} +0 -0
  223. /package/{src → core}/UI/Media/Image/index.js +0 -0
  224. /package/{src → core}/UI/Media/index.js +0 -0
  225. /package/{src → core}/UI/Style/index.js +0 -0
  226. /package/{src → core}/UI/Table/elements.js +0 -0
  227. /package/{src → core}/UI/Table/index.js +0 -0
  228. /package/{src → core}/UI/Table/utils.js +0 -0
  229. /package/{src → core}/UI/Text/index.js +0 -0
  230. /package/{src/__proto__/Function.js → core/UI/Text/pre.js} +0 -0
  231. /package/{src → core}/UI/Utils/index.js +0 -0
  232. /package/{src → core}/__proto__/Array.js +0 -0
  233. /package/{src/__proto__/Object.js → core/__proto__/Function.js} +0 -0
  234. /package/{src → core}/__proto__/Number.js +0 -0
  235. /package/{src/__proto__/String.js → core/__proto__/Object.js} +0 -0
package/README.md CHANGED
@@ -4,24 +4,20 @@
4
4
 
5
5
  <br>
6
6
 
7
- ## Get started
8
- ### NPX
7
+ # Install
8
+ ```bash
9
+ npm install ziko
10
+ ```
11
+ # ⚡ Get started
12
+ ## Node
9
13
  ```bash
10
14
  npx create-ziko-app [My_App]
11
- cd [My_App]
12
15
  ```
13
-
14
- #### Commands
15
16
  ```
17
+ cd [My_App]
16
18
  npm run dev
17
19
  ```
18
- ```
19
- npm start
20
- ```
21
- ```
22
- npm run build
23
- ```
24
- ### Browser
20
+ ## Browser
25
21
  ```html
26
22
  <!DOCTYPE html>
27
23
  <html lang="en">
@@ -53,11 +49,11 @@
53
49
  </body>
54
50
  </html>
55
51
  ```
56
-
52
+ ## Documentation
57
53
  ## 🎬 Demos
58
54
  - ### [ Windows entanglement using zikojs and ziko-three ](https://www.linkedin.com/feed/update/urn:li:activity:7144023650394918913/)
59
55
 
60
- ## 📃 [wiki](https://github.com/zakarialaoui10/ziko.js/wiki/Math-Functions)
56
+ ## 📃 [wiki](https://github.com/zakarialaoui10/ziko.js/wiki)
61
57
 
62
58
  ## 💡 [Features]()
63
59
  <details>
@@ -319,7 +315,7 @@ useThread(() => {
319
315
 
320
316
  If you appreciate the library, kindly demonstrate your support by giving it a star!<br>
321
317
  [![Star](https://img.shields.io/github/stars/zakarialaoui10/ziko.js?style=social)](https://github.com/zakarialaoui10/ziko.js)
322
-
318
+ <!--## Financial support-->
323
319
  # License
324
320
  This projet is licensed under the terms of MIT License
325
321
  <img src="https://img.shields.io/github/license/zakarialaoui10/zikojs?color=rgb%2820%2C21%2C169%29" width="100" align="right">
@@ -0,0 +1,18 @@
1
+ // var __Target__=null;
2
+ // if(globalThis?.document?.body)__Target__=document.body;
3
+ const __ZikoConfig__={
4
+ default:{
5
+ target:null,
6
+ render:true
7
+ },
8
+ setDefault:function(pairs){
9
+ const keys=Object.keys(pairs);
10
+ const values=Object.values(pairs);
11
+ for(let i=0;i<keys.length;i++)this.default[keys[i]]=values[i];
12
+ },
13
+ init:()=>document.documentElement.setAttribute("data-engine","zikojs")
14
+ }
15
+ export * from "./__init__";
16
+ export * from "./__Target__";
17
+ export * from "./__UI__";
18
+ export {__ZikoConfig__}
@@ -1,5 +1,6 @@
1
1
  import { ZikoUIFlex } from "../UI/CustomElement/Flex.js";
2
2
  import { Seo } from "./Seo/index.js";
3
+ import { HashEvent } from "../Reactivity/index.js";
3
4
  class ZikoUIApp extends ZikoUIFlex{
4
5
  constructor(){
5
6
  super("main");
@@ -7,11 +8,14 @@ class ZikoUIApp extends ZikoUIFlex{
7
8
  this.head=null;
8
9
  this.#init();
9
10
  this.seo=Seo(this);
11
+ Object.assign(this.events,{
12
+ hash:null
13
+ })
10
14
  Object.assign(this.cache,{
11
15
  theme:null,
12
16
  isRoot:true
13
17
  });
14
- this.render();
18
+ this.render(globalThis.__ZikoConfig__.default.render);
15
19
  }
16
20
  #init(){
17
21
  this.root.setAttribute("data-engine","zikojs");
@@ -32,6 +36,11 @@ class ZikoUIApp extends ZikoUIFlex{
32
36
  description(){
33
37
 
34
38
  }
39
+ onHashChange(...callbacks){
40
+ if(!this.events.hash)this.events.hash = HashEvent(this);
41
+ this.events.hash.onChange(...callbacks);
42
+ return this;
43
+ }
35
44
  }
36
45
  const App=(...UIElement)=>new ZikoUIApp().append(...UIElement)
37
46
  export {App};
@@ -8,4 +8,5 @@ export {
8
8
  } from "./Themes";
9
9
  export {
10
10
  __init__,
11
+ __ZikoConfig__
11
12
  } from "./Globals"
@@ -20,7 +20,7 @@ class ZikoUICanvas extends ZikoUIElement{
20
20
  [-10,-10],
21
21
  [10,10]
22
22
  ])
23
- this.render();
23
+ this.render(globalThis.__ZikoConfig__.default.render);
24
24
  setTimeout(()=>this.resize(w,h),0);
25
25
  this.on("sizeupdated",()=>this.adjust())
26
26
  }
@@ -49,5 +49,5 @@ class ZikoCustomEvent extends ZikoEvent{
49
49
  return this;
50
50
  }
51
51
  }
52
- const CustomEvent=Target=>new ZikoCustomEvent(Target);
53
- export default CustomEvent;
52
+ const customEvent=Target=>new customEvent(Target);
53
+ export default customEvent;
@@ -0,0 +1,230 @@
1
+ import {ZikoEvent,EVENT_CONTROLLER} from "../ZikoEvent.js";
2
+ class ZikoEventMouse extends ZikoEvent{
3
+ constructor(target){
4
+ super(target);
5
+ this.event=null;
6
+ this.dx=0;
7
+ this.dy=0;
8
+ this.dt=0;
9
+ this.mx=0;
10
+ this.my=0;
11
+ this.mt=0;
12
+ this.ux=0;
13
+ this.uy=0;
14
+ this.ut=0;
15
+ this.swippe={
16
+ h:null,
17
+ v:null,
18
+ delta_x:0,
19
+ delta_y:0
20
+ }
21
+ this.isMoving=false;
22
+ this.isDown=false;
23
+ this.cache={
24
+ prefixe:"mouse",
25
+ preventDefault:{
26
+ down:false,
27
+ move:false,
28
+ up:false,
29
+ enter:false,
30
+ out:false,
31
+ leave:false,
32
+ over:false,
33
+ },
34
+ paused:{
35
+ down:false,
36
+ move:false,
37
+ up:false,
38
+ enter:false,
39
+ out:false,
40
+ leave:false,
41
+ over:false,
42
+ },
43
+ stream:{
44
+ enabled:{
45
+ down:false,
46
+ move:false,
47
+ up:false,
48
+ enter:false,
49
+ out:false,
50
+ leave:false,
51
+ over:false,
52
+ },
53
+ clear:{
54
+ down:false,
55
+ move:false,
56
+ up:false,
57
+ enter:false,
58
+ out:false,
59
+ leave:false,
60
+ over:false,
61
+ },
62
+ history:{
63
+ down:[],
64
+ move:[],
65
+ up:[],
66
+ enter:[],
67
+ out:[],
68
+ leave:[],
69
+ over:[]
70
+ }
71
+ },
72
+ callbacks:{
73
+ down:[(self)=>console.log({dx:self.dx,dy:self.dy,down:self.down,move:self.move,t:self.dt})],
74
+ move:[(self)=>console.log({mx:self.mx,my:self.my,down:self.down,move:self.move,t:self.dt})],
75
+ up:[(self)=>console.log({ux:self.ux,uy:self.uy,down:self.down,move:self.move,t:self.dt})],
76
+ enter:[(self)=>console.log({dx:self.dx,dy:self.dy,down:self.down,move:self.move,t:self.dt})],
77
+ out:[(self)=>console.log({mx:self.mx,my:self.my,down:self.down,move:self.move,t:self.dt})],
78
+ leave:[(self)=>console.log({ux:self.ux,uy:self.uy,down:self.down,move:self.move,t:self.dt})],
79
+ over:[(self)=>console.log({ux:self.ux,uy:self.uy,down:self.down,move:self.move,t:self.dt})]
80
+ }
81
+ }
82
+ this.__controller={
83
+ down:mousedown_controller.bind(this),
84
+ move:mousemove_controller.bind(this),
85
+ up:mouseup_controller.bind(this),
86
+ enter:mouseenter_controller.bind(this),
87
+ out:mouseout_controller.bind(this),
88
+ leave:mouseleave_controller.bind(this),
89
+ over:mouseover_controller.bind(this),
90
+ }
91
+ }
92
+ onDown(...callbacks){
93
+ if(callbacks.length===0)callbacks=[()=>{}];
94
+ this.__onEvent("down",{down:true,move:false,up:false,enter:false,out:false,leave:false,over:false},...callbacks)
95
+ return this;
96
+ }
97
+ onMove(...callbacks){
98
+ if(callbacks.length===0)callbacks=[()=>{}];
99
+ this.__onEvent("move",{down:false,move:true,up:false,enter:false,out:false,leave:false,over:false},...callbacks)
100
+ return this;
101
+ }
102
+ onUp(...callbacks){
103
+ if(callbacks.length===0)callbacks=[()=>{}];
104
+ this.__onEvent("up",{down:false,move:false,up:true,enter:false,out:false,leave:false,over:false},...callbacks)
105
+ return this;
106
+ }
107
+ onEnter(...callbacks){
108
+ if(callbacks.length===0)callbacks=[()=>{}];
109
+ this.__onEvent("enter",{down:false,move:false,up:false,enter:true,out:false,leave:false,over:false},...callbacks)
110
+ return this;
111
+ }
112
+ onOut(...callbacks){
113
+ if(callbacks.length===0)callbacks=[()=>{}];
114
+ this.__onEvent("out",{down:false,move:false,up:false,enter:false,out:true,leave:false,over:false},...callbacks)
115
+ return this;
116
+ }
117
+ onLeave(...callbacks){
118
+ if(callbacks.length===0)callbacks=[()=>{}];
119
+ this.__onEvent("leave",{down:false,move:false,up:false,enter:false,out:false,leave:true,over:false},...callbacks)
120
+ return this;
121
+ }
122
+ onOver(...callbacks){
123
+ if(callbacks.length===0)callbacks=[()=>{}];
124
+ this.__onEvent("over",{down:false,move:false,up:false,enter:false,out:false,leave:false,over:true},...callbacks)
125
+ return this;
126
+ }
127
+ }
128
+ function mousedown_controller(e){
129
+ EVENT_CONTROLLER.call(
130
+ this,
131
+ e,
132
+ "down",
133
+ ()=>{
134
+ this.dx=parseInt(e.offsetX);
135
+ this.dy=parseInt(e.offsetY);
136
+ this.isDown=true;
137
+ },
138
+ {
139
+ x:this.dx,
140
+ y:this.dy,
141
+ t:Date.now()-this.cache.stream.t0
142
+ }
143
+ )
144
+ }
145
+ function mousemove_controller(e){
146
+ EVENT_CONTROLLER.call(
147
+ this,
148
+ e,
149
+ "move",
150
+ ()=>{
151
+ this.mx=parseInt(e.offsetX);
152
+ this.my=parseInt(e.offsetY);
153
+ this.isMoving=true;
154
+ },
155
+ {
156
+ x:this.mx,
157
+ y:this.my,
158
+ t:Date.now()-this.cache.stream.t0
159
+ }
160
+ )
161
+ }
162
+ function mouseup_controller(e){
163
+ EVENT_CONTROLLER.call(
164
+ this,
165
+ e,
166
+ "up",
167
+ ()=>{
168
+ this.ux=parseInt(e.offsetX);
169
+ this.uy=parseInt(e.offsetY);
170
+ this.isDown=false;
171
+ const dx=this.dx;
172
+ const dy=this.dy;
173
+ const ux=this.ux;
174
+ const uy=this.uy;
175
+ const delta_x=(ux-dx)/this.target.Width;
176
+ const delta_y=(dy-uy)/this.target.Height;
177
+ const HORIZONTAL_SWIPPE=(delta_x<0)?"left":(delta_x>0)?"right":"none";
178
+ const VERTICAL_SWIPPE=(delta_y<0)?"bottom":(delta_y>0)?"top":"none";
179
+ this.swippe={
180
+ h:HORIZONTAL_SWIPPE,
181
+ v:VERTICAL_SWIPPE,
182
+ delta_x,
183
+ delta_y
184
+ }
185
+ },
186
+ {
187
+ x:this.ux,
188
+ y:this.uy,
189
+ t:Date.now()-this.cache.stream.t0
190
+ }
191
+ )
192
+ }
193
+ function mouseenter_controller(e){
194
+ EVENT_CONTROLLER.call(
195
+ this,
196
+ e,
197
+ "enter",
198
+ null,
199
+ null
200
+ )
201
+ }
202
+ function mouseleave_controller(e){
203
+ EVENT_CONTROLLER.call(
204
+ this,
205
+ e,
206
+ "leave",
207
+ null,
208
+ null
209
+ )
210
+ }
211
+ function mouseout_controller(e){
212
+ EVENT_CONTROLLER.call(
213
+ this,
214
+ e,
215
+ "out",
216
+ null,
217
+ null
218
+ )
219
+ }
220
+ function mouseover_controller(e){
221
+ EVENT_CONTROLLER.call(
222
+ this,
223
+ e,
224
+ "out",
225
+ null,
226
+ null
227
+ )
228
+ }
229
+ const Mouse=target=>new ZikoEventMouse(target);
230
+ export default Mouse;
@@ -0,0 +1,44 @@
1
+ import { ZikoEvent , EVENT_CONTROLLER } from "../ZikoEvent.js";
2
+ function wheel_controller(e){
3
+ EVENT_CONTROLLER.call(this,e,"wheel",null,null)
4
+ }
5
+ class ZikoEventWheel extends ZikoEvent{
6
+ constructor(target){
7
+ super(target);
8
+ this.event=null;
9
+ this.cache={
10
+ prefixe:"",
11
+ preventDefault:{
12
+ wheel:false,
13
+ },
14
+ paused:{
15
+ wheel:false,
16
+ },
17
+ stream:{
18
+ enabled:{
19
+ wheel:false,
20
+
21
+ },
22
+ clear:{
23
+ wheel:false,
24
+
25
+ },
26
+ history:{
27
+ wheel:[],
28
+ }
29
+ },
30
+ callbacks:{
31
+ click:[],
32
+ }
33
+ }
34
+ this.__controller={
35
+ wheel:wheel_controller.bind(this),
36
+ }
37
+ }
38
+ onWheel(...callbacks){
39
+ this.__onEvent("wheel",{},...callbacks)
40
+ return this;
41
+ }
42
+ }
43
+ const Wheel=Target=>new ZikoEventWheel(Target);
44
+ export default Wheel
@@ -0,0 +1,44 @@
1
+ import { ZikoEvent , EVENT_CONTROLLER } from "../ZikoEvent.js";
2
+ function hashchange_controller(e){
3
+ EVENT_CONTROLLER.call(this,e,"hashchange",null,null)
4
+ }
5
+ class ZikoEventHash extends ZikoEvent{
6
+ constructor(target){
7
+ super(target);
8
+ this.event=null;
9
+ this.cache={
10
+ prefixe:"",
11
+ preventDefault:{
12
+ hashchange:false,
13
+ },
14
+ paused:{
15
+ hashchange:false,
16
+ },
17
+ stream:{
18
+ enabled:{
19
+ hashchange:false,
20
+
21
+ },
22
+ clear:{
23
+ hashchange:false,
24
+
25
+ },
26
+ history:{
27
+ hashchange:[],
28
+ }
29
+ },
30
+ callbacks:{
31
+ hashchange:[],
32
+ }
33
+ }
34
+ this.__controller={
35
+ hashchange:hashchange_controller.bind(this),
36
+ }
37
+ }
38
+ onChange(...callbacks){
39
+ this.__onEvent("hashchange",{},...callbacks)
40
+ return this;
41
+ }
42
+ }
43
+ const HashEvent=Target=>new ZikoEventHash(Target);
44
+ export default HashEvent
@@ -0,0 +1 @@
1
+ // Timeupdate
@@ -1,13 +1,18 @@
1
1
  import Pointer from "./Global/Pointer.js";
2
+ import Mouse from "./Global/Mouse.js";
3
+ import Wheel from "./Global/Wheel.js";
2
4
  import Key from "./Global/Key.js";
3
5
  import {Drag,Drop} from "./Global/Drag.js";
4
6
  import Click from "./Global/Click.js";
5
7
  import Clipboard from "./Global/Clipboard.js";
6
8
  import Focus from "./Global/Focus.js";
7
9
  import Input from "./Partiel/Input.js";
8
- import CustomEvent from "./Global/CustomEvent.js";
10
+ import HashEvent from "./Partiel/Hash.js";
11
+ import customEvent from "./Global/CustomEvent.js";
9
12
  const Events={
10
13
  Pointer,
14
+ Mouse,
15
+ Wheel,
11
16
  Key,
12
17
  Drag,
13
18
  Drop,
@@ -15,7 +20,8 @@ const Events={
15
20
  Clipboard,
16
21
  Focus,
17
22
  Input,
18
- CustomEvent,
23
+ HashEvent,
24
+ customEvent,
19
25
  ExtractAll: function () {
20
26
  const keys = Object.keys(this);
21
27
  for (let i = 0; i < keys.length; i++) {
@@ -39,6 +45,8 @@ const Events={
39
45
  }
40
46
  export {
41
47
  Pointer,
48
+ Mouse,
49
+ Wheel,
42
50
  Key,
43
51
  Drag,
44
52
  Drop,
@@ -46,6 +54,7 @@ export {
46
54
  Clipboard,
47
55
  Focus,
48
56
  Input,
49
- CustomEvent
57
+ HashEvent,
58
+ customEvent
50
59
  }
51
60
  export default Events
@@ -1,10 +1,10 @@
1
1
  import ZikoUIElement from "../../../ZikoUIElement";
2
2
  import { ZikoUIFlex } from "../../Flex";
3
- import { ZikoHtml } from "../../../Misc";
3
+ import { html } from "../../../Misc";
4
4
  class ZikoUIAccordion extends ZikoUIElement{
5
5
  constructor(summary,content,icon="😁"){
6
6
  super("details","Accordion")
7
- this.summary=ZikoHtml("summary",summary).style({
7
+ this.summary=html("summary",summary).style({
8
8
  fontSize:"1.1em",
9
9
  padding:"0.625rem",
10
10
  fontWeight:"bold",
@@ -142,7 +142,7 @@ class ZikoUICodeCell extends ZikoUIFlex{
142
142
 
143
143
  }
144
144
  evaluate(order){
145
- globalThis.__Target__=this.Output.element;
145
+ globalThis.__ZikoConfig__.default.target=this.Output.element;
146
146
  switch(this.cache.type){
147
147
  case "js":this.#evaluateJs(order);break;
148
148
  }
@@ -1,8 +1,8 @@
1
- import { ZikoHtml } from "../../../Misc";
1
+ import { html } from "../../../Misc";
2
2
  import { Flex } from "../../Flex";
3
3
  import { text } from "../../../Text";
4
4
  import { ZikoUICodeNote } from "./CodeNote";
5
- const Input=(codeText="")=>ZikoHtml("code",codeText).style({
5
+ const Input=(codeText="")=>html("code",codeText).style({
6
6
  width:"100%",
7
7
  height:"auto",
8
8
  padding:"10px",
@@ -16,7 +16,7 @@ const Input=(codeText="")=>ZikoHtml("code",codeText).style({
16
16
  background:"#f6f8fa",
17
17
  color:"#0062C3"
18
18
  }).setAttr("contenteditable",true).setAttr("spellcheck",false);
19
- const Output=()=>ZikoHtml("output").style({
19
+ const Output=()=>html("output").style({
20
20
  width:"100%",
21
21
  height:"auto",
22
22
  padding:"5px 0",
@@ -43,7 +43,7 @@ const Right=(ctx)=>Flex(
43
43
  text('▶️').style(BTN_STYLE).onClick(e=>{
44
44
  if(ctx.parent instanceof ZikoUICodeNote)ctx.parent.setCurrentNote(ctx);
45
45
  ctx.execute();
46
- globalThis.__Target__=e.target.parent.parent[1][1];
46
+ globalThis.__ZikoConfig__.default.target=e.target.parent.parent[1][1];
47
47
  }),
48
48
  text('📋').style(BTN_STYLE).onClick(()=>{
49
49
  navigator.clipboard.writeText(ctx.codeText)
@@ -1,27 +1,7 @@
1
1
  import ZikoUIElement from "../ZikoUIElement.js"
2
- function set_vertical(direction){
3
- direction == 1
4
- ? this.style({ flexDirection: "column" })
5
- : direction == -1 && this.style({ flexDirection: "column-reverse" });
6
- return this;
7
- }
8
- function set_horizontal(direction){
9
- direction == 1
10
- ? this.style({ flexDirection: "row" })
11
- : direction == -1 && this.style({ flexDirection: "row-reverse" });
12
- return this;
13
- }
14
- function map_pos_x(align){
15
- let pos = ["flex-start", "center", "flex-end"];
16
- if (typeof align === "number") align = pos[align + 1];
17
- return align;
18
- }
19
- function map_pos_y(align){
20
- return map_pos_x(-align);
21
- }
22
2
  class ZikoUIFlex extends ZikoUIElement {
23
- constructor(tag , w = "100%", h = "100%") {
24
- super(tag,"Flex");
3
+ constructor(tag = "div", w = "100%", h = "100%") {
4
+ super(tag ,"Flex");
25
5
  this.direction = "cols";
26
6
  if (typeof w == "number") w += "%";
27
7
  if (typeof h == "number") h += "%";
@@ -94,4 +74,24 @@ const Flex = (...ZikoUIElement) =>{
94
74
  }
95
75
  return new ZikoUIFlex(tag).append(...ZikoUIElement);
96
76
  }
77
+ function set_vertical(direction){
78
+ direction == 1
79
+ ? this.style({ flexDirection: "column" })
80
+ : direction == -1 && this.style({ flexDirection: "column-reverse" });
81
+ return this;
82
+ }
83
+ function set_horizontal(direction){
84
+ direction == 1
85
+ ? this.style({ flexDirection: "row" })
86
+ : direction == -1 && this.style({ flexDirection: "row-reverse" });
87
+ return this;
88
+ }
89
+ function map_pos_x(align){
90
+ let pos = ["flex-start", "center", "flex-end"];
91
+ if (typeof align === "number") align = pos[align + 1];
92
+ return align;
93
+ }
94
+ function map_pos_y(align){
95
+ return map_pos_x(-align);
96
+ }
97
97
  export{Flex,ZikoUIFlex}
@@ -1,10 +1,9 @@
1
1
  import ZikoUIElement from "../../ZikoUIElement.js";
2
2
  class ZikoUIBtn extends ZikoUIElement {
3
3
  constructor(value = "button") {
4
- super();
4
+ super("button","btn");
5
5
  this.element = document.createElement("button");
6
6
  this.setValue(value);
7
- this.render();
8
7
  this.st.cursor("pointer");
9
8
  }
10
9
  setValue(value) {