@genome-spy/app 0.56.1 → 0.58.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/_commonjsHelpers-DjF3Plf2.js +26 -0
- package/dist/app.css +1 -0
- package/dist/index-BftNdA0O.js +27 -0
- package/dist/index-C08YCM2T.js +539 -0
- package/dist/index-CCJIjehY.js +218 -0
- package/dist/index-CalimFw3.js +2131 -0
- package/dist/index-DS2hvLgl.js +3425 -0
- package/dist/index-DTcHjAHp.js +505 -0
- package/dist/index-Dec7VcMU.js +626 -0
- package/dist/index-DnIkxb0L.js +1025 -0
- package/dist/index-DwLfOHEk.js +1319 -0
- package/dist/{index-HGQZ77IK.js → index-Ww3TAo6_.js} +7 -7
- package/dist/{index-CjesiOz_.js → index-vgGDWUPz.js} +24 -24
- package/dist/index.es.js +9704 -10544
- package/dist/index.js +598 -789
- package/dist/long-BviWyoZx.js +2387 -0
- package/dist/remoteFile-BuaqFGWk.js +94 -0
- package/package.json +3 -3
- package/dist/_commonjsHelpers-DSebQMb9.js +0 -28
- package/dist/index-B6haPltu.js +0 -1042
- package/dist/index-BhtH2nrr.js +0 -513
- package/dist/index-BpoXW6_f.js +0 -1370
- package/dist/index-COovE1Oo.js +0 -3997
- package/dist/index-WACuLhO6.js +0 -2136
- package/dist/index-_ftu0t0z.js +0 -500
- package/dist/index-nCZhu2o-.js +0 -613
- package/dist/long-BXK3UEks.js +0 -2375
- package/dist/remoteFile-DuIsnepi.js +0 -90
- package/dist/style.css +0 -1
@@ -0,0 +1,94 @@
|
|
1
|
+
import { b as d } from "./index-BftNdA0O.js";
|
2
|
+
function u(n) {
|
3
|
+
return (typeof n == "object" && n !== null && "message" in n ? n.message : `${n}`).replace(/\.$/, "");
|
4
|
+
}
|
5
|
+
class $ {
|
6
|
+
async getBufferFromResponse(e) {
|
7
|
+
const t = await e.arrayBuffer();
|
8
|
+
return d.Buffer.from(t);
|
9
|
+
}
|
10
|
+
constructor(e, t = {}) {
|
11
|
+
this.baseOverrides = {}, this.url = e;
|
12
|
+
const r = t.fetch || globalThis.fetch.bind(globalThis);
|
13
|
+
if (!r)
|
14
|
+
throw new TypeError("no fetch function supplied, and none found in global environment");
|
15
|
+
t.overrides && (this.baseOverrides = t.overrides), this.fetchImplementation = r;
|
16
|
+
}
|
17
|
+
async fetch(e, t) {
|
18
|
+
let r;
|
19
|
+
try {
|
20
|
+
r = await this.fetchImplementation(e, t);
|
21
|
+
} catch (s) {
|
22
|
+
if (`${s}`.includes("Failed to fetch")) {
|
23
|
+
console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);
|
24
|
+
try {
|
25
|
+
r = await this.fetchImplementation(e, {
|
26
|
+
...t,
|
27
|
+
cache: "reload"
|
28
|
+
});
|
29
|
+
} catch (i) {
|
30
|
+
throw new Error(`${u(i)} fetching ${e}`, { cause: i });
|
31
|
+
}
|
32
|
+
} else
|
33
|
+
throw new Error(`${u(s)} fetching ${e}`, { cause: s });
|
34
|
+
}
|
35
|
+
return r;
|
36
|
+
}
|
37
|
+
async read(e, t = 0, r, s = 0, i = {}) {
|
38
|
+
const { headers: c = {}, signal: o, overrides: f = {} } = i;
|
39
|
+
r < 1 / 0 ? c.range = `bytes=${s}-${s + r}` : r === 1 / 0 && s !== 0 && (c.range = `bytes=${s}-`);
|
40
|
+
const a = await this.fetch(this.url, {
|
41
|
+
...this.baseOverrides,
|
42
|
+
...f,
|
43
|
+
headers: {
|
44
|
+
...c,
|
45
|
+
...f.headers,
|
46
|
+
...this.baseOverrides.headers
|
47
|
+
},
|
48
|
+
method: "GET",
|
49
|
+
redirect: "follow",
|
50
|
+
mode: "cors",
|
51
|
+
signal: o
|
52
|
+
});
|
53
|
+
if (!a.ok)
|
54
|
+
throw new Error(`HTTP ${a.status} fetching ${this.url}`);
|
55
|
+
if (a.status === 200 && s === 0 || a.status === 206) {
|
56
|
+
const l = await this.getBufferFromResponse(a), g = l.copy(e, t, 0, Math.min(r, l.length)), w = a.headers.get("content-range"), h = /\/(\d+)$/.exec(w || "");
|
57
|
+
return h != null && h[1] && (this._stat = { size: parseInt(h[1], 10) }), { bytesRead: g, buffer: e };
|
58
|
+
}
|
59
|
+
throw a.status === 200 ? new Error(`${this.url} fetch returned status 200, expected 206`) : new Error(`HTTP ${a.status} fetching ${this.url}`);
|
60
|
+
}
|
61
|
+
async readFile(e = {}) {
|
62
|
+
let t, r;
|
63
|
+
typeof e == "string" ? (t = e, r = {}) : (t = e.encoding, r = e, delete r.encoding);
|
64
|
+
const { headers: s = {}, signal: i, overrides: c = {} } = r, o = await this.fetch(this.url, {
|
65
|
+
headers: s,
|
66
|
+
method: "GET",
|
67
|
+
redirect: "follow",
|
68
|
+
mode: "cors",
|
69
|
+
signal: i,
|
70
|
+
...this.baseOverrides,
|
71
|
+
...c
|
72
|
+
});
|
73
|
+
if (o.status !== 200)
|
74
|
+
throw new Error(`HTTP ${o.status} fetching ${this.url}`);
|
75
|
+
if (t === "utf8")
|
76
|
+
return o.text();
|
77
|
+
if (t)
|
78
|
+
throw new Error(`unsupported encoding: ${t}`);
|
79
|
+
return this.getBufferFromResponse(o);
|
80
|
+
}
|
81
|
+
async stat() {
|
82
|
+
if (!this._stat) {
|
83
|
+
const e = d.Buffer.allocUnsafe(10);
|
84
|
+
if (await this.read(e, 0, 10, 0), !this._stat)
|
85
|
+
throw new Error(`unable to determine size of file at ${this.url}`);
|
86
|
+
}
|
87
|
+
return this._stat;
|
88
|
+
}
|
89
|
+
async close() {
|
90
|
+
}
|
91
|
+
}
|
92
|
+
export {
|
93
|
+
$ as R
|
94
|
+
};
|
package/package.json
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
},
|
8
8
|
"contributors": [],
|
9
9
|
"license": "MIT",
|
10
|
-
"version": "0.
|
10
|
+
"version": "0.58.0",
|
11
11
|
"main": "dist/index.js",
|
12
12
|
"type": "module",
|
13
13
|
"files": [
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"@fortawesome/fontawesome-free": "^6.4.2",
|
30
30
|
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
31
31
|
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
32
|
-
"@genome-spy/core": "^0.
|
32
|
+
"@genome-spy/core": "^0.58.0",
|
33
33
|
"@reduxjs/toolkit": "^1.8.4",
|
34
34
|
"idb": "^7.1.1",
|
35
35
|
"lit": "^3.1.2",
|
@@ -39,5 +39,5 @@
|
|
39
39
|
"redux-batched-actions": "^0.5.0",
|
40
40
|
"redux-undo": "^1.0.1"
|
41
41
|
},
|
42
|
-
"gitHead": "
|
42
|
+
"gitHead": "d2a1bbf4fbbab5bf174e890baa0163edc9195155"
|
43
43
|
}
|
@@ -1,28 +0,0 @@
|
|
1
|
-
var u = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
2
|
-
function f(e) {
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
4
|
-
}
|
5
|
-
function s(e) {
|
6
|
-
if (e.__esModule) return e;
|
7
|
-
var r = e.default;
|
8
|
-
if (typeof r == "function") {
|
9
|
-
var t = function o() {
|
10
|
-
return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
|
11
|
-
};
|
12
|
-
t.prototype = r.prototype;
|
13
|
-
} else t = {};
|
14
|
-
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
|
15
|
-
var n = Object.getOwnPropertyDescriptor(e, o);
|
16
|
-
Object.defineProperty(t, o, n.get ? n : {
|
17
|
-
enumerable: !0,
|
18
|
-
get: function() {
|
19
|
-
return e[o];
|
20
|
-
}
|
21
|
-
});
|
22
|
-
}), t;
|
23
|
-
}
|
24
|
-
export {
|
25
|
-
s as a,
|
26
|
-
u as c,
|
27
|
-
f as g
|
28
|
-
};
|