@jbrowse/core 2.4.0 → 2.4.2
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.d.ts +1 -3
- package/BaseFeatureWidget/BaseFeatureDetail.js +13 -9
- package/BaseFeatureWidget/SequenceFeatureDetails.js +3 -10
- package/BaseFeatureWidget/SequencePanel.js +1 -1
- package/BaseFeatureWidget/index.d.ts +1 -1
- package/BaseFeatureWidget/index.js +8 -11
- package/PluginLoader.js +8 -8
- package/PluginManager.d.ts +2 -4
- 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 +2 -4
- package/ReExports/modules.js +2 -2
- package/assemblyManager/assembly.js +5 -5
- package/assemblyManager/assemblyConfigSchema.js +2 -2
- package/configuration/configurationSchema.d.ts +3 -1
- package/configuration/configurationSchema.js +1 -1
- package/configuration/configurationSlot.d.ts +1 -0
- 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 -3
- 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/models/baseTrackConfig.js +1 -1
- 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.d.ts +2 -3
- package/ui/ViewContainer.js +7 -41
- package/ui/ViewContainerTitle.d.ts +6 -0
- package/ui/ViewContainerTitle.js +42 -0
- 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 +11 -9
- package/util/index.js +42 -50
- package/util/io/RemoteFileWithRangeCache.js +2 -2
- package/util/io/index.d.ts +4 -3
- package/util/io/index.js +14 -9
- 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/mst-reflection.d.ts +12 -17
- package/util/mst-reflection.js +13 -12
- 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 +2 -1
- package/util/types/index.js +3 -3
- package/util/types/mst.js +3 -3
- package/util/useMeasure.d.ts +5 -0
- package/util/useMeasure.js +34 -0
|
@@ -3,9 +3,7 @@ import { IAnyStateTreeNode } from 'mobx-state-tree';
|
|
|
3
3
|
import { BaseCardProps, BaseProps } from './types';
|
|
4
4
|
import { SimpleFeatureSerializedNoId } from '../util/simpleFeature';
|
|
5
5
|
export declare const useStyles: (params: void, styleOverrides?: {
|
|
6
|
-
props:
|
|
7
|
-
classes?: Record<string, string> | undefined;
|
|
8
|
-
} & Record<string, unknown>;
|
|
6
|
+
props: any;
|
|
9
7
|
ownerState?: Record<string, unknown> | undefined;
|
|
10
8
|
} | undefined) => {
|
|
11
9
|
classes: Record<"expansionPanelDetails" | "expandIcon" | "field" | "fieldDescription" | "fieldName" | "fieldValue" | "fieldSubvalue", string>;
|
|
@@ -169,7 +169,7 @@ function Position(props) {
|
|
|
169
169
|
'1': '+',
|
|
170
170
|
};
|
|
171
171
|
const str = strandMap[strand] ? `(${strandMap[strand]})` : '';
|
|
172
|
-
// @ts-
|
|
172
|
+
// @ts-expect-error
|
|
173
173
|
const loc = (0, util_1.assembleLocString)(feature);
|
|
174
174
|
return react_1.default.createElement(react_1.default.Fragment, null, `${loc} ${str}`);
|
|
175
175
|
}
|
|
@@ -209,7 +209,11 @@ exports.UriLink = UriLink;
|
|
|
209
209
|
function DataGridDetails({ value, prefix, name, }) {
|
|
210
210
|
const keys = Object.keys(value[0]).sort();
|
|
211
211
|
const unionKeys = new Set(keys);
|
|
212
|
-
|
|
212
|
+
for (const val of value) {
|
|
213
|
+
for (const k of Object.keys(val)) {
|
|
214
|
+
unionKeys.add(k);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
213
217
|
if (unionKeys.size < keys.length + 5) {
|
|
214
218
|
// avoids key 'id' from being used in row data
|
|
215
219
|
const rows = Object.entries(value).map(([k, val]) => {
|
|
@@ -294,12 +298,12 @@ function UriAttribute({ value, prefix, name, }) {
|
|
|
294
298
|
}
|
|
295
299
|
function Attributes(props) {
|
|
296
300
|
const { attributes, omit = [], omitSingleLevel = [], descriptions, formatter = val => val, hideUris, prefix = [], } = props;
|
|
297
|
-
const omits = [...omit, ...globalOmit, ...omitSingleLevel];
|
|
301
|
+
const omits = new Set([...omit, ...globalOmit, ...omitSingleLevel]);
|
|
298
302
|
const { __jbrowsefmt, ...rest } = attributes;
|
|
299
303
|
const formattedAttributes = { ...rest, ...__jbrowsefmt };
|
|
300
|
-
const maxLabelWidth = generateMaxWidth(Object.entries(formattedAttributes).filter(([k, v]) => v !== undefined && !omits.
|
|
304
|
+
const maxLabelWidth = generateMaxWidth(Object.entries(formattedAttributes).filter(([k, v]) => v !== undefined && !omits.has(k)), prefix);
|
|
301
305
|
return (react_1.default.createElement(react_1.default.Fragment, null, Object.entries(formattedAttributes)
|
|
302
|
-
.filter(([k, v]) => v !== undefined && !omits.
|
|
306
|
+
.filter(([k, v]) => v !== undefined && !omits.has(k))
|
|
303
307
|
.map(([key, value]) => {
|
|
304
308
|
const description = accessNested([...prefix, key], descriptions);
|
|
305
309
|
if (Array.isArray(value)) {
|
|
@@ -333,7 +337,7 @@ function generateTitle(name, id, type) {
|
|
|
333
337
|
}
|
|
334
338
|
function FeatureDetails(props) {
|
|
335
339
|
const { omit = [], model, feature, depth = 0 } = props;
|
|
336
|
-
const { name = '', id = '', type = '', subfeatures } = feature;
|
|
340
|
+
const { mate, name = '', id = '', type = '', subfeatures } = feature;
|
|
337
341
|
const pm = (0, util_1.getEnv)(model).pluginManager;
|
|
338
342
|
const session = (0, util_1.getSession)(model);
|
|
339
343
|
const ExtraPanel = pm.evaluateExtensionPoint('Core-extraFeaturePanel', null, {
|
|
@@ -344,10 +348,10 @@ function FeatureDetails(props) {
|
|
|
344
348
|
return (react_1.default.createElement(BaseCard, { title: generateTitle(name, id, type) },
|
|
345
349
|
react_1.default.createElement(material_1.Typography, null, "Core details"),
|
|
346
350
|
react_1.default.createElement(CoreDetails, { ...props }),
|
|
347
|
-
|
|
351
|
+
mate ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
348
352
|
react_1.default.createElement(material_1.Divider, null),
|
|
349
353
|
react_1.default.createElement(material_1.Typography, null, "Mate details"),
|
|
350
|
-
react_1.default.createElement(CoreDetails, { ...props, feature:
|
|
354
|
+
react_1.default.createElement(CoreDetails, { ...props, feature: mate }))) : null,
|
|
351
355
|
react_1.default.createElement(material_1.Divider, null),
|
|
352
356
|
react_1.default.createElement(material_1.Typography, null, "Attributes"),
|
|
353
357
|
react_1.default.createElement(Attributes, { attributes: feature, ...props, omit: omit, omitSingleLevel: coreDetails }),
|
|
@@ -369,6 +373,6 @@ exports.default = (0, mobx_react_1.observer)(function ({ model }) {
|
|
|
369
373
|
// setting null is not allowed by jexl so we set it to undefined to hide. see
|
|
370
374
|
// config guide. this replacement happens both here and when snapshotting the
|
|
371
375
|
// featureData
|
|
372
|
-
const g = JSON.parse(JSON.stringify(featureData, (_, v) =>
|
|
376
|
+
const g = JSON.parse(JSON.stringify(featureData, (_, v) => (v === undefined ? null : v)));
|
|
373
377
|
return isEmpty(g) ? null : react_1.default.createElement(FeatureDetails, { model: model, feature: g });
|
|
374
378
|
});
|
|
@@ -48,9 +48,6 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
48
48
|
formControl: {
|
|
49
49
|
margin: 0,
|
|
50
50
|
},
|
|
51
|
-
container: {
|
|
52
|
-
margin: theme.spacing(1),
|
|
53
|
-
},
|
|
54
51
|
container2: {
|
|
55
52
|
marginTop: theme.spacing(1),
|
|
56
53
|
},
|
|
@@ -60,14 +57,10 @@ const BPLIMIT = 500000;
|
|
|
60
57
|
// sequence. this is a best effort and weird genomic phenomena could lead these
|
|
61
58
|
// to not be 100% accurate
|
|
62
59
|
function SequenceFeatureDetails({ model, feature }) {
|
|
63
|
-
var _a;
|
|
64
60
|
const { classes } = useStyles();
|
|
65
|
-
const parentFeature = feature;
|
|
66
|
-
const hasCDS = !!((_a = parentFeature.subfeatures) === null || _a === void 0 ? void 0 : _a.find(sub => sub.type === 'CDS'));
|
|
67
|
-
const isGene = feature.type === 'gene';
|
|
68
61
|
const [shown, setShown] = (0, react_1.useState)(false);
|
|
69
62
|
const [helpShown, setHelpShown] = (0, react_1.useState)(false);
|
|
70
|
-
return
|
|
63
|
+
return !model ? null : (react_1.default.createElement("div", { className: classes.container2 },
|
|
71
64
|
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => setShown(!shown) }, shown ? 'Hide feature sequence' : 'Show feature sequence'),
|
|
72
65
|
react_1.default.createElement(material_1.FormControl, { className: classes.formControl },
|
|
73
66
|
react_1.default.createElement(material_1.IconButton, { onClick: () => setHelpShown(true) },
|
|
@@ -79,7 +72,7 @@ function SequenceFeatureDetails({ model, feature }) {
|
|
|
79
72
|
}
|
|
80
73
|
exports.default = SequenceFeatureDetails;
|
|
81
74
|
function FeatureSequence({ model, feature }) {
|
|
82
|
-
var _a;
|
|
75
|
+
var _a, _b;
|
|
83
76
|
const { classes } = useStyles();
|
|
84
77
|
const parentFeature = feature;
|
|
85
78
|
const hasCDS = !!((_a = parentFeature.subfeatures) === null || _a === void 0 ? void 0 : _a.find(sub => sub.type === 'CDS'));
|
|
@@ -166,7 +159,7 @@ function FeatureSequence({ model, feature }) {
|
|
|
166
159
|
// only attempt fetching gene type sequence on a bare CDS if it has no parent
|
|
167
160
|
const attemptGeneType = feature.type === 'CDS'
|
|
168
161
|
? sequenceTypes.includes('CDS') && !feature.parentId
|
|
169
|
-
: sequenceTypes.includes(feature.type);
|
|
162
|
+
: sequenceTypes.includes(feature.type) && ((_b = feature.subfeatures) === null || _b === void 0 ? void 0 : _b.length);
|
|
170
163
|
const val = attemptGeneType ? (hasCDS ? 'cds' : 'cdna') : 'genomic';
|
|
171
164
|
// this useEffect is needed to reset the mode/setMode useState because the
|
|
172
165
|
// contents of the select box can completely change depending on whether we
|
|
@@ -68,7 +68,7 @@ const SeqPanel = react_1.default.forwardRef(function (props, ref) {
|
|
|
68
68
|
} },
|
|
69
69
|
react_1.default.createElement("span", { style: { background: 'white' } }, `>${feature.name ||
|
|
70
70
|
feature.id ||
|
|
71
|
-
feature.refName
|
|
71
|
+
`${feature.refName}:${feature.start + 1}-${feature.end}`}-${mode}\n`),
|
|
72
72
|
react_1.default.createElement("br", null),
|
|
73
73
|
mode === 'genomic' ? (react_1.default.createElement(SequenceBox_1.Genomic, { sequence: seq })) : mode === 'genomic_sequence_updown' ? (react_1.default.createElement(SequenceBox_1.Genomic, { sequence: seq, upstream: upstream, downstream: downstream })) : mode === 'cds' ? (react_1.default.createElement(SequenceBox_1.GeneCDS, { cds: cds, sequence: seq })) : mode === 'cdna' ? (react_1.default.createElement(SequenceBox_1.GenecDNA, { exons: exons, cds: cds, utr: utr, sequence: seq, intronBp: intronBp })) : mode === 'protein' ? (react_1.default.createElement(SequenceBox_1.GeneProtein, { cds: cds, codonTable: codonTable, sequence: seq })) : mode === 'gene' ? (react_1.default.createElement(SequenceBox_1.GenecDNA, { exons: exons, cds: cds, utr: utr, sequence: seq, includeIntrons: true, intronBp: intronBp })) : mode === 'gene_collapsed_intron' ? (react_1.default.createElement(SequenceBox_1.GenecDNA, { exons: exons, cds: cds, sequence: seq, utr: utr, includeIntrons: true, collapseIntron: true, intronBp: intronBp })) : mode === 'gene_updownstream' ? (react_1.default.createElement(SequenceBox_1.GenecDNA, { exons: exons, cds: cds, sequence: seq, utr: utr, upstream: upstream, downstream: downstream, includeIntrons: true, intronBp: intronBp })) : mode === 'gene_updownstream_collapsed_intron' ? (react_1.default.createElement(SequenceBox_1.GenecDNA, { exons: exons, cds: cds, sequence: seq, utr: utr, upstream: upstream, downstream: downstream, includeIntrons: true, collapseIntron: true, intronBp: intronBp })) : (react_1.default.createElement("div", null, "Unknown type")))));
|
|
74
74
|
});
|
|
@@ -28,8 +28,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
28
28
|
trackId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
29
29
|
trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
30
30
|
}>>, {
|
|
31
|
-
id: string;
|
|
32
31
|
type: "BaseFeatureWidget";
|
|
32
|
+
id: string;
|
|
33
33
|
track: import("mobx-state-tree").ReferenceIdentifier | undefined;
|
|
34
34
|
view: import("mobx-state-tree").ReferenceIdentifier | undefined;
|
|
35
35
|
trackId: string | undefined;
|
|
@@ -60,20 +60,17 @@ function stateModelFactory(pluginManager) {
|
|
|
60
60
|
const session = (0, util_1.getSession)(self);
|
|
61
61
|
if (unformattedFeatureData) {
|
|
62
62
|
const feature = (0, clone_1.default)(unformattedFeatureData);
|
|
63
|
-
const
|
|
63
|
+
const combine = (arg2, feature) => ({
|
|
64
|
+
...(0, configuration_1.getConf)(session, ['formatDetails', arg2], { feature }),
|
|
65
|
+
...(0, configuration_1.getConf)(track, ['formatDetails', arg2], { feature }),
|
|
66
|
+
});
|
|
64
67
|
if (track) {
|
|
65
68
|
// eslint-disable-next-line no-underscore-dangle
|
|
66
|
-
feature.__jbrowsefmt =
|
|
67
|
-
...f(session, 'feature'),
|
|
68
|
-
...f(track, 'feature'),
|
|
69
|
-
};
|
|
69
|
+
feature.__jbrowsefmt = combine('feature', feature);
|
|
70
70
|
const depth = (0, configuration_1.getConf)(track, ['formatDetails', 'depth']);
|
|
71
71
|
formatSubfeatures(feature, depth, sub => {
|
|
72
72
|
// eslint-disable-next-line no-underscore-dangle
|
|
73
|
-
sub.__jbrowsefmt =
|
|
74
|
-
...f(session, 'subfeature'),
|
|
75
|
-
...f(track, 'subfeature'),
|
|
76
|
-
};
|
|
73
|
+
sub.__jbrowsefmt = combine('subfeatures', sub);
|
|
77
74
|
});
|
|
78
75
|
}
|
|
79
76
|
self.setFormattedData(feature);
|
|
@@ -82,7 +79,7 @@ function stateModelFactory(pluginManager) {
|
|
|
82
79
|
},
|
|
83
80
|
}))
|
|
84
81
|
.preProcessSnapshot(snap => {
|
|
85
|
-
// @ts-
|
|
82
|
+
// @ts-expect-error
|
|
86
83
|
const { featureData, finalizedFeatureData, ...rest } = snap;
|
|
87
84
|
return {
|
|
88
85
|
unformattedFeatureData: featureData,
|
|
@@ -100,7 +97,7 @@ function stateModelFactory(pluginManager) {
|
|
|
100
97
|
// hidden, setting null is not allowed by jexl so we set it to
|
|
101
98
|
// undefined to hide. see config guide. this replacement happens both
|
|
102
99
|
// here and when displaying the featureData in base feature widget
|
|
103
|
-
finalizedFeatureData: JSON.parse(JSON.stringify(featureData, (_, v) =>
|
|
100
|
+
finalizedFeatureData: JSON.parse(JSON.stringify(featureData, (_, v) => (v === undefined ? null : v))),
|
|
104
101
|
...rest,
|
|
105
102
|
};
|
|
106
103
|
});
|
package/PluginLoader.js
CHANGED
|
@@ -39,9 +39,9 @@ class PluginLoader {
|
|
|
39
39
|
if (!isInWebWorker()) {
|
|
40
40
|
return (0, load_script2_1.default)(scriptUrl);
|
|
41
41
|
}
|
|
42
|
-
// @ts-
|
|
42
|
+
// @ts-expect-error
|
|
43
43
|
if (globalThis === null || globalThis === void 0 ? void 0 : globalThis.importScripts) {
|
|
44
|
-
// @ts-
|
|
44
|
+
// @ts-expect-error
|
|
45
45
|
await globalThis.importScripts(scriptUrl);
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
@@ -84,14 +84,14 @@ class PluginLoader {
|
|
|
84
84
|
}
|
|
85
85
|
const moduleName = def.name;
|
|
86
86
|
const umdName = `JBrowsePlugin${moduleName}`;
|
|
87
|
-
if (typeof jest
|
|
88
|
-
|
|
89
|
-
globalThis[umdName] = { default: Plugin_1.default };
|
|
87
|
+
if (typeof jest === 'undefined') {
|
|
88
|
+
await this.loadScript(parsedUrl.href);
|
|
90
89
|
}
|
|
91
90
|
else {
|
|
92
|
-
|
|
91
|
+
// @ts-expect-error
|
|
92
|
+
globalThis[umdName] = { default: Plugin_1.default };
|
|
93
93
|
}
|
|
94
|
-
// @ts-
|
|
94
|
+
// @ts-expect-error
|
|
95
95
|
const plugin = globalThis[umdName];
|
|
96
96
|
if (!plugin) {
|
|
97
97
|
throw new Error(`Failed to load UMD bundle for ${moduleName}, ${umdName} is undefined`);
|
|
@@ -118,7 +118,7 @@ class PluginLoader {
|
|
|
118
118
|
return plugin.default;
|
|
119
119
|
}
|
|
120
120
|
installGlobalReExports(target) {
|
|
121
|
-
// @ts-
|
|
121
|
+
// @ts-expect-error
|
|
122
122
|
target.JBrowseExports = Object.fromEntries(Object.entries(ReExports_1.default).map(([moduleName, module]) => {
|
|
123
123
|
return [moduleName, module];
|
|
124
124
|
}));
|
package/PluginManager.d.ts
CHANGED
|
@@ -195,7 +195,7 @@ export default class PluginManager {
|
|
|
195
195
|
showAllRegions(): void;
|
|
196
196
|
zoomOut(): void;
|
|
197
197
|
zoomIn(): void;
|
|
198
|
-
zoomTo(
|
|
198
|
+
zoomTo(bpPerPx: number, offset?: number): number;
|
|
199
199
|
scrollTo(offsetPx: number): number;
|
|
200
200
|
centerAt(coord: number, refName: string | undefined, regionNumber: number): void;
|
|
201
201
|
scroll(distance: number): number;
|
|
@@ -228,9 +228,7 @@ export default class PluginManager {
|
|
|
228
228
|
name?: string | Record<string, unknown> | undefined;
|
|
229
229
|
uniqId?: string | undefined;
|
|
230
230
|
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme: import("@mui/material").Theme, params: Params, classes: Record<RuleNameSubsetReferencableInNestedSelectors, string>) => Record<RuleNameSubsetReferencableInNestedSelectors | RuleName, import("tss-react").CSSObject>)) => (params: Params, styleOverrides?: {
|
|
231
|
-
props:
|
|
232
|
-
classes?: Record<string, string> | undefined;
|
|
233
|
-
} & Record<string, unknown>;
|
|
231
|
+
props: any;
|
|
234
232
|
ownerState?: Record<string, unknown> | undefined;
|
|
235
233
|
} | undefined) => {
|
|
236
234
|
classes: Record<RuleName, string>;
|
package/PluginManager.js
CHANGED
|
@@ -149,7 +149,6 @@ class PluginManager {
|
|
|
149
149
|
}
|
|
150
150
|
this.pluginMetadata[plugin.name] = metadata;
|
|
151
151
|
if ('definition' in load) {
|
|
152
|
-
// @ts-ignore
|
|
153
152
|
this.runtimePluginDefinitions.push(load.definition);
|
|
154
153
|
}
|
|
155
154
|
plugin.install(this);
|
|
@@ -253,7 +252,7 @@ class PluginManager {
|
|
|
253
252
|
pluggableMstType(groupName, fieldName, fallback = mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.null)) {
|
|
254
253
|
const pluggableTypes = this.getElementTypeRecord(groupName)
|
|
255
254
|
.all()
|
|
256
|
-
// @ts-
|
|
255
|
+
// @ts-expect-error
|
|
257
256
|
.map(t => t[fieldName])
|
|
258
257
|
.filter(t => (0, mobx_state_tree_1.isType)(t) && (0, mobx_state_tree_1.isModelType)(t));
|
|
259
258
|
// try to smooth over the case when no types are registered, mostly
|
|
@@ -268,7 +267,7 @@ class PluginManager {
|
|
|
268
267
|
pluggableConfigSchemaType(typeGroup, fieldName = 'configSchema') {
|
|
269
268
|
const pluggableTypes = this.getElementTypeRecord(typeGroup)
|
|
270
269
|
.all()
|
|
271
|
-
// @ts-
|
|
270
|
+
// @ts-expect-error
|
|
272
271
|
.map(t => t[fieldName])
|
|
273
272
|
.filter(t => (0, configuration_1.isBareConfigurationSchemaType)(t));
|
|
274
273
|
if (pluggableTypes.length === 0) {
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default Attributes;
|
|
1
|
+
export { Attributes as default } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';
|
package/ReExports/Attributes.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
// convert named export to default for lazy react
|
|
4
|
-
|
|
5
|
-
exports.default =
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var BaseFeatureDetail_1 = require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return BaseFeatureDetail_1.Attributes; } });
|
package/ReExports/BaseCard.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default BaseCard;
|
|
1
|
+
export { BaseCard as default } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';
|
package/ReExports/BaseCard.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
// convert named export to default for lazy react
|
|
4
|
-
|
|
5
|
-
exports.default =
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var BaseFeatureDetail_1 = require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return BaseFeatureDetail_1.BaseCard; } });
|
package/ReExports/DataGrid.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { DataGrid as default };
|
|
1
|
+
export { DataGrid as default } from '@mui/x-data-grid';
|
package/ReExports/DataGrid.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// convert named export to default for lazy react
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.default = void 0;
|
|
4
|
-
|
|
5
|
-
const x_data_grid_1 = require("@mui/x-data-grid");
|
|
5
|
+
var x_data_grid_1 = require("@mui/x-data-grid");
|
|
6
6
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return x_data_grid_1.DataGrid; } });
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default FeatureDetails;
|
|
1
|
+
export { FeatureDetails as default } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
// convert named export to default for lazy react
|
|
4
|
-
|
|
5
|
-
exports.default =
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var BaseFeatureDetail_1 = require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return BaseFeatureDetail_1.FeatureDetails; } });
|
package/ReExports/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default modules;
|
|
1
|
+
export { default } from './modules';
|
package/ReExports/index.js
CHANGED
|
@@ -3,5 +3,6 @@ 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
|
-
|
|
7
|
-
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var modules_1 = require("./modules");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(modules_1).default; } });
|
package/ReExports/modules.d.ts
CHANGED
|
@@ -112,7 +112,7 @@ declare const libs: {
|
|
|
112
112
|
showAllRegions(): void;
|
|
113
113
|
zoomOut(): void;
|
|
114
114
|
zoomIn(): void;
|
|
115
|
-
zoomTo(
|
|
115
|
+
zoomTo(bpPerPx: number, offset?: number): number;
|
|
116
116
|
scrollTo(offsetPx: number): number;
|
|
117
117
|
centerAt(coord: number, refName: string | undefined, regionNumber: number): void;
|
|
118
118
|
scroll(distance: number): number;
|
|
@@ -145,9 +145,7 @@ declare const libs: {
|
|
|
145
145
|
name?: string | Record<string, unknown> | undefined;
|
|
146
146
|
uniqId?: string | undefined;
|
|
147
147
|
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme: MUIStyles.Theme, params: Params, classes: Record<RuleNameSubsetReferencableInNestedSelectors, string>) => Record<RuleNameSubsetReferencableInNestedSelectors | RuleName, import("tss-react").CSSObject>)) => (params: Params, styleOverrides?: {
|
|
148
|
-
props:
|
|
149
|
-
classes?: Record<string, string> | undefined;
|
|
150
|
-
} & Record<string, unknown>;
|
|
148
|
+
props: any;
|
|
151
149
|
ownerState?: Record<string, unknown> | undefined;
|
|
152
150
|
} | undefined) => {
|
|
153
151
|
classes: Record<RuleName, string>;
|
package/ReExports/modules.js
CHANGED
|
@@ -445,11 +445,11 @@ const libs = {
|
|
|
445
445
|
},
|
|
446
446
|
'@jbrowse/core/data_adapters/BaseAdapter': BaseAdapterExports,
|
|
447
447
|
};
|
|
448
|
-
const libsList =
|
|
448
|
+
const libsList = Object.keys(libs);
|
|
449
449
|
// make sure that all the items in the ReExports/list array (used by build
|
|
450
450
|
// systems and such) are included here, and vice versa
|
|
451
451
|
const inLibsOnly = libsList.filter(mod => !list_1.default.includes(mod));
|
|
452
|
-
if (inLibsOnly.length) {
|
|
452
|
+
if (inLibsOnly.length > 0) {
|
|
453
453
|
throw new Error(`The following modules are in the re-exports list, but not the modules libs: ${inLibsOnly.join(', ')}`);
|
|
454
454
|
}
|
|
455
455
|
const inReExportsOnly = list_1.default.filter(mod => !libsList.includes(mod));
|
|
@@ -74,7 +74,7 @@ async function loadRefNameMap(assembly, adapterConfig, options, signal) {
|
|
|
74
74
|
}
|
|
75
75
|
// Valid refName pattern from https://samtools.github.io/hts-specs/SAMv1.pdf
|
|
76
76
|
function checkRefName(refName) {
|
|
77
|
-
if (!
|
|
77
|
+
if (!refNameRegex.test(refName)) {
|
|
78
78
|
throw new Error(`Encountered invalid refName: "${refName}"`);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -104,7 +104,7 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
104
104
|
}))
|
|
105
105
|
.views(self => ({
|
|
106
106
|
get initialized() {
|
|
107
|
-
// @ts-
|
|
107
|
+
// @ts-expect-error
|
|
108
108
|
self.load();
|
|
109
109
|
return !!self.refNameAliases;
|
|
110
110
|
},
|
|
@@ -112,7 +112,7 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
112
112
|
return (0, configuration_1.getConf)(self, 'name');
|
|
113
113
|
},
|
|
114
114
|
get regions() {
|
|
115
|
-
// @ts-
|
|
115
|
+
// @ts-expect-error
|
|
116
116
|
self.load();
|
|
117
117
|
return self.volatileRegions;
|
|
118
118
|
},
|
|
@@ -172,7 +172,7 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
172
172
|
if (!self.refNames) {
|
|
173
173
|
return undefined;
|
|
174
174
|
}
|
|
175
|
-
const idx = self.refNames.
|
|
175
|
+
const idx = self.refNames.indexOf(refName);
|
|
176
176
|
if (idx === -1) {
|
|
177
177
|
return undefined;
|
|
178
178
|
}
|
|
@@ -301,7 +301,7 @@ async function getCytobands(config, pm) {
|
|
|
301
301
|
const type = pm.getAdapterType(config.type);
|
|
302
302
|
const CLASS = await type.getAdapterClass();
|
|
303
303
|
const adapter = new CLASS(config, undefined, pm);
|
|
304
|
-
// @ts-
|
|
304
|
+
// @ts-expect-error
|
|
305
305
|
return adapter.getData();
|
|
306
306
|
}
|
|
307
307
|
async function getAssemblyRegions(config, pm, signal) {
|
|
@@ -42,7 +42,7 @@ function assemblyConfigSchema(pluginManager) {
|
|
|
42
42
|
}, {
|
|
43
43
|
preProcessSnapshot: snap => {
|
|
44
44
|
// allow refNameAliases to be unspecified
|
|
45
|
-
// @ts-
|
|
45
|
+
// @ts-expect-error
|
|
46
46
|
if (!snap.adapter) {
|
|
47
47
|
return { adapter: { type: 'RefNameAliasAdapter' } };
|
|
48
48
|
}
|
|
@@ -59,7 +59,7 @@ function assemblyConfigSchema(pluginManager) {
|
|
|
59
59
|
}, {
|
|
60
60
|
preProcessSnapshot: snap => {
|
|
61
61
|
// allow cytoBand to be unspecified
|
|
62
|
-
// @ts-
|
|
62
|
+
// @ts-expect-error
|
|
63
63
|
if (!snap.adapter) {
|
|
64
64
|
return { adapter: { type: 'CytobandAdapter' } };
|
|
65
65
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Instance, IAnyType } from 'mobx-state-tree';
|
|
2
|
-
import { ConfigSlotDefinition } from './configurationSlot';
|
|
2
|
+
import ConfigSlot, { ConfigSlotDefinition } from './configurationSlot';
|
|
3
3
|
export interface ConfigurationSchemaDefinition {
|
|
4
4
|
[n: string]: ConfigSlotDefinition | ConfigurationSchemaDefinition | string | number | IAnyType;
|
|
5
5
|
}
|
|
@@ -23,6 +23,8 @@ export interface AnyConfigurationSchemaType extends ReturnType<typeof makeConfig
|
|
|
23
23
|
type: string;
|
|
24
24
|
}
|
|
25
25
|
export type AnyConfigurationModel = Instance<AnyConfigurationSchemaType>;
|
|
26
|
+
export type AnyConfigurationSlotType = ReturnType<typeof ConfigSlot>;
|
|
27
|
+
export type AnyConfigurationSlot = Instance<AnyConfigurationSlotType>;
|
|
26
28
|
export type ConfigurationModel<SCHEMA extends AnyConfigurationSchemaType> = Instance<SCHEMA>;
|
|
27
29
|
export declare function ConfigurationSchema<DEFINITION extends ConfigurationSchemaDefinition, OPTIONS extends ConfigurationSchemaOptions>(modelName: string, inputSchemaDefinition: DEFINITION, inputOptions?: OPTIONS): AnyConfigurationSchemaType;
|
|
28
30
|
export declare function ConfigurationReference(schemaType: IAnyType): import("mobx-state-tree").ITypeUnion<any, any, any>;
|
|
@@ -32,7 +32,7 @@ function preprocessConfigurationSchemaArguments(modelName, inputSchemaDefinition
|
|
|
32
32
|
...schemaDefinition,
|
|
33
33
|
};
|
|
34
34
|
options = {
|
|
35
|
-
...
|
|
35
|
+
...inputOptions.baseConfiguration.jbrowseSchemaOptions,
|
|
36
36
|
...inputOptions,
|
|
37
37
|
};
|
|
38
38
|
delete options.baseConfiguration;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IAnyModelType, IAnyComplexType } from 'mobx-state-tree';
|
|
2
2
|
export interface ConfigSlotDefinition {
|
|
3
|
+
/** human-readable description of the slot's meaning */
|
|
3
4
|
description?: string;
|
|
4
5
|
/** custom base MST model for the slot's value */
|
|
5
6
|
model?: IAnyModelType | IAnyComplexType;
|
package/configuration/util.js
CHANGED
|
@@ -100,7 +100,7 @@ exports.getConf = getConf;
|
|
|
100
100
|
function getTypeNamesFromExplicitlyTypedUnion(maybeUnionType) {
|
|
101
101
|
if ((0, mobx_state_tree_1.isType)(maybeUnionType)) {
|
|
102
102
|
maybeUnionType = (0, mst_reflection_1.resolveLateType)(maybeUnionType);
|
|
103
|
-
// @ts-
|
|
103
|
+
// @ts-expect-error
|
|
104
104
|
if ((0, mobx_state_tree_1.isUnionType)(maybeUnionType)) {
|
|
105
105
|
const typeNames = [];
|
|
106
106
|
(0, mst_reflection_1.getUnionSubTypes)(maybeUnionType).forEach(type => {
|
|
@@ -169,7 +169,7 @@ class BaseFeatureDataAdapter extends BaseAdapter {
|
|
|
169
169
|
}
|
|
170
170
|
else {
|
|
171
171
|
console.warn("Stats estimation reached timeout, or didn't get enough features");
|
|
172
|
-
return { featureDensity:
|
|
172
|
+
return { featureDensity: Number.POSITIVE_INFINITY };
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
175
|
return statsFromInterval(1000, 0);
|
|
@@ -17,7 +17,7 @@ class CytobandAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
17
17
|
if (loc.uri === '' || loc.uri === '/path/to/cytoband.txt.gz') {
|
|
18
18
|
return [];
|
|
19
19
|
}
|
|
20
|
-
const buffer =
|
|
20
|
+
const buffer = await (0, io_1.openLocation)(loc, pm).readFile();
|
|
21
21
|
const buf = isGzip(buffer) ? await (0, bgzf_filehandle_1.unzip)(buffer) : buffer;
|
|
22
22
|
const text = new TextDecoder('utf8', { fatal: true }).decode(buf);
|
|
23
23
|
return text
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SnapshotIn } from 'mobx-state-tree';
|
|
2
2
|
import PluginManager from '../PluginManager';
|
|
3
|
-
import { AnyConfigurationSchemaType } from '../configuration
|
|
3
|
+
import { AnyConfigurationSchemaType } from '../configuration';
|
|
4
4
|
import { AnyDataAdapter } from './BaseAdapter';
|
|
5
|
+
type ConfigSnap = SnapshotIn<AnyConfigurationSchemaType>;
|
|
5
6
|
interface AdapterCacheEntry {
|
|
6
7
|
dataAdapter: AnyDataAdapter;
|
|
7
8
|
sessionIds: Set<string>;
|
|
@@ -21,7 +22,7 @@ export declare function getAdapter(pluginManager: PluginManager, sessionId: stri
|
|
|
21
22
|
* allows them to get any sub-adapters that they need
|
|
22
23
|
* internally, staying with the same worker session ID
|
|
23
24
|
*/
|
|
24
|
-
export type getSubAdapterType = (
|
|
25
|
+
export type getSubAdapterType = (adapterConfigSnap: ConfigSnap) => ReturnType<typeof getAdapter>;
|
|
25
26
|
export declare function freeAdapterResources(specification: Record<string, any>): number;
|
|
26
27
|
export declare function clearAdapterCache(): void;
|
|
27
28
|
export {};
|
|
@@ -39,7 +39,6 @@ async function getAdapter(pluginManager, sessionId, adapterConfigSnapshot) {
|
|
|
39
39
|
// (such as sequence adapters or wrapped subadapters) that it needs
|
|
40
40
|
//
|
|
41
41
|
const { AdapterClass, getAdapterClass } = dataAdapterType;
|
|
42
|
-
// @ts-ignore
|
|
43
42
|
const CLASS = AdapterClass || (await getAdapterClass());
|
|
44
43
|
if (!CLASS) {
|
|
45
44
|
throw new Error('Failed to get adapter');
|
|
@@ -81,11 +80,11 @@ function freeAdapterResources(specification) {
|
|
|
81
80
|
else {
|
|
82
81
|
const regions = specification.regions ||
|
|
83
82
|
(specification.region ? [specification.region] : []);
|
|
84
|
-
|
|
83
|
+
for (const region of regions) {
|
|
85
84
|
if (region.refName !== undefined) {
|
|
86
85
|
cacheEntry.dataAdapter.freeResources(region);
|
|
87
86
|
}
|
|
88
|
-
}
|
|
87
|
+
}
|
|
89
88
|
}
|
|
90
89
|
});
|
|
91
90
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"material-ui-popup-state": "^5.0.0",
|
|
55
55
|
"rbush": "^3.0.1",
|
|
56
56
|
"react-error-boundary": "^3.0.0",
|
|
57
|
-
"react-use-measure": "^2.1.1",
|
|
58
57
|
"serialize-error": "^8.0.0",
|
|
59
58
|
"shortid": "^2.2.13",
|
|
60
59
|
"svg-path-generator": "^1.1.0"
|
|
@@ -75,5 +74,5 @@
|
|
|
75
74
|
"access": "public",
|
|
76
75
|
"directory": "dist"
|
|
77
76
|
},
|
|
78
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "36e382a70e7d220343b873e7e6aba5c83e5342c8"
|
|
79
78
|
}
|
|
@@ -55,7 +55,7 @@ class RpcMethodType extends PluggableElementBase_1.default {
|
|
|
55
55
|
catch (error) {
|
|
56
56
|
if ((0, types_1.isAuthNeededException)(error)) {
|
|
57
57
|
const retryAccount =
|
|
58
|
-
// @ts-
|
|
58
|
+
// @ts-expect-error
|
|
59
59
|
(_a = this.pluginManager.rootModel) === null || _a === void 0 ? void 0 : _a.createEphemeralInternetAccount(`HTTPBasicInternetAccount-${new URL(error.url).origin}`, {}, error.url);
|
|
60
60
|
throw new types_1.RetryError('Retrying with created internet account', retryAccount.internetAccountId);
|
|
61
61
|
}
|
|
@@ -11,6 +11,16 @@ import TextSearchAdapterType from './TextSearchAdapterType';
|
|
|
11
11
|
import AddTrackWorkflowType from './AddTrackWorkflowType';
|
|
12
12
|
export * from './renderers';
|
|
13
13
|
export * from './models';
|
|
14
|
-
export { AdapterType, ConnectionType, RendererType, WidgetType, TrackType, DisplayType, ViewType, RpcMethodType, InternetAccountType, TextSearchAdapterType, AddTrackWorkflowType, };
|
|
15
14
|
export type PluggableElementType = AdapterType | ConnectionType | RendererType | WidgetType | TrackType | DisplayType | ViewType | RpcMethodType | InternetAccountType | TextSearchAdapterType | AddTrackWorkflowType;
|
|
16
15
|
export type PluggableElementMember = keyof AdapterType | keyof ConnectionType | keyof RendererType | keyof WidgetType | keyof TrackType | keyof DisplayType | keyof ViewType | keyof RpcMethodType | keyof InternetAccountType | keyof TextSearchAdapterType | keyof AddTrackWorkflowType;
|
|
16
|
+
export { default as AdapterType } from './AdapterType';
|
|
17
|
+
export { default as RendererType } from './renderers/RendererType';
|
|
18
|
+
export { default as ConnectionType } from './ConnectionType';
|
|
19
|
+
export { default as TrackType } from './TrackType';
|
|
20
|
+
export { default as WidgetType } from './WidgetType';
|
|
21
|
+
export { default as ViewType } from './ViewType';
|
|
22
|
+
export { default as DisplayType } from './DisplayType';
|
|
23
|
+
export { default as InternetAccountType } from './InternetAccountType';
|
|
24
|
+
export { default as RpcMethodType } from './RpcMethodType';
|
|
25
|
+
export { default as AddTrackWorkflowType } from './AddTrackWorkflowType';
|
|
26
|
+
export { default as TextSearchAdapterType } from './TextSearchAdapterType';
|