@jbrowse/core 2.11.2 → 2.12.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/ArrayValue.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +17 -22
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +4 -6
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +4 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +24 -85
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +55 -24
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +9 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +69 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +9 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +126 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +6 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +68 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +19 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +47 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/model.js +84 -11
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +3 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +76 -19
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +5 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +12 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +7 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +51 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +5 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +12 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +11 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +30 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +11 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +42 -0
- package/BaseFeatureWidget/stateModelFactory.d.ts +26 -0
- package/BaseFeatureWidget/stateModelFactory.js +1 -2
- package/BaseFeatureWidget/util.d.ts +5 -5
- package/BaseFeatureWidget/util.js +6 -7
- package/PluginLoader.js +4 -5
- package/PluginManager.d.ts +7 -17
- package/ReExports/modules.d.ts +7 -16
- package/TextSearch/TextSearchManager.d.ts +6 -2
- package/assemblyManager/assembly.js +1 -1
- package/assemblyManager/assemblyManager.d.ts +9 -82
- package/configuration/configurationSchema.d.ts +7 -1
- package/configuration/configurationSchema.js +2 -3
- package/configuration/configurationSlot.js +1 -1
- package/configuration/util.d.ts +1 -1
- package/configuration/util.js +7 -8
- package/data_adapters/BaseAdapter/util.js +5 -6
- package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +0 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +1 -2
- package/data_adapters/CytobandAdapter/index.js +1 -1
- package/data_adapters/dataAdapterCache.js +4 -5
- package/package.json +4 -2
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +1 -3
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -3
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +6 -2
- package/pluggableElementTypes/models/BaseTrackModel.js +2 -3
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +13 -13
- package/pluggableElementTypes/models/baseTrackConfig.js +1 -2
- package/rpc/BaseRpcDriver.js +1 -2
- package/rpc/methods/util.js +1 -2
- package/rpc/remoteAbortSignals.js +5 -6
- package/stories/JBrowseCore.stories.d.ts +5 -0
- package/stories/JBrowseCore.stories.js +10 -0
- package/stories/examples/WithSequencePanel.d.ts +7 -0
- package/stories/examples/WithSequencePanel.js +42 -0
- package/stories/examples/index.d.ts +1 -0
- package/stories/examples/index.js +17 -0
- package/stories/examples/util.d.ts +33 -0
- package/stories/examples/util.js +235 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/ColorPicker.js +3 -3
- package/ui/Dialog.js +2 -1
- package/ui/ErrorMessageStackTraceDialog.js +1 -1
- package/ui/FactoryResetDialog.js +1 -1
- package/ui/FatalErrorDialog.js +1 -1
- package/ui/Icons.js +9 -10
- package/ui/LoadingEllipses.js +1 -1
- package/ui/Logo.js +2 -3
- package/ui/Menu.js +1 -2
- package/ui/RedErrorMessageBox.js +1 -1
- package/ui/SanitizedHTML.js +1 -1
- package/ui/SnackbarModel.js +1 -1
- package/ui/theme.js +3 -3
- package/util/Base1DUtils.d.ts +1 -1
- package/util/Base1DUtils.js +7 -12
- package/util/Base1DViewModel.d.ts +6 -17
- package/util/Base1DViewModel.js +6 -12
- package/util/aborting.js +5 -6
- package/util/analytics.js +3 -4
- package/util/blobToDataURL.js +1 -2
- package/util/calculateDynamicBlocks.js +1 -1
- package/util/calculateStaticBlocks.js +1 -1
- package/util/color/cssColorsLevel4.js +2 -3
- package/util/color/index.js +4 -4
- package/util/dedupe.js +1 -2
- package/util/formatFastaStrings.js +2 -3
- package/util/idMaker.js +1 -1
- package/util/index.d.ts +3 -3
- package/util/index.js +70 -71
- package/util/io/RemoteFileWithRangeCache.d.ts +0 -1
- package/util/io/RemoteFileWithRangeCache.js +2 -2
- package/util/io/index.js +4 -4
- package/util/jexl.js +1 -1
- package/util/jexlStrings.js +1 -2
- package/util/map-obj.js +1 -1
- package/util/mst-reflection.js +6 -7
- package/util/offscreenCanvasPonyfill.js +2 -2
- package/util/offscreenCanvasUtils.js +3 -4
- package/util/range.js +3 -4
- package/util/rxjs.js +1 -2
- package/util/simpleFeature.js +1 -2
- package/util/stats.js +5 -6
- package/util/tracks.d.ts +3 -2
- package/util/tracks.js +24 -20
- package/util/types/index.d.ts +4 -1
- package/util/types/index.js +23 -23
- package/util/types/mst.d.ts +0 -1
- package/util/useMeasure.d.ts +2 -3
- package/util/useMeasure.js +1 -1
- package/util/when.js +2 -3
- package/ui/useResizeBar.d.ts +0 -5
- package/ui/useResizeBar.js +0 -22
package/util/jexlStrings.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.stringToJexlExpression =
|
|
6
|
+
exports.stringToJexlExpression = stringToJexlExpression;
|
|
7
7
|
const jexl_1 = __importDefault(require("./jexl"));
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
9
|
const compilationCache = {};
|
|
@@ -32,4 +32,3 @@ jexl) {
|
|
|
32
32
|
}
|
|
33
33
|
return compilationCache[cacheKey];
|
|
34
34
|
}
|
|
35
|
-
exports.stringToJexlExpression = stringToJexlExpression;
|
package/util/map-obj.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = map;
|
|
3
4
|
// adapted from map-obj (MIT), with modifications to pass the "whole object"
|
|
4
5
|
// from an array of objects into itself
|
|
5
6
|
const isObject = (value) => typeof value === 'object' && value !== null;
|
|
@@ -30,4 +31,3 @@ function map(object, mapper, isSeen = new WeakSet()) {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
exports.default = map;
|
package/util/mst-reflection.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getSubType = getSubType;
|
|
4
|
+
exports.getUnionSubTypes = getUnionSubTypes;
|
|
5
|
+
exports.getPropertyType = getPropertyType;
|
|
6
|
+
exports.getDefaultValue = getDefaultValue;
|
|
7
|
+
exports.getEnumerationValues = getEnumerationValues;
|
|
8
|
+
exports.resolveLateType = resolveLateType;
|
|
4
9
|
/* eslint-disable no-underscore-dangle */
|
|
5
10
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
11
|
/**
|
|
@@ -30,7 +35,6 @@ function getSubType(type) {
|
|
|
30
35
|
}
|
|
31
36
|
return t;
|
|
32
37
|
}
|
|
33
|
-
exports.getSubType = getSubType;
|
|
34
38
|
/**
|
|
35
39
|
* get the array of the subtypes in a union
|
|
36
40
|
*/
|
|
@@ -53,14 +57,12 @@ function getUnionSubTypes(unionType) {
|
|
|
53
57
|
}
|
|
54
58
|
return t;
|
|
55
59
|
}
|
|
56
|
-
exports.getUnionSubTypes = getUnionSubTypes;
|
|
57
60
|
/**
|
|
58
61
|
* get the type of one of the properties of the given MST model type
|
|
59
62
|
*/
|
|
60
63
|
function getPropertyType(type, propertyName) {
|
|
61
64
|
return type.properties[propertyName];
|
|
62
65
|
}
|
|
63
|
-
exports.getPropertyType = getPropertyType;
|
|
64
66
|
/**
|
|
65
67
|
* get the base type from inside an MST optional type
|
|
66
68
|
*/
|
|
@@ -71,14 +73,12 @@ function getDefaultValue(type) {
|
|
|
71
73
|
// @ts-expect-error
|
|
72
74
|
return type._defaultValue || type.defaultValue;
|
|
73
75
|
}
|
|
74
|
-
exports.getDefaultValue = getDefaultValue;
|
|
75
76
|
/** get the string values of an MST enumeration type */
|
|
76
77
|
function getEnumerationValues(type) {
|
|
77
78
|
const subtypes = getUnionSubTypes(type);
|
|
78
79
|
// the subtypes should all be literals with a value member
|
|
79
80
|
return subtypes.map(t => t.value);
|
|
80
81
|
}
|
|
81
|
-
exports.getEnumerationValues = getEnumerationValues;
|
|
82
82
|
function resolveLateType(maybeLate) {
|
|
83
83
|
if (!(0, mobx_state_tree_1.isUnionType)(maybeLate) &&
|
|
84
84
|
!(0, mobx_state_tree_1.isArrayType)(maybeLate) &&
|
|
@@ -88,4 +88,3 @@ function resolveLateType(maybeLate) {
|
|
|
88
88
|
}
|
|
89
89
|
return maybeLate;
|
|
90
90
|
}
|
|
91
|
-
exports.resolveLateType = resolveLateType;
|
|
@@ -5,7 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.ImageBitmapType = exports.createImageBitmap = exports.createCanvas = void 0;
|
|
9
|
+
exports.drawImageOntoCanvasContext = drawImageOntoCanvasContext;
|
|
9
10
|
const detect_node_1 = __importDefault(require("detect-node"));
|
|
10
11
|
const canvas_sequencer_1 = require("canvas-sequencer");
|
|
11
12
|
function drawImageOntoCanvasContext(
|
|
@@ -19,7 +20,6 @@ imageData, context) {
|
|
|
19
20
|
context.drawImage(imageData, 0, 0);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
exports.drawImageOntoCanvasContext = drawImageOntoCanvasContext;
|
|
23
23
|
const weHave = {
|
|
24
24
|
realOffscreenCanvas: typeof OffscreenCanvas === 'function',
|
|
25
25
|
node: detect_node_1.default,
|
|
@@ -26,7 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.renderToAbstractCanvas = renderToAbstractCanvas;
|
|
30
|
+
exports.getSerializedSvg = getSerializedSvg;
|
|
31
|
+
exports.ReactRendering = ReactRendering;
|
|
30
32
|
/* eslint-disable react-refresh/only-export-components */
|
|
31
33
|
const react_1 = __importDefault(require("react"));
|
|
32
34
|
const canvas_sequencer_1 = require("canvas-sequencer");
|
|
@@ -77,7 +79,6 @@ async function renderToAbstractCanvas(width, height, opts, cb) {
|
|
|
77
79
|
return { ...result, imageData: await (0, offscreenCanvasPonyfill_1.createImageBitmap)(canvas) };
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
|
-
exports.renderToAbstractCanvas = renderToAbstractCanvas;
|
|
81
82
|
async function getSerializedSvg(results) {
|
|
82
83
|
const { width, height, canvasRecordedData } = results;
|
|
83
84
|
// @ts-ignore needs to be ignore not expect error, produces error in build step
|
|
@@ -89,10 +90,8 @@ async function getSerializedSvg(results) {
|
|
|
89
90
|
// our own <svg> element in the view's SVG export
|
|
90
91
|
return ctx.getSvg().innerHTML;
|
|
91
92
|
}
|
|
92
|
-
exports.getSerializedSvg = getSerializedSvg;
|
|
93
93
|
function ReactRendering({ rendering, }) {
|
|
94
94
|
return react_1.default.isValidElement(rendering.reactElement) ? (rendering.reactElement) : (react_1.default.createElement("g", {
|
|
95
95
|
/* eslint-disable-next-line react/no-danger */
|
|
96
96
|
dangerouslySetInnerHTML: { __html: rendering.html || '' } }));
|
|
97
97
|
}
|
|
98
|
-
exports.ReactRendering = ReactRendering;
|
package/util/range.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.intersection2 = intersection2;
|
|
4
|
+
exports.doesIntersect2 = doesIntersect2;
|
|
5
|
+
exports.isContainedWithin = isContainedWithin;
|
|
4
6
|
/**
|
|
5
7
|
* fast low-level intersection of 2 coordinate ranges. assumes interbase coordinates.
|
|
6
8
|
*
|
|
@@ -32,7 +34,6 @@ function intersection2(left1, right1, left2, right2) {
|
|
|
32
34
|
}
|
|
33
35
|
return [];
|
|
34
36
|
}
|
|
35
|
-
exports.intersection2 = intersection2;
|
|
36
37
|
/**
|
|
37
38
|
* Return whether 2 interbase coordinate ranges intersect.
|
|
38
39
|
*
|
|
@@ -46,7 +47,6 @@ exports.intersection2 = intersection2;
|
|
|
46
47
|
function doesIntersect2(left1, right1, left2, right2) {
|
|
47
48
|
return right1 > left2 && left1 < right2;
|
|
48
49
|
}
|
|
49
|
-
exports.doesIntersect2 = doesIntersect2;
|
|
50
50
|
/**
|
|
51
51
|
* Return whether the first region is completely contained within the second region
|
|
52
52
|
*
|
|
@@ -58,4 +58,3 @@ exports.doesIntersect2 = doesIntersect2;
|
|
|
58
58
|
function isContainedWithin(left1, right1, left2, right2) {
|
|
59
59
|
return left2 <= left1 && right2 >= right1;
|
|
60
60
|
}
|
|
61
|
-
exports.isContainedWithin = isContainedWithin;
|
package/util/rxjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObservableCreate =
|
|
3
|
+
exports.ObservableCreate = ObservableCreate;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const _1 = require(".");
|
|
@@ -24,4 +24,3 @@ function ObservableCreate(func, signal) {
|
|
|
24
24
|
}
|
|
25
25
|
}).pipe((0, operators_1.takeUntil)((0, _1.observeAbortSignal)(signal)));
|
|
26
26
|
}
|
|
27
|
-
exports.ObservableCreate = ObservableCreate;
|
package/util/simpleFeature.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFeature =
|
|
3
|
+
exports.isFeature = isFeature;
|
|
4
4
|
function isFeature(thing) {
|
|
5
5
|
return (typeof thing === 'object' &&
|
|
6
6
|
thing !== null &&
|
|
7
7
|
typeof thing.get === 'function' &&
|
|
8
8
|
typeof thing.id === 'function');
|
|
9
9
|
}
|
|
10
|
-
exports.isFeature = isFeature;
|
|
11
10
|
function isSimpleFeatureSerialized(args) {
|
|
12
11
|
return 'uniqueId' in args && typeof args.data !== 'object';
|
|
13
12
|
}
|
package/util/stats.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.calcStdFromSums = calcStdFromSums;
|
|
4
|
+
exports.rectifyStats = rectifyStats;
|
|
5
|
+
exports.calcPerBaseStats = calcPerBaseStats;
|
|
6
|
+
exports.scoresToStats = scoresToStats;
|
|
7
|
+
exports.blankStats = blankStats;
|
|
4
8
|
const rxjs_1 = require("rxjs");
|
|
5
9
|
const operators_1 = require("rxjs/operators");
|
|
6
10
|
/**
|
|
@@ -30,7 +34,6 @@ function calcStdFromSums(sum, sumSquares, n, population = false) {
|
|
|
30
34
|
}
|
|
31
35
|
return variance < 0 ? 0 : Math.sqrt(variance);
|
|
32
36
|
}
|
|
33
|
-
exports.calcStdFromSums = calcStdFromSums;
|
|
34
37
|
/**
|
|
35
38
|
* @param stats - a summary stats object with scoreSum, featureCount,
|
|
36
39
|
* scoreSumSquares, and basesCovered
|
|
@@ -45,7 +48,6 @@ function rectifyStats(s) {
|
|
|
45
48
|
featureDensity: (s.featureCount || 1) / s.basesCovered,
|
|
46
49
|
};
|
|
47
50
|
}
|
|
48
|
-
exports.rectifyStats = rectifyStats;
|
|
49
51
|
/**
|
|
50
52
|
* calculates per-base scores for variable width features over a region
|
|
51
53
|
*
|
|
@@ -79,7 +81,6 @@ function calcPerBaseStats(region, features) {
|
|
|
79
81
|
}
|
|
80
82
|
return scores;
|
|
81
83
|
}
|
|
82
|
-
exports.calcPerBaseStats = calcPerBaseStats;
|
|
83
84
|
/**
|
|
84
85
|
* transform a list of scores to summary statistics
|
|
85
86
|
*
|
|
@@ -120,7 +121,6 @@ async function scoresToStats(region, feats) {
|
|
|
120
121
|
})
|
|
121
122
|
: blankStats();
|
|
122
123
|
}
|
|
123
|
-
exports.scoresToStats = scoresToStats;
|
|
124
124
|
function blankStats() {
|
|
125
125
|
return {
|
|
126
126
|
scoreMin: 0,
|
|
@@ -134,4 +134,3 @@ function blankStats() {
|
|
|
134
134
|
basesCovered: 0,
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
exports.blankStats = blankStats;
|
package/util/tracks.d.ts
CHANGED
|
@@ -4,11 +4,12 @@ import { AnyConfigurationModel } from '../configuration';
|
|
|
4
4
|
export declare function getTrackAssemblyNames(track: IAnyStateTreeNode & {
|
|
5
5
|
configuration: AnyConfigurationModel;
|
|
6
6
|
}): string[];
|
|
7
|
+
export declare function getConfAssemblyNames(conf: AnyConfigurationModel): string[];
|
|
7
8
|
/** return the rpcSessionId of the highest parent node in the tree that has an rpcSessionId */
|
|
8
9
|
export declare function getRpcSessionId(thisNode: IAnyStateTreeNode): string;
|
|
9
10
|
/**
|
|
10
|
-
* given an MST node, get the renderprops of the first parent container that
|
|
11
|
-
* renderProps
|
|
11
|
+
* given an MST node, get the renderprops of the first parent container that
|
|
12
|
+
* has renderProps
|
|
12
13
|
* @param node -
|
|
13
14
|
* @returns renderprops, or empty object if none found
|
|
14
15
|
*/
|
package/util/tracks.js
CHANGED
|
@@ -1,23 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UNSUPPORTED = exports.UNKNOWN = void 0;
|
|
4
|
+
exports.getTrackAssemblyNames = getTrackAssemblyNames;
|
|
5
|
+
exports.getConfAssemblyNames = getConfAssemblyNames;
|
|
6
|
+
exports.getRpcSessionId = getRpcSessionId;
|
|
7
|
+
exports.getParentRenderProps = getParentRenderProps;
|
|
8
|
+
exports.getBlob = getBlob;
|
|
9
|
+
exports.getBlobMap = getBlobMap;
|
|
10
|
+
exports.setBlobMap = setBlobMap;
|
|
11
|
+
exports.storeBlobLocation = storeBlobLocation;
|
|
12
|
+
exports.makeIndex = makeIndex;
|
|
13
|
+
exports.makeIndexType = makeIndexType;
|
|
14
|
+
exports.getFileName = getFileName;
|
|
15
|
+
exports.guessAdapter = guessAdapter;
|
|
16
|
+
exports.guessTrackType = guessTrackType;
|
|
17
|
+
exports.generateUnsupportedTrackConf = generateUnsupportedTrackConf;
|
|
18
|
+
exports.generateUnknownTrackConf = generateUnknownTrackConf;
|
|
19
|
+
exports.getTrackName = getTrackName;
|
|
4
20
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
5
21
|
const index_1 = require("./index");
|
|
6
22
|
const configuration_1 = require("../configuration");
|
|
7
23
|
/* utility functions for use by track models and so forth */
|
|
8
24
|
function getTrackAssemblyNames(track) {
|
|
9
|
-
|
|
25
|
+
return getConfAssemblyNames(track.configuration);
|
|
26
|
+
}
|
|
27
|
+
function getConfAssemblyNames(conf) {
|
|
28
|
+
const trackAssemblyNames = (0, configuration_1.readConfObject)(conf, 'assemblyNames');
|
|
10
29
|
if (!trackAssemblyNames) {
|
|
11
30
|
// Check if it's an assembly sequence track
|
|
12
31
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
-
const parent = (0, mobx_state_tree_1.getParent)(
|
|
32
|
+
const parent = (0, mobx_state_tree_1.getParent)(conf);
|
|
14
33
|
if ('sequence' in parent) {
|
|
15
34
|
return [(0, configuration_1.readConfObject)(parent, 'name')];
|
|
16
35
|
}
|
|
17
36
|
}
|
|
18
37
|
return trackAssemblyNames;
|
|
19
38
|
}
|
|
20
|
-
exports.getTrackAssemblyNames = getTrackAssemblyNames;
|
|
21
39
|
/** return the rpcSessionId of the highest parent node in the tree that has an rpcSessionId */
|
|
22
40
|
function getRpcSessionId(thisNode) {
|
|
23
41
|
let highestRpcSessionId;
|
|
@@ -32,10 +50,9 @@ function getRpcSessionId(thisNode) {
|
|
|
32
50
|
}
|
|
33
51
|
return highestRpcSessionId;
|
|
34
52
|
}
|
|
35
|
-
exports.getRpcSessionId = getRpcSessionId;
|
|
36
53
|
/**
|
|
37
|
-
* given an MST node, get the renderprops of the first parent container that
|
|
38
|
-
* renderProps
|
|
54
|
+
* given an MST node, get the renderprops of the first parent container that
|
|
55
|
+
* has renderProps
|
|
39
56
|
* @param node -
|
|
40
57
|
* @returns renderprops, or empty object if none found
|
|
41
58
|
*/
|
|
@@ -51,7 +68,6 @@ function getParentRenderProps(node) {
|
|
|
51
68
|
}
|
|
52
69
|
return {};
|
|
53
70
|
}
|
|
54
|
-
exports.getParentRenderProps = getParentRenderProps;
|
|
55
71
|
exports.UNKNOWN = 'UNKNOWN';
|
|
56
72
|
exports.UNSUPPORTED = 'UNSUPPORTED';
|
|
57
73
|
let blobMap = {};
|
|
@@ -59,17 +75,14 @@ let blobMap = {};
|
|
|
59
75
|
function getBlob(id) {
|
|
60
76
|
return blobMap[id];
|
|
61
77
|
}
|
|
62
|
-
exports.getBlob = getBlob;
|
|
63
78
|
// used to export entire context to webworker
|
|
64
79
|
function getBlobMap() {
|
|
65
80
|
return blobMap;
|
|
66
81
|
}
|
|
67
|
-
exports.getBlobMap = getBlobMap;
|
|
68
82
|
// used in new contexts like webworkers
|
|
69
83
|
function setBlobMap(map) {
|
|
70
84
|
blobMap = map;
|
|
71
85
|
}
|
|
72
|
-
exports.setBlobMap = setBlobMap;
|
|
73
86
|
let counter = 0;
|
|
74
87
|
// blob files are stored in a global map. the blobId is based on a combination
|
|
75
88
|
// of timestamp plus counter to be unique across sessions and fast repeated
|
|
@@ -82,7 +95,6 @@ function storeBlobLocation(location) {
|
|
|
82
95
|
}
|
|
83
96
|
return location;
|
|
84
97
|
}
|
|
85
|
-
exports.storeBlobLocation = storeBlobLocation;
|
|
86
98
|
/**
|
|
87
99
|
* creates a new location from the provided location including the appropriate suffix and location type
|
|
88
100
|
* @param location - the FileLocation
|
|
@@ -101,7 +113,6 @@ function makeIndex(location, suffix) {
|
|
|
101
113
|
}
|
|
102
114
|
return location;
|
|
103
115
|
}
|
|
104
|
-
exports.makeIndex = makeIndex;
|
|
105
116
|
/**
|
|
106
117
|
* constructs a potential index file (with suffix) from the provided file name
|
|
107
118
|
* @param name - the name of the index file
|
|
@@ -112,7 +123,6 @@ exports.makeIndex = makeIndex;
|
|
|
112
123
|
function makeIndexType(name, typeA, typeB) {
|
|
113
124
|
return (name === null || name === void 0 ? void 0 : name.toUpperCase().endsWith(typeA)) ? typeA : typeB;
|
|
114
125
|
}
|
|
115
|
-
exports.makeIndexType = makeIndexType;
|
|
116
126
|
function getFileName(track) {
|
|
117
127
|
const uri = 'uri' in track ? track.uri : undefined;
|
|
118
128
|
const localPath = 'localPath' in track ? track.localPath : undefined;
|
|
@@ -122,7 +132,6 @@ function getFileName(track) {
|
|
|
122
132
|
(localPath === null || localPath === void 0 ? void 0 : localPath.slice((localPath === null || localPath === void 0 ? void 0 : localPath.replace(/\\/g, '/').lastIndexOf('/')) + 1)) ||
|
|
123
133
|
'');
|
|
124
134
|
}
|
|
125
|
-
exports.getFileName = getFileName;
|
|
126
135
|
function guessAdapter(file, index, adapterHint, model) {
|
|
127
136
|
if (model) {
|
|
128
137
|
const { pluginManager } = (0, index_1.getEnv)(model);
|
|
@@ -138,7 +147,6 @@ function guessAdapter(file, index, adapterHint, model) {
|
|
|
138
147
|
type: exports.UNKNOWN,
|
|
139
148
|
};
|
|
140
149
|
}
|
|
141
|
-
exports.guessAdapter = guessAdapter;
|
|
142
150
|
function guessTrackType(adapterType, model) {
|
|
143
151
|
if (model) {
|
|
144
152
|
const session = (0, index_1.getSession)(model);
|
|
@@ -152,7 +160,6 @@ function guessTrackType(adapterType, model) {
|
|
|
152
160
|
}
|
|
153
161
|
return 'FeatureTrack';
|
|
154
162
|
}
|
|
155
|
-
exports.guessTrackType = guessTrackType;
|
|
156
163
|
function generateUnsupportedTrackConf(trackName, trackUrl, categories) {
|
|
157
164
|
const conf = {
|
|
158
165
|
type: 'FeatureTrack',
|
|
@@ -164,7 +171,6 @@ function generateUnsupportedTrackConf(trackName, trackUrl, categories) {
|
|
|
164
171
|
conf.trackId = (0, index_1.objectHash)(conf);
|
|
165
172
|
return conf;
|
|
166
173
|
}
|
|
167
|
-
exports.generateUnsupportedTrackConf = generateUnsupportedTrackConf;
|
|
168
174
|
function generateUnknownTrackConf(trackName, trackUrl, categories) {
|
|
169
175
|
const conf = {
|
|
170
176
|
type: 'FeatureTrack',
|
|
@@ -176,7 +182,6 @@ function generateUnknownTrackConf(trackName, trackUrl, categories) {
|
|
|
176
182
|
conf.trackId = (0, index_1.objectHash)(conf);
|
|
177
183
|
return conf;
|
|
178
184
|
}
|
|
179
|
-
exports.generateUnknownTrackConf = generateUnknownTrackConf;
|
|
180
185
|
function getTrackName(conf, session) {
|
|
181
186
|
const trackName = (0, configuration_1.readConfObject)(conf, 'name');
|
|
182
187
|
if (!trackName && (0, configuration_1.readConfObject)(conf, 'type') === 'ReferenceSequenceTrack') {
|
|
@@ -187,4 +192,3 @@ function getTrackName(conf, session) {
|
|
|
187
192
|
}
|
|
188
193
|
return trackName;
|
|
189
194
|
}
|
|
190
|
-
exports.getTrackName = getTrackName;
|
package/util/types/index.d.ts
CHANGED
|
@@ -225,7 +225,10 @@ export interface AbstractMenuManager {
|
|
|
225
225
|
export declare function isAbstractMenuManager(thing: unknown): thing is AbstractMenuManager;
|
|
226
226
|
export interface NoAssemblyRegion extends SnapshotIn<typeof MUNoAssemblyRegion> {
|
|
227
227
|
}
|
|
228
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* a description of a specific genomic region. assemblyName, refName, start,
|
|
230
|
+
* end, and reversed
|
|
231
|
+
*/
|
|
229
232
|
export interface Region extends SnapshotIn<typeof MUIRegion> {
|
|
230
233
|
}
|
|
231
234
|
export interface AugmentedRegion extends Region {
|
package/util/types/index.js
CHANGED
|
@@ -14,7 +14,29 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.RetryError = exports.AuthNeededError = void 0;
|
|
18
|
+
exports.isViewContainer = isViewContainer;
|
|
19
|
+
exports.isSessionModel = isSessionModel;
|
|
20
|
+
exports.isSessionModelWithConfigEditing = isSessionModelWithConfigEditing;
|
|
21
|
+
exports.isSessionWithAddTracks = isSessionWithAddTracks;
|
|
22
|
+
exports.isSessionWithShareURL = isSessionWithShareURL;
|
|
23
|
+
exports.isSessionModelWithWidgets = isSessionModelWithWidgets;
|
|
24
|
+
exports.isSessionModelWithConnections = isSessionModelWithConnections;
|
|
25
|
+
exports.isSessionModelWithConnectionEditing = isSessionModelWithConnectionEditing;
|
|
26
|
+
exports.isSessionWithSessionPlugins = isSessionWithSessionPlugins;
|
|
27
|
+
exports.isSelectionContainer = isSelectionContainer;
|
|
28
|
+
exports.isViewModel = isViewModel;
|
|
29
|
+
exports.isTrackModel = isTrackModel;
|
|
30
|
+
exports.isDisplayModel = isDisplayModel;
|
|
31
|
+
exports.isTrackViewModel = isTrackViewModel;
|
|
32
|
+
exports.isAppRootModel = isAppRootModel;
|
|
33
|
+
exports.isRootModelWithInternetAccounts = isRootModelWithInternetAccounts;
|
|
34
|
+
exports.isAbstractMenuManager = isAbstractMenuManager;
|
|
35
|
+
exports.isUriLocation = isUriLocation;
|
|
36
|
+
exports.isLocalPathLocation = isLocalPathLocation;
|
|
37
|
+
exports.isBlobLocation = isBlobLocation;
|
|
38
|
+
exports.isAuthNeededException = isAuthNeededException;
|
|
39
|
+
exports.isRetryException = isRetryException;
|
|
18
40
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
19
41
|
__exportStar(require("./util"), exports);
|
|
20
42
|
function isViewContainer(thing) {
|
|
@@ -23,58 +45,47 @@ function isViewContainer(thing) {
|
|
|
23
45
|
'addView' in thing &&
|
|
24
46
|
'views' in thing);
|
|
25
47
|
}
|
|
26
|
-
exports.isViewContainer = isViewContainer;
|
|
27
48
|
function isSessionModel(thing) {
|
|
28
49
|
return (typeof thing === 'object' &&
|
|
29
50
|
thing !== null &&
|
|
30
51
|
'rpcManager' in thing &&
|
|
31
52
|
'configuration' in thing);
|
|
32
53
|
}
|
|
33
|
-
exports.isSessionModel = isSessionModel;
|
|
34
54
|
function isSessionModelWithConfigEditing(thing) {
|
|
35
55
|
return isSessionModel(thing) && 'editConfiguration' in thing;
|
|
36
56
|
}
|
|
37
|
-
exports.isSessionModelWithConfigEditing = isSessionModelWithConfigEditing;
|
|
38
57
|
function isSessionWithAddTracks(thing) {
|
|
39
58
|
return (
|
|
40
59
|
// @ts-expect-error
|
|
41
60
|
isSessionModel(thing) && 'addTrackConf' in thing && !thing.disableAddTracks);
|
|
42
61
|
}
|
|
43
|
-
exports.isSessionWithAddTracks = isSessionWithAddTracks;
|
|
44
62
|
function isSessionWithShareURL(thing) {
|
|
45
63
|
return isSessionModel(thing) && 'shareURL' in thing && !!thing.shareURL;
|
|
46
64
|
}
|
|
47
|
-
exports.isSessionWithShareURL = isSessionWithShareURL;
|
|
48
65
|
function isSessionModelWithWidgets(thing) {
|
|
49
66
|
return isSessionModel(thing) && 'widgets' in thing;
|
|
50
67
|
}
|
|
51
|
-
exports.isSessionModelWithWidgets = isSessionModelWithWidgets;
|
|
52
68
|
function isSessionModelWithConnections(thing) {
|
|
53
69
|
return isSessionModel(thing) && 'makeConnection' in thing;
|
|
54
70
|
}
|
|
55
|
-
exports.isSessionModelWithConnections = isSessionModelWithConnections;
|
|
56
71
|
function isSessionModelWithConnectionEditing(thing) {
|
|
57
72
|
return isSessionModel(thing) && 'addConnectionConf' in thing;
|
|
58
73
|
}
|
|
59
|
-
exports.isSessionModelWithConnectionEditing = isSessionModelWithConnectionEditing;
|
|
60
74
|
function isSessionWithSessionPlugins(thing) {
|
|
61
75
|
return isSessionModel(thing) && 'sessionPlugins' in thing;
|
|
62
76
|
}
|
|
63
|
-
exports.isSessionWithSessionPlugins = isSessionWithSessionPlugins;
|
|
64
77
|
function isSelectionContainer(thing) {
|
|
65
78
|
return (typeof thing === 'object' &&
|
|
66
79
|
thing !== null &&
|
|
67
80
|
'selection' in thing &&
|
|
68
81
|
'setSelection' in thing);
|
|
69
82
|
}
|
|
70
|
-
exports.isSelectionContainer = isSelectionContainer;
|
|
71
83
|
function isViewModel(thing) {
|
|
72
84
|
return (typeof thing === 'object' &&
|
|
73
85
|
thing !== null &&
|
|
74
86
|
'width' in thing &&
|
|
75
87
|
'setWidth' in thing);
|
|
76
88
|
}
|
|
77
|
-
exports.isViewModel = isViewModel;
|
|
78
89
|
function isTrackModel(thing) {
|
|
79
90
|
return (typeof thing === 'object' &&
|
|
80
91
|
thing !== null &&
|
|
@@ -82,7 +93,6 @@ function isTrackModel(thing) {
|
|
|
82
93
|
// @ts-expect-error
|
|
83
94
|
thing.configuration.trackId);
|
|
84
95
|
}
|
|
85
|
-
exports.isTrackModel = isTrackModel;
|
|
86
96
|
function isDisplayModel(thing) {
|
|
87
97
|
return (typeof thing === 'object' &&
|
|
88
98
|
thing !== null &&
|
|
@@ -90,55 +100,47 @@ function isDisplayModel(thing) {
|
|
|
90
100
|
// @ts-expect-error
|
|
91
101
|
thing.configuration.displayId);
|
|
92
102
|
}
|
|
93
|
-
exports.isDisplayModel = isDisplayModel;
|
|
94
103
|
function isTrackViewModel(thing) {
|
|
95
104
|
return (typeof thing === 'object' &&
|
|
96
105
|
thing !== null &&
|
|
97
106
|
'showTrack' in thing &&
|
|
98
107
|
'hideTrack' in thing);
|
|
99
108
|
}
|
|
100
|
-
exports.isTrackViewModel = isTrackViewModel;
|
|
101
109
|
function isAppRootModel(thing) {
|
|
102
110
|
return (typeof thing === 'object' &&
|
|
103
111
|
thing !== null &&
|
|
104
112
|
'findAppropriateInternetAccount' in thing);
|
|
105
113
|
}
|
|
106
|
-
exports.isAppRootModel = isAppRootModel;
|
|
107
114
|
function isRootModelWithInternetAccounts(thing) {
|
|
108
115
|
return (typeof thing === 'object' &&
|
|
109
116
|
thing !== null &&
|
|
110
117
|
'internetAccounts' in thing &&
|
|
111
118
|
'findAppropriateInternetAccount' in thing);
|
|
112
119
|
}
|
|
113
|
-
exports.isRootModelWithInternetAccounts = isRootModelWithInternetAccounts;
|
|
114
120
|
function isAbstractMenuManager(thing) {
|
|
115
121
|
return (typeof thing === 'object' &&
|
|
116
122
|
thing !== null &&
|
|
117
123
|
'appendMenu' in thing &&
|
|
118
124
|
'appendToSubMenu' in thing);
|
|
119
125
|
}
|
|
120
|
-
exports.isAbstractMenuManager = isAbstractMenuManager;
|
|
121
126
|
function isUriLocation(location) {
|
|
122
127
|
return (typeof location === 'object' &&
|
|
123
128
|
location !== null &&
|
|
124
129
|
'uri' in location &&
|
|
125
130
|
!!location.uri);
|
|
126
131
|
}
|
|
127
|
-
exports.isUriLocation = isUriLocation;
|
|
128
132
|
function isLocalPathLocation(location) {
|
|
129
133
|
return (typeof location === 'object' &&
|
|
130
134
|
location !== null &&
|
|
131
135
|
'localPath' in location &&
|
|
132
136
|
!!location.localPath);
|
|
133
137
|
}
|
|
134
|
-
exports.isLocalPathLocation = isLocalPathLocation;
|
|
135
138
|
function isBlobLocation(location) {
|
|
136
139
|
return (typeof location === 'object' &&
|
|
137
140
|
location !== null &&
|
|
138
141
|
'blobId' in location &&
|
|
139
142
|
!!location.blobId);
|
|
140
143
|
}
|
|
141
|
-
exports.isBlobLocation = isBlobLocation;
|
|
142
144
|
class AuthNeededError extends Error {
|
|
143
145
|
constructor(message, url) {
|
|
144
146
|
super(message);
|
|
@@ -164,11 +166,9 @@ function isAuthNeededException(exception) {
|
|
|
164
166
|
(exception.name === 'AuthNeededError' ||
|
|
165
167
|
exception.url !== undefined));
|
|
166
168
|
}
|
|
167
|
-
exports.isAuthNeededException = isAuthNeededException;
|
|
168
169
|
function isRetryException(exception) {
|
|
169
170
|
return (
|
|
170
171
|
// DOMException
|
|
171
172
|
exception.name === 'RetryError' ||
|
|
172
173
|
exception.internetAccountId !== undefined);
|
|
173
174
|
}
|
|
174
|
-
exports.isRetryException = isRetryException;
|
package/util/types/mst.d.ts
CHANGED
package/util/useMeasure.d.ts
CHANGED
package/util/useMeasure.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = useMeasure;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
function useMeasure() {
|
|
5
6
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -31,4 +32,3 @@ function useMeasure() {
|
|
|
31
32
|
}, []);
|
|
32
33
|
return [ref, dims];
|
|
33
34
|
}
|
|
34
|
-
exports.default = useMeasure;
|
package/util/when.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.when = when;
|
|
4
|
+
exports.whenPresent = whenPresent;
|
|
4
5
|
const mobx_1 = require("mobx");
|
|
5
6
|
const aborting_1 = require("./aborting");
|
|
6
7
|
/**
|
|
@@ -52,7 +53,6 @@ function when(getter, { timeout, signal, name } = {}) {
|
|
|
52
53
|
});
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
|
-
exports.when = when;
|
|
56
56
|
/**
|
|
57
57
|
* Wrapper for mobx `when` that makes a promise for the return value
|
|
58
58
|
* of the given function at the point in time when it becomes not
|
|
@@ -65,4 +65,3 @@ async function whenPresent(getter, opts = {}) {
|
|
|
65
65
|
}, opts);
|
|
66
66
|
return getter();
|
|
67
67
|
}
|
|
68
|
-
exports.whenPresent = whenPresent;
|
package/ui/useResizeBar.d.ts
DELETED
package/ui/useResizeBar.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useResizeBar = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
function useResizeBar() {
|
|
6
|
-
const ref = (0, react_1.useRef)(null);
|
|
7
|
-
const [scrollLeft, setScrollLeft] = (0, react_1.useState)(0);
|
|
8
|
-
(0, react_1.useEffect)(() => {
|
|
9
|
-
const timer = setInterval(() => {
|
|
10
|
-
var _a;
|
|
11
|
-
const elt = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.querySelector('.MuiDataGrid-virtualScroller');
|
|
12
|
-
if (elt) {
|
|
13
|
-
setScrollLeft(elt.scrollLeft);
|
|
14
|
-
}
|
|
15
|
-
}, 100);
|
|
16
|
-
return () => {
|
|
17
|
-
clearInterval(timer);
|
|
18
|
-
};
|
|
19
|
-
}, []);
|
|
20
|
-
return { ref, scrollLeft };
|
|
21
|
-
}
|
|
22
|
-
exports.useResizeBar = useResizeBar;
|