@jbrowse/product-core 5.0.0-beta.1 → 5.0.0-beta.11

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 (105) hide show
  1. package/esm/RootModel/BaseRootModel.d.ts +24 -158
  2. package/esm/RootModel/BaseRootModel.js +7 -4
  3. package/esm/RootModel/HierarchicalConfig.d.ts +21 -47
  4. package/esm/RootModel/PreferencesConfig.d.ts +20 -36
  5. package/esm/RootModel/PreferencesConfig.js +17 -3
  6. package/esm/RootModel/createConfigModel.d.ts +148 -123
  7. package/esm/RootModel/createConfigModel.js +35 -14
  8. package/esm/RootModel/menuItems.js +7 -9
  9. package/esm/Session/BaseSession.d.ts +60 -85
  10. package/esm/Session/BaseSession.js +106 -172
  11. package/esm/Session/Connections.d.ts +4 -3
  12. package/esm/Session/Connections.js +4 -3
  13. package/esm/Session/DrawerWidgets.d.ts +32 -1
  14. package/esm/Session/DrawerWidgets.js +71 -11
  15. package/esm/Session/MultipleViews.d.ts +85 -333
  16. package/esm/Session/MultipleViews.js +50 -10
  17. package/esm/Session/Preferences.d.ts +53 -329
  18. package/esm/Session/Preferences.js +6 -2
  19. package/esm/Session/SessionTracks.d.ts +180 -396
  20. package/esm/Session/SessionTracks.js +291 -238
  21. package/esm/Session/Themes.d.ts +79 -30
  22. package/esm/Session/Themes.js +153 -40
  23. package/esm/Session/TrackMenu.d.ts +4 -28
  24. package/esm/Session/TrackMenu.js +28 -53
  25. package/esm/Session/TrackMenuSessionMixin.js +2 -1
  26. package/esm/Session/Tracks.d.ts +75 -341
  27. package/esm/Session/Tracks.js +192 -133
  28. package/esm/Session/copyTrackSnapshot.d.ts +21 -0
  29. package/esm/Session/copyTrackSnapshot.js +20 -0
  30. package/esm/Session/developerMode.d.ts +7 -0
  31. package/esm/Session/developerMode.js +43 -0
  32. package/esm/Session/finalizeSession.d.ts +1 -2
  33. package/esm/Session/finalizeSession.js +1 -2
  34. package/esm/Session/hydratedForms.d.ts +16 -0
  35. package/esm/Session/hydratedForms.js +13 -0
  36. package/esm/Session/index.d.ts +8 -3
  37. package/esm/Session/index.js +6 -3
  38. package/esm/Session/pluginExtraTrackItems.d.ts +11 -0
  39. package/esm/Session/pluginExtraTrackItems.js +13 -0
  40. package/esm/Session/readdedTrackConf.d.ts +8 -0
  41. package/esm/Session/readdedTrackConf.js +24 -0
  42. package/esm/Session/shareableSnapshot.d.ts +6 -60
  43. package/esm/Session/shareableSnapshot.js +8 -138
  44. package/esm/Session/temporaryAssemblyTracks.d.ts +4 -3
  45. package/esm/Session/temporaryAssemblyTracks.js +6 -7
  46. package/esm/controllerTracks.d.ts +31 -11
  47. package/esm/controllerTracks.js +63 -15
  48. package/esm/embeddedController.d.ts +57 -0
  49. package/esm/embeddedController.js +100 -0
  50. package/esm/index.d.ts +12 -11
  51. package/esm/index.js +9 -9
  52. package/esm/loadPlugins.d.ts +8 -3
  53. package/esm/loadPlugins.js +11 -4
  54. package/esm/observeSession.d.ts +4 -5
  55. package/esm/observeSession.js +3 -4
  56. package/esm/parallelChunkLoading.d.ts +30 -0
  57. package/esm/parallelChunkLoading.js +71 -0
  58. package/esm/pruneUnbuildableNodes.js +18 -24
  59. package/esm/resolveAssemblies.d.ts +36 -12
  60. package/esm/resolveAssemblies.js +38 -16
  61. package/esm/rpcWorker.d.ts +11 -5
  62. package/esm/rpcWorker.js +41 -16
  63. package/esm/sessionMigrations/index.d.ts +10 -48
  64. package/esm/sessionMigrations/index.js +116 -370
  65. package/esm/sessionUrl.d.ts +7 -8
  66. package/esm/sessionUrl.js +27 -14
  67. package/esm/sessionUtils.d.ts +6 -1
  68. package/esm/sessionUtils.js +78 -92
  69. package/esm/ui/AboutDialog.d.ts +10 -2
  70. package/esm/ui/AboutDialog.js +11 -2
  71. package/esm/ui/AboutDialogContents.js +5 -29
  72. package/esm/ui/AssemblyInfoPanel.js +4 -10
  73. package/esm/ui/DescriptionPanel.d.ts +3 -0
  74. package/esm/ui/DescriptionPanel.js +62 -0
  75. package/esm/ui/FileInfoPanel.js +12 -11
  76. package/esm/ui/GeneralPreferencesTab.d.ts +17 -0
  77. package/esm/ui/GeneralPreferencesTab.js +34 -0
  78. package/esm/ui/HeaderButtons.d.ts +1 -6
  79. package/esm/ui/HeaderButtons.js +5 -12
  80. package/esm/ui/ModalWidget.d.ts +2 -1
  81. package/esm/ui/ModalWidget.js +18 -3
  82. package/esm/ui/PreferenceCheckbox.d.ts +6 -0
  83. package/esm/ui/PreferenceCheckbox.js +16 -0
  84. package/esm/ui/PreferencesDialog.d.ts +5 -27
  85. package/esm/ui/PreferencesDialog.js +29 -119
  86. package/esm/ui/RefNameInfoDialog.js +13 -25
  87. package/esm/ui/ViewPreferencesTab.d.ts +12 -0
  88. package/esm/ui/ViewPreferencesTab.js +15 -0
  89. package/esm/ui/aboutTestUtils.d.ts +140 -0
  90. package/esm/ui/aboutTestUtils.js +25 -0
  91. package/esm/ui/descriptionHtml.d.ts +47 -0
  92. package/esm/ui/descriptionHtml.js +117 -0
  93. package/esm/ui/index.d.ts +2 -0
  94. package/esm/ui/index.js +1 -0
  95. package/esm/ui/preferencesReset.d.ts +18 -0
  96. package/esm/ui/preferencesReset.js +69 -0
  97. package/esm/ui/util.d.ts +9 -27
  98. package/esm/ui/util.js +12 -31
  99. package/esm/useEngineLifecycle.d.ts +7 -1
  100. package/esm/useEngineLifecycle.js +24 -2
  101. package/package.json +11 -10
  102. package/esm/scheduleDetachedDestroy.d.ts +0 -18
  103. package/esm/scheduleDetachedDestroy.js +0 -24
  104. package/esm/ui/DisplayDefaultsSection.d.ts +0 -36
  105. package/esm/ui/DisplayDefaultsSection.js +0 -65
@@ -39,6 +39,12 @@ export declare function DrawerWidgetSessionMixin(pluginManager: PluginManager):
39
39
  * modal, with no drawer behind it, is disorienting
40
40
  */
41
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;
42
48
  } & {
43
49
  /**
44
50
  * #getter
@@ -51,6 +57,12 @@ export declare function DrawerWidgetSessionMixin(pluginManager: PluginManager):
51
57
  * the modal and the drawer at once.
52
58
  */
53
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;
54
66
  } & {
55
67
  /**
56
68
  * #action
@@ -74,6 +86,8 @@ export declare function DrawerWidgetSessionMixin(pluginManager: PluginManager):
74
86
  showWidget(widget: any): void;
75
87
  /**
76
88
  * #action
89
+ * closes the widget, and removes it from the session when its type sets
90
+ * `discardOnClose`. Minimizing the drawer is not closing.
77
91
  */
78
92
  hideWidget(widget: any): void;
79
93
  /**
@@ -93,10 +107,28 @@ export declare function DrawerWidgetSessionMixin(pluginManager: PluginManager):
93
107
  * #action
94
108
  */
95
109
  returnWidgetToDrawer(): void;
110
+ /**
111
+ * #action
112
+ */
113
+ setModalWidgets(flag: boolean): void;
96
114
  /**
97
115
  * #action
98
116
  */
99
117
  hideAllWidgets(): void;
118
+ afterAttach(): void;
119
+ } & {
120
+ /**
121
+ * #action
122
+ * the modal's close button: a popped-out widget goes back to the drawer,
123
+ * and with no drawer to go back to the widget closes
124
+ */
125
+ closeModalWidget(): void;
126
+ /**
127
+ * #action
128
+ * adds the widget, replacing one with the same id, and shows it
129
+ */
130
+ openWidget(typeName: string, id: string, initialState?: any, conf?: unknown): any;
131
+ } & {
100
132
  /**
101
133
  * #action
102
134
  * opens a configuration editor to configure the given thing,
@@ -108,7 +140,6 @@ export declare function DrawerWidgetSessionMixin(pluginManager: PluginManager):
108
140
  }, opts?: {
109
141
  expandedDisplayId?: string;
110
142
  }): void;
111
- afterAttach(): void;
112
143
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree").ModelSnapshotType<{
113
144
  /**
114
145
  * #property
@@ -1,6 +1,6 @@
1
1
  import { isConfigurationModel } from '@jbrowse/core/configuration';
2
- import { localStorageGetItem, localStorageSetItem } from '@jbrowse/core/util';
3
- import { addDisposer, getEnv, isAlive, isStateTreeNode, types, } from '@jbrowse/mobx-state-tree';
2
+ import { localStorageGetItem, localStorageSetItem, scheduleDetachedDestroy, } from '@jbrowse/core/util';
3
+ import { addDisposer, detach, getEnv, isAlive, isStateTreeNode, types, } from '@jbrowse/mobx-state-tree';
4
4
  import { autorun } from 'mobx';
5
5
  import { isBaseSession } from './BaseSession.js';
6
6
  const minDrawerWidth = 128;
@@ -89,6 +89,12 @@ export function DrawerWidgetSessionMixin(pluginManager) {
89
89
  * modal, with no drawer behind it, is disorienting
90
90
  */
91
91
  poppedOut: false,
92
+ /**
93
+ * #volatile
94
+ * set by a host with no room for a drawer column beside its views (a
95
+ * phone), so every widget shows in a modal instead
96
+ */
97
+ modalWidgets: false,
92
98
  }))
93
99
  .views(self => ({
94
100
  /**
@@ -102,7 +108,20 @@ export function DrawerWidgetSessionMixin(pluginManager) {
102
108
  * the modal and the drawer at once.
103
109
  */
104
110
  get drawerVisible() {
105
- return Boolean(self.visibleWidget) && !self.minimized && !self.poppedOut;
111
+ return (Boolean(self.visibleWidget) &&
112
+ !self.minimized &&
113
+ !self.poppedOut &&
114
+ !self.modalWidgets);
115
+ },
116
+ /**
117
+ * #getter
118
+ * whether the visible widget shows in a modal: popped out of the drawer,
119
+ * or on a host with no room for one
120
+ */
121
+ get modalWidgetVisible() {
122
+ return (Boolean(self.visibleWidget) &&
123
+ !self.minimized &&
124
+ (self.poppedOut || self.modalWidgets));
106
125
  },
107
126
  }))
108
127
  .actions(self => ({
@@ -152,12 +171,19 @@ export function DrawerWidgetSessionMixin(pluginManager) {
152
171
  },
153
172
  /**
154
173
  * #action
174
+ * closes the widget, and removes it from the session when its type sets
175
+ * `discardOnClose`. Minimizing the drawer is not closing.
155
176
  */
156
177
  hideWidget(widget) {
157
178
  self.activeWidgets.delete(widget.id);
158
179
  if (self.activeWidgets.size === 0) {
159
180
  self.poppedOut = false;
160
181
  }
182
+ if (self.widgets.get(widget.id) === widget &&
183
+ pluginManager.getWidgetType(widget.type).discardOnClose) {
184
+ detach(widget);
185
+ scheduleDetachedDestroy(widget);
186
+ }
161
187
  },
162
188
  /**
163
189
  * #action
@@ -184,13 +210,53 @@ export function DrawerWidgetSessionMixin(pluginManager) {
184
210
  returnWidgetToDrawer() {
185
211
  self.poppedOut = false;
186
212
  },
213
+ /**
214
+ * #action
215
+ */
216
+ setModalWidgets(flag) {
217
+ self.modalWidgets = flag;
218
+ },
187
219
  /**
188
220
  * #action
189
221
  */
190
222
  hideAllWidgets() {
191
- self.activeWidgets.clear();
223
+ for (const widget of [...self.activeWidgets.values()]) {
224
+ this.hideWidget(widget);
225
+ }
192
226
  self.poppedOut = false;
193
227
  },
228
+ afterAttach() {
229
+ addDisposer(self, autorun(function drawerPositionAutorun() {
230
+ localStorageSetItem('drawerPosition', self.drawerPosition);
231
+ }, { name: 'DrawerPosition' }));
232
+ },
233
+ }))
234
+ .actions(self => ({
235
+ /**
236
+ * #action
237
+ * the modal's close button: a popped-out widget goes back to the drawer,
238
+ * and with no drawer to go back to the widget closes
239
+ */
240
+ closeModalWidget() {
241
+ const widget = self.visibleWidget;
242
+ if (self.modalWidgets && widget) {
243
+ self.hideWidget(widget);
244
+ }
245
+ else {
246
+ self.returnWidgetToDrawer();
247
+ }
248
+ },
249
+ /**
250
+ * #action
251
+ * adds the widget, replacing one with the same id, and shows it
252
+ */
253
+ openWidget(typeName, id, initialState = {}, conf) {
254
+ const widget = self.addWidget(typeName, id, initialState, conf);
255
+ self.showWidget(widget);
256
+ return widget;
257
+ },
258
+ }))
259
+ .actions(self => ({
194
260
  /**
195
261
  * #action
196
262
  * opens a configuration editor to configure the given thing,
@@ -212,16 +278,10 @@ export function DrawerWidgetSessionMixin(pluginManager) {
212
278
  else {
213
279
  throw new Error('must pass a configuration model or frozen config with trackId to editConfiguration');
214
280
  }
215
- const editor = this.addWidget('ConfigurationEditorWidget', 'configEditor', {});
281
+ const editor = self.openWidget('ConfigurationEditorWidget', 'configEditor');
216
282
  // Set target via action since it's now volatile
217
283
  editor.setTarget(targetConfig);
218
284
  editor.setExpandedDisplayId(opts?.expandedDisplayId);
219
- this.showWidget(editor);
220
- },
221
- afterAttach() {
222
- addDisposer(self, autorun(function drawerPositionAutorun() {
223
- localStorageSetItem('drawerPosition', self.drawerPosition);
224
- }, { name: 'DrawerPosition' }));
225
285
  },
226
286
  }))
227
287
  .postProcessSnapshot(snap => {