@jbrowse/product-core 2.17.0 → 3.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/dist/RootModel/BaseRootModel.d.ts +6 -43
- package/dist/RootModel/BaseRootModel.js +5 -41
- package/dist/RootModel/FormatAbout.d.ts +0 -10
- package/dist/RootModel/FormatAbout.js +0 -10
- package/dist/RootModel/FormatDetails.d.ts +0 -17
- package/dist/RootModel/FormatDetails.js +0 -17
- package/dist/RootModel/HierarchicalConfig.d.ts +0 -19
- package/dist/RootModel/HierarchicalConfig.js +0 -19
- package/dist/RootModel/InternetAccounts.d.ts +4 -20
- package/dist/RootModel/InternetAccounts.js +0 -20
- package/dist/Session/BaseSession.d.ts +5 -96
- package/dist/Session/BaseSession.js +1 -63
- package/dist/Session/Connections.d.ts +5 -56
- package/dist/Session/Connections.js +0 -30
- package/dist/Session/DialogQueue.d.ts +3 -22
- package/dist/Session/DialogQueue.js +0 -17
- package/dist/Session/DrawerWidgets.d.ts +3 -63
- package/dist/Session/DrawerWidgets.js +2 -61
- package/dist/Session/MultipleViews.d.ts +8 -1760
- package/dist/Session/MultipleViews.js +2 -40
- package/dist/Session/ReferenceManagement.d.ts +2 -21
- package/dist/Session/ReferenceManagement.js +0 -23
- package/dist/Session/SessionTracks.d.ts +7 -1748
- package/dist/Session/SessionTracks.js +1 -21
- package/dist/Session/Themes.d.ts +3 -21
- package/dist/Session/Themes.js +1 -17
- package/dist/Session/Tracks.d.ts +6 -1737
- package/dist/Session/Tracks.js +0 -16
- package/dist/rpcWorker.d.ts +2 -2
- package/dist/rpcWorker.js +3 -17
- package/dist/ui/AboutDialog.d.ts +2 -3
- package/dist/ui/AboutDialog.js +2 -3
- package/dist/ui/AboutDialogContents.d.ts +2 -3
- package/dist/ui/AboutDialogContents.js +20 -53
- package/dist/ui/FileInfoPanel.d.ts +2 -3
- package/dist/ui/FileInfoPanel.js +5 -28
- package/dist/ui/RefNameInfoDialog.d.ts +2 -3
- package/dist/ui/RefNameInfoDialog.js +17 -44
- package/esm/RootModel/BaseRootModel.d.ts +6 -43
- package/esm/RootModel/BaseRootModel.js +6 -42
- package/esm/RootModel/FormatAbout.d.ts +0 -10
- package/esm/RootModel/FormatAbout.js +0 -10
- package/esm/RootModel/FormatDetails.d.ts +0 -17
- package/esm/RootModel/FormatDetails.js +0 -17
- package/esm/RootModel/HierarchicalConfig.d.ts +0 -19
- package/esm/RootModel/HierarchicalConfig.js +0 -19
- package/esm/RootModel/InternetAccounts.d.ts +4 -20
- package/esm/RootModel/InternetAccounts.js +0 -20
- package/esm/Session/BaseSession.d.ts +5 -96
- package/esm/Session/BaseSession.js +1 -63
- package/esm/Session/Connections.d.ts +5 -56
- package/esm/Session/Connections.js +1 -31
- package/esm/Session/DialogQueue.d.ts +3 -22
- package/esm/Session/DialogQueue.js +0 -17
- package/esm/Session/DrawerWidgets.d.ts +3 -63
- package/esm/Session/DrawerWidgets.js +2 -61
- package/esm/Session/MultipleViews.d.ts +8 -1760
- package/esm/Session/MultipleViews.js +2 -40
- package/esm/Session/ReferenceManagement.d.ts +2 -21
- package/esm/Session/ReferenceManagement.js +0 -23
- package/esm/Session/SessionTracks.d.ts +7 -1748
- package/esm/Session/SessionTracks.js +1 -21
- package/esm/Session/Themes.d.ts +3 -21
- package/esm/Session/Themes.js +1 -17
- package/esm/Session/Tracks.d.ts +6 -1737
- package/esm/Session/Tracks.js +0 -16
- package/esm/rpcWorker.d.ts +2 -2
- package/esm/rpcWorker.js +3 -17
- package/esm/ui/AboutDialog.d.ts +2 -3
- package/esm/ui/AboutDialog.js +3 -4
- package/esm/ui/AboutDialogContents.d.ts +2 -3
- package/esm/ui/AboutDialogContents.js +20 -30
- package/esm/ui/FileInfoPanel.d.ts +2 -3
- package/esm/ui/FileInfoPanel.js +5 -5
- package/esm/ui/RefNameInfoDialog.d.ts +2 -3
- package/esm/ui/RefNameInfoDialog.js +18 -22
- package/package.json +3 -3
|
@@ -2,48 +2,29 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MultipleViewsSessionMixin = MultipleViewsSessionMixin;
|
|
4
4
|
exports.isSessionWithMultipleViews = isSessionWithMultipleViews;
|
|
5
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
5
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
7
|
-
const
|
|
8
|
-
// locals
|
|
6
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
9
7
|
const BaseSession_1 = require("./BaseSession");
|
|
10
|
-
|
|
11
|
-
* #stateModel MultipleViewsSessionMixin
|
|
12
|
-
* composed of
|
|
13
|
-
* - [BaseSessionModel](../basesessionmodel)
|
|
14
|
-
* - [DrawerWidgetSessionMixin](../drawerwidgetsessionmixin)
|
|
15
|
-
*/
|
|
8
|
+
const DrawerWidgets_1 = require("./DrawerWidgets");
|
|
16
9
|
function MultipleViewsSessionMixin(pluginManager) {
|
|
17
10
|
return mobx_state_tree_1.types
|
|
18
11
|
.compose((0, BaseSession_1.BaseSessionModel)(pluginManager), (0, DrawerWidgets_1.DrawerWidgetSessionMixin)(pluginManager))
|
|
19
12
|
.props({
|
|
20
|
-
/**
|
|
21
|
-
* #property
|
|
22
|
-
*/
|
|
23
13
|
views: mobx_state_tree_1.types.array(pluginManager.pluggableMstType('view', 'stateModel')),
|
|
24
14
|
})
|
|
25
15
|
.actions(self => ({
|
|
26
|
-
/**
|
|
27
|
-
* #action
|
|
28
|
-
*/
|
|
29
16
|
moveViewDown(id) {
|
|
30
17
|
const idx = self.views.findIndex(v => v.id === id);
|
|
31
18
|
if (idx !== -1 && idx < self.views.length - 1) {
|
|
32
19
|
self.views.splice(idx, 2, self.views[idx + 1], self.views[idx]);
|
|
33
20
|
}
|
|
34
21
|
},
|
|
35
|
-
/**
|
|
36
|
-
* #action
|
|
37
|
-
*/
|
|
38
22
|
moveViewUp(id) {
|
|
39
23
|
const idx = self.views.findIndex(view => view.id === id);
|
|
40
24
|
if (idx > 0) {
|
|
41
25
|
self.views.splice(idx - 1, 2, self.views[idx], self.views[idx - 1]);
|
|
42
26
|
}
|
|
43
27
|
},
|
|
44
|
-
/**
|
|
45
|
-
* #action
|
|
46
|
-
*/
|
|
47
28
|
moveViewToTop(id) {
|
|
48
29
|
const idx = self.views.findIndex(view => view.id === id);
|
|
49
30
|
self.views = (0, mobx_state_tree_1.cast)([
|
|
@@ -51,9 +32,6 @@ function MultipleViewsSessionMixin(pluginManager) {
|
|
|
51
32
|
...self.views.filter(view => view.id !== id),
|
|
52
33
|
]);
|
|
53
34
|
},
|
|
54
|
-
/**
|
|
55
|
-
* #action
|
|
56
|
-
*/
|
|
57
35
|
moveViewToBottom(id) {
|
|
58
36
|
const idx = self.views.findIndex(view => view.id === id);
|
|
59
37
|
self.views = (0, mobx_state_tree_1.cast)([
|
|
@@ -61,9 +39,6 @@ function MultipleViewsSessionMixin(pluginManager) {
|
|
|
61
39
|
self.views[idx],
|
|
62
40
|
]);
|
|
63
41
|
},
|
|
64
|
-
/**
|
|
65
|
-
* #action
|
|
66
|
-
*/
|
|
67
42
|
addView(typeName, initialState = {}) {
|
|
68
43
|
const typeDefinition = pluginManager.getElementType('view', typeName);
|
|
69
44
|
if (!typeDefinition) {
|
|
@@ -75,9 +50,6 @@ function MultipleViewsSessionMixin(pluginManager) {
|
|
|
75
50
|
});
|
|
76
51
|
return self.views[length - 1];
|
|
77
52
|
},
|
|
78
|
-
/**
|
|
79
|
-
* #action
|
|
80
|
-
*/
|
|
81
53
|
removeView(view) {
|
|
82
54
|
for (const [, widget] of self.activeWidgets) {
|
|
83
55
|
if (widget.view && widget.view.id === view.id) {
|
|
@@ -86,15 +58,9 @@ function MultipleViewsSessionMixin(pluginManager) {
|
|
|
86
58
|
}
|
|
87
59
|
self.views.remove(view);
|
|
88
60
|
},
|
|
89
|
-
/**
|
|
90
|
-
* #action
|
|
91
|
-
*/
|
|
92
61
|
addLinearGenomeViewOfAssembly(assemblyName, initialState = {}) {
|
|
93
62
|
return this.addViewOfAssembly('LinearGenomeView', assemblyName, initialState);
|
|
94
63
|
},
|
|
95
|
-
/**
|
|
96
|
-
* #action
|
|
97
|
-
*/
|
|
98
64
|
addViewOfAssembly(viewType, assemblyName, initialState = {}) {
|
|
99
65
|
const asm = self.assemblies.find(s => (0, configuration_1.readConfObject)(s, 'name') === assemblyName);
|
|
100
66
|
if (!asm) {
|
|
@@ -105,9 +71,6 @@ function MultipleViewsSessionMixin(pluginManager) {
|
|
|
105
71
|
displayRegionsFromAssemblyName: (0, configuration_1.readConfObject)(asm, 'name'),
|
|
106
72
|
});
|
|
107
73
|
},
|
|
108
|
-
/**
|
|
109
|
-
* #action
|
|
110
|
-
*/
|
|
111
74
|
addViewFromAnotherView(viewType, otherView, initialState = {}) {
|
|
112
75
|
const state = { ...initialState };
|
|
113
76
|
state.displayedRegions = (0, mobx_state_tree_1.getSnapshot)(otherView.displayedRegions);
|
|
@@ -115,7 +78,6 @@ function MultipleViewsSessionMixin(pluginManager) {
|
|
|
115
78
|
},
|
|
116
79
|
}));
|
|
117
80
|
}
|
|
118
|
-
/** Type guard for SessionWithMultipleViews */
|
|
119
81
|
function isSessionWithMultipleViews(session) {
|
|
120
82
|
return (0, BaseSession_1.isBaseSession)(session) && 'views' in session;
|
|
121
83
|
}
|
|
@@ -1,34 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
-
import { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
4
2
|
import type { BaseTrackConfig } from '@jbrowse/core/pluggableElementTypes';
|
|
3
|
+
import type { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
|
|
5
4
|
export interface ReferringNode {
|
|
6
5
|
node: IAnyStateTreeNode;
|
|
7
6
|
key: string;
|
|
8
7
|
}
|
|
9
|
-
/**
|
|
10
|
-
* #stateModel ReferenceManagementSessionMixin
|
|
11
|
-
*/
|
|
12
8
|
export declare function ReferenceManagementSessionMixin(_pluginManager: PluginManager): import("mobx-state-tree").IModelType<{}, {
|
|
13
|
-
/**
|
|
14
|
-
* #method
|
|
15
|
-
* See if any MST nodes currently have a types.reference to this object.
|
|
16
|
-
*
|
|
17
|
-
* @param object - object
|
|
18
|
-
* @returns An array where the first element is the node referring
|
|
19
|
-
* to the object and the second element is they property name the node is
|
|
20
|
-
* using to refer to the object
|
|
21
|
-
*/
|
|
22
9
|
getReferring(object: IAnyStateTreeNode): ReferringNode[];
|
|
23
10
|
} & {
|
|
24
|
-
/**
|
|
25
|
-
* #action
|
|
26
|
-
*/
|
|
27
11
|
removeReferring(referring: ReferringNode[], track: BaseTrackConfig, callbacks: ((arg: string) => void)[], dereferenceTypeCount: Record<string, number>): void;
|
|
28
12
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
29
|
-
/** Session mixin MST type for a session that manages multiple views */
|
|
30
13
|
export type SessionWithReferenceManagementType = ReturnType<typeof ReferenceManagementSessionMixin>;
|
|
31
|
-
/** Instance of a session with MST reference management (`getReferring()`, `removeReferring()`) */
|
|
32
14
|
export type SessionWithReferenceManagement = Instance<SessionWithReferenceManagementType>;
|
|
33
|
-
/** Type guard for SessionWithReferenceManagement */
|
|
34
15
|
export declare function isSessionWithReferenceManagement(thing: IAnyStateTreeNode): thing is SessionWithReferenceManagement;
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/** MST props, views, actions, etc related to managing connections */
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.ReferenceManagementSessionMixin = ReferenceManagementSessionMixin;
|
|
5
4
|
exports.isSessionWithReferenceManagement = isSessionWithReferenceManagement;
|
|
6
5
|
const util_1 = require("@jbrowse/core/util");
|
|
7
6
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
8
|
-
// locals
|
|
9
7
|
const BaseSession_1 = require("./BaseSession");
|
|
10
|
-
/**
|
|
11
|
-
* #stateModel ReferenceManagementSessionMixin
|
|
12
|
-
*/
|
|
13
8
|
function ReferenceManagementSessionMixin(_pluginManager) {
|
|
14
9
|
return mobx_state_tree_1.types
|
|
15
10
|
.model('ReferenceManagementSessionMixin', {})
|
|
16
11
|
.views(self => ({
|
|
17
|
-
/**
|
|
18
|
-
* #method
|
|
19
|
-
* See if any MST nodes currently have a types.reference to this object.
|
|
20
|
-
*
|
|
21
|
-
* @param object - object
|
|
22
|
-
* @returns An array where the first element is the node referring
|
|
23
|
-
* to the object and the second element is they property name the node is
|
|
24
|
-
* using to refer to the object
|
|
25
|
-
*/
|
|
26
12
|
getReferring(object) {
|
|
27
13
|
const refs = [];
|
|
28
14
|
(0, mobx_state_tree_1.walk)((0, mobx_state_tree_1.getParent)(self), node => {
|
|
@@ -39,15 +25,10 @@ function ReferenceManagementSessionMixin(_pluginManager) {
|
|
|
39
25
|
},
|
|
40
26
|
}))
|
|
41
27
|
.actions(self => ({
|
|
42
|
-
/**
|
|
43
|
-
* #action
|
|
44
|
-
*/
|
|
45
28
|
removeReferring(referring, track, callbacks, dereferenceTypeCount) {
|
|
46
29
|
referring.forEach(({ node }) => {
|
|
47
30
|
let dereferenced = false;
|
|
48
31
|
try {
|
|
49
|
-
// If a view is referring to the track config, remove the track
|
|
50
|
-
// from the view
|
|
51
32
|
const type = 'open track(s)';
|
|
52
33
|
const view = (0, util_1.getContainingView)(node);
|
|
53
34
|
callbacks.push(() => {
|
|
@@ -60,11 +41,8 @@ function ReferenceManagementSessionMixin(_pluginManager) {
|
|
|
60
41
|
dereferenceTypeCount[type] += 1;
|
|
61
42
|
}
|
|
62
43
|
catch (err1) {
|
|
63
|
-
// ignore
|
|
64
44
|
}
|
|
65
45
|
if ((0, util_1.isSessionModelWithWidgets)(self) && self.widgets.has(node.id)) {
|
|
66
|
-
// If a configuration editor widget has the track config
|
|
67
|
-
// open, close the widget
|
|
68
46
|
const type = 'configuration editor widget(s)';
|
|
69
47
|
if ((0, util_1.isSessionModelWithWidgets)(self)) {
|
|
70
48
|
callbacks.push(() => {
|
|
@@ -84,7 +62,6 @@ function ReferenceManagementSessionMixin(_pluginManager) {
|
|
|
84
62
|
},
|
|
85
63
|
}));
|
|
86
64
|
}
|
|
87
|
-
/** Type guard for SessionWithReferenceManagement */
|
|
88
65
|
function isSessionWithReferenceManagement(thing) {
|
|
89
66
|
return ((0, BaseSession_1.isBaseSession)(thing) &&
|
|
90
67
|
'getReferring' in thing &&
|