sonic-widget 2.0.6 → 2.1.1
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/README.md +3 -3
- package/dist/index.js +1510 -1510
- package/dist/manifest.webmanifest +1 -1
- package/dist/service-worker.js +57 -128
- package/dist/sw.js +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"sonic
|
|
1
|
+
{"name":"sonic widget","short_name":"sonic","start_url":"/","display":"standalone","background_color":"#ffffff","lang":"en","scope":"/","theme_color":"#ffffff","icons":[{"src":"/pwa-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/pwa-512x512.png","sizes":"512x512","type":"image/png"}]}
|
package/dist/service-worker.js
CHANGED
|
@@ -1,63 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// self.addEventListener('install', event => {
|
|
4
|
-
// event.waitUntil(
|
|
5
|
-
// caches.open(CACHE_NAME).then(cache => {
|
|
6
|
-
// console.log("Opened cache");
|
|
7
|
-
// return cache.addAll([
|
|
8
|
-
// // coco ssd
|
|
9
|
-
// 'https://storage.googleapis.com/tfjs-models/savedmodel/ssdlite_mobilenet_v2/model.json',
|
|
10
|
-
// // document model
|
|
11
|
-
// "https://teachablemachine.withgoogle.com/models/ikFAYzyyu/model.json",
|
|
12
|
-
|
|
13
|
-
// // mask model
|
|
14
|
-
// "https://teachablemachine.withgoogle.com/models/_08Yck2dy/model.json",
|
|
15
|
-
|
|
16
|
-
// // blazeface
|
|
17
|
-
// 'https://tfhub.dev/tensorflow/tfjs-model/blazeface/1/default/1/model.json?tfjs-format=file',
|
|
18
|
-
|
|
19
|
-
// // handpose model
|
|
20
|
-
// "https://tfhub.dev/mediapipe/tfjs-model/handpose_3d/detector/full/1/model.json?tfjs-format=file",
|
|
21
|
-
// "https://tfhub.dev/mediapipe/tfjs-model/handpose_3d/landmark/full/1/model.json?tfjs-format=file"
|
|
22
|
-
// // Add more model files if necessary
|
|
23
|
-
// ]);
|
|
24
|
-
// })
|
|
25
|
-
// );
|
|
26
|
-
// });
|
|
27
|
-
|
|
28
|
-
// self.addEventListener('fetch', event => {
|
|
29
|
-
// event.respondWith(
|
|
30
|
-
// caches.match(event.request).then(response => {
|
|
31
|
-
// console.log("response from fetch request: ", {response});
|
|
32
|
-
// // Cache hit - return response
|
|
33
|
-
// if (response) {
|
|
34
|
-
// return response;
|
|
35
|
-
// }
|
|
36
|
-
// return fetch(event.request);
|
|
37
|
-
// })
|
|
38
|
-
// );
|
|
39
|
-
// });
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const CACHE_NAME = 'tensorflow-models-cache-v1';
|
|
1
|
+
const CACHE_NAME = 'sonic-widget-ai-ml-tensorflow-models-cache-v1';
|
|
44
2
|
const urlsToCache = [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
3
|
+
// coco ssd
|
|
4
|
+
'https://storage.googleapis.com/tfjs-models/savedmodel/ssdlite_mobilenet_v2/model.json',
|
|
5
|
+
// document model
|
|
6
|
+
"https://teachablemachine.withgoogle.com/models/ikFAYzyyu/model.json",
|
|
7
|
+
"https://teachablemachine.withgoogle.com/models/ikFAYzyyu/metadata.json",
|
|
8
|
+
"https://bkr.axiomprotect.com:6653/AxiomFiles/teachableMachine/CardModel/model.json",
|
|
9
|
+
"https://bkr.axiomprotect.com:6653/AxiomFiles/teachableMachine/CardModel/metadata.json",
|
|
10
|
+
// mask model
|
|
11
|
+
"https://teachablemachine.withgoogle.com/models/_08Yck2dy/model.json",
|
|
12
|
+
"https://teachablemachine.withgoogle.com/models/_08Yck2dy/metadata.json",
|
|
13
|
+
"https://bkr.axiomprotect.com:6653/AxiomFiles/teachableMachine/MaskModel/model.json",
|
|
14
|
+
"https://bkr.axiomprotect.com:6653/AxiomFiles/teachableMachine/MaskModel/metadata.json",
|
|
15
|
+
// blazeface
|
|
16
|
+
'https://tfhub.dev/tensorflow/tfjs-model/blazeface/1/default/1/model.json?tfjs-format=file',
|
|
17
|
+
|
|
18
|
+
// handpose model
|
|
19
|
+
"https://tfhub.dev/mediapipe/tfjs-model/handpose_3d/detector/full/1/model.json?tfjs-format=file",
|
|
20
|
+
"https://tfhub.dev/mediapipe/tfjs-model/handpose_3d/landmark/full/1/model.json?tfjs-format=file"
|
|
21
|
+
// Add more model files if necessary
|
|
22
|
+
];
|
|
61
23
|
|
|
62
24
|
self.addEventListener('install', function(event) {
|
|
63
25
|
// Perform install steps
|
|
@@ -70,76 +32,43 @@ self.addEventListener('install', function(event) {
|
|
|
70
32
|
});
|
|
71
33
|
|
|
72
34
|
self.addEventListener('fetch', function(event) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
event.respondWith(
|
|
81
|
-
caches.match(request)
|
|
82
|
-
.then(function(response) {
|
|
83
|
-
// Cache hit - return response
|
|
84
|
-
if (response) {
|
|
85
|
-
return response;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Clone the request
|
|
89
|
-
const fetchRequest = request.clone();
|
|
90
|
-
|
|
91
|
-
return fetch(fetchRequest).then(
|
|
92
|
-
function(response) {
|
|
93
|
-
// Check if we received a valid response
|
|
94
|
-
if(!response || response.status !== 200 || response.type !== 'basic') {
|
|
95
|
-
return response;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Clone the response
|
|
99
|
-
const responseToCache = response.clone();
|
|
100
|
-
// Save the response for future matching
|
|
101
|
-
caches.open(CACHE_NAME)
|
|
102
|
-
.then(function(cache) {
|
|
103
|
-
cache.put(request, responseToCache);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
return response;
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
})
|
|
110
|
-
);
|
|
111
|
-
});
|
|
35
|
+
const request = event.request;
|
|
36
|
+
|
|
37
|
+
console.log({request});
|
|
38
|
+
// Skip caching for requests from browser extensions
|
|
39
|
+
if (request.url.startsWith('chrome-extension://')) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
112
42
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
// }
|
|
121
|
-
// // Clone the request
|
|
122
|
-
// var fetchRequest = event.request.clone();
|
|
43
|
+
event.respondWith(
|
|
44
|
+
caches.match(request)
|
|
45
|
+
.then(function(response) {
|
|
46
|
+
// Cache hit - return response
|
|
47
|
+
if (response) {
|
|
48
|
+
return response;
|
|
49
|
+
}
|
|
123
50
|
|
|
124
|
-
//
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
//
|
|
51
|
+
// Clone the request
|
|
52
|
+
const fetchRequest = request.clone();
|
|
53
|
+
|
|
54
|
+
return fetch(fetchRequest).then(
|
|
55
|
+
function(response) {
|
|
56
|
+
// Check if we received a valid response
|
|
57
|
+
if(!response || response.status !== 200 || response.type !== 'basic') {
|
|
58
|
+
return response;
|
|
59
|
+
}
|
|
130
60
|
|
|
131
|
-
//
|
|
132
|
-
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
// });
|
|
61
|
+
// Clone the response
|
|
62
|
+
const responseToCache = response.clone();
|
|
63
|
+
// Save the response for future matching
|
|
64
|
+
caches.open(CACHE_NAME)
|
|
65
|
+
.then(function(cache) {
|
|
66
|
+
cache.put(request, responseToCache);
|
|
67
|
+
});
|
|
139
68
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
69
|
+
return response;
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
})
|
|
73
|
+
);
|
|
74
|
+
});
|
package/dist/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let e,
|
|
1
|
+
if(!self.define){let e,i={};const r=(r,s)=>(r=new URL(r+".js",s).href,i[r]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=i,document.head.appendChild(e)}else e=r,importScripts(r),i()})).then((()=>{let e=i[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e})));self.define=(s,n)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(i[t])return;let o={};const c=e=>r(e,t),d={module:{uri:t},exports:o,require:c};i[t]=Promise.all(s.map((e=>d[e]||c(e)))).then((e=>(n(...e),o)))}}define(["./workbox-3e911b1d"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"index.js",revision:"924332edff7fa2e7fdc408012ad2a370"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"service-worker.js",revision:"d5ece7079686fc1071ab9c492a5a86e8"},{url:"manifest.webmanifest",revision:"8c47c1de4bc0ba64bdf24317589e4209"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sonic-widget",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Sonic widget library for doing E-KYC",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"build": "vite build",
|
|
15
15
|
"preview": "vite preview"
|
|
16
16
|
},
|
|
17
|
+
|
|
17
18
|
"dependencies": {
|
|
18
19
|
"@emotion/react": "^11.10.4",
|
|
19
20
|
"@emotion/styled": "^11.10.4",
|