cradova 1.0.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.
- package/LICENSE +201 -0
- package/cradova.png +0 -0
- package/docs/README.md +0 -0
- package/index.d.ts +52 -0
- package/index.js +342 -0
- package/index.ts +366 -0
- package/package.json +36 -0
- package/scripts/JsonDB.d.ts +298 -0
- package/scripts/JsonDB.js +698 -0
- package/scripts/JsonDB.ts +794 -0
- package/scripts/Metrics.d.ts +51 -0
- package/scripts/Metrics.js +56 -0
- package/scripts/Metrics.ts +66 -0
- package/scripts/Router.d.ts +12 -0
- package/scripts/Router.js +95 -0
- package/scripts/Router.ts +105 -0
- package/scripts/Screen.d.ts +11 -0
- package/scripts/Screen.js +62 -0
- package/scripts/Screen.ts +62 -0
- package/scripts/animate.d.ts +25 -0
- package/scripts/animate.js +47 -0
- package/scripts/animate.ts +57 -0
- package/scripts/css.d.ts +20 -0
- package/scripts/css.js +41 -0
- package/scripts/css.ts +46 -0
- package/scripts/dispatcher.d.ts +1 -0
- package/scripts/dispatcher.js +57 -0
- package/scripts/dispatcher.ts +58 -0
- package/scripts/file-system.d.ts +2 -0
- package/scripts/file-system.js +175 -0
- package/scripts/file-system.ts +177 -0
- package/scripts/fullscreen.d.ts +4 -0
- package/scripts/fullscreen.js +29 -0
- package/scripts/fullscreen.ts +30 -0
- package/scripts/init.d.ts +2 -0
- package/scripts/init.js +17 -0
- package/scripts/init.ts +18 -0
- package/scripts/localStorage.d.ts +9 -0
- package/scripts/localStorage.js +26 -0
- package/scripts/localStorage.ts +37 -0
- package/scripts/media.d.ts +22 -0
- package/scripts/media.js +48 -0
- package/scripts/media.ts +51 -0
- package/scripts/reuse.ts +74 -0
- package/scripts/speaker.d.ts +2 -0
- package/scripts/speaker.js +16 -0
- package/scripts/speaker.ts +25 -0
- package/scripts/store.d.ts +10 -0
- package/scripts/store.js +56 -0
- package/scripts/store.ts +47 -0
- package/scripts/swipe.d.ts +9 -0
- package/scripts/swipe.js +113 -0
- package/scripts/swipe.ts +129 -0
- package/scripts/widget.d.ts +2 -0
- package/scripts/widget.js +19 -0
- package/scripts/widget.ts +23 -0
- package/service-worker.d.ts +2 -0
- package/service-worker.js +40 -0
- package/service-worker.ts +52 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const w = function (...childrens) {
|
|
2
|
+
let props;
|
|
3
|
+
if (typeof childrens[0] === "object" &&
|
|
4
|
+
!(childrens[0] instanceof HTMLElement)) {
|
|
5
|
+
props = childrens[0];
|
|
6
|
+
childrens = childrens.slice(1, childrens.length);
|
|
7
|
+
}
|
|
8
|
+
const par = document.createDocumentFragment();
|
|
9
|
+
childrens.forEach((ch) => {
|
|
10
|
+
if (typeof ch === "function") {
|
|
11
|
+
par.append(ch(props));
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
par.append(ch);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return () => par;
|
|
18
|
+
};
|
|
19
|
+
export default w;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const w = function (
|
|
2
|
+
...childrens: HTMLElement[] | ((el: Record<string, string>) => HTMLElement)[]
|
|
3
|
+
) {
|
|
4
|
+
let props: Record<string, string>;
|
|
5
|
+
if (
|
|
6
|
+
typeof childrens[0] === "object" &&
|
|
7
|
+
!(childrens[0] instanceof HTMLElement)
|
|
8
|
+
) {
|
|
9
|
+
props = childrens[0];
|
|
10
|
+
childrens = childrens.slice(1, childrens.length);
|
|
11
|
+
}
|
|
12
|
+
const par = document.createDocumentFragment();
|
|
13
|
+
childrens.forEach((ch) => {
|
|
14
|
+
if (typeof ch === "function") {
|
|
15
|
+
par.append(ch(props));
|
|
16
|
+
} else {
|
|
17
|
+
par.append(ch);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return () => par;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default w;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const store = "sample_store";
|
|
2
|
+
const assets = [
|
|
3
|
+
// put all the files you want cached here
|
|
4
|
+
"/",
|
|
5
|
+
];
|
|
6
|
+
self.addEventListener("install", function (e) {
|
|
7
|
+
e.waitUntil(assets.forEach((asset) => {
|
|
8
|
+
fetch(asset)
|
|
9
|
+
.then((res) => {
|
|
10
|
+
const response = res.clone();
|
|
11
|
+
caches.open(store).then((cache) => {
|
|
12
|
+
cache.put(e.request, response);
|
|
13
|
+
});
|
|
14
|
+
return res;
|
|
15
|
+
})
|
|
16
|
+
.catch((err) => console.log(err));
|
|
17
|
+
}));
|
|
18
|
+
self["skipWaiting"]();
|
|
19
|
+
});
|
|
20
|
+
self.addEventListener("activate", function (e) {
|
|
21
|
+
e.waitUntil(caches.keys().then((cach) => {
|
|
22
|
+
if (cach !== store) {
|
|
23
|
+
return caches.delete(cach);
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
return self.clients.claim();
|
|
27
|
+
});
|
|
28
|
+
self.addEventListener("fetch", function (e) {
|
|
29
|
+
e.waitUntil(e.respondWith(fetch(e.request)
|
|
30
|
+
.then((res) => {
|
|
31
|
+
const response = res.clone();
|
|
32
|
+
caches.open(store).then((cache) => {
|
|
33
|
+
console.log(response, " fetching");
|
|
34
|
+
cache.put(e.request, response);
|
|
35
|
+
});
|
|
36
|
+
return res;
|
|
37
|
+
})
|
|
38
|
+
.catch(() => caches.match(e.request).then((res) => res))));
|
|
39
|
+
self["skipWaiting"]();
|
|
40
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const store = "sample_store";
|
|
2
|
+
|
|
3
|
+
const assets = [
|
|
4
|
+
// put all the files you want cached here
|
|
5
|
+
"/",
|
|
6
|
+
];
|
|
7
|
+
|
|
8
|
+
self.addEventListener("install", function (e) {
|
|
9
|
+
e.waitUntil(
|
|
10
|
+
assets.forEach((asset) => {
|
|
11
|
+
fetch(asset)
|
|
12
|
+
.then((res) => {
|
|
13
|
+
const response = res.clone();
|
|
14
|
+
caches.open(store).then((cache) => {
|
|
15
|
+
cache.put(e.request, response);
|
|
16
|
+
});
|
|
17
|
+
return res;
|
|
18
|
+
})
|
|
19
|
+
.catch((err) => console.log(err));
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
self["skipWaiting"]();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
self.addEventListener("activate", function (e) {
|
|
26
|
+
e.waitUntil(
|
|
27
|
+
caches.keys().then((cach) => {
|
|
28
|
+
if (cach !== store) {
|
|
29
|
+
return caches.delete(cach);
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
return self.clients.claim();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
self.addEventListener("fetch", function (e) {
|
|
37
|
+
e.waitUntil(
|
|
38
|
+
e.respondWith(
|
|
39
|
+
fetch(e.request)
|
|
40
|
+
.then((res) => {
|
|
41
|
+
const response = res.clone();
|
|
42
|
+
caches.open(store).then((cache) => {
|
|
43
|
+
console.log(response, " fetching");
|
|
44
|
+
cache.put(e.request, response);
|
|
45
|
+
});
|
|
46
|
+
return res;
|
|
47
|
+
})
|
|
48
|
+
.catch(() => caches.match(e.request).then((res) => res))
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
self["skipWaiting"]();
|
|
52
|
+
});
|