@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.
Files changed (137) hide show
  1. package/esm/RootModel/BaseRootModel.d.ts +629 -304
  2. package/esm/RootModel/BaseRootModel.js +139 -14
  3. package/esm/RootModel/HierarchicalConfig.d.ts +57 -21
  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 +68 -0
  8. package/esm/RootModel/PreferencesConfig.js +76 -0
  9. package/esm/RootModel/createConfigModel.d.ts +240 -0
  10. package/esm/RootModel/createConfigModel.js +56 -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 +143 -0
  15. package/esm/Session/BaseSession.d.ts +312 -11
  16. package/esm/Session/BaseSession.js +458 -14
  17. package/esm/Session/Connections.d.ts +114 -8
  18. package/esm/Session/Connections.js +195 -74
  19. package/esm/Session/DrawerWidgets.d.ts +115 -12
  20. package/esm/Session/DrawerWidgets.js +161 -42
  21. package/esm/Session/MultipleViews.d.ts +1281 -1128
  22. package/esm/Session/MultipleViews.js +396 -64
  23. package/esm/Session/Preferences.d.ts +1667 -0
  24. package/esm/Session/Preferences.js +59 -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 +1277 -1138
  28. package/esm/Session/SessionTracks.js +540 -35
  29. package/esm/Session/Themes.d.ts +87 -2
  30. package/esm/Session/Themes.js +156 -23
  31. package/esm/Session/TrackMenu.d.ts +112 -0
  32. package/esm/Session/TrackMenu.js +200 -0
  33. package/esm/Session/TrackMenuSessionMixin.d.ts +27 -0
  34. package/esm/Session/TrackMenuSessionMixin.js +41 -0
  35. package/esm/Session/Tracks.d.ts +1171 -1117
  36. package/esm/Session/Tracks.js +183 -20
  37. package/esm/Session/assertSessionModel.d.ts +21 -0
  38. package/esm/Session/assertSessionModel.js +1 -0
  39. package/esm/Session/developerMode.d.ts +7 -0
  40. package/esm/Session/developerMode.js +43 -0
  41. package/esm/Session/finalizeSession.d.ts +16 -0
  42. package/esm/Session/finalizeSession.js +29 -0
  43. package/esm/Session/index.d.ts +22 -10
  44. package/esm/Session/index.js +13 -10
  45. package/esm/Session/readdedTrackConf.d.ts +8 -0
  46. package/esm/Session/readdedTrackConf.js +25 -0
  47. package/esm/Session/shareableSnapshot.d.ts +77 -0
  48. package/esm/Session/shareableSnapshot.js +196 -0
  49. package/esm/Session/temporaryAssemblyTracks.d.ts +24 -0
  50. package/esm/Session/temporaryAssemblyTracks.js +37 -0
  51. package/esm/assertExtends.d.ts +55 -0
  52. package/esm/assertExtends.js +1 -0
  53. package/esm/controllerTracks.d.ts +56 -0
  54. package/esm/controllerTracks.js +90 -0
  55. package/esm/destroyViewState.d.ts +21 -0
  56. package/esm/destroyViewState.js +29 -0
  57. package/esm/index.d.ts +31 -4
  58. package/esm/index.js +31 -4
  59. package/esm/loadPlugins.d.ts +33 -0
  60. package/esm/loadPlugins.js +41 -0
  61. package/esm/localFiles.d.ts +74 -0
  62. package/esm/localFiles.js +156 -0
  63. package/esm/observeSession.d.ts +56 -0
  64. package/esm/observeSession.js +91 -0
  65. package/esm/pluginInput.d.ts +32 -0
  66. package/esm/pluginInput.js +19 -0
  67. package/esm/pruneUnbuildableNodes.d.ts +109 -0
  68. package/esm/pruneUnbuildableNodes.js +568 -0
  69. package/esm/resolveAssemblies.d.ts +44 -0
  70. package/esm/resolveAssemblies.js +55 -0
  71. package/esm/rpcWorker.d.ts +26 -0
  72. package/esm/rpcWorker.js +98 -16
  73. package/esm/scheduleDetachedDestroy.d.ts +18 -0
  74. package/esm/scheduleDetachedDestroy.js +24 -0
  75. package/esm/sessionMigrations/index.d.ts +53 -0
  76. package/esm/sessionMigrations/index.js +432 -0
  77. package/esm/sessionUrl.d.ts +41 -0
  78. package/esm/sessionUrl.js +53 -0
  79. package/esm/sessionUtils.d.ts +69 -0
  80. package/esm/sessionUtils.js +613 -0
  81. package/esm/siblingCast.d.ts +14 -0
  82. package/esm/siblingCast.js +16 -0
  83. package/esm/snapshotUtils.d.ts +8 -0
  84. package/esm/snapshotUtils.js +12 -0
  85. package/esm/ui/AboutDialog.d.ts +3 -6
  86. package/esm/ui/AboutDialog.js +4 -4
  87. package/esm/ui/AboutDialogContents.d.ts +2 -6
  88. package/esm/ui/AboutDialogContents.js +34 -13
  89. package/esm/ui/AssemblyInfoPanel.d.ts +5 -0
  90. package/esm/ui/AssemblyInfoPanel.js +69 -0
  91. package/esm/ui/DisplayDefaultsSection.d.ts +36 -0
  92. package/esm/ui/DisplayDefaultsSection.js +65 -0
  93. package/esm/ui/Drawer.d.ts +21 -0
  94. package/esm/ui/Drawer.js +60 -0
  95. package/esm/ui/DrawerControls.d.ts +5 -0
  96. package/esm/ui/DrawerControls.js +28 -0
  97. package/esm/ui/DrawerHeader.d.ts +6 -0
  98. package/esm/ui/DrawerHeader.js +36 -0
  99. package/esm/ui/DrawerWidget.d.ts +5 -0
  100. package/esm/ui/DrawerWidget.js +12 -0
  101. package/esm/ui/DrawerWidgetSelector.d.ts +5 -0
  102. package/esm/ui/DrawerWidgetSelector.js +40 -0
  103. package/esm/ui/FileInfoPanel.d.ts +3 -6
  104. package/esm/ui/FileInfoPanel.js +35 -26
  105. package/esm/ui/HeaderButtons.d.ts +7 -1
  106. package/esm/ui/HeaderButtons.js +23 -18
  107. package/esm/ui/ModalWidget.d.ts +12 -0
  108. package/esm/ui/ModalWidget.js +33 -0
  109. package/esm/ui/ModalWidgetAppBar.d.ts +8 -0
  110. package/esm/ui/ModalWidgetAppBar.js +9 -0
  111. package/esm/ui/PreferencesDialog.d.ts +56 -0
  112. package/esm/ui/PreferencesDialog.js +145 -0
  113. package/esm/ui/PreferencesResetDialog.d.ts +8 -0
  114. package/esm/ui/PreferencesResetDialog.js +19 -0
  115. package/esm/ui/RefNameAliasesDialog.d.ts +9 -0
  116. package/esm/ui/RefNameAliasesDialog.js +65 -0
  117. package/esm/ui/RefNameInfoDialog.d.ts +3 -6
  118. package/esm/ui/RefNameInfoDialog.js +57 -63
  119. package/esm/ui/WidgetBody.d.ts +18 -0
  120. package/esm/ui/WidgetBody.js +22 -0
  121. package/esm/ui/WidgetHeading.d.ts +7 -0
  122. package/esm/ui/WidgetHeading.js +7 -0
  123. package/esm/ui/drawerLayout.d.ts +18 -0
  124. package/esm/ui/drawerLayout.js +22 -0
  125. package/esm/ui/index.d.ts +13 -1
  126. package/esm/ui/index.js +12 -1
  127. package/esm/ui/util.d.ts +37 -4
  128. package/esm/ui/util.js +35 -38
  129. package/esm/useEngineLifecycle.d.ts +19 -0
  130. package/esm/useEngineLifecycle.js +44 -0
  131. package/package.json +12 -15
  132. package/esm/RootModel/FormatAbout.d.ts +0 -12
  133. package/esm/RootModel/FormatAbout.js +0 -15
  134. package/esm/RootModel/FormatDetails.d.ts +0 -24
  135. package/esm/RootModel/FormatDetails.js +0 -27
  136. package/esm/Session/DialogQueue.d.ts +0 -17
  137. package/esm/Session/DialogQueue.js +0 -31
@@ -0,0 +1,76 @@
1
+ import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
+ import { types } from '@jbrowse/mobx-state-tree';
3
+ /**
4
+ * #config PreferencesConfigSchema
5
+ * #category root
6
+ * admin/embedder defaults for user-facing preferences, found on the root config
7
+ * as `configuration.preferences`. Individual users override these at runtime
8
+ * (persisted to localStorage) via the session `getPreference` reader; a runtime
9
+ * override map layered over config defaults, at app scope.
10
+ */
11
+ export function PreferencesConfigSchemaFactory() {
12
+ return ConfigurationSchema('Preferences', {
13
+ /**
14
+ * #slot configuration.preferences.animationMode
15
+ * controls feature-layout animations: 'enabled' always animates (the
16
+ * default), 'system' respects the OS prefers-reduced-motion setting,
17
+ * 'disabled' never animates
18
+ */
19
+ animationMode: {
20
+ model: types.enumeration('AnimationMode', [
21
+ 'system',
22
+ 'enabled',
23
+ 'disabled',
24
+ ]),
25
+ type: 'stringEnum',
26
+ defaultValue: 'enabled',
27
+ },
28
+ /**
29
+ * #slot configuration.preferences.scrollZoom
30
+ * when true, scrolling the mouse wheel over a track zooms in and out
31
+ * without holding Ctrl. Applies globally to all wheel-zoom views.
32
+ */
33
+ scrollZoom: {
34
+ type: 'boolean',
35
+ defaultValue: false,
36
+ },
37
+ /**
38
+ * #slot configuration.preferences.numberGrouping
39
+ * when true (the default), numbers are displayed with thousand separators
40
+ * — `chr1:1,234,567`. Turn it off to render them bare, which is what you
41
+ * want if you copy coordinates out of JBrowse into tools that won't accept
42
+ * the commas. Applies to every displayed number, and takes effect on
43
+ * reload.
44
+ */
45
+ numberGrouping: {
46
+ type: 'boolean',
47
+ defaultValue: true,
48
+ },
49
+ /**
50
+ * #slot configuration.preferences.useWorkspaces
51
+ * when true, views open in the tabbed/tiled workspace layout rather than
52
+ * stacked vertically. Only the default: a session that names
53
+ * `useWorkspaces` itself (a shared snapshot, or a session spec carrying a
54
+ * `layout`) still wins, and a user's own toggle overrides it.
55
+ */
56
+ useWorkspaces: {
57
+ type: 'boolean',
58
+ defaultValue: false,
59
+ },
60
+ /**
61
+ * #slot configuration.preferences.developerMode
62
+ * when true, the ordering-contract checks a display or plugin can break
63
+ * report themselves in the app rather than only in a development build.
64
+ * Off by default and deliberately not in the Preferences dialog: the
65
+ * messages are about code, and a reader who cannot change the code cannot
66
+ * act on one. Turn it on for a site that is running a plugin under
67
+ * development; a plugin author needs nothing here, since a plugin served
68
+ * from localhost arms the same channel on its own, as does
69
+ * `localStorage.jbrowseDeveloperMode`. Takes effect on reload.
70
+ */
71
+ developerMode: {
72
+ type: 'boolean',
73
+ defaultValue: false,
74
+ },
75
+ });
76
+ }
@@ -0,0 +1,240 @@
1
+ import RpcManager from '@jbrowse/core/rpc/RpcManager';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
+ import type { ConfigurationSnapshot } from '@jbrowse/core/configuration';
4
+ import type { IAnyType } from '@jbrowse/mobx-state-tree';
5
+ declare function rootConfigurationSchema(): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
6
+ readonly rpc: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
7
+ readonly defaultDriver: {
8
+ readonly type: "string";
9
+ readonly description: "the RPC driver to run data fetching on: MainThreadRpcDriver or WebWorkerRpcDriver. Leave empty to use the default for this application";
10
+ readonly defaultValue: "";
11
+ readonly advanced: true;
12
+ };
13
+ readonly workerCount: {
14
+ readonly type: "number";
15
+ readonly description: "The number of workers to use. If 0 (the default) JBrowse will decide how many workers to use.";
16
+ readonly defaultValue: 0;
17
+ readonly advanced: true;
18
+ };
19
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
20
+ readonly hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
21
+ readonly sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
22
+ readonly trackNames: {
23
+ readonly type: "boolean";
24
+ readonly defaultValue: false;
25
+ };
26
+ readonly categories: {
27
+ readonly type: "boolean";
28
+ readonly defaultValue: false;
29
+ };
30
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
31
+ readonly defaultFolderCategories: {
32
+ readonly type: "stringArray";
33
+ readonly description: "list of category names to display as folders by default";
34
+ readonly defaultValue: readonly [];
35
+ };
36
+ readonly defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
37
+ readonly categoryNames: {
38
+ readonly type: "stringArray";
39
+ readonly defaultValue: readonly [];
40
+ };
41
+ readonly topLevelCategories: {
42
+ readonly type: "boolean";
43
+ readonly defaultValue: false;
44
+ };
45
+ readonly subCategories: {
46
+ readonly type: "boolean";
47
+ readonly defaultValue: false;
48
+ };
49
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
50
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
51
+ readonly preferences: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
52
+ readonly animationMode: {
53
+ readonly model: import("@jbrowse/mobx-state-tree").ISimpleType<"disabled" | "enabled" | "system">;
54
+ readonly type: "stringEnum";
55
+ readonly defaultValue: "enabled";
56
+ };
57
+ readonly scrollZoom: {
58
+ readonly type: "boolean";
59
+ readonly defaultValue: false;
60
+ };
61
+ readonly numberGrouping: {
62
+ readonly type: "boolean";
63
+ readonly defaultValue: true;
64
+ };
65
+ readonly useWorkspaces: {
66
+ readonly type: "boolean";
67
+ readonly defaultValue: false;
68
+ };
69
+ readonly developerMode: {
70
+ readonly type: "boolean";
71
+ readonly defaultValue: false;
72
+ };
73
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
74
+ readonly formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
75
+ readonly feature: {
76
+ readonly type: "frozen";
77
+ readonly description: "adds extra fields to the feature details";
78
+ readonly defaultValue: {};
79
+ readonly contextVariable: ["feature"];
80
+ };
81
+ readonly subfeatures: {
82
+ readonly type: "frozen";
83
+ readonly description: "adds extra fields to the subfeatures of a feature";
84
+ readonly defaultValue: {};
85
+ readonly contextVariable: ["feature"];
86
+ };
87
+ readonly depth: {
88
+ readonly type: "maybeNumber";
89
+ readonly description: "levels of subfeature the formatDetails.subfeatures callback runs on, default 2";
90
+ };
91
+ readonly maxDepth: {
92
+ readonly type: "maybeNumber";
93
+ readonly description: "hide subfeatures nested deeper than this, default no limit";
94
+ };
95
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
96
+ readonly formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
97
+ readonly config: {
98
+ readonly type: "frozen";
99
+ readonly description: "formats configuration object in about dialog";
100
+ readonly defaultValue: {};
101
+ readonly contextVariable: ["config"];
102
+ };
103
+ readonly hideUris: {
104
+ readonly type: "boolean";
105
+ readonly defaultValue: false;
106
+ };
107
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
108
+ readonly theme: {
109
+ readonly type: "frozen";
110
+ readonly defaultValue: {};
111
+ };
112
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
113
+ /**
114
+ * What an embedder may put in `createViewState`'s `configuration` option: every
115
+ * root slot and sub-schema by name, values unchecked. Derived from the schema
116
+ * above rather than restated, so a slot added there is spellable here the same
117
+ * day.
118
+ */
119
+ export type RootConfigurationSnapshot = ConfigurationSnapshot<ReturnType<typeof rootConfigurationSchema>>;
120
+ export declare function createConfigModel(pluginManager: PluginManager, assemblyConfigSchemasType: IAnyType): import("@jbrowse/mobx-state-tree").IModelType<{
121
+ configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
122
+ readonly rpc: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
123
+ readonly defaultDriver: {
124
+ readonly type: "string";
125
+ readonly description: "the RPC driver to run data fetching on: MainThreadRpcDriver or WebWorkerRpcDriver. Leave empty to use the default for this application";
126
+ readonly defaultValue: "";
127
+ readonly advanced: true;
128
+ };
129
+ readonly workerCount: {
130
+ readonly type: "number";
131
+ readonly description: "The number of workers to use. If 0 (the default) JBrowse will decide how many workers to use.";
132
+ readonly defaultValue: 0;
133
+ readonly advanced: true;
134
+ };
135
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
136
+ readonly hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
137
+ readonly sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
138
+ readonly trackNames: {
139
+ readonly type: "boolean";
140
+ readonly defaultValue: false;
141
+ };
142
+ readonly categories: {
143
+ readonly type: "boolean";
144
+ readonly defaultValue: false;
145
+ };
146
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
147
+ readonly defaultFolderCategories: {
148
+ readonly type: "stringArray";
149
+ readonly description: "list of category names to display as folders by default";
150
+ readonly defaultValue: readonly [];
151
+ };
152
+ readonly defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
153
+ readonly categoryNames: {
154
+ readonly type: "stringArray";
155
+ readonly defaultValue: readonly [];
156
+ };
157
+ readonly topLevelCategories: {
158
+ readonly type: "boolean";
159
+ readonly defaultValue: false;
160
+ };
161
+ readonly subCategories: {
162
+ readonly type: "boolean";
163
+ readonly defaultValue: false;
164
+ };
165
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
166
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
167
+ readonly preferences: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
168
+ readonly animationMode: {
169
+ readonly model: import("@jbrowse/mobx-state-tree").ISimpleType<"disabled" | "enabled" | "system">;
170
+ readonly type: "stringEnum";
171
+ readonly defaultValue: "enabled";
172
+ };
173
+ readonly scrollZoom: {
174
+ readonly type: "boolean";
175
+ readonly defaultValue: false;
176
+ };
177
+ readonly numberGrouping: {
178
+ readonly type: "boolean";
179
+ readonly defaultValue: true;
180
+ };
181
+ readonly useWorkspaces: {
182
+ readonly type: "boolean";
183
+ readonly defaultValue: false;
184
+ };
185
+ readonly developerMode: {
186
+ readonly type: "boolean";
187
+ readonly defaultValue: false;
188
+ };
189
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
190
+ readonly formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
191
+ readonly feature: {
192
+ readonly type: "frozen";
193
+ readonly description: "adds extra fields to the feature details";
194
+ readonly defaultValue: {};
195
+ readonly contextVariable: ["feature"];
196
+ };
197
+ readonly subfeatures: {
198
+ readonly type: "frozen";
199
+ readonly description: "adds extra fields to the subfeatures of a feature";
200
+ readonly defaultValue: {};
201
+ readonly contextVariable: ["feature"];
202
+ };
203
+ readonly depth: {
204
+ readonly type: "maybeNumber";
205
+ readonly description: "levels of subfeature the formatDetails.subfeatures callback runs on, default 2";
206
+ };
207
+ readonly maxDepth: {
208
+ readonly type: "maybeNumber";
209
+ readonly description: "hide subfeatures nested deeper than this, default no limit";
210
+ };
211
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
212
+ readonly formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
213
+ readonly config: {
214
+ readonly type: "frozen";
215
+ readonly description: "formats configuration object in about dialog";
216
+ readonly defaultValue: {};
217
+ readonly contextVariable: ["config"];
218
+ };
219
+ readonly hideUris: {
220
+ readonly type: "boolean";
221
+ readonly defaultValue: false;
222
+ };
223
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
224
+ readonly theme: {
225
+ readonly type: "frozen";
226
+ readonly defaultValue: {};
227
+ };
228
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
229
+ assembly: IAnyType;
230
+ tracks: import("@jbrowse/mobx-state-tree").IArrayType<IAnyType>;
231
+ internetAccounts: import("@jbrowse/mobx-state-tree").IArrayType<IAnyType>;
232
+ connections: import("@jbrowse/mobx-state-tree").IArrayType<IAnyType>;
233
+ aggregateTextSearchAdapters: import("@jbrowse/mobx-state-tree").IArrayType<IAnyType>;
234
+ plugins: import("@jbrowse/mobx-state-tree").IType<any, any, any>;
235
+ }, {
236
+ readonly assemblies: any[];
237
+ readonly assemblyName: string;
238
+ readonly rpcManager: RpcManager;
239
+ }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
240
+ export {};
@@ -0,0 +1,56 @@
1
+ import { ConfigurationSchema, FormatAboutConfigSchemaFactory, FormatDetailsConfigSchemaFactory, readConfObject, } from '@jbrowse/core/configuration';
2
+ import RpcManager from '@jbrowse/core/rpc/RpcManager';
3
+ import { expandLooseTrackConfig } from '@jbrowse/core/util/tracks';
4
+ import { getParent, types } from '@jbrowse/mobx-state-tree';
5
+ import { HierarchicalConfigSchemaFactory } from './HierarchicalConfig.js';
6
+ import { PreferencesConfigSchemaFactory } from './PreferencesConfig.js';
7
+ // A function rather than a module constant so it is still built once per
8
+ // createConfigModel call, as it was inline — what the function buys is a name
9
+ // for its type, since `SnapshotIn` of the model erases every slot name (a
10
+ // schema's MST props are assembled as a `Record<string, any>`).
11
+ function rootConfigurationSchema() {
12
+ return ConfigurationSchema('Root', {
13
+ rpc: RpcManager.configSchema,
14
+ hierarchical: HierarchicalConfigSchemaFactory(),
15
+ preferences: PreferencesConfigSchemaFactory(),
16
+ formatDetails: FormatDetailsConfigSchemaFactory(),
17
+ formatAbout: FormatAboutConfigSchemaFactory(),
18
+ theme: { type: 'frozen', defaultValue: {} },
19
+ });
20
+ }
21
+ export function createConfigModel(pluginManager, assemblyConfigSchemasType) {
22
+ return (types
23
+ .model('Configuration', {
24
+ configuration: rootConfigurationSchema(),
25
+ assembly: assemblyConfigSchemasType,
26
+ tracks: types.array(pluginManager.pluggableConfigSchemaType('track')),
27
+ internetAccounts: types.array(pluginManager.pluggableConfigSchemaType('internet account')),
28
+ connections: types.array(pluginManager.pluggableConfigSchemaType('connection')),
29
+ aggregateTextSearchAdapters: types.array(pluginManager.pluggableConfigSchemaType('text search adapter')),
30
+ plugins: types.frozen(),
31
+ })
32
+ // The one assembly is what every loose `{ trackId, uri }` track is on, so
33
+ // a snapshot need not repeat its name per track.
34
+ .preProcessSnapshot((snap) => {
35
+ const tracks = snap?.tracks;
36
+ const assemblyName = snap?.assembly
37
+ ?.name;
38
+ return Array.isArray(tracks)
39
+ ? {
40
+ ...snap,
41
+ tracks: tracks.map(t => expandLooseTrackConfig(t, pluginManager, assemblyName)),
42
+ }
43
+ : snap;
44
+ })
45
+ .views(self => ({
46
+ get assemblies() {
47
+ return [self.assembly];
48
+ },
49
+ get assemblyName() {
50
+ return readConfObject(self.assembly, 'name');
51
+ },
52
+ get rpcManager() {
53
+ return getParent(self).rpcManager;
54
+ },
55
+ })));
56
+ }
@@ -1,5 +1,10 @@
1
- export * from './BaseRootModel.ts';
2
- export * from './InternetAccounts.ts';
3
- export * from './FormatAbout.ts';
4
- export * from './FormatDetails.ts';
5
- export * from './HierarchicalConfig.ts';
1
+ export { BaseRootModelFactory, isRootModel } from './BaseRootModel.ts';
2
+ export type { BaseRootModel, BaseRootModelType } from './BaseRootModel.ts';
3
+ export { InternetAccountsRootModelMixin } from './InternetAccounts.ts';
4
+ export type { RootModelWithInternetAccounts, RootModelWithInternetAccountsType, } from './InternetAccounts.ts';
5
+ export { FormatAboutConfigSchemaFactory, FormatDetailsConfigSchemaFactory, } from '@jbrowse/core/configuration';
6
+ export { HierarchicalConfigSchemaFactory } from './HierarchicalConfig.ts';
7
+ export { PreferencesConfigSchemaFactory } from './PreferencesConfig.ts';
8
+ export { createConfigModel } from './createConfigModel.ts';
9
+ export type { RootConfigurationSnapshot } from './createConfigModel.ts';
10
+ export { exportSessionMenuItem, importSessionMenuItem, newSessionMenuItem, openConnectionMenuItem, openTrackMenuItem, pluginStoreMenuItem, preferencesMenuItem, redoMenuItem, undoMenuItem, workspacesMenuItem, } from './menuItems.ts';
@@ -1,5 +1,10 @@
1
- export * from "./BaseRootModel.js";
2
- export * from "./InternetAccounts.js";
3
- export * from "./FormatAbout.js";
4
- export * from "./FormatDetails.js";
5
- export * from "./HierarchicalConfig.js";
1
+ export { BaseRootModelFactory, isRootModel } from './BaseRootModel.js';
2
+ export { InternetAccountsRootModelMixin } from './InternetAccounts.js';
3
+ // re-exported rather than declared here: the same two schemas hang off every
4
+ // track config, so they live in core next to `createBaseTrackConfig` and this
5
+ // keeps the long-published `@jbrowse/product-core` spelling working
6
+ export { FormatAboutConfigSchemaFactory, FormatDetailsConfigSchemaFactory, } from '@jbrowse/core/configuration';
7
+ export { HierarchicalConfigSchemaFactory } from './HierarchicalConfig.js';
8
+ export { PreferencesConfigSchemaFactory } from './PreferencesConfig.js';
9
+ export { createConfigModel } from './createConfigModel.js';
10
+ export { exportSessionMenuItem, importSessionMenuItem, newSessionMenuItem, openConnectionMenuItem, openTrackMenuItem, pluginStoreMenuItem, preferencesMenuItem, redoMenuItem, undoMenuItem, workspacesMenuItem, } from './menuItems.js';
@@ -0,0 +1,24 @@
1
+ import type { SessionWithMultipleViews } from '../Session/index.ts';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
+ import type { MenuItem } from '@jbrowse/core/ui';
4
+ import type { DialogComponentType } from '@jbrowse/core/util';
5
+ interface RootWithDefaultSession {
6
+ setDefaultSession: () => void;
7
+ }
8
+ export declare function newSessionMenuItem(root: RootWithDefaultSession): MenuItem;
9
+ export declare function importSessionMenuItem(): MenuItem;
10
+ export declare function exportSessionMenuItem(): MenuItem;
11
+ export declare function openTrackMenuItem(): MenuItem;
12
+ export declare function openConnectionMenuItem(): MenuItem;
13
+ export declare function pluginStoreMenuItem(): MenuItem;
14
+ export declare function preferencesMenuItem(pluginManager: PluginManager, PreferencesDialog: DialogComponentType): MenuItem;
15
+ interface HistoryManager {
16
+ canUndo: boolean;
17
+ canRedo: boolean;
18
+ undo(): void;
19
+ redo(): void;
20
+ }
21
+ export declare function undoMenuItem(history: HistoryManager): MenuItem;
22
+ export declare function redoMenuItem(history: HistoryManager): MenuItem;
23
+ export declare function workspacesMenuItem(session: SessionWithMultipleViews | undefined): MenuItem;
24
+ export {};
@@ -0,0 +1,143 @@
1
+ import { Cable } from '@jbrowse/core/ui/Icons';
2
+ import AddIcon from '@mui/icons-material/Add';
3
+ import ExtensionIcon from '@mui/icons-material/Extension';
4
+ import GetAppIcon from '@mui/icons-material/GetApp';
5
+ import PublishIcon from '@mui/icons-material/Publish';
6
+ import RedoIcon from '@mui/icons-material/Redo';
7
+ import SettingsIcon from '@mui/icons-material/Settings';
8
+ import SpaceDashboardIcon from '@mui/icons-material/SpaceDashboard';
9
+ import StorageIcon from '@mui/icons-material/Storage';
10
+ import UndoIcon from '@mui/icons-material/Undo';
11
+ import { getShareableSessionSnapshot } from '../Session/index.js';
12
+ // the renderer binds the active session into each onClick (see AppToolbar's
13
+ // wrapMenuItems), so these handlers receive it as their argument
14
+ const MULTI_VIEW_WARNING = 'This will add a track to the first view. Note: if you want to open a track in a specific view open the track selector for that view and use the add track (plus icon) in the bottom right';
15
+ const WORKSPACES_HELP_TEXT = 'Workspaces allow you to organize views into tabs and tiles. There are a variety of unique features, for instance, you can drag views between tabs or split them side-by-side. Try clicking and dragging the tab header to create a new split';
16
+ export function newSessionMenuItem(root) {
17
+ return {
18
+ label: 'New session',
19
+ icon: AddIcon,
20
+ onClick: () => {
21
+ root.setDefaultSession();
22
+ },
23
+ };
24
+ }
25
+ export function importSessionMenuItem() {
26
+ return {
27
+ label: 'Import session...',
28
+ icon: PublishIcon,
29
+ onClick: (session) => {
30
+ session.showWidget(session.addWidget('ImportSessionWidget', 'importSessionWidget'));
31
+ },
32
+ };
33
+ }
34
+ export function exportSessionMenuItem() {
35
+ return {
36
+ label: 'Export session',
37
+ icon: GetAppIcon,
38
+ onClick: async (session) => {
39
+ const { saveAs } = await import('@jbrowse/core/util/FileSaver');
40
+ saveAs(new Blob([
41
+ JSON.stringify({
42
+ // an exported file is read by someone who doesn't have this
43
+ // browser's promoted display-type defaults, so flatten the
44
+ // cascade into it (same rule as ShareDialog)
45
+ session: getShareableSessionSnapshot(session),
46
+ }, null, 2),
47
+ ], { type: 'text/plain;charset=utf-8' }), 'session.json');
48
+ },
49
+ };
50
+ }
51
+ export function openTrackMenuItem() {
52
+ return {
53
+ label: 'Open track...',
54
+ icon: StorageIcon,
55
+ onClick: (session) => {
56
+ const firstView = session.views[0];
57
+ if (!firstView) {
58
+ session.notify('Please open a view to add a track first');
59
+ }
60
+ else {
61
+ const widget = session.addWidget('AddTrackWidget', 'addTrackWidget', {
62
+ view: firstView.id,
63
+ });
64
+ session.showWidget(widget);
65
+ if (session.views.length > 1) {
66
+ session.notify(MULTI_VIEW_WARNING);
67
+ }
68
+ }
69
+ },
70
+ };
71
+ }
72
+ export function openConnectionMenuItem() {
73
+ return {
74
+ label: 'Open connection...',
75
+ icon: Cable,
76
+ onClick: (session) => {
77
+ const widget = session.addWidget('AddConnectionWidget', 'addConnectionWidget');
78
+ session.showWidget(widget);
79
+ },
80
+ };
81
+ }
82
+ export function pluginStoreMenuItem() {
83
+ return {
84
+ label: 'Plugin store',
85
+ icon: ExtensionIcon,
86
+ onClick: (session) => {
87
+ session.showWidget(session.addWidget('PluginStoreWidget', 'pluginStoreWidget'));
88
+ },
89
+ };
90
+ }
91
+ // the dialog component differs per product, so it is passed in rather than
92
+ // imported; typing it as DialogComponentType lets queueDialog accept it with no
93
+ // cast (the inline call sites needed `as BaseSession` to reach queueDialog)
94
+ export function preferencesMenuItem(pluginManager, PreferencesDialog) {
95
+ return {
96
+ label: 'Preferences',
97
+ icon: SettingsIcon,
98
+ onClick: (session) => {
99
+ session.queueDialog(handleClose => [
100
+ PreferencesDialog,
101
+ { session, pluginManager, handleClose },
102
+ ]);
103
+ },
104
+ };
105
+ }
106
+ export function undoMenuItem(history) {
107
+ return {
108
+ label: 'Undo',
109
+ icon: UndoIcon,
110
+ onClick: () => {
111
+ if (history.canUndo) {
112
+ history.undo();
113
+ }
114
+ },
115
+ };
116
+ }
117
+ export function redoMenuItem(history) {
118
+ return {
119
+ label: 'Redo',
120
+ icon: RedoIcon,
121
+ onClick: () => {
122
+ if (history.canRedo) {
123
+ history.redo();
124
+ }
125
+ },
126
+ };
127
+ }
128
+ export function workspacesMenuItem(session) {
129
+ return {
130
+ label: 'Use workspaces',
131
+ icon: SpaceDashboardIcon,
132
+ type: 'checkbox',
133
+ checked: session?.effectiveUseWorkspaces ?? false,
134
+ helpText: WORKSPACES_HELP_TEXT,
135
+ // opts out of the checkbox "stay open" default: this re-lays out the whole
136
+ // app (classic stack <-> tiled workspace), so it's a one-shot mode switch
137
+ // rather than a setting to flip repeatedly with the menu up
138
+ keepMenuOpen: false,
139
+ onClick: () => {
140
+ session?.setUseWorkspacesPreference(!session.effectiveUseWorkspaces);
141
+ },
142
+ };
143
+ }