@jbrowse/core 1.6.4 → 1.6.7
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/BaseFeatureWidget/BaseFeatureDetail.js +1 -3
- package/BaseFeatureWidget/index.d.ts +1 -1
- package/PluginLoader.d.ts +1 -1
- package/PluginManager.d.ts +2 -0
- package/ReExports/modules.d.ts +2 -0
- package/TextSearch/TextSearchManager.d.ts +2 -2
- package/assemblyManager/assemblyConfigSchema.d.ts +1 -1
- package/assemblyManager/assemblyManager.d.ts +1 -1
- package/configuration/index.d.ts +1 -1
- package/data_adapters/BaseAdapter.d.ts +2 -1
- package/data_adapters/BaseAdapter.js +29 -3
- package/data_adapters/CytobandAdapter.d.ts +1 -1
- package/package.json +4 -4
- package/pluggableElementTypes/RpcMethodType.js +1 -1
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +103 -7
- package/pluggableElementTypes/models/InternetAccountModel.js +296 -10
- package/pluggableElementTypes/models/baseConnectionConfig.d.ts +1 -1
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +1 -1
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +16 -1
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +1 -1
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +1 -0
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +46 -22
- package/rpc/BaseRpcDriver.d.ts +4 -4
- package/rpc/BaseRpcDriver.js +152 -79
- package/rpc/BaseRpcDriver.test.js +64 -43
- package/rpc/MainThreadRpcDriver.d.ts +1 -1
- package/rpc/MainThreadRpcDriver.js +25 -16
- package/rpc/RpcManager.d.ts +1 -1
- package/rpc/WebWorkerRpcDriver.d.ts +1 -1
- package/rpc/WebWorkerRpcDriver.js +43 -11
- package/rpc/configSchema.d.ts +1 -1
- package/ui/ErrorMessage.js +23 -8
- package/ui/FileSelector/FileSelector.js +1 -1
- package/ui/ReturnToImportFormDialog.d.ts +9 -0
- package/ui/ReturnToImportFormDialog.js +63 -0
- package/ui/Tooltip.d.ts +1 -1
- package/ui/Tooltip.js +2 -2
- package/ui/index.d.ts +2 -0
- package/ui/index.js +18 -0
- package/ui/theme.d.ts +8 -0
- package/ui/theme.js +9 -0
- package/ui/theme.test.js +2 -2
- package/util/Base1DViewModel.d.ts +2 -0
- package/util/Base1DViewModel.js +9 -0
- package/util/index.d.ts +12 -1
- package/util/index.js +52 -17
- package/util/index.test.js +35 -14
- package/util/io/index.d.ts +2 -1
- package/util/io/index.js +95 -96
- package/util/offscreenCanvasPonyfill.d.ts +1 -0
- package/util/offscreenCanvasPonyfill.js +70 -58
- package/util/simpleFeature.d.ts +3 -0
- package/util/types/index.d.ts +2 -2
- package/util/types/index.js +3 -3
- package/babel.config.d.ts +0 -15
- package/babel.config.js +0 -19
package/util/io/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { GenericFilehandle } from 'generic-filehandle';
|
|
1
|
+
import { GenericFilehandle, Fetcher } from 'generic-filehandle';
|
|
2
2
|
import { RemoteFileWithRangeCache } from './RemoteFileWithRangeCache';
|
|
3
3
|
import { FileLocation } from '../types';
|
|
4
4
|
import PluginManager from '../../PluginManager';
|
|
5
5
|
export { RemoteFileWithRangeCache };
|
|
6
6
|
export declare function openLocation(location: FileLocation, pluginManager?: PluginManager): GenericFilehandle;
|
|
7
|
+
export declare function getFetcher(location: FileLocation, pluginManager: PluginManager): Fetcher;
|
package/util/io/index.js
CHANGED
|
@@ -11,12 +11,15 @@ Object.defineProperty(exports, "RemoteFileWithRangeCache", {
|
|
|
11
11
|
return _RemoteFileWithRangeCache.RemoteFileWithRangeCache;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
+
exports.getFetcher = getFetcher;
|
|
14
15
|
exports.openLocation = openLocation;
|
|
15
16
|
|
|
16
17
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
17
18
|
|
|
18
19
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
20
|
|
|
21
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
22
|
+
|
|
20
23
|
var _genericFilehandle = require("generic-filehandle");
|
|
21
24
|
|
|
22
25
|
var _RemoteFileWithRangeCache = require("./RemoteFileWithRangeCache");
|
|
@@ -27,6 +30,10 @@ var _tracks = require("../tracks");
|
|
|
27
30
|
|
|
28
31
|
var _detectNode = _interopRequireDefault(require("detect-node"));
|
|
29
32
|
|
|
33
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
34
|
+
|
|
35
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
36
|
+
|
|
30
37
|
function isLocalPathLocation(location) {
|
|
31
38
|
return 'localPath' in location;
|
|
32
39
|
}
|
|
@@ -36,50 +43,6 @@ function isBlobLocation(location) {
|
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
function openLocation(location, pluginManager) {
|
|
39
|
-
function checkAuthNeededFetch(_x, _x2) {
|
|
40
|
-
return _checkAuthNeededFetch.apply(this, arguments);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _checkAuthNeededFetch() {
|
|
44
|
-
_checkAuthNeededFetch = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url, opts) {
|
|
45
|
-
var response, authHeaders;
|
|
46
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
47
|
-
while (1) {
|
|
48
|
-
switch (_context.prev = _context.next) {
|
|
49
|
-
case 0:
|
|
50
|
-
_context.next = 2;
|
|
51
|
-
return fetch(url, opts);
|
|
52
|
-
|
|
53
|
-
case 2:
|
|
54
|
-
response = _context.sent;
|
|
55
|
-
|
|
56
|
-
if (!(response.status === 401)) {
|
|
57
|
-
_context.next = 7;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
authHeaders = response.headers.get('WWW-Authenticate');
|
|
62
|
-
|
|
63
|
-
if (!((0, _types.isUriLocation)(location) && authHeaders && authHeaders.includes('Basic'))) {
|
|
64
|
-
_context.next = 7;
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
throw new _types.AuthNeededError('Accessing HTTPBasic resource without authentication', location);
|
|
69
|
-
|
|
70
|
-
case 7:
|
|
71
|
-
return _context.abrupt("return", response);
|
|
72
|
-
|
|
73
|
-
case 8:
|
|
74
|
-
case "end":
|
|
75
|
-
return _context.stop();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}, _callee);
|
|
79
|
-
}));
|
|
80
|
-
return _checkAuthNeededFetch.apply(this, arguments);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
46
|
if (!location) {
|
|
84
47
|
throw new Error('must provide a location to openLocation');
|
|
85
48
|
}
|
|
@@ -108,78 +71,114 @@ function openLocation(location, pluginManager) {
|
|
|
108
71
|
}
|
|
109
72
|
|
|
110
73
|
if ((0, _types.isUriLocation)(location)) {
|
|
74
|
+
// Check for empty string
|
|
111
75
|
if (!location.uri) {
|
|
112
76
|
throw new Error('No URI provided');
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (location.internetAccountPreAuthorization) {
|
|
116
|
-
if (!pluginManager) {
|
|
117
|
-
throw new Error('need plugin manager to open locations with an internet account');
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
var rootModel = pluginManager.rootModel;
|
|
77
|
+
} // Resolve any relative URLs to absolute URLs
|
|
121
78
|
|
|
122
|
-
if (rootModel && !(0, _types.isAppRootModel)(rootModel)) {
|
|
123
|
-
throw new Error('This context does not support internet accounts');
|
|
124
|
-
}
|
|
125
79
|
|
|
126
|
-
|
|
80
|
+
var absoluteLocation = location.baseUri ? _objectSpread(_objectSpread({}, location), {}, {
|
|
81
|
+
uri: new URL(location.uri, location.baseUri).href
|
|
82
|
+
}) : location; // If there is a plugin manager, we can try internet accounts
|
|
127
83
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
} else {
|
|
131
|
-
var internetAccountType = pluginManager.getInternetAccountType(location.internetAccountPreAuthorization.internetAccountType);
|
|
132
|
-
internetAccount = internetAccountType.stateModel.create({
|
|
133
|
-
type: location.internetAccountPreAuthorization.internetAccountType,
|
|
134
|
-
configuration: location.internetAccountPreAuthorization.authInfo.configuration
|
|
135
|
-
});
|
|
84
|
+
if (pluginManager) {
|
|
85
|
+
var internetAccount = getInternetAccount(location, pluginManager); // If an internetAccount was found, use it to open the location
|
|
136
86
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
87
|
+
if (internetAccount) {
|
|
88
|
+
return internetAccount.openLocation(absoluteLocation);
|
|
140
89
|
}
|
|
90
|
+
} // Otherwise fall back on usual open
|
|
141
91
|
|
|
142
|
-
if (!internetAccount) {
|
|
143
|
-
throw new Error('Could not find associated internet account');
|
|
144
|
-
}
|
|
145
92
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
93
|
+
return new _RemoteFileWithRangeCache.RemoteFileWithRangeCache(absoluteLocation.uri, {
|
|
94
|
+
fetch: checkAuthNeededFetch
|
|
95
|
+
});
|
|
96
|
+
}
|
|
151
97
|
|
|
152
|
-
|
|
98
|
+
throw new Error('invalid fileLocation');
|
|
99
|
+
}
|
|
153
100
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
101
|
+
function getFetcher(location, pluginManager) {
|
|
102
|
+
if (!(0, _types.isUriLocation)(location)) {
|
|
103
|
+
throw new Error("Not a valid UriLocation: ".concat(JSON.stringify(location)));
|
|
104
|
+
}
|
|
157
105
|
|
|
158
|
-
|
|
159
|
-
var modifiedLocation = JSON.parse(JSON.stringify(location));
|
|
106
|
+
var internetAccount = getInternetAccount(location, pluginManager);
|
|
160
107
|
|
|
161
|
-
|
|
108
|
+
if (internetAccount) {
|
|
109
|
+
return internetAccount.getFetcher(location);
|
|
110
|
+
}
|
|
162
111
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
112
|
+
return checkAuthNeededFetch;
|
|
113
|
+
}
|
|
166
114
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
115
|
+
function getInternetAccount(location, pluginManager) {
|
|
116
|
+
var rootModel = pluginManager.rootModel; // If there is an appRootModel, use it to find the internetAccount
|
|
117
|
+
|
|
118
|
+
if (rootModel && (0, _types.isAppRootModel)(rootModel)) {
|
|
119
|
+
return rootModel.findAppropriateInternetAccount(location);
|
|
120
|
+
} // If there is no appRootModel, but there is pre-auth, create a temporary
|
|
121
|
+
// internetAccount. This is typical in a worker.
|
|
171
122
|
|
|
172
|
-
return _internetAccount.openLocation(modifiedLocation);
|
|
173
|
-
}
|
|
174
123
|
|
|
175
|
-
|
|
124
|
+
if (location.internetAccountPreAuthorization) {
|
|
125
|
+
if (!location.internetAccountPreAuthorization.authInfo.token) {
|
|
126
|
+
throw new Error('Failed to obtain token from internet account. Try reloading the page');
|
|
176
127
|
}
|
|
177
128
|
|
|
178
|
-
var
|
|
179
|
-
return
|
|
180
|
-
|
|
129
|
+
var internetAccountType = pluginManager.getInternetAccountType(location.internetAccountPreAuthorization.internetAccountType);
|
|
130
|
+
return internetAccountType.stateModel.create({
|
|
131
|
+
type: location.internetAccountPreAuthorization.internetAccountType,
|
|
132
|
+
configuration: location.internetAccountPreAuthorization.authInfo.configuration
|
|
181
133
|
});
|
|
182
134
|
}
|
|
183
135
|
|
|
184
|
-
|
|
136
|
+
return;
|
|
137
|
+
} // This fetch throws a special error if the response is "401" and includes a
|
|
138
|
+
// "WWW-Authenticate: Basic" header. This is so downstream code can retry if
|
|
139
|
+
// needed with HTTP Basic authentication included
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
function checkAuthNeededFetch(_x, _x2) {
|
|
143
|
+
return _checkAuthNeededFetch.apply(this, arguments);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function _checkAuthNeededFetch() {
|
|
147
|
+
_checkAuthNeededFetch = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url, opts) {
|
|
148
|
+
var response, authHeaders;
|
|
149
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
150
|
+
while (1) {
|
|
151
|
+
switch (_context.prev = _context.next) {
|
|
152
|
+
case 0:
|
|
153
|
+
_context.next = 2;
|
|
154
|
+
return fetch(url, opts);
|
|
155
|
+
|
|
156
|
+
case 2:
|
|
157
|
+
response = _context.sent;
|
|
158
|
+
|
|
159
|
+
if (!(response.status === 401)) {
|
|
160
|
+
_context.next = 7;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
authHeaders = response.headers.get('WWW-Authenticate');
|
|
165
|
+
|
|
166
|
+
if (!(authHeaders && authHeaders.includes('Basic'))) {
|
|
167
|
+
_context.next = 7;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
throw new _types.AuthNeededError('Accessing HTTPBasic resource without authentication', url.toString());
|
|
172
|
+
|
|
173
|
+
case 7:
|
|
174
|
+
return _context.abrupt("return", response);
|
|
175
|
+
|
|
176
|
+
case 8:
|
|
177
|
+
case "end":
|
|
178
|
+
return _context.stop();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}, _callee);
|
|
182
|
+
}));
|
|
183
|
+
return _checkAuthNeededFetch.apply(this, arguments);
|
|
185
184
|
}
|
|
@@ -14,6 +14,7 @@ export class PonyfillOffscreenContext {
|
|
|
14
14
|
set font(arg: any);
|
|
15
15
|
arc(...args: any[]): void;
|
|
16
16
|
arcTo(...args: any[]): void;
|
|
17
|
+
bezierCurveTo(...args: any[]): void;
|
|
17
18
|
beginPath(...args: any[]): void;
|
|
18
19
|
clearRect(...args: any[]): void;
|
|
19
20
|
clip(...args: any[]): void;
|
|
@@ -111,12 +111,24 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
}, {
|
|
114
|
-
key: "
|
|
115
|
-
value: function
|
|
114
|
+
key: "bezierCurveTo",
|
|
115
|
+
value: function bezierCurveTo() {
|
|
116
116
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
117
117
|
args[_key3] = arguments[_key3];
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
this.commands.push({
|
|
121
|
+
type: 'bezierCurveTo',
|
|
122
|
+
args: args
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
key: "beginPath",
|
|
127
|
+
value: function beginPath() {
|
|
128
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
129
|
+
args[_key4] = arguments[_key4];
|
|
130
|
+
}
|
|
131
|
+
|
|
120
132
|
this.commands.push({
|
|
121
133
|
type: 'beginPath',
|
|
122
134
|
args: args
|
|
@@ -125,8 +137,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
125
137
|
}, {
|
|
126
138
|
key: "clearRect",
|
|
127
139
|
value: function clearRect() {
|
|
128
|
-
for (var
|
|
129
|
-
args[
|
|
140
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
141
|
+
args[_key5] = arguments[_key5];
|
|
130
142
|
}
|
|
131
143
|
|
|
132
144
|
this.commands.push({
|
|
@@ -137,8 +149,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
137
149
|
}, {
|
|
138
150
|
key: "clip",
|
|
139
151
|
value: function clip() {
|
|
140
|
-
for (var
|
|
141
|
-
args[
|
|
152
|
+
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
153
|
+
args[_key6] = arguments[_key6];
|
|
142
154
|
}
|
|
143
155
|
|
|
144
156
|
this.commands.push({
|
|
@@ -149,8 +161,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
149
161
|
}, {
|
|
150
162
|
key: "closePath",
|
|
151
163
|
value: function closePath() {
|
|
152
|
-
for (var
|
|
153
|
-
args[
|
|
164
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
165
|
+
args[_key7] = arguments[_key7];
|
|
154
166
|
}
|
|
155
167
|
|
|
156
168
|
this.commands.push({
|
|
@@ -161,8 +173,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
161
173
|
}, {
|
|
162
174
|
key: "createLinearGradient",
|
|
163
175
|
value: function createLinearGradient() {
|
|
164
|
-
for (var
|
|
165
|
-
args[
|
|
176
|
+
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
|
177
|
+
args[_key8] = arguments[_key8];
|
|
166
178
|
}
|
|
167
179
|
|
|
168
180
|
this.commands.push({
|
|
@@ -173,8 +185,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
173
185
|
}, {
|
|
174
186
|
key: "createPattern",
|
|
175
187
|
value: function createPattern() {
|
|
176
|
-
for (var
|
|
177
|
-
args[
|
|
188
|
+
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
|
189
|
+
args[_key9] = arguments[_key9];
|
|
178
190
|
}
|
|
179
191
|
|
|
180
192
|
this.commands.push({
|
|
@@ -185,8 +197,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
185
197
|
}, {
|
|
186
198
|
key: "createRadialGradient",
|
|
187
199
|
value: function createRadialGradient() {
|
|
188
|
-
for (var
|
|
189
|
-
args[
|
|
200
|
+
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
|
201
|
+
args[_key10] = arguments[_key10];
|
|
190
202
|
}
|
|
191
203
|
|
|
192
204
|
this.commands.push({
|
|
@@ -197,8 +209,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
197
209
|
}, {
|
|
198
210
|
key: "drawFocusIfNeeded",
|
|
199
211
|
value: function drawFocusIfNeeded() {
|
|
200
|
-
for (var
|
|
201
|
-
args[
|
|
212
|
+
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
|
213
|
+
args[_key11] = arguments[_key11];
|
|
202
214
|
}
|
|
203
215
|
|
|
204
216
|
this.commands.push({
|
|
@@ -209,8 +221,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
209
221
|
}, {
|
|
210
222
|
key: "drawImage",
|
|
211
223
|
value: function drawImage() {
|
|
212
|
-
for (var
|
|
213
|
-
args[
|
|
224
|
+
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
|
225
|
+
args[_key12] = arguments[_key12];
|
|
214
226
|
}
|
|
215
227
|
|
|
216
228
|
this.commands.push({
|
|
@@ -221,8 +233,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
221
233
|
}, {
|
|
222
234
|
key: "ellipse",
|
|
223
235
|
value: function ellipse() {
|
|
224
|
-
for (var
|
|
225
|
-
args[
|
|
236
|
+
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
|
237
|
+
args[_key13] = arguments[_key13];
|
|
226
238
|
}
|
|
227
239
|
|
|
228
240
|
this.commands.push({
|
|
@@ -233,8 +245,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
233
245
|
}, {
|
|
234
246
|
key: "fill",
|
|
235
247
|
value: function fill() {
|
|
236
|
-
for (var
|
|
237
|
-
args[
|
|
248
|
+
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
|
249
|
+
args[_key14] = arguments[_key14];
|
|
238
250
|
}
|
|
239
251
|
|
|
240
252
|
this.commands.push({
|
|
@@ -245,21 +257,21 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
245
257
|
}, {
|
|
246
258
|
key: "fillRect",
|
|
247
259
|
value: function fillRect() {
|
|
248
|
-
for (var
|
|
249
|
-
args[
|
|
260
|
+
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
|
261
|
+
args[_key15] = arguments[_key15];
|
|
250
262
|
}
|
|
251
263
|
|
|
252
264
|
var x = args[0],
|
|
253
265
|
y = args[1],
|
|
254
266
|
w = args[2],
|
|
255
|
-
h = args[3];
|
|
267
|
+
h = args[3]; // avoid rendering offscreen contents
|
|
256
268
|
|
|
257
269
|
if (x > this.width || x + w < 0) {
|
|
258
270
|
return;
|
|
259
271
|
}
|
|
260
272
|
|
|
261
273
|
var nx = Math.max(x, 0);
|
|
262
|
-
var nw =
|
|
274
|
+
var nw = w - (nx - x);
|
|
263
275
|
this.commands.push({
|
|
264
276
|
type: 'fillRect',
|
|
265
277
|
args: [nx, y, nw, h]
|
|
@@ -268,8 +280,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
268
280
|
}, {
|
|
269
281
|
key: "fillText",
|
|
270
282
|
value: function fillText() {
|
|
271
|
-
for (var
|
|
272
|
-
args[
|
|
283
|
+
for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
|
|
284
|
+
args[_key16] = arguments[_key16];
|
|
273
285
|
}
|
|
274
286
|
|
|
275
287
|
// if (x > this.width || x + 1000 < 0) {
|
|
@@ -283,8 +295,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
283
295
|
}, {
|
|
284
296
|
key: "lineTo",
|
|
285
297
|
value: function lineTo() {
|
|
286
|
-
for (var
|
|
287
|
-
args[
|
|
298
|
+
for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
|
|
299
|
+
args[_key17] = arguments[_key17];
|
|
288
300
|
}
|
|
289
301
|
|
|
290
302
|
this.commands.push({
|
|
@@ -304,8 +316,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
304
316
|
}, {
|
|
305
317
|
key: "moveTo",
|
|
306
318
|
value: function moveTo() {
|
|
307
|
-
for (var
|
|
308
|
-
args[
|
|
319
|
+
for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
|
|
320
|
+
args[_key18] = arguments[_key18];
|
|
309
321
|
}
|
|
310
322
|
|
|
311
323
|
this.commands.push({
|
|
@@ -316,8 +328,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
316
328
|
}, {
|
|
317
329
|
key: "quadraticCurveTo",
|
|
318
330
|
value: function quadraticCurveTo() {
|
|
319
|
-
for (var
|
|
320
|
-
args[
|
|
331
|
+
for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
|
|
332
|
+
args[_key19] = arguments[_key19];
|
|
321
333
|
}
|
|
322
334
|
|
|
323
335
|
this.commands.push({
|
|
@@ -328,8 +340,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
328
340
|
}, {
|
|
329
341
|
key: "rect",
|
|
330
342
|
value: function rect() {
|
|
331
|
-
for (var
|
|
332
|
-
args[
|
|
343
|
+
for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
|
|
344
|
+
args[_key20] = arguments[_key20];
|
|
333
345
|
}
|
|
334
346
|
|
|
335
347
|
this.commands.push({
|
|
@@ -340,8 +352,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
340
352
|
}, {
|
|
341
353
|
key: "restore",
|
|
342
354
|
value: function restore() {
|
|
343
|
-
for (var
|
|
344
|
-
args[
|
|
355
|
+
for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
|
|
356
|
+
args[_key21] = arguments[_key21];
|
|
345
357
|
}
|
|
346
358
|
|
|
347
359
|
this.commands.push({
|
|
@@ -352,8 +364,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
352
364
|
}, {
|
|
353
365
|
key: "rotate",
|
|
354
366
|
value: function rotate() {
|
|
355
|
-
for (var
|
|
356
|
-
args[
|
|
367
|
+
for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
|
|
368
|
+
args[_key22] = arguments[_key22];
|
|
357
369
|
}
|
|
358
370
|
|
|
359
371
|
this.commands.push({
|
|
@@ -364,8 +376,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
364
376
|
}, {
|
|
365
377
|
key: "save",
|
|
366
378
|
value: function save() {
|
|
367
|
-
for (var
|
|
368
|
-
args[
|
|
379
|
+
for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
|
|
380
|
+
args[_key23] = arguments[_key23];
|
|
369
381
|
}
|
|
370
382
|
|
|
371
383
|
this.commands.push({
|
|
@@ -376,8 +388,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
376
388
|
}, {
|
|
377
389
|
key: "setLineDash",
|
|
378
390
|
value: function setLineDash() {
|
|
379
|
-
for (var
|
|
380
|
-
args[
|
|
391
|
+
for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {
|
|
392
|
+
args[_key24] = arguments[_key24];
|
|
381
393
|
}
|
|
382
394
|
|
|
383
395
|
this.commands.push({
|
|
@@ -388,8 +400,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
388
400
|
}, {
|
|
389
401
|
key: "setTransform",
|
|
390
402
|
value: function setTransform() {
|
|
391
|
-
for (var
|
|
392
|
-
args[
|
|
403
|
+
for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) {
|
|
404
|
+
args[_key25] = arguments[_key25];
|
|
393
405
|
}
|
|
394
406
|
|
|
395
407
|
this.commands.push({
|
|
@@ -400,8 +412,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
400
412
|
}, {
|
|
401
413
|
key: "scale",
|
|
402
414
|
value: function scale() {
|
|
403
|
-
for (var
|
|
404
|
-
args[
|
|
415
|
+
for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {
|
|
416
|
+
args[_key26] = arguments[_key26];
|
|
405
417
|
}
|
|
406
418
|
|
|
407
419
|
this.commands.push({
|
|
@@ -412,8 +424,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
412
424
|
}, {
|
|
413
425
|
key: "stroke",
|
|
414
426
|
value: function stroke() {
|
|
415
|
-
for (var
|
|
416
|
-
args[
|
|
427
|
+
for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) {
|
|
428
|
+
args[_key27] = arguments[_key27];
|
|
417
429
|
}
|
|
418
430
|
|
|
419
431
|
this.commands.push({
|
|
@@ -424,8 +436,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
424
436
|
}, {
|
|
425
437
|
key: "strokeRect",
|
|
426
438
|
value: function strokeRect() {
|
|
427
|
-
for (var
|
|
428
|
-
args[
|
|
439
|
+
for (var _len28 = arguments.length, args = new Array(_len28), _key28 = 0; _key28 < _len28; _key28++) {
|
|
440
|
+
args[_key28] = arguments[_key28];
|
|
429
441
|
}
|
|
430
442
|
|
|
431
443
|
this.commands.push({
|
|
@@ -436,8 +448,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
436
448
|
}, {
|
|
437
449
|
key: "strokeText",
|
|
438
450
|
value: function strokeText() {
|
|
439
|
-
for (var
|
|
440
|
-
args[
|
|
451
|
+
for (var _len29 = arguments.length, args = new Array(_len29), _key29 = 0; _key29 < _len29; _key29++) {
|
|
452
|
+
args[_key29] = arguments[_key29];
|
|
441
453
|
}
|
|
442
454
|
|
|
443
455
|
this.commands.push({
|
|
@@ -448,8 +460,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
448
460
|
}, {
|
|
449
461
|
key: "transform",
|
|
450
462
|
value: function transform() {
|
|
451
|
-
for (var
|
|
452
|
-
args[
|
|
463
|
+
for (var _len30 = arguments.length, args = new Array(_len30), _key30 = 0; _key30 < _len30; _key30++) {
|
|
464
|
+
args[_key30] = arguments[_key30];
|
|
453
465
|
}
|
|
454
466
|
|
|
455
467
|
this.commands.push({
|
|
@@ -460,8 +472,8 @@ var PonyfillOffscreenContext = /*#__PURE__*/function () {
|
|
|
460
472
|
}, {
|
|
461
473
|
key: "translate",
|
|
462
474
|
value: function translate() {
|
|
463
|
-
for (var
|
|
464
|
-
args[
|
|
475
|
+
for (var _len31 = arguments.length, args = new Array(_len31), _key31 = 0; _key31 < _len31; _key31++) {
|
|
476
|
+
args[_key31] = arguments[_key31];
|
|
465
477
|
}
|
|
466
478
|
|
|
467
479
|
this.commands.push({
|
package/util/simpleFeature.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export interface Feature {
|
|
|
6
6
|
* Get a piece of data about the feature. All features must have
|
|
7
7
|
* 'start' and 'end', but everything else is optional.
|
|
8
8
|
*/
|
|
9
|
+
get(name: 'refName'): string;
|
|
10
|
+
get(name: 'start'): number;
|
|
11
|
+
get(name: 'end'): number;
|
|
9
12
|
get(name: string): any;
|
|
10
13
|
/**
|
|
11
14
|
* Set an item of data.
|
package/util/types/index.d.ts
CHANGED
|
@@ -186,8 +186,8 @@ export interface UriLocation extends SnapshotIn<typeof MUUriLocation> {
|
|
|
186
186
|
export declare function isUriLocation(location: unknown): location is UriLocation;
|
|
187
187
|
export declare class AuthNeededError extends Error {
|
|
188
188
|
message: string;
|
|
189
|
-
|
|
190
|
-
constructor(message: string,
|
|
189
|
+
url: string;
|
|
190
|
+
constructor(message: string, url: string);
|
|
191
191
|
}
|
|
192
192
|
export declare class RetryError extends Error {
|
|
193
193
|
message: string;
|
package/util/types/index.js
CHANGED
|
@@ -158,13 +158,13 @@ var AuthNeededError = /*#__PURE__*/function (_Error) {
|
|
|
158
158
|
|
|
159
159
|
var _super = _createSuper(AuthNeededError);
|
|
160
160
|
|
|
161
|
-
function AuthNeededError(message,
|
|
161
|
+
function AuthNeededError(message, url) {
|
|
162
162
|
var _this;
|
|
163
163
|
|
|
164
164
|
(0, _classCallCheck2.default)(this, AuthNeededError);
|
|
165
165
|
_this = _super.call(this, message);
|
|
166
166
|
_this.message = message;
|
|
167
|
-
_this.
|
|
167
|
+
_this.url = url;
|
|
168
168
|
_this.name = 'AuthNeededError';
|
|
169
169
|
Object.setPrototypeOf((0, _assertThisInitialized2.default)(_this), AuthNeededError.prototype);
|
|
170
170
|
return _this;
|
|
@@ -198,7 +198,7 @@ exports.RetryError = RetryError;
|
|
|
198
198
|
|
|
199
199
|
function isAuthNeededException(exception) {
|
|
200
200
|
return exception instanceof Error && ( // DOMException
|
|
201
|
-
exception.name === 'AuthNeededError' || exception.
|
|
201
|
+
exception.name === 'AuthNeededError' || exception.url !== undefined);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
function isRetryException(exception) {
|
package/babel.config.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare function _exports(api: any): {
|
|
2
|
-
babelrcRoots: string[];
|
|
3
|
-
comments: boolean;
|
|
4
|
-
presets: (string | (string | {
|
|
5
|
-
targets: {
|
|
6
|
-
node: number;
|
|
7
|
-
browsers: string[];
|
|
8
|
-
};
|
|
9
|
-
})[])[];
|
|
10
|
-
ignore: string[];
|
|
11
|
-
plugins: (string | (string | {
|
|
12
|
-
useESModules: boolean;
|
|
13
|
-
})[])[];
|
|
14
|
-
};
|
|
15
|
-
export = _exports;
|