ziko 0.33.0 → 0.34.0

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 (70) hide show
  1. package/dist/ziko.cjs +2440 -3447
  2. package/dist/ziko.js +8192 -9199
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +2423 -3424
  5. package/package.json +4 -6
  6. package/src/app/index.js +0 -3
  7. package/src/events/__Events__.js +18 -8
  8. package/src/events/pointer.js +1 -1
  9. package/src/index.js +9 -3
  10. package/src/math/functions/index.js +6 -9
  11. package/src/math/index.js +0 -7
  12. package/src/math/matrix/Matrix.js +1 -50
  13. package/src/math/matrix/index.js +1 -3
  14. package/src/math/signal/index.js +1 -110
  15. package/src/math/statistics/index.js +2 -2
  16. package/src/reactivity/events/index.js +8 -8
  17. package/src/reactivity/hooks/Head/useFavIcon.js +2 -2
  18. package/src/reactivity/hooks/Head/useTitle.js +1 -1
  19. package/src/reactivity/hooks/index.js +3 -3
  20. package/src/ui/elements/ZikoUIElement.js +34 -176
  21. package/src/ui/elements/semantic/index.js +33 -73
  22. package/src/ui/methods/events.js +39 -0
  23. package/src/use/decorators/index.js +2 -0
  24. package/src/use/decorators/use-debounce.js +4 -0
  25. package/src/use/decorators/use-throttle.js +9 -0
  26. package/src/use/index.js +3 -0
  27. package/src/use/interactions/index.js +3 -0
  28. package/src/{reactivity/hooks/Interactions/useChannel.js → use/interactions/use-channel.js} +8 -8
  29. package/src/{reactivity/hooks/Storage/useStorage.js → use/storage/index.js} +2 -2
  30. package/src/app/json-style-sheet.js +0 -64
  31. package/src/compose.js +0 -89
  32. package/src/math/calculus/derivation/index.js +0 -7
  33. package/src/math/calculus/index.js +0 -2
  34. package/src/math/calculus/special-functions/bessel.js +0 -31
  35. package/src/math/calculus/special-functions/beta.js +0 -38
  36. package/src/math/calculus/special-functions/gamma.js +0 -30
  37. package/src/math/calculus/special-functions/index.js +0 -4
  38. package/src/math/matrix/Decomposition.js +0 -90
  39. package/src/math/matrix/LinearSystem.js +0 -10
  40. package/src/math/signal/__np.py.txt +0 -40
  41. package/src/math/signal/conv.js +0 -175
  42. package/src/math/signal/fft.js +0 -55
  43. package/src/math/signal/filter.js +0 -39
  44. package/src/reactivity/events/Pointer.js +0 -232
  45. package/src/reactivity/events/click.js +0 -102
  46. package/src/reactivity/events/clipboard.js +0 -88
  47. package/src/reactivity/events/drag.js +0 -137
  48. package/src/reactivity/events/focus.js +0 -59
  49. package/src/reactivity/events/key.js +0 -102
  50. package/src/reactivity/events/wheel.js +0 -47
  51. package/src/reactivity/hooks/Decorators/index.js +0 -6
  52. package/src/reactivity/hooks/Decorators/time.js +0 -17
  53. package/src/reactivity/hooks/Decorators/type.js +0 -88
  54. package/src/reactivity/hooks/Interactions/_useBluetooth.js +0 -48
  55. package/src/reactivity/hooks/Interactions/index.js +0 -4
  56. package/src/reactivity/hooks/Sensors ( To Be Moved )/index.js +0 -2
  57. package/src/reactivity/hooks/Sensors ( To Be Moved )/useBattery.js +0 -36
  58. package/src/reactivity/hooks/Sensors ( To Be Moved )/useGeolocation.js +0 -17
  59. package/src/reactivity/hooks/Storage/index.js +0 -1
  60. package/src/reactivity/hooks/Storage/useCookie.js +0 -0
  61. package/src/reactivity/hooks/Storage/useIndexedDb.js +0 -0
  62. /package/src/events/{index.d.ts → index.d.ts.txt} +0 -0
  63. /package/src/math/statistics/{Functions → functions}/index.js +0 -0
  64. /package/src/{math/numeric → use/app}/index.js +0 -0
  65. /package/src/{reactivity/hooks/Interactions/useUsb.js → use/app/use-favicon.js} +0 -0
  66. /package/src/{reactivity/hooks/Sensors ( To Be Moved )/useCamera.js → use/app/use-link.js} +0 -0
  67. /package/src/{reactivity/hooks/Sensors ( To Be Moved )/useMicro.js → use/app/use-meta.js} +0 -0
  68. /package/src/{reactivity/hooks/Sensors ( To Be Moved )/useOrientation.js → use/app/use-title.js} +0 -0
  69. /package/src/{reactivity/hooks/Interactions/useEventEmmiter.js → use/interactions/use-event-emmiter.js} +0 -0
  70. /package/src/{reactivity/hooks/Interactions/useThread.js → use/interactions/use-thread.js} +0 -0
@@ -1,232 +0,0 @@
1
- import {ZikoEvent,EVENT_CONTROLLER} from "./ZikoEvent.js";
2
- function pointerdown_controller(e){
3
- EVENT_CONTROLLER.call(
4
- this,
5
- e,
6
- "down",
7
- ()=>{
8
- this.dx=parseInt(e.offsetX);
9
- this.dy=parseInt(e.offsetY);
10
- this.isDown=true;
11
- },
12
- {
13
- x:this.dx,
14
- y:this.dy,
15
- t:Date.now()-this.cache.stream.t0
16
- }
17
- )
18
- }
19
- function pointermove_controller(e){
20
- EVENT_CONTROLLER.call(
21
- this,
22
- e,
23
- "move",
24
- ()=>{
25
- this.mx=parseInt(e.offsetX);
26
- this.my=parseInt(e.offsetY);
27
- this.isMoving=true;
28
- },
29
- {
30
- x:this.mx,
31
- y:this.my,
32
- t:Date.now()-this.cache.stream.t0
33
- }
34
- )
35
- }
36
- function pointerup_controller(e){
37
- EVENT_CONTROLLER.call(
38
- this,
39
- e,
40
- "up",
41
- ()=>{
42
- this.ux=parseInt(e.offsetX);
43
- this.uy=parseInt(e.offsetY);
44
- this.isDown=false;
45
- const dx=this.dx;
46
- const dy=this.dy;
47
- const ux=this.ux;
48
- const uy=this.uy;
49
- const delta_x=(ux-dx)/this.target.Width;
50
- const delta_y=(dy-uy)/this.target.Height;
51
- const HORIZONTAL_SWIPPE=(delta_x<0)?"left":(delta_x>0)?"right":"none";
52
- const VERTICAL_SWIPPE=(delta_y<0)?"bottom":(delta_y>0)?"top":"none";
53
- this.swippe={
54
- h:HORIZONTAL_SWIPPE,
55
- v:VERTICAL_SWIPPE,
56
- delta_x,
57
- delta_y
58
- }
59
- },
60
- {
61
- x:this.ux,
62
- y:this.uy,
63
- t:Date.now()-this.cache.stream.t0
64
- }
65
- )
66
- }
67
- function pointerenter_controller(e){
68
- EVENT_CONTROLLER.call(
69
- this,
70
- e,
71
- "enter",
72
- null,
73
- null
74
- )
75
- }
76
- function pointerleave_controller(e){
77
- EVENT_CONTROLLER.call(
78
- this,
79
- e,
80
- "leave",
81
- null,
82
- null
83
- )
84
- }
85
- function pointerout_controller(e){
86
- EVENT_CONTROLLER.call(
87
- this,
88
- e,
89
- "out",
90
- null,
91
- null
92
- )
93
- }
94
- function pointercancel_controller(e){
95
- EVENT_CONTROLLER.call(
96
- this,
97
- e,
98
- "cancel",
99
- null,
100
- null
101
- )
102
- }
103
- class ZikoEventPointer extends ZikoEvent{
104
- constructor(target){
105
- super(target);
106
- this.event=null;
107
- this.dx=0;
108
- this.dy=0;
109
- this.dt=0;
110
- this.mx=0;
111
- this.my=0;
112
- this.mt=0;
113
- this.ux=0;
114
- this.uy=0;
115
- this.ut=0;
116
- this.swippe={
117
- h:null,
118
- v:null,
119
- delta_x:0,
120
- delta_y:0
121
- }
122
- this.isMoving=false;
123
- this.isDown=false;
124
- this.cache={
125
- prefixe:"pointer",
126
- preventDefault:{
127
- down:false,
128
- move:false,
129
- up:false,
130
- enter:false,
131
- out:false,
132
- leave:false,
133
- cancel:false
134
- },
135
- paused:{
136
- down:false,
137
- move:false,
138
- up:false,
139
- enter:false,
140
- out:false,
141
- leave:false,
142
- cancel:false
143
- },
144
- stream:{
145
- enabled:{
146
- down:false,
147
- move:false,
148
- up:false,
149
- enter:false,
150
- out:false,
151
- leave:false,
152
- cancel:false
153
- },
154
- clear:{
155
- down:false,
156
- move:false,
157
- up:false,
158
- enter:false,
159
- out:false,
160
- leave:false,
161
- cancel:false
162
- },
163
- history:{
164
- down:[],
165
- move:[],
166
- up:[],
167
- enter:[],
168
- out:[],
169
- leave:[]
170
- }
171
- },
172
- callbacks:{
173
- down:[(self)=>console.log({dx:self.dx,dy:self.dy,down:self.down,move:self.move,t:self.dt})],
174
- move:[(self)=>console.log({mx:self.mx,my:self.my,down:self.down,move:self.move,t:self.dt})],
175
- up:[(self)=>console.log({ux:self.ux,uy:self.uy,down:self.down,move:self.move,t:self.dt})],
176
- enter:[(self)=>console.log({dx:self.dx,dy:self.dy,down:self.down,move:self.move,t:self.dt})],
177
- out:[(self)=>console.log({mx:self.mx,my:self.my,down:self.down,move:self.move,t:self.dt})],
178
- leave:[(self)=>console.log({ux:self.ux,uy:self.uy,down:self.down,move:self.move,t:self.dt})],
179
- cancel:[(self)=>console.log({ux:self.ux,uy:self.uy,down:self.down,move:self.move,t:self.dt})]
180
- }
181
- }
182
- this.__controller={
183
- down:pointerdown_controller.bind(this),
184
- move:pointermove_controller.bind(this),
185
- up:pointerup_controller.bind(this),
186
- enter:pointerenter_controller.bind(this),
187
- out:pointerout_controller.bind(this),
188
- leave:pointerleave_controller.bind(this),
189
- cancel:pointercancel_controller.bind(this),
190
- }
191
- }
192
- onDown(...callbacks){
193
- if(callbacks.length===0)callbacks=[()=>{}];
194
- this.__onEvent("down",{down:true,move:false,up:false,enter:false,out:false,leave:false,cancel:false},...callbacks)
195
- return this;
196
- }
197
- onMove(...callbacks){
198
- if(callbacks.length===0)callbacks=[()=>{}];
199
- this.__onEvent("move",{down:false,move:true,up:false,enter:false,out:false,leave:false,cancel:false},...callbacks)
200
- return this;
201
- }
202
- onUp(...callbacks){
203
- if(callbacks.length===0)callbacks=[()=>{}];
204
- this.__onEvent("up",{down:false,move:false,up:true,enter:false,out:false,leave:false,cancel:false},...callbacks)
205
- return this;
206
- }
207
- onEnter(...callbacks){
208
- if(callbacks.length===0)callbacks=[()=>{}];
209
- this.__onEvent("enter",{down:false,move:false,up:false,enter:true,out:false,leave:false,cancel:false},...callbacks)
210
- return this;
211
- }
212
- onOut(...callbacks){
213
- if(callbacks.length===0)callbacks=[()=>{}];
214
- this.__onEvent("out",{down:false,move:false,up:false,enter:false,out:true,leave:false,cancel:false},...callbacks)
215
- return this;
216
- }
217
- onLeave(...callbacks){
218
- if(callbacks.length===0)callbacks=[()=>{}];
219
- this.__onEvent("leave",{down:false,move:false,up:false,enter:false,out:false,leave:true,cancel:false},...callbacks)
220
- return this;
221
- }
222
- onCancel(...callbacks){
223
- if(callbacks.length===0)callbacks=[()=>{}];
224
- this.__onEvent("cancel",{down:false,move:false,up:false,enter:false,out:false,leave:false,cancel:true},...callbacks)
225
- return this;
226
- }
227
- }
228
- var usePointerEvent=target=>new ZikoEventPointer(target)
229
- export{
230
- usePointerEvent,
231
- ZikoEventPointer
232
- }
@@ -1,102 +0,0 @@
1
- import { ZikoEvent , EVENT_CONTROLLER } from "./ZikoEvent.js";
2
- function click_controller(e){
3
- EVENT_CONTROLLER.call(this,e,"click",null,null)
4
- }
5
- function dbclick_controller(e){
6
- EVENT_CONTROLLER.call(this,e,"dbclick",null,null)
7
- }
8
- class ZikoEventClick extends ZikoEvent{
9
- constructor(target){
10
- super(target);
11
- this.event=null;
12
- this.cache={
13
- prefixe:"",
14
- preventDefault:{
15
- click:false,
16
- dbclick:false,
17
- },
18
- paused:{
19
- click:false,
20
- dbclick:false,
21
- },
22
- stream:{
23
- enabled:{
24
- click:false,
25
- dbclick:false,
26
- },
27
- clear:{
28
- click:false,
29
- dbclick:false,
30
- },
31
- history:{
32
- click:[],
33
- dbclick:[],
34
- }
35
- },
36
- callbacks:{
37
- click:[],
38
- dbclick:[],
39
- }
40
- }
41
- this.__controller={
42
- click:click_controller.bind(this),
43
- dbclick:dbclick_controller.bind(this),
44
- }
45
- }
46
- onClick(...callbacks){
47
- this.__onEvent("click",{},...callbacks)
48
- return this;
49
- }
50
- onDbClick(...callbacks){
51
- this.__onEvent("dbclick",{},...callbacks)
52
- return this;
53
- }
54
- }
55
- const useClickEvent=target=>new ZikoEventClick(target);
56
- export default useClickEvent;
57
- export {
58
- useClickEvent,
59
- ZikoEventClick
60
- }
61
-
62
-
63
- //
64
-
65
-
66
- // import { ZikoEvent, EVENT_CONTROLLER } from "./ZikoEvent.js";
67
-
68
- // class ZikoEventClick extends ZikoEvent {
69
- // constructor(target) {
70
- // super(target);
71
- // this.event = null;
72
- // this.cache = {
73
- // prefixe: "",
74
- // preventDefault: { click: false, dbclick: false },
75
- // paused: { click: false, dbclick: false },
76
- // stream: {
77
- // enabled: { click: false, dbclick: false },
78
- // clear: { click: false, dbclick: false },
79
- // history: { click: [], dbclick: [] }
80
- // },
81
- // callbacks: { click: [], dbclick: [] }
82
- // };
83
-
84
- // this.__controller = {};
85
- // ["click", "dbclick"].forEach(evt => {
86
- // this.__controller[evt] = (e) => EVENT_CONTROLLER.call(this, e, evt, null, null);
87
- // });
88
- // }
89
-
90
- // onClick(...callbacks) {
91
- // return this.__onEvent("click", {}, ...callbacks);
92
- // }
93
-
94
- // onDbClick(...callbacks) {
95
- // return this.__onEvent("dbclick", {}, ...callbacks);
96
- // }
97
- // }
98
-
99
- // const useClickEvent = (target) => new ZikoEventClick(target);
100
-
101
- // export default useClickEvent;
102
- // export { useClickEvent, ZikoEventClick };
@@ -1,88 +0,0 @@
1
- import { ZikoEvent , EVENT_CONTROLLER } from "./ZikoEvent.js";
2
- function copy_controller(e){
3
- EVENT_CONTROLLER.call(this,e,"copy",null,null)
4
- }
5
- function cut_controller(e){
6
- EVENT_CONTROLLER.call(this,e,"cut",null,null)
7
- }
8
- function paste_controller(e){
9
- EVENT_CONTROLLER.call(this,e,"paste",null,null)
10
- }
11
- function select_controller(e){
12
- EVENT_CONTROLLER.call(this,e,"select",null,null)
13
- }
14
- class ZikoEventClipboard extends ZikoEvent{
15
- constructor(target){
16
- super(target);
17
- this.event=null;
18
- this.cache={
19
- prefixe:"",
20
- preventDefault:{
21
- copy:false,
22
- cut:false,
23
- paste:false,
24
- select:false
25
- },
26
- paused:{
27
- copy:false,
28
- cut:false,
29
- paste:false,
30
- select:false
31
- },
32
- stream:{
33
- enabled:{
34
- copy:false,
35
- cut:false,
36
- paste:false,
37
- select:false,
38
- },
39
- clear:{
40
- copy:false,
41
- cut:false,
42
- paste:false,
43
- select:false,
44
- },
45
- history:{
46
- copy:[],
47
- cut:[],
48
- paste:[],
49
- select:[]
50
- }
51
- },
52
- callbacks:{
53
- copy:[],
54
- cut:[],
55
- paste:[],
56
- select:[]
57
- }
58
- }
59
- this.__controller={
60
- copy:copy_controller.bind(this),
61
- cut:cut_controller.bind(this),
62
- paste:paste_controller.bind(this),
63
- select:select_controller.bind(this)
64
- }
65
- }
66
- onCopy(...callbacks){
67
- this.__onEvent("copy",{},...callbacks)
68
- return this;
69
- }
70
- onCut(...callbacks){
71
- this.__onEvent("cut",{},...callbacks)
72
- return this;
73
- }
74
- onPaste(...callbacks){
75
- this.__onEvent("paste",{},...callbacks)
76
- return this;
77
- }
78
- onSelect(...callbacks){
79
- this.__onEvent("select",{},...callbacks)
80
- return this;
81
- }
82
- }
83
- const useClipboardEvent=target=>new ZikoEventClipboard(target);
84
- // export default useClipboardEvent
85
- export{
86
- useClipboardEvent,
87
- ZikoEventClipboard
88
- }
@@ -1,137 +0,0 @@
1
- import { ZikoEvent , EVENT_CONTROLLER } from "./ZikoEvent.js";
2
- function dragstart_controller(e){
3
- EVENT_CONTROLLER(this,e,"start",null,null)
4
- }
5
- function drag_controller(e){
6
- EVENT_CONTROLLER.call(this,e,"drag",null,null)
7
- }
8
- function dragend_controller(e){
9
- EVENT_CONTROLLER.call(this,e,"end",null,null)
10
- }
11
- function drop_controller(e){
12
- EVENT_CONTROLLER.call(this,e,"drop",null,null)
13
- }
14
-
15
- class ZikoEventDrag extends ZikoEvent{
16
- constructor(target){
17
- super(target)
18
- this.target.setAttribute("draggable",true);
19
- this.cache={
20
- prefixe:"drag",
21
- preventDefault:{
22
- drag:false,
23
- start:false,
24
- end:false,
25
- enter:false,
26
- leave:false,
27
- over:false,
28
- },
29
- paused:{
30
- drag:false,
31
- start:false,
32
- end:false,
33
- enter:false,
34
- leave:false,
35
- over:false,
36
- },
37
- enabled:{
38
- drag:false,
39
- start:false,
40
- end:false,
41
- enter:false,
42
- leave:false,
43
- over:false,
44
- },
45
- callbacks:{
46
- drag:[],
47
- start:[],
48
- end:[],
49
- enter:[],
50
- leave:[],
51
- over:[]
52
- },
53
- stream:{
54
- enabled:{
55
- drag:false,
56
- start:false,
57
- end:false,
58
- enter:false,
59
- leave:false,
60
- over:false,
61
- },
62
- clear:{
63
- drag:false,
64
- start:false,
65
- end:false,
66
- enter:false,
67
- leave:false,
68
- over:false,
69
- },
70
- history:{
71
- drag:[],
72
- start:[],
73
- end:[],
74
- enter:[],
75
- leave:[],
76
- over:[],
77
- }
78
- }
79
- }
80
- this.__controller={
81
- start:dragstart_controller.bind(this),
82
- drag:drag_controller.bind(this),
83
- end:dragend_controller.bind(this)
84
- }
85
- }
86
- onStart(...callbacks){
87
- this.__onEvent("start",{},...callbacks);
88
- return this;
89
- }
90
- onDrag(...callbacks){
91
- this.__onEvent("drag",{},...callbacks);
92
- return this;
93
- }
94
- onEnd(...callbacks){
95
- this.__onEvent("end",{},...callbacks);
96
- return this;
97
- }
98
- }
99
- class ZikoEventDrop extends ZikoEvent{
100
- constructor(target){
101
- super(target);
102
- this.event=null;
103
- this.cache={
104
- prefixe:"",
105
- preventDefault:{
106
- drop:false,
107
- },
108
- paused:{
109
- drop:false,
110
- },
111
- stream:{
112
- enabled:{
113
- drop:false,
114
- },
115
- clear:{
116
- drop:false,
117
- },
118
- history:{
119
- drop:[],
120
- }
121
- },
122
- callbacks:{
123
- drop:[(self)=>console.log({dx:self.dx,dy:self.dy,drop:self.drop,move:self.move,t:self.dt})],
124
- }
125
- }
126
- this.__controller={
127
- drop:drop_controller.bind(this),
128
- }
129
- }
130
- onDrop(...callbacks){
131
- this.__onEvent("drop",{},...callbacks);
132
- return this;
133
- }
134
- }
135
- const useDragEvent=target=>new ZikoEventDrag(target);
136
- const useDropEvent=target=>new ZikoEventDrop(target);
137
- export {useDragEvent,useDropEvent}
@@ -1,59 +0,0 @@
1
- import { ZikoEvent , EVENT_CONTROLLER } from "./ZikoEvent.js";
2
- function focus_controller(e){
3
- EVENT_CONTROLLER.call(this,e,"focus",null,null)
4
- }
5
- function blur_controller(e){
6
- EVENT_CONTROLLER.call(this,e,"blur",null,null)
7
- }
8
- class ZikoEventFocus extends ZikoEvent{
9
- constructor(target){
10
- super(target);
11
- this.event=null;
12
- this.cache={
13
- prefixe:"",
14
- preventDefault:{
15
- focus:false,
16
- blur:false,
17
- },
18
- paused:{
19
- focus:false,
20
- blur:false,
21
- },
22
- stream:{
23
- enabled:{
24
- focus:false,
25
- blur:false,
26
- },
27
- clear:{
28
- focus:false,
29
- blur:false,
30
- },
31
- history:{
32
- focus:[],
33
- blur:[],
34
- }
35
- },
36
- callbacks:{
37
- focus:[],
38
- blur:[],
39
- }
40
- }
41
- this.__controller={
42
- focus:focus_controller.bind(this),
43
- blur:blur_controller.bind(this),
44
- }
45
- }
46
- onFocus(...callbacks){
47
- this.__onEvent("focus",{},...callbacks)
48
- return this;
49
- }
50
- onBlur(...callbacks){
51
- this.__onEvent("blur",{},...callbacks)
52
- return this;
53
- }
54
- }
55
- const useFocusEvent=target=>new ZikoEventFocus(target);
56
- export{
57
- useFocusEvent,
58
- ZikoEvent
59
- }