@jbrowse/core 1.7.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseFeatureWidget/BaseFeatureDetail.d.ts +14 -7
- package/BaseFeatureWidget/BaseFeatureDetail.js +203 -125
- package/BaseFeatureWidget/SequenceFeatureDetails.js +20 -15
- package/BaseFeatureWidget/index.d.ts +23 -2
- package/BaseFeatureWidget/index.js +100 -3
- package/BaseFeatureWidget/index.test.js +48 -30
- package/PluginManager.d.ts +58 -86
- package/ReExports/Attributes.d.ts +2 -0
- package/ReExports/Attributes.js +12 -0
- package/ReExports/BaseCard.d.ts +2 -0
- package/ReExports/BaseCard.js +12 -0
- package/ReExports/DataGrid.d.ts +2 -0
- package/ReExports/DataGrid.js +13 -0
- package/ReExports/FeatureDetails.d.ts +2 -0
- package/ReExports/FeatureDetails.js +12 -0
- package/ReExports/list.js +1 -1
- package/ReExports/material-ui-colors.d.ts +1 -19
- package/ReExports/material-ui-colors.js +11 -152
- package/ReExports/modules.d.ts +59 -91
- package/ReExports/modules.js +683 -127
- package/TextSearch/TextSearchManager.d.ts +3 -1
- package/assemblyManager/assembly.d.ts +6 -7
- package/assemblyManager/assembly.js +27 -16
- package/assemblyManager/assemblyManager.d.ts +82 -24
- package/assemblyManager/assemblyManager.js +32 -36
- package/configuration/util.d.ts +1 -1
- package/package.json +15 -15
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +10 -10
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +1 -1
- package/pluggableElementTypes/models/BaseTrackModel.js +24 -25
- package/pluggableElementTypes/models/baseTrackConfig.js +20 -13
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +2 -2
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +2 -2
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +1 -1
- package/rpc/BaseRpcDriver.js +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AboutDialog.d.ts +1 -1
- package/ui/AboutDialog.js +38 -16
- package/ui/App.js +18 -37
- package/ui/AssemblySelector.d.ts +1 -1
- package/ui/AssemblySelector.js +10 -5
- package/ui/CascadingMenu.d.ts +9 -0
- package/ui/CascadingMenu.js +207 -0
- package/ui/Drawer.js +8 -5
- package/ui/DrawerWidget.js +39 -45
- package/ui/DropDownMenu.d.ts +0 -8
- package/ui/DropDownMenu.js +9 -15
- package/ui/EditableTypography.d.ts +1 -1
- package/ui/EditableTypography.js +42 -48
- package/ui/ErrorMessage.js +13 -23
- package/ui/FactoryResetDialog.js +6 -6
- package/ui/FatalErrorDialog.js +5 -5
- package/ui/FileSelector/FileSelector.js +19 -19
- package/ui/FileSelector/LocalFileChooser.js +12 -8
- package/ui/FileSelector/UrlChooser.js +2 -2
- package/ui/Icons.d.ts +1 -1
- package/ui/Icons.js +1 -1
- package/ui/Menu.d.ts +11 -1
- package/ui/Menu.js +32 -38
- package/ui/PrerenderedCanvas.js +10 -1
- package/ui/ResizeHandle.js +8 -6
- package/ui/ReturnToImportFormDialog.js +14 -10
- package/ui/SanitizedHTML.js +15 -21
- package/ui/Snackbar.js +11 -9
- package/ui/Tooltip.d.ts +3 -1
- package/ui/Tooltip.js +5 -3
- package/ui/ViewContainer.js +38 -25
- package/ui/index.d.ts +1 -0
- package/ui/index.js +9 -0
- package/ui/theme.d.ts +279 -131
- package/ui/theme.js +174 -154
- package/ui/theme.test.js +56 -75
- package/util/Base1DViewModel.d.ts +1 -8
- package/util/Base1DViewModel.js +11 -13
- package/util/color/index.js +6 -6
- package/util/index.d.ts +4 -8
- package/util/index.js +29 -19
- package/util/jexl.js +42 -43
- package/util/layouts/GranularRectLayout.js +1 -3
- package/util/layouts/PrecomputedLayout.js +1 -3
- package/util/offscreenCanvasPonyfill.js +10 -12
- package/util/tracks.js +4 -2
- package/util/types/index.d.ts +14 -4
- package/util/types/index.js +6 -0
- package/util/types/mst.d.ts +3 -3
- package/util/types/mst.js +11 -7
package/util/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare function getSession(node: IAnyStateTreeNode): import("./types").A
|
|
|
24
24
|
/** get the state model of the view in the state tree that contains the given node */
|
|
25
25
|
export declare function getContainingView(node: IAnyStateTreeNode): import("./types").AbstractViewModel & IAnyStateTreeNode;
|
|
26
26
|
/** get the state model of the view in the state tree that contains the given node */
|
|
27
|
-
export declare function getContainingTrack(node: IAnyStateTreeNode): IAnyStateTreeNode;
|
|
27
|
+
export declare function getContainingTrack(node: IAnyStateTreeNode): import("./types").AbstractTrackModel & IAnyStateTreeNode;
|
|
28
28
|
export declare function getContainingDisplay(node: IAnyStateTreeNode): import("./types").AbstractDisplayModel & IAnyStateTreeNode;
|
|
29
29
|
/**
|
|
30
30
|
* Assemble a 1-based "locString" from an interbase genomic location
|
|
@@ -149,12 +149,6 @@ export declare function bpSpanPx(leftBp: number, rightBp: number, region: {
|
|
|
149
149
|
end: number;
|
|
150
150
|
reversed?: boolean;
|
|
151
151
|
}, bpPerPx: number): [number, number];
|
|
152
|
-
export declare const objectFromEntries: {
|
|
153
|
-
<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
|
|
154
|
-
[k: string]: T;
|
|
155
|
-
};
|
|
156
|
-
(entries: Iterable<readonly any[]>): any;
|
|
157
|
-
};
|
|
158
152
|
export declare function iterMap<T, U>(iterable: Iterable<T>, func: (item: T) => U, sizeHint?: number): U[];
|
|
159
153
|
interface Assembly {
|
|
160
154
|
name: string;
|
|
@@ -222,7 +216,7 @@ export declare function renameRegionsIfNeeded<ARGTYPE extends {
|
|
|
222
216
|
export declare function minmax(a: number, b: number): number[];
|
|
223
217
|
export declare function stringify({ refName, coord, oob, }: {
|
|
224
218
|
coord: number;
|
|
225
|
-
refName
|
|
219
|
+
refName?: string;
|
|
226
220
|
oob?: boolean;
|
|
227
221
|
}): string;
|
|
228
222
|
export declare const isElectron: boolean;
|
|
@@ -342,6 +336,8 @@ export declare function viewBpToPx({ refName, coord, regionNumber, self, }: {
|
|
|
342
336
|
} | undefined;
|
|
343
337
|
export declare function supportedIndexingAdapters(type: string): boolean;
|
|
344
338
|
export declare function getBpDisplayStr(totalBp: number): string;
|
|
339
|
+
export declare function toLocale(n: number): string;
|
|
340
|
+
export declare function getTickDisplayStr(totalBp: number, bpPerPx: number): string;
|
|
345
341
|
export declare function getViewParams(model: IAnyStateTreeNode, exportSVG?: boolean): {
|
|
346
342
|
offsetPx: number;
|
|
347
343
|
offsetPx1: number;
|
package/util/index.js
CHANGED
|
@@ -32,7 +32,6 @@ var _exportNames = {
|
|
|
32
32
|
cartesianToPolar: true,
|
|
33
33
|
featureSpanPx: true,
|
|
34
34
|
bpSpanPx: true,
|
|
35
|
-
objectFromEntries: true,
|
|
36
35
|
iterMap: true,
|
|
37
36
|
mergeConfigs: true,
|
|
38
37
|
findLastIndex: true,
|
|
@@ -58,6 +57,8 @@ var _exportNames = {
|
|
|
58
57
|
viewBpToPx: true,
|
|
59
58
|
supportedIndexingAdapters: true,
|
|
60
59
|
getBpDisplayStr: true,
|
|
60
|
+
toLocale: true,
|
|
61
|
+
getTickDisplayStr: true,
|
|
61
62
|
getViewParams: true,
|
|
62
63
|
getLayoutId: true,
|
|
63
64
|
SimpleFeature: true,
|
|
@@ -91,6 +92,7 @@ exports.getContainingTrack = getContainingTrack;
|
|
|
91
92
|
exports.getContainingView = getContainingView;
|
|
92
93
|
exports.getLayoutId = getLayoutId;
|
|
93
94
|
exports.getSession = getSession;
|
|
95
|
+
exports.getTickDisplayStr = getTickDisplayStr;
|
|
94
96
|
exports.getViewParams = getViewParams;
|
|
95
97
|
exports.hashCode = hashCode;
|
|
96
98
|
exports.isElectron = exports.inProduction = exports.inDevelopment = void 0;
|
|
@@ -105,7 +107,6 @@ exports.makeAbortableReaction = makeAbortableReaction;
|
|
|
105
107
|
exports.measureText = measureText;
|
|
106
108
|
exports.mergeConfigs = mergeConfigs;
|
|
107
109
|
exports.minmax = minmax;
|
|
108
|
-
exports.objectFromEntries = void 0;
|
|
109
110
|
exports.objectHash = objectHash;
|
|
110
111
|
exports.parseLocString = parseLocString;
|
|
111
112
|
exports.parseLocStringOneBased = parseLocStringOneBased;
|
|
@@ -118,6 +119,7 @@ exports.revcom = revcom;
|
|
|
118
119
|
exports.springAnimate = springAnimate;
|
|
119
120
|
exports.stringify = stringify;
|
|
120
121
|
exports.supportedIndexingAdapters = supportedIndexingAdapters;
|
|
122
|
+
exports.toLocale = toLocale;
|
|
121
123
|
exports.updateStatus = updateStatus;
|
|
122
124
|
exports.useDebounce = useDebounce;
|
|
123
125
|
exports.useDebouncedCallback = useDebouncedCallback;
|
|
@@ -141,8 +143,6 @@ var _mobxStateTree = require("mobx-state-tree");
|
|
|
141
143
|
|
|
142
144
|
var _mobx = require("mobx");
|
|
143
145
|
|
|
144
|
-
var _object = _interopRequireDefault(require("object.fromentries"));
|
|
145
|
-
|
|
146
146
|
var _deepmerge = _interopRequireDefault(require("deepmerge"));
|
|
147
147
|
|
|
148
148
|
var _simpleFeature = _interopRequireWildcard(require("./simpleFeature"));
|
|
@@ -245,11 +245,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
245
245
|
|
|
246
246
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
247
247
|
|
|
248
|
-
if (!Object.fromEntries) {
|
|
249
|
-
// @ts-ignore
|
|
250
|
-
_object.default.shim();
|
|
251
|
-
}
|
|
252
|
-
|
|
253
248
|
var inDevelopment = (typeof process === "undefined" ? "undefined" : (0, _typeof2.default)(process)) === 'object' && process.env && process.env.NODE_ENV === 'development';
|
|
254
249
|
exports.inDevelopment = inDevelopment;
|
|
255
250
|
var inProduction = !inDevelopment;
|
|
@@ -785,11 +780,8 @@ function bpSpanPx(leftBp, rightBp, region, bpPerPx) {
|
|
|
785
780
|
var start = bpToPx(leftBp, region, bpPerPx);
|
|
786
781
|
var end = bpToPx(rightBp, region, bpPerPx);
|
|
787
782
|
return region.reversed ? [end, start] : [start, end];
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
var objectFromEntries = Object.fromEntries.bind(Object); // do an array map of an iterable
|
|
783
|
+
} // do an array map of an iterable
|
|
791
784
|
|
|
792
|
-
exports.objectFromEntries = objectFromEntries;
|
|
793
785
|
|
|
794
786
|
function iterMap(iterable, func, sizeHint) {
|
|
795
787
|
var results = sizeHint ? new Array(sizeHint) : [];
|
|
@@ -867,7 +859,8 @@ function findLastIndex(array, predicate) {
|
|
|
867
859
|
*/
|
|
868
860
|
|
|
869
861
|
|
|
870
|
-
function makeAbortableReaction(self, dataFunction, asyncReactionFunction,
|
|
862
|
+
function makeAbortableReaction(self, dataFunction, asyncReactionFunction, // @ts-ignore
|
|
863
|
+
reactionOptions, startedFunction, successFunction, errorFunction) {
|
|
871
864
|
var inProgress;
|
|
872
865
|
|
|
873
866
|
function handleError(error) {
|
|
@@ -880,7 +873,7 @@ function makeAbortableReaction(self, dataFunction, asyncReactionFunction, reacti
|
|
|
880
873
|
}
|
|
881
874
|
}
|
|
882
875
|
|
|
883
|
-
|
|
876
|
+
(0, _mobxStateTree.addDisposer)(self, (0, _mobx.reaction)(function () {
|
|
884
877
|
try {
|
|
885
878
|
return dataFunction(self);
|
|
886
879
|
} catch (e) {
|
|
@@ -911,7 +904,8 @@ function makeAbortableReaction(self, dataFunction, asyncReactionFunction, reacti
|
|
|
911
904
|
startedFunction(thisInProgress);
|
|
912
905
|
_context.prev = 6;
|
|
913
906
|
_context.next = 9;
|
|
914
|
-
return asyncReactionFunction(data, thisInProgress.signal, self,
|
|
907
|
+
return asyncReactionFunction(data, thisInProgress.signal, self, // @ts-ignore
|
|
908
|
+
mobxReactionHandle);
|
|
915
909
|
|
|
916
910
|
case 9:
|
|
917
911
|
result = _context.sent;
|
|
@@ -945,8 +939,7 @@ function makeAbortableReaction(self, dataFunction, asyncReactionFunction, reacti
|
|
|
945
939
|
return function (_x, _x2) {
|
|
946
940
|
return _ref2.apply(this, arguments);
|
|
947
941
|
};
|
|
948
|
-
}(), reactionOptions);
|
|
949
|
-
(0, _mobxStateTree.addDisposer)(self, reactionDisposer);
|
|
942
|
+
}(), reactionOptions));
|
|
950
943
|
(0, _mobxStateTree.addDisposer)(self, function () {
|
|
951
944
|
if (inProgress && !inProgress.signal.aborted) {
|
|
952
945
|
inProgress.abort();
|
|
@@ -962,6 +955,7 @@ function renameRegionIfNeeded(refNameMap, region) {
|
|
|
962
955
|
if (region && refNameMap && refNameMap[region.refName]) {
|
|
963
956
|
// clone the region so we don't modify it
|
|
964
957
|
if ((0, _mobxStateTree.isStateTreeNode)(region)) {
|
|
958
|
+
// @ts-ignore
|
|
965
959
|
region = _objectSpread({}, (0, _mobxStateTree.getSnapshot)(region));
|
|
966
960
|
} else {
|
|
967
961
|
region = _objectSpread({}, region);
|
|
@@ -1417,7 +1411,23 @@ function getBpDisplayStr(totalBp) {
|
|
|
1417
1411
|
} else if (Math.floor(totalBp / 1000) > 0) {
|
|
1418
1412
|
str = "".concat(parseFloat((totalBp / 1000).toPrecision(3)), "Kbp");
|
|
1419
1413
|
} else {
|
|
1420
|
-
str = "".concat(Math.floor(totalBp), "bp");
|
|
1414
|
+
str = "".concat(toLocale(Math.floor(totalBp)), "bp");
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
return str;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
function toLocale(n) {
|
|
1421
|
+
return n.toLocaleString('en-US');
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
function getTickDisplayStr(totalBp, bpPerPx) {
|
|
1425
|
+
var str;
|
|
1426
|
+
|
|
1427
|
+
if (Math.floor(bpPerPx / 1000) > 0) {
|
|
1428
|
+
str = "".concat(toLocale(parseFloat((totalBp / 1000000).toFixed(2))), "M");
|
|
1429
|
+
} else {
|
|
1430
|
+
str = "".concat(toLocale(Math.floor(totalBp)));
|
|
1421
1431
|
}
|
|
1422
1432
|
|
|
1423
1433
|
return str;
|
package/util/jexl.js
CHANGED
|
@@ -25,15 +25,14 @@ _default() {
|
|
|
25
25
|
j.addFunction('id', function (feature) {
|
|
26
26
|
return feature.id();
|
|
27
27
|
}); // let user cast a jexl type into a javascript type
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
28
|
|
|
30
29
|
j.addFunction('cast', function (arg) {
|
|
31
30
|
return arg;
|
|
32
31
|
}); // logging
|
|
33
32
|
|
|
34
33
|
j.addFunction('log', function (thing) {
|
|
35
|
-
// eslint-disable-
|
|
36
|
-
|
|
34
|
+
console.log(thing); // eslint-disable-line no-console
|
|
35
|
+
|
|
37
36
|
return thing;
|
|
38
37
|
}); // math
|
|
39
38
|
// addfunction added in jexl 2.3 but types/jexl still on 2.2
|
|
@@ -49,66 +48,66 @@ _default() {
|
|
|
49
48
|
j.addFunction('parseInt', Number.parseInt);
|
|
50
49
|
j.addFunction('parseFloat', Number.parseFloat); // string
|
|
51
50
|
|
|
52
|
-
j.addFunction('split', function (
|
|
53
|
-
return
|
|
51
|
+
j.addFunction('split', function (s, char) {
|
|
52
|
+
return s.split(char);
|
|
54
53
|
});
|
|
55
|
-
j.addFunction('charAt', function (
|
|
56
|
-
return
|
|
54
|
+
j.addFunction('charAt', function (s, index) {
|
|
55
|
+
return s.charAt(index);
|
|
57
56
|
});
|
|
58
|
-
j.addFunction('charCodeAt', function (
|
|
59
|
-
return
|
|
57
|
+
j.addFunction('charCodeAt', function (s, index) {
|
|
58
|
+
return s.charCodeAt(index);
|
|
60
59
|
});
|
|
61
|
-
j.addFunction('codePointAt', function (
|
|
62
|
-
return
|
|
60
|
+
j.addFunction('codePointAt', function (s, pos) {
|
|
61
|
+
return s.codePointAt(pos);
|
|
63
62
|
});
|
|
64
|
-
j.addFunction('startsWith', function (
|
|
65
|
-
return
|
|
63
|
+
j.addFunction('startsWith', function (s, search, len) {
|
|
64
|
+
return s.startsWith(search, len);
|
|
66
65
|
});
|
|
67
|
-
j.addFunction('endsWith', function (
|
|
68
|
-
return
|
|
66
|
+
j.addFunction('endsWith', function (s, search, len) {
|
|
67
|
+
return s.endsWith(search, len);
|
|
69
68
|
});
|
|
70
|
-
j.addFunction('padEnd', function (
|
|
71
|
-
return
|
|
69
|
+
j.addFunction('padEnd', function (s, len, pad) {
|
|
70
|
+
return s.padEnd(len, pad);
|
|
72
71
|
});
|
|
73
|
-
j.addFunction('padStart', function (
|
|
74
|
-
return
|
|
72
|
+
j.addFunction('padStart', function (s, len, fill) {
|
|
73
|
+
return s.padStart(len, fill);
|
|
75
74
|
});
|
|
76
|
-
j.addFunction('repeat', function (
|
|
77
|
-
return
|
|
75
|
+
j.addFunction('repeat', function (s, count) {
|
|
76
|
+
return s.repeat(count);
|
|
78
77
|
});
|
|
79
|
-
j.addFunction('replace', function (
|
|
80
|
-
return
|
|
78
|
+
j.addFunction('replace', function (s, match, sub) {
|
|
79
|
+
return s.replace(match, sub);
|
|
81
80
|
});
|
|
82
|
-
j.addFunction('replaceAll', function (
|
|
83
|
-
return
|
|
81
|
+
j.addFunction('replaceAll', function (s, match, sub) {
|
|
82
|
+
return s.replaceAll(match, sub);
|
|
84
83
|
});
|
|
85
|
-
j.addFunction('slice', function (
|
|
86
|
-
return
|
|
84
|
+
j.addFunction('slice', function (s, start, end) {
|
|
85
|
+
return s.slice(start, end);
|
|
87
86
|
});
|
|
88
|
-
j.addFunction('startsWith', function (
|
|
89
|
-
return
|
|
87
|
+
j.addFunction('startsWith', function (s, search, pos) {
|
|
88
|
+
return s.startsWith(search, pos);
|
|
90
89
|
});
|
|
91
|
-
j.addFunction('substring', function (
|
|
92
|
-
return
|
|
90
|
+
j.addFunction('substring', function (s, start, end) {
|
|
91
|
+
return s.substring(start, end);
|
|
93
92
|
});
|
|
94
|
-
j.addFunction('toLowerCase', function (
|
|
95
|
-
return
|
|
93
|
+
j.addFunction('toLowerCase', function (s) {
|
|
94
|
+
return s.toLowerCase();
|
|
96
95
|
});
|
|
97
|
-
j.addFunction('toUpperCase', function (
|
|
98
|
-
return
|
|
96
|
+
j.addFunction('toUpperCase', function (s) {
|
|
97
|
+
return s.toUpperCase();
|
|
99
98
|
});
|
|
100
|
-
j.addFunction('trim', function (
|
|
101
|
-
|
|
99
|
+
j.addFunction('trim', function (s) {
|
|
100
|
+
return s.trim();
|
|
102
101
|
});
|
|
103
|
-
j.addFunction('trimEnd', function (
|
|
104
|
-
return
|
|
102
|
+
j.addFunction('trimEnd', function (s) {
|
|
103
|
+
return s.trimEnd();
|
|
105
104
|
});
|
|
106
|
-
j.addFunction('trimStart', function (
|
|
107
|
-
return
|
|
105
|
+
j.addFunction('trimStart', function (s) {
|
|
106
|
+
return s.trimStart();
|
|
108
107
|
});
|
|
109
|
-
j.addFunction('getTag', function (feature,
|
|
108
|
+
j.addFunction('getTag', function (feature, s) {
|
|
110
109
|
var tags = feature.get('tags');
|
|
111
|
-
return tags ? tags[
|
|
110
|
+
return tags ? tags[s] : feature.get(s);
|
|
112
111
|
});
|
|
113
112
|
j.addBinaryOp('&', 15, function (a, b) {
|
|
114
113
|
return a & b;
|
|
@@ -15,8 +15,6 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
15
15
|
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
17
|
|
|
18
|
-
var _index = require("../index");
|
|
19
|
-
|
|
20
18
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
21
19
|
|
|
22
20
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -588,7 +586,7 @@ var GranularRectLayout = /*#__PURE__*/function () {
|
|
|
588
586
|
}, {
|
|
589
587
|
key: "toJSON",
|
|
590
588
|
value: function toJSON() {
|
|
591
|
-
var rectangles =
|
|
589
|
+
var rectangles = Object.fromEntries(this.getRectangles());
|
|
592
590
|
return {
|
|
593
591
|
rectangles: rectangles,
|
|
594
592
|
containsNoTransferables: true,
|
|
@@ -15,8 +15,6 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
15
15
|
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
17
|
|
|
18
|
-
var _ = require("..");
|
|
19
|
-
|
|
20
18
|
var _rbush = _interopRequireDefault(require("rbush"));
|
|
21
19
|
|
|
22
20
|
var PrecomputedLayout = /*#__PURE__*/function () {
|
|
@@ -116,7 +114,7 @@ var PrecomputedLayout = /*#__PURE__*/function () {
|
|
|
116
114
|
key: "toJSON",
|
|
117
115
|
value: function toJSON() {
|
|
118
116
|
return {
|
|
119
|
-
rectangles:
|
|
117
|
+
rectangles: Object.fromEntries(this.rectangles),
|
|
120
118
|
totalHeight: this.totalHeight,
|
|
121
119
|
maxHeightReached: false,
|
|
122
120
|
containsNoTransferables: true
|
|
@@ -31,10 +31,8 @@ imageData, context) {
|
|
|
31
31
|
if (imageData.serializedCommands) {
|
|
32
32
|
var seq = new _canvasSequencer.CanvasSequence(imageData.serializedCommands);
|
|
33
33
|
seq.execute(context);
|
|
34
|
-
} else
|
|
34
|
+
} else {
|
|
35
35
|
context.drawImage(imageData, 0, 0);
|
|
36
|
-
} else if (imageData.dataURL) {
|
|
37
|
-
throw new Error('dataURL deserialization no longer supported');
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
38
|
|
|
@@ -54,11 +52,11 @@ if (weHave.realOffscreenCanvas) {
|
|
|
54
52
|
exports.ImageBitmapType = ImageBitmapType = window.ImageBitmap || self.ImageBitmap;
|
|
55
53
|
} else if (weHave.node) {
|
|
56
54
|
// use node-canvas if we are running in node (i.e. automated tests)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
exports.createCanvas = createCanvas = function createCanvas() {
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
// eslint-disable-next-line no-undef
|
|
58
|
+
return nodeCreateCanvas.apply(void 0, arguments);
|
|
59
|
+
};
|
|
62
60
|
|
|
63
61
|
exports.createImageBitmap = createImageBitmap = /*#__PURE__*/function () {
|
|
64
62
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(canvas) {
|
|
@@ -77,8 +75,10 @@ if (weHave.realOffscreenCanvas) {
|
|
|
77
75
|
throw new Error('only one-argument uses of createImageBitmap are supported by the node offscreencanvas ponyfill');
|
|
78
76
|
|
|
79
77
|
case 2:
|
|
80
|
-
dataUri = canvas.toDataURL();
|
|
81
|
-
|
|
78
|
+
dataUri = canvas.toDataURL(); // @ts-ignore
|
|
79
|
+
// eslint-disable-next-line no-undef
|
|
80
|
+
|
|
81
|
+
img = new nodeImage();
|
|
82
82
|
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
83
83
|
img.onload = function () {
|
|
84
84
|
return resolve(img);
|
|
@@ -100,8 +100,6 @@ if (weHave.realOffscreenCanvas) {
|
|
|
100
100
|
return _ref.apply(this, arguments);
|
|
101
101
|
};
|
|
102
102
|
}();
|
|
103
|
-
|
|
104
|
-
exports.ImageBitmapType = ImageBitmapType = Image;
|
|
105
103
|
} else {
|
|
106
104
|
exports.createCanvas = createCanvas = function createCanvas(width, height) {
|
|
107
105
|
var context = new _canvasSequencer.CanvasSequence();
|
package/util/tracks.js
CHANGED
|
@@ -46,7 +46,7 @@ function getTrackAssemblyNames(track) {
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
function getRpcSessionId(thisNode) {
|
|
49
|
-
var highestRpcSessionId;
|
|
49
|
+
var highestRpcSessionId; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
50
|
|
|
51
51
|
for (var node = thisNode; !(0, _mobxStateTree.isRoot)(node); node = (0, _mobxStateTree.getParent)(node)) {
|
|
52
52
|
if ('rpcSessionId' in node) {
|
|
@@ -69,7 +69,9 @@ function getRpcSessionId(thisNode) {
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
function getParentRenderProps(node) {
|
|
72
|
-
for (
|
|
72
|
+
for ( // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
73
|
+
var currentNode = (0, _mobxStateTree.getParent)(node); !(0, _mobxStateTree.isRoot)(currentNode); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
|
+
currentNode = (0, _mobxStateTree.getParent)(currentNode)) {
|
|
73
75
|
if ('renderProps' in currentNode) {
|
|
74
76
|
return currentNode.renderProps();
|
|
75
77
|
}
|
package/util/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Instance, SnapshotIn, IAnyStateTreeNode } from 'mobx-state-tree';
|
|
2
|
+
import { Instance, SnapshotIn, IAnyStateTreeNode, IStateTreeNode, IType } from 'mobx-state-tree';
|
|
3
3
|
import { AnyConfigurationModel } from '../../configuration/configurationSchema';
|
|
4
4
|
import assemblyManager from '../../assemblyManager';
|
|
5
5
|
import TextSearchManager from '../../TextSearch/TextSearchManager';
|
|
@@ -10,10 +10,10 @@ import { Feature } from '../simpleFeature';
|
|
|
10
10
|
import { BaseInternetAccountModel } from '../../pluggableElementTypes/models';
|
|
11
11
|
export * from './util';
|
|
12
12
|
/** abstract type for a model that contains multiple views */
|
|
13
|
-
export interface AbstractViewContainer extends
|
|
13
|
+
export interface AbstractViewContainer extends IStateTreeNode<IType<any, unknown, any>> {
|
|
14
14
|
views: AbstractViewModel[];
|
|
15
15
|
removeView(view: AbstractViewModel): void;
|
|
16
|
-
addView(typeName: string, initialState
|
|
16
|
+
addView(typeName: string, initialState?: Record<string, unknown>): AbstractViewModel;
|
|
17
17
|
}
|
|
18
18
|
export declare function isViewContainer(thing: unknown): thing is AbstractViewContainer;
|
|
19
19
|
export declare type NotificationLevel = 'error' | 'info' | 'warning' | 'success';
|
|
@@ -43,6 +43,7 @@ export interface JBrowsePlugin {
|
|
|
43
43
|
export declare type DialogComponentType = React.LazyExoticComponent<React.FC<any>> | React.FC<any>;
|
|
44
44
|
/** minimum interface that all session state models must implement */
|
|
45
45
|
export interface AbstractSessionModel extends AbstractViewContainer {
|
|
46
|
+
drawerPosition?: string;
|
|
46
47
|
setSelection(feature: Feature): void;
|
|
47
48
|
clearSelection(): void;
|
|
48
49
|
configuration: AnyConfigurationModel;
|
|
@@ -63,6 +64,8 @@ export interface AbstractSessionModel extends AbstractViewContainer {
|
|
|
63
64
|
sessionConnections?: AnyConfigurationModel[];
|
|
64
65
|
connectionInstances?: {
|
|
65
66
|
name: string;
|
|
67
|
+
connectionId: string;
|
|
68
|
+
tracks: AnyConfigurationModel[];
|
|
66
69
|
}[];
|
|
67
70
|
makeConnection?: Function;
|
|
68
71
|
adminMode?: boolean;
|
|
@@ -73,6 +76,7 @@ export interface AbstractSessionModel extends AbstractViewContainer {
|
|
|
73
76
|
queueDialog: (callback: (doneCallback: Function) => [DialogComponentType, any]) => void;
|
|
74
77
|
name: string;
|
|
75
78
|
id?: string;
|
|
79
|
+
tracks: AnyConfigurationModel[];
|
|
76
80
|
}
|
|
77
81
|
export declare function isSessionModel(thing: unknown): thing is AbstractSessionModel;
|
|
78
82
|
/** abstract interface for a session allows editing configurations */
|
|
@@ -110,6 +114,10 @@ export interface SessionWithDrawerWidgets extends SessionWithWidgets {
|
|
|
110
114
|
setDrawerPosition(arg: string): void;
|
|
111
115
|
}
|
|
112
116
|
export declare function isSessionModelWithWidgets(thing: unknown): thing is SessionWithWidgets;
|
|
117
|
+
interface SessionWithConnections {
|
|
118
|
+
addConnectionConf: (arg: AnyConfigurationModel) => void;
|
|
119
|
+
}
|
|
120
|
+
export declare function isSessionModelWithConnections(thing: unknown): thing is SessionWithConnections;
|
|
113
121
|
export interface SessionWithSessionPlugins extends AbstractSessionModel {
|
|
114
122
|
sessionPlugins: JBrowsePlugin[];
|
|
115
123
|
addSessionPlugin: Function;
|
|
@@ -133,7 +141,9 @@ export interface AbstractViewModel {
|
|
|
133
141
|
menuItems: () => MenuItem[];
|
|
134
142
|
}
|
|
135
143
|
export declare function isViewModel(thing: unknown): thing is AbstractViewModel;
|
|
136
|
-
|
|
144
|
+
export interface AbstractTrackModel {
|
|
145
|
+
displays: AbstractDisplayModel[];
|
|
146
|
+
}
|
|
137
147
|
export declare function isTrackModel(thing: unknown): thing is AbstractTrackModel;
|
|
138
148
|
export interface AbstractDisplayModel {
|
|
139
149
|
id: string;
|
package/util/types/index.js
CHANGED
|
@@ -11,6 +11,7 @@ var _exportNames = {
|
|
|
11
11
|
isSessionModelWithConfigEditing: true,
|
|
12
12
|
isSessionWithAddTracks: true,
|
|
13
13
|
isSessionModelWithWidgets: true,
|
|
14
|
+
isSessionModelWithConnections: true,
|
|
14
15
|
isSessionWithSessionPlugins: true,
|
|
15
16
|
isSelectionContainer: true,
|
|
16
17
|
isViewModel: true,
|
|
@@ -34,6 +35,7 @@ exports.isRetryException = isRetryException;
|
|
|
34
35
|
exports.isSelectionContainer = isSelectionContainer;
|
|
35
36
|
exports.isSessionModel = isSessionModel;
|
|
36
37
|
exports.isSessionModelWithConfigEditing = isSessionModelWithConfigEditing;
|
|
38
|
+
exports.isSessionModelWithConnections = isSessionModelWithConnections;
|
|
37
39
|
exports.isSessionModelWithWidgets = isSessionModelWithWidgets;
|
|
38
40
|
exports.isSessionWithAddTracks = isSessionWithAddTracks;
|
|
39
41
|
exports.isSessionWithSessionPlugins = isSessionWithSessionPlugins;
|
|
@@ -103,6 +105,10 @@ function isSessionModelWithWidgets(thing) {
|
|
|
103
105
|
return isSessionModel(thing) && 'widgets' in thing;
|
|
104
106
|
}
|
|
105
107
|
|
|
108
|
+
function isSessionModelWithConnections(thing) {
|
|
109
|
+
return isSessionModel(thing) && 'addConnectionConf' in thing;
|
|
110
|
+
}
|
|
111
|
+
|
|
106
112
|
function isSessionWithSessionPlugins(thing) {
|
|
107
113
|
return isSessionModel(thing) && 'sessionPlugins' in thing;
|
|
108
114
|
}
|
package/util/types/mst.d.ts
CHANGED
|
@@ -108,11 +108,11 @@ export declare const FileLocation: import("mobx-state-tree").ISnapshotProcessor<
|
|
|
108
108
|
internetAccountType: import("mobx-state-tree").ISimpleType<string>;
|
|
109
109
|
authInfo: import("mobx-state-tree").IType<any, any, any>;
|
|
110
110
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
111
|
-
}>> | import("mobx-state-tree").
|
|
111
|
+
}>> | import("mobx-state-tree").ModelInstanceType<{
|
|
112
112
|
locationType: import("mobx-state-tree").ISimpleType<"BlobLocation">;
|
|
113
113
|
name: import("mobx-state-tree").ISimpleType<string>;
|
|
114
114
|
blobId: import("mobx-state-tree").ISimpleType<string>;
|
|
115
|
-
}> | import("mobx-state-tree").
|
|
115
|
+
}, {}> | import("mobx-state-tree").ModelInstanceType<{
|
|
116
116
|
locationType: import("mobx-state-tree").ISimpleType<"LocalPathLocation">;
|
|
117
117
|
localPath: import("mobx-state-tree").ISimpleType<string>;
|
|
118
|
-
}>>, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
118
|
+
}, {}>>, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
package/util/types/mst.js
CHANGED
|
@@ -98,8 +98,10 @@ exports.UriLocationRaw = UriLocationRaw;
|
|
|
98
98
|
|
|
99
99
|
var UriLocation = _mobxStateTree.types.snapshotProcessor(UriLocationRaw, {
|
|
100
100
|
postProcessor: function postProcessor(snap) {
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
102
|
+
var _ref = snap,
|
|
103
|
+
baseUri = _ref.baseUri,
|
|
104
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
103
105
|
|
|
104
106
|
if (!baseUri) {
|
|
105
107
|
return rest;
|
|
@@ -113,14 +115,16 @@ exports.UriLocation = UriLocation;
|
|
|
113
115
|
|
|
114
116
|
var FileLocation = _mobxStateTree.types.snapshotProcessor(_mobxStateTree.types.union(LocalPathLocation, UriLocation, BlobLocation), {
|
|
115
117
|
// @ts-ignore
|
|
116
|
-
preProcessor: function preProcessor(
|
|
117
|
-
if (!
|
|
118
|
+
preProcessor: function preProcessor(snap) {
|
|
119
|
+
if (!snap) {
|
|
118
120
|
return undefined;
|
|
119
121
|
} // @ts-ignore
|
|
122
|
+
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
120
123
|
|
|
121
124
|
|
|
122
|
-
var
|
|
123
|
-
|
|
125
|
+
var _ref2 = snap,
|
|
126
|
+
locationType = _ref2.locationType,
|
|
127
|
+
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
124
128
|
|
|
125
129
|
if (!locationType) {
|
|
126
130
|
// @ts-ignore
|
|
@@ -142,7 +146,7 @@ var FileLocation = _mobxStateTree.types.snapshotProcessor(_mobxStateTree.types.u
|
|
|
142
146
|
});
|
|
143
147
|
}
|
|
144
148
|
|
|
145
|
-
return
|
|
149
|
+
return snap;
|
|
146
150
|
}
|
|
147
151
|
});
|
|
148
152
|
|