@w3kits-com/plugin-opendesign 0.1.9 → 0.1.10
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/404/index.html +1 -1
- package/dist/404.html +1 -1
- package/dist/__next.$oc$slug.__PAGE__.txt +3 -3
- package/dist/__next.$oc$slug.txt +3 -3
- package/dist/__next._full.txt +11 -11
- package/dist/__next._head.txt +4 -4
- package/dist/__next._index.txt +5 -5
- package/dist/__next._tree.txt +1 -1
- package/dist/_next/static/chunks/0axqck9-llseo.js +1 -0
- package/dist/_next/static/chunks/0xl644~f.h0hd.js +1 -0
- package/dist/_next/static/chunks/{0kf4c9h~6b0ok.js → 0xykzmwq7w9.b.js} +1 -1
- package/dist/_not-found/__next._full.txt +10 -10
- package/dist/_not-found/__next._head.txt +4 -4
- package/dist/_not-found/__next._index.txt +5 -5
- package/dist/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/dist/_not-found/__next._not-found.txt +3 -3
- package/dist/_not-found/__next._tree.txt +1 -1
- package/dist/_not-found/index.html +1 -1
- package/dist/_not-found/index.txt +10 -10
- package/dist/index.html +1 -1
- package/dist/index.txt +11 -11
- package/package.json +1 -1
- package/dist/_next/static/chunks/04x4~r_ltq17a.js +0 -1
- package/dist/_next/static/chunks/05_595ph9d4yp.js +0 -1
- package/dist/w3kits-daemon-sw.js +0 -77
- /package/dist/_next/static/{Jxi73Py0I4WvBhRY47OF- → zDhAhlvmD2uhNsdWY6CQB}/_buildManifest.js +0 -0
- /package/dist/_next/static/{Jxi73Py0I4WvBhRY47OF- → zDhAhlvmD2uhNsdWY6CQB}/_clientMiddlewareManifest.js +0 -0
- /package/dist/_next/static/{Jxi73Py0I4WvBhRY47OF- → zDhAhlvmD2uhNsdWY6CQB}/_ssgManifest.js +0 -0
package/dist/w3kits-daemon-sw.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
const REQUEST_TIMEOUT_MS = 30000;
|
|
2
|
-
|
|
3
|
-
function bytesToBase64(bytes) {
|
|
4
|
-
let binary = '';
|
|
5
|
-
const chunkSize = 0x8000;
|
|
6
|
-
for (let index = 0; index < bytes.length; index += chunkSize) {
|
|
7
|
-
binary += String.fromCharCode(...bytes.subarray(index, index + chunkSize));
|
|
8
|
-
}
|
|
9
|
-
return btoa(binary);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function base64ToBytes(value) {
|
|
13
|
-
const binary = atob(value || '');
|
|
14
|
-
const bytes = new Uint8Array(binary.length);
|
|
15
|
-
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
16
|
-
return bytes;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async function requestPayload(request) {
|
|
20
|
-
const body = request.method === 'GET' || request.method === 'HEAD'
|
|
21
|
-
? undefined
|
|
22
|
-
: bytesToBase64(new Uint8Array(await request.arrayBuffer()));
|
|
23
|
-
return {
|
|
24
|
-
type: 'W3KITS_DAEMON_REQUEST',
|
|
25
|
-
request: {
|
|
26
|
-
url: request.url,
|
|
27
|
-
method: request.method,
|
|
28
|
-
headers: Array.from(request.headers.entries()),
|
|
29
|
-
bodyBase64: body,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async function targetClient(event) {
|
|
35
|
-
if (event.clientId) {
|
|
36
|
-
const client = await self.clients.get(event.clientId);
|
|
37
|
-
if (client) return client;
|
|
38
|
-
}
|
|
39
|
-
const clients = await self.clients.matchAll({ type: 'window', includeUncontrolled: true });
|
|
40
|
-
return clients[0] || null;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async function relayToClient(event) {
|
|
44
|
-
const client = await targetClient(event);
|
|
45
|
-
if (!client) return new Response(JSON.stringify({ error: 'w3kits_client_unavailable' }), { status: 503, headers: { 'content-type': 'application/json' } });
|
|
46
|
-
|
|
47
|
-
const message = await requestPayload(event.request);
|
|
48
|
-
const channel = new MessageChannel();
|
|
49
|
-
const response = await new Promise((resolve) => {
|
|
50
|
-
const timeout = setTimeout(() => resolve({ status: 504, headers: [['content-type', 'application/json']], bodyBase64: bytesToBase64(new TextEncoder().encode(JSON.stringify({ error: 'w3kits_daemon_timeout' }))) }), REQUEST_TIMEOUT_MS);
|
|
51
|
-
channel.port1.onmessage = (reply) => {
|
|
52
|
-
clearTimeout(timeout);
|
|
53
|
-
resolve(reply.data || {});
|
|
54
|
-
};
|
|
55
|
-
client.postMessage(message, [channel.port2]);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
return new Response(base64ToBytes(response.bodyBase64), {
|
|
59
|
-
status: response.status || 200,
|
|
60
|
-
headers: response.headers || [],
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
self.addEventListener('install', (event) => {
|
|
65
|
-
event.waitUntil(self.skipWaiting());
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
self.addEventListener('activate', (event) => {
|
|
69
|
-
event.waitUntil(self.clients.claim());
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
self.addEventListener('fetch', (event) => {
|
|
73
|
-
const url = new URL(event.request.url);
|
|
74
|
-
if (url.origin !== self.location.origin) return;
|
|
75
|
-
if (!url.pathname.startsWith('/api/') && !url.pathname.startsWith('/artifacts/')) return;
|
|
76
|
-
event.respondWith(relayToClient(event));
|
|
77
|
-
});
|
/package/dist/_next/static/{Jxi73Py0I4WvBhRY47OF- → zDhAhlvmD2uhNsdWY6CQB}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|