@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
|
@@ -1,45 +1,26 @@
|
|
|
1
|
-
import { cast, getSnapshot, types, } from 'mobx-state-tree';
|
|
2
1
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
3
|
-
import {
|
|
4
|
-
// locals
|
|
2
|
+
import { cast, getSnapshot, types } from 'mobx-state-tree';
|
|
5
3
|
import { BaseSessionModel, isBaseSession } from './BaseSession';
|
|
6
|
-
|
|
7
|
-
* #stateModel MultipleViewsSessionMixin
|
|
8
|
-
* composed of
|
|
9
|
-
* - [BaseSessionModel](../basesessionmodel)
|
|
10
|
-
* - [DrawerWidgetSessionMixin](../drawerwidgetsessionmixin)
|
|
11
|
-
*/
|
|
4
|
+
import { DrawerWidgetSessionMixin } from './DrawerWidgets';
|
|
12
5
|
export function MultipleViewsSessionMixin(pluginManager) {
|
|
13
6
|
return types
|
|
14
7
|
.compose(BaseSessionModel(pluginManager), DrawerWidgetSessionMixin(pluginManager))
|
|
15
8
|
.props({
|
|
16
|
-
/**
|
|
17
|
-
* #property
|
|
18
|
-
*/
|
|
19
9
|
views: types.array(pluginManager.pluggableMstType('view', 'stateModel')),
|
|
20
10
|
})
|
|
21
11
|
.actions(self => ({
|
|
22
|
-
/**
|
|
23
|
-
* #action
|
|
24
|
-
*/
|
|
25
12
|
moveViewDown(id) {
|
|
26
13
|
const idx = self.views.findIndex(v => v.id === id);
|
|
27
14
|
if (idx !== -1 && idx < self.views.length - 1) {
|
|
28
15
|
self.views.splice(idx, 2, self.views[idx + 1], self.views[idx]);
|
|
29
16
|
}
|
|
30
17
|
},
|
|
31
|
-
/**
|
|
32
|
-
* #action
|
|
33
|
-
*/
|
|
34
18
|
moveViewUp(id) {
|
|
35
19
|
const idx = self.views.findIndex(view => view.id === id);
|
|
36
20
|
if (idx > 0) {
|
|
37
21
|
self.views.splice(idx - 1, 2, self.views[idx], self.views[idx - 1]);
|
|
38
22
|
}
|
|
39
23
|
},
|
|
40
|
-
/**
|
|
41
|
-
* #action
|
|
42
|
-
*/
|
|
43
24
|
moveViewToTop(id) {
|
|
44
25
|
const idx = self.views.findIndex(view => view.id === id);
|
|
45
26
|
self.views = cast([
|
|
@@ -47,9 +28,6 @@ export function MultipleViewsSessionMixin(pluginManager) {
|
|
|
47
28
|
...self.views.filter(view => view.id !== id),
|
|
48
29
|
]);
|
|
49
30
|
},
|
|
50
|
-
/**
|
|
51
|
-
* #action
|
|
52
|
-
*/
|
|
53
31
|
moveViewToBottom(id) {
|
|
54
32
|
const idx = self.views.findIndex(view => view.id === id);
|
|
55
33
|
self.views = cast([
|
|
@@ -57,9 +35,6 @@ export function MultipleViewsSessionMixin(pluginManager) {
|
|
|
57
35
|
self.views[idx],
|
|
58
36
|
]);
|
|
59
37
|
},
|
|
60
|
-
/**
|
|
61
|
-
* #action
|
|
62
|
-
*/
|
|
63
38
|
addView(typeName, initialState = {}) {
|
|
64
39
|
const typeDefinition = pluginManager.getElementType('view', typeName);
|
|
65
40
|
if (!typeDefinition) {
|
|
@@ -71,9 +46,6 @@ export function MultipleViewsSessionMixin(pluginManager) {
|
|
|
71
46
|
});
|
|
72
47
|
return self.views[length - 1];
|
|
73
48
|
},
|
|
74
|
-
/**
|
|
75
|
-
* #action
|
|
76
|
-
*/
|
|
77
49
|
removeView(view) {
|
|
78
50
|
for (const [, widget] of self.activeWidgets) {
|
|
79
51
|
if (widget.view && widget.view.id === view.id) {
|
|
@@ -82,15 +54,9 @@ export function MultipleViewsSessionMixin(pluginManager) {
|
|
|
82
54
|
}
|
|
83
55
|
self.views.remove(view);
|
|
84
56
|
},
|
|
85
|
-
/**
|
|
86
|
-
* #action
|
|
87
|
-
*/
|
|
88
57
|
addLinearGenomeViewOfAssembly(assemblyName, initialState = {}) {
|
|
89
58
|
return this.addViewOfAssembly('LinearGenomeView', assemblyName, initialState);
|
|
90
59
|
},
|
|
91
|
-
/**
|
|
92
|
-
* #action
|
|
93
|
-
*/
|
|
94
60
|
addViewOfAssembly(viewType, assemblyName, initialState = {}) {
|
|
95
61
|
const asm = self.assemblies.find(s => readConfObject(s, 'name') === assemblyName);
|
|
96
62
|
if (!asm) {
|
|
@@ -101,9 +67,6 @@ export function MultipleViewsSessionMixin(pluginManager) {
|
|
|
101
67
|
displayRegionsFromAssemblyName: readConfObject(asm, 'name'),
|
|
102
68
|
});
|
|
103
69
|
},
|
|
104
|
-
/**
|
|
105
|
-
* #action
|
|
106
|
-
*/
|
|
107
70
|
addViewFromAnotherView(viewType, otherView, initialState = {}) {
|
|
108
71
|
const state = { ...initialState };
|
|
109
72
|
state.displayedRegions = getSnapshot(otherView.displayedRegions);
|
|
@@ -111,7 +74,6 @@ export function MultipleViewsSessionMixin(pluginManager) {
|
|
|
111
74
|
},
|
|
112
75
|
}));
|
|
113
76
|
}
|
|
114
|
-
/** Type guard for SessionWithMultipleViews */
|
|
115
77
|
export function isSessionWithMultipleViews(session) {
|
|
116
78
|
return isBaseSession(session) && 'views' in session;
|
|
117
79
|
}
|
|
@@ -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,24 +1,10 @@
|
|
|
1
|
-
/** MST props, views, actions, etc related to managing connections */
|
|
2
1
|
import { getContainingView, isSessionModelWithWidgets, } from '@jbrowse/core/util';
|
|
3
2
|
import { getMembers, getParent, getSnapshot, getType, isModelType, isReferenceType, types, walk, } from 'mobx-state-tree';
|
|
4
|
-
// locals
|
|
5
3
|
import { isBaseSession } from './BaseSession';
|
|
6
|
-
/**
|
|
7
|
-
* #stateModel ReferenceManagementSessionMixin
|
|
8
|
-
*/
|
|
9
4
|
export function ReferenceManagementSessionMixin(_pluginManager) {
|
|
10
5
|
return types
|
|
11
6
|
.model('ReferenceManagementSessionMixin', {})
|
|
12
7
|
.views(self => ({
|
|
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
8
|
getReferring(object) {
|
|
23
9
|
const refs = [];
|
|
24
10
|
walk(getParent(self), node => {
|
|
@@ -35,15 +21,10 @@ export function ReferenceManagementSessionMixin(_pluginManager) {
|
|
|
35
21
|
},
|
|
36
22
|
}))
|
|
37
23
|
.actions(self => ({
|
|
38
|
-
/**
|
|
39
|
-
* #action
|
|
40
|
-
*/
|
|
41
24
|
removeReferring(referring, track, callbacks, dereferenceTypeCount) {
|
|
42
25
|
referring.forEach(({ node }) => {
|
|
43
26
|
let dereferenced = false;
|
|
44
27
|
try {
|
|
45
|
-
// If a view is referring to the track config, remove the track
|
|
46
|
-
// from the view
|
|
47
28
|
const type = 'open track(s)';
|
|
48
29
|
const view = getContainingView(node);
|
|
49
30
|
callbacks.push(() => {
|
|
@@ -56,11 +37,8 @@ export function ReferenceManagementSessionMixin(_pluginManager) {
|
|
|
56
37
|
dereferenceTypeCount[type] += 1;
|
|
57
38
|
}
|
|
58
39
|
catch (err1) {
|
|
59
|
-
// ignore
|
|
60
40
|
}
|
|
61
41
|
if (isSessionModelWithWidgets(self) && self.widgets.has(node.id)) {
|
|
62
|
-
// If a configuration editor widget has the track config
|
|
63
|
-
// open, close the widget
|
|
64
42
|
const type = 'configuration editor widget(s)';
|
|
65
43
|
if (isSessionModelWithWidgets(self)) {
|
|
66
44
|
callbacks.push(() => {
|
|
@@ -80,7 +58,6 @@ export function ReferenceManagementSessionMixin(_pluginManager) {
|
|
|
80
58
|
},
|
|
81
59
|
}));
|
|
82
60
|
}
|
|
83
|
-
/** Type guard for SessionWithReferenceManagement */
|
|
84
61
|
export function isSessionWithReferenceManagement(thing) {
|
|
85
62
|
return (isBaseSession(thing) &&
|
|
86
63
|
'getReferring' in thing &&
|