@jbrowse/product-core 2.17.0 → 2.18.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 -64
- package/dist/Session/BaseSession.js +1 -63
- package/dist/Session/Connections.d.ts +3 -34
- 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 +16 -65
- 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 +9 -27
- 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 +9 -27
- 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 +1 -1
- package/dist/ui/AboutDialogContents.d.ts +1 -1
- package/dist/ui/AboutDialogContents.js +7 -9
- package/dist/ui/FileInfoPanel.d.ts +1 -1
- package/dist/ui/FileInfoPanel.js +2 -3
- package/dist/ui/RefNameInfoDialog.d.ts +1 -1
- package/dist/ui/RefNameInfoDialog.js +2 -4
- 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 -64
- package/esm/Session/BaseSession.js +1 -63
- package/esm/Session/Connections.d.ts +3 -34
- 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 +16 -65
- 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 +9 -27
- 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 +9 -27
- 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 +1 -1
- package/esm/ui/AboutDialog.js +1 -1
- package/esm/ui/AboutDialogContents.d.ts +1 -1
- package/esm/ui/AboutDialogContents.js +7 -9
- package/esm/ui/FileInfoPanel.d.ts +1 -1
- package/esm/ui/FileInfoPanel.js +3 -4
- package/esm/ui/RefNameInfoDialog.d.ts +1 -1
- package/esm/ui/RefNameInfoDialog.js +4 -6
- package/package.json +3 -3
|
@@ -1,88 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
/**
|
|
5
|
-
* #stateModel DrawerWidgetSessionMixin
|
|
6
|
-
*/
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
|
|
7
4
|
export declare function DrawerWidgetSessionMixin(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
8
|
-
/**
|
|
9
|
-
* #property
|
|
10
|
-
*/
|
|
11
5
|
drawerPosition: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
12
|
-
/**
|
|
13
|
-
* #property
|
|
14
|
-
*/
|
|
15
6
|
drawerWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
16
|
-
/**
|
|
17
|
-
* #property
|
|
18
|
-
*/
|
|
19
7
|
widgets: import("mobx-state-tree").IMapType<import("mobx-state-tree").IAnyType>;
|
|
20
|
-
/**
|
|
21
|
-
* #property
|
|
22
|
-
*/
|
|
23
8
|
activeWidgets: import("mobx-state-tree").IMapType<import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>>;
|
|
24
|
-
/**
|
|
25
|
-
* #property
|
|
26
|
-
*/
|
|
27
9
|
minimized: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
28
10
|
}, {
|
|
29
|
-
/**
|
|
30
|
-
* #getter
|
|
31
|
-
*/
|
|
32
11
|
readonly visibleWidget: any;
|
|
33
12
|
} & {
|
|
34
|
-
/**
|
|
35
|
-
* #action
|
|
36
|
-
*/
|
|
37
13
|
setDrawerPosition(arg: string): void;
|
|
38
|
-
/**
|
|
39
|
-
* #action
|
|
40
|
-
*/
|
|
41
14
|
updateDrawerWidth(drawerWidth: number): number;
|
|
42
|
-
/**
|
|
43
|
-
* #action
|
|
44
|
-
*/
|
|
45
15
|
resizeDrawer(distance: number): number;
|
|
46
|
-
/**
|
|
47
|
-
* #action
|
|
48
|
-
*/
|
|
49
16
|
addWidget(typeName: string, id: string, initialState?: {}, conf?: unknown): any;
|
|
50
|
-
/**
|
|
51
|
-
* #action
|
|
52
|
-
*/
|
|
53
17
|
showWidget(widget: any): void;
|
|
54
|
-
/**
|
|
55
|
-
* #action
|
|
56
|
-
*/
|
|
57
18
|
hasWidget(widget: any): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* #action
|
|
60
|
-
*/
|
|
61
19
|
hideWidget(widget: any): void;
|
|
62
|
-
/**
|
|
63
|
-
* #action
|
|
64
|
-
*/
|
|
65
20
|
minimizeWidgetDrawer(): void;
|
|
66
|
-
/**
|
|
67
|
-
* #action
|
|
68
|
-
*/
|
|
69
21
|
showWidgetDrawer(): void;
|
|
70
|
-
/**
|
|
71
|
-
* #action
|
|
72
|
-
*/
|
|
73
22
|
hideAllWidgets(): void;
|
|
74
|
-
/**
|
|
75
|
-
* #action
|
|
76
|
-
* opens a configuration editor to configure the given thing,
|
|
77
|
-
* and sets the current task to be configuring it
|
|
78
|
-
* @param configuration -
|
|
79
|
-
*/
|
|
80
23
|
editConfiguration(configuration: AnyConfigurationModel): void;
|
|
81
24
|
afterAttach(): void;
|
|
82
25
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
83
|
-
/** Session mixin MST type for a session that manages drawer widgets */
|
|
84
26
|
export type SessionWithDrawerWidgetsType = ReturnType<typeof DrawerWidgetSessionMixin>;
|
|
85
|
-
/** Instance of a session that manages drawer widgets */
|
|
86
27
|
export type SessionWithDrawerWidgets = Instance<SessionWithDrawerWidgetsType>;
|
|
87
|
-
/** Type guard for SessionWithDrawerWidgets */
|
|
88
28
|
export declare function isSessionWithDrawerWidgets(session: IAnyStateTreeNode): session is SessionWithDrawerWidgets;
|
|
@@ -1,60 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
2
|
import { localStorageGetItem, localStorageSetItem } from '@jbrowse/core/util';
|
|
3
3
|
import { autorun } from 'mobx';
|
|
4
|
-
import {
|
|
4
|
+
import { addDisposer, isAlive, types } from 'mobx-state-tree';
|
|
5
5
|
import { isBaseSession } from './BaseSession';
|
|
6
6
|
const minDrawerWidth = 128;
|
|
7
|
-
/**
|
|
8
|
-
* #stateModel DrawerWidgetSessionMixin
|
|
9
|
-
*/
|
|
10
7
|
export function DrawerWidgetSessionMixin(pluginManager) {
|
|
11
8
|
const widgetStateModelType = pluginManager.pluggableMstType('widget', 'stateModel');
|
|
12
9
|
return types
|
|
13
10
|
.model({
|
|
14
|
-
/**
|
|
15
|
-
* #property
|
|
16
|
-
*/
|
|
17
11
|
drawerPosition: types.optional(types.string, () => localStorageGetItem('drawerPosition') || 'right'),
|
|
18
|
-
/**
|
|
19
|
-
* #property
|
|
20
|
-
*/
|
|
21
12
|
drawerWidth: types.optional(types.refinement(types.integer, width => width >= minDrawerWidth), 384),
|
|
22
|
-
/**
|
|
23
|
-
* #property
|
|
24
|
-
*/
|
|
25
13
|
widgets: types.map(widgetStateModelType),
|
|
26
|
-
/**
|
|
27
|
-
* #property
|
|
28
|
-
*/
|
|
29
14
|
activeWidgets: types.map(types.safeReference(widgetStateModelType)),
|
|
30
|
-
/**
|
|
31
|
-
* #property
|
|
32
|
-
*/
|
|
33
15
|
minimized: types.optional(types.boolean, false),
|
|
34
16
|
})
|
|
35
17
|
.views(self => ({
|
|
36
|
-
/**
|
|
37
|
-
* #getter
|
|
38
|
-
*/
|
|
39
18
|
get visibleWidget() {
|
|
40
19
|
if (isAlive(self)) {
|
|
41
|
-
// returns most recently added item in active widgets
|
|
42
20
|
return [...self.activeWidgets.values()][self.activeWidgets.size - 1];
|
|
43
21
|
}
|
|
44
22
|
return undefined;
|
|
45
23
|
},
|
|
46
24
|
}))
|
|
47
25
|
.actions(self => ({
|
|
48
|
-
/**
|
|
49
|
-
* #action
|
|
50
|
-
*/
|
|
51
26
|
setDrawerPosition(arg) {
|
|
52
27
|
self.drawerPosition = arg;
|
|
53
28
|
localStorage.setItem('drawerPosition', arg);
|
|
54
29
|
},
|
|
55
|
-
/**
|
|
56
|
-
* #action
|
|
57
|
-
*/
|
|
58
30
|
updateDrawerWidth(drawerWidth) {
|
|
59
31
|
if (drawerWidth === self.drawerWidth) {
|
|
60
32
|
return self.drawerWidth;
|
|
@@ -66,9 +38,6 @@ export function DrawerWidgetSessionMixin(pluginManager) {
|
|
|
66
38
|
self.drawerWidth = newDrawerWidth;
|
|
67
39
|
return newDrawerWidth;
|
|
68
40
|
},
|
|
69
|
-
/**
|
|
70
|
-
* #action
|
|
71
|
-
*/
|
|
72
41
|
resizeDrawer(distance) {
|
|
73
42
|
if (self.drawerPosition === 'left') {
|
|
74
43
|
distance *= -1;
|
|
@@ -77,9 +46,6 @@ export function DrawerWidgetSessionMixin(pluginManager) {
|
|
|
77
46
|
const newDrawerWidth = this.updateDrawerWidth(oldDrawerWidth - distance);
|
|
78
47
|
return oldDrawerWidth - newDrawerWidth;
|
|
79
48
|
},
|
|
80
|
-
/**
|
|
81
|
-
* #action
|
|
82
|
-
*/
|
|
83
49
|
addWidget(typeName, id, initialState = {}, conf) {
|
|
84
50
|
const typeDefinition = pluginManager.getElementType('widget', typeName);
|
|
85
51
|
if (!typeDefinition) {
|
|
@@ -94,9 +60,6 @@ export function DrawerWidgetSessionMixin(pluginManager) {
|
|
|
94
60
|
self.widgets.set(id, data);
|
|
95
61
|
return self.widgets.get(id);
|
|
96
62
|
},
|
|
97
|
-
/**
|
|
98
|
-
* #action
|
|
99
|
-
*/
|
|
100
63
|
showWidget(widget) {
|
|
101
64
|
if (self.activeWidgets.has(widget.id)) {
|
|
102
65
|
self.activeWidgets.delete(widget.id);
|
|
@@ -104,42 +67,21 @@ export function DrawerWidgetSessionMixin(pluginManager) {
|
|
|
104
67
|
self.activeWidgets.set(widget.id, widget);
|
|
105
68
|
self.minimized = false;
|
|
106
69
|
},
|
|
107
|
-
/**
|
|
108
|
-
* #action
|
|
109
|
-
*/
|
|
110
70
|
hasWidget(widget) {
|
|
111
71
|
return self.activeWidgets.has(widget.id);
|
|
112
72
|
},
|
|
113
|
-
/**
|
|
114
|
-
* #action
|
|
115
|
-
*/
|
|
116
73
|
hideWidget(widget) {
|
|
117
74
|
self.activeWidgets.delete(widget.id);
|
|
118
75
|
},
|
|
119
|
-
/**
|
|
120
|
-
* #action
|
|
121
|
-
*/
|
|
122
76
|
minimizeWidgetDrawer() {
|
|
123
77
|
self.minimized = true;
|
|
124
78
|
},
|
|
125
|
-
/**
|
|
126
|
-
* #action
|
|
127
|
-
*/
|
|
128
79
|
showWidgetDrawer() {
|
|
129
80
|
self.minimized = false;
|
|
130
81
|
},
|
|
131
|
-
/**
|
|
132
|
-
* #action
|
|
133
|
-
*/
|
|
134
82
|
hideAllWidgets() {
|
|
135
83
|
self.activeWidgets.clear();
|
|
136
84
|
},
|
|
137
|
-
/**
|
|
138
|
-
* #action
|
|
139
|
-
* opens a configuration editor to configure the given thing,
|
|
140
|
-
* and sets the current task to be configuring it
|
|
141
|
-
* @param configuration -
|
|
142
|
-
*/
|
|
143
85
|
editConfiguration(configuration) {
|
|
144
86
|
if (!isConfigurationModel(configuration)) {
|
|
145
87
|
throw new Error('must pass a configuration model to editConfiguration');
|
|
@@ -154,7 +96,6 @@ export function DrawerWidgetSessionMixin(pluginManager) {
|
|
|
154
96
|
},
|
|
155
97
|
}));
|
|
156
98
|
}
|
|
157
|
-
/** Type guard for SessionWithDrawerWidgets */
|
|
158
99
|
export function isSessionWithDrawerWidgets(session) {
|
|
159
100
|
return (isBaseSession(session) &&
|
|
160
101
|
'widgets' in session &&
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
/**
|
|
7
|
-
* #stateModel MultipleViewsSessionMixin
|
|
8
|
-
* composed of
|
|
9
|
-
* - [BaseSessionModel](../basesessionmodel)
|
|
10
|
-
* - [DrawerWidgetSessionMixin](../drawerwidgetsessionmixin)
|
|
11
|
-
*/
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes';
|
|
3
|
+
import type { IBaseViewModelWithDisplayedRegions } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
4
|
+
import type { Region } from '@jbrowse/core/util';
|
|
5
|
+
import type { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
|
|
12
6
|
export declare function MultipleViewsSessionMixin(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
13
7
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
14
8
|
name: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -20,9 +14,6 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
20
14
|
activeWidgets: import("mobx-state-tree").IMapType<import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>>;
|
|
21
15
|
minimized: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
22
16
|
} & {
|
|
23
|
-
/**
|
|
24
|
-
* #property
|
|
25
|
-
*/
|
|
26
17
|
views: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyType>;
|
|
27
18
|
}, {
|
|
28
19
|
selection: unknown;
|
|
@@ -38,9 +29,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
38
29
|
}, {
|
|
39
30
|
error: unknown;
|
|
40
31
|
loadingP: Promise<void> | undefined;
|
|
41
|
-
volatileRegions: import("@jbrowse/core/assemblyManager/assembly"
|
|
42
|
-
* #property
|
|
43
|
-
*/).BasicRegion[] | undefined;
|
|
32
|
+
volatileRegions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
44
33
|
refNameAliases: {
|
|
45
34
|
[x: string]: string;
|
|
46
35
|
} | undefined;
|
|
@@ -53,9 +42,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
53
42
|
} & {
|
|
54
43
|
readonly initialized: boolean;
|
|
55
44
|
readonly name: string;
|
|
56
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly"
|
|
57
|
-
* #action
|
|
58
|
-
*/).BasicRegion[] | undefined;
|
|
45
|
+
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
59
46
|
readonly aliases: string[];
|
|
60
47
|
readonly displayName: string | undefined;
|
|
61
48
|
hasName(name: string): boolean;
|
|
@@ -610,7 +597,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
610
597
|
getRefNameMapForAdapter(adapterConf: {
|
|
611
598
|
[x: string]: unknown;
|
|
612
599
|
}, assemblyName: string | undefined, opts: {
|
|
613
|
-
|
|
600
|
+
stopToken?: string;
|
|
614
601
|
sessionId: string;
|
|
615
602
|
}): Promise<{
|
|
616
603
|
[x: string]: string;
|
|
@@ -618,7 +605,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
618
605
|
getReverseRefNameMapForAdapter(adapterConf: {
|
|
619
606
|
[x: string]: unknown;
|
|
620
607
|
}, assemblyName: string | undefined, opts: {
|
|
621
|
-
|
|
608
|
+
stopToken?: string;
|
|
622
609
|
sessionId: string;
|
|
623
610
|
}): Promise<{
|
|
624
611
|
[x: string]: string;
|
|
@@ -634,9 +621,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
634
621
|
}, {
|
|
635
622
|
error: unknown;
|
|
636
623
|
loadingP: Promise<void> | undefined;
|
|
637
|
-
volatileRegions: import("@jbrowse/core/assemblyManager/assembly"
|
|
638
|
-
* #property
|
|
639
|
-
*/).BasicRegion[] | undefined;
|
|
624
|
+
volatileRegions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
640
625
|
refNameAliases: {
|
|
641
626
|
[x: string]: string;
|
|
642
627
|
} | undefined;
|
|
@@ -649,9 +634,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
649
634
|
} & {
|
|
650
635
|
readonly initialized: boolean;
|
|
651
636
|
readonly name: string;
|
|
652
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly"
|
|
653
|
-
* #action
|
|
654
|
-
*/).BasicRegion[] | undefined;
|
|
637
|
+
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
655
638
|
readonly aliases: string[];
|
|
656
639
|
readonly displayName: string | undefined;
|
|
657
640
|
hasName(name: string): boolean;
|
|
@@ -1136,7 +1119,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
1136
1119
|
getRefNameMapForAdapter(adapterConf: {
|
|
1137
1120
|
[x: string]: unknown;
|
|
1138
1121
|
}, assemblyName: string | undefined, opts: {
|
|
1139
|
-
|
|
1122
|
+
stopToken?: string;
|
|
1140
1123
|
sessionId: string;
|
|
1141
1124
|
}): Promise<{
|
|
1142
1125
|
[x: string]: string;
|
|
@@ -1144,7 +1127,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
1144
1127
|
getReverseRefNameMapForAdapter(adapterConf: {
|
|
1145
1128
|
[x: string]: unknown;
|
|
1146
1129
|
}, assemblyName: string | undefined, opts: {
|
|
1147
|
-
|
|
1130
|
+
stopToken?: string;
|
|
1148
1131
|
sessionId: string;
|
|
1149
1132
|
}): Promise<{
|
|
1150
1133
|
[x: string]: string;
|
|
@@ -1675,7 +1658,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
1675
1658
|
getRefNameMapForAdapter(adapterConf: {
|
|
1676
1659
|
[x: string]: unknown;
|
|
1677
1660
|
}, assemblyName: string | undefined, opts: {
|
|
1678
|
-
|
|
1661
|
+
stopToken?: string;
|
|
1679
1662
|
sessionId: string;
|
|
1680
1663
|
}): Promise<{
|
|
1681
1664
|
[x: string]: string;
|
|
@@ -1683,7 +1666,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
1683
1666
|
getReverseRefNameMapForAdapter(adapterConf: {
|
|
1684
1667
|
[x: string]: unknown;
|
|
1685
1668
|
}, assemblyName: string | undefined, opts: {
|
|
1686
|
-
|
|
1669
|
+
stopToken?: string;
|
|
1687
1670
|
sessionId: string;
|
|
1688
1671
|
}): Promise<{
|
|
1689
1672
|
[x: string]: string;
|
|
@@ -1718,9 +1701,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
1718
1701
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
1719
1702
|
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
1720
1703
|
[x: string]: any;
|
|
1721
|
-
} & import("mobx-state-tree/dist/internal"
|
|
1722
|
-
* #action
|
|
1723
|
-
*/).NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
1704
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
1724
1705
|
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
1725
1706
|
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>;
|
|
1726
1707
|
readonly adminMode: boolean;
|
|
@@ -1780,48 +1761,18 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
1780
1761
|
editConfiguration(configuration: import("@jbrowse/core/configuration").AnyConfigurationModel): void;
|
|
1781
1762
|
afterAttach(): void;
|
|
1782
1763
|
} & {
|
|
1783
|
-
/**
|
|
1784
|
-
* #action
|
|
1785
|
-
*/
|
|
1786
1764
|
moveViewDown(id: string): void;
|
|
1787
|
-
/**
|
|
1788
|
-
* #action
|
|
1789
|
-
*/
|
|
1790
1765
|
moveViewUp(id: string): void;
|
|
1791
|
-
/**
|
|
1792
|
-
* #action
|
|
1793
|
-
*/
|
|
1794
1766
|
moveViewToTop(id: string): void;
|
|
1795
|
-
/**
|
|
1796
|
-
* #action
|
|
1797
|
-
*/
|
|
1798
1767
|
moveViewToBottom(id: string): void;
|
|
1799
|
-
/**
|
|
1800
|
-
* #action
|
|
1801
|
-
*/
|
|
1802
1768
|
addView(typeName: string, initialState?: {}): any;
|
|
1803
|
-
/**
|
|
1804
|
-
* #action
|
|
1805
|
-
*/
|
|
1806
1769
|
removeView(view: IBaseViewModel): void;
|
|
1807
|
-
/**
|
|
1808
|
-
* #action
|
|
1809
|
-
*/
|
|
1810
1770
|
addLinearGenomeViewOfAssembly(assemblyName: string, initialState?: {}): any;
|
|
1811
|
-
/**
|
|
1812
|
-
* #action
|
|
1813
|
-
*/
|
|
1814
1771
|
addViewOfAssembly(viewType: string, assemblyName: string, initialState?: Record<string, unknown>): any;
|
|
1815
|
-
/**
|
|
1816
|
-
* #action
|
|
1817
|
-
*/
|
|
1818
1772
|
addViewFromAnotherView(viewType: string, otherView: IBaseViewModelWithDisplayedRegions, initialState?: {
|
|
1819
1773
|
displayedRegions?: Region[];
|
|
1820
1774
|
}): any;
|
|
1821
1775
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
1822
|
-
/** Session mixin MST type for a session that manages multiple views */
|
|
1823
1776
|
export type SessionWithMultipleViewsType = ReturnType<typeof MultipleViewsSessionMixin>;
|
|
1824
|
-
/** Instance of a session with multiple views */
|
|
1825
1777
|
export type SessionWithMultipleViews = Instance<SessionWithMultipleViewsType>;
|
|
1826
|
-
/** Type guard for SessionWithMultipleViews */
|
|
1827
1778
|
export declare function isSessionWithMultipleViews(session: IAnyStateTreeNode): session is SessionWithMultipleViews;
|
|
@@ -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 &&
|