@jbrowse/product-core 4.3.0 → 5.0.0-beta.2
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/esm/RootModel/BaseRootModel.d.ts +629 -304
- package/esm/RootModel/BaseRootModel.js +139 -14
- package/esm/RootModel/HierarchicalConfig.d.ts +57 -21
- package/esm/RootModel/HierarchicalConfig.js +36 -0
- package/esm/RootModel/InternetAccounts.d.ts +18 -1
- package/esm/RootModel/InternetAccounts.js +120 -22
- package/esm/RootModel/PreferencesConfig.d.ts +68 -0
- package/esm/RootModel/PreferencesConfig.js +76 -0
- package/esm/RootModel/createConfigModel.d.ts +240 -0
- package/esm/RootModel/createConfigModel.js +56 -0
- package/esm/RootModel/index.d.ts +10 -5
- package/esm/RootModel/index.js +10 -5
- package/esm/RootModel/menuItems.d.ts +24 -0
- package/esm/RootModel/menuItems.js +143 -0
- package/esm/Session/BaseSession.d.ts +312 -11
- package/esm/Session/BaseSession.js +458 -14
- package/esm/Session/Connections.d.ts +114 -8
- package/esm/Session/Connections.js +195 -74
- package/esm/Session/DrawerWidgets.d.ts +115 -12
- package/esm/Session/DrawerWidgets.js +161 -42
- package/esm/Session/MultipleViews.d.ts +1281 -1128
- package/esm/Session/MultipleViews.js +396 -64
- package/esm/Session/Preferences.d.ts +1667 -0
- package/esm/Session/Preferences.js +59 -0
- package/esm/Session/ReferenceManagement.d.ts +28 -3
- package/esm/Session/ReferenceManagement.js +56 -41
- package/esm/Session/SessionTracks.d.ts +1277 -1138
- package/esm/Session/SessionTracks.js +540 -35
- package/esm/Session/Themes.d.ts +87 -2
- package/esm/Session/Themes.js +156 -23
- package/esm/Session/TrackMenu.d.ts +112 -0
- package/esm/Session/TrackMenu.js +200 -0
- package/esm/Session/TrackMenuSessionMixin.d.ts +27 -0
- package/esm/Session/TrackMenuSessionMixin.js +41 -0
- package/esm/Session/Tracks.d.ts +1171 -1117
- package/esm/Session/Tracks.js +183 -20
- package/esm/Session/assertSessionModel.d.ts +21 -0
- package/esm/Session/assertSessionModel.js +1 -0
- package/esm/Session/developerMode.d.ts +7 -0
- package/esm/Session/developerMode.js +43 -0
- package/esm/Session/finalizeSession.d.ts +16 -0
- package/esm/Session/finalizeSession.js +29 -0
- package/esm/Session/index.d.ts +22 -10
- package/esm/Session/index.js +13 -10
- package/esm/Session/readdedTrackConf.d.ts +8 -0
- package/esm/Session/readdedTrackConf.js +25 -0
- package/esm/Session/shareableSnapshot.d.ts +77 -0
- package/esm/Session/shareableSnapshot.js +196 -0
- package/esm/Session/temporaryAssemblyTracks.d.ts +24 -0
- package/esm/Session/temporaryAssemblyTracks.js +37 -0
- package/esm/assertExtends.d.ts +55 -0
- package/esm/assertExtends.js +1 -0
- package/esm/controllerTracks.d.ts +56 -0
- package/esm/controllerTracks.js +90 -0
- package/esm/destroyViewState.d.ts +21 -0
- package/esm/destroyViewState.js +29 -0
- package/esm/index.d.ts +31 -4
- package/esm/index.js +31 -4
- package/esm/loadPlugins.d.ts +33 -0
- package/esm/loadPlugins.js +41 -0
- package/esm/localFiles.d.ts +74 -0
- package/esm/localFiles.js +156 -0
- package/esm/observeSession.d.ts +56 -0
- package/esm/observeSession.js +91 -0
- package/esm/pluginInput.d.ts +32 -0
- package/esm/pluginInput.js +19 -0
- package/esm/pruneUnbuildableNodes.d.ts +109 -0
- package/esm/pruneUnbuildableNodes.js +568 -0
- package/esm/resolveAssemblies.d.ts +44 -0
- package/esm/resolveAssemblies.js +55 -0
- package/esm/rpcWorker.d.ts +26 -0
- package/esm/rpcWorker.js +98 -16
- package/esm/scheduleDetachedDestroy.d.ts +18 -0
- package/esm/scheduleDetachedDestroy.js +24 -0
- package/esm/sessionMigrations/index.d.ts +53 -0
- package/esm/sessionMigrations/index.js +432 -0
- package/esm/sessionUrl.d.ts +41 -0
- package/esm/sessionUrl.js +53 -0
- package/esm/sessionUtils.d.ts +69 -0
- package/esm/sessionUtils.js +613 -0
- package/esm/siblingCast.d.ts +14 -0
- package/esm/siblingCast.js +16 -0
- package/esm/snapshotUtils.d.ts +8 -0
- package/esm/snapshotUtils.js +12 -0
- package/esm/ui/AboutDialog.d.ts +3 -6
- package/esm/ui/AboutDialog.js +4 -4
- package/esm/ui/AboutDialogContents.d.ts +2 -6
- package/esm/ui/AboutDialogContents.js +34 -13
- package/esm/ui/AssemblyInfoPanel.d.ts +5 -0
- package/esm/ui/AssemblyInfoPanel.js +69 -0
- package/esm/ui/DisplayDefaultsSection.d.ts +36 -0
- package/esm/ui/DisplayDefaultsSection.js +65 -0
- package/esm/ui/Drawer.d.ts +21 -0
- package/esm/ui/Drawer.js +60 -0
- package/esm/ui/DrawerControls.d.ts +5 -0
- package/esm/ui/DrawerControls.js +28 -0
- package/esm/ui/DrawerHeader.d.ts +6 -0
- package/esm/ui/DrawerHeader.js +36 -0
- package/esm/ui/DrawerWidget.d.ts +5 -0
- package/esm/ui/DrawerWidget.js +12 -0
- package/esm/ui/DrawerWidgetSelector.d.ts +5 -0
- package/esm/ui/DrawerWidgetSelector.js +40 -0
- package/esm/ui/FileInfoPanel.d.ts +3 -6
- package/esm/ui/FileInfoPanel.js +35 -26
- package/esm/ui/HeaderButtons.d.ts +7 -1
- package/esm/ui/HeaderButtons.js +23 -18
- package/esm/ui/ModalWidget.d.ts +12 -0
- package/esm/ui/ModalWidget.js +33 -0
- package/esm/ui/ModalWidgetAppBar.d.ts +8 -0
- package/esm/ui/ModalWidgetAppBar.js +9 -0
- package/esm/ui/PreferencesDialog.d.ts +56 -0
- package/esm/ui/PreferencesDialog.js +145 -0
- package/esm/ui/PreferencesResetDialog.d.ts +8 -0
- package/esm/ui/PreferencesResetDialog.js +19 -0
- package/esm/ui/RefNameAliasesDialog.d.ts +9 -0
- package/esm/ui/RefNameAliasesDialog.js +65 -0
- package/esm/ui/RefNameInfoDialog.d.ts +3 -6
- package/esm/ui/RefNameInfoDialog.js +57 -63
- package/esm/ui/WidgetBody.d.ts +18 -0
- package/esm/ui/WidgetBody.js +22 -0
- package/esm/ui/WidgetHeading.d.ts +7 -0
- package/esm/ui/WidgetHeading.js +7 -0
- package/esm/ui/drawerLayout.d.ts +18 -0
- package/esm/ui/drawerLayout.js +22 -0
- package/esm/ui/index.d.ts +13 -1
- package/esm/ui/index.js +12 -1
- package/esm/ui/util.d.ts +37 -4
- package/esm/ui/util.js +35 -38
- package/esm/useEngineLifecycle.d.ts +19 -0
- package/esm/useEngineLifecycle.js +44 -0
- package/package.json +12 -15
- package/esm/RootModel/FormatAbout.d.ts +0 -12
- package/esm/RootModel/FormatAbout.js +0 -15
- package/esm/RootModel/FormatDetails.d.ts +0 -24
- package/esm/RootModel/FormatDetails.js +0 -27
- package/esm/Session/DialogQueue.d.ts +0 -17
- package/esm/Session/DialogQueue.js +0 -31
|
@@ -1,90 +1,211 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { isBaseSession } from
|
|
1
|
+
import { getSnapshot, types } from '@jbrowse/mobx-state-tree';
|
|
2
|
+
import { asSession } from '../siblingCast.js';
|
|
3
|
+
import { isBaseSession } from './BaseSession.js';
|
|
4
|
+
/**
|
|
5
|
+
* #stateModel ConnectionManagementSessionMixin
|
|
6
|
+
*/
|
|
4
7
|
export function ConnectionManagementSessionMixin(pluginManager) {
|
|
5
8
|
return types
|
|
6
9
|
.model({
|
|
7
|
-
|
|
10
|
+
/**
|
|
11
|
+
* #property
|
|
12
|
+
*/
|
|
13
|
+
connectionInstances: types.stripDefault(types.array(pluginManager.pluggableMstType('connection', 'stateModel')), []),
|
|
14
|
+
/**
|
|
15
|
+
* #property
|
|
16
|
+
* Persisted configs of connection tracks the user has opened, keyed by
|
|
17
|
+
* trackId. Unlike `connectionInstances` (stripped from snapshots, holds
|
|
18
|
+
* the whole fetched hub), this holds only the tracks in use, so an open
|
|
19
|
+
* connection track resolves synchronously on session load without
|
|
20
|
+
* re-establishing the connection.
|
|
21
|
+
*/
|
|
22
|
+
connectionTrackConfigs: types.stripDefault(types.frozen(), {}),
|
|
8
23
|
})
|
|
9
24
|
.views(self => ({
|
|
25
|
+
/**
|
|
26
|
+
* #getter
|
|
27
|
+
*/
|
|
10
28
|
get connections() {
|
|
11
|
-
const { jbrowse } = self;
|
|
29
|
+
const { jbrowse } = asSession(self);
|
|
12
30
|
return jbrowse.connections;
|
|
13
31
|
},
|
|
14
32
|
}))
|
|
15
|
-
.actions(self =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
throw new Error('track configuration has no `type` listed');
|
|
20
|
-
}
|
|
21
|
-
const name = readConfObject(configuration, 'name');
|
|
22
|
-
const connectionType = pluginManager.getConnectionType(type);
|
|
23
|
-
if (!connectionType) {
|
|
24
|
-
throw new Error(`unknown connection type ${type}`);
|
|
25
|
-
}
|
|
26
|
-
const length = self.connectionInstances.push({
|
|
27
|
-
...initialSnapshot,
|
|
28
|
-
name,
|
|
29
|
-
type,
|
|
30
|
-
configuration,
|
|
31
|
-
});
|
|
32
|
-
return self.connectionInstances[length - 1];
|
|
33
|
-
},
|
|
34
|
-
prepareToBreakConnection(configuration) {
|
|
35
|
-
const root = self;
|
|
36
|
-
const callbacksToDeref = [];
|
|
37
|
-
const derefTypeCount = {};
|
|
38
|
-
const name = readConfObject(configuration, 'name');
|
|
39
|
-
const connection = self.connectionInstances.find(c => c.name === name);
|
|
40
|
-
if (!connection) {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
for (const track of connection.tracks) {
|
|
44
|
-
const ref = root.getReferring(track);
|
|
45
|
-
root.removeReferring(ref, track, callbacksToDeref, derefTypeCount);
|
|
46
|
-
}
|
|
47
|
-
return [
|
|
48
|
-
() => {
|
|
49
|
-
for (const cb of callbacksToDeref) {
|
|
50
|
-
cb();
|
|
51
|
-
}
|
|
52
|
-
this.breakConnection(configuration);
|
|
53
|
-
},
|
|
54
|
-
derefTypeCount,
|
|
55
|
-
];
|
|
56
|
-
},
|
|
57
|
-
breakConnection(configuration) {
|
|
58
|
-
const name = readConfObject(configuration, 'name');
|
|
59
|
-
const connection = self.connectionInstances.find(c => c.name === name);
|
|
60
|
-
if (!connection) {
|
|
61
|
-
throw new Error(`no connection found with name ${name}`);
|
|
62
|
-
}
|
|
63
|
-
self.connectionInstances.remove(connection);
|
|
64
|
-
},
|
|
65
|
-
deleteConnection(configuration) {
|
|
66
|
-
const { jbrowse } = self;
|
|
67
|
-
return jbrowse.deleteConnectionConf(configuration);
|
|
68
|
-
},
|
|
69
|
-
addConnectionConf(connectionConf) {
|
|
70
|
-
const { jbrowse } = self;
|
|
71
|
-
return jbrowse.addConnectionConf(connectionConf);
|
|
72
|
-
},
|
|
73
|
-
clearConnections() {
|
|
74
|
-
self.connectionInstances.clear();
|
|
75
|
-
},
|
|
76
|
-
}))
|
|
77
|
-
.postProcessSnapshot(snap => {
|
|
78
|
-
if (!snap) {
|
|
79
|
-
return snap;
|
|
80
|
-
}
|
|
81
|
-
const { connectionInstances, ...rest } = snap;
|
|
33
|
+
.actions(self => {
|
|
34
|
+
// this mixin is always composed onto a base session with a jbrowse config
|
|
35
|
+
// and reference-management helpers; alias once instead of re-casting self
|
|
36
|
+
const session = self;
|
|
82
37
|
return {
|
|
83
|
-
|
|
84
|
-
|
|
38
|
+
/**
|
|
39
|
+
* #action
|
|
40
|
+
*/
|
|
41
|
+
makeConnection(configuration, initialSnapshot = {}) {
|
|
42
|
+
const { type, connectionId } = configuration;
|
|
43
|
+
if (!type) {
|
|
44
|
+
throw new Error('connection configuration has no `type` listed');
|
|
45
|
+
}
|
|
46
|
+
const existing = self.connectionInstances.find(c => c.connectionId === connectionId);
|
|
47
|
+
if (existing) {
|
|
48
|
+
return existing;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const length = self.connectionInstances.push({
|
|
52
|
+
...initialSnapshot,
|
|
53
|
+
type,
|
|
54
|
+
configuration,
|
|
55
|
+
});
|
|
56
|
+
return self.connectionInstances[length - 1];
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* #action
|
|
61
|
+
* Remove a live connection instance. Tolerant of an already-dormant
|
|
62
|
+
* connection (its instance is stripped from the session on reload).
|
|
63
|
+
* Leaves persisted open-track configs alone — the connect() error path
|
|
64
|
+
* calls this and the user's already-open tracks must survive a transient
|
|
65
|
+
* failure. Full removal goes through `deleteConnection`.
|
|
66
|
+
*/
|
|
67
|
+
breakConnection(configuration) {
|
|
68
|
+
const { connectionId } = configuration;
|
|
69
|
+
const connection = self.connectionInstances.find(c => c.connectionId === connectionId);
|
|
70
|
+
if (connection) {
|
|
71
|
+
self.connectionInstances.remove(connection);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* #action
|
|
76
|
+
* Close every track a connection contributed — the live instance's
|
|
77
|
+
* tracks plus any persisted open-track configs (a dormant connection,
|
|
78
|
+
* never expanded this session, still renders its opened tracks from
|
|
79
|
+
* `connectionTrackConfigs`) — from all views/widgets, drop the live
|
|
80
|
+
* instance, and drop the persisted configs. The session is left as if the
|
|
81
|
+
* connection had never loaded.
|
|
82
|
+
*/
|
|
83
|
+
teardownConnection(configuration) {
|
|
84
|
+
const { connectionId } = configuration;
|
|
85
|
+
const connection = self.connectionInstances.find(c => c.connectionId === connectionId);
|
|
86
|
+
const trackIds = [
|
|
87
|
+
...new Set([
|
|
88
|
+
...(connection?.tracks.map((t) => t.trackId) ?? []),
|
|
89
|
+
...Object.entries(self.connectionTrackConfigs)
|
|
90
|
+
.filter(([, e]) => e.connectionId === connectionId)
|
|
91
|
+
.map(([trackId]) => trackId),
|
|
92
|
+
]),
|
|
93
|
+
];
|
|
94
|
+
const referring = session.getReferringMultiple(trackIds);
|
|
95
|
+
for (const trackId of trackIds) {
|
|
96
|
+
session.dereferenceTrack(trackId, referring.get(trackId) ?? []);
|
|
97
|
+
}
|
|
98
|
+
this.breakConnection(configuration);
|
|
99
|
+
// closing the tracks above prunes their configs via hideTrack; this
|
|
100
|
+
// mops up any orphaned entry that had no open view
|
|
101
|
+
const remaining = Object.fromEntries(Object.entries(self.connectionTrackConfigs).filter(([, e]) => e.connectionId !== connectionId));
|
|
102
|
+
if (Object.keys(remaining).length !==
|
|
103
|
+
Object.keys(self.connectionTrackConfigs).length) {
|
|
104
|
+
self.connectionTrackConfigs = remaining;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
* #action
|
|
109
|
+
* Fully remove a connection: tear down its tracks and live instance, then
|
|
110
|
+
* delete its config.
|
|
111
|
+
*/
|
|
112
|
+
deleteConnection(configuration) {
|
|
113
|
+
this.teardownConnection(configuration);
|
|
114
|
+
return session.jbrowse.deleteConnectionConf(configuration);
|
|
115
|
+
},
|
|
116
|
+
/**
|
|
117
|
+
* #action
|
|
118
|
+
* Adds to the **config**, not the session: `jbrowse.connections`, which
|
|
119
|
+
* every visitor to this instance loads. jbrowse-web overrides this so a
|
|
120
|
+
* non-admin's connection lands in `sessionConnections` instead — see
|
|
121
|
+
* WebSessionConnectionsMixin, whose `addSessionConnectionConf` is what
|
|
122
|
+
* to call when you mean the session specifically rather than "wherever
|
|
123
|
+
* this user's edits go".
|
|
124
|
+
*
|
|
125
|
+
* Applications without that override (Desktop, the embedded products)
|
|
126
|
+
* have only this one destination, and it is the right one there: their
|
|
127
|
+
* config and session are saved as a single document.
|
|
128
|
+
*/
|
|
129
|
+
addConnectionConf(connectionConf) {
|
|
130
|
+
return session.jbrowse.addConnectionConf(connectionConf);
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* #action
|
|
134
|
+
*/
|
|
135
|
+
clearConnections() {
|
|
136
|
+
self.connectionInstances.clear();
|
|
137
|
+
},
|
|
138
|
+
/**
|
|
139
|
+
* #action
|
|
140
|
+
* Snapshot a just-opened connection track's config into
|
|
141
|
+
* `connectionTrackConfigs` so it survives session reload. No-op if the
|
|
142
|
+
* track isn't connection-provided or is already captured (edits go
|
|
143
|
+
* through `updateConnectionTrackConfig`).
|
|
144
|
+
*/
|
|
145
|
+
captureConnectionTrack(trackId) {
|
|
146
|
+
if (!(trackId in self.connectionTrackConfigs)) {
|
|
147
|
+
for (const conn of self.connectionInstances) {
|
|
148
|
+
const track = conn.tracks.find((t) => t.trackId === trackId);
|
|
149
|
+
if (track) {
|
|
150
|
+
this.setConnectionTrackConfig(trackId, conn.connectionId, structuredClone(getSnapshot(track)));
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
/**
|
|
157
|
+
* #action
|
|
158
|
+
* Persist an edit to an opened connection track. The full config is
|
|
159
|
+
* stored (not a delta): the connection's fetched "base" isn't present at
|
|
160
|
+
* load, so only a complete config resolves synchronously.
|
|
161
|
+
*/
|
|
162
|
+
updateConnectionTrackConfig(trackConf) {
|
|
163
|
+
const existing = self.connectionTrackConfigs[trackConf.trackId];
|
|
164
|
+
if (existing) {
|
|
165
|
+
this.setConnectionTrackConfig(trackConf.trackId, existing.connectionId, trackConf);
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
/**
|
|
169
|
+
* #action
|
|
170
|
+
* Upsert one opened connection track's persisted config.
|
|
171
|
+
*/
|
|
172
|
+
setConnectionTrackConfig(trackId, connectionId, config) {
|
|
173
|
+
self.connectionTrackConfigs = {
|
|
174
|
+
...self.connectionTrackConfigs,
|
|
175
|
+
[trackId]: { connectionId, config },
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
/**
|
|
179
|
+
* #action
|
|
180
|
+
* Drop a connection track's persisted config once no open view still
|
|
181
|
+
* references it, so the session doesn't accumulate closed tracks.
|
|
182
|
+
*/
|
|
183
|
+
pruneConnectionTrackConfig(trackId) {
|
|
184
|
+
if (trackId in self.connectionTrackConfigs &&
|
|
185
|
+
session.getReferring(trackId).length === 0) {
|
|
186
|
+
const { [trackId]: _removed, ...rest } = self.connectionTrackConfigs;
|
|
187
|
+
self.connectionTrackConfigs = rest;
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
/**
|
|
191
|
+
* #action
|
|
192
|
+
* Lazily establish a single connection by id if it isn't already live —
|
|
193
|
+
* used when its category is expanded in the track selector. Fetches
|
|
194
|
+
* silently (no view launch / success snackbar); already-open tracks keep
|
|
195
|
+
* rendering from `connectionTrackConfigs` meanwhile. Idempotent.
|
|
196
|
+
*/
|
|
197
|
+
hydrateConnection(connectionId) {
|
|
198
|
+
// makeConnection is idempotent (returns the existing live instance if
|
|
199
|
+
// one matches), so no separate liveness check is needed
|
|
200
|
+
const conf = self.connections.find(c => c.connectionId === connectionId);
|
|
201
|
+
if (conf) {
|
|
202
|
+
this.makeConnection(conf, { silent: true });
|
|
203
|
+
}
|
|
204
|
+
},
|
|
85
205
|
};
|
|
86
206
|
});
|
|
87
207
|
}
|
|
208
|
+
/** Type guard for SessionWithConnections */
|
|
88
209
|
export function isSessionWithConnections(session) {
|
|
89
210
|
return isBaseSession(session) && 'connectionInstances' in session;
|
|
90
211
|
}
|
|
@@ -1,36 +1,139 @@
|
|
|
1
1
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { DrawerPosition, Widget } from '@jbrowse/core/util/types';
|
|
3
4
|
import type { IAnyStateTreeNode, Instance } from '@jbrowse/mobx-state-tree';
|
|
5
|
+
/**
|
|
6
|
+
* #stateModel DrawerWidgetSessionMixin
|
|
7
|
+
*/
|
|
4
8
|
export declare function DrawerWidgetSessionMixin(pluginManager: PluginManager): import("@jbrowse/mobx-state-tree").IModelType<{
|
|
5
|
-
|
|
9
|
+
/**
|
|
10
|
+
* #property
|
|
11
|
+
*/
|
|
12
|
+
drawerPosition: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<DrawerPosition>, [undefined]>;
|
|
13
|
+
/**
|
|
14
|
+
* #property
|
|
15
|
+
*/
|
|
6
16
|
drawerWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
7
|
-
|
|
8
|
-
|
|
17
|
+
/**
|
|
18
|
+
* #property
|
|
19
|
+
*/
|
|
20
|
+
widgets: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IAnyType>, [undefined]>;
|
|
21
|
+
/**
|
|
22
|
+
* #property
|
|
23
|
+
*/
|
|
24
|
+
activeWidgets: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").IReferenceType<import("@jbrowse/mobx-state-tree").IAnyType>>>, [undefined]>;
|
|
25
|
+
/**
|
|
26
|
+
* #property
|
|
27
|
+
*/
|
|
9
28
|
minimized: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
10
29
|
}, {
|
|
11
|
-
|
|
30
|
+
/**
|
|
31
|
+
* #getter
|
|
32
|
+
*/
|
|
33
|
+
readonly visibleWidget: Widget | undefined;
|
|
12
34
|
} & {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
35
|
+
/**
|
|
36
|
+
* #volatile
|
|
37
|
+
* true while the visible widget is shown in a modal dialog instead of the
|
|
38
|
+
* drawer. Volatile because a restored session that opened straight into a
|
|
39
|
+
* modal, with no drawer behind it, is disorienting
|
|
40
|
+
*/
|
|
41
|
+
poppedOut: boolean;
|
|
42
|
+
} & {
|
|
43
|
+
/**
|
|
44
|
+
* #getter
|
|
45
|
+
* whether the drawer column is on screen: there is something to show, it
|
|
46
|
+
* is not minimized to the FAB, and it is not currently a modal instead.
|
|
47
|
+
*
|
|
48
|
+
* A getter rather than each host's own `&&`, because the hosts drifted --
|
|
49
|
+
* the app shell tested `poppedOut` and the embedded view did not, so the
|
|
50
|
+
* day a popout button reaches the embedded drawer header it would render
|
|
51
|
+
* the modal and the drawer at once.
|
|
52
|
+
*/
|
|
53
|
+
readonly drawerVisible: boolean;
|
|
54
|
+
} & {
|
|
55
|
+
/**
|
|
56
|
+
* #action
|
|
57
|
+
*/
|
|
58
|
+
setDrawerPosition(arg: DrawerPosition): void;
|
|
59
|
+
/**
|
|
60
|
+
* #action
|
|
61
|
+
*/
|
|
62
|
+
updateDrawerWidth(drawerWidth: number, availableWidth?: number): number;
|
|
63
|
+
/**
|
|
64
|
+
* #action
|
|
65
|
+
*/
|
|
66
|
+
resizeDrawer(distance: number, availableWidth?: number): number;
|
|
67
|
+
/**
|
|
68
|
+
* #action
|
|
69
|
+
*/
|
|
70
|
+
addWidget(typeName: string, id: string, initialState?: any, conf?: unknown): any;
|
|
71
|
+
/**
|
|
72
|
+
* #action
|
|
73
|
+
*/
|
|
17
74
|
showWidget(widget: any): void;
|
|
18
|
-
|
|
75
|
+
/**
|
|
76
|
+
* #action
|
|
77
|
+
*/
|
|
19
78
|
hideWidget(widget: any): void;
|
|
79
|
+
/**
|
|
80
|
+
* #action
|
|
81
|
+
*/
|
|
20
82
|
minimizeWidgetDrawer(): void;
|
|
83
|
+
/**
|
|
84
|
+
* #action
|
|
85
|
+
*/
|
|
21
86
|
showWidgetDrawer(): void;
|
|
87
|
+
/**
|
|
88
|
+
* #action
|
|
89
|
+
* show the visible widget in a modal dialog, freeing the drawer column
|
|
90
|
+
*/
|
|
91
|
+
popoutWidget(): void;
|
|
92
|
+
/**
|
|
93
|
+
* #action
|
|
94
|
+
*/
|
|
95
|
+
returnWidgetToDrawer(): void;
|
|
96
|
+
/**
|
|
97
|
+
* #action
|
|
98
|
+
*/
|
|
22
99
|
hideAllWidgets(): void;
|
|
100
|
+
/**
|
|
101
|
+
* #action
|
|
102
|
+
* opens a configuration editor to configure the given thing,
|
|
103
|
+
* and sets the current task to be configuring it
|
|
104
|
+
* @param configuration - can be an MST model or a frozen/plain object with trackId
|
|
105
|
+
*/
|
|
23
106
|
editConfiguration(configuration: AnyConfigurationModel | {
|
|
24
107
|
trackId: string;
|
|
108
|
+
}, opts?: {
|
|
109
|
+
expandedDisplayId?: string;
|
|
25
110
|
}): void;
|
|
26
111
|
afterAttach(): void;
|
|
27
112
|
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree").ModelSnapshotType<{
|
|
28
|
-
|
|
113
|
+
/**
|
|
114
|
+
* #property
|
|
115
|
+
*/
|
|
116
|
+
drawerPosition: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<DrawerPosition>, [undefined]>;
|
|
117
|
+
/**
|
|
118
|
+
* #property
|
|
119
|
+
*/
|
|
29
120
|
drawerWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
30
|
-
|
|
31
|
-
|
|
121
|
+
/**
|
|
122
|
+
* #property
|
|
123
|
+
*/
|
|
124
|
+
widgets: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IAnyType>, [undefined]>;
|
|
125
|
+
/**
|
|
126
|
+
* #property
|
|
127
|
+
*/
|
|
128
|
+
activeWidgets: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").IReferenceType<import("@jbrowse/mobx-state-tree").IAnyType>>>, [undefined]>;
|
|
129
|
+
/**
|
|
130
|
+
* #property
|
|
131
|
+
*/
|
|
32
132
|
minimized: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
33
133
|
}>>;
|
|
134
|
+
/** Session mixin MST type for a session that manages drawer widgets */
|
|
34
135
|
export type SessionWithDrawerWidgetsType = ReturnType<typeof DrawerWidgetSessionMixin>;
|
|
136
|
+
/** Instance of a session that manages drawer widgets */
|
|
35
137
|
export type SessionWithDrawerWidgets = Instance<SessionWithDrawerWidgetsType>;
|
|
138
|
+
/** Type guard for SessionWithDrawerWidgets */
|
|
36
139
|
export declare function isSessionWithDrawerWidgets(session: IAnyStateTreeNode): session is SessionWithDrawerWidgets;
|