@jbrowse/core 2.4.0 → 2.4.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/BaseFeatureWidget/BaseFeatureDetail.js +13 -9
- package/BaseFeatureWidget/SequencePanel.js +1 -1
- package/BaseFeatureWidget/index.js +2 -2
- package/PluginLoader.js +8 -8
- package/PluginManager.d.ts +1 -1
- package/PluginManager.js +2 -3
- package/ReExports/Attributes.d.ts +1 -2
- package/ReExports/Attributes.js +4 -3
- package/ReExports/BaseCard.d.ts +1 -2
- package/ReExports/BaseCard.js +4 -3
- package/ReExports/DataGrid.d.ts +1 -2
- package/ReExports/DataGrid.js +2 -2
- package/ReExports/FeatureDetails.d.ts +1 -2
- package/ReExports/FeatureDetails.js +4 -3
- package/ReExports/index.d.ts +1 -2
- package/ReExports/index.js +3 -2
- package/ReExports/modules.d.ts +1 -1
- package/ReExports/modules.js +2 -2
- package/assemblyManager/assembly.js +5 -5
- package/assemblyManager/assemblyConfigSchema.js +2 -2
- package/configuration/configurationSchema.js +1 -1
- package/configuration/util.js +1 -1
- package/data_adapters/BaseAdapter.js +1 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +1 -1
- package/data_adapters/dataAdapterCache.d.ts +3 -2
- package/data_adapters/dataAdapterCache.js +2 -3
- package/package.json +2 -2
- package/pluggableElementTypes/RpcMethodType.js +1 -1
- package/pluggableElementTypes/index.d.ts +11 -1
- package/pluggableElementTypes/index.js +23 -23
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +2 -2
- package/pluggableElementTypes/models/BaseTrackModel.js +8 -13
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +2 -2
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +1 -3
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/index.d.ts +7 -9
- package/pluggableElementTypes/renderers/index.js +15 -15
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +1 -1
- package/rpc/BaseRpcDriver.js +7 -8
- package/rpc/WebWorkerRpcDriver.js +18 -12
- package/rpc/coreRpcMethods.d.ts +9 -11
- package/rpc/coreRpcMethods.js +17 -17
- package/rpc/methods/CoreGetFeatureDetails.js +1 -1
- package/rpc/methods/util.d.ts +2 -2
- package/rpc/methods/util.js +2 -2
- package/rpc/remoteAbortSignals.js +0 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/App.js +1 -1
- package/ui/AppLogo.js +1 -6
- package/ui/ColorPicker.js +1 -1
- package/ui/Dialog.js +1 -1
- package/ui/DrawerWidget.js +4 -4
- package/ui/EditableTypography.js +1 -1
- package/ui/FileSelector/FileSelector.d.ts +2 -2
- package/ui/FileSelector/FileSelector.js +24 -35
- package/ui/FileSelector/index.d.ts +1 -2
- package/ui/FileSelector/index.js +3 -2
- package/ui/LoadingEllipses.js +4 -4
- package/ui/Menu.js +45 -32
- package/ui/ResizeBar.js +6 -1
- package/ui/ResizeHandle.js +3 -6
- package/ui/ViewContainer.js +4 -6
- package/ui/theme.js +7 -7
- package/util/Base1DUtils.js +16 -14
- package/util/Base1DViewModel.d.ts +1 -1
- package/util/Base1DViewModel.js +9 -8
- package/util/aborting.js +1 -1
- package/util/analytics.js +1 -1
- package/util/blockTypes.js +10 -10
- package/util/color/index.d.ts +1 -2
- package/util/color/index.js +4 -3
- package/util/idMaker.js +5 -8
- package/util/index.d.ts +6 -7
- package/util/index.js +25 -48
- package/util/io/RemoteFileWithRangeCache.js +2 -2
- package/util/io/index.d.ts +1 -2
- package/util/io/index.js +6 -6
- package/util/jexl.js +3 -1
- package/util/layouts/GranularRectLayout.js +10 -4
- package/util/layouts/MultiLayout.js +1 -1
- package/util/layouts/SceneGraph.js +3 -7
- package/util/offscreenCanvasPonyfill.js +4 -3
- package/util/offscreenCanvasUtils.js +1 -0
- package/util/tracks.d.ts +1 -1
- package/util/tracks.js +0 -1
- package/util/types/index.d.ts +1 -1
- package/util/types/index.js +3 -3
- package/util/types/mst.js +3 -3
package/util/color/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { namedColorToHex, isNamedColor } from './cssColorsLevel4';
|
|
2
|
-
export { namedColorToHex, isNamedColor };
|
|
3
1
|
/**
|
|
4
2
|
* Algorithmically pick a contrasting text color that will
|
|
5
3
|
* be visible on top of the given background color. Either
|
|
@@ -22,3 +20,4 @@ export declare function contrastingTextColor(color: string): string;
|
|
|
22
20
|
*/
|
|
23
21
|
export declare function emphasize(color: string, coefficient?: number): string;
|
|
24
22
|
export declare function makeContrasting(foreground: string, background?: string, minContrastRatio?: number): string;
|
|
23
|
+
export { isNamedColor, namedColorToHex } from './cssColorsLevel4';
|
package/util/color/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.namedColorToHex = exports.isNamedColor = exports.makeContrasting = exports.emphasize = exports.contrastingTextColor = void 0;
|
|
4
4
|
const styles_1 = require("@mui/material/styles");
|
|
5
5
|
const cssColorsLevel4_1 = require("./cssColorsLevel4");
|
|
6
|
-
Object.defineProperty(exports, "namedColorToHex", { enumerable: true, get: function () { return cssColorsLevel4_1.namedColorToHex; } });
|
|
7
|
-
Object.defineProperty(exports, "isNamedColor", { enumerable: true, get: function () { return cssColorsLevel4_1.isNamedColor; } });
|
|
8
6
|
/**
|
|
9
7
|
* Algorithmically pick a contrasting text color that will
|
|
10
8
|
* be visible on top of the given background color. Either
|
|
@@ -67,3 +65,6 @@ function makeContrasting(foreground, background = 'white', minContrastRatio = 3)
|
|
|
67
65
|
return convertedForeground;
|
|
68
66
|
}
|
|
69
67
|
exports.makeContrasting = makeContrasting;
|
|
68
|
+
var cssColorsLevel4_2 = require("./cssColorsLevel4");
|
|
69
|
+
Object.defineProperty(exports, "isNamedColor", { enumerable: true, get: function () { return cssColorsLevel4_2.isNamedColor; } });
|
|
70
|
+
Object.defineProperty(exports, "namedColorToHex", { enumerable: true, get: function () { return cssColorsLevel4_2.namedColorToHex; } });
|
package/util/idMaker.js
CHANGED
|
@@ -7,17 +7,14 @@ const _1 = require("./");
|
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
8
|
function idMaker(args, id = '') {
|
|
9
9
|
const keys = Object.keys(args);
|
|
10
|
-
for (
|
|
11
|
-
const key = keys[i];
|
|
10
|
+
for (const key of keys) {
|
|
12
11
|
if (id.length > 5000) {
|
|
13
12
|
break;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
id += `${key}-${args[key]};`;
|
|
20
|
-
}
|
|
14
|
+
id +=
|
|
15
|
+
typeof args[key] === 'object' && args[key]
|
|
16
|
+
? idMaker(args[key], id)
|
|
17
|
+
: `${key}-${args[key]};`;
|
|
21
18
|
}
|
|
22
19
|
return (0, _1.hashCode)(id);
|
|
23
20
|
}
|
package/util/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import PluginManager from '../PluginManager';
|
|
2
2
|
import { IAnyStateTreeNode, IStateTreeNode } from 'mobx-state-tree';
|
|
3
3
|
import { IReactionPublic, IReactionOptions } from 'mobx';
|
|
4
|
-
import
|
|
4
|
+
import { Feature } from './simpleFeature';
|
|
5
5
|
import { AssemblyManager, Region, TypeTestedByPredicate } from './types';
|
|
6
6
|
import { BaseBlock } from './blockTypes';
|
|
7
7
|
export * from './types';
|
|
@@ -9,8 +9,6 @@ export * from './aborting';
|
|
|
9
9
|
export * from './when';
|
|
10
10
|
export * from './range';
|
|
11
11
|
export * from './dedupe';
|
|
12
|
-
export { SimpleFeature, isFeature };
|
|
13
|
-
export type { Feature, SimpleFeatureSerialized };
|
|
14
12
|
export * from './offscreenCanvasPonyfill';
|
|
15
13
|
export * from './offscreenCanvasUtils';
|
|
16
14
|
export declare const inDevelopment: boolean;
|
|
@@ -286,7 +284,7 @@ export declare const defaultCodonTable: {
|
|
|
286
284
|
export declare function generateCodonTable(table: any): {
|
|
287
285
|
[key: string]: string;
|
|
288
286
|
};
|
|
289
|
-
export declare function updateStatus<U>(msg: string, cb: (arg: string) => void, fn: () => U): Promise<U>;
|
|
287
|
+
export declare function updateStatus<U>(msg: string, cb: (arg: string) => void, fn: () => U | Promise<U>): Promise<U>;
|
|
290
288
|
export declare function hashCode(str: string): number;
|
|
291
289
|
export declare function objectHash(obj: Record<string, any>): string;
|
|
292
290
|
interface VirtualOffset {
|
|
@@ -324,8 +322,8 @@ export declare function getTickDisplayStr(totalBp: number, bpPerPx: number): str
|
|
|
324
322
|
export declare function getViewParams(model: IAnyStateTreeNode, exportSVG?: boolean): {
|
|
325
323
|
offsetPx: number;
|
|
326
324
|
offsetPx1: number;
|
|
327
|
-
start:
|
|
328
|
-
end:
|
|
325
|
+
start: number;
|
|
326
|
+
end: number;
|
|
329
327
|
};
|
|
330
328
|
export declare function getLayoutId({ sessionId, layoutId, }: {
|
|
331
329
|
sessionId: string;
|
|
@@ -337,7 +335,7 @@ export declare function getUriLink(value: {
|
|
|
337
335
|
baseUri?: string;
|
|
338
336
|
}): string;
|
|
339
337
|
export declare function getStr(obj: unknown): string;
|
|
340
|
-
export declare function measureGridWidth(elements:
|
|
338
|
+
export declare function measureGridWidth(elements: unknown[], args?: {
|
|
341
339
|
minWidth?: number;
|
|
342
340
|
fontSize?: number;
|
|
343
341
|
maxWidth?: number;
|
|
@@ -353,3 +351,4 @@ export declare function max(arr: number[], init?: number): number;
|
|
|
353
351
|
export declare function min(arr: number[], init?: number): number;
|
|
354
352
|
export declare function sum(arr: number[]): number;
|
|
355
353
|
export declare function avg(arr: number[]): number;
|
|
354
|
+
export { default as SimpleFeature, type Feature, type SimpleFeatureSerialized, isFeature, } from './simpleFeature';
|
package/util/index.js
CHANGED
|
@@ -10,18 +10,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
15
|
};
|
|
@@ -29,16 +17,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
18
|
};
|
|
31
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.bytesForRegions = exports.objectHash = exports.hashCode = exports.updateStatus = exports.generateCodonTable = exports.defaultCodonTable = exports.defaultStops = exports.defaultStarts = exports.measureText = exports.rIC = exports.blobToDataURL = exports.complement = exports.reverse = exports.revcom = exports.isElectron = exports.stringify = exports.shorten = exports.minmax = exports.renameRegionsIfNeeded = exports.renameRegionIfNeeded = exports.makeAbortableReaction = exports.findLastIndex = exports.iterMap = exports.bpSpanPx = exports.featureSpanPx = exports.cartesianToPolar = exports.polarToCartesian = exports.degToRad = exports.radToDeg = exports.bpToPx = exports.clamp = exports.compareLocStrings = exports.compareLocs = exports.parseLocString = exports.parseLocStringOneBased = exports.assembleLocStringFast = exports.assembleLocString = exports.getContainingDisplay = exports.getContainingTrack = exports.getContainingView = exports.getSession = exports.findParentThatIs = exports.springAnimate = exports.findParentThat = exports.useDebouncedCallback = exports.useDebounce = exports.inProduction = exports.inDevelopment =
|
|
33
|
-
exports.avg = exports.sum = exports.min = exports.max = exports.localStorageSetItem = exports.localStorageGetItem = exports.getEnv = exports.measureGridWidth = exports.getStr = exports.getUriLink = exports.useLocalStorage = exports.getLayoutId = exports.getViewParams = exports.getTickDisplayStr = exports.toLocale =
|
|
20
|
+
exports.getBpDisplayStr = exports.supportedIndexingAdapters = exports.bytesForRegions = exports.objectHash = exports.hashCode = exports.updateStatus = exports.generateCodonTable = exports.defaultCodonTable = exports.defaultStops = exports.defaultStarts = exports.measureText = exports.rIC = exports.blobToDataURL = exports.complement = exports.reverse = exports.revcom = exports.isElectron = exports.stringify = exports.shorten = exports.minmax = exports.renameRegionsIfNeeded = exports.renameRegionIfNeeded = exports.makeAbortableReaction = exports.findLastIndex = exports.iterMap = exports.bpSpanPx = exports.featureSpanPx = exports.cartesianToPolar = exports.polarToCartesian = exports.degToRad = exports.radToDeg = exports.bpToPx = exports.clamp = exports.compareLocStrings = exports.compareLocs = exports.parseLocString = exports.parseLocStringOneBased = exports.assembleLocStringFast = exports.assembleLocString = exports.getContainingDisplay = exports.getContainingTrack = exports.getContainingView = exports.getSession = exports.findParentThatIs = exports.springAnimate = exports.findParentThat = exports.useDebouncedCallback = exports.useDebounce = exports.inProduction = exports.inDevelopment = void 0;
|
|
21
|
+
exports.isFeature = exports.SimpleFeature = exports.avg = exports.sum = exports.min = exports.max = exports.localStorageSetItem = exports.localStorageGetItem = exports.getEnv = exports.measureGridWidth = exports.getStr = exports.getUriLink = exports.useLocalStorage = exports.getLayoutId = exports.getViewParams = exports.getTickDisplayStr = exports.toLocale = void 0;
|
|
34
22
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
35
23
|
const react_1 = require("react");
|
|
36
24
|
const is_object_1 = __importDefault(require("is-object"));
|
|
37
25
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
38
26
|
const mobx_1 = require("mobx");
|
|
39
|
-
const simpleFeature_1 = __importStar(require("./simpleFeature"));
|
|
40
|
-
exports.SimpleFeature = simpleFeature_1.default;
|
|
41
|
-
Object.defineProperty(exports, "isFeature", { enumerable: true, get: function () { return simpleFeature_1.isFeature; } });
|
|
42
27
|
const types_1 = require("./types");
|
|
43
28
|
const aborting_1 = require("./aborting");
|
|
44
29
|
const types_2 = require("./types");
|
|
@@ -278,12 +263,12 @@ function parseLocStringOneBased(locString, isValidRefName) {
|
|
|
278
263
|
let reversed = false;
|
|
279
264
|
if (locString.endsWith('[rev]')) {
|
|
280
265
|
reversed = true;
|
|
281
|
-
locString = locString.replace(/\[rev
|
|
266
|
+
locString = locString.replace(/\[rev]$/, '');
|
|
282
267
|
}
|
|
283
268
|
// remove any whitespace
|
|
284
269
|
locString = locString.replace(/\s/, '');
|
|
285
270
|
// refNames can have colons, ref https://samtools.github.io/hts-specs/SAMv1.pdf Appendix A
|
|
286
|
-
const assemblyMatch = locString.match(/(
|
|
271
|
+
const assemblyMatch = locString.match(/({(.+)})?(.+)/);
|
|
287
272
|
if (!assemblyMatch) {
|
|
288
273
|
throw new Error(`invalid location string: "${locString}"`);
|
|
289
274
|
}
|
|
@@ -465,8 +450,8 @@ function bpToPx(bp, { reversed, end = 0, start = 0, }, bpPerPx) {
|
|
|
465
450
|
return roundToNearestPointOne((reversed ? end - bp : bp - start) / bpPerPx);
|
|
466
451
|
}
|
|
467
452
|
exports.bpToPx = bpToPx;
|
|
468
|
-
const oneEightyOverPi = 180
|
|
469
|
-
const piOverOneEighty = Math.PI / 180
|
|
453
|
+
const oneEightyOverPi = 180 / Math.PI;
|
|
454
|
+
const piOverOneEighty = Math.PI / 180;
|
|
470
455
|
function radToDeg(radians) {
|
|
471
456
|
return (radians * oneEightyOverPi) % 360;
|
|
472
457
|
}
|
|
@@ -505,7 +490,7 @@ function bpSpanPx(leftBp, rightBp, region, bpPerPx) {
|
|
|
505
490
|
exports.bpSpanPx = bpSpanPx;
|
|
506
491
|
// do an array map of an iterable
|
|
507
492
|
function iterMap(iter, func, sizeHint) {
|
|
508
|
-
const results = sizeHint
|
|
493
|
+
const results = Array.from({ length: sizeHint || 0 });
|
|
509
494
|
let counter = 0;
|
|
510
495
|
for (const item of iter) {
|
|
511
496
|
results[counter] = func(item);
|
|
@@ -552,7 +537,7 @@ exports.findLastIndex = findLastIndex;
|
|
|
552
537
|
* @param errorFunction -
|
|
553
538
|
*/
|
|
554
539
|
function makeAbortableReaction(self, dataFunction, asyncReactionFunction,
|
|
555
|
-
// @ts-
|
|
540
|
+
// @ts-expect-error
|
|
556
541
|
reactionOptions, startedFunction, successFunction, errorFunction) {
|
|
557
542
|
let inProgress;
|
|
558
543
|
function handleError(error) {
|
|
@@ -585,7 +570,7 @@ reactionOptions, startedFunction, successFunction, errorFunction) {
|
|
|
585
570
|
startedFunction(thisInProgress);
|
|
586
571
|
try {
|
|
587
572
|
const result = await asyncReactionFunction(data, thisInProgress.signal, self,
|
|
588
|
-
// @ts-
|
|
573
|
+
// @ts-expect-error
|
|
589
574
|
mobxReactionHandle);
|
|
590
575
|
(0, aborting_1.checkAbortSignal)(thisInProgress.signal);
|
|
591
576
|
if ((0, mobx_state_tree_1.isAlive)(self)) {
|
|
@@ -610,15 +595,12 @@ function renameRegionIfNeeded(refNameMap, region) {
|
|
|
610
595
|
if ((0, mobx_state_tree_1.isStateTreeNode)(region) && !(0, mobx_state_tree_1.isAlive)(region)) {
|
|
611
596
|
return region;
|
|
612
597
|
}
|
|
613
|
-
if (region && refNameMap
|
|
598
|
+
if (region && (refNameMap === null || refNameMap === void 0 ? void 0 : refNameMap[region.refName])) {
|
|
614
599
|
// clone the region so we don't modify it
|
|
615
|
-
|
|
616
|
-
// @ts-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
else {
|
|
620
|
-
region = { ...region };
|
|
621
|
-
}
|
|
600
|
+
region = (0, mobx_state_tree_1.isStateTreeNode)(region)
|
|
601
|
+
? // @ts-expect-error
|
|
602
|
+
{ ...(0, mobx_state_tree_1.getSnapshot)(region) }
|
|
603
|
+
: { ...region };
|
|
622
604
|
// modify it directly in the container
|
|
623
605
|
const newRef = refNameMap[region.refName];
|
|
624
606
|
if (newRef) {
|
|
@@ -741,11 +723,9 @@ exports.blobToDataURL = blobToDataURL;
|
|
|
741
723
|
// otherwise listens for prerendered_canvas but reads empty pixels, and doesn't
|
|
742
724
|
// get the contents of the canvas
|
|
743
725
|
exports.rIC = typeof jest === 'undefined'
|
|
744
|
-
?
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
window.requestIdleCallback
|
|
748
|
-
: (cb) => setTimeout(() => cb(), 1)
|
|
726
|
+
? typeof window !== 'undefined' && window.requestIdleCallback
|
|
727
|
+
? window.requestIdleCallback
|
|
728
|
+
: (cb) => setTimeout(() => cb(), 1)
|
|
749
729
|
: (cb) => cb();
|
|
750
730
|
// prettier-ignore
|
|
751
731
|
const widths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2765625, 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625, 0.3328125, 0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125, 0.2765625, 0.3015625, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875, 1.0140625, 0.665625, 0.665625, 0.721875, 0.721875, 0.665625, 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625, 0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625, 0.721875, 0.665625, 0.609375, 0.721875, 0.665625, 0.94375, 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625, 0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5, 0.5546875, 0.5546875, 0.2765625, 0.5546875, 0.5546875, 0.221875, 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875, 0.5, 0.721875, 0.5, 0.5, 0.5, 0.3546875, 0.259375, 0.353125, 0.5890625];
|
|
@@ -910,10 +890,10 @@ exports.supportedIndexingAdapters = supportedIndexingAdapters;
|
|
|
910
890
|
function getBpDisplayStr(totalBp) {
|
|
911
891
|
let str;
|
|
912
892
|
if (Math.floor(totalBp / 1000000) > 0) {
|
|
913
|
-
str = `${parseFloat((totalBp / 1000000).toPrecision(3))}Mbp`;
|
|
893
|
+
str = `${Number.parseFloat((totalBp / 1000000).toPrecision(3))}Mbp`;
|
|
914
894
|
}
|
|
915
895
|
else if (Math.floor(totalBp / 1000) > 0) {
|
|
916
|
-
str = `${parseFloat((totalBp / 1000).toPrecision(3))}Kbp`;
|
|
896
|
+
str = `${Number.parseFloat((totalBp / 1000).toPrecision(3))}Kbp`;
|
|
917
897
|
}
|
|
918
898
|
else {
|
|
919
899
|
str = `${toLocale(Math.floor(totalBp))}bp`;
|
|
@@ -926,18 +906,12 @@ function toLocale(n) {
|
|
|
926
906
|
}
|
|
927
907
|
exports.toLocale = toLocale;
|
|
928
908
|
function getTickDisplayStr(totalBp, bpPerPx) {
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
}
|
|
933
|
-
else {
|
|
934
|
-
str = `${toLocale(Math.floor(totalBp))}`;
|
|
935
|
-
}
|
|
936
|
-
return str;
|
|
909
|
+
return Math.floor(bpPerPx / 1000) > 0
|
|
910
|
+
? `${toLocale(Number.parseFloat((totalBp / 1000000).toFixed(2)))}M`
|
|
911
|
+
: `${toLocale(Math.floor(totalBp))}`;
|
|
937
912
|
}
|
|
938
913
|
exports.getTickDisplayStr = getTickDisplayStr;
|
|
939
914
|
function getViewParams(model, exportSVG) {
|
|
940
|
-
// @ts-ignore
|
|
941
915
|
const { dynamicBlocks, staticBlocks, offsetPx } = getContainingView(model);
|
|
942
916
|
const b = (dynamicBlocks === null || dynamicBlocks === void 0 ? void 0 : dynamicBlocks.contentBlocks[0]) || {};
|
|
943
917
|
const staticblock = (staticBlocks === null || staticBlocks === void 0 ? void 0 : staticBlocks.contentBlocks[0]) || {};
|
|
@@ -1062,3 +1036,6 @@ function avg(arr) {
|
|
|
1062
1036
|
return sum(arr) / arr.length;
|
|
1063
1037
|
}
|
|
1064
1038
|
exports.avg = avg;
|
|
1039
|
+
var simpleFeature_1 = require("./simpleFeature");
|
|
1040
|
+
Object.defineProperty(exports, "SimpleFeature", { enumerable: true, get: function () { return __importDefault(simpleFeature_1).default; } });
|
|
1041
|
+
Object.defineProperty(exports, "isFeature", { enumerable: true, get: function () { return simpleFeature_1.isFeature; } });
|
|
@@ -50,8 +50,8 @@ class RemoteFileWithRangeCache extends generic_filehandle_1.RemoteFile {
|
|
|
50
50
|
const rangeParse = /bytes=(\d+)-(\d+)/.exec(range);
|
|
51
51
|
if (rangeParse) {
|
|
52
52
|
const [, start, end] = rangeParse;
|
|
53
|
-
const s = parseInt(start, 10);
|
|
54
|
-
const e = parseInt(end, 10);
|
|
53
|
+
const s = Number.parseInt(start, 10);
|
|
54
|
+
const e = Number.parseInt(end, 10);
|
|
55
55
|
const response = (await globalRangeCache.getRange(url, s, e - s + 1, {
|
|
56
56
|
signal: init && init.signal,
|
|
57
57
|
}));
|
package/util/io/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GenericFilehandle, Fetcher } from 'generic-filehandle';
|
|
2
|
-
import { RemoteFileWithRangeCache } from './RemoteFileWithRangeCache';
|
|
3
2
|
import { FileLocation } from '../types';
|
|
4
3
|
import PluginManager from '../../PluginManager';
|
|
5
|
-
export { RemoteFileWithRangeCache };
|
|
6
4
|
export declare function openLocation(location: FileLocation, pluginManager?: PluginManager): GenericFilehandle;
|
|
7
5
|
export declare function getFetcher(location: FileLocation, pluginManager?: PluginManager): Fetcher;
|
|
6
|
+
export { RemoteFileWithRangeCache } from './RemoteFileWithRangeCache';
|
package/util/io/index.js
CHANGED
|
@@ -3,12 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.RemoteFileWithRangeCache = exports.getFetcher = exports.openLocation = void 0;
|
|
7
7
|
const generic_filehandle_1 = require("generic-filehandle");
|
|
8
8
|
const detect_node_1 = __importDefault(require("detect-node"));
|
|
9
9
|
// locals
|
|
10
10
|
const RemoteFileWithRangeCache_1 = require("./RemoteFileWithRangeCache");
|
|
11
|
-
Object.defineProperty(exports, "RemoteFileWithRangeCache", { enumerable: true, get: function () { return RemoteFileWithRangeCache_1.RemoteFileWithRangeCache; } });
|
|
12
11
|
const types_1 = require("../types");
|
|
13
12
|
const tracks_1 = require("../tracks");
|
|
14
13
|
const __1 = require("../");
|
|
@@ -105,10 +104,11 @@ function getInternetAccount(location, pluginManager) {
|
|
|
105
104
|
async function checkAuthNeededFetch(url, opts) {
|
|
106
105
|
var _a;
|
|
107
106
|
const response = await fetch(url, opts);
|
|
108
|
-
if (response.status === 401
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
107
|
+
if (response.status === 401 &&
|
|
108
|
+
((_a = response.headers.get('WWW-Authenticate')) === null || _a === void 0 ? void 0 : _a.includes('Basic'))) {
|
|
109
|
+
throw new types_1.AuthNeededError('Accessing HTTPBasic resource without authentication', url.toString());
|
|
112
110
|
}
|
|
113
111
|
return response;
|
|
114
112
|
}
|
|
113
|
+
var RemoteFileWithRangeCache_2 = require("./RemoteFileWithRangeCache");
|
|
114
|
+
Object.defineProperty(exports, "RemoteFileWithRangeCache", { enumerable: true, get: function () { return RemoteFileWithRangeCache_2.RemoteFileWithRangeCache; } });
|
package/util/jexl.js
CHANGED
|
@@ -45,7 +45,9 @@ function default_1( /* config?: any*/) {
|
|
|
45
45
|
j.addFunction('replaceAll', (s, match, sub) => s.replaceAll(match, sub));
|
|
46
46
|
j.addFunction('slice', (s, start, end) => s.slice(start, end));
|
|
47
47
|
j.addFunction('startsWith', (s, search, pos) => s.startsWith(search, pos));
|
|
48
|
-
j.addFunction('substring', (s, start, end) =>
|
|
48
|
+
j.addFunction('substring', (s, start, end) =>
|
|
49
|
+
// eslint-disable-next-line unicorn/prefer-string-slice
|
|
50
|
+
s.substring(start, end));
|
|
49
51
|
j.addFunction('toLowerCase', (s) => s.toLowerCase());
|
|
50
52
|
j.addFunction('toUpperCase', (s) => s.toUpperCase());
|
|
51
53
|
j.addFunction('trim', (s) => s.trim());
|
|
@@ -64,7 +64,7 @@ class LayoutRow {
|
|
|
64
64
|
offset: left - rectWidth,
|
|
65
65
|
min: left,
|
|
66
66
|
max: right,
|
|
67
|
-
bits:
|
|
67
|
+
bits: Array.from({ length: 3 * rectWidth }),
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
addRect(rect, data) {
|
|
@@ -85,7 +85,10 @@ class LayoutRow {
|
|
|
85
85
|
this.rowState = this.initialize(left, right);
|
|
86
86
|
}
|
|
87
87
|
else if (additionalLength > 0) {
|
|
88
|
-
this.rowState.bits =
|
|
88
|
+
this.rowState.bits = [
|
|
89
|
+
...this.rowState.bits,
|
|
90
|
+
...Array.from({ length: additionalLength }),
|
|
91
|
+
];
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
// expand leftward if necessary
|
|
@@ -97,7 +100,10 @@ class LayoutRow {
|
|
|
97
100
|
this.rowState = this.initialize(left, right);
|
|
98
101
|
}
|
|
99
102
|
else {
|
|
100
|
-
this.rowState.bits =
|
|
103
|
+
this.rowState.bits = [
|
|
104
|
+
...Array.from({ length: additionalLength }),
|
|
105
|
+
...this.rowState.bits,
|
|
106
|
+
];
|
|
101
107
|
this.rowState.offset -= additionalLength;
|
|
102
108
|
}
|
|
103
109
|
}
|
|
@@ -370,7 +376,7 @@ class GranularRectLayout {
|
|
|
370
376
|
return this.getTotalHeight();
|
|
371
377
|
}
|
|
372
378
|
getRectangles() {
|
|
373
|
-
return new Map(
|
|
379
|
+
return new Map([...this.rectangles.entries()].map(([id, rect]) => {
|
|
374
380
|
const { l, r, originalHeight, top } = rect;
|
|
375
381
|
const t = (top || 0) * this.pitchY;
|
|
376
382
|
const b = t + originalHeight;
|
|
@@ -32,13 +32,9 @@ class SceneGraph {
|
|
|
32
32
|
addChild(nameOrSceneGraph, left, top, width, height,
|
|
33
33
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
34
|
data) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
child = new SceneGraph(nameOrSceneGraph, left, top, width, height, data);
|
|
41
|
-
}
|
|
35
|
+
const child = nameOrSceneGraph instanceof SceneGraph
|
|
36
|
+
? nameOrSceneGraph
|
|
37
|
+
: new SceneGraph(nameOrSceneGraph, left, top, width, height, data);
|
|
42
38
|
if (!(child instanceof SceneGraph)) {
|
|
43
39
|
throw new TypeError('argument to addChild must be an array or a SceneGraph');
|
|
44
40
|
}
|
|
@@ -33,19 +33,20 @@ if (weHave.realOffscreenCanvas) {
|
|
|
33
33
|
else if (weHave.node) {
|
|
34
34
|
// use node-canvas if we are running in node (i.e. automated tests)
|
|
35
35
|
exports.createCanvas = (...args) => {
|
|
36
|
-
// @ts-
|
|
36
|
+
// @ts-expect-error
|
|
37
37
|
// eslint-disable-next-line no-undef
|
|
38
38
|
return nodeCreateCanvas(...args);
|
|
39
39
|
};
|
|
40
40
|
exports.createImageBitmap = async (canvas, ...otherargs) => {
|
|
41
|
-
if (otherargs.length) {
|
|
41
|
+
if (otherargs.length > 0) {
|
|
42
42
|
throw new Error('only one-argument uses of createImageBitmap are supported by the node offscreencanvas ponyfill');
|
|
43
43
|
}
|
|
44
44
|
const dataUri = canvas.toDataURL();
|
|
45
|
-
// @ts-
|
|
45
|
+
// @ts-expect-error
|
|
46
46
|
// eslint-disable-next-line no-undef
|
|
47
47
|
const img = new nodeImage();
|
|
48
48
|
return new Promise((resolve, reject) => {
|
|
49
|
+
// need onload for jest
|
|
49
50
|
img.onload = () => resolve(img);
|
|
50
51
|
img.onerror = reject;
|
|
51
52
|
img.src = dataUri;
|
|
@@ -79,6 +79,7 @@ async function renderToAbstractCanvas(width, height, opts, cb) {
|
|
|
79
79
|
exports.renderToAbstractCanvas = renderToAbstractCanvas;
|
|
80
80
|
async function getSerializedSvg(results) {
|
|
81
81
|
const { width, height, canvasRecordedData } = results;
|
|
82
|
+
// @ts-ignore needs to be ignore not expect error, produces error in build step
|
|
82
83
|
const C2S = await Promise.resolve().then(() => __importStar(require('canvas2svg')));
|
|
83
84
|
const ctx = new C2S.default(width, height);
|
|
84
85
|
const seq = new canvas_sequencer_1.CanvasSequence(canvasRecordedData);
|
package/util/tracks.d.ts
CHANGED
package/util/tracks.js
CHANGED
|
@@ -141,7 +141,6 @@ function guessAdapter(file, index, adapterHint, model) {
|
|
|
141
141
|
exports.guessAdapter = guessAdapter;
|
|
142
142
|
function guessTrackType(adapterType, model) {
|
|
143
143
|
if (model) {
|
|
144
|
-
// @ts-ignore
|
|
145
144
|
const session = (0, index_1.getSession)(model);
|
|
146
145
|
const trackTypeGuesser = (0, index_1.getEnv)(session).pluginManager.evaluateExtensionPoint('Core-guessTrackTypeForLocation', (_adapterName) => {
|
|
147
146
|
return undefined;
|
package/util/types/index.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ export interface SnackAction {
|
|
|
22
22
|
onClick: () => void;
|
|
23
23
|
}
|
|
24
24
|
export type AssemblyManager = Instance<ReturnType<typeof assemblyManager>>;
|
|
25
|
-
export type { TextSearchManager };
|
|
26
25
|
export interface BasePlugin {
|
|
27
26
|
version?: string;
|
|
28
27
|
name: string;
|
|
@@ -230,3 +229,4 @@ export type PreBlobLocation = {
|
|
|
230
229
|
blob: File;
|
|
231
230
|
};
|
|
232
231
|
export type PreFileLocation = PreUriLocation | PreLocalPathLocation | PreBlobLocation;
|
|
232
|
+
export { type default as TextSearchManager } from '../../TextSearch/TextSearchManager';
|
package/util/types/index.js
CHANGED
|
@@ -37,7 +37,7 @@ function isSessionModelWithConfigEditing(thing) {
|
|
|
37
37
|
exports.isSessionModelWithConfigEditing = isSessionModelWithConfigEditing;
|
|
38
38
|
function isSessionWithAddTracks(thing) {
|
|
39
39
|
return (
|
|
40
|
-
// @ts-
|
|
40
|
+
// @ts-expect-error
|
|
41
41
|
isSessionModel(thing) && 'addTrackConf' in thing && !thing.disableAddTracks);
|
|
42
42
|
}
|
|
43
43
|
exports.isSessionWithAddTracks = isSessionWithAddTracks;
|
|
@@ -71,7 +71,7 @@ function isTrackModel(thing) {
|
|
|
71
71
|
return (typeof thing === 'object' &&
|
|
72
72
|
thing !== null &&
|
|
73
73
|
'configuration' in thing &&
|
|
74
|
-
// @ts-
|
|
74
|
+
// @ts-expect-error
|
|
75
75
|
thing.configuration.trackId);
|
|
76
76
|
}
|
|
77
77
|
exports.isTrackModel = isTrackModel;
|
|
@@ -79,7 +79,7 @@ function isDisplayModel(thing) {
|
|
|
79
79
|
return (typeof thing === 'object' &&
|
|
80
80
|
thing !== null &&
|
|
81
81
|
'configuration' in thing &&
|
|
82
|
-
// @ts-
|
|
82
|
+
// @ts-expect-error
|
|
83
83
|
thing.configuration.displayId);
|
|
84
84
|
}
|
|
85
85
|
exports.isDisplayModel = isDisplayModel;
|
package/util/types/mst.js
CHANGED
|
@@ -70,16 +70,16 @@ exports.UriLocation = mobx_state_tree_1.types.snapshotProcessor(exports.UriLocat
|
|
|
70
70
|
},
|
|
71
71
|
});
|
|
72
72
|
exports.FileLocation = mobx_state_tree_1.types.snapshotProcessor(mobx_state_tree_1.types.union(exports.LocalPathLocation, exports.UriLocation, exports.BlobLocation), {
|
|
73
|
-
// @ts-
|
|
73
|
+
// @ts-expect-error
|
|
74
74
|
preProcessor(snap) {
|
|
75
75
|
if (!snap) {
|
|
76
76
|
return undefined;
|
|
77
77
|
}
|
|
78
|
-
// @ts-
|
|
78
|
+
// @ts-expect-error
|
|
79
79
|
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
80
80
|
const { locationType, ...rest } = snap;
|
|
81
81
|
if (!locationType) {
|
|
82
|
-
// @ts-
|
|
82
|
+
// @ts-expect-error
|
|
83
83
|
const { uri, localPath, blob } = rest;
|
|
84
84
|
let locationType = '';
|
|
85
85
|
if (uri !== undefined) {
|