@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
|
@@ -3,123 +3,61 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseSessionModel = BaseSessionModel;
|
|
4
4
|
exports.isBaseSession = isBaseSession;
|
|
5
5
|
exports.isSession = isSession;
|
|
6
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
7
6
|
const mst_1 = require("@jbrowse/core/util/types/mst");
|
|
8
|
-
|
|
9
|
-
* #stateModel BaseSessionModel
|
|
10
|
-
*
|
|
11
|
-
* base session shared by all JBrowse products. Be careful what you include
|
|
12
|
-
* here, everything will use it.
|
|
13
|
-
*/
|
|
7
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
14
8
|
function BaseSessionModel(_pluginManager) {
|
|
15
9
|
return mobx_state_tree_1.types
|
|
16
10
|
.model({
|
|
17
|
-
/**
|
|
18
|
-
* #property
|
|
19
|
-
*/
|
|
20
11
|
id: mst_1.ElementId,
|
|
21
|
-
/**
|
|
22
|
-
* #property
|
|
23
|
-
*/
|
|
24
12
|
name: mobx_state_tree_1.types.string,
|
|
25
|
-
/**
|
|
26
|
-
* #property
|
|
27
|
-
*/
|
|
28
13
|
margin: 0,
|
|
29
14
|
})
|
|
30
15
|
.volatile(() => ({
|
|
31
|
-
/**
|
|
32
|
-
* #volatile
|
|
33
|
-
* this is the globally "selected" object. can be anything. code that
|
|
34
|
-
* wants to deal with this should examine it to see what kind of thing it
|
|
35
|
-
* is.
|
|
36
|
-
*/
|
|
37
16
|
selection: undefined,
|
|
38
|
-
/**
|
|
39
|
-
* #volatile
|
|
40
|
-
* this is the globally "hovered" object. can be anything. code that
|
|
41
|
-
* wants to deal with this should examine it to see what kind of thing it
|
|
42
|
-
* is.
|
|
43
|
-
*/
|
|
44
17
|
hovered: undefined,
|
|
45
18
|
}))
|
|
46
19
|
.views(self => ({
|
|
47
|
-
/**
|
|
48
|
-
* #getter
|
|
49
|
-
*/
|
|
50
20
|
get root() {
|
|
51
21
|
return (0, mobx_state_tree_1.getParent)(self);
|
|
52
22
|
},
|
|
53
23
|
}))
|
|
54
24
|
.views(self => ({
|
|
55
|
-
/**
|
|
56
|
-
* #getter
|
|
57
|
-
*/
|
|
58
25
|
get jbrowse() {
|
|
59
26
|
return self.root.jbrowse;
|
|
60
27
|
},
|
|
61
|
-
/**
|
|
62
|
-
* #getter
|
|
63
|
-
*/
|
|
64
28
|
get rpcManager() {
|
|
65
29
|
return self.root.rpcManager;
|
|
66
30
|
},
|
|
67
|
-
/**
|
|
68
|
-
* #getter
|
|
69
|
-
*/
|
|
70
31
|
get configuration() {
|
|
71
32
|
return this.jbrowse.configuration;
|
|
72
33
|
},
|
|
73
|
-
/**
|
|
74
|
-
* #getter
|
|
75
|
-
*/
|
|
76
34
|
get adminMode() {
|
|
77
35
|
return self.root.adminMode;
|
|
78
36
|
},
|
|
79
|
-
/**
|
|
80
|
-
* #getter
|
|
81
|
-
*/
|
|
82
37
|
get textSearchManager() {
|
|
83
38
|
return self.root.textSearchManager;
|
|
84
39
|
},
|
|
85
40
|
}))
|
|
86
41
|
.views(self => ({
|
|
87
|
-
/**
|
|
88
|
-
* #getter
|
|
89
|
-
*/
|
|
90
42
|
get assemblies() {
|
|
91
43
|
return self.jbrowse.assemblies;
|
|
92
44
|
},
|
|
93
45
|
}))
|
|
94
46
|
.actions(self => ({
|
|
95
|
-
/**
|
|
96
|
-
* #action
|
|
97
|
-
* set the global selection, i.e. the globally-selected object. can be a
|
|
98
|
-
* feature, a view, just about anything
|
|
99
|
-
*/
|
|
100
47
|
setSelection(thing) {
|
|
101
48
|
self.selection = thing;
|
|
102
49
|
},
|
|
103
|
-
/**
|
|
104
|
-
* #action
|
|
105
|
-
* clears the global selection
|
|
106
|
-
*/
|
|
107
50
|
clearSelection() {
|
|
108
51
|
self.selection = undefined;
|
|
109
52
|
},
|
|
110
|
-
/**
|
|
111
|
-
* #action
|
|
112
|
-
*/
|
|
113
53
|
setHovered(thing) {
|
|
114
54
|
self.hovered = thing;
|
|
115
55
|
},
|
|
116
56
|
}));
|
|
117
57
|
}
|
|
118
|
-
/** Type guard for BaseSession */
|
|
119
58
|
function isBaseSession(thing) {
|
|
120
59
|
return 'id' in thing && 'name' in thing && 'root' in thing;
|
|
121
60
|
}
|
|
122
|
-
/** Type guard for whether a thing is JBrowse session */
|
|
123
61
|
function isSession(thing) {
|
|
124
62
|
return (0, mobx_state_tree_1.isStateTreeNode)(thing) && isBaseSession(thing);
|
|
125
63
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
* #stateModel ConnectionManagementSessionMixin
|
|
6
|
-
*/
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { BaseConnectionConfigModel } from '@jbrowse/core/pluggableElementTypes/models/baseConnectionConfig';
|
|
4
|
+
import type { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
|
|
7
5
|
export declare function ConnectionManagementSessionMixin(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
8
|
-
/**
|
|
9
|
-
* #property
|
|
10
|
-
*/
|
|
11
6
|
connectionInstances: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
12
7
|
name: import("mobx-state-tree").ISimpleType<string>;
|
|
13
8
|
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
@@ -53,35 +48,8 @@ export declare function ConnectionManagementSessionMixin(pluginManager: PluginMa
|
|
|
53
48
|
clear(): void;
|
|
54
49
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
55
50
|
}, {
|
|
56
|
-
|
|
57
|
-
* #getter
|
|
58
|
-
*/
|
|
59
|
-
readonly connections: ({
|
|
60
|
-
[x: string]: any;
|
|
61
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
62
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
63
|
-
[x: string]: any;
|
|
64
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
65
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
66
|
-
[x: string]: any;
|
|
67
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
68
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
69
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
70
|
-
name: {
|
|
71
|
-
type: string;
|
|
72
|
-
defaultValue: string;
|
|
73
|
-
description: string;
|
|
74
|
-
};
|
|
75
|
-
assemblyNames: {
|
|
76
|
-
type: string;
|
|
77
|
-
defaultValue: never[];
|
|
78
|
-
description: string;
|
|
79
|
-
};
|
|
80
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>>)[];
|
|
51
|
+
readonly connections: BaseConnectionConfigModel[];
|
|
81
52
|
} & {
|
|
82
|
-
/**
|
|
83
|
-
* #action
|
|
84
|
-
*/
|
|
85
53
|
makeConnection(configuration: AnyConfigurationModel, initialSnapshot?: {}): ({
|
|
86
54
|
name: string;
|
|
87
55
|
tracks: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IAnyModelType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>>;
|
|
@@ -179,31 +147,12 @@ export declare function ConnectionManagementSessionMixin(pluginManager: PluginMa
|
|
|
179
147
|
setTrackConfs(trackConfs: AnyConfigurationModel[]): void;
|
|
180
148
|
clear(): void;
|
|
181
149
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>) | undefined;
|
|
182
|
-
/**
|
|
183
|
-
* #action
|
|
184
|
-
*/
|
|
185
150
|
prepareToBreakConnection(configuration: AnyConfigurationModel): (Record<string, number> | (() => void))[] | undefined;
|
|
186
|
-
/**
|
|
187
|
-
* #action
|
|
188
|
-
*/
|
|
189
151
|
breakConnection(configuration: AnyConfigurationModel): void;
|
|
190
|
-
/**
|
|
191
|
-
* #action
|
|
192
|
-
*/
|
|
193
152
|
deleteConnection(configuration: AnyConfigurationModel): any;
|
|
194
|
-
/**
|
|
195
|
-
* #action
|
|
196
|
-
*/
|
|
197
153
|
addConnectionConf(connectionConf: AnyConfigurationModel): any;
|
|
198
|
-
/**
|
|
199
|
-
* #action
|
|
200
|
-
*/
|
|
201
154
|
clearConnections(): void;
|
|
202
155
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
203
|
-
/** Session mixin MST type for a session that has connections */
|
|
204
156
|
export type SessionWithConnectionsType = ReturnType<typeof ConnectionManagementSessionMixin>;
|
|
205
|
-
/** Instance of a session that has connections: `connectionInstances`,
|
|
206
|
-
* `makeConnection()`, etc. */
|
|
207
157
|
export type SessionWithConnections = Instance<SessionWithConnectionsType>;
|
|
208
|
-
/** Type guard for SessionWithConnections */
|
|
209
158
|
export declare function isSessionWithConnections(session: IAnyStateTreeNode): session is SessionWithConnections;
|
|
@@ -5,30 +5,18 @@ exports.isSessionWithConnections = isSessionWithConnections;
|
|
|
5
5
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
6
6
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
7
7
|
const BaseSession_1 = require("./BaseSession");
|
|
8
|
-
/**
|
|
9
|
-
* #stateModel ConnectionManagementSessionMixin
|
|
10
|
-
*/
|
|
11
8
|
function ConnectionManagementSessionMixin(pluginManager) {
|
|
12
9
|
return mobx_state_tree_1.types
|
|
13
10
|
.model({
|
|
14
|
-
/**
|
|
15
|
-
* #property
|
|
16
|
-
*/
|
|
17
11
|
connectionInstances: mobx_state_tree_1.types.array(pluginManager.pluggableMstType('connection', 'stateModel')),
|
|
18
12
|
})
|
|
19
13
|
.views(self => ({
|
|
20
|
-
/**
|
|
21
|
-
* #getter
|
|
22
|
-
*/
|
|
23
14
|
get connections() {
|
|
24
15
|
const { jbrowse } = self;
|
|
25
16
|
return jbrowse.connections;
|
|
26
17
|
},
|
|
27
18
|
}))
|
|
28
19
|
.actions(self => ({
|
|
29
|
-
/**
|
|
30
|
-
* #action
|
|
31
|
-
*/
|
|
32
20
|
makeConnection(configuration, initialSnapshot = {}) {
|
|
33
21
|
const type = configuration.type;
|
|
34
22
|
if (!type) {
|
|
@@ -42,16 +30,11 @@ function ConnectionManagementSessionMixin(pluginManager) {
|
|
|
42
30
|
const length = self.connectionInstances.push({
|
|
43
31
|
...initialSnapshot,
|
|
44
32
|
name,
|
|
45
|
-
// @ts-expect-error unsure why ts doesn't like `type` here, but is
|
|
46
|
-
// needed
|
|
47
33
|
type,
|
|
48
34
|
configuration,
|
|
49
35
|
});
|
|
50
36
|
return self.connectionInstances[length - 1];
|
|
51
37
|
},
|
|
52
|
-
/**
|
|
53
|
-
* #action
|
|
54
|
-
*/
|
|
55
38
|
prepareToBreakConnection(configuration) {
|
|
56
39
|
const root = self;
|
|
57
40
|
const callbacksToDeref = [];
|
|
@@ -75,9 +58,6 @@ function ConnectionManagementSessionMixin(pluginManager) {
|
|
|
75
58
|
derefTypeCount,
|
|
76
59
|
];
|
|
77
60
|
},
|
|
78
|
-
/**
|
|
79
|
-
* #action
|
|
80
|
-
*/
|
|
81
61
|
breakConnection(configuration) {
|
|
82
62
|
const name = (0, configuration_1.readConfObject)(configuration, 'name');
|
|
83
63
|
const connection = self.connectionInstances.find(c => c.name === name);
|
|
@@ -86,29 +66,19 @@ function ConnectionManagementSessionMixin(pluginManager) {
|
|
|
86
66
|
}
|
|
87
67
|
self.connectionInstances.remove(connection);
|
|
88
68
|
},
|
|
89
|
-
/**
|
|
90
|
-
* #action
|
|
91
|
-
*/
|
|
92
69
|
deleteConnection(configuration) {
|
|
93
70
|
const { jbrowse } = self;
|
|
94
71
|
return jbrowse.deleteConnectionConf(configuration);
|
|
95
72
|
},
|
|
96
|
-
/**
|
|
97
|
-
* #action
|
|
98
|
-
*/
|
|
99
73
|
addConnectionConf(connectionConf) {
|
|
100
74
|
const { jbrowse } = self;
|
|
101
75
|
return jbrowse.addConnectionConf(connectionConf);
|
|
102
76
|
},
|
|
103
|
-
/**
|
|
104
|
-
* #action
|
|
105
|
-
*/
|
|
106
77
|
clearConnections() {
|
|
107
78
|
self.connectionInstances.clear();
|
|
108
79
|
},
|
|
109
80
|
}));
|
|
110
81
|
}
|
|
111
|
-
/** Type guard for SessionWithConnections */
|
|
112
82
|
function isSessionWithConnections(session) {
|
|
113
83
|
return (0, BaseSession_1.isBaseSession)(session) && 'connectionInstances' in session;
|
|
114
84
|
}
|
|
@@ -1,34 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
|
|
5
|
-
/**
|
|
6
|
-
* #stateModel DialogQueueSessionMixin
|
|
7
|
-
*/
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type { DialogComponentType } from '@jbrowse/core/util';
|
|
3
|
+
import type { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
|
|
8
4
|
export declare function DialogQueueSessionMixin(_pluginManager: PluginManager): import("mobx-state-tree").IModelType<{}, {
|
|
9
5
|
queueOfDialogs: [DialogComponentType, unknown][];
|
|
10
6
|
} & {
|
|
11
|
-
/**
|
|
12
|
-
* #getter
|
|
13
|
-
*/
|
|
14
7
|
readonly DialogComponent: DialogComponentType | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* #getter
|
|
17
|
-
*/
|
|
18
8
|
readonly DialogProps: unknown;
|
|
19
9
|
} & {
|
|
20
|
-
/**
|
|
21
|
-
* #action
|
|
22
|
-
*/
|
|
23
10
|
removeActiveDialog(): void;
|
|
24
|
-
/**
|
|
25
|
-
* #action
|
|
26
|
-
*/
|
|
27
11
|
queueDialog(cb: (doneCallback: () => void) => [DialogComponentType, unknown]): void;
|
|
28
12
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
29
|
-
/** Session mixin MST type for a session that has `queueOfDialogs`, etc. */
|
|
30
13
|
export type SessionWithDialogsType = ReturnType<typeof DialogQueueSessionMixin>;
|
|
31
|
-
/** Instance of a session that has dialogs */
|
|
32
14
|
export type SessionWithDialogs = Instance<SessionWithDialogsType>;
|
|
33
|
-
/** Type guard for SessionWithDialogs */
|
|
34
15
|
export declare function isSessionWithDialogs(session: IAnyStateTreeNode): session is SessionWithDialogs;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/** MST mixin for managing a queue of dialogs at the level of the session */
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.DialogQueueSessionMixin = DialogQueueSessionMixin;
|
|
5
4
|
exports.isSessionWithDialogs = isSessionWithDialogs;
|
|
6
5
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
7
6
|
const BaseSession_1 = require("./BaseSession");
|
|
8
|
-
/**
|
|
9
|
-
* #stateModel DialogQueueSessionMixin
|
|
10
|
-
*/
|
|
11
7
|
function DialogQueueSessionMixin(_pluginManager) {
|
|
12
8
|
return mobx_state_tree_1.types
|
|
13
9
|
.model('DialogQueueSessionMixin', {})
|
|
@@ -15,31 +11,19 @@ function DialogQueueSessionMixin(_pluginManager) {
|
|
|
15
11
|
queueOfDialogs: [],
|
|
16
12
|
}))
|
|
17
13
|
.views(self => ({
|
|
18
|
-
/**
|
|
19
|
-
* #getter
|
|
20
|
-
*/
|
|
21
14
|
get DialogComponent() {
|
|
22
15
|
var _a;
|
|
23
16
|
return (_a = self.queueOfDialogs[0]) === null || _a === void 0 ? void 0 : _a[0];
|
|
24
17
|
},
|
|
25
|
-
/**
|
|
26
|
-
* #getter
|
|
27
|
-
*/
|
|
28
18
|
get DialogProps() {
|
|
29
19
|
var _a;
|
|
30
20
|
return (_a = self.queueOfDialogs[0]) === null || _a === void 0 ? void 0 : _a[1];
|
|
31
21
|
},
|
|
32
22
|
}))
|
|
33
23
|
.actions(self => ({
|
|
34
|
-
/**
|
|
35
|
-
* #action
|
|
36
|
-
*/
|
|
37
24
|
removeActiveDialog() {
|
|
38
25
|
self.queueOfDialogs = self.queueOfDialogs.slice(1);
|
|
39
26
|
},
|
|
40
|
-
/**
|
|
41
|
-
* #action
|
|
42
|
-
*/
|
|
43
27
|
queueDialog(cb) {
|
|
44
28
|
const [component, props] = cb(() => {
|
|
45
29
|
this.removeActiveDialog();
|
|
@@ -48,7 +32,6 @@ function DialogQueueSessionMixin(_pluginManager) {
|
|
|
48
32
|
},
|
|
49
33
|
}));
|
|
50
34
|
}
|
|
51
|
-
/** Type guard for SessionWithDialogs */
|
|
52
35
|
function isSessionWithDialogs(session) {
|
|
53
36
|
return (0, BaseSession_1.isBaseSession)(session) && 'queueOfDialogs' in session;
|
|
54
37
|
}
|
|
@@ -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;
|
|
@@ -2,63 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DrawerWidgetSessionMixin = DrawerWidgetSessionMixin;
|
|
4
4
|
exports.isSessionWithDrawerWidgets = isSessionWithDrawerWidgets;
|
|
5
|
-
const
|
|
5
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
6
6
|
const util_1 = require("@jbrowse/core/util");
|
|
7
7
|
const mobx_1 = require("mobx");
|
|
8
|
-
const
|
|
8
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
9
9
|
const BaseSession_1 = require("./BaseSession");
|
|
10
10
|
const minDrawerWidth = 128;
|
|
11
|
-
/**
|
|
12
|
-
* #stateModel DrawerWidgetSessionMixin
|
|
13
|
-
*/
|
|
14
11
|
function DrawerWidgetSessionMixin(pluginManager) {
|
|
15
12
|
const widgetStateModelType = pluginManager.pluggableMstType('widget', 'stateModel');
|
|
16
13
|
return mobx_state_tree_1.types
|
|
17
14
|
.model({
|
|
18
|
-
/**
|
|
19
|
-
* #property
|
|
20
|
-
*/
|
|
21
15
|
drawerPosition: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, () => (0, util_1.localStorageGetItem)('drawerPosition') || 'right'),
|
|
22
|
-
/**
|
|
23
|
-
* #property
|
|
24
|
-
*/
|
|
25
16
|
drawerWidth: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.refinement(mobx_state_tree_1.types.integer, width => width >= minDrawerWidth), 384),
|
|
26
|
-
/**
|
|
27
|
-
* #property
|
|
28
|
-
*/
|
|
29
17
|
widgets: mobx_state_tree_1.types.map(widgetStateModelType),
|
|
30
|
-
/**
|
|
31
|
-
* #property
|
|
32
|
-
*/
|
|
33
18
|
activeWidgets: mobx_state_tree_1.types.map(mobx_state_tree_1.types.safeReference(widgetStateModelType)),
|
|
34
|
-
/**
|
|
35
|
-
* #property
|
|
36
|
-
*/
|
|
37
19
|
minimized: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.boolean, false),
|
|
38
20
|
})
|
|
39
21
|
.views(self => ({
|
|
40
|
-
/**
|
|
41
|
-
* #getter
|
|
42
|
-
*/
|
|
43
22
|
get visibleWidget() {
|
|
44
23
|
if ((0, mobx_state_tree_1.isAlive)(self)) {
|
|
45
|
-
// returns most recently added item in active widgets
|
|
46
24
|
return [...self.activeWidgets.values()][self.activeWidgets.size - 1];
|
|
47
25
|
}
|
|
48
26
|
return undefined;
|
|
49
27
|
},
|
|
50
28
|
}))
|
|
51
29
|
.actions(self => ({
|
|
52
|
-
/**
|
|
53
|
-
* #action
|
|
54
|
-
*/
|
|
55
30
|
setDrawerPosition(arg) {
|
|
56
31
|
self.drawerPosition = arg;
|
|
57
32
|
localStorage.setItem('drawerPosition', arg);
|
|
58
33
|
},
|
|
59
|
-
/**
|
|
60
|
-
* #action
|
|
61
|
-
*/
|
|
62
34
|
updateDrawerWidth(drawerWidth) {
|
|
63
35
|
if (drawerWidth === self.drawerWidth) {
|
|
64
36
|
return self.drawerWidth;
|
|
@@ -70,9 +42,6 @@ function DrawerWidgetSessionMixin(pluginManager) {
|
|
|
70
42
|
self.drawerWidth = newDrawerWidth;
|
|
71
43
|
return newDrawerWidth;
|
|
72
44
|
},
|
|
73
|
-
/**
|
|
74
|
-
* #action
|
|
75
|
-
*/
|
|
76
45
|
resizeDrawer(distance) {
|
|
77
46
|
if (self.drawerPosition === 'left') {
|
|
78
47
|
distance *= -1;
|
|
@@ -81,9 +50,6 @@ function DrawerWidgetSessionMixin(pluginManager) {
|
|
|
81
50
|
const newDrawerWidth = this.updateDrawerWidth(oldDrawerWidth - distance);
|
|
82
51
|
return oldDrawerWidth - newDrawerWidth;
|
|
83
52
|
},
|
|
84
|
-
/**
|
|
85
|
-
* #action
|
|
86
|
-
*/
|
|
87
53
|
addWidget(typeName, id, initialState = {}, conf) {
|
|
88
54
|
const typeDefinition = pluginManager.getElementType('widget', typeName);
|
|
89
55
|
if (!typeDefinition) {
|
|
@@ -98,9 +64,6 @@ function DrawerWidgetSessionMixin(pluginManager) {
|
|
|
98
64
|
self.widgets.set(id, data);
|
|
99
65
|
return self.widgets.get(id);
|
|
100
66
|
},
|
|
101
|
-
/**
|
|
102
|
-
* #action
|
|
103
|
-
*/
|
|
104
67
|
showWidget(widget) {
|
|
105
68
|
if (self.activeWidgets.has(widget.id)) {
|
|
106
69
|
self.activeWidgets.delete(widget.id);
|
|
@@ -108,42 +71,21 @@ function DrawerWidgetSessionMixin(pluginManager) {
|
|
|
108
71
|
self.activeWidgets.set(widget.id, widget);
|
|
109
72
|
self.minimized = false;
|
|
110
73
|
},
|
|
111
|
-
/**
|
|
112
|
-
* #action
|
|
113
|
-
*/
|
|
114
74
|
hasWidget(widget) {
|
|
115
75
|
return self.activeWidgets.has(widget.id);
|
|
116
76
|
},
|
|
117
|
-
/**
|
|
118
|
-
* #action
|
|
119
|
-
*/
|
|
120
77
|
hideWidget(widget) {
|
|
121
78
|
self.activeWidgets.delete(widget.id);
|
|
122
79
|
},
|
|
123
|
-
/**
|
|
124
|
-
* #action
|
|
125
|
-
*/
|
|
126
80
|
minimizeWidgetDrawer() {
|
|
127
81
|
self.minimized = true;
|
|
128
82
|
},
|
|
129
|
-
/**
|
|
130
|
-
* #action
|
|
131
|
-
*/
|
|
132
83
|
showWidgetDrawer() {
|
|
133
84
|
self.minimized = false;
|
|
134
85
|
},
|
|
135
|
-
/**
|
|
136
|
-
* #action
|
|
137
|
-
*/
|
|
138
86
|
hideAllWidgets() {
|
|
139
87
|
self.activeWidgets.clear();
|
|
140
88
|
},
|
|
141
|
-
/**
|
|
142
|
-
* #action
|
|
143
|
-
* opens a configuration editor to configure the given thing,
|
|
144
|
-
* and sets the current task to be configuring it
|
|
145
|
-
* @param configuration -
|
|
146
|
-
*/
|
|
147
89
|
editConfiguration(configuration) {
|
|
148
90
|
if (!(0, configuration_1.isConfigurationModel)(configuration)) {
|
|
149
91
|
throw new Error('must pass a configuration model to editConfiguration');
|
|
@@ -158,7 +100,6 @@ function DrawerWidgetSessionMixin(pluginManager) {
|
|
|
158
100
|
},
|
|
159
101
|
}));
|
|
160
102
|
}
|
|
161
|
-
/** Type guard for SessionWithDrawerWidgets */
|
|
162
103
|
function isSessionWithDrawerWidgets(session) {
|
|
163
104
|
return ((0, BaseSession_1.isBaseSession)(session) &&
|
|
164
105
|
'widgets' in session &&
|