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/dist/ziko.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Sun Mar 10 2024 11:12:39 GMT+0000 (UTC)
5
+ Date : Thu Mar 21 2024 19:27:32 GMT+0000 (UTC)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
@@ -3384,6 +3384,332 @@ class ZikoEventPointer extends ZikoEvent {
3384
3384
  }
3385
3385
  var Pointer = target => new ZikoEventPointer(target);
3386
3386
 
3387
+ class ZikoEventMouse extends ZikoEvent {
3388
+ constructor(target) {
3389
+ super(target);
3390
+ this.event = null;
3391
+ this.dx = 0;
3392
+ this.dy = 0;
3393
+ this.dt = 0;
3394
+ this.mx = 0;
3395
+ this.my = 0;
3396
+ this.mt = 0;
3397
+ this.ux = 0;
3398
+ this.uy = 0;
3399
+ this.ut = 0;
3400
+ this.swippe = {
3401
+ h: null,
3402
+ v: null,
3403
+ delta_x: 0,
3404
+ delta_y: 0
3405
+ };
3406
+ this.isMoving = false;
3407
+ this.isDown = false;
3408
+ this.cache = {
3409
+ prefixe: "mouse",
3410
+ preventDefault: {
3411
+ down: false,
3412
+ move: false,
3413
+ up: false,
3414
+ enter: false,
3415
+ out: false,
3416
+ leave: false,
3417
+ over: false
3418
+ },
3419
+ paused: {
3420
+ down: false,
3421
+ move: false,
3422
+ up: false,
3423
+ enter: false,
3424
+ out: false,
3425
+ leave: false,
3426
+ over: false
3427
+ },
3428
+ stream: {
3429
+ enabled: {
3430
+ down: false,
3431
+ move: false,
3432
+ up: false,
3433
+ enter: false,
3434
+ out: false,
3435
+ leave: false,
3436
+ over: false
3437
+ },
3438
+ clear: {
3439
+ down: false,
3440
+ move: false,
3441
+ up: false,
3442
+ enter: false,
3443
+ out: false,
3444
+ leave: false,
3445
+ over: false
3446
+ },
3447
+ history: {
3448
+ down: [],
3449
+ move: [],
3450
+ up: [],
3451
+ enter: [],
3452
+ out: [],
3453
+ leave: [],
3454
+ over: []
3455
+ }
3456
+ },
3457
+ callbacks: {
3458
+ down: [self => console.log({
3459
+ dx: self.dx,
3460
+ dy: self.dy,
3461
+ down: self.down,
3462
+ move: self.move,
3463
+ t: self.dt
3464
+ })],
3465
+ move: [self => console.log({
3466
+ mx: self.mx,
3467
+ my: self.my,
3468
+ down: self.down,
3469
+ move: self.move,
3470
+ t: self.dt
3471
+ })],
3472
+ up: [self => console.log({
3473
+ ux: self.ux,
3474
+ uy: self.uy,
3475
+ down: self.down,
3476
+ move: self.move,
3477
+ t: self.dt
3478
+ })],
3479
+ enter: [self => console.log({
3480
+ dx: self.dx,
3481
+ dy: self.dy,
3482
+ down: self.down,
3483
+ move: self.move,
3484
+ t: self.dt
3485
+ })],
3486
+ out: [self => console.log({
3487
+ mx: self.mx,
3488
+ my: self.my,
3489
+ down: self.down,
3490
+ move: self.move,
3491
+ t: self.dt
3492
+ })],
3493
+ leave: [self => console.log({
3494
+ ux: self.ux,
3495
+ uy: self.uy,
3496
+ down: self.down,
3497
+ move: self.move,
3498
+ t: self.dt
3499
+ })],
3500
+ over: [self => console.log({
3501
+ ux: self.ux,
3502
+ uy: self.uy,
3503
+ down: self.down,
3504
+ move: self.move,
3505
+ t: self.dt
3506
+ })]
3507
+ }
3508
+ };
3509
+ this.__controller = {
3510
+ down: mousedown_controller.bind(this),
3511
+ move: mousemove_controller.bind(this),
3512
+ up: mouseup_controller.bind(this),
3513
+ enter: mouseenter_controller.bind(this),
3514
+ out: mouseout_controller.bind(this),
3515
+ leave: mouseleave_controller.bind(this),
3516
+ over: mouseover_controller.bind(this)
3517
+ };
3518
+ }
3519
+ onDown(...callbacks) {
3520
+ if (callbacks.length === 0) callbacks = [() => {}];
3521
+ this.__onEvent("down", {
3522
+ down: true,
3523
+ move: false,
3524
+ up: false,
3525
+ enter: false,
3526
+ out: false,
3527
+ leave: false,
3528
+ over: false
3529
+ }, ...callbacks);
3530
+ return this;
3531
+ }
3532
+ onMove(...callbacks) {
3533
+ if (callbacks.length === 0) callbacks = [() => {}];
3534
+ this.__onEvent("move", {
3535
+ down: false,
3536
+ move: true,
3537
+ up: false,
3538
+ enter: false,
3539
+ out: false,
3540
+ leave: false,
3541
+ over: false
3542
+ }, ...callbacks);
3543
+ return this;
3544
+ }
3545
+ onUp(...callbacks) {
3546
+ if (callbacks.length === 0) callbacks = [() => {}];
3547
+ this.__onEvent("up", {
3548
+ down: false,
3549
+ move: false,
3550
+ up: true,
3551
+ enter: false,
3552
+ out: false,
3553
+ leave: false,
3554
+ over: false
3555
+ }, ...callbacks);
3556
+ return this;
3557
+ }
3558
+ onEnter(...callbacks) {
3559
+ if (callbacks.length === 0) callbacks = [() => {}];
3560
+ this.__onEvent("enter", {
3561
+ down: false,
3562
+ move: false,
3563
+ up: false,
3564
+ enter: true,
3565
+ out: false,
3566
+ leave: false,
3567
+ over: false
3568
+ }, ...callbacks);
3569
+ return this;
3570
+ }
3571
+ onOut(...callbacks) {
3572
+ if (callbacks.length === 0) callbacks = [() => {}];
3573
+ this.__onEvent("out", {
3574
+ down: false,
3575
+ move: false,
3576
+ up: false,
3577
+ enter: false,
3578
+ out: true,
3579
+ leave: false,
3580
+ over: false
3581
+ }, ...callbacks);
3582
+ return this;
3583
+ }
3584
+ onLeave(...callbacks) {
3585
+ if (callbacks.length === 0) callbacks = [() => {}];
3586
+ this.__onEvent("leave", {
3587
+ down: false,
3588
+ move: false,
3589
+ up: false,
3590
+ enter: false,
3591
+ out: false,
3592
+ leave: true,
3593
+ over: false
3594
+ }, ...callbacks);
3595
+ return this;
3596
+ }
3597
+ onOver(...callbacks) {
3598
+ if (callbacks.length === 0) callbacks = [() => {}];
3599
+ this.__onEvent("over", {
3600
+ down: false,
3601
+ move: false,
3602
+ up: false,
3603
+ enter: false,
3604
+ out: false,
3605
+ leave: false,
3606
+ over: true
3607
+ }, ...callbacks);
3608
+ return this;
3609
+ }
3610
+ }
3611
+ function mousedown_controller(e) {
3612
+ EVENT_CONTROLLER.call(this, e, "down", () => {
3613
+ this.dx = parseInt(e.offsetX);
3614
+ this.dy = parseInt(e.offsetY);
3615
+ this.isDown = true;
3616
+ }, {
3617
+ x: this.dx,
3618
+ y: this.dy,
3619
+ t: Date.now() - this.cache.stream.t0
3620
+ });
3621
+ }
3622
+ function mousemove_controller(e) {
3623
+ EVENT_CONTROLLER.call(this, e, "move", () => {
3624
+ this.mx = parseInt(e.offsetX);
3625
+ this.my = parseInt(e.offsetY);
3626
+ this.isMoving = true;
3627
+ }, {
3628
+ x: this.mx,
3629
+ y: this.my,
3630
+ t: Date.now() - this.cache.stream.t0
3631
+ });
3632
+ }
3633
+ function mouseup_controller(e) {
3634
+ EVENT_CONTROLLER.call(this, e, "up", () => {
3635
+ this.ux = parseInt(e.offsetX);
3636
+ this.uy = parseInt(e.offsetY);
3637
+ this.isDown = false;
3638
+ const dx = this.dx;
3639
+ const dy = this.dy;
3640
+ const ux = this.ux;
3641
+ const uy = this.uy;
3642
+ const delta_x = (ux - dx) / this.target.Width;
3643
+ const delta_y = (dy - uy) / this.target.Height;
3644
+ const HORIZONTAL_SWIPPE = delta_x < 0 ? "left" : delta_x > 0 ? "right" : "none";
3645
+ const VERTICAL_SWIPPE = delta_y < 0 ? "bottom" : delta_y > 0 ? "top" : "none";
3646
+ this.swippe = {
3647
+ h: HORIZONTAL_SWIPPE,
3648
+ v: VERTICAL_SWIPPE,
3649
+ delta_x,
3650
+ delta_y
3651
+ };
3652
+ }, {
3653
+ x: this.ux,
3654
+ y: this.uy,
3655
+ t: Date.now() - this.cache.stream.t0
3656
+ });
3657
+ }
3658
+ function mouseenter_controller(e) {
3659
+ EVENT_CONTROLLER.call(this, e, "enter", null, null);
3660
+ }
3661
+ function mouseleave_controller(e) {
3662
+ EVENT_CONTROLLER.call(this, e, "leave", null, null);
3663
+ }
3664
+ function mouseout_controller(e) {
3665
+ EVENT_CONTROLLER.call(this, e, "out", null, null);
3666
+ }
3667
+ function mouseover_controller(e) {
3668
+ EVENT_CONTROLLER.call(this, e, "out", null, null);
3669
+ }
3670
+ const Mouse = target => new ZikoEventMouse(target);
3671
+
3672
+ function wheel_controller(e) {
3673
+ EVENT_CONTROLLER.call(this, e, "wheel", null, null);
3674
+ }
3675
+ class ZikoEventWheel extends ZikoEvent {
3676
+ constructor(target) {
3677
+ super(target);
3678
+ this.event = null;
3679
+ this.cache = {
3680
+ prefixe: "",
3681
+ preventDefault: {
3682
+ wheel: false
3683
+ },
3684
+ paused: {
3685
+ wheel: false
3686
+ },
3687
+ stream: {
3688
+ enabled: {
3689
+ wheel: false
3690
+ },
3691
+ clear: {
3692
+ wheel: false
3693
+ },
3694
+ history: {
3695
+ wheel: []
3696
+ }
3697
+ },
3698
+ callbacks: {
3699
+ click: []
3700
+ }
3701
+ };
3702
+ this.__controller = {
3703
+ wheel: wheel_controller.bind(this)
3704
+ };
3705
+ }
3706
+ onWheel(...callbacks) {
3707
+ this.__onEvent("wheel", {}, ...callbacks);
3708
+ return this;
3709
+ }
3710
+ }
3711
+ const Wheel = Target => new ZikoEventWheel(Target);
3712
+
3387
3713
  function keydown_controller(e) {
3388
3714
  EVENT_CONTROLLER.call(this, e, "down", () => this.kd = e.key, {
3389
3715
  key: e.key,
@@ -3874,53 +4200,53 @@ class ZikoEventInput extends ZikoEvent {
3874
4200
  }
3875
4201
  const Input$1 = Target => new ZikoEventInput(Target);
3876
4202
 
3877
- const custom_event_controller = event_name => function (e) {
3878
- EVENT_CONTROLLER.call(this, e, event_name, null, null);
3879
- };
3880
- class ZikoCustomEvent extends ZikoEvent {
4203
+ function hashchange_controller(e) {
4204
+ EVENT_CONTROLLER.call(this, e, "hashchange", null, null);
4205
+ }
4206
+ class ZikoEventHash extends ZikoEvent {
3881
4207
  constructor(target) {
3882
4208
  super(target);
3883
4209
  this.event = null;
3884
4210
  this.cache = {
3885
4211
  prefixe: "",
3886
- preventDefault: {},
3887
- paused: {},
4212
+ preventDefault: {
4213
+ hashchange: false
4214
+ },
4215
+ paused: {
4216
+ hashchange: false
4217
+ },
3888
4218
  stream: {
3889
- enabled: {},
3890
- clear: {},
3891
- history: {}
4219
+ enabled: {
4220
+ hashchange: false
4221
+ },
4222
+ clear: {
4223
+ hashchange: false
4224
+ },
4225
+ history: {
4226
+ hashchange: []
4227
+ }
3892
4228
  },
3893
- callbacks: {}
4229
+ callbacks: {
4230
+ hashchange: []
4231
+ }
4232
+ };
4233
+ this.__controller = {
4234
+ hashchange: hashchange_controller.bind(this)
3894
4235
  };
3895
- this.__controller = {};
3896
- }
3897
- #init(event_name) {
3898
- this.cache.preventDefault[event_name] = false;
3899
- this.cache.paused[event_name] = false;
3900
- this.cache.stream.enabled = false;
3901
- this.cache.stream.clear = false;
3902
- this.cache.stream.history = [];
3903
- this.cache.callbacks[event_name] = [];
3904
- this.__controller[event_name] = custom_event_controller(event_name).bind(this);
3905
- return this;
3906
- }
3907
- on(event_name, ...callbacks) {
3908
- if (!this.__controller[event_name]) this.#init(event_name);
3909
- this.__onEvent(event_name, {}, ...callbacks);
3910
- return this;
3911
4236
  }
3912
- emit(event_name, detail = {}) {
3913
- if (!this.__controller[event_name]) this.#init(event_name);
3914
- this.detail = detail;
3915
- const event = new Event(event_name);
3916
- this.targetElement.dispatchEvent(event);
4237
+ onChange(...callbacks) {
4238
+ this.__onEvent("hashchange", {}, ...callbacks);
3917
4239
  return this;
3918
4240
  }
3919
4241
  }
3920
- const CustomEvent = Target => new ZikoCustomEvent(Target);
4242
+ const HashEvent = Target => new ZikoEventHash(Target);
4243
+
4244
+ const customEvent = Target => new customEvent();
3921
4245
 
3922
4246
  const Events = {
3923
4247
  Pointer,
4248
+ Mouse,
4249
+ Wheel,
3924
4250
  Key,
3925
4251
  Drag,
3926
4252
  Drop,
@@ -3928,7 +4254,8 @@ const Events = {
3928
4254
  Clipboard,
3929
4255
  Focus,
3930
4256
  Input: Input$1,
3931
- CustomEvent,
4257
+ HashEvent,
4258
+ customEvent,
3932
4259
  ExtractAll: function () {
3933
4260
  const keys = Object.keys(this);
3934
4261
  for (let i = 0; i < keys.length; i++) {
@@ -6105,7 +6432,8 @@ const Use = {
6105
6432
 
6106
6433
  class ZikoUIElement {
6107
6434
  constructor(element, name = "") {
6108
- this.target = globalThis.__Target__ || globalThis.document.body;
6435
+ //this.target = globalThis.__Target__||globalThis.document.body;
6436
+ this.target = globalThis.__ZikoConfig__.default.target || globalThis.document.body;
6109
6437
  if (typeof element === "string") element = globalThis.document.createElement(element);
6110
6438
  this.element = element;
6111
6439
  this.uuid = this.constructor.name + "-" + Random.string(10);
@@ -6115,18 +6443,16 @@ class ZikoUIElement {
6115
6443
  isRoot: false,
6116
6444
  isHidden: false,
6117
6445
  isFrozzen: false,
6118
- // transformMatrix:matrix([
6119
- // [0,0,0],
6120
- // [0,0,0],
6121
- // [1,1,0]
6122
- // ]),
6123
6446
  style: ZikoStyle({}),
6124
6447
  attributes: {},
6125
- filters: {}
6448
+ filters: {},
6449
+ temp: {}
6126
6450
  };
6127
6451
  this.items = [];
6128
6452
  this.events = {
6129
6453
  ptr: null,
6454
+ mouse: null,
6455
+ Wheel: null,
6130
6456
  key: null,
6131
6457
  drag: null,
6132
6458
  drop: null,
@@ -6149,6 +6475,7 @@ class ZikoUIElement {
6149
6475
  });
6150
6476
  this.size("auto", "auto");
6151
6477
  globalThis.__UI__[this.cache.name]?.push(this);
6478
+ this.render(globalThis.__ZikoConfig__.default.render);
6152
6479
  }
6153
6480
  get st() {
6154
6481
  return this.cache.style;
@@ -6171,7 +6498,7 @@ class ZikoUIElement {
6171
6498
  root = root.parent;
6172
6499
  }
6173
6500
  }
6174
- clone() {
6501
+ clone(render = false) {
6175
6502
  // Not working For Table
6176
6503
  const UI = new this.constructor();
6177
6504
  UI.__proto__ = this.__proto__;
@@ -6179,7 +6506,7 @@ class ZikoUIElement {
6179
6506
  const items = [...this.items].map(n => n.clone());
6180
6507
  UI.append(...items);
6181
6508
  } else UI.element = this.element.cloneNode(true);
6182
- return UI;
6509
+ return UI.render(render);
6183
6510
  }
6184
6511
  style(styles, {
6185
6512
  target = "parent",
@@ -6355,10 +6682,13 @@ class ZikoUIElement {
6355
6682
  this.items.forEach(callback);
6356
6683
  return this;
6357
6684
  }
6358
- filter(condition_callback, if_callback, else_callback) {
6685
+ where(condition_callback, if_callback, else_callback) {
6359
6686
  this.items.filter(condition_callback).forEach(if_callback);
6360
6687
  return this;
6361
6688
  }
6689
+ filter(condition) {
6690
+ return this.items.filter(condition);
6691
+ }
6362
6692
  filterByTextContent(text, exactMatch = false) {
6363
6693
  this.items.map(n => n.render());
6364
6694
  this.items.filter(n => {
@@ -6412,6 +6742,41 @@ class ZikoUIElement {
6412
6742
  this.events.ptr.onOut(...callbacks);
6413
6743
  return this;
6414
6744
  }
6745
+ onMouseMove(...callbacks) {
6746
+ if (!this.events.mouse) this.events.mouse = Mouse(this);
6747
+ this.events.mouse.onMove(...callbacks);
6748
+ return this;
6749
+ }
6750
+ onMouseDown(...callbacks) {
6751
+ if (!this.events.mouse) this.events.mouse = Mouse(this);
6752
+ this.events.mouse.onDown(...callbacks);
6753
+ return this;
6754
+ }
6755
+ onMouseUp(...callbacks) {
6756
+ if (!this.events.mouse) this.events.mouse = Mouse(this);
6757
+ this.events.mouse.onUp(...callbacks);
6758
+ return this;
6759
+ }
6760
+ onMouseEnter(...callbacks) {
6761
+ if (!this.events.mouse) this.events.mouse = Mouse(this);
6762
+ this.events.mouse.onEnter(...callbacks);
6763
+ return this;
6764
+ }
6765
+ onMouseLeave(...callbacks) {
6766
+ if (!this.events.mouse) this.events.mouse = Mouse(this);
6767
+ this.events.mouse.onLeave(...callbacks);
6768
+ return this;
6769
+ }
6770
+ onMouseOut(...callbacks) {
6771
+ if (!this.events.mouse) this.events.mouse = Mouse(this);
6772
+ this.events.mouse.onOut(...callbacks);
6773
+ return this;
6774
+ }
6775
+ onWheel(...callbacks) {
6776
+ if (!this.events.wheel) this.events.wheel = Wheel(this);
6777
+ this.events.wheel.onWheel(...callbacks);
6778
+ return this;
6779
+ }
6415
6780
  onKeyDown(...callbacks) {
6416
6781
  if (!this.events.key) this.events.key = Key(this);
6417
6782
  this.events.key.onDown(...callbacks);
@@ -6499,12 +6864,12 @@ class ZikoUIElement {
6499
6864
  return this;
6500
6865
  }
6501
6866
  on(event_name, ...callbacks) {
6502
- if (!this.events.custom) this.events.custom = CustomEvent(this);
6867
+ if (!this.events.custom) this.events.custom = customEvent();
6503
6868
  this.events.custom.on(event_name, ...callbacks);
6504
6869
  return this;
6505
6870
  }
6506
6871
  emit(event_name, detail = {}) {
6507
- if (!this.events.custom) this.events.custom = CustomEvent(this);
6872
+ if (!this.events.custom) this.events.custom = customEvent();
6508
6873
  this.events.custom.emit(event_name, detail);
6509
6874
  return this;
6510
6875
  }
@@ -6537,18 +6902,6 @@ class ZikoUIElement {
6537
6902
  isVisible: topVisible || bottomVisible || rightVisible || leftVisible
6538
6903
  };
6539
6904
  }
6540
-
6541
- // toggleSlide() {}
6542
-
6543
- // Glassmorphism(background = "rgba(255,255,255,0.1)", blur = "1px") {
6544
- // this.style({ background: background, backdropFilter: blur });
6545
- // return this;
6546
- // }
6547
- // Neumorphism(r = "50px", bg = "cyan", box = "13px -13px 49px #5d8fac") {
6548
- // this.style({ borderRadius: r, background: bg, boxShadow: box });
6549
- // return this;
6550
- // }
6551
-
6552
6905
  setFullScreen(set = true, e) {
6553
6906
  if (!this.element.requestFullscreen) {
6554
6907
  console.error("Fullscreen API is not supported in this browser.");
@@ -6608,7 +6961,6 @@ class ZikoUIText extends ZikoUIElement {
6608
6961
  this.text = "";
6609
6962
  this.addValue(...value);
6610
6963
  this.st.display("inline-block");
6611
- this.render();
6612
6964
  }
6613
6965
  clear() {
6614
6966
  this.element.textContent = "";
@@ -6665,7 +7017,6 @@ class ZikoUIParagraphe extends ZikoUIElement {
6665
7017
  margin: 0,
6666
7018
  padding: 0
6667
7019
  });
6668
- this.render();
6669
7020
  }
6670
7021
  addValue(...value) {
6671
7022
  for (let i = 0; i < value.length; i++) {
@@ -6693,7 +7044,6 @@ class ZikoUIHeading extends ZikoUIElement {
6693
7044
  super(`h${type}`, `h${type}`);
6694
7045
  this.element = document.createElement("h" + type);
6695
7046
  this.element.textContent = value;
6696
- this.render();
6697
7047
  }
6698
7048
  get value() {
6699
7049
  return this.element.innerText;
@@ -6716,21 +7066,18 @@ const h6 = (text = "") => new ZikoUIHeading(6, text);
6716
7066
 
6717
7067
  class ZikoUIHtmlTag extends ZikoUIElement {
6718
7068
  constructor(element) {
6719
- super(element, "ZikoHtml");
6720
- this.render();
7069
+ super(element, "html");
6721
7070
  }
6722
7071
  }
6723
7072
  class ZikoUIBr extends ZikoUIElement {
6724
7073
  constructor() {
6725
7074
  super("br", "br");
6726
- this.render();
6727
7075
  delete this.append;
6728
7076
  }
6729
7077
  }
6730
7078
  class ZikoUIHr extends ZikoUIElement {
6731
7079
  constructor() {
6732
7080
  super("hr", "hr");
6733
- this.render();
6734
7081
  delete this.append;
6735
7082
  }
6736
7083
  }
@@ -6738,7 +7085,6 @@ class ZikoUILink extends ZikoUIElement {
6738
7085
  constructor(href) {
6739
7086
  super("a", "link");
6740
7087
  this.setHref(href);
6741
- this.render();
6742
7088
  }
6743
7089
  setHref(href) {
6744
7090
  this.element.href = href;
@@ -6749,14 +7095,13 @@ const hr = () => new ZikoUIHr();
6749
7095
  const brs = (n = 1) => new Array(n).fill(new ZikoUIBr());
6750
7096
  const hrs = (n = 1) => new Array(n).fill(new ZikoUIHr());
6751
7097
  const link = (href, ...UIElement) => new ZikoUILink(href).append(...UIElement);
6752
- const ZikoHtml = (tag, ...UIElement) => new ZikoUIHtmlTag(tag).append(...UIElement);
7098
+ const html = (tag, ...UIElement) => new ZikoUIHtmlTag(tag).append(...UIElement);
6753
7099
 
6754
7100
  class ZikoUILI extends ZikoUIElement {
6755
7101
  constructor(UI) {
6756
7102
  super();
6757
7103
  this.element = document.createElement("li");
6758
7104
  this.append(UI);
6759
- this.render();
6760
7105
  }
6761
7106
  }
6762
7107
  class ZikoUIList extends ZikoUIElement {
@@ -6840,7 +7185,6 @@ class ZikoUIOList extends ZikoUIList {
6840
7185
  constructor(...arr) {
6841
7186
  super("ol", "ol");
6842
7187
  this.append(...arr);
6843
- this.render();
6844
7188
  }
6845
7189
  type(tp = 1) {
6846
7190
  this.element.setAttribute("type", tp);
@@ -6855,7 +7199,6 @@ class ZikoUIUList extends ZikoUIList {
6855
7199
  constructor(...arr) {
6856
7200
  super("ul", "ul");
6857
7201
  this.append(...arr);
6858
- this.render();
6859
7202
  }
6860
7203
  }
6861
7204
  const li = UI => new ZikoUILI(UI);
@@ -6864,10 +7207,9 @@ const ul = (...arr) => new ZikoUIUList(...arr);
6864
7207
 
6865
7208
  class ZikoUIBtn extends ZikoUIElement {
6866
7209
  constructor(value = "button") {
6867
- super();
7210
+ super("button", "btn");
6868
7211
  this.element = document.createElement("button");
6869
7212
  this.setValue(value);
6870
- this.render();
6871
7213
  this.st.cursor("pointer");
6872
7214
  }
6873
7215
  setValue(value) {
@@ -6913,7 +7255,6 @@ class ZikoUITextArea extends ZikoUIElement {
6913
7255
  super();
6914
7256
  this.element = document.createElement("textarea");
6915
7257
  //Object.assign(this,inputComposer.call(this));
6916
- this.render();
6917
7258
  }
6918
7259
  get value() {
6919
7260
  return this.element.textContent;
@@ -6933,7 +7274,6 @@ class ZikoUIInput extends ZikoUIElement {
6933
7274
  });
6934
7275
  this.setValue(value);
6935
7276
  if (datalist) this.linkDatalist(datalist);
6936
- this.render();
6937
7277
  }
6938
7278
  onInput(...callbacks) {
6939
7279
  if (!this.events.input) this.events.input = Input$1(this);
@@ -7042,7 +7382,6 @@ class ZikoUIInputNumber extends ZikoUIInput {
7042
7382
  super();
7043
7383
  this._setType("number");
7044
7384
  this.setMin(min).setMax(max).setStep(step);
7045
- this.render();
7046
7385
  }
7047
7386
  get value() {
7048
7387
  return +this.element.value;
@@ -7065,7 +7404,6 @@ class ZikoUIInputSlider extends ZikoUIInputNumber {
7065
7404
  super();
7066
7405
  this._setType("range");
7067
7406
  this.setMin(min).setMax(max).setValue(val).setStep(step);
7068
- this.render();
7069
7407
  }
7070
7408
  }
7071
7409
  class ZikoUIInputColor extends ZikoUIInput {
@@ -7073,7 +7411,6 @@ class ZikoUIInputColor extends ZikoUIInput {
7073
7411
  super();
7074
7412
  this._setType("color");
7075
7413
  this.background(this.value);
7076
- this.render();
7077
7414
  this.onInput(() => this.background(this.value));
7078
7415
  }
7079
7416
  }
@@ -7081,35 +7418,30 @@ class ZikoUIInputPassword extends ZikoUIInput {
7081
7418
  constructor() {
7082
7419
  super();
7083
7420
  this._setType("password");
7084
- this.render();
7085
7421
  }
7086
7422
  }
7087
7423
  class ZikoUIInputEmail extends ZikoUIInput {
7088
7424
  constructor() {
7089
7425
  super();
7090
7426
  this._setType("email");
7091
- this.render();
7092
7427
  }
7093
7428
  }
7094
7429
  class ZikoUIInputTime extends ZikoUIInput {
7095
7430
  constructor() {
7096
7431
  super();
7097
7432
  this._setType("time");
7098
- this.render();
7099
7433
  }
7100
7434
  }
7101
7435
  class ZikoUIInputDate extends ZikoUIInput {
7102
7436
  constructor() {
7103
7437
  super();
7104
7438
  this._setType("date");
7105
- this.render();
7106
7439
  }
7107
7440
  }
7108
7441
  class ZikoUIInputDateTime extends ZikoUIInput {
7109
7442
  constructor() {
7110
7443
  super();
7111
7444
  this._setType("datetime-local");
7112
- this.render();
7113
7445
  }
7114
7446
  }
7115
7447
  class ZikoUIInputCheckbox extends ZikoUIInput {
@@ -7185,7 +7517,6 @@ class ZikoUIInputDatalist extends ZikoUIElement {
7185
7517
  super();
7186
7518
  this.element = document.createElement("datalist");
7187
7519
  this.addOptions(...options).setId("ziko-datalist-id" + Random.string(10));
7188
- this.render();
7189
7520
  }
7190
7521
  addOptions(...options) {
7191
7522
  options.map(n => this.append(new ZikoUIInputOption(n)));
@@ -7244,7 +7575,6 @@ class ZikoUISelect extends ZikoUIElement {
7244
7575
  constructor() {
7245
7576
  super();
7246
7577
  this.element = document.createElement("select");
7247
- this.render();
7248
7578
  }
7249
7579
  addOptions(...options) {
7250
7580
  options.map(n => this.append(new ZikoUIInputOption(n)));
@@ -7265,7 +7595,6 @@ class ZikoUIImage extends ZikoUIElement {
7265
7595
  width: w,
7266
7596
  height: h
7267
7597
  });
7268
- this.render();
7269
7598
  }
7270
7599
  updateSrc(url) {
7271
7600
  this.value = url;
@@ -7293,7 +7622,6 @@ class ZikoUIFigure extends ZikoUIElement {
7293
7622
  this.caption.append(caption.element);
7294
7623
  this.element.append(this.img);
7295
7624
  this.element.append(this.caption);
7296
- this.render();
7297
7625
  }
7298
7626
  }
7299
7627
  const figure = (image, caption) => new ZikoUIFigure(image, caption);
@@ -7308,7 +7636,9 @@ class ZikoUIVideo extends ZikoUIElement {
7308
7636
  width: w,
7309
7637
  height: h
7310
7638
  });
7311
- this.render();
7639
+ }
7640
+ get t() {
7641
+ return this.element.currentTime;
7312
7642
  }
7313
7643
  useControls(enabled = true) {
7314
7644
  this.element.controls = enabled;
@@ -7330,6 +7660,12 @@ class ZikoUIVideo extends ZikoUIElement {
7330
7660
  this.element.requestPictureInPicture(e);
7331
7661
  return this;
7332
7662
  }
7663
+ seekTo(time) {
7664
+ this.element.currentTime = time;
7665
+ return this;
7666
+ }
7667
+ onPlay() {}
7668
+ onPause() {}
7333
7669
  }
7334
7670
  const video = (src, width, height) => new ZikoUIVideo(src, width, height);
7335
7671
 
@@ -7337,8 +7673,10 @@ class ZikoUIAudio extends ZikoUIElement {
7337
7673
  constructor(src) {
7338
7674
  super("audio", "audio");
7339
7675
  this.element.setAttribute("src", src);
7340
- this.render();
7341
- this.controls();
7676
+ this.useControls();
7677
+ }
7678
+ get t() {
7679
+ return this.element.currentTime;
7342
7680
  }
7343
7681
  useControls(enabled = true) {
7344
7682
  this.element.controls = enabled;
@@ -7352,6 +7690,12 @@ class ZikoUIAudio extends ZikoUIElement {
7352
7690
  this.element.pause();
7353
7691
  return this;
7354
7692
  }
7693
+ seekTo(time) {
7694
+ this.element.currentTime = time;
7695
+ return this;
7696
+ }
7697
+ onPlay() {}
7698
+ onPause() {}
7355
7699
  }
7356
7700
  const audio = src => new ZikoUIAudio(src);
7357
7701
 
@@ -7382,32 +7726,8 @@ class ZikoUIWebcame extends ZikoUIVideo {
7382
7726
  }
7383
7727
  const inputCamera = () => new ZikoUIWebcame();
7384
7728
 
7385
- function set_vertical(direction) {
7386
- direction == 1 ? this.style({
7387
- flexDirection: "column"
7388
- }) : direction == -1 && this.style({
7389
- flexDirection: "column-reverse"
7390
- });
7391
- return this;
7392
- }
7393
- function set_horizontal(direction) {
7394
- direction == 1 ? this.style({
7395
- flexDirection: "row"
7396
- }) : direction == -1 && this.style({
7397
- flexDirection: "row-reverse"
7398
- });
7399
- return this;
7400
- }
7401
- function map_pos_x(align) {
7402
- let pos = ["flex-start", "center", "flex-end"];
7403
- if (typeof align === "number") align = pos[align + 1];
7404
- return align;
7405
- }
7406
- function map_pos_y(align) {
7407
- return map_pos_x(-align);
7408
- }
7409
7729
  class ZikoUIFlex extends ZikoUIElement {
7410
- constructor(tag, w = "100%", h = "100%") {
7730
+ constructor(tag = "div", w = "100%", h = "100%") {
7411
7731
  super(tag, "Flex");
7412
7732
  this.direction = "cols";
7413
7733
  if (typeof w == "number") w += "%";
@@ -7497,6 +7817,30 @@ const Flex = (...ZikoUIElement) => {
7497
7817
  }
7498
7818
  return new ZikoUIFlex(tag).append(...ZikoUIElement);
7499
7819
  };
7820
+ function set_vertical(direction) {
7821
+ direction == 1 ? this.style({
7822
+ flexDirection: "column"
7823
+ }) : direction == -1 && this.style({
7824
+ flexDirection: "column-reverse"
7825
+ });
7826
+ return this;
7827
+ }
7828
+ function set_horizontal(direction) {
7829
+ direction == 1 ? this.style({
7830
+ flexDirection: "row"
7831
+ }) : direction == -1 && this.style({
7832
+ flexDirection: "row-reverse"
7833
+ });
7834
+ return this;
7835
+ }
7836
+ function map_pos_x(align) {
7837
+ let pos = ["flex-start", "center", "flex-end"];
7838
+ if (typeof align === "number") align = pos[align + 1];
7839
+ return align;
7840
+ }
7841
+ function map_pos_y(align) {
7842
+ return map_pos_x(-align);
7843
+ }
7500
7844
 
7501
7845
  class ZikoUIGrid extends ZikoUIElement {
7502
7846
  constructor(tag = "div", w = "50vw", h = "50vh") {
@@ -7541,7 +7885,7 @@ const Grid$1 = (...ZikoUIElement) => new ZikoUIGrid("div").append(...ZikoUIEleme
7541
7885
  class ZikoUIAccordion extends ZikoUIElement {
7542
7886
  constructor(summary, content, icon = "😁") {
7543
7887
  super("details", "Accordion");
7544
- this.summary = ZikoHtml("summary", summary).style({
7888
+ this.summary = html("summary", summary).style({
7545
7889
  fontSize: "1.1em",
7546
7890
  padding: "0.625rem",
7547
7891
  fontWeight: "bold",
@@ -7693,7 +8037,7 @@ class ZikoUICodeNote extends ZikoUIFlex {
7693
8037
  }
7694
8038
  const CodeNote = () => new ZikoUICodeNote();
7695
8039
 
7696
- const Input = (codeText = "") => ZikoHtml("code", codeText).style({
8040
+ const Input = (codeText = "") => html("code", codeText).style({
7697
8041
  width: "100%",
7698
8042
  height: "auto",
7699
8043
  padding: "10px",
@@ -7707,7 +8051,7 @@ const Input = (codeText = "") => ZikoHtml("code", codeText).style({
7707
8051
  background: "#f6f8fa",
7708
8052
  color: "#0062C3"
7709
8053
  }).setAttr("contenteditable", true).setAttr("spellcheck", false);
7710
- const Output = () => ZikoHtml("output").style({
8054
+ const Output = () => html("output").style({
7711
8055
  width: "100%",
7712
8056
  height: "auto",
7713
8057
  padding: "5px 0"
@@ -7731,7 +8075,7 @@ const BTN_STYLE = {
7731
8075
  const Right = ctx => Flex(text$1('▶️').style(BTN_STYLE).onClick(e => {
7732
8076
  if (ctx.parent instanceof ZikoUICodeNote) ctx.parent.setCurrentNote(ctx);
7733
8077
  ctx.execute();
7734
- globalThis.__Target__ = e.target.parent.parent[1][1];
8078
+ globalThis.__ZikoConfig__.default.target = e.target.parent.parent[1][1];
7735
8079
  }), text$1('📋').style(BTN_STYLE).onClick(() => {
7736
8080
  navigator.clipboard.writeText(ctx.codeText);
7737
8081
  }), text$1('✖️').style(BTN_STYLE).onClick(() => ctx.remove()), text$1('✖️').style(BTN_STYLE).onClick(() => ctx.remove())).style({
@@ -7863,7 +8207,7 @@ class ZikoUICodeCell extends ZikoUIFlex {
7863
8207
  #evaluateMd() {}
7864
8208
  #evaluateHtml() {}
7865
8209
  evaluate(order) {
7866
- globalThis.__Target__ = this.Output.element;
8210
+ globalThis.__ZikoConfig__.default.target = this.Output.element;
7867
8211
  switch (this.cache.type) {
7868
8212
  case "js":
7869
8213
  this.#evaluateJs(order);
@@ -8000,19 +8344,16 @@ const Tabs = (Controllers, Contents) => new ZikoUITabs(Controllers, Contents);
8000
8344
  class ZikoUIMain extends ZikoUIElement {
8001
8345
  constructor() {
8002
8346
  super("main", "Main");
8003
- this.render();
8004
8347
  }
8005
8348
  }
8006
8349
  class ZikoUIHeader extends ZikoUIElement {
8007
8350
  constructor() {
8008
8351
  super("header", "Header");
8009
- this.render();
8010
8352
  }
8011
8353
  }
8012
8354
  class ZikoUINav extends ZikoUIElement {
8013
8355
  constructor() {
8014
8356
  super("nav", "Nav");
8015
- this.render();
8016
8357
  }
8017
8358
  }
8018
8359
  class ZikoUISection extends ZikoUIElement {
@@ -8021,26 +8362,22 @@ class ZikoUISection extends ZikoUIElement {
8021
8362
  this.style({
8022
8363
  position: "relative"
8023
8364
  });
8024
- this.render();
8025
8365
  }
8026
8366
  }
8027
8367
  class ZikoUIArticle extends ZikoUIElement {
8028
8368
  constructor() {
8029
8369
  super("article", "Article");
8030
- this.render();
8031
8370
  }
8032
8371
  }
8033
8372
  class ZikoUIAside extends ZikoUIElement {
8034
8373
  constructor() {
8035
8374
  super("aside", "Aside");
8036
- this.render();
8037
8375
  }
8038
8376
  }
8039
8377
  class ZikoUIFooter extends ZikoUIElement {
8040
8378
  constructor() {
8041
8379
  super("footer", "Footer");
8042
8380
  this.element = document.createElement("footer");
8043
- this.render();
8044
8381
  }
8045
8382
  }
8046
8383
  const Section$1 = (...ZikoUIElement) => new ZikoUISection().append(...ZikoUIElement);
@@ -8131,7 +8468,6 @@ class ZikoUITable extends ZikoUIElement {
8131
8468
  };
8132
8469
  if (body) this.fromMatrix(body);
8133
8470
  if (caption) this.setCaption(caption);
8134
- this.render();
8135
8471
  }
8136
8472
  get caption() {
8137
8473
  return this.structure.caption;
@@ -8230,7 +8566,7 @@ class ZikoUITable extends ZikoUIElement {
8230
8566
  const Table = (matrix, config) => new ZikoUITable(matrix, config);
8231
8567
 
8232
8568
  const UI$1 = {
8233
- ZikoHtml,
8569
+ html,
8234
8570
  text: text$1,
8235
8571
  p,
8236
8572
  h1,
@@ -8961,7 +9297,7 @@ class ZikoUICanvas extends ZikoUIElement {
8961
9297
  });
8962
9298
  this.transformMatrix = new Matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]]);
8963
9299
  this.axisMatrix = new Matrix([[-10, -10], [10, 10]]);
8964
- this.render();
9300
+ this.render(globalThis.__ZikoConfig__.default.render);
8965
9301
  setTimeout(() => this.resize(w, h), 0);
8966
9302
  this.on("sizeupdated", () => this.adjust());
8967
9303
  }
@@ -9457,8 +9793,20 @@ const SPA = (root_UI, routes, patterns) => new ZikoSPA(root_UI, routes, patterns
9457
9793
 
9458
9794
  const __init__ = () => document.documentElement.setAttribute("data-engine", "zikojs");
9459
9795
 
9460
- var __Target__ = null;
9461
- if (globalThis?.document?.body) __Target__ = document.body;
9796
+ // var __Target__=null;
9797
+ // if(globalThis?.document?.body)__Target__=document.body;
9798
+ const __ZikoConfig__ = {
9799
+ default: {
9800
+ target: null,
9801
+ render: true
9802
+ },
9803
+ setDefault: function (pairs) {
9804
+ const keys = Object.keys(pairs);
9805
+ const values = Object.values(pairs);
9806
+ for (let i = 0; i < keys.length; i++) this.default[keys[i]] = values[i];
9807
+ },
9808
+ init: () => document.documentElement.setAttribute("data-engine", "zikojs")
9809
+ };
9462
9810
 
9463
9811
  class ZikoSeo {
9464
9812
  constructor(app) {
@@ -9510,11 +9858,14 @@ class ZikoUIApp extends ZikoUIFlex {
9510
9858
  this.head = null;
9511
9859
  this.#init();
9512
9860
  this.seo = Seo(this);
9861
+ Object.assign(this.events, {
9862
+ hash: null
9863
+ });
9513
9864
  Object.assign(this.cache, {
9514
9865
  theme: null,
9515
9866
  isRoot: true
9516
9867
  });
9517
- this.render();
9868
+ this.render(globalThis.__ZikoConfig__.default.render);
9518
9869
  }
9519
9870
  #init() {
9520
9871
  this.root.setAttribute("data-engine", "zikojs");
@@ -9531,6 +9882,11 @@ class ZikoUIApp extends ZikoUIFlex {
9531
9882
  }
9532
9883
  prefetch() {}
9533
9884
  description() {}
9885
+ onHashChange(...callbacks) {
9886
+ if (!this.events.hash) this.events.hash = HashEvent(this);
9887
+ this.events.hash.onChange(...callbacks);
9888
+ return this;
9889
+ }
9534
9890
  }
9535
9891
  const App = (...UIElement) => new ZikoUIApp().append(...UIElement);
9536
9892
 
@@ -9547,7 +9903,7 @@ const Ziko = {
9547
9903
  };
9548
9904
  globalThis.__Ziko__ = Ziko;
9549
9905
  globalThis.__UI__ = __UI__;
9550
- globalThis.__Target__ = __Target__;
9906
+ globalThis.__ZikoConfig__ = __ZikoConfig__;
9551
9907
  function ExtractAll() {
9552
9908
  UI$1.ExtractAll();
9553
9909
  Math$1.ExtractAll();
@@ -9613,7 +9969,6 @@ exports.Themes = Themes;
9613
9969
  exports.Time = Time;
9614
9970
  exports.UI = UI$1;
9615
9971
  exports.Utils = Utils;
9616
- exports.ZikoHtml = ZikoHtml;
9617
9972
  exports.ZikoUIArticle = ZikoUIArticle;
9618
9973
  exports.ZikoUIAside = ZikoUIAside;
9619
9974
  exports.ZikoUIAudio = ZikoUIAudio;
@@ -9633,6 +9988,7 @@ exports.ZikoUINav = ZikoUINav;
9633
9988
  exports.ZikoUISection = ZikoUISection;
9634
9989
  exports.ZikoUISvg = ZikoUISvg;
9635
9990
  exports.ZikoUIVideo = ZikoUIVideo;
9991
+ exports.__ZikoConfig__ = __ZikoConfig__;
9636
9992
  exports.__init__ = __init__;
9637
9993
  exports.abs = abs;
9638
9994
  exports.accum = accum;
@@ -9692,6 +10048,7 @@ exports.h5 = h5;
9692
10048
  exports.h6 = h6;
9693
10049
  exports.hr = hr;
9694
10050
  exports.hrs = hrs;
10051
+ exports.html = html;
9695
10052
  exports.hypot = hypot;
9696
10053
  exports.image = image;
9697
10054
  exports.inRange = inRange;