@jbrowse/product-core 4.3.0 → 5.0.0-beta.10

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.
Files changed (157) hide show
  1. package/esm/RootModel/BaseRootModel.d.ts +514 -323
  2. package/esm/RootModel/BaseRootModel.js +141 -14
  3. package/esm/RootModel/HierarchicalConfig.d.ts +30 -20
  4. package/esm/RootModel/HierarchicalConfig.js +36 -0
  5. package/esm/RootModel/InternetAccounts.d.ts +18 -1
  6. package/esm/RootModel/InternetAccounts.js +120 -22
  7. package/esm/RootModel/PreferencesConfig.d.ts +37 -0
  8. package/esm/RootModel/PreferencesConfig.js +75 -0
  9. package/esm/RootModel/createConfigModel.d.ts +257 -0
  10. package/esm/RootModel/createConfigModel.js +77 -0
  11. package/esm/RootModel/index.d.ts +10 -5
  12. package/esm/RootModel/index.js +10 -5
  13. package/esm/RootModel/menuItems.d.ts +24 -0
  14. package/esm/RootModel/menuItems.js +141 -0
  15. package/esm/Session/BaseSession.d.ts +285 -11
  16. package/esm/Session/BaseSession.js +383 -15
  17. package/esm/Session/Connections.d.ts +115 -8
  18. package/esm/Session/Connections.js +196 -74
  19. package/esm/Session/DrawerWidgets.d.ts +145 -13
  20. package/esm/Session/DrawerWidgets.js +219 -49
  21. package/esm/Session/MultipleViews.d.ts +1067 -1177
  22. package/esm/Session/MultipleViews.js +395 -64
  23. package/esm/Session/Preferences.d.ts +1389 -0
  24. package/esm/Session/Preferences.js +58 -0
  25. package/esm/Session/ReferenceManagement.d.ts +28 -3
  26. package/esm/Session/ReferenceManagement.js +56 -41
  27. package/esm/Session/SessionTracks.d.ts +1101 -1180
  28. package/esm/Session/SessionTracks.js +584 -34
  29. package/esm/Session/Themes.d.ts +136 -2
  30. package/esm/Session/Themes.js +267 -21
  31. package/esm/Session/TrackMenu.d.ts +88 -0
  32. package/esm/Session/TrackMenu.js +175 -0
  33. package/esm/Session/TrackMenuSessionMixin.d.ts +27 -0
  34. package/esm/Session/TrackMenuSessionMixin.js +42 -0
  35. package/esm/Session/Tracks.d.ts +945 -1159
  36. package/esm/Session/Tracks.js +229 -30
  37. package/esm/Session/assertSessionModel.d.ts +21 -0
  38. package/esm/Session/assertSessionModel.js +1 -0
  39. package/esm/Session/copyTrackSnapshot.d.ts +21 -0
  40. package/esm/Session/copyTrackSnapshot.js +20 -0
  41. package/esm/Session/developerMode.d.ts +7 -0
  42. package/esm/Session/developerMode.js +43 -0
  43. package/esm/Session/finalizeSession.d.ts +15 -0
  44. package/esm/Session/finalizeSession.js +28 -0
  45. package/esm/Session/hydratedForms.d.ts +16 -0
  46. package/esm/Session/hydratedForms.js +13 -0
  47. package/esm/Session/index.d.ts +27 -10
  48. package/esm/Session/index.js +16 -10
  49. package/esm/Session/pluginExtraTrackItems.d.ts +11 -0
  50. package/esm/Session/pluginExtraTrackItems.js +13 -0
  51. package/esm/Session/readdedTrackConf.d.ts +8 -0
  52. package/esm/Session/readdedTrackConf.js +24 -0
  53. package/esm/Session/shareableSnapshot.d.ts +23 -0
  54. package/esm/Session/shareableSnapshot.js +66 -0
  55. package/esm/Session/temporaryAssemblyTracks.d.ts +24 -0
  56. package/esm/Session/temporaryAssemblyTracks.js +37 -0
  57. package/esm/assertExtends.d.ts +55 -0
  58. package/esm/assertExtends.js +1 -0
  59. package/esm/controllerTracks.d.ts +76 -0
  60. package/esm/controllerTracks.js +125 -0
  61. package/esm/destroyViewState.d.ts +21 -0
  62. package/esm/destroyViewState.js +29 -0
  63. package/esm/embeddedController.d.ts +57 -0
  64. package/esm/embeddedController.js +100 -0
  65. package/esm/index.d.ts +32 -4
  66. package/esm/index.js +31 -4
  67. package/esm/loadPlugins.d.ts +38 -0
  68. package/esm/loadPlugins.js +45 -0
  69. package/esm/localFiles.d.ts +74 -0
  70. package/esm/localFiles.js +156 -0
  71. package/esm/observeSession.d.ts +55 -0
  72. package/esm/observeSession.js +90 -0
  73. package/esm/parallelChunkLoading.d.ts +30 -0
  74. package/esm/parallelChunkLoading.js +71 -0
  75. package/esm/pluginInput.d.ts +32 -0
  76. package/esm/pluginInput.js +19 -0
  77. package/esm/pruneUnbuildableNodes.d.ts +109 -0
  78. package/esm/pruneUnbuildableNodes.js +562 -0
  79. package/esm/resolveAssemblies.d.ts +68 -0
  80. package/esm/resolveAssemblies.js +77 -0
  81. package/esm/rpcWorker.d.ts +36 -4
  82. package/esm/rpcWorker.js +126 -20
  83. package/esm/sessionMigrations/index.d.ts +15 -0
  84. package/esm/sessionMigrations/index.js +178 -0
  85. package/esm/sessionUrl.d.ts +40 -0
  86. package/esm/sessionUrl.js +66 -0
  87. package/esm/sessionUtils.d.ts +74 -0
  88. package/esm/sessionUtils.js +599 -0
  89. package/esm/siblingCast.d.ts +14 -0
  90. package/esm/siblingCast.js +16 -0
  91. package/esm/snapshotUtils.d.ts +8 -0
  92. package/esm/snapshotUtils.js +12 -0
  93. package/esm/ui/AboutDialog.d.ts +8 -3
  94. package/esm/ui/AboutDialog.js +14 -5
  95. package/esm/ui/AboutDialogContents.d.ts +2 -6
  96. package/esm/ui/AboutDialogContents.js +13 -17
  97. package/esm/ui/AssemblyInfoPanel.d.ts +5 -0
  98. package/esm/ui/AssemblyInfoPanel.js +63 -0
  99. package/esm/ui/DescriptionPanel.d.ts +3 -0
  100. package/esm/ui/DescriptionPanel.js +25 -0
  101. package/esm/ui/Drawer.d.ts +21 -0
  102. package/esm/ui/Drawer.js +60 -0
  103. package/esm/ui/DrawerControls.d.ts +5 -0
  104. package/esm/ui/DrawerControls.js +28 -0
  105. package/esm/ui/DrawerHeader.d.ts +6 -0
  106. package/esm/ui/DrawerHeader.js +36 -0
  107. package/esm/ui/DrawerWidget.d.ts +5 -0
  108. package/esm/ui/DrawerWidget.js +12 -0
  109. package/esm/ui/DrawerWidgetSelector.d.ts +5 -0
  110. package/esm/ui/DrawerWidgetSelector.js +40 -0
  111. package/esm/ui/FileInfoPanel.d.ts +3 -6
  112. package/esm/ui/FileInfoPanel.js +36 -26
  113. package/esm/ui/GeneralPreferencesTab.d.ts +17 -0
  114. package/esm/ui/GeneralPreferencesTab.js +34 -0
  115. package/esm/ui/HeaderButtons.d.ts +2 -1
  116. package/esm/ui/HeaderButtons.js +15 -17
  117. package/esm/ui/ModalWidget.d.ts +13 -0
  118. package/esm/ui/ModalWidget.js +48 -0
  119. package/esm/ui/ModalWidgetAppBar.d.ts +8 -0
  120. package/esm/ui/ModalWidgetAppBar.js +9 -0
  121. package/esm/ui/PreferenceCheckbox.d.ts +6 -0
  122. package/esm/ui/PreferenceCheckbox.js +16 -0
  123. package/esm/ui/PreferencesDialog.d.ts +34 -0
  124. package/esm/ui/PreferencesDialog.js +55 -0
  125. package/esm/ui/PreferencesResetDialog.d.ts +8 -0
  126. package/esm/ui/PreferencesResetDialog.js +19 -0
  127. package/esm/ui/RefNameAliasesDialog.d.ts +9 -0
  128. package/esm/ui/RefNameAliasesDialog.js +65 -0
  129. package/esm/ui/RefNameInfoDialog.d.ts +3 -6
  130. package/esm/ui/RefNameInfoDialog.js +45 -63
  131. package/esm/ui/ViewPreferencesTab.d.ts +12 -0
  132. package/esm/ui/ViewPreferencesTab.js +15 -0
  133. package/esm/ui/WidgetBody.d.ts +18 -0
  134. package/esm/ui/WidgetBody.js +22 -0
  135. package/esm/ui/WidgetHeading.d.ts +7 -0
  136. package/esm/ui/WidgetHeading.js +7 -0
  137. package/esm/ui/aboutTestUtils.d.ts +140 -0
  138. package/esm/ui/aboutTestUtils.js +25 -0
  139. package/esm/ui/descriptionHtml.d.ts +25 -0
  140. package/esm/ui/descriptionHtml.js +64 -0
  141. package/esm/ui/drawerLayout.d.ts +18 -0
  142. package/esm/ui/drawerLayout.js +22 -0
  143. package/esm/ui/index.d.ts +15 -1
  144. package/esm/ui/index.js +13 -1
  145. package/esm/ui/preferencesReset.d.ts +18 -0
  146. package/esm/ui/preferencesReset.js +69 -0
  147. package/esm/ui/util.d.ts +22 -7
  148. package/esm/ui/util.js +19 -41
  149. package/esm/useEngineLifecycle.d.ts +19 -0
  150. package/esm/useEngineLifecycle.js +44 -0
  151. package/package.json +15 -18
  152. package/esm/RootModel/FormatAbout.d.ts +0 -12
  153. package/esm/RootModel/FormatAbout.js +0 -15
  154. package/esm/RootModel/FormatDetails.d.ts +0 -24
  155. package/esm/RootModel/FormatDetails.js +0 -27
  156. package/esm/Session/DialogQueue.d.ts +0 -17
  157. package/esm/Session/DialogQueue.js +0 -31
@@ -1,90 +1,212 @@
1
- import { readConfObject } from '@jbrowse/core/configuration';
2
- import { types } from '@jbrowse/mobx-state-tree';
3
- import { isBaseSession } from "./BaseSession.js";
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
- connectionInstances: types.array(pluginManager.pluggableMstType('connection', 'stateModel')),
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
- makeConnection(configuration, initialSnapshot = {}) {
17
- const type = configuration.type;
18
- if (!type) {
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
- ...rest,
84
- ...(connectionInstances?.length ? { connectionInstances } : {}),
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
+ * the track selector calls it when the connection's category is
194
+ * expanded. Fetches without launching a view or showing a success
195
+ * snackbar; already-open tracks keep
196
+ * rendering from `connectionTrackConfigs` meanwhile. Idempotent.
197
+ */
198
+ hydrateConnection(connectionId) {
199
+ // makeConnection is idempotent (returns the existing live instance if
200
+ // one matches), so no separate liveness check is needed
201
+ const conf = self.connections.find(c => c.connectionId === connectionId);
202
+ if (conf) {
203
+ this.makeConnection(conf, { silent: true });
204
+ }
205
+ },
85
206
  };
86
207
  });
87
208
  }
209
+ /** Type guard for SessionWithConnections */
88
210
  export function isSessionWithConnections(session) {
89
211
  return isBaseSession(session) && 'connectionInstances' in session;
90
212
  }
@@ -1,36 +1,168 @@
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
- drawerPosition: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
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
- widgets: import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IAnyType>;
8
- activeWidgets: import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").IReferenceType<import("@jbrowse/mobx-state-tree").IAnyType>>>;
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
- readonly visibleWidget: any;
30
+ /**
31
+ * #getter
32
+ */
33
+ readonly visibleWidget: Widget | undefined;
12
34
  } & {
13
- setDrawerPosition(arg: string): void;
14
- updateDrawerWidth(drawerWidth: number): number;
15
- resizeDrawer(distance: number): number;
16
- addWidget(typeName: string, id: string, initialState?: {}, conf?: unknown): any;
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
+ * #volatile
44
+ * set by a host with no room for a drawer column beside its views (a
45
+ * phone), so every widget shows in a modal instead
46
+ */
47
+ modalWidgets: boolean;
48
+ } & {
49
+ /**
50
+ * #getter
51
+ * whether the drawer column is on screen: there is something to show, it
52
+ * is not minimized to the FAB, and it is not currently a modal instead.
53
+ *
54
+ * A getter rather than each host's own `&&`, because the hosts drifted --
55
+ * the app shell tested `poppedOut` and the embedded view did not, so the
56
+ * day a popout button reaches the embedded drawer header it would render
57
+ * the modal and the drawer at once.
58
+ */
59
+ readonly drawerVisible: boolean;
60
+ /**
61
+ * #getter
62
+ * whether the visible widget shows in a modal: popped out of the drawer,
63
+ * or on a host with no room for one
64
+ */
65
+ readonly modalWidgetVisible: boolean;
66
+ } & {
67
+ /**
68
+ * #action
69
+ */
70
+ setDrawerPosition(arg: DrawerPosition): void;
71
+ /**
72
+ * #action
73
+ */
74
+ updateDrawerWidth(drawerWidth: number, availableWidth?: number): number;
75
+ /**
76
+ * #action
77
+ */
78
+ resizeDrawer(distance: number, availableWidth?: number): number;
79
+ /**
80
+ * #action
81
+ */
82
+ addWidget(typeName: string, id: string, initialState?: any, conf?: unknown): any;
83
+ /**
84
+ * #action
85
+ */
17
86
  showWidget(widget: any): void;
18
- hasWidget(widget: any): boolean;
87
+ /**
88
+ * #action
89
+ */
19
90
  hideWidget(widget: any): void;
91
+ /**
92
+ * #action
93
+ */
20
94
  minimizeWidgetDrawer(): void;
95
+ /**
96
+ * #action
97
+ */
21
98
  showWidgetDrawer(): void;
99
+ /**
100
+ * #action
101
+ * show the visible widget in a modal dialog, freeing the drawer column
102
+ */
103
+ popoutWidget(): void;
104
+ /**
105
+ * #action
106
+ */
107
+ returnWidgetToDrawer(): void;
108
+ /**
109
+ * #action
110
+ */
111
+ setModalWidgets(flag: boolean): void;
112
+ /**
113
+ * #action
114
+ */
22
115
  hideAllWidgets(): void;
116
+ afterAttach(): void;
117
+ } & {
118
+ /**
119
+ * #action
120
+ * the modal's close button: a popped-out widget goes back to the drawer,
121
+ * and with no drawer to go back to the widget closes
122
+ */
123
+ closeModalWidget(): void;
124
+ /**
125
+ * #action
126
+ * adds the widget, replacing one with the same id, and shows it
127
+ */
128
+ openWidget(typeName: string, id: string, initialState?: any, conf?: unknown): any;
129
+ } & {
130
+ /**
131
+ * #action
132
+ * opens a configuration editor to configure the given thing,
133
+ * and sets the current task to be configuring it
134
+ * @param configuration - can be an MST model or a frozen/plain object with trackId
135
+ */
23
136
  editConfiguration(configuration: AnyConfigurationModel | {
24
137
  trackId: string;
138
+ }, opts?: {
139
+ expandedDisplayId?: string;
25
140
  }): void;
26
- afterAttach(): void;
27
141
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree").ModelSnapshotType<{
28
- drawerPosition: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
142
+ /**
143
+ * #property
144
+ */
145
+ drawerPosition: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<DrawerPosition>, [undefined]>;
146
+ /**
147
+ * #property
148
+ */
29
149
  drawerWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
30
- widgets: import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IAnyType>;
31
- activeWidgets: import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").IReferenceType<import("@jbrowse/mobx-state-tree").IAnyType>>>;
150
+ /**
151
+ * #property
152
+ */
153
+ widgets: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IAnyType>, [undefined]>;
154
+ /**
155
+ * #property
156
+ */
157
+ 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]>;
158
+ /**
159
+ * #property
160
+ */
32
161
  minimized: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
33
162
  }>>;
163
+ /** Session mixin MST type for a session that manages drawer widgets */
34
164
  export type SessionWithDrawerWidgetsType = ReturnType<typeof DrawerWidgetSessionMixin>;
165
+ /** Instance of a session that manages drawer widgets */
35
166
  export type SessionWithDrawerWidgets = Instance<SessionWithDrawerWidgetsType>;
167
+ /** Type guard for SessionWithDrawerWidgets */
36
168
  export declare function isSessionWithDrawerWidgets(session: IAnyStateTreeNode): session is SessionWithDrawerWidgets;