ziko 0.0.5 → 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.
- package/dist/ziko.cjs +9999 -9853
- package/dist/ziko.js +10000 -9854
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +9999 -9853
- package/package.json +12 -4
- package/starter/bin/index.js +10 -0
- package/wrapper/react/README.md +26 -0
- package/wrapper/react/index.jsx +7 -1
- package/wrapper/svelte/ZikoUI.svelte +15 -0
- package/wrapper/vue/ZikoUI.vue +8 -2
- package/core/App/Accessibility/index.js +0 -0
- package/core/App/Globals/__Target__.js +0 -3
- package/core/App/Globals/__UI__.js +0 -38
- package/core/App/Globals/__init__.js +0 -8
- package/core/App/Globals/index.js +0 -18
- package/core/App/Router/index.js +0 -40
- package/core/App/Seo/index.js +0 -43
- package/core/App/Themes/dark.js +0 -885
- package/core/App/Themes/index.js +0 -11
- package/core/App/Themes/light.js +0 -255
- package/core/App/app.js +0 -46
- package/core/App/index.js +0 -12
- package/core/Data/Api/fetchdom.js +0 -14
- package/core/Data/Api/index.js +0 -4
- package/core/Data/Api/preload.js +0 -11
- package/core/Data/Converter/canvas.js +0 -25
- package/core/Data/Converter/csv.js +0 -33
- package/core/Data/Converter/index.js +0 -25
- package/core/Data/Converter/json.js +0 -80
- package/core/Data/Converter/markdown.js +0 -83
- package/core/Data/Converter/svg.js +0 -11
- package/core/Data/Parser/markdown.js +0 -0
- package/core/Data/Parser/xml.js +0 -47
- package/core/Data/Strings/index.js +0 -26
- package/core/Data/decorators.js +0 -0
- package/core/Data/index.js +0 -64
- package/core/Graphics/Canvas/Elements/Basic/arc.js +0 -43
- package/core/Graphics/Canvas/Elements/Basic/image.js +0 -0
- package/core/Graphics/Canvas/Elements/Basic/line.js +0 -26
- package/core/Graphics/Canvas/Elements/Basic/path.js +0 -0
- package/core/Graphics/Canvas/Elements/Basic/points.js +0 -48
- package/core/Graphics/Canvas/Elements/Basic/polygon.js +0 -7
- package/core/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
- package/core/Graphics/Canvas/Elements/Basic/rect.js +0 -46
- package/core/Graphics/Canvas/Elements/Basic/text.js +0 -0
- package/core/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
- package/core/Graphics/Canvas/Elements/Chart/plot.js +0 -0
- package/core/Graphics/Canvas/Elements/Chart/scatter.js +0 -2
- package/core/Graphics/Canvas/Elements/Chart/stem.js +0 -0
- package/core/Graphics/Canvas/Elements/Element.js +0 -115
- package/core/Graphics/Canvas/Elements/Groupe.js +0 -0
- package/core/Graphics/Canvas/Elements/grid.js +0 -0
- package/core/Graphics/Canvas/Elements/index.js +0 -13
- package/core/Graphics/Canvas/Filter/index.js +0 -0
- package/core/Graphics/Canvas/Paint/index.js +0 -0
- package/core/Graphics/Canvas/Utils/color.js +0 -8
- package/core/Graphics/Canvas/Utils/floodFill.js +0 -58
- package/core/Graphics/Canvas/_canvas_offscreen +0 -0
- package/core/Graphics/Canvas/canvas.js +0 -189
- package/core/Graphics/Canvas/index.js +0 -15
- package/core/Graphics/Svg/Elements/ZikoSvgElement.js +0 -28
- package/core/Graphics/Svg/Elements/circle.js +0 -34
- package/core/Graphics/Svg/Elements/ellipse.js +0 -29
- package/core/Graphics/Svg/Elements/foreignObject.js +0 -46
- package/core/Graphics/Svg/Elements/grid.js +0 -9
- package/core/Graphics/Svg/Elements/groupe.js +0 -29
- package/core/Graphics/Svg/Elements/image.js +0 -33
- package/core/Graphics/Svg/Elements/line.js +0 -29
- package/core/Graphics/Svg/Elements/path.js +0 -59
- package/core/Graphics/Svg/Elements/polygon.js +0 -31
- package/core/Graphics/Svg/Elements/polyline.js +0 -4
- package/core/Graphics/Svg/Elements/rect.js +0 -43
- package/core/Graphics/Svg/Elements/text.js +0 -26
- package/core/Graphics/Svg/index.js +0 -1
- package/core/Graphics/Svg/svg.js +0 -117
- package/core/Graphics/index.js +0 -61
- package/core/Math/Calculus/Special Functions/bessel.js +0 -31
- package/core/Math/Calculus/Special Functions/beta.js +0 -38
- package/core/Math/Calculus/Special Functions/gamma.js +0 -30
- package/core/Math/Calculus/Special Functions/index.js +0 -4
- package/core/Math/Calculus/index.js +0 -1
- package/core/Math/Complex/Fractals/julia.js +0 -0
- package/core/Math/Complex/index.js +0 -191
- package/core/Math/Discret/Combinaison/index.js +0 -34
- package/core/Math/Discret/Conversion/index.js +0 -86
- package/core/Math/Discret/Logic/index.js +0 -46
- package/core/Math/Discret/Permutation/index.js +0 -31
- package/core/Math/Discret/Set/index.js +0 -2
- package/core/Math/Discret/Set/powerSet.js +0 -15
- package/core/Math/Discret/Set/subSet.js +0 -10
- package/core/Math/Discret/index.js +0 -23
- package/core/Math/Functions/index.js +0 -182
- package/core/Math/Matrix/Decomposition.js +0 -90
- package/core/Math/Matrix/LinearSystem.js +0 -10
- package/core/Math/Matrix/Matrix.js +0 -712
- package/core/Math/Matrix/index.js +0 -3
- package/core/Math/Numeric/index.js +0 -0
- package/core/Math/Random/index.js +0 -173
- package/core/Math/Signal/__np.py.txt +0 -40
- package/core/Math/Signal/conv.js +0 -175
- package/core/Math/Signal/fft.js +0 -55
- package/core/Math/Signal/filter.js +0 -39
- package/core/Math/Signal/functions.js +0 -146
- package/core/Math/Signal/index.js +0 -110
- package/core/Math/Statistics/Functions/index.js +0 -100
- package/core/Math/Statistics/index.js +0 -16
- package/core/Math/Utils/arithmetic.js +0 -139
- package/core/Math/Utils/checkers.js +0 -11
- package/core/Math/Utils/comparaison.js +0 -1
- package/core/Math/Utils/conversions.js +0 -7
- package/core/Math/Utils/discret.js +0 -28
- package/core/Math/Utils/index.js +0 -102
- package/core/Math/Utils/mapfun.js +0 -43
- package/core/Math/absract.js +0 -1
- package/core/Math/const.js +0 -3
- package/core/Math/index.js +0 -193
- package/core/Reactivity/Events/Global/Click.js +0 -56
- package/core/Reactivity/Events/Global/Clipboard.js +0 -84
- package/core/Reactivity/Events/Global/CustomEvent.js +0 -53
- package/core/Reactivity/Events/Global/Drag.js +0 -137
- package/core/Reactivity/Events/Global/Focus.js +0 -56
- package/core/Reactivity/Events/Global/Key.js +0 -104
- package/core/Reactivity/Events/Global/Mouse.js +0 -230
- package/core/Reactivity/Events/Global/Pointer.js +0 -214
- package/core/Reactivity/Events/Global/Touch.js +0 -0
- package/core/Reactivity/Events/Global/Wheel.js +0 -44
- package/core/Reactivity/Events/Partiel/Hash.js +0 -44
- package/core/Reactivity/Events/Partiel/Input.js +0 -59
- package/core/Reactivity/Events/Partiel/MediaEvent.js +0 -1
- package/core/Reactivity/Events/ZikoEvent.js +0 -91
- package/core/Reactivity/Events/index.js +0 -60
- package/core/Reactivity/Observer/index.js +0 -3
- package/core/Reactivity/Observer/intersection.js +0 -40
- package/core/Reactivity/Observer/mutation.js +0 -90
- package/core/Reactivity/Observer/resize.js +0 -47
- package/core/Reactivity/Use/Contexte/index.js +0 -1
- package/core/Reactivity/Use/Contexte/useSuccesifKeys.js +0 -14
- package/core/Reactivity/Use/Decorators/index.js +0 -4
- package/core/Reactivity/Use/Interactions/index.js +0 -4
- package/core/Reactivity/Use/Interactions/useBluetooth.js +0 -48
- package/core/Reactivity/Use/Interactions/useChannel.js +0 -50
- package/core/Reactivity/Use/Interactions/useEventEmmiter.js +0 -64
- package/core/Reactivity/Use/Interactions/useSerial.js +0 -0
- package/core/Reactivity/Use/Interactions/useThread.js +0 -44
- package/core/Reactivity/Use/Interactions/useUsb.js +0 -0
- package/core/Reactivity/Use/Sensors/index.js +0 -2
- package/core/Reactivity/Use/Sensors/useBattery.js +0 -36
- package/core/Reactivity/Use/Sensors/useCamera.js +0 -0
- package/core/Reactivity/Use/Sensors/useGeolocation.js +0 -17
- package/core/Reactivity/Use/Sensors/useMicro.js +0 -0
- package/core/Reactivity/Use/Sensors/useOrientation.js +0 -0
- package/core/Reactivity/Use/Storage/index.js +0 -1
- package/core/Reactivity/Use/Storage/useCookie.js +0 -0
- package/core/Reactivity/Use/Storage/useIndexedDb.js +0 -0
- package/core/Reactivity/Use/Storage/useStorage.js +0 -74
- package/core/Reactivity/Use/UI/index.js +0 -4
- package/core/Reactivity/Use/UI/useCssLink.js +0 -0
- package/core/Reactivity/Use/UI/useCssText.js +0 -21
- package/core/Reactivity/Use/UI/useFavIcon.js +0 -38
- package/core/Reactivity/Use/UI/useLinearGradient.js +0 -0
- package/core/Reactivity/Use/UI/useMediaQuery.js +0 -1
- package/core/Reactivity/Use/UI/useRadialGradient.js +0 -0
- package/core/Reactivity/Use/UI/useStyle.js +0 -54
- package/core/Reactivity/Use/UI/useTheme.js +0 -62
- package/core/Reactivity/Use/UI/useTitle.js +0 -30
- package/core/Reactivity/Use/index.js +0 -82
- package/core/Reactivity/Use/todo.md +0 -26
- package/core/Reactivity/index.js +0 -3
- package/core/Time/animation.js +0 -76
- package/core/Time/index.js +0 -54
- package/core/Time/loop.js +0 -83
- package/core/Time/utils/decorators.js +0 -17
- package/core/Time/utils/ease.js +0 -144
- package/core/Time/utils/index.js +0 -18
- package/core/Time/utils/performance.js +0 -16
- package/core/Time/utils/ui.js +0 -26
- package/core/UI/CustomElement/Elements/Accordion/index.js +0 -62
- package/core/UI/CustomElement/Elements/Carousel/index.js +0 -47
- package/core/UI/CustomElement/Elements/CodeNote/CodeCell.js +0 -176
- package/core/UI/CustomElement/Elements/CodeNote/CodeNote.js +0 -69
- package/core/UI/CustomElement/Elements/CodeNote/SubElements.js +0 -64
- package/core/UI/CustomElement/Elements/CodeNote/index.js +0 -2
- package/core/UI/CustomElement/Elements/Columns.js +0 -1
- package/core/UI/CustomElement/Elements/FAB.js +0 -0
- package/core/UI/CustomElement/Elements/Menu.js +0 -0
- package/core/UI/CustomElement/Elements/Notification.js +0 -0
- package/core/UI/CustomElement/Elements/Popover.js +0 -0
- package/core/UI/CustomElement/Elements/Popup.js +0 -0
- package/core/UI/CustomElement/Elements/Swipper.js +0 -4
- package/core/UI/CustomElement/Elements/Tabs/index.js +0 -111
- package/core/UI/CustomElement/Elements/Timeline.js +0 -0
- package/core/UI/CustomElement/Elements/Toast.js +0 -0
- package/core/UI/CustomElement/Elements/Treeview.js +0 -0
- package/core/UI/CustomElement/Elements/index.js +0 -4
- package/core/UI/CustomElement/Flex.js +0 -97
- package/core/UI/CustomElement/Grid.js +0 -30
- package/core/UI/CustomElement/index.js +0 -3
- package/core/UI/Embaded/index.js +0 -1
- package/core/UI/Inputs/Primitives/btn.js +0 -30
- package/core/UI/Inputs/Primitives/elements.js +0 -28
- package/core/UI/Inputs/Primitives/inputs.js +0 -324
- package/core/UI/Inputs/Primitives/select.js +0 -14
- package/core/UI/Inputs/Primitives/textarea.js +0 -15
- package/core/UI/Inputs/camera.js +0 -23
- package/core/UI/Inputs/index.js +0 -20
- package/core/UI/List/elements.js +0 -0
- package/core/UI/List/index.js +0 -127
- package/core/UI/Media/Audio/index.js +0 -38
- package/core/UI/Media/Image/figure.js +0 -16
- package/core/UI/Media/Image/image.js +0 -33
- package/core/UI/Media/Image/index.js +0 -2
- package/core/UI/Media/Video/index.js +0 -49
- package/core/UI/Media/index.js +0 -3
- package/core/UI/Misc/index.js +0 -45
- package/core/UI/Semantic/index.js +0 -61
- package/core/UI/Style/index.js +0 -499
- package/core/UI/Table/elements.js +0 -94
- package/core/UI/Table/index.js +0 -3
- package/core/UI/Table/table.js +0 -112
- package/core/UI/Table/utils.js +0 -12
- package/core/UI/Text/heading.js +0 -34
- package/core/UI/Text/index.js +0 -3
- package/core/UI/Text/p.js +0 -36
- package/core/UI/Text/pre.js +0 -0
- package/core/UI/Text/text.js +0 -65
- package/core/UI/Utils/index.js +0 -70
- package/core/UI/ZikoUIElement.js +0 -503
- package/core/UI/index.js +0 -154
- package/core/__proto__/Array.js +0 -74
- package/core/__proto__/Function.js +0 -0
- package/core/__proto__/Number.js +0 -76
- package/core/__proto__/Object.js +0 -0
- package/core/__proto__/String.js +0 -0
- package/core/index.js +0 -72
- package/wrapper/react/readme.md +0 -19
|
@@ -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
|
-
|
package/core/Reactivity/index.js
DELETED
package/core/Time/animation.js
DELETED
|
@@ -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/core/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/core/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
|
-
}
|
package/core/Time/utils/ease.js
DELETED
|
@@ -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
|
package/core/Time/utils/index.js
DELETED
|
@@ -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"
|