ziko 0.0.4 → 0.0.6

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 (234) hide show
  1. package/dist/ziko.cjs +10000 -9874
  2. package/dist/ziko.js +10001 -9875
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +9998 -9873
  5. package/package.json +15 -5
  6. package/starter/bin/index.js +10 -0
  7. package/wrapper/react/README.md +26 -0
  8. package/wrapper/react/index.jsx +22 -0
  9. package/wrapper/svelte/ZikoUI.svelte +15 -0
  10. package/wrapper/vue/ZikoUI.vue +23 -0
  11. package/src/App/Accessibility/index.js +0 -0
  12. package/src/App/Globals/__Target__.js +0 -3
  13. package/src/App/Globals/__UI__.js +0 -38
  14. package/src/App/Globals/__init__.js +0 -8
  15. package/src/App/Globals/index.js +0 -3
  16. package/src/App/Router/index.js +0 -40
  17. package/src/App/Seo/index.js +0 -43
  18. package/src/App/Themes/dark.js +0 -885
  19. package/src/App/Themes/index.js +0 -11
  20. package/src/App/Themes/light.js +0 -255
  21. package/src/App/app.js +0 -46
  22. package/src/App/index.js +0 -11
  23. package/src/Data/Api/fetchdom.js +0 -14
  24. package/src/Data/Api/index.js +0 -4
  25. package/src/Data/Api/preload.js +0 -11
  26. package/src/Data/Converter/canvas.js +0 -25
  27. package/src/Data/Converter/csv.js +0 -33
  28. package/src/Data/Converter/index.js +0 -25
  29. package/src/Data/Converter/json.js +0 -80
  30. package/src/Data/Converter/markdown.js +0 -83
  31. package/src/Data/Converter/svg.js +0 -11
  32. package/src/Data/Parser/markdown.js +0 -0
  33. package/src/Data/Parser/xml.js +0 -47
  34. package/src/Data/Strings/index.js +0 -26
  35. package/src/Data/decorators.js +0 -0
  36. package/src/Data/index.js +0 -64
  37. package/src/Graphics/Canvas/Elements/Basic/arc.js +0 -43
  38. package/src/Graphics/Canvas/Elements/Basic/image.js +0 -0
  39. package/src/Graphics/Canvas/Elements/Basic/line.js +0 -26
  40. package/src/Graphics/Canvas/Elements/Basic/path.js +0 -0
  41. package/src/Graphics/Canvas/Elements/Basic/points.js +0 -48
  42. package/src/Graphics/Canvas/Elements/Basic/polygon.js +0 -7
  43. package/src/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
  44. package/src/Graphics/Canvas/Elements/Basic/rect.js +0 -46
  45. package/src/Graphics/Canvas/Elements/Basic/text.js +0 -0
  46. package/src/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
  47. package/src/Graphics/Canvas/Elements/Chart/plot.js +0 -0
  48. package/src/Graphics/Canvas/Elements/Chart/scatter.js +0 -2
  49. package/src/Graphics/Canvas/Elements/Chart/stem.js +0 -0
  50. package/src/Graphics/Canvas/Elements/Element.js +0 -115
  51. package/src/Graphics/Canvas/Elements/Groupe.js +0 -0
  52. package/src/Graphics/Canvas/Elements/grid.js +0 -0
  53. package/src/Graphics/Canvas/Elements/index.js +0 -13
  54. package/src/Graphics/Canvas/Filter/index.js +0 -0
  55. package/src/Graphics/Canvas/Paint/index.js +0 -0
  56. package/src/Graphics/Canvas/Utils/color.js +0 -8
  57. package/src/Graphics/Canvas/Utils/floodFill.js +0 -58
  58. package/src/Graphics/Canvas/_canvas_offscreen +0 -0
  59. package/src/Graphics/Canvas/canvas.js +0 -189
  60. package/src/Graphics/Canvas/index.js +0 -15
  61. package/src/Graphics/Svg/Elements/ZikoSvgElement.js +0 -28
  62. package/src/Graphics/Svg/Elements/circle.js +0 -34
  63. package/src/Graphics/Svg/Elements/ellipse.js +0 -29
  64. package/src/Graphics/Svg/Elements/foreignObject.js +0 -46
  65. package/src/Graphics/Svg/Elements/grid.js +0 -9
  66. package/src/Graphics/Svg/Elements/groupe.js +0 -29
  67. package/src/Graphics/Svg/Elements/image.js +0 -33
  68. package/src/Graphics/Svg/Elements/line.js +0 -29
  69. package/src/Graphics/Svg/Elements/path.js +0 -59
  70. package/src/Graphics/Svg/Elements/polygon.js +0 -31
  71. package/src/Graphics/Svg/Elements/polyline.js +0 -4
  72. package/src/Graphics/Svg/Elements/rect.js +0 -43
  73. package/src/Graphics/Svg/Elements/text.js +0 -26
  74. package/src/Graphics/Svg/index.js +0 -1
  75. package/src/Graphics/Svg/svg.js +0 -117
  76. package/src/Graphics/index.js +0 -61
  77. package/src/Math/Calculus/Special Functions/bessel.js +0 -31
  78. package/src/Math/Calculus/Special Functions/beta.js +0 -38
  79. package/src/Math/Calculus/Special Functions/gamma.js +0 -30
  80. package/src/Math/Calculus/Special Functions/index.js +0 -4
  81. package/src/Math/Calculus/index.js +0 -1
  82. package/src/Math/Complex/Fractals/julia.js +0 -0
  83. package/src/Math/Complex/index.js +0 -191
  84. package/src/Math/Discret/Combinaison/index.js +0 -34
  85. package/src/Math/Discret/Conversion/index.js +0 -86
  86. package/src/Math/Discret/Logic/index.js +0 -46
  87. package/src/Math/Discret/Permutation/index.js +0 -31
  88. package/src/Math/Discret/Set/index.js +0 -2
  89. package/src/Math/Discret/Set/powerSet.js +0 -15
  90. package/src/Math/Discret/Set/subSet.js +0 -10
  91. package/src/Math/Discret/index.js +0 -23
  92. package/src/Math/Functions/index.js +0 -182
  93. package/src/Math/Matrix/Decomposition.js +0 -90
  94. package/src/Math/Matrix/LinearSystem.js +0 -10
  95. package/src/Math/Matrix/Matrix.js +0 -712
  96. package/src/Math/Matrix/index.js +0 -3
  97. package/src/Math/Numeric/index.js +0 -0
  98. package/src/Math/Random/index.js +0 -173
  99. package/src/Math/Signal/__np.py.txt +0 -40
  100. package/src/Math/Signal/conv.js +0 -175
  101. package/src/Math/Signal/fft.js +0 -55
  102. package/src/Math/Signal/filter.js +0 -39
  103. package/src/Math/Signal/functions.js +0 -146
  104. package/src/Math/Signal/index.js +0 -110
  105. package/src/Math/Statistics/Functions/index.js +0 -100
  106. package/src/Math/Statistics/index.js +0 -16
  107. package/src/Math/Utils/arithmetic.js +0 -139
  108. package/src/Math/Utils/checkers.js +0 -11
  109. package/src/Math/Utils/comparaison.js +0 -1
  110. package/src/Math/Utils/conversions.js +0 -7
  111. package/src/Math/Utils/discret.js +0 -28
  112. package/src/Math/Utils/index.js +0 -102
  113. package/src/Math/Utils/mapfun.js +0 -43
  114. package/src/Math/absract.js +0 -1
  115. package/src/Math/const.js +0 -3
  116. package/src/Math/index.js +0 -193
  117. package/src/Reactivity/Events/Global/Click.js +0 -56
  118. package/src/Reactivity/Events/Global/Clipboard.js +0 -84
  119. package/src/Reactivity/Events/Global/CustomEvent.js +0 -53
  120. package/src/Reactivity/Events/Global/Drag.js +0 -137
  121. package/src/Reactivity/Events/Global/Focus.js +0 -56
  122. package/src/Reactivity/Events/Global/Key.js +0 -104
  123. package/src/Reactivity/Events/Global/Mouse.js +0 -230
  124. package/src/Reactivity/Events/Global/Pointer.js +0 -214
  125. package/src/Reactivity/Events/Global/Touch.js +0 -0
  126. package/src/Reactivity/Events/Global/Wheel.js +0 -44
  127. package/src/Reactivity/Events/Partiel/Hash.js +0 -44
  128. package/src/Reactivity/Events/Partiel/Input.js +0 -59
  129. package/src/Reactivity/Events/Partiel/MediaEvent.js +0 -1
  130. package/src/Reactivity/Events/ZikoEvent.js +0 -91
  131. package/src/Reactivity/Events/index.js +0 -60
  132. package/src/Reactivity/Observer/index.js +0 -3
  133. package/src/Reactivity/Observer/intersection.js +0 -40
  134. package/src/Reactivity/Observer/mutation.js +0 -90
  135. package/src/Reactivity/Observer/resize.js +0 -47
  136. package/src/Reactivity/Use/Contexte/index.js +0 -1
  137. package/src/Reactivity/Use/Contexte/useSuccesifKeys.js +0 -14
  138. package/src/Reactivity/Use/Decorators/index.js +0 -4
  139. package/src/Reactivity/Use/Interactions/index.js +0 -4
  140. package/src/Reactivity/Use/Interactions/useBluetooth.js +0 -48
  141. package/src/Reactivity/Use/Interactions/useChannel.js +0 -50
  142. package/src/Reactivity/Use/Interactions/useEventEmmiter.js +0 -64
  143. package/src/Reactivity/Use/Interactions/useSerial.js +0 -0
  144. package/src/Reactivity/Use/Interactions/useThread.js +0 -44
  145. package/src/Reactivity/Use/Interactions/useUsb.js +0 -0
  146. package/src/Reactivity/Use/Sensors/index.js +0 -2
  147. package/src/Reactivity/Use/Sensors/useBattery.js +0 -36
  148. package/src/Reactivity/Use/Sensors/useCamera.js +0 -0
  149. package/src/Reactivity/Use/Sensors/useGeolocation.js +0 -17
  150. package/src/Reactivity/Use/Sensors/useMicro.js +0 -0
  151. package/src/Reactivity/Use/Sensors/useOrientation.js +0 -0
  152. package/src/Reactivity/Use/Storage/index.js +0 -1
  153. package/src/Reactivity/Use/Storage/useCookie.js +0 -0
  154. package/src/Reactivity/Use/Storage/useIndexedDb.js +0 -0
  155. package/src/Reactivity/Use/Storage/useStorage.js +0 -74
  156. package/src/Reactivity/Use/UI/index.js +0 -4
  157. package/src/Reactivity/Use/UI/useCssLink.js +0 -0
  158. package/src/Reactivity/Use/UI/useCssText.js +0 -21
  159. package/src/Reactivity/Use/UI/useFavIcon.js +0 -38
  160. package/src/Reactivity/Use/UI/useLinearGradient.js +0 -0
  161. package/src/Reactivity/Use/UI/useMediaQuery.js +0 -1
  162. package/src/Reactivity/Use/UI/useRadialGradient.js +0 -0
  163. package/src/Reactivity/Use/UI/useStyle.js +0 -54
  164. package/src/Reactivity/Use/UI/useTheme.js +0 -62
  165. package/src/Reactivity/Use/UI/useTitle.js +0 -30
  166. package/src/Reactivity/Use/index.js +0 -82
  167. package/src/Reactivity/Use/todo.md +0 -26
  168. package/src/Reactivity/index.js +0 -3
  169. package/src/Time/animation.js +0 -76
  170. package/src/Time/index.js +0 -54
  171. package/src/Time/loop.js +0 -83
  172. package/src/Time/utils/decorators.js +0 -17
  173. package/src/Time/utils/ease.js +0 -144
  174. package/src/Time/utils/index.js +0 -18
  175. package/src/Time/utils/performance.js +0 -16
  176. package/src/Time/utils/ui.js +0 -26
  177. package/src/UI/CustomElement/Elements/Accordion/index.js +0 -62
  178. package/src/UI/CustomElement/Elements/Carousel/index.js +0 -47
  179. package/src/UI/CustomElement/Elements/CodeNote/CodeCell.js +0 -176
  180. package/src/UI/CustomElement/Elements/CodeNote/CodeNote.js +0 -69
  181. package/src/UI/CustomElement/Elements/CodeNote/SubElements.js +0 -64
  182. package/src/UI/CustomElement/Elements/CodeNote/index.js +0 -2
  183. package/src/UI/CustomElement/Elements/Columns.js +0 -1
  184. package/src/UI/CustomElement/Elements/FAB.js +0 -0
  185. package/src/UI/CustomElement/Elements/Menu.js +0 -0
  186. package/src/UI/CustomElement/Elements/Notification.js +0 -0
  187. package/src/UI/CustomElement/Elements/Popover.js +0 -0
  188. package/src/UI/CustomElement/Elements/Popup.js +0 -0
  189. package/src/UI/CustomElement/Elements/Swipper.js +0 -4
  190. package/src/UI/CustomElement/Elements/Tabs/index.js +0 -111
  191. package/src/UI/CustomElement/Elements/Timeline.js +0 -0
  192. package/src/UI/CustomElement/Elements/Toast.js +0 -0
  193. package/src/UI/CustomElement/Elements/Treeview.js +0 -0
  194. package/src/UI/CustomElement/Elements/index.js +0 -4
  195. package/src/UI/CustomElement/Flex.js +0 -97
  196. package/src/UI/CustomElement/Grid.js +0 -30
  197. package/src/UI/CustomElement/index.js +0 -3
  198. package/src/UI/Embaded/index.js +0 -1
  199. package/src/UI/Inputs/Primitives/btn.js +0 -31
  200. package/src/UI/Inputs/Primitives/elements.js +0 -28
  201. package/src/UI/Inputs/Primitives/inputs.js +0 -334
  202. package/src/UI/Inputs/Primitives/select.js +0 -15
  203. package/src/UI/Inputs/Primitives/textarea.js +0 -16
  204. package/src/UI/Inputs/camera.js +0 -23
  205. package/src/UI/Inputs/index.js +0 -20
  206. package/src/UI/List/elements.js +0 -0
  207. package/src/UI/List/index.js +0 -130
  208. package/src/UI/Media/Audio/index.js +0 -39
  209. package/src/UI/Media/Image/figure.js +0 -17
  210. package/src/UI/Media/Image/image.js +0 -34
  211. package/src/UI/Media/Image/index.js +0 -2
  212. package/src/UI/Media/Video/index.js +0 -50
  213. package/src/UI/Media/index.js +0 -3
  214. package/src/UI/Misc/index.js +0 -49
  215. package/src/UI/Semantic/index.js +0 -68
  216. package/src/UI/Style/index.js +0 -499
  217. package/src/UI/Table/elements.js +0 -94
  218. package/src/UI/Table/index.js +0 -3
  219. package/src/UI/Table/table.js +0 -113
  220. package/src/UI/Table/utils.js +0 -12
  221. package/src/UI/Text/heading.js +0 -35
  222. package/src/UI/Text/index.js +0 -3
  223. package/src/UI/Text/p.js +0 -37
  224. package/src/UI/Text/pre.js +0 -0
  225. package/src/UI/Text/text.js +0 -66
  226. package/src/UI/Utils/index.js +0 -70
  227. package/src/UI/ZikoUIElement.js +0 -501
  228. package/src/UI/index.js +0 -154
  229. package/src/__proto__/Array.js +0 -74
  230. package/src/__proto__/Function.js +0 -0
  231. package/src/__proto__/Number.js +0 -76
  232. package/src/__proto__/Object.js +0 -0
  233. package/src/__proto__/String.js +0 -0
  234. package/src/index.js +0 -70
@@ -1,38 +0,0 @@
1
- import { useEventEmitter } from "../Interactions/useEventEmmiter";
2
- class ZikoUseFavIcon{
3
- constructor(FavIcon,useEventEmitter=true){
4
- this.#init();
5
- this.cache={
6
- Emitter:null
7
- }
8
- if(useEventEmitter)this.useEventEmitter();
9
- this.set(FavIcon);
10
- }
11
- #init(){
12
- this.__FavIcon__=document.querySelector("link[rel*='icon']") || document.createElement('link');
13
- this.__FavIcon__.type = 'image/x-icon';
14
- this.__FavIcon__.rel = 'shortcut icon';
15
- return this;
16
- }
17
- set(href){
18
- if(href!==this.__FavIcon__.href){
19
- this.__FavIcon__.href=href;
20
- if(this.cache.Emitter)this.cache.Emitter.emit("ziko:favicon-changed");
21
- }
22
- return this;
23
- }
24
- get current(){
25
- return document.__FavIcon__.href;
26
- }
27
- onChange(callback){
28
- if(this.cache.Emitter)this.cache.Emitter.on("ziko:favicon-changed",callback);
29
- return this;
30
- }
31
- useEventEmitter(){
32
- this.cache.Emitter=useEventEmitter();
33
- return this;
34
- }
35
-
36
- }
37
- const useFavIcon=(FavIcon,useEventEmitter)=>new ZikoUseFavIcon(FavIcon,useEventEmitter);
38
- export{ useFavIcon }
File without changes
@@ -1 +0,0 @@
1
- //window.matchMedia('(max-width: 600px)');
File without changes
@@ -1,54 +0,0 @@
1
- class ZikoUseStyle{
2
- constructor(style,id=0){
3
- this.id="Ziko-Style-"+id;
4
- this.use(style);
5
- this.keys=new Set();
6
- this.styles={
7
- default:{
8
- fontSize:"1em"
9
- }
10
- }
11
- }
12
- get current(){
13
- return [...this.keys].reduce((key, value) => {
14
- key[value] = `var(--${value}-${this.id})`;
15
- return key;
16
- }, {});
17
- }
18
- add(name,style={}){
19
- if(name instanceof Object)Object.assign(this.styles,name)
20
- else Object.assign(this.styles,{[name]:style});
21
- return this;
22
- }
23
- #useStyleIndex(index){
24
- const keys=Object.keys(this.styles);
25
- for(let a in this.styles[keys[index]]){
26
- document.documentElement.style.setProperty(`--${a}-${this.id}`, this.styles[keys[index]][a]);
27
- this.keys.add(a);
28
- }
29
-
30
- return this;
31
- }
32
- #useStyleName(name){
33
- for(let a in this.styles[name]){
34
- document.documentElement.style.setProperty(`--${a}-${this.id}`, this.styles[name][a]);
35
- this.keys.add(a);
36
- }
37
- return this;
38
- }
39
- #useStyleObject(Style){
40
- for(let a in Style){
41
- document.documentElement.style.setProperty(`--${a}-${this.id}`, Style[a]);
42
- this.keys.add(a);
43
- }
44
- return this;
45
- }
46
- use(style){
47
- if(typeof style === "number")this.#useStyleIndex(style);
48
- if(typeof style === "string")this.#useStyleName(style);
49
- if(style instanceof Object)this.#useStyleObject(style);
50
- return this;
51
- }
52
- }
53
- const useStyle=id=>style=>new ZikoUseStyle(style,id)
54
- export {useStyle}
@@ -1,62 +0,0 @@
1
- import { Themes } from "../../../App/Themes";
2
- class ZikoUseTheme{
3
- constructor(theme,id=0){
4
- this.id="Ziko-Theme-"+id;
5
- this.use(theme)
6
- }
7
- get current(){
8
- const colorNames = [
9
- 'background',
10
- 'currentLine',
11
- 'selection',
12
- 'foreground',
13
- 'comment',
14
- 'cyan',
15
- 'green',
16
- 'orange',
17
- 'pink',
18
- 'purple',
19
- 'red',
20
- 'yellow',
21
- ];
22
- return colorNames.reduce((theme, color) => {
23
- theme[color] = `var(--${color}-${this.id})`;
24
- return theme;
25
- }, {});
26
-
27
- }
28
- useThemeIndex(index){
29
- const keys=Object.keys(Themes);
30
- for(let a in Themes[keys[index]]){
31
- document.documentElement.style.setProperty(`--${a}-${this.id}`, Themes[keys[index]][a]);
32
- }
33
- return this;
34
- }
35
- useThemeName(str){
36
- str=str.toLowerCase()
37
- const Themes_With_Lower_Case=Object.fromEntries(Object.entries(Themes).map(n=>[n[0].toLowerCase(),n[1]]))
38
- for(let a in Themes_With_Lower_Case[str]){
39
- document.documentElement.style.setProperty(`--${a}-${this.id}`, Themes_With_Lower_Case[str][a]);
40
- }
41
- return this;
42
- }
43
- useThemeObject(Theme){
44
- for(let a in Theme){
45
- document.documentElement.style.setProperty(`--${a}-${this.id}`, Theme[a]);
46
- }
47
- return this;
48
- }
49
- use(theme){
50
- if(typeof theme === "number")this.useThemeIndex(theme);
51
- if(typeof theme === "string")this.useThemeName(theme);
52
- if(theme instanceof Object)this.useThemeObject(theme);
53
- return this;
54
- }
55
- }
56
- const useTheme=(id=0)=>(theme=0)=>new ZikoUseTheme(theme,id)
57
- export {
58
- useTheme,
59
- // Themes,
60
- // LightThemes,
61
- // DarkThemes,
62
- };
@@ -1,30 +0,0 @@
1
- import { useEventEmitter } from "../Interactions/useEventEmmiter";
2
- class ZikoUseTitle{
3
- constructor(title=document.title,useEventEmitter=true){
4
- this.cache={
5
- Emitter:null
6
- }
7
- if(useEventEmitter)this.useEventEmitter();
8
- this.set(title);
9
- }
10
- useEventEmitter(){
11
- this.cache.Emitter=useEventEmitter();
12
- return this;
13
- }
14
- set(title){
15
- if(title!==document.title){
16
- document.title=title;
17
- if(this.cache.Emitter)this.cache.Emitter.emit("ziko:title-changed");
18
- }
19
- return this;
20
- }
21
- get current(){
22
- return document.title;
23
- }
24
- onChange(callback){
25
- if(this.cache.Emitter)this.cache.Emitter.on("ziko:title-changed",callback);
26
- return this;
27
- }
28
- }
29
- const useTitle=(title, useEventEmitter)=>new ZikoUseTitle(title, useEventEmitter);
30
- export{ useTitle }
@@ -1,82 +0,0 @@
1
- import {
2
- useStyle,
3
- useTheme,
4
- useTitle,
5
- useFavIcon
6
- } from "./UI";
7
- import {
8
- useEventEmitter,
9
- useChannel,
10
- useThread,
11
- useBluetooth
12
- } from "./Interactions";
13
- import {
14
- useBattery,
15
- useGeolocation
16
- } from "./Sensors";
17
- import {
18
- useThrottle,
19
- useDebounce
20
- } from "./Decorators";
21
- import {
22
- useLocaleStorage,
23
- useSessionStorage
24
- } from "./Storage"
25
- import {
26
- useSuccesifKeys
27
- } from "./Contexte";
28
- const Use={
29
- useStyle,
30
- useTheme,
31
- useBattery,
32
- useGeolocation,
33
- useEventEmitter,
34
- useChannel,
35
- useThread,
36
- useBluetooth,
37
- useTitle,
38
- useFavIcon,
39
- useThrottle,
40
- useDebounce,
41
- useLocaleStorage,
42
- useSessionStorage,
43
- useSuccesifKeys,
44
- ExtractAll: function () {
45
- const keys = Object.keys(this);
46
- for (let i = 0; i < keys.length; i++) {
47
- const key = keys[i];
48
- if (key !== 'ExtractAll' && key !== 'RemoveAll') {
49
- globalThis[key] = this[key];
50
- }
51
- }
52
- return this;
53
- },
54
- RemoveAll: function () {
55
- const keys = Object.keys(this);
56
- for (let i = 0; i < keys.length; i++) {
57
- const key = keys[i];
58
- if (key !== 'RemoveAll') {
59
- delete globalThis[key];
60
- }
61
- }
62
- return this;
63
- }
64
- }
65
- export default Use;
66
- export{
67
- useStyle,
68
- useTheme,
69
- useTitle,
70
- useFavIcon,
71
- useBattery,
72
- useGeolocation,
73
- useEventEmitter,
74
- useChannel,
75
- useThread,
76
- useBluetooth,
77
- useThrottle,
78
- useDebounce,
79
- useLocaleStorage,
80
- useSessionStorage,
81
- useSuccesifKeys
82
- }
@@ -1,26 +0,0 @@
1
- - Device :
2
- - useBattery
3
- - useGeolocation
4
- - useFullScrean
5
- - useOrientation
6
- - useNotification
7
- - UI
8
- - useTheme
9
- - useStyle
10
- - useCss
11
- - useTitle
12
- - useFavIcon
13
- - Interactions
14
- - useEventEmitter
15
- - useChannel
16
- - useBluetooth
17
- - useSerial
18
- - useUsb
19
- - useSocket
20
- - Storage
21
- - useSessionStorage
22
- - useLocalStorage
23
- - Timing
24
- - useDebounce
25
- - useThrottle
26
-
@@ -1,3 +0,0 @@
1
- export * from "./Events";
2
- export * from "./Observer";
3
- export * from "./Use";
@@ -1,76 +0,0 @@
1
- import { Ease } from "./utils";
2
- import { map } from "../Math/Utils"
3
- class ZikoTimeAnimation{
4
- constructor(callback,{ease=Ease.Linear,step=50,t=[0,null],start=true,duration=3000}={}){
5
- this.cache={
6
- isRunning:false,
7
- AnimationId:null,
8
- startTime:null,
9
- ease,
10
- step,
11
- intervall:t,
12
- started:start,
13
- duration
14
- }
15
- this.t=0;
16
- this.tx=0;
17
- this.ty=0;
18
- this.i=0;
19
- this.callback=callback;
20
- }
21
- #animation_handler(){
22
- this.t+=this.cache.step;
23
- this.i++;
24
- this.tx=map(this.t,0,this.cache.duration,0,1);
25
- this.ty=this.cache.ease(this.tx);
26
- this.callback(this)
27
- if(this.t>=this.cache.duration){
28
- clearInterval(this.cache.AnimationId);
29
- this.cache.isRunning=false;
30
- }
31
- }
32
- reset(restart=true){
33
- this.t=0
34
- this.tx=0;
35
- this.ty=0;
36
- this.i=0;
37
- if(restart)this.start();
38
- return this;
39
- }
40
- #animate(reset=true){
41
- if(!this.cache.isRunning){
42
- if(reset)this.reset(false);
43
- this.cache.isRunning=true;
44
- this.cache.startTime = Date.now();
45
- this.cache.AnimationId=setInterval(this.#animation_handler.bind(this),this.cache.step);
46
- }
47
- return this;
48
- }
49
- start(){
50
- this.#animate(true);
51
- return this;
52
- }
53
- pause(){
54
- if (this.cache.isRunning) {
55
- clearTimeout(this.cache.AnimationId);
56
- this.cache.isRunning = false;
57
- }
58
- return this;
59
- }
60
- resume(){
61
- this.#animate(false);
62
- return this;
63
- }
64
- stop(){
65
- this.pause();
66
- this.reset(false);
67
- return this;
68
- }
69
- // clear(){
70
- // }
71
- // stream(){
72
- // }
73
- }
74
-
75
- const animation=(callback,config)=>new ZikoTimeAnimation(callback,config)
76
- export{animation}
package/src/Time/index.js DELETED
@@ -1,54 +0,0 @@
1
- import{
2
- loop
3
- } from "./loop.js"
4
- import{
5
- animation
6
- } from "./animation.js"
7
- import {
8
- wait,
9
- timeTaken,
10
- useThrottle,
11
- useDebounce,
12
- Ease,
13
- time_memory_Taken,
14
- waitForUIElm,
15
- waitForUIElmSync
16
- } from "./utils/index.js";
17
- const Time={
18
- wait,
19
- timeTaken,
20
- useThrottle,
21
- useDebounce,
22
- Ease,
23
- time_memory_Taken,
24
- loop,
25
- animation,
26
- waitForUIElm,
27
- waitForUIElmSync,
28
- ExtractAll: function () {
29
- const keys = Object.keys(this);
30
- for (let i = 0; i < keys.length; i++) {
31
- const key = keys[i];
32
- if (key !== 'ExtractAll' && key !== 'RemoveAll') {
33
- globalThis[key] = this[key];
34
- }
35
- }
36
- return this;
37
- },
38
- RemoveAll: function () {
39
- const keys = Object.keys(this);
40
- for (let i = 0; i < keys.length; i++) {
41
- const key = keys[i];
42
- if (key !== 'RemoveAll') {
43
- delete globalThis[key];
44
- }
45
- }
46
- return this;
47
- }
48
- }
49
- export * from "./utils/index.js"
50
- export {
51
- loop,
52
- animation
53
- }
54
- export default Time;
package/src/Time/loop.js DELETED
@@ -1,83 +0,0 @@
1
- class ZikoTimeLoop {
2
- constructor(callback, {fps,step,t=[0,null],start=true}={}) {
3
- this.callback = callback;
4
- this.cache = {
5
- isRunning: false,
6
- AnimationId : null,
7
- startTime : null,
8
- step,
9
- fps,
10
- t,
11
- started:start
12
- };
13
- this.adjust();
14
- this.i=0;
15
- }
16
- adjust(){
17
- if(this.cache.step && this.cache.fps){
18
- console.warn(`Fps will be adjusted from ${this.cache.fps} to ${1000/this.cache.step} to ensure a smoother animation`);
19
- this.cache.fps=1000/this.cache.step;
20
- }
21
- if(this.cache.started){
22
- const t=this.cache.t;
23
- t[0]?this.startAfter(t[0]):this.start();
24
- if(t[1])this.stopAfter(t[1]);
25
- }
26
- return this;
27
- }
28
- get TIME_STEP() {
29
- return this.cache.step?this.cache.step:1000 / this.cache.fps;
30
- }
31
- start() {
32
- if (!this.cache.isRunning) {
33
- this.i=0;
34
- this.cache.isRunning = true;
35
- this.cache.startTime = Date.now();
36
- this.animate();
37
- }
38
- return this;
39
- }
40
- pause() {
41
- if (this.cache.isRunning) {
42
- clearTimeout(this.cache.AnimationId);
43
- this.cache.isRunning = false;
44
- }
45
- return this;
46
- }
47
- stop(){
48
- this.pause();
49
- this.i=0;
50
- return this;
51
- }
52
- resume(){
53
- this.cache.isRunning=true;
54
- this.animate();
55
- return this;
56
- }
57
- startAfter(t=1000){
58
- setTimeout(this.start.bind(this),t);
59
- return this;
60
- }
61
- stopAfter(t=1000){
62
- setTimeout(this.stop.bind(this),t);
63
- return this;
64
- }
65
- animate = () => {
66
- if (this.cache.isRunning) {
67
- const now = Date.now();
68
- const delta = now - this.cache.startTime;
69
- if (delta > this.TIME_STEP) {
70
- this.callback(this);
71
- this.i++;
72
- this.cache.startTime = now - (delta % this.TIME_STEP);
73
- }
74
- this.cache.AnimationId = setTimeout(this.animate, 0);
75
- };
76
- }
77
- }
78
-
79
- const loop = (callback, options) => new ZikoTimeLoop(callback, options);
80
-
81
-
82
- //const a = loop((e) => console.log(e.i), {step:100,fps:30,t:[500,4001],start:true});
83
- export {loop}
@@ -1,17 +0,0 @@
1
- const useDebounce=(fn,delay=1000)=>{
2
- let id;
3
- return(...args)=>id?clearTimeout(id):setTimeout(()=>fn(...args),delay)
4
- }
5
- const useThrottle=(fn,delay)=>{
6
- let lastTime=0;
7
- return (...args)=>{
8
- const now=new Date().getTime()
9
- if(now-lastTime<delay)return;
10
- lastTime=now;
11
- fn(...args);
12
- }
13
- }
14
- export{
15
- useDebounce,
16
- useThrottle
17
- }
@@ -1,144 +0,0 @@
1
- const Ease={
2
- Linear:function(t){
3
- return t;
4
- },
5
- InSin(t){
6
- return 1 - Math.cos((t * Math.PI) / 2);
7
- },
8
- OutSin(t){
9
- return Math.sin((t * Math.PI) / 2);
10
- },
11
- InOutSin(t){
12
- return -(Math.cos(Math.PI * t) - 1) / 2;
13
- },
14
- InQuad(t){
15
- return t**2;
16
- },
17
- OutQuad(t){
18
- return 1 - Math.pow((1 - t),2)
19
- },
20
- InOutQuad(t){
21
- return t < 0.5 ? 2 * Math.pow(t,2) : 1 - Math.pow(-2 * t + 2, 2) / 2;
22
- },
23
- InCubic(t){
24
- return t**3;
25
- },
26
- OutCubic(t){
27
- return 1 - Math.pow((1 - t),3)
28
- },
29
- InOutCubic(t){
30
- return t < 0.5 ? 4 * Math.pow(t,3) : 1 - Math.pow(-2 * t + 2, 3) / 2;
31
- },
32
- InQuart(t){
33
- return t**4;
34
- },
35
- OutQuart(t){
36
- return 1 - Math.pow((1 - t),4);
37
- },
38
- InOutQuart(t){
39
- return t < 0.5 ? 8 * Math.pow(t,4) : 1 - Math.pow(-2 * t + 2, 4) / 2;
40
- },
41
- InQuint(t){
42
- return t**5;
43
- },
44
- OutQuint(t){
45
- return 1 - Math.pow((1 - t),5);
46
- },
47
- InOutQuint(t){
48
- return t < 0.5 ? 16 * Math.pow(t,5) : 1 - Math.pow(-2 * t + 2, 5) / 2;
49
- },
50
- InExpo(t){
51
- return t === 0 ? 0 : Math.pow(2, 10 * t - 10);
52
- },
53
- OutExpo(t){
54
- return t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
55
- },
56
- InOutExpo(t){
57
- return t === 0? 0: t === 1? 1: t < 0.5 ? Math.pow(2, 20 * t - 10) / 2: (2 - Math.pow(2, -20 * t + 10)) / 2;
58
- },
59
- InCirc(t){
60
- return 1 - Math.sqrt(1 - Math.pow(t, 2));
61
- },
62
- OutCirc(t){
63
- return Math.sqrt(1 - Math.pow(t - 1, 2));
64
- },
65
- InOutCic(t){
66
- return t < 0.5? (1 - Math.sqrt(1 - Math.pow(2 * t, 2))) / 2: (Math.sqrt(1 - Math.pow(-2 * t + 2, 2)) + 1) / 2;
67
- },
68
- Arc(t){
69
- return 1 - Math.sin(Math.acos(t));
70
- },
71
- Back(t){
72
- // To Be Changed
73
- let x=1
74
- return Math.pow(t, 2) * ((x + 1) * t - x);
75
- },
76
- Elastic(t){
77
- return -2*Math.pow(2, 10 * (t - 1)) * Math.cos(20 * Math.PI * t / 3 * t);
78
- },
79
- InBack(t){
80
- const c1 = 1.70158;
81
- const c3 = c1 + 1;
82
- return c3 *Math.pow(t,3)- c1 * (t**2);
83
- },
84
- OutBack(t){
85
- const c1 = 1.70158;
86
- const c3 = c1 + 1;
87
- return 1 + c3 * Math.pow(t - 1, 3) + c1 * Math.pow(t - 1, 2);
88
- },
89
- InOutBack(t){
90
- const c1 = 1.70158;
91
- const c2 = c1 * 1.525;
92
- return t < 0.5
93
- ? (Math.pow(2 * t, 2) * ((c2 + 1) * 2 * t - c2)) / 2
94
- : (Math.pow(2 * t - 2, 2) * ((c2 + 1) * (t * 2 - 2) + c2) + 2) / 2;
95
- },
96
- InElastic(t){
97
- const c4 = (2 * Math.PI) / 3;return t === 0
98
- ? 0
99
- : t === 1
100
- ? 1
101
- : -Math.pow(2, 10 * t - 10) * Math.sin((t * 10 - 10.75) * c4);
102
- },
103
- OutElastic(t){
104
- const c4 = (2 * Math.PI) / 3;
105
- return t === 0
106
- ? 0
107
- : t === 1
108
- ? 1
109
- : Math.pow(2, -10 * t) * Math.sin((t * 10 - 0.75) * c4) + 1;
110
- },
111
- InOutElastic(t){
112
- const c5 = (2 * Math.PI) / 4.5;
113
- return t === 0
114
- ? 0
115
- : t === 1
116
- ? 1
117
- : t < 0.5
118
- ? -(Math.pow(2, 20 * t - 10) * Math.sin((20 * t - 11.125) * c5)) / 2
119
- : (Math.pow(2, -20 * t + 10) * Math.sin((20 * t - 11.125) * c5)) / 2 + 1;
120
- },
121
- InBounce(t){
122
- return 1 - Ease.OutBounce(1-t);
123
- },
124
- OutBounce(t){
125
- const n1 = 7.5625;
126
- const d1 = 2.75;
127
- if (t < 1 / d1) {
128
- return n1 * t * t;
129
- } else if (t < 2 / d1) {
130
- return n1 * (t -= 1.5 / d1) * t + 0.75;
131
- } else if (t < 2.5 / d1) {
132
- return n1 * (t -= 2.25 / d1) * t + 0.9375;
133
- } else {
134
- return n1 * (t -= 2.625 / d1) * t + 0.984375;
135
- }
136
-
137
- },
138
- InOutBounce(t){
139
- return t < 0.5
140
- ? (1 - Ease.OutBounce(1 - 2 * t)) / 2
141
- : (1 + Ease.OutBounce(2 * t - 1)) / 2;
142
- }
143
- }
144
- export default Ease
@@ -1,18 +0,0 @@
1
- import Ease from "./ease.js";
2
- const wait=(delayInMS)=>{
3
- return new Promise((resolve) => setTimeout(resolve, delayInMS));
4
- }
5
- const timeTaken = callback => {
6
- console.time('timeTaken');
7
- const r = callback();
8
- console.timeEnd('timeTaken');
9
- return r;
10
- }
11
- export{
12
- wait,
13
- timeTaken,
14
- Ease
15
- }
16
- export * from "./decorators.js";
17
- export * from "./performance.js";
18
- export * from "./ui.js"