@jbrowse/core 2.13.1 → 2.14.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/ArrayValue.js +2 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +3 -1
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +28 -25
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +11 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +11 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +6 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +11 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +15 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +4 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +15 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +5 -3
- package/BaseFeatureWidget/stateModelFactory.js +0 -2
- package/PluginLoader.d.ts +1 -2
- package/PluginLoader.js +16 -6
- package/PluginManager.d.ts +13 -13
- package/PluginManager.js +7 -2
- package/ReExports/modules.js +2 -11
- package/assemblyManager/assembly.d.ts +18 -12
- package/assemblyManager/assembly.js +75 -52
- package/assemblyManager/assemblyConfigSchema.d.ts +9 -7
- package/assemblyManager/assemblyConfigSchema.js +15 -16
- package/assemblyManager/assemblyManager.d.ts +109 -81
- package/assemblyManager/assemblyManager.js +3 -6
- package/configuration/configurationSchema.d.ts +1 -1
- package/configuration/configurationSchema.js +1 -2
- package/configuration/configurationSlot.js +7 -8
- package/configuration/util.js +0 -7
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +6 -6
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +6 -6
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +1 -0
- package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +0 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +4 -8
- package/data_adapters/dataAdapterCache.d.ts +9 -6
- package/data_adapters/dataAdapterCache.js +16 -22
- package/package.json +3 -3
- package/pluggableElementTypes/AddTrackWorkflowType.js +0 -6
- package/pluggableElementTypes/ConnectionType.js +0 -6
- package/pluggableElementTypes/DisplayType.js +0 -20
- package/pluggableElementTypes/InternetAccountType.js +0 -11
- package/pluggableElementTypes/RpcMethodType.d.ts +1 -1
- package/pluggableElementTypes/TextSearchAdapterType.js +0 -3
- package/pluggableElementTypes/TrackType.js +0 -11
- package/pluggableElementTypes/ViewType.js +0 -6
- package/pluggableElementTypes/WidgetType.js +0 -6
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +4 -3
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +1 -3
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +4 -5
- package/pluggableElementTypes/models/BaseDisplayModel.js +6 -14
- package/pluggableElementTypes/models/BaseTrackModel.js +8 -5
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +1 -1
- package/pluggableElementTypes/models/InternetAccountModel.js +19 -13
- package/pluggableElementTypes/models/baseTrackConfig.js +2 -5
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +10 -4
- package/pluggableElementTypes/renderers/BoxRendererType.js +10 -26
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +9 -12
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +12 -19
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +5 -5
- package/pluggableElementTypes/renderers/FeatureRendererType.js +6 -13
- package/pluggableElementTypes/renderers/RendererType.js +0 -10
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +1 -1
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +8 -9
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +11 -14
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +4 -4
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +7 -5
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +0 -1
- package/rpc/BaseRpcDriver.d.ts +1 -1
- package/rpc/BaseRpcDriver.js +12 -11
- package/rpc/MainThreadRpcDriver.d.ts +2 -2
- package/rpc/MainThreadRpcDriver.js +3 -0
- package/rpc/RpcManager.d.ts +1 -1
- package/rpc/RpcManager.js +11 -8
- package/rpc/configSchema.js +0 -1
- package/rpc/methods/CoreFreeResources.d.ts +2 -2
- package/rpc/methods/CoreGetFeatureDensityStats.d.ts +2 -2
- package/rpc/methods/CoreGetFeatureDetails.d.ts +1 -1
- package/rpc/methods/CoreGetFeatureDetails.js +3 -3
- package/rpc/methods/CoreGetFeatures.d.ts +1 -1
- package/rpc/methods/CoreGetFileInfo.d.ts +1 -1
- package/rpc/methods/CoreGetMetadata.d.ts +1 -1
- package/rpc/methods/CoreGetRefNames.d.ts +1 -1
- package/rpc/methods/util.d.ts +2 -2
- package/rpc/methods/util.js +0 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AssemblySelector.js +3 -1
- package/ui/CascadingMenu.js +2 -1
- package/ui/CascadingMenuButton.js +3 -1
- package/ui/ColorPicker.js +14 -4
- package/ui/DropDownMenu.js +3 -1
- package/ui/EditableTypography.js +6 -2
- package/ui/ErrorMessage.d.ts +2 -2
- package/ui/ErrorMessage.js +37 -20
- package/ui/ErrorMessageStackTraceDialog.js +11 -9
- package/ui/FactoryResetDialog.d.ts +1 -1
- package/ui/FactoryResetDialog.js +9 -3
- package/ui/FatalErrorDialog.js +9 -3
- package/ui/FileSelector/FileSelector.js +8 -4
- package/ui/FileSelector/LocalFileChooser.js +7 -6
- package/ui/LoadingEllipses.js +1 -1
- package/ui/Menu.d.ts +4 -4
- package/ui/Menu.js +6 -9
- package/ui/MenuButton.js +6 -2
- package/ui/PrerenderedCanvas.js +8 -5
- package/ui/RedErrorMessageBox.js +13 -8
- package/ui/ResizeHandle.d.ts +1 -1
- package/ui/ReturnToImportFormDialog.js +3 -1
- package/ui/SanitizedHTML.js +1 -3
- package/ui/SnackbarModel.d.ts +12 -1
- package/ui/SnackbarModel.js +19 -3
- package/ui/theme.js +5 -5
- package/util/Base1DViewModel.js +3 -1
- package/util/QuickLRU.js +8 -8
- package/util/TimeTraveller.js +12 -4
- package/util/analytics.js +0 -1
- package/util/blockTypes.js +5 -9
- package/util/calculateStaticBlocks.d.ts +1 -1
- package/util/compositeMap.js +2 -2
- package/util/idMaker.js +0 -1
- package/util/index.d.ts +9 -8
- package/util/index.js +91 -51
- package/util/io/RemoteFileWithRangeCache.js +1 -3
- package/util/io/index.js +3 -5
- package/util/jexlStrings.js +5 -8
- package/util/layouts/GranularRectLayout.js +1 -4
- package/util/layouts/SceneGraph.d.ts +1 -1
- package/util/layouts/SceneGraph.js +2 -6
- package/util/map-obj.js +15 -7
- package/util/mst-reflection.js +1 -2
- package/util/nanoid.js +9 -8
- package/util/offscreenCanvasPonyfill.d.ts +1 -1
- package/util/offscreenCanvasPonyfill.js +7 -10
- package/util/offscreenCanvasUtils.d.ts +1 -1
- package/util/offscreenCanvasUtils.js +1 -3
- package/util/rxjs.js +4 -2
- package/util/simpleFeature.d.ts +2 -3
- package/util/simpleFeature.js +9 -12
- package/util/stats.js +3 -1
- package/util/tracks.d.ts +4 -2
- package/util/tracks.js +10 -11
- package/util/types/index.d.ts +5 -5
- package/util/types/index.js +8 -1
- package/util/types/mst.js +1 -0
- package/util/when.js +7 -2
|
@@ -9,13 +9,16 @@ interface AdapterCacheEntry {
|
|
|
9
9
|
sessionIds: Set<string>;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* instantiate a data adapter, or return an already-instantiated one if we have
|
|
13
|
-
* configuration
|
|
12
|
+
* instantiate a data adapter, or return an already-instantiated one if we have
|
|
13
|
+
* one with the same configuration
|
|
14
14
|
*
|
|
15
|
-
* @param pluginManager
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* @param pluginManager
|
|
16
|
+
*
|
|
17
|
+
* @param sessionId - session ID of the associated worker session. used for
|
|
18
|
+
* reference counting
|
|
19
|
+
*
|
|
20
|
+
* @param adapterConfigSnapshot - plain-JS configuration snapshot for the
|
|
21
|
+
* adapter
|
|
19
22
|
*/
|
|
20
23
|
export declare function getAdapter(pluginManager: PluginManager, sessionId: string, adapterConfigSnapshot: SnapshotIn<AnyConfigurationSchemaType>): Promise<AdapterCacheEntry>;
|
|
21
24
|
/**
|
|
@@ -13,13 +13,16 @@ function adapterConfigCacheKey(conf = {}) {
|
|
|
13
13
|
}
|
|
14
14
|
let adapterCache = {};
|
|
15
15
|
/**
|
|
16
|
-
* instantiate a data adapter, or return an already-instantiated one if we have
|
|
17
|
-
* configuration
|
|
16
|
+
* instantiate a data adapter, or return an already-instantiated one if we have
|
|
17
|
+
* one with the same configuration
|
|
18
18
|
*
|
|
19
|
-
* @param pluginManager
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* @param pluginManager
|
|
20
|
+
*
|
|
21
|
+
* @param sessionId - session ID of the associated worker session. used for
|
|
22
|
+
* reference counting
|
|
23
|
+
*
|
|
24
|
+
* @param adapterConfigSnapshot - plain-JS configuration snapshot for the
|
|
25
|
+
* adapter
|
|
23
26
|
*/
|
|
24
27
|
async function getAdapter(pluginManager, sessionId, adapterConfigSnapshot) {
|
|
25
28
|
// cache the adapter object
|
|
@@ -43,9 +46,6 @@ async function getAdapter(pluginManager, sessionId, adapterConfigSnapshot) {
|
|
|
43
46
|
//
|
|
44
47
|
const { AdapterClass, getAdapterClass } = dataAdapterType;
|
|
45
48
|
const CLASS = AdapterClass || (await getAdapterClass());
|
|
46
|
-
if (!CLASS) {
|
|
47
|
-
throw new Error('Failed to get adapter');
|
|
48
|
-
}
|
|
49
49
|
const dataAdapter = new CLASS(adapterConfig, getSubAdapter, pluginManager);
|
|
50
50
|
// store it in our cache
|
|
51
51
|
adapterCache[cacheKey] = {
|
|
@@ -57,12 +57,11 @@ async function getAdapter(pluginManager, sessionId, adapterConfigSnapshot) {
|
|
|
57
57
|
cacheEntry.sessionIds.add(sessionId);
|
|
58
58
|
return cacheEntry;
|
|
59
59
|
}
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
61
60
|
function freeAdapterResources(specification) {
|
|
62
61
|
let deleteCount = 0;
|
|
63
62
|
const specKeys = Object.keys(specification);
|
|
64
|
-
// if we don't specify a range, delete any adapters that are
|
|
65
|
-
//
|
|
63
|
+
// if we don't specify a range, delete any adapters that are only associated
|
|
64
|
+
// with that session
|
|
66
65
|
if (specKeys.length === 1 && specKeys[0] === 'sessionId') {
|
|
67
66
|
const { sessionId } = specification;
|
|
68
67
|
Object.entries(adapterCache).forEach(([cacheKey, cacheEntry]) => {
|
|
@@ -76,16 +75,11 @@ function freeAdapterResources(specification) {
|
|
|
76
75
|
else {
|
|
77
76
|
// otherwise call freeResources on all the cached data adapters
|
|
78
77
|
Object.values(adapterCache).forEach(cacheEntry => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
(specification.region ? [specification.region] : []);
|
|
85
|
-
for (const region of regions) {
|
|
86
|
-
if (region.refName !== undefined) {
|
|
87
|
-
cacheEntry.dataAdapter.freeResources(region);
|
|
88
|
-
}
|
|
78
|
+
const regions = specification.regions ||
|
|
79
|
+
(specification.region ? [specification.region] : []);
|
|
80
|
+
for (const region of regions) {
|
|
81
|
+
if (region.refName !== undefined) {
|
|
82
|
+
cacheEntry.dataAdapter.freeResources(region);
|
|
89
83
|
}
|
|
90
84
|
}
|
|
91
85
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"author": "JBrowse Team",
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"scripts": {
|
|
23
|
-
"test": "cd ../..; jest packages/core",
|
|
23
|
+
"test": "cd ../..; jest --passWithNoTests packages/core",
|
|
24
24
|
"storybook": "storybook dev --port 6006",
|
|
25
25
|
"storybook:build": "storybook build",
|
|
26
26
|
"coverage": "yarn test --coverage",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"access": "public",
|
|
74
74
|
"directory": "dist"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "9fb8231d932db40adf0a283081765431756c66ff"
|
|
77
77
|
}
|
|
@@ -9,12 +9,6 @@ class AddTrackWorkflow extends PluggableElementBase_1.default {
|
|
|
9
9
|
super(stuff);
|
|
10
10
|
this.ReactComponent = stuff.ReactComponent;
|
|
11
11
|
this.stateModel = stuff.stateModel;
|
|
12
|
-
if (!this.ReactComponent) {
|
|
13
|
-
throw new Error(`no ReactComponent defined for view ${this.name}`);
|
|
14
|
-
}
|
|
15
|
-
if (!this.stateModel) {
|
|
16
|
-
throw new Error(`no stateModel defined for view ${this.name}`);
|
|
17
|
-
}
|
|
18
12
|
}
|
|
19
13
|
}
|
|
20
14
|
exports.default = AddTrackWorkflow;
|
|
@@ -12,12 +12,6 @@ class ConnectionType extends PluggableElementBase_1.default {
|
|
|
12
12
|
this.description = stuff.description;
|
|
13
13
|
this.url = stuff.url;
|
|
14
14
|
this.configEditorComponent = stuff.configEditorComponent;
|
|
15
|
-
if (!this.stateModel) {
|
|
16
|
-
throw new Error(`no stateModel defined for connection ${this.name}`);
|
|
17
|
-
}
|
|
18
|
-
if (!this.configSchema) {
|
|
19
|
-
throw new Error(`no configSchema defined for connection ${this.name}`);
|
|
20
|
-
}
|
|
21
15
|
}
|
|
22
16
|
}
|
|
23
17
|
exports.default = ConnectionType;
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const PluggableElementBase_1 = __importDefault(require("./PluggableElementBase"));
|
|
7
|
-
const mst_reflection_1 = require("../util/mst-reflection");
|
|
8
7
|
class DisplayType extends PluggableElementBase_1.default {
|
|
9
8
|
constructor(stuff) {
|
|
10
9
|
super(stuff);
|
|
@@ -14,25 +13,6 @@ class DisplayType extends PluggableElementBase_1.default {
|
|
|
14
13
|
this.ReactComponent = stuff.ReactComponent;
|
|
15
14
|
this.trackType = stuff.trackType;
|
|
16
15
|
this.viewType = stuff.viewType;
|
|
17
|
-
if (!this.stateModel) {
|
|
18
|
-
throw new Error(`no stateModel defined for display ${this.name}`);
|
|
19
|
-
}
|
|
20
|
-
if (!this.configSchema) {
|
|
21
|
-
throw new Error(`no configSchema provided for display ${this.name}`);
|
|
22
|
-
}
|
|
23
|
-
if (!this.ReactComponent) {
|
|
24
|
-
throw new Error(`no ReactComponent provided for display ${this.name}`);
|
|
25
|
-
}
|
|
26
|
-
if (!this.trackType) {
|
|
27
|
-
throw new Error(`no trackType provided for display ${this.name}`);
|
|
28
|
-
}
|
|
29
|
-
if (!this.viewType) {
|
|
30
|
-
throw new Error(`no viewType provided for display ${this.name}`);
|
|
31
|
-
}
|
|
32
|
-
if (!(0, mst_reflection_1.getDefaultValue)(this.configSchema).type) {
|
|
33
|
-
const name = this.configSchema ? this.configSchema.name : 'UNKNOWN';
|
|
34
|
-
throw new Error(`${name} is not explicitlyTyped`);
|
|
35
|
-
}
|
|
36
16
|
}
|
|
37
17
|
}
|
|
38
18
|
exports.default = DisplayType;
|
|
@@ -4,22 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const PluggableElementBase_1 = __importDefault(require("./PluggableElementBase"));
|
|
7
|
-
const mst_reflection_1 = require("../util/mst-reflection");
|
|
8
7
|
class InternetAccountType extends PluggableElementBase_1.default {
|
|
9
8
|
constructor(stuff) {
|
|
10
9
|
super(stuff);
|
|
11
10
|
this.stateModel = stuff.stateModel;
|
|
12
11
|
this.configSchema = stuff.configSchema;
|
|
13
|
-
if (!this.stateModel) {
|
|
14
|
-
throw new Error(`no stateModel defined for internet account type ${this.name}`);
|
|
15
|
-
}
|
|
16
|
-
if (!this.configSchema) {
|
|
17
|
-
throw new Error(`no configSchema provided for internet account type ${this.name}`);
|
|
18
|
-
}
|
|
19
|
-
if (!(0, mst_reflection_1.getDefaultValue)(this.configSchema).type) {
|
|
20
|
-
const name = this.configSchema ? this.configSchema.name : 'UNKNOWN';
|
|
21
|
-
throw new Error(`${name} is not explicitlyTyped`);
|
|
22
|
-
}
|
|
23
12
|
}
|
|
24
13
|
}
|
|
25
14
|
exports.default = InternetAccountType;
|
|
@@ -10,7 +10,7 @@ export type RpcMethodConstructor = new (pm: PluginManager) => RpcMethodType;
|
|
|
10
10
|
export default abstract class RpcMethodType extends PluggableElementBase {
|
|
11
11
|
pluginManager: PluginManager;
|
|
12
12
|
constructor(pluginManager: PluginManager);
|
|
13
|
-
serializeArguments(args:
|
|
13
|
+
serializeArguments(args: Record<string, unknown>, rpcDriverClassName: string): Promise<Record<string, unknown>>;
|
|
14
14
|
serializeNewAuthArguments(loc: UriLocation, rpcDriverClassName: string): Promise<UriLocation>;
|
|
15
15
|
deserializeArguments<T extends SerializedArgs>(serializedArgs: T, _rpcDriverClassName: string): Promise<T & {
|
|
16
16
|
signal: AbortSignal | undefined;
|
|
@@ -10,9 +10,6 @@ class TextSearchAdapterType extends PluggableElementBase_1.default {
|
|
|
10
10
|
this.description = stuff.description;
|
|
11
11
|
this.configSchema = stuff.configSchema;
|
|
12
12
|
this.AdapterClass = stuff.AdapterClass;
|
|
13
|
-
if (!this.AdapterClass) {
|
|
14
|
-
throw new Error(`no AdapterClass defined for adapter type ${this.name}`);
|
|
15
|
-
}
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
15
|
exports.default = TextSearchAdapterType;
|
|
@@ -4,23 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const PluggableElementBase_1 = __importDefault(require("./PluggableElementBase"));
|
|
7
|
-
const mst_reflection_1 = require("../util/mst-reflection");
|
|
8
7
|
class TrackType extends PluggableElementBase_1.default {
|
|
9
8
|
constructor(stuff) {
|
|
10
9
|
super(stuff);
|
|
11
10
|
this.displayTypes = [];
|
|
12
11
|
this.stateModel = stuff.stateModel;
|
|
13
12
|
this.configSchema = stuff.configSchema;
|
|
14
|
-
if (!this.stateModel) {
|
|
15
|
-
throw new Error(`no stateModel defined for track ${this.name}`);
|
|
16
|
-
}
|
|
17
|
-
if (!this.configSchema) {
|
|
18
|
-
throw new Error(`no configSchema provided for track ${this.name}`);
|
|
19
|
-
}
|
|
20
|
-
if (!(0, mst_reflection_1.getDefaultValue)(this.configSchema).type) {
|
|
21
|
-
const name = this.configSchema ? this.configSchema.name : 'UNKNOWN';
|
|
22
|
-
throw new Error(`${name} is not explicitlyTyped`);
|
|
23
|
-
}
|
|
24
13
|
}
|
|
25
14
|
addDisplayType(display) {
|
|
26
15
|
this.displayTypes.push(display);
|
|
@@ -11,12 +11,6 @@ class ViewType extends PluggableElementBase_1.default {
|
|
|
11
11
|
this.ReactComponent = stuff.ReactComponent;
|
|
12
12
|
this.stateModel = stuff.stateModel;
|
|
13
13
|
this.extendedName = stuff.extendedName;
|
|
14
|
-
if (!this.ReactComponent) {
|
|
15
|
-
throw new Error(`no ReactComponent defined for view ${this.name}`);
|
|
16
|
-
}
|
|
17
|
-
if (!this.stateModel) {
|
|
18
|
-
throw new Error(`no stateModel defined for view ${this.name}`);
|
|
19
|
-
}
|
|
20
14
|
}
|
|
21
15
|
addDisplayType(display) {
|
|
22
16
|
this.displayTypes.push(display);
|
|
@@ -12,12 +12,6 @@ class WidgetType extends PluggableElementBase_1.default {
|
|
|
12
12
|
this.configSchema = stuff.configSchema;
|
|
13
13
|
this.stateModel = stuff.stateModel;
|
|
14
14
|
this.ReactComponent = stuff.ReactComponent;
|
|
15
|
-
if (!this.ReactComponent) {
|
|
16
|
-
throw new Error(`no ReactComponent defined for widget ${this.name}`);
|
|
17
|
-
}
|
|
18
|
-
if (!this.stateModel) {
|
|
19
|
-
throw new Error(`no stateModel defined for widget ${this.name}`);
|
|
20
|
-
}
|
|
21
15
|
}
|
|
22
16
|
}
|
|
23
17
|
exports.default = WidgetType;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AnyConfigurationModel } from '../../configuration';
|
|
2
2
|
import PluginManager from '../../PluginManager';
|
|
3
|
+
type TrackConf = AnyConfigurationModel | Record<string, unknown>;
|
|
3
4
|
/**
|
|
4
5
|
* #stateModel BaseConnectionModel
|
|
5
6
|
*/
|
|
@@ -37,15 +38,15 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
37
38
|
/**
|
|
38
39
|
* #action
|
|
39
40
|
*/
|
|
40
|
-
addTrackConf(trackConf:
|
|
41
|
+
addTrackConf(trackConf: TrackConf): any;
|
|
41
42
|
/**
|
|
42
43
|
* #action
|
|
43
44
|
*/
|
|
44
|
-
addTrackConfs(trackConfs:
|
|
45
|
+
addTrackConfs(trackConfs: TrackConf[]): void;
|
|
45
46
|
/**
|
|
46
47
|
* #action
|
|
47
48
|
*/
|
|
48
|
-
setTrackConfs(trackConfs: AnyConfigurationModel[]):
|
|
49
|
+
setTrackConfs(trackConfs: AnyConfigurationModel[]): void;
|
|
49
50
|
/**
|
|
50
51
|
* #action
|
|
51
52
|
*/
|
|
@@ -48,15 +48,13 @@ function stateModelFactory(pluginManager) {
|
|
|
48
48
|
* #action
|
|
49
49
|
*/
|
|
50
50
|
addTrackConfs(trackConfs) {
|
|
51
|
-
|
|
52
|
-
return self.tracks.slice(length - 1 - trackConfs.length, length - 1);
|
|
51
|
+
self.tracks.push(...trackConfs);
|
|
53
52
|
},
|
|
54
53
|
/**
|
|
55
54
|
* #action
|
|
56
55
|
*/
|
|
57
56
|
setTrackConfs(trackConfs) {
|
|
58
57
|
self.tracks = (0, mobx_state_tree_1.cast)(trackConfs);
|
|
59
|
-
return self.tracks;
|
|
60
58
|
},
|
|
61
59
|
/**
|
|
62
60
|
* #action
|
|
@@ -49,7 +49,7 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
49
49
|
error: unknown;
|
|
50
50
|
message: string | undefined;
|
|
51
51
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
52
|
-
onHorizontalScroll?:
|
|
52
|
+
onHorizontalScroll?: () => void;
|
|
53
53
|
blockState?: Record<string, any>;
|
|
54
54
|
}>;
|
|
55
55
|
/**
|
|
@@ -99,14 +99,13 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
99
99
|
renderProps(): any;
|
|
100
100
|
/**
|
|
101
101
|
* #getter
|
|
102
|
-
* the pluggable element type object for this display's
|
|
103
|
-
* renderer
|
|
102
|
+
* the pluggable element type object for this display's renderer
|
|
104
103
|
*/
|
|
105
104
|
readonly rendererType: import("..").RendererType;
|
|
106
105
|
/**
|
|
107
106
|
* #getter
|
|
108
|
-
* if a display-level message should be displayed instead,
|
|
109
|
-
*
|
|
107
|
+
* if a display-level message should be displayed instead, make this
|
|
108
|
+
* return a react component
|
|
110
109
|
*/
|
|
111
110
|
readonly DisplayMessageComponent: undefined | React.FC<any>;
|
|
112
111
|
/**
|
|
@@ -38,8 +38,8 @@ function stateModelFactory() {
|
|
|
38
38
|
*/
|
|
39
39
|
get RenderingComponent() {
|
|
40
40
|
const { pluginManager } = (0, util_1.getEnv)(self);
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
return pluginManager.getDisplayType(self.type)
|
|
42
|
+
.ReactComponent;
|
|
43
43
|
},
|
|
44
44
|
/**
|
|
45
45
|
* #getter
|
|
@@ -81,24 +81,16 @@ function stateModelFactory() {
|
|
|
81
81
|
},
|
|
82
82
|
/**
|
|
83
83
|
* #getter
|
|
84
|
-
* the pluggable element type object for this display's
|
|
85
|
-
* renderer
|
|
84
|
+
* the pluggable element type object for this display's renderer
|
|
86
85
|
*/
|
|
87
86
|
get rendererType() {
|
|
88
87
|
const { pluginManager } = (0, util_1.getEnv)(self);
|
|
89
|
-
|
|
90
|
-
if (!RendererType) {
|
|
91
|
-
throw new Error(`renderer "${self.rendererTypeName}" not found`);
|
|
92
|
-
}
|
|
93
|
-
if (!RendererType.ReactComponent) {
|
|
94
|
-
throw new Error(`renderer ${self.rendererTypeName} has no ReactComponent, it may not be completely implemented yet`);
|
|
95
|
-
}
|
|
96
|
-
return RendererType;
|
|
88
|
+
return pluginManager.getRendererType(self.rendererTypeName);
|
|
97
89
|
},
|
|
98
90
|
/**
|
|
99
91
|
* #getter
|
|
100
|
-
* if a display-level message should be displayed instead,
|
|
101
|
-
*
|
|
92
|
+
* if a display-level message should be displayed instead, make this
|
|
93
|
+
* return a react component
|
|
102
94
|
*/
|
|
103
95
|
get DisplayMessageComponent() {
|
|
104
96
|
return undefined;
|
|
@@ -55,8 +55,7 @@ function createBaseTrackModel(pm, trackType, baseTrackConfig) {
|
|
|
55
55
|
* determines which webworker to send the track to, currently based on trackId
|
|
56
56
|
*/
|
|
57
57
|
get rpcSessionId() {
|
|
58
|
-
|
|
59
|
-
return (_a = self.configuration) === null || _a === void 0 ? void 0 : _a.trackId;
|
|
58
|
+
return self.configuration.trackId;
|
|
60
59
|
},
|
|
61
60
|
/**
|
|
62
61
|
* #getter
|
|
@@ -98,7 +97,7 @@ function createBaseTrackModel(pm, trackType, baseTrackConfig) {
|
|
|
98
97
|
const { sessionTracks, adminMode } = session;
|
|
99
98
|
return ((0, types_1.isSessionModelWithConfigEditing)(session) &&
|
|
100
99
|
(adminMode ||
|
|
101
|
-
(sessionTracks === null || sessionTracks === void 0 ? void 0 : sessionTracks.find(t =>
|
|
100
|
+
(sessionTracks === null || sessionTracks === void 0 ? void 0 : sessionTracks.find(t => t.trackId === self.configuration.trackId))));
|
|
102
101
|
},
|
|
103
102
|
}))
|
|
104
103
|
.actions(self => ({
|
|
@@ -132,7 +131,9 @@ function createBaseTrackModel(pm, trackType, baseTrackConfig) {
|
|
|
132
131
|
const schema = pm.pluggableConfigSchemaType('display');
|
|
133
132
|
const conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), displayId);
|
|
134
133
|
const t = self.displays.filter(d => d.configuration === conf);
|
|
135
|
-
(0, mobx_1.transaction)(() =>
|
|
134
|
+
(0, mobx_1.transaction)(() => {
|
|
135
|
+
t.forEach(d => self.displays.remove(d));
|
|
136
|
+
});
|
|
136
137
|
return t.length;
|
|
137
138
|
},
|
|
138
139
|
/**
|
|
@@ -175,7 +176,9 @@ function createBaseTrackModel(pm, trackType, baseTrackConfig) {
|
|
|
175
176
|
type: 'radio',
|
|
176
177
|
label: pm.getDisplayType(d.type).displayName,
|
|
177
178
|
checked: d.displayId === shownId,
|
|
178
|
-
onClick: () =>
|
|
179
|
+
onClick: () => {
|
|
180
|
+
self.replaceDisplay(shownId, d.displayId);
|
|
181
|
+
},
|
|
179
182
|
})),
|
|
180
183
|
},
|
|
181
184
|
]
|
|
@@ -147,7 +147,7 @@ export declare const InternetAccount: import("mobx-state-tree").IModelType<{
|
|
|
147
147
|
/**
|
|
148
148
|
* #action
|
|
149
149
|
*/
|
|
150
|
-
addAuthHeaderToInit(init
|
|
150
|
+
addAuthHeaderToInit(init?: RequestInit, token?: string): {
|
|
151
151
|
headers: Headers;
|
|
152
152
|
body?: BodyInit | null;
|
|
153
153
|
cache?: RequestCache;
|
|
@@ -96,7 +96,7 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
96
96
|
* @returns true or false
|
|
97
97
|
*/
|
|
98
98
|
handlesLocation(location) {
|
|
99
|
-
return self.domains.some(domain => location
|
|
99
|
+
return self.domains.some(domain => location.uri.includes(domain));
|
|
100
100
|
},
|
|
101
101
|
/**
|
|
102
102
|
* #getter
|
|
@@ -183,13 +183,15 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
183
183
|
tokenPromise = Promise.resolve(token);
|
|
184
184
|
return tokenPromise;
|
|
185
185
|
}
|
|
186
|
-
tokenPromise = new Promise((resolve, reject) =>
|
|
187
|
-
self.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
186
|
+
tokenPromise = new Promise((resolve, reject) => {
|
|
187
|
+
self.getTokenFromUser(token => {
|
|
188
|
+
self.storeToken(token);
|
|
189
|
+
resolve(token);
|
|
190
|
+
}, error => {
|
|
191
|
+
self.removeToken();
|
|
192
|
+
reject(error);
|
|
193
|
+
});
|
|
194
|
+
});
|
|
193
195
|
return tokenPromise;
|
|
194
196
|
},
|
|
195
197
|
};
|
|
@@ -198,14 +200,18 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
198
200
|
/**
|
|
199
201
|
* #action
|
|
200
202
|
*/
|
|
201
|
-
addAuthHeaderToInit(init
|
|
203
|
+
addAuthHeaderToInit(init, token) {
|
|
202
204
|
return {
|
|
203
205
|
...init,
|
|
204
206
|
headers: new Headers({
|
|
205
|
-
...init.headers,
|
|
206
|
-
|
|
207
|
-
?
|
|
208
|
-
|
|
207
|
+
...init === null || init === void 0 ? void 0 : init.headers,
|
|
208
|
+
...(token
|
|
209
|
+
? {
|
|
210
|
+
[self.authHeader]: self.tokenType
|
|
211
|
+
? `${self.tokenType} ${token}`
|
|
212
|
+
: token,
|
|
213
|
+
}
|
|
214
|
+
: {}),
|
|
209
215
|
}),
|
|
210
216
|
};
|
|
211
217
|
},
|
|
@@ -140,7 +140,7 @@ function createBaseTrackConfig(pluginManager) {
|
|
|
140
140
|
// Gets the displays on the track snapshot and the possible displays
|
|
141
141
|
// from the track type and adds any missing possible displays to the
|
|
142
142
|
// snapshot
|
|
143
|
-
const configDisplayTypes = new Set(displays.
|
|
143
|
+
const configDisplayTypes = new Set(displays.map(d => d.type));
|
|
144
144
|
pluginManager.getTrackType(snap.type).displayTypes.forEach(d => {
|
|
145
145
|
if (!configDisplayTypes.has(d.name)) {
|
|
146
146
|
displays.push({
|
|
@@ -157,16 +157,13 @@ function createBaseTrackConfig(pluginManager) {
|
|
|
157
157
|
*/
|
|
158
158
|
explicitIdentifier: 'trackId',
|
|
159
159
|
explicitlyTyped: true,
|
|
160
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
161
160
|
actions: (self) => ({
|
|
162
161
|
addDisplayConf(conf) {
|
|
163
162
|
const { type } = conf;
|
|
164
163
|
if (!type) {
|
|
165
164
|
throw new Error(`unknown display type ${type}`);
|
|
166
165
|
}
|
|
167
|
-
const display = self.displays.find(
|
|
168
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
169
|
-
(d) => (d === null || d === void 0 ? void 0 : d.displayId) === conf.displayId);
|
|
166
|
+
const display = self.displays.find((d) => (d === null || d === void 0 ? void 0 : d.displayId) === conf.displayId);
|
|
170
167
|
if (display) {
|
|
171
168
|
return display;
|
|
172
169
|
}
|
|
@@ -10,18 +10,18 @@ import RpcManager from '../../rpc/RpcManager';
|
|
|
10
10
|
export interface LayoutSessionProps {
|
|
11
11
|
config: AnyConfigurationModel;
|
|
12
12
|
bpPerPx: number;
|
|
13
|
-
filters
|
|
13
|
+
filters?: SerializableFilterChain;
|
|
14
14
|
}
|
|
15
15
|
export type MyMultiLayout = MultiLayout<GranularRectLayout<unknown>, unknown>;
|
|
16
16
|
export interface CachedLayout {
|
|
17
17
|
layout: MyMultiLayout;
|
|
18
18
|
config: AnyConfigurationModel;
|
|
19
|
-
filters
|
|
19
|
+
filters?: SerializableFilterChain;
|
|
20
20
|
}
|
|
21
21
|
export declare class LayoutSession implements LayoutSessionProps {
|
|
22
22
|
config: AnyConfigurationModel;
|
|
23
23
|
bpPerPx: number;
|
|
24
|
-
filters
|
|
24
|
+
filters?: SerializableFilterChain;
|
|
25
25
|
constructor(args: LayoutSessionProps);
|
|
26
26
|
update(props: LayoutSessionProps): void;
|
|
27
27
|
makeLayout(): MultiLayout<GranularRectLayout<unknown>, unknown>;
|
|
@@ -61,7 +61,13 @@ export default class BoxRendererType extends FeatureRendererType {
|
|
|
61
61
|
sessionId: string;
|
|
62
62
|
layoutId: string;
|
|
63
63
|
}): LayoutSession;
|
|
64
|
-
getExpandedRegion(region: Region, renderArgs: RenderArgsDeserialized):
|
|
64
|
+
getExpandedRegion(region: Region, renderArgs: RenderArgsDeserialized): {
|
|
65
|
+
start: number;
|
|
66
|
+
end: number;
|
|
67
|
+
refName: string;
|
|
68
|
+
reversed?: boolean | undefined;
|
|
69
|
+
assemblyName: string;
|
|
70
|
+
};
|
|
65
71
|
createSession(props: LayoutSessionProps): LayoutSession;
|
|
66
72
|
freeResourcesInClient(rpcManager: RpcManager, args: RenderArgs): Promise<number>;
|
|
67
73
|
deserializeLayoutInClient(json: SerializedLayout): PrecomputedLayout<unknown>;
|
|
@@ -36,8 +36,7 @@ class LayoutSession {
|
|
|
36
36
|
* @returns true if the given layout is a valid one to use for this session
|
|
37
37
|
*/
|
|
38
38
|
cachedLayoutIsValid(cachedLayout) {
|
|
39
|
-
return (cachedLayout &&
|
|
40
|
-
cachedLayout.layout.subLayoutConstructorArgs.pitchX === this.bpPerPx &&
|
|
39
|
+
return (cachedLayout.layout.subLayoutConstructorArgs.pitchX === this.bpPerPx &&
|
|
41
40
|
(0, fast_deep_equal_1.default)((0, configuration_1.readConfObject)(this.config), cachedLayout.config) &&
|
|
42
41
|
(0, fast_deep_equal_1.default)(this.filters, cachedLayout.filters));
|
|
43
42
|
}
|
|
@@ -67,18 +66,9 @@ class BoxRendererType extends FeatureRendererType_1.default {
|
|
|
67
66
|
session.update(props);
|
|
68
67
|
return session;
|
|
69
68
|
}
|
|
70
|
-
// expands region for glyphs to use
|
|
71
69
|
getExpandedRegion(region, renderArgs) {
|
|
72
|
-
if (!region) {
|
|
73
|
-
return region;
|
|
74
|
-
}
|
|
75
70
|
const { bpPerPx, config } = renderArgs;
|
|
76
|
-
const maxFeatureGlyphExpansion = config
|
|
77
|
-
? 0
|
|
78
|
-
: (0, configuration_1.readConfObject)(config, 'maxFeatureGlyphExpansion');
|
|
79
|
-
if (!maxFeatureGlyphExpansion) {
|
|
80
|
-
return region;
|
|
81
|
-
}
|
|
71
|
+
const maxFeatureGlyphExpansion = (0, configuration_1.readConfObject)(config, 'maxFeatureGlyphExpansion') || 0;
|
|
82
72
|
const bpExpansion = Math.round(maxFeatureGlyphExpansion * bpPerPx);
|
|
83
73
|
return {
|
|
84
74
|
...region,
|
|
@@ -92,16 +82,12 @@ class BoxRendererType extends FeatureRendererType_1.default {
|
|
|
92
82
|
async freeResourcesInClient(rpcManager, args) {
|
|
93
83
|
const { regions } = args;
|
|
94
84
|
const key = (0, util_1.getLayoutId)(args);
|
|
95
|
-
let freed = 0;
|
|
96
85
|
const session = this.sessions[key];
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
if (session && regions) {
|
|
102
|
-
session.layout.discardRange(regions[0].refName, regions[0].start, regions[0].end);
|
|
86
|
+
if (session) {
|
|
87
|
+
const region = regions[0];
|
|
88
|
+
session.layout.discardRange(region.refName, region.start, region.end);
|
|
103
89
|
}
|
|
104
|
-
return
|
|
90
|
+
return await super.freeResourcesInClient(rpcManager, args);
|
|
105
91
|
}
|
|
106
92
|
deserializeLayoutInClient(json) {
|
|
107
93
|
return new PrecomputedLayout_1.default(json);
|
|
@@ -117,13 +103,11 @@ class BoxRendererType extends FeatureRendererType_1.default {
|
|
|
117
103
|
}
|
|
118
104
|
serializeResultsInWorker(results, args) {
|
|
119
105
|
const serialized = super.serializeResultsInWorker(results, args);
|
|
120
|
-
const
|
|
106
|
+
const region = args.regions[0];
|
|
121
107
|
serialized.layout = results.layout.serializeRegion(this.getExpandedRegion(region, args));
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
});
|
|
126
|
-
}
|
|
108
|
+
serialized.features = serialized.features.filter(f => {
|
|
109
|
+
return Boolean(serialized.layout.rectangles[f.uniqueId]);
|
|
110
|
+
});
|
|
127
111
|
serialized.maxHeightReached = serialized.layout.maxHeightReached;
|
|
128
112
|
return serialized;
|
|
129
113
|
}
|