@genome-spy/app 0.37.4 → 0.39.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/dist/__vite-browser-external-ENoMJThg.js +8 -0
- package/dist/_commonjsHelpers-QtkX90xp.js +30 -0
- package/dist/index-1QVesMzU.js +1074 -0
- package/dist/index-Cbz74kpR.js +638 -0
- package/dist/index-LD6yPc3X.js +515 -0
- package/dist/index-Pv3tKJ1W.js +2190 -0
- package/dist/index-UyrC0vvF.js +72 -0
- package/dist/index-Y-LdHNIz.js +501 -0
- package/dist/index-gn8bhQ8w.js +4050 -0
- package/dist/index-lmJu1tfP.js +1372 -0
- package/dist/index-z4Cs62EO.js +279 -0
- package/dist/index.es.js +29983 -0
- package/dist/index.js +1156 -373
- package/dist/long-Veu0zKh9.js +2382 -0
- package/dist/remoteFile-Ur-gRKsH.js +96 -0
- package/package.json +10 -9
@@ -0,0 +1,96 @@
|
|
1
|
+
import { b as u } from "./index-1QVesMzU.js";
|
2
|
+
const h = typeof window < "u" ? window : typeof self < "u" ? self : { fetch: void 0 };
|
3
|
+
class b {
|
4
|
+
async getBufferFromResponse(e) {
|
5
|
+
if (typeof e.buffer == "function")
|
6
|
+
return e.buffer();
|
7
|
+
if (typeof e.arrayBuffer == "function") {
|
8
|
+
const t = await e.arrayBuffer();
|
9
|
+
return u.Buffer.from(t);
|
10
|
+
} else
|
11
|
+
throw new TypeError("invalid HTTP response object, has no buffer method, and no arrayBuffer method");
|
12
|
+
}
|
13
|
+
constructor(e, t = {}) {
|
14
|
+
this.baseOverrides = {}, this.url = e;
|
15
|
+
const r = t.fetch || h.fetch && h.fetch.bind(h);
|
16
|
+
if (!r)
|
17
|
+
throw new TypeError("no fetch function supplied, and none found in global environment");
|
18
|
+
t.overrides && (this.baseOverrides = t.overrides), this.fetchImplementation = r;
|
19
|
+
}
|
20
|
+
async fetch(e, t) {
|
21
|
+
let r;
|
22
|
+
try {
|
23
|
+
r = await this.fetchImplementation(e, t);
|
24
|
+
} catch (s) {
|
25
|
+
if (`${s}`.includes("Failed to fetch"))
|
26
|
+
console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`), r = await this.fetchImplementation(e, {
|
27
|
+
...t,
|
28
|
+
cache: "reload"
|
29
|
+
});
|
30
|
+
else
|
31
|
+
throw s;
|
32
|
+
}
|
33
|
+
return r;
|
34
|
+
}
|
35
|
+
async read(e, t = 0, r, s = 0, o = {}) {
|
36
|
+
const { headers: i = {}, signal: f, overrides: n = {} } = o;
|
37
|
+
r < 1 / 0 ? i.range = `bytes=${s}-${s + r}` : r === 1 / 0 && s !== 0 && (i.range = `bytes=${s}-`);
|
38
|
+
const l = {
|
39
|
+
...this.baseOverrides,
|
40
|
+
...n,
|
41
|
+
headers: {
|
42
|
+
...i,
|
43
|
+
...n.headers,
|
44
|
+
...this.baseOverrides.headers
|
45
|
+
},
|
46
|
+
method: "GET",
|
47
|
+
redirect: "follow",
|
48
|
+
mode: "cors",
|
49
|
+
signal: f
|
50
|
+
}, a = await this.fetch(this.url, l);
|
51
|
+
if (!a.ok)
|
52
|
+
throw new Error(`HTTP ${a.status} ${a.statusText} ${this.url}`);
|
53
|
+
if (a.status === 200 && s === 0 || a.status === 206) {
|
54
|
+
const d = await this.getBufferFromResponse(a), w = d.copy(e, t, 0, Math.min(r, d.length)), m = a.headers.get("content-range"), c = /\/(\d+)$/.exec(m || "");
|
55
|
+
return c && c[1] && (this._stat = { size: parseInt(c[1], 10) }), { bytesRead: w, buffer: e };
|
56
|
+
}
|
57
|
+
throw a.status === 200 ? new Error("${this.url} fetch returned status 200, expected 206") : new Error(`HTTP ${a.status} fetching ${this.url}`);
|
58
|
+
}
|
59
|
+
async readFile(e = {}) {
|
60
|
+
let t, r;
|
61
|
+
typeof e == "string" ? (t = e, r = {}) : (t = e.encoding, r = e, delete r.encoding);
|
62
|
+
const { headers: s = {}, signal: o, overrides: i = {} } = r, f = {
|
63
|
+
headers: s,
|
64
|
+
method: "GET",
|
65
|
+
redirect: "follow",
|
66
|
+
mode: "cors",
|
67
|
+
signal: o,
|
68
|
+
...this.baseOverrides,
|
69
|
+
...i
|
70
|
+
}, n = await this.fetch(this.url, f);
|
71
|
+
if (!n)
|
72
|
+
throw new Error("generic-filehandle failed to fetch");
|
73
|
+
if (n.status !== 200)
|
74
|
+
throw Object.assign(new Error(`HTTP ${n.status} fetching ${this.url}`), {
|
75
|
+
status: n.status
|
76
|
+
});
|
77
|
+
if (t === "utf8")
|
78
|
+
return n.text();
|
79
|
+
if (t)
|
80
|
+
throw new Error(`unsupported encoding: ${t}`);
|
81
|
+
return this.getBufferFromResponse(n);
|
82
|
+
}
|
83
|
+
async stat() {
|
84
|
+
if (!this._stat) {
|
85
|
+
const e = u.Buffer.allocUnsafe(10);
|
86
|
+
if (await this.read(e, 0, 10, 0), !this._stat)
|
87
|
+
throw new Error(`unable to determine size of file at ${this.url}`);
|
88
|
+
}
|
89
|
+
return this._stat;
|
90
|
+
}
|
91
|
+
async close() {
|
92
|
+
}
|
93
|
+
}
|
94
|
+
export {
|
95
|
+
b as R
|
96
|
+
};
|
package/package.json
CHANGED
@@ -7,8 +7,9 @@
|
|
7
7
|
},
|
8
8
|
"contributors": [],
|
9
9
|
"license": "MIT",
|
10
|
-
"version": "0.
|
10
|
+
"version": "0.39.0",
|
11
11
|
"main": "dist/index.js",
|
12
|
+
"type": "module",
|
12
13
|
"files": [
|
13
14
|
"dist/"
|
14
15
|
],
|
@@ -18,25 +19,25 @@
|
|
18
19
|
"directory": "packages/app"
|
19
20
|
},
|
20
21
|
"scripts": {
|
21
|
-
"dev": "node dev-server.
|
22
|
+
"dev": "node dev-server.mjs",
|
22
23
|
"build": "vite build",
|
23
24
|
"test:tsc": "tsc -p tsconfig.json --noEmit",
|
24
25
|
"prepublishOnly": "npm run build"
|
25
26
|
},
|
26
27
|
"dependencies": {
|
27
28
|
"@floating-ui/dom": "^0.5.0",
|
28
|
-
"@fortawesome/fontawesome-free": "^6.
|
29
|
-
"@fortawesome/fontawesome-svg-core": "^6.
|
30
|
-
"@fortawesome/free-solid-svg-icons": "^6.
|
31
|
-
"@genome-spy/core": "^0.
|
29
|
+
"@fortawesome/fontawesome-free": "^6.4.2",
|
30
|
+
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
31
|
+
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
32
|
+
"@genome-spy/core": "^0.39.0",
|
32
33
|
"@reduxjs/toolkit": "^1.8.4",
|
33
|
-
"idb": "^7.
|
34
|
-
"lit": "^
|
34
|
+
"idb": "^7.1.1",
|
35
|
+
"lit": "^3.1.0",
|
35
36
|
"lz-string": "^1.4.4",
|
36
37
|
"mapsort": "^1.0.5",
|
37
38
|
"redux-batched-actions": "^0.5.0",
|
38
39
|
"redux-undo": "^1.0.1",
|
39
40
|
"snarkdown": "^2.0.0"
|
40
41
|
},
|
41
|
-
"gitHead": "
|
42
|
+
"gitHead": "62718f51e03f665435dd2f3b557e20b42df1410e"
|
42
43
|
}
|