@jbrowse/product-core 4.2.1 → 5.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/RootModel/BaseRootModel.d.ts +629 -304
- package/esm/RootModel/BaseRootModel.js +138 -14
- package/esm/RootModel/HierarchicalConfig.d.ts +57 -21
- package/esm/RootModel/HierarchicalConfig.js +36 -0
- package/esm/RootModel/InternetAccounts.d.ts +18 -1
- package/esm/RootModel/InternetAccounts.js +120 -22
- package/esm/RootModel/PreferencesConfig.d.ts +53 -0
- package/esm/RootModel/PreferencesConfig.js +61 -0
- package/esm/RootModel/createConfigModel.d.ts +232 -0
- package/esm/RootModel/createConfigModel.js +56 -0
- package/esm/RootModel/index.d.ts +10 -5
- package/esm/RootModel/index.js +10 -5
- package/esm/RootModel/menuItems.d.ts +24 -0
- package/esm/RootModel/menuItems.js +143 -0
- package/esm/Session/BaseSession.d.ts +310 -11
- package/esm/Session/BaseSession.js +448 -14
- package/esm/Session/Connections.d.ts +114 -8
- package/esm/Session/Connections.js +195 -74
- package/esm/Session/DrawerWidgets.d.ts +115 -12
- package/esm/Session/DrawerWidgets.js +161 -42
- package/esm/Session/MultipleViews.d.ts +1266 -1128
- package/esm/Session/MultipleViews.js +357 -66
- package/esm/Session/Preferences.d.ts +1665 -0
- package/esm/Session/Preferences.js +54 -0
- package/esm/Session/ReferenceManagement.d.ts +28 -3
- package/esm/Session/ReferenceManagement.js +56 -41
- package/esm/Session/SessionTracks.d.ts +1275 -1138
- package/esm/Session/SessionTracks.js +532 -35
- package/esm/Session/Themes.d.ts +87 -2
- package/esm/Session/Themes.js +156 -23
- package/esm/Session/TrackMenu.d.ts +112 -0
- package/esm/Session/TrackMenu.js +200 -0
- package/esm/Session/TrackMenuSessionMixin.d.ts +27 -0
- package/esm/Session/TrackMenuSessionMixin.js +41 -0
- package/esm/Session/Tracks.d.ts +1169 -1117
- package/esm/Session/Tracks.js +160 -20
- package/esm/Session/assertSessionModel.d.ts +21 -0
- package/esm/Session/assertSessionModel.js +1 -0
- package/esm/Session/finalizeSession.d.ts +16 -0
- package/esm/Session/finalizeSession.js +29 -0
- package/esm/Session/index.d.ts +22 -10
- package/esm/Session/index.js +13 -10
- package/esm/Session/shareableSnapshot.d.ts +77 -0
- package/esm/Session/shareableSnapshot.js +196 -0
- package/esm/Session/temporaryAssemblyTracks.d.ts +23 -0
- package/esm/Session/temporaryAssemblyTracks.js +38 -0
- package/esm/assertExtends.d.ts +55 -0
- package/esm/assertExtends.js +1 -0
- package/esm/controllerTracks.d.ts +56 -0
- package/esm/controllerTracks.js +77 -0
- package/esm/destroyViewState.d.ts +21 -0
- package/esm/destroyViewState.js +29 -0
- package/esm/index.d.ts +31 -4
- package/esm/index.js +31 -4
- package/esm/loadPlugins.d.ts +33 -0
- package/esm/loadPlugins.js +38 -0
- package/esm/localFiles.d.ts +74 -0
- package/esm/localFiles.js +156 -0
- package/esm/observeSession.d.ts +56 -0
- package/esm/observeSession.js +91 -0
- package/esm/pluginInput.d.ts +32 -0
- package/esm/pluginInput.js +19 -0
- package/esm/pruneUnbuildableNodes.d.ts +109 -0
- package/esm/pruneUnbuildableNodes.js +568 -0
- package/esm/resolveAssemblies.d.ts +44 -0
- package/esm/resolveAssemblies.js +55 -0
- package/esm/rpcWorker.d.ts +26 -0
- package/esm/rpcWorker.js +96 -15
- package/esm/scheduleDetachedDestroy.d.ts +18 -0
- package/esm/scheduleDetachedDestroy.js +24 -0
- package/esm/sessionMigrations/index.d.ts +53 -0
- package/esm/sessionMigrations/index.js +432 -0
- package/esm/sessionUrl.d.ts +41 -0
- package/esm/sessionUrl.js +53 -0
- package/esm/sessionUtils.d.ts +69 -0
- package/esm/sessionUtils.js +613 -0
- package/esm/siblingCast.d.ts +14 -0
- package/esm/siblingCast.js +16 -0
- package/esm/snapshotUtils.d.ts +8 -0
- package/esm/snapshotUtils.js +12 -0
- package/esm/ui/AboutDialog.d.ts +3 -6
- package/esm/ui/AboutDialog.js +4 -4
- package/esm/ui/AboutDialogContents.d.ts +2 -6
- package/esm/ui/AboutDialogContents.js +34 -13
- package/esm/ui/AssemblyInfoPanel.d.ts +5 -0
- package/esm/ui/AssemblyInfoPanel.js +69 -0
- package/esm/ui/DisplayDefaultsSection.d.ts +36 -0
- package/esm/ui/DisplayDefaultsSection.js +65 -0
- package/esm/ui/Drawer.d.ts +21 -0
- package/esm/ui/Drawer.js +60 -0
- package/esm/ui/DrawerControls.d.ts +5 -0
- package/esm/ui/DrawerControls.js +28 -0
- package/esm/ui/DrawerHeader.d.ts +6 -0
- package/esm/ui/DrawerHeader.js +36 -0
- package/esm/ui/DrawerWidget.d.ts +5 -0
- package/esm/ui/DrawerWidget.js +12 -0
- package/esm/ui/DrawerWidgetSelector.d.ts +5 -0
- package/esm/ui/DrawerWidgetSelector.js +40 -0
- package/esm/ui/FileInfoPanel.d.ts +3 -6
- package/esm/ui/FileInfoPanel.js +35 -26
- package/esm/ui/HeaderButtons.d.ts +7 -1
- package/esm/ui/HeaderButtons.js +23 -18
- package/esm/ui/ModalWidget.d.ts +12 -0
- package/esm/ui/ModalWidget.js +33 -0
- package/esm/ui/ModalWidgetAppBar.d.ts +8 -0
- package/esm/ui/ModalWidgetAppBar.js +9 -0
- package/esm/ui/PreferencesDialog.d.ts +56 -0
- package/esm/ui/PreferencesDialog.js +145 -0
- package/esm/ui/PreferencesResetDialog.d.ts +8 -0
- package/esm/ui/PreferencesResetDialog.js +19 -0
- package/esm/ui/RefNameAliasesDialog.d.ts +9 -0
- package/esm/ui/RefNameAliasesDialog.js +65 -0
- package/esm/ui/RefNameInfoDialog.d.ts +3 -6
- package/esm/ui/RefNameInfoDialog.js +57 -63
- package/esm/ui/WidgetBody.d.ts +18 -0
- package/esm/ui/WidgetBody.js +22 -0
- package/esm/ui/WidgetHeading.d.ts +7 -0
- package/esm/ui/WidgetHeading.js +7 -0
- package/esm/ui/drawerLayout.d.ts +18 -0
- package/esm/ui/drawerLayout.js +22 -0
- package/esm/ui/index.d.ts +13 -1
- package/esm/ui/index.js +12 -1
- package/esm/ui/util.d.ts +37 -4
- package/esm/ui/util.js +35 -38
- package/esm/useEngineLifecycle.d.ts +13 -0
- package/esm/useEngineLifecycle.js +22 -0
- package/package.json +11 -15
- package/esm/RootModel/FormatAbout.d.ts +0 -12
- package/esm/RootModel/FormatAbout.js +0 -15
- package/esm/RootModel/FormatDetails.d.ts +0 -24
- package/esm/RootModel/FormatDetails.js +0 -27
- package/esm/Session/DialogQueue.d.ts +0 -17
- package/esm/Session/DialogQueue.js +0 -31
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
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
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
70
|
+
readonly formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
71
|
+
readonly feature: {
|
|
72
|
+
readonly type: "frozen";
|
|
73
|
+
readonly description: "adds extra fields to the feature details";
|
|
74
|
+
readonly defaultValue: {};
|
|
75
|
+
readonly contextVariable: ["feature"];
|
|
76
|
+
};
|
|
77
|
+
readonly subfeatures: {
|
|
78
|
+
readonly type: "frozen";
|
|
79
|
+
readonly description: "adds extra fields to the subfeatures of a feature";
|
|
80
|
+
readonly defaultValue: {};
|
|
81
|
+
readonly contextVariable: ["feature"];
|
|
82
|
+
};
|
|
83
|
+
readonly depth: {
|
|
84
|
+
readonly type: "maybeNumber";
|
|
85
|
+
readonly description: "levels of subfeature the formatDetails.subfeatures callback runs on, default 2";
|
|
86
|
+
};
|
|
87
|
+
readonly maxDepth: {
|
|
88
|
+
readonly type: "maybeNumber";
|
|
89
|
+
readonly description: "hide subfeatures nested deeper than this, default no limit";
|
|
90
|
+
};
|
|
91
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
92
|
+
readonly formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
93
|
+
readonly config: {
|
|
94
|
+
readonly type: "frozen";
|
|
95
|
+
readonly description: "formats configuration object in about dialog";
|
|
96
|
+
readonly defaultValue: {};
|
|
97
|
+
readonly contextVariable: ["config"];
|
|
98
|
+
};
|
|
99
|
+
readonly hideUris: {
|
|
100
|
+
readonly type: "boolean";
|
|
101
|
+
readonly defaultValue: false;
|
|
102
|
+
};
|
|
103
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
104
|
+
readonly theme: {
|
|
105
|
+
readonly type: "frozen";
|
|
106
|
+
readonly defaultValue: {};
|
|
107
|
+
};
|
|
108
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
109
|
+
/**
|
|
110
|
+
* What an embedder may put in `createViewState`'s `configuration` option: every
|
|
111
|
+
* root slot and sub-schema by name, values unchecked. Derived from the schema
|
|
112
|
+
* above rather than restated, so a slot added there is spellable here the same
|
|
113
|
+
* day.
|
|
114
|
+
*/
|
|
115
|
+
export type RootConfigurationSnapshot = ConfigurationSnapshot<ReturnType<typeof rootConfigurationSchema>>;
|
|
116
|
+
export declare function createConfigModel(pluginManager: PluginManager, assemblyConfigSchemasType: IAnyType): import("@jbrowse/mobx-state-tree").IModelType<{
|
|
117
|
+
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
118
|
+
readonly rpc: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
119
|
+
readonly defaultDriver: {
|
|
120
|
+
readonly type: "string";
|
|
121
|
+
readonly description: "the RPC driver to run data fetching on: MainThreadRpcDriver or WebWorkerRpcDriver. Leave empty to use the default for this application";
|
|
122
|
+
readonly defaultValue: "";
|
|
123
|
+
readonly advanced: true;
|
|
124
|
+
};
|
|
125
|
+
readonly workerCount: {
|
|
126
|
+
readonly type: "number";
|
|
127
|
+
readonly description: "The number of workers to use. If 0 (the default) JBrowse will decide how many workers to use.";
|
|
128
|
+
readonly defaultValue: 0;
|
|
129
|
+
readonly advanced: true;
|
|
130
|
+
};
|
|
131
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
132
|
+
readonly hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
133
|
+
readonly sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
134
|
+
readonly trackNames: {
|
|
135
|
+
readonly type: "boolean";
|
|
136
|
+
readonly defaultValue: false;
|
|
137
|
+
};
|
|
138
|
+
readonly categories: {
|
|
139
|
+
readonly type: "boolean";
|
|
140
|
+
readonly defaultValue: false;
|
|
141
|
+
};
|
|
142
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
143
|
+
readonly defaultFolderCategories: {
|
|
144
|
+
readonly type: "stringArray";
|
|
145
|
+
readonly description: "list of category names to display as folders by default";
|
|
146
|
+
readonly defaultValue: readonly [];
|
|
147
|
+
};
|
|
148
|
+
readonly defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
149
|
+
readonly categoryNames: {
|
|
150
|
+
readonly type: "stringArray";
|
|
151
|
+
readonly defaultValue: readonly [];
|
|
152
|
+
};
|
|
153
|
+
readonly topLevelCategories: {
|
|
154
|
+
readonly type: "boolean";
|
|
155
|
+
readonly defaultValue: false;
|
|
156
|
+
};
|
|
157
|
+
readonly subCategories: {
|
|
158
|
+
readonly type: "boolean";
|
|
159
|
+
readonly defaultValue: false;
|
|
160
|
+
};
|
|
161
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
162
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
163
|
+
readonly preferences: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
164
|
+
readonly animationMode: {
|
|
165
|
+
readonly model: import("@jbrowse/mobx-state-tree").ISimpleType<"disabled" | "enabled" | "system">;
|
|
166
|
+
readonly type: "stringEnum";
|
|
167
|
+
readonly defaultValue: "enabled";
|
|
168
|
+
};
|
|
169
|
+
readonly scrollZoom: {
|
|
170
|
+
readonly type: "boolean";
|
|
171
|
+
readonly defaultValue: false;
|
|
172
|
+
};
|
|
173
|
+
readonly numberGrouping: {
|
|
174
|
+
readonly type: "boolean";
|
|
175
|
+
readonly defaultValue: true;
|
|
176
|
+
};
|
|
177
|
+
readonly useWorkspaces: {
|
|
178
|
+
readonly type: "boolean";
|
|
179
|
+
readonly defaultValue: false;
|
|
180
|
+
};
|
|
181
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
182
|
+
readonly formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
183
|
+
readonly feature: {
|
|
184
|
+
readonly type: "frozen";
|
|
185
|
+
readonly description: "adds extra fields to the feature details";
|
|
186
|
+
readonly defaultValue: {};
|
|
187
|
+
readonly contextVariable: ["feature"];
|
|
188
|
+
};
|
|
189
|
+
readonly subfeatures: {
|
|
190
|
+
readonly type: "frozen";
|
|
191
|
+
readonly description: "adds extra fields to the subfeatures of a feature";
|
|
192
|
+
readonly defaultValue: {};
|
|
193
|
+
readonly contextVariable: ["feature"];
|
|
194
|
+
};
|
|
195
|
+
readonly depth: {
|
|
196
|
+
readonly type: "maybeNumber";
|
|
197
|
+
readonly description: "levels of subfeature the formatDetails.subfeatures callback runs on, default 2";
|
|
198
|
+
};
|
|
199
|
+
readonly maxDepth: {
|
|
200
|
+
readonly type: "maybeNumber";
|
|
201
|
+
readonly description: "hide subfeatures nested deeper than this, default no limit";
|
|
202
|
+
};
|
|
203
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
204
|
+
readonly formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
205
|
+
readonly config: {
|
|
206
|
+
readonly type: "frozen";
|
|
207
|
+
readonly description: "formats configuration object in about dialog";
|
|
208
|
+
readonly defaultValue: {};
|
|
209
|
+
readonly contextVariable: ["config"];
|
|
210
|
+
};
|
|
211
|
+
readonly hideUris: {
|
|
212
|
+
readonly type: "boolean";
|
|
213
|
+
readonly defaultValue: false;
|
|
214
|
+
};
|
|
215
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
216
|
+
readonly theme: {
|
|
217
|
+
readonly type: "frozen";
|
|
218
|
+
readonly defaultValue: {};
|
|
219
|
+
};
|
|
220
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
221
|
+
assembly: IAnyType;
|
|
222
|
+
tracks: import("@jbrowse/mobx-state-tree").IArrayType<IAnyType>;
|
|
223
|
+
internetAccounts: import("@jbrowse/mobx-state-tree").IArrayType<IAnyType>;
|
|
224
|
+
connections: import("@jbrowse/mobx-state-tree").IArrayType<IAnyType>;
|
|
225
|
+
aggregateTextSearchAdapters: import("@jbrowse/mobx-state-tree").IArrayType<IAnyType>;
|
|
226
|
+
plugins: import("@jbrowse/mobx-state-tree").IType<any, any, any>;
|
|
227
|
+
}, {
|
|
228
|
+
readonly assemblies: any[];
|
|
229
|
+
readonly assemblyName: string;
|
|
230
|
+
readonly rpcManager: RpcManager;
|
|
231
|
+
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
232
|
+
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
|
+
}
|
package/esm/RootModel/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
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';
|
package/esm/RootModel/index.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
}
|