@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
@@ -0,0 +1,257 @@
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
+ type: "string";
9
+ } & {
10
+ defaultValue: string;
11
+ };
12
+ readonly workerCount: {
13
+ type: "number";
14
+ } & {
15
+ defaultValue: number;
16
+ };
17
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
18
+ readonly hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
19
+ readonly sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
20
+ readonly trackNames: {
21
+ type: "boolean";
22
+ } & {
23
+ defaultValue: boolean;
24
+ };
25
+ readonly categories: {
26
+ type: "boolean";
27
+ } & {
28
+ defaultValue: boolean;
29
+ };
30
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
31
+ readonly defaultFolderCategories: {
32
+ type: "stringArray";
33
+ } & {
34
+ defaultValue: unknown;
35
+ };
36
+ readonly defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
37
+ readonly categoryNames: {
38
+ type: "stringArray";
39
+ } & {
40
+ defaultValue: unknown;
41
+ };
42
+ readonly topLevelCategories: {
43
+ type: "boolean";
44
+ } & {
45
+ defaultValue: boolean;
46
+ };
47
+ readonly subCategories: {
48
+ type: "boolean";
49
+ } & {
50
+ defaultValue: boolean;
51
+ };
52
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
53
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
54
+ readonly preferences: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
55
+ readonly animationMode: {
56
+ type: "stringEnum";
57
+ } & {
58
+ model: import("@jbrowse/mobx-state-tree").ISimpleType<"disabled" | "enabled" | "system">;
59
+ } & {
60
+ defaultValue: string;
61
+ };
62
+ readonly scrollZoom: {
63
+ type: "boolean";
64
+ } & {
65
+ defaultValue: boolean;
66
+ };
67
+ readonly numberGrouping: {
68
+ type: "boolean";
69
+ } & {
70
+ defaultValue: boolean;
71
+ };
72
+ readonly useWorkspaces: {
73
+ type: "boolean";
74
+ } & {
75
+ defaultValue: boolean;
76
+ };
77
+ readonly developerMode: {
78
+ type: "boolean";
79
+ } & {
80
+ defaultValue: boolean;
81
+ };
82
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
83
+ readonly formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
84
+ readonly feature: {
85
+ type: "frozen";
86
+ } & {
87
+ defaultValue: unknown;
88
+ };
89
+ readonly subfeatures: {
90
+ type: "frozen";
91
+ } & {
92
+ defaultValue: unknown;
93
+ };
94
+ readonly depth: {
95
+ type: "maybeNumber";
96
+ };
97
+ readonly maxDepth: {
98
+ type: "maybeNumber";
99
+ };
100
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
101
+ readonly formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
102
+ readonly config: {
103
+ type: "frozen";
104
+ } & {
105
+ defaultValue: unknown;
106
+ };
107
+ readonly hideUris: {
108
+ type: "boolean";
109
+ } & {
110
+ defaultValue: boolean;
111
+ };
112
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
113
+ readonly theme: {
114
+ type: "frozen";
115
+ } & {
116
+ defaultValue: unknown;
117
+ };
118
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
119
+ /**
120
+ * What an embedder may put in `createViewState`'s `configuration` option: every
121
+ * root slot and sub-schema by name, values unchecked. Derived from the schema
122
+ * above rather than restated, so a slot added there is spellable here the same
123
+ * day.
124
+ */
125
+ export type RootConfigurationSnapshot = ConfigurationSnapshot<ReturnType<typeof rootConfigurationSchema>>;
126
+ export declare function createConfigModel(pluginManager: PluginManager, assemblyConfigSchemasType: IAnyType): import("@jbrowse/mobx-state-tree").IModelType<{
127
+ configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
128
+ readonly rpc: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
129
+ readonly defaultDriver: {
130
+ type: "string";
131
+ } & {
132
+ defaultValue: string;
133
+ };
134
+ readonly workerCount: {
135
+ type: "number";
136
+ } & {
137
+ defaultValue: number;
138
+ };
139
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
140
+ readonly hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
141
+ readonly sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
142
+ readonly trackNames: {
143
+ type: "boolean";
144
+ } & {
145
+ defaultValue: boolean;
146
+ };
147
+ readonly categories: {
148
+ type: "boolean";
149
+ } & {
150
+ defaultValue: boolean;
151
+ };
152
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
153
+ readonly defaultFolderCategories: {
154
+ type: "stringArray";
155
+ } & {
156
+ defaultValue: unknown;
157
+ };
158
+ readonly defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
159
+ readonly categoryNames: {
160
+ type: "stringArray";
161
+ } & {
162
+ defaultValue: unknown;
163
+ };
164
+ readonly topLevelCategories: {
165
+ type: "boolean";
166
+ } & {
167
+ defaultValue: boolean;
168
+ };
169
+ readonly subCategories: {
170
+ type: "boolean";
171
+ } & {
172
+ defaultValue: boolean;
173
+ };
174
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
175
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
176
+ readonly preferences: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
177
+ readonly animationMode: {
178
+ type: "stringEnum";
179
+ } & {
180
+ model: import("@jbrowse/mobx-state-tree").ISimpleType<"disabled" | "enabled" | "system">;
181
+ } & {
182
+ defaultValue: string;
183
+ };
184
+ readonly scrollZoom: {
185
+ type: "boolean";
186
+ } & {
187
+ defaultValue: boolean;
188
+ };
189
+ readonly numberGrouping: {
190
+ type: "boolean";
191
+ } & {
192
+ defaultValue: boolean;
193
+ };
194
+ readonly useWorkspaces: {
195
+ type: "boolean";
196
+ } & {
197
+ defaultValue: boolean;
198
+ };
199
+ readonly developerMode: {
200
+ type: "boolean";
201
+ } & {
202
+ defaultValue: boolean;
203
+ };
204
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
205
+ readonly formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
206
+ readonly feature: {
207
+ type: "frozen";
208
+ } & {
209
+ defaultValue: unknown;
210
+ };
211
+ readonly subfeatures: {
212
+ type: "frozen";
213
+ } & {
214
+ defaultValue: unknown;
215
+ };
216
+ readonly depth: {
217
+ type: "maybeNumber";
218
+ };
219
+ readonly maxDepth: {
220
+ type: "maybeNumber";
221
+ };
222
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
223
+ readonly formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
224
+ readonly config: {
225
+ type: "frozen";
226
+ } & {
227
+ defaultValue: unknown;
228
+ };
229
+ readonly hideUris: {
230
+ type: "boolean";
231
+ } & {
232
+ defaultValue: boolean;
233
+ };
234
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
235
+ readonly theme: {
236
+ type: "frozen";
237
+ } & {
238
+ defaultValue: unknown;
239
+ };
240
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
241
+ /**
242
+ * One genome in the ordinary case, several where the view draws them
243
+ * together — a circular view's synteny ribbons need both ends of an
244
+ * alignment on the circle. The order is the order a view lays them out
245
+ * in.
246
+ */
247
+ assemblies: import("@jbrowse/mobx-state-tree").IArrayType<IAnyType>;
248
+ tracks: import("@jbrowse/mobx-state-tree").IType<Record<string, unknown>[] | null | undefined, Record<string, unknown>[], Record<string, unknown>[]>;
249
+ internetAccounts: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/PluginManager").PluggableConfigSchemaType>;
250
+ connections: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/PluginManager").PluggableConfigSchemaType>;
251
+ aggregateTextSearchAdapters: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/PluginManager").PluggableConfigSchemaType>;
252
+ plugins: import("@jbrowse/mobx-state-tree").IType<any, any, any>;
253
+ }, {
254
+ readonly assemblyNames: string[];
255
+ readonly rpcManager: RpcManager;
256
+ }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
257
+ export {};
@@ -0,0 +1,77 @@
1
+ import { ConfigurationSchema, FormatAboutConfigSchemaFactory, FormatDetailsConfigSchemaFactory, readConfObject, } from '@jbrowse/core/configuration';
2
+ import { migrateRetiredDisplays } from '@jbrowse/core/pluggableElementTypes/models';
3
+ import RpcManager from '@jbrowse/core/rpc/RpcManager';
4
+ import { expandLooseSearchIndex } from '@jbrowse/core/util/expandLooseSearchIndex';
5
+ import { expandLooseTrackConfig } from '@jbrowse/core/util/tracks';
6
+ import { getParent, types } from '@jbrowse/mobx-state-tree';
7
+ import { HierarchicalConfigSchemaFactory } from './HierarchicalConfig.js';
8
+ import { PreferencesConfigSchemaFactory } from './PreferencesConfig.js';
9
+ // A function rather than a module constant so it is still built once per
10
+ // createConfigModel call, as it was inline — what the function buys is a name
11
+ // for its type, since `SnapshotIn` of the model erases every slot name (a
12
+ // schema's MST props are assembled as a `Record<string, any>`).
13
+ function rootConfigurationSchema() {
14
+ return ConfigurationSchema('Root', {
15
+ rpc: RpcManager.configSchema,
16
+ hierarchical: HierarchicalConfigSchemaFactory(),
17
+ preferences: PreferencesConfigSchemaFactory(),
18
+ formatDetails: FormatDetailsConfigSchemaFactory(),
19
+ formatAbout: FormatAboutConfigSchemaFactory(),
20
+ theme: { type: 'frozen', defaultValue: {} },
21
+ });
22
+ }
23
+ export function createConfigModel(pluginManager, assemblyConfigSchemasType) {
24
+ return (types
25
+ .model('Configuration', {
26
+ configuration: rootConfigurationSchema(),
27
+ /**
28
+ * One genome in the ordinary case, several where the view draws them
29
+ * together — a circular view's synteny ribbons need both ends of an
30
+ * alignment on the circle. The order is the order a view lays them out
31
+ * in.
32
+ */
33
+ assemblies: types.array(assemblyConfigSchemasType),
34
+ tracks: types.frozen([]),
35
+ internetAccounts: types.array(pluginManager.pluggableConfigSchemaType('internet account')),
36
+ connections: types.array(pluginManager.pluggableConfigSchemaType('connection')),
37
+ aggregateTextSearchAdapters: types.array(pluginManager.pluggableConfigSchemaType('text search adapter')),
38
+ plugins: types.frozen(),
39
+ })
40
+ // The first assembly is what every loose `{ trackId, uri }` track is on,
41
+ // so a snapshot need not repeat its name per track. `tracks` is frozen,
42
+ // so a retired display type stays spelt as written until the track
43
+ // hydrates — and the track selector reads these entries before that, so
44
+ // they carry the current name here as they do in app-core's JBrowseModel.
45
+ .preProcessSnapshot((snap) => {
46
+ const { tracks, aggregateTextSearchAdapters: indexes } = snap ?? {};
47
+ const assemblyName = snap?.assemblies?.[0]?.name;
48
+ return snap
49
+ ? {
50
+ ...snap,
51
+ ...(Array.isArray(tracks)
52
+ ? {
53
+ tracks: tracks.map(t => {
54
+ const track = expandLooseTrackConfig(t, pluginManager, assemblyName);
55
+ return track && typeof track === 'object'
56
+ ? migrateRetiredDisplays(pluginManager, track)
57
+ : track;
58
+ }),
59
+ }
60
+ : {}),
61
+ ...(Array.isArray(indexes)
62
+ ? {
63
+ aggregateTextSearchAdapters: indexes.map(i => expandLooseSearchIndex(i, assemblyName ? [assemblyName] : undefined)),
64
+ }
65
+ : {}),
66
+ }
67
+ : snap;
68
+ })
69
+ .views(self => ({
70
+ get assemblyNames() {
71
+ return self.assemblies.map(a => readConfObject(a, 'name'));
72
+ },
73
+ get rpcManager() {
74
+ return getParent(self).rpcManager;
75
+ },
76
+ })));
77
+ }
@@ -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,141 @@
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.openWidget('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 whose own preferences
43
+ // differ, so stamp what the live session resolves at read
44
+ // time (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
+ session.openWidget('AddTrackWidget', 'addTrackWidget', {
62
+ view: firstView.id,
63
+ });
64
+ if (session.views.length > 1) {
65
+ session.notify(MULTI_VIEW_WARNING);
66
+ }
67
+ }
68
+ },
69
+ };
70
+ }
71
+ export function openConnectionMenuItem() {
72
+ return {
73
+ label: 'Open connection...',
74
+ icon: Cable,
75
+ onClick: (session) => {
76
+ session.openWidget('AddConnectionWidget', 'addConnectionWidget');
77
+ },
78
+ };
79
+ }
80
+ export function pluginStoreMenuItem() {
81
+ return {
82
+ label: 'Plugin store',
83
+ icon: ExtensionIcon,
84
+ onClick: (session) => {
85
+ session.openWidget('PluginStoreWidget', 'pluginStoreWidget');
86
+ },
87
+ };
88
+ }
89
+ // the dialog component differs per product, so it is passed in rather than
90
+ // imported; typing it as DialogComponentType lets queueDialog accept it with no
91
+ // cast (the inline call sites needed `as BaseSession` to reach queueDialog)
92
+ export function preferencesMenuItem(pluginManager, PreferencesDialog) {
93
+ return {
94
+ label: 'Preferences',
95
+ icon: SettingsIcon,
96
+ onClick: (session) => {
97
+ session.queueDialog(handleClose => [
98
+ PreferencesDialog,
99
+ { session, pluginManager, handleClose },
100
+ ]);
101
+ },
102
+ };
103
+ }
104
+ export function undoMenuItem(history) {
105
+ return {
106
+ label: 'Undo',
107
+ icon: UndoIcon,
108
+ onClick: () => {
109
+ if (history.canUndo) {
110
+ history.undo();
111
+ }
112
+ },
113
+ };
114
+ }
115
+ export function redoMenuItem(history) {
116
+ return {
117
+ label: 'Redo',
118
+ icon: RedoIcon,
119
+ onClick: () => {
120
+ if (history.canRedo) {
121
+ history.redo();
122
+ }
123
+ },
124
+ };
125
+ }
126
+ export function workspacesMenuItem(session) {
127
+ return {
128
+ label: 'Use workspaces',
129
+ icon: SpaceDashboardIcon,
130
+ type: 'checkbox',
131
+ checked: session?.effectiveUseWorkspaces ?? false,
132
+ helpText: WORKSPACES_HELP_TEXT,
133
+ // opts out of the checkbox "stay open" default: this re-lays out the whole
134
+ // app (classic stack <-> tiled workspace), so it's a one-shot mode switch
135
+ // rather than a setting to flip repeatedly with the menu up
136
+ keepMenuOpen: false,
137
+ onClick: () => {
138
+ session?.setUseWorkspacesPreference(!session.effectiveUseWorkspaces);
139
+ },
140
+ };
141
+ }