@jbrowse/app-core 4.3.0 → 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/AppSession/AppRootModel.d.ts +30 -0
- package/esm/AppSession/AppRootModel.js +1 -0
- package/esm/AppSession/AppSessionMixin.d.ts +1598 -0
- package/esm/AppSession/AppSessionMixin.js +62 -0
- package/esm/AppSession/index.d.ts +2 -0
- package/esm/AppSession/index.js +1 -0
- package/esm/Assemblies/AssembliesMixin.d.ts +225 -0
- package/esm/Assemblies/AssembliesMixin.js +149 -0
- package/esm/Assemblies/index.d.ts +1 -2
- package/esm/Assemblies/index.js +1 -2
- package/esm/HistoryManagement/index.d.ts +19 -0
- package/esm/HistoryManagement/index.js +42 -5
- package/esm/JBrowseConfig/RootConfiguration.d.ts +167 -78
- package/esm/JBrowseConfig/RootConfiguration.js +85 -7
- package/esm/JBrowseConfig/index.d.ts +169 -84
- package/esm/JBrowseConfig/index.js +62 -2
- package/esm/JBrowseModel/index.d.ts +176 -95
- package/esm/JBrowseModel/index.js +122 -21
- package/esm/RootMenu/index.d.ts +77 -2
- package/esm/RootMenu/index.js +107 -61
- package/esm/SessionSpec/index.d.ts +6 -0
- package/esm/SessionSpec/index.js +3 -0
- package/esm/SessionSpec/lgvUrlInit.d.ts +79 -0
- package/esm/SessionSpec/lgvUrlInit.js +158 -0
- package/esm/SessionSpec/loadSessionSpec.d.ts +21 -0
- package/esm/SessionSpec/loadSessionSpec.js +311 -0
- package/esm/SessionSpec/parseSessionSpecUrl.d.ts +13 -0
- package/esm/SessionSpec/parseSessionSpecUrl.js +196 -0
- package/esm/SessionSpec/types.d.ts +33 -0
- package/esm/SessionSpec/types.js +1 -0
- package/esm/WorkspaceLayout/LayoutRenderer.d.ts +24 -0
- package/esm/WorkspaceLayout/LayoutRenderer.js +185 -0
- package/esm/WorkspaceLayout/PanelView.d.ts +13 -0
- package/esm/WorkspaceLayout/PanelView.js +99 -0
- package/esm/WorkspaceLayout/TabStrip.d.ts +14 -0
- package/esm/WorkspaceLayout/TabStrip.js +226 -0
- package/esm/WorkspaceLayout/WorkspaceContainer.d.ts +16 -0
- package/esm/WorkspaceLayout/WorkspaceContainer.js +105 -0
- package/esm/WorkspaceLayout/WorkspacePanelActions.d.ts +24 -0
- package/esm/WorkspaceLayout/WorkspacePanelActions.js +120 -0
- package/esm/WorkspaceLayout/WorkspaceTab.d.ts +27 -0
- package/esm/WorkspaceLayout/WorkspaceTab.js +109 -0
- package/esm/WorkspaceLayout/dockviewTheme.d.ts +69 -0
- package/esm/WorkspaceLayout/dockviewTheme.js +82 -0
- package/esm/WorkspaceLayout/dropZone.d.ts +105 -0
- package/esm/WorkspaceLayout/dropZone.js +113 -0
- package/esm/WorkspaceLayout/index.d.ts +8 -0
- package/esm/WorkspaceLayout/index.js +4 -0
- package/esm/WorkspaceLayout/model.d.ts +240 -0
- package/esm/WorkspaceLayout/model.js +527 -0
- package/esm/WorkspaceLayout/panelChrome.d.ts +19 -0
- package/esm/WorkspaceLayout/panelChrome.js +4 -0
- package/esm/WorkspaceLayout/spec.d.ts +58 -0
- package/esm/WorkspaceLayout/spec.js +153 -0
- package/esm/WorkspaceLayout/splitter.d.ts +25 -0
- package/esm/WorkspaceLayout/splitter.js +37 -0
- package/esm/WorkspaceLayout/tree.d.ts +158 -0
- package/esm/WorkspaceLayout/tree.js +379 -0
- package/esm/WorkspaceLayout/useLayoutDrag.d.ts +34 -0
- package/esm/WorkspaceLayout/useLayoutDrag.js +232 -0
- package/esm/index.d.ts +16 -9
- package/esm/index.js +13 -9
- package/esm/menus.d.ts +63 -62
- package/esm/menus.js +131 -84
- package/esm/queryParams.d.ts +9 -0
- package/esm/queryParams.js +92 -0
- package/esm/sessionModelFactory.d.ts +18 -0
- package/esm/sessionModelFactory.js +1 -0
- package/esm/ui/App/App.d.ts +3 -14
- package/esm/ui/App/App.js +30 -17
- package/esm/ui/App/AppFab.d.ts +12 -3
- package/esm/ui/App/AppFab.js +15 -8
- package/esm/ui/App/AppReadyMarker.d.ts +34 -0
- package/esm/ui/App/AppReadyMarker.js +56 -0
- package/esm/ui/App/AppToolbar.d.ts +2 -14
- package/esm/ui/App/AppToolbar.js +23 -24
- package/esm/ui/App/ClassicViewsContainer.d.ts +3 -9
- package/esm/ui/App/ClassicViewsContainer.js +9 -8
- package/esm/ui/App/DialogQueue.d.ts +17 -1
- package/esm/ui/App/DialogQueue.js +30 -1
- package/esm/ui/App/Drawer.d.ts +1 -1
- package/esm/ui/App/Drawer.js +10 -39
- package/esm/ui/App/DrawerControls.d.ts +1 -5
- package/esm/ui/App/DrawerControls.js +1 -25
- package/esm/ui/App/DrawerHeader.d.ts +2 -3
- package/esm/ui/App/DrawerHeader.js +24 -10
- package/esm/ui/App/DrawerHeaderHelpButton.d.ts +1 -1
- package/esm/ui/App/DrawerHeaderHelpButton.js +3 -3
- package/esm/ui/App/DrawerHeaderHelpDialog.d.ts +2 -2
- package/esm/ui/App/DrawerHeaderHelpDialog.js +3 -4
- package/esm/ui/App/DrawerWidget.d.ts +1 -1
- package/esm/ui/App/DrawerWidget.js +9 -21
- package/esm/ui/App/JBrowseTabMenu.d.ts +2 -3
- package/esm/ui/App/JBrowseTabMenu.js +24 -5
- package/esm/ui/App/ViewButtons.d.ts +2 -4
- package/esm/ui/App/ViewButtons.js +15 -3
- package/esm/ui/App/ViewContainer.d.ts +3 -2
- package/esm/ui/App/ViewContainer.js +144 -24
- package/esm/ui/App/ViewContainerTitle.d.ts +1 -1
- package/esm/ui/App/ViewContainerTitle.js +9 -2
- package/esm/ui/App/ViewErrorFallback.d.ts +18 -0
- package/esm/ui/App/ViewErrorFallback.js +42 -0
- package/esm/ui/App/ViewHeader.d.ts +3 -4
- package/esm/ui/App/ViewHeader.js +28 -17
- package/esm/ui/App/ViewLauncher.d.ts +2 -8
- package/esm/ui/App/ViewLauncher.js +7 -5
- package/esm/ui/App/ViewMenu.d.ts +3 -5
- package/esm/ui/App/ViewMenu.js +87 -92
- package/esm/ui/App/ViewStack.d.ts +7 -0
- package/esm/ui/App/ViewStack.js +42 -0
- package/esm/ui/App/ViewWrapper.d.ts +15 -1
- package/esm/ui/App/ViewWrapper.js +26 -10
- package/esm/ui/App/ViewsContainer.d.ts +3 -8
- package/esm/ui/App/ViewsContainer.js +9 -6
- package/esm/ui/App/copyView.js +1 -1
- package/esm/ui/App/index.d.ts +2 -1
- package/esm/ui/App/index.js +3 -2
- package/esm/ui/App/lazyChunk.d.ts +13 -0
- package/esm/ui/App/lazyChunk.js +91 -0
- package/esm/ui/App/types.d.ts +12 -3
- package/esm/ui/App/types.js +1 -1
- package/esm/ui/App/useViewVisibility.d.ts +34 -0
- package/esm/ui/App/useViewVisibility.js +87 -0
- package/esm/ui/App/viewTitle.d.ts +5 -0
- package/esm/ui/App/viewTitle.js +9 -0
- package/esm/ui/index.d.ts +1 -1
- package/esm/ui/index.js +1 -1
- package/package.json +12 -17
- package/esm/AppFocus/index.d.ts +0 -5
- package/esm/AppFocus/index.js +0 -12
- package/esm/Assemblies/SessionAssembliesMixin.d.ts +0 -92
- package/esm/Assemblies/SessionAssembliesMixin.js +0 -53
- package/esm/Assemblies/TemporaryAssembliesMixin.d.ts +0 -10
- package/esm/Assemblies/TemporaryAssembliesMixin.js +0 -37
- package/esm/DockviewLayout/index.d.ts +0 -35
- package/esm/DockviewLayout/index.js +0 -111
- package/esm/ui/App/DockviewContext.d.ts +0 -22
- package/esm/ui/App/DockviewContext.js +0 -29
- package/esm/ui/App/DockviewLeftHeaderActions.d.ts +0 -2
- package/esm/ui/App/DockviewLeftHeaderActions.js +0 -58
- package/esm/ui/App/DockviewRightHeaderActions.d.ts +0 -2
- package/esm/ui/App/DockviewRightHeaderActions.js +0 -100
- package/esm/ui/App/DrawerWidgetSelector.d.ts +0 -5
- package/esm/ui/App/DrawerWidgetSelector.js +0 -47
- package/esm/ui/App/JBrowseViewPanel.d.ts +0 -8
- package/esm/ui/App/JBrowseViewPanel.js +0 -40
- package/esm/ui/App/JBrowseViewTab.d.ts +0 -8
- package/esm/ui/App/JBrowseViewTab.js +0 -97
- package/esm/ui/App/ModalWidget.d.ts +0 -6
- package/esm/ui/App/ModalWidget.js +0 -48
- package/esm/ui/App/TiledViewsContainer.d.ts +0 -6
- package/esm/ui/App/TiledViewsContainer.js +0 -366
- package/esm/ui/App/dockviewUtils.d.ts +0 -46
- package/esm/ui/App/dockviewUtils.js +0 -55
|
@@ -1,115 +1,141 @@
|
|
|
1
|
-
import type { PluginDefinition } from '@jbrowse/core/PluginLoader';
|
|
2
1
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
2
|
import type { BaseAssemblyConfigSchema } from '@jbrowse/core/assemblyManager';
|
|
4
|
-
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { AnyConfiguration, AnyConfigurationModel, ConfigurationSchemaDefinition } from '@jbrowse/core/configuration';
|
|
4
|
+
import type { PluginDefinition } from '@jbrowse/core/pluginDefinitions';
|
|
5
5
|
import type RpcManager from '@jbrowse/core/rpc/RpcManager';
|
|
6
|
-
export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, }: {
|
|
7
|
-
adminMode?: boolean;
|
|
6
|
+
export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, extraConfigSlots, }: {
|
|
8
7
|
pluginManager: PluginManager;
|
|
9
8
|
assemblyConfigSchema: BaseAssemblyConfigSchema;
|
|
10
|
-
|
|
9
|
+
extraConfigSlots?: ConfigurationSchemaDefinition;
|
|
10
|
+
}): import("@jbrowse/mobx-state-tree").ISnapshotProcessor<import("@jbrowse/mobx-state-tree").IModelType<{
|
|
11
11
|
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
12
|
-
rpc: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
13
|
-
defaultDriver: {
|
|
14
|
-
type: string;
|
|
15
|
-
description:
|
|
16
|
-
defaultValue:
|
|
12
|
+
readonly rpc: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
13
|
+
readonly defaultDriver: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly description: "the RPC driver to run data fetching on: MainThreadRpcDriver or WebWorkerRpcDriver. Leave empty to use the default for this application";
|
|
16
|
+
readonly defaultValue: "";
|
|
17
|
+
readonly advanced: true;
|
|
18
|
+
};
|
|
19
|
+
readonly workerCount: {
|
|
20
|
+
readonly type: "number";
|
|
21
|
+
readonly description: "The number of workers to use. If 0 (the default) JBrowse will decide how many workers to use.";
|
|
22
|
+
readonly defaultValue: 0;
|
|
23
|
+
readonly advanced: true;
|
|
17
24
|
};
|
|
18
|
-
drivers: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").ITypeUnion<import("@jbrowse/mobx-state-tree").ModelCreationType<import("@jbrowse/mobx-state-tree/dist/internal").ExtractCFromProps<Record<string, any>>> | undefined, import("@jbrowse/mobx-state-tree").ModelSnapshotType<Record<string, any>>, ({} & Partial<import("@jbrowse/mobx-state-tree/dist/internal").ExtractCFromProps<Record<string, any>>> & import("@jbrowse/mobx-state-tree/dist/internal").NonEmptyObject) | undefined>>, [undefined]>;
|
|
19
25
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
type: string;
|
|
27
|
-
description: string;
|
|
28
|
-
defaultValue: {};
|
|
29
|
-
contextVariable: string[];
|
|
26
|
+
readonly formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
27
|
+
readonly feature: {
|
|
28
|
+
readonly type: "frozen";
|
|
29
|
+
readonly description: "adds extra fields to the feature details";
|
|
30
|
+
readonly defaultValue: {};
|
|
31
|
+
readonly contextVariable: ["feature"];
|
|
30
32
|
};
|
|
31
|
-
subfeatures: {
|
|
32
|
-
type:
|
|
33
|
-
description:
|
|
34
|
-
defaultValue: {};
|
|
35
|
-
contextVariable:
|
|
33
|
+
readonly subfeatures: {
|
|
34
|
+
readonly type: "frozen";
|
|
35
|
+
readonly description: "adds extra fields to the subfeatures of a feature";
|
|
36
|
+
readonly defaultValue: {};
|
|
37
|
+
readonly contextVariable: ["feature"];
|
|
36
38
|
};
|
|
37
|
-
depth: {
|
|
38
|
-
type:
|
|
39
|
-
|
|
40
|
-
description: string;
|
|
39
|
+
readonly depth: {
|
|
40
|
+
readonly type: "maybeNumber";
|
|
41
|
+
readonly description: "levels of subfeature the formatDetails.subfeatures callback runs on, default 2";
|
|
41
42
|
};
|
|
42
|
-
maxDepth: {
|
|
43
|
-
type:
|
|
44
|
-
|
|
45
|
-
description: string;
|
|
43
|
+
readonly maxDepth: {
|
|
44
|
+
readonly type: "maybeNumber";
|
|
45
|
+
readonly description: "hide subfeatures nested deeper than this, default no limit";
|
|
46
46
|
};
|
|
47
47
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
48
|
-
formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
49
|
-
config: {
|
|
50
|
-
type:
|
|
51
|
-
description:
|
|
52
|
-
defaultValue: {};
|
|
53
|
-
contextVariable:
|
|
48
|
+
readonly formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
49
|
+
readonly config: {
|
|
50
|
+
readonly type: "frozen";
|
|
51
|
+
readonly description: "formats configuration object in about dialog";
|
|
52
|
+
readonly defaultValue: {};
|
|
53
|
+
readonly contextVariable: ["config"];
|
|
54
54
|
};
|
|
55
|
-
hideUris: {
|
|
56
|
-
type:
|
|
57
|
-
defaultValue:
|
|
55
|
+
readonly hideUris: {
|
|
56
|
+
readonly type: "boolean";
|
|
57
|
+
readonly defaultValue: false;
|
|
58
58
|
};
|
|
59
59
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
60
|
-
shareURL: {
|
|
61
|
-
type: string;
|
|
62
|
-
defaultValue:
|
|
60
|
+
readonly shareURL: {
|
|
61
|
+
readonly type: "string";
|
|
62
|
+
readonly defaultValue: "https://share.jbrowse.org/api/v1/";
|
|
63
|
+
readonly advanced: true;
|
|
63
64
|
};
|
|
64
|
-
disableAnalytics: {
|
|
65
|
-
type:
|
|
66
|
-
defaultValue:
|
|
65
|
+
readonly disableAnalytics: {
|
|
66
|
+
readonly type: "boolean";
|
|
67
|
+
readonly defaultValue: false;
|
|
68
|
+
readonly advanced: true;
|
|
67
69
|
};
|
|
68
|
-
hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
69
|
-
sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
70
|
-
trackNames: {
|
|
71
|
-
type:
|
|
72
|
-
defaultValue:
|
|
70
|
+
readonly hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
71
|
+
readonly sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
72
|
+
readonly trackNames: {
|
|
73
|
+
readonly type: "boolean";
|
|
74
|
+
readonly defaultValue: false;
|
|
73
75
|
};
|
|
74
|
-
categories: {
|
|
75
|
-
type:
|
|
76
|
-
defaultValue:
|
|
76
|
+
readonly categories: {
|
|
77
|
+
readonly type: "boolean";
|
|
78
|
+
readonly defaultValue: false;
|
|
77
79
|
};
|
|
78
80
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
79
|
-
defaultFolderCategories: {
|
|
80
|
-
type:
|
|
81
|
-
description:
|
|
82
|
-
defaultValue:
|
|
81
|
+
readonly defaultFolderCategories: {
|
|
82
|
+
readonly type: "stringArray";
|
|
83
|
+
readonly description: "list of category names to display as folders by default";
|
|
84
|
+
readonly defaultValue: readonly [];
|
|
83
85
|
};
|
|
84
|
-
defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
85
|
-
categoryNames: {
|
|
86
|
-
type:
|
|
87
|
-
defaultValue:
|
|
86
|
+
readonly defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
87
|
+
readonly categoryNames: {
|
|
88
|
+
readonly type: "stringArray";
|
|
89
|
+
readonly defaultValue: readonly [];
|
|
88
90
|
};
|
|
89
|
-
topLevelCategories: {
|
|
90
|
-
type:
|
|
91
|
-
defaultValue:
|
|
91
|
+
readonly topLevelCategories: {
|
|
92
|
+
readonly type: "boolean";
|
|
93
|
+
readonly defaultValue: false;
|
|
92
94
|
};
|
|
93
|
-
subCategories: {
|
|
94
|
-
type:
|
|
95
|
-
defaultValue:
|
|
95
|
+
readonly subCategories: {
|
|
96
|
+
readonly type: "boolean";
|
|
97
|
+
readonly defaultValue: false;
|
|
96
98
|
};
|
|
97
99
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
98
100
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
readonly preferences: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
102
|
+
readonly animationMode: {
|
|
103
|
+
readonly model: import("@jbrowse/mobx-state-tree").ISimpleType<"disabled" | "enabled" | "system">;
|
|
104
|
+
readonly type: "stringEnum";
|
|
105
|
+
readonly defaultValue: "enabled";
|
|
106
|
+
};
|
|
107
|
+
readonly scrollZoom: {
|
|
108
|
+
readonly type: "boolean";
|
|
109
|
+
readonly defaultValue: false;
|
|
110
|
+
};
|
|
111
|
+
readonly numberGrouping: {
|
|
112
|
+
readonly type: "boolean";
|
|
113
|
+
readonly defaultValue: true;
|
|
114
|
+
};
|
|
115
|
+
readonly useWorkspaces: {
|
|
116
|
+
readonly type: "boolean";
|
|
117
|
+
readonly defaultValue: false;
|
|
118
|
+
};
|
|
119
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
120
|
+
readonly theme: {
|
|
121
|
+
readonly type: "frozen";
|
|
122
|
+
readonly description: "Material UI theme overrides applied to the JBrowse UI";
|
|
123
|
+
readonly defaultValue: {};
|
|
102
124
|
};
|
|
103
|
-
extraThemes: {
|
|
104
|
-
type:
|
|
105
|
-
|
|
125
|
+
readonly extraThemes: {
|
|
126
|
+
readonly type: "frozen";
|
|
127
|
+
readonly description: "additional named themes the user can switch between";
|
|
128
|
+
readonly defaultValue: {};
|
|
129
|
+
readonly advanced: true;
|
|
106
130
|
};
|
|
107
|
-
logoPath: {
|
|
108
|
-
type:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
131
|
+
readonly logoPath: {
|
|
132
|
+
readonly type: "fileLocation";
|
|
133
|
+
readonly description: "path to a custom logo image displayed in the app header";
|
|
134
|
+
readonly defaultValue: {
|
|
135
|
+
readonly uri: "";
|
|
136
|
+
readonly locationType: "UriLocation";
|
|
112
137
|
};
|
|
138
|
+
readonly advanced: true;
|
|
113
139
|
};
|
|
114
140
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
115
141
|
plugins: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<PluginDefinition, PluginDefinition, PluginDefinition>>;
|
|
@@ -124,42 +150,97 @@ export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, }:
|
|
|
124
150
|
[key: string]: unknown;
|
|
125
151
|
trackId: string;
|
|
126
152
|
}[]>;
|
|
127
|
-
internetAccounts: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").
|
|
128
|
-
aggregateTextSearchAdapters: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").
|
|
129
|
-
connections: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").
|
|
153
|
+
internetAccounts: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IAnyType>;
|
|
154
|
+
aggregateTextSearchAdapters: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IAnyType>;
|
|
155
|
+
connections: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IAnyType>;
|
|
130
156
|
defaultSession: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
131
157
|
preConfiguredSessions: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<any, any, any>>;
|
|
132
158
|
}, {
|
|
159
|
+
/**
|
|
160
|
+
* #getter
|
|
161
|
+
*/
|
|
133
162
|
readonly assemblyNames: string[];
|
|
163
|
+
/**
|
|
164
|
+
* #getter
|
|
165
|
+
*/
|
|
134
166
|
readonly rpcManager: RpcManager;
|
|
135
167
|
} & {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
168
|
+
/**
|
|
169
|
+
* #action
|
|
170
|
+
*/
|
|
171
|
+
addAssemblyConf(conf: AnyConfigurationModel): (import("@jbrowse/mobx-state-tree").ModelInstanceTypeProps<Record<string, any>> & {
|
|
172
|
+
setSubschema(slotName: string, data: Record<string, unknown>): any;
|
|
173
|
+
setSlot(slotName: string, value: unknown): void;
|
|
142
174
|
} & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* #action
|
|
177
|
+
*/
|
|
143
178
|
removeAssemblyConf(assemblyName: string): void;
|
|
144
|
-
|
|
179
|
+
/**
|
|
180
|
+
* #action
|
|
181
|
+
*/
|
|
182
|
+
addTrackConf(loose: {
|
|
145
183
|
trackId: string;
|
|
146
|
-
type
|
|
184
|
+
type?: string;
|
|
147
185
|
}): {
|
|
148
186
|
[key: string]: unknown;
|
|
149
187
|
trackId: string;
|
|
150
188
|
} | undefined;
|
|
151
|
-
|
|
189
|
+
/**
|
|
190
|
+
* #action
|
|
191
|
+
* Adds to the config's own `connections`, which every visitor to this
|
|
192
|
+
* instance loads. Takes a snapshot as readily as a built config model —
|
|
193
|
+
* the array coerces — since callers hand it plain JSON (a session spec's
|
|
194
|
+
* `sessionConnections`, the CLI's add-connection output).
|
|
195
|
+
*/
|
|
196
|
+
addConnectionConf(connectionConf: AnyConfiguration): any;
|
|
197
|
+
/**
|
|
198
|
+
* #action
|
|
199
|
+
*/
|
|
152
200
|
deleteConnectionConf(configuration: AnyConfigurationModel): boolean;
|
|
201
|
+
/**
|
|
202
|
+
* #action
|
|
203
|
+
*/
|
|
153
204
|
deleteTrackConf(trackConf: AnyConfigurationModel | {
|
|
154
205
|
trackId: string;
|
|
155
206
|
}): void;
|
|
207
|
+
/**
|
|
208
|
+
* #action
|
|
209
|
+
* Updates an existing track configuration. Used to sync editable configs
|
|
210
|
+
* back to the frozen tracks array.
|
|
211
|
+
*/
|
|
156
212
|
updateTrackConf(trackConf: {
|
|
157
213
|
trackId: string;
|
|
158
214
|
[key: string]: unknown;
|
|
159
215
|
}): void;
|
|
216
|
+
/**
|
|
217
|
+
* #action
|
|
218
|
+
*/
|
|
160
219
|
addPlugin(pluginDefinition: PluginDefinition): void;
|
|
220
|
+
/**
|
|
221
|
+
* #action
|
|
222
|
+
* Removes the entry that loads from the same url — the version-pinned
|
|
223
|
+
* definition, not every entry sharing a name, so the update flow's
|
|
224
|
+
* remove-then-add swaps one version for another.
|
|
225
|
+
*
|
|
226
|
+
* A definition naming no loader matches nothing (`isPluginUrl`) rather than
|
|
227
|
+
* every other url-less entry: `pluginUrl`'s miss value is the display string
|
|
228
|
+
* 'unknown url', so removing one hand-written broken entry used to filter out
|
|
229
|
+
* all of them. Such an entry has no InstalledPlugin row to remove it from
|
|
230
|
+
* either — it never loads, so it is never in `runtimePluginDefinitions` — so
|
|
231
|
+
* matching nothing costs nothing the UI could reach.
|
|
232
|
+
*/
|
|
161
233
|
removePlugin(pluginDefinition: PluginDefinition): void;
|
|
234
|
+
/**
|
|
235
|
+
* #action
|
|
236
|
+
*/
|
|
162
237
|
setDefaultSessionConf(sessionConf: AnyConfigurationModel): void;
|
|
238
|
+
/**
|
|
239
|
+
* #action
|
|
240
|
+
*/
|
|
163
241
|
addInternetAccountConf(internetAccountConf: AnyConfigurationModel): any;
|
|
242
|
+
/**
|
|
243
|
+
* #action
|
|
244
|
+
*/
|
|
164
245
|
deleteInternetAccountConf(configuration: AnyConfigurationModel): boolean;
|
|
165
|
-
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
246
|
+
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>, Record<string, unknown>, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
@@ -1,18 +1,57 @@
|
|
|
1
1
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
|
-
import {
|
|
2
|
+
import { isPluginUrl, maybePluginUrl } from '@jbrowse/core/pluginDefinitions';
|
|
3
|
+
import { expandLooseTrackConfig } from '@jbrowse/core/util/tracks';
|
|
4
|
+
import { cast, getParent, getSnapshot, types } from '@jbrowse/mobx-state-tree';
|
|
5
|
+
import { migrateConfigSnapshot } from '@jbrowse/product-core';
|
|
3
6
|
import { toJS } from 'mobx';
|
|
4
|
-
import { JBrowseConfigF } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
import { JBrowseConfigF } from '../JBrowseConfig/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* #stateModel AppCoreJBrowseModel
|
|
10
|
+
* #category root
|
|
11
|
+
* built on the [JBrowseRootConfig](/docs/config/jbrowserootconfig) config model —
|
|
12
|
+
* config models are MST trees themselves, which is why this state model is
|
|
13
|
+
* allowed to build on one. Generally found on a property named rootModel.jbrowse
|
|
14
|
+
*/
|
|
15
|
+
// A config with exactly one assembly is what every loose track is on, so
|
|
16
|
+
// `assemblyNames` may be left off; with several, the track has to say.
|
|
17
|
+
function expandLooseTracks(snapshot, pluginManager) {
|
|
18
|
+
const tracks = snapshot.tracks;
|
|
19
|
+
if (!Array.isArray(tracks)) {
|
|
20
|
+
return snapshot;
|
|
21
|
+
}
|
|
22
|
+
const assemblies = snapshot.assemblies;
|
|
23
|
+
const only = Array.isArray(assemblies) && assemblies.length === 1
|
|
24
|
+
? assemblies[0].name
|
|
25
|
+
: undefined;
|
|
26
|
+
const expanded = tracks.map(t => expandLooseTrackConfig(t, pluginManager, only));
|
|
27
|
+
return expanded.every((t, i) => t === tracks[i])
|
|
28
|
+
? snapshot
|
|
29
|
+
: { ...snapshot, tracks: expanded };
|
|
30
|
+
}
|
|
31
|
+
export function JBrowseModelF({ pluginManager, assemblyConfigSchema, extraConfigSlots, }) {
|
|
32
|
+
const model = JBrowseConfigF({
|
|
33
|
+
pluginManager,
|
|
34
|
+
assemblyConfigSchema,
|
|
35
|
+
extraConfigSlots,
|
|
36
|
+
})
|
|
7
37
|
.views(self => ({
|
|
38
|
+
/**
|
|
39
|
+
* #getter
|
|
40
|
+
*/
|
|
8
41
|
get assemblyNames() {
|
|
9
42
|
return self.assemblies.map(assembly => readConfObject(assembly, 'name'));
|
|
10
43
|
},
|
|
44
|
+
/**
|
|
45
|
+
* #getter
|
|
46
|
+
*/
|
|
11
47
|
get rpcManager() {
|
|
12
48
|
return getParent(self).rpcManager;
|
|
13
49
|
},
|
|
14
50
|
}))
|
|
15
51
|
.actions(self => ({
|
|
52
|
+
/**
|
|
53
|
+
* #action
|
|
54
|
+
*/
|
|
16
55
|
addAssemblyConf(conf) {
|
|
17
56
|
const { name } = conf;
|
|
18
57
|
if (!name) {
|
|
@@ -31,36 +70,64 @@ export function JBrowseModelF({ pluginManager, assemblyConfigSchema, }) {
|
|
|
31
70
|
});
|
|
32
71
|
return self.assemblies[length - 1];
|
|
33
72
|
},
|
|
73
|
+
/**
|
|
74
|
+
* #action
|
|
75
|
+
*/
|
|
34
76
|
removeAssemblyConf(assemblyName) {
|
|
35
77
|
const toRemove = self.assemblies.find(a => a.name === assemblyName);
|
|
36
78
|
if (toRemove) {
|
|
37
79
|
self.assemblies.remove(toRemove);
|
|
38
80
|
}
|
|
39
81
|
},
|
|
40
|
-
|
|
82
|
+
/**
|
|
83
|
+
* #action
|
|
84
|
+
*/
|
|
85
|
+
addTrackConf(loose) {
|
|
86
|
+
const trackConf = expandLooseTrackConfig(loose, pluginManager);
|
|
41
87
|
const { type } = trackConf;
|
|
42
88
|
if (!type) {
|
|
43
|
-
throw new Error(`
|
|
89
|
+
throw new Error(`track type not specified for "${trackConf.trackId}"`);
|
|
44
90
|
}
|
|
45
91
|
self.tracks = [...self.tracks, trackConf];
|
|
46
92
|
return self.tracks.at(-1);
|
|
47
93
|
},
|
|
94
|
+
/**
|
|
95
|
+
* #action
|
|
96
|
+
* Adds to the config's own `connections`, which every visitor to this
|
|
97
|
+
* instance loads. Takes a snapshot as readily as a built config model —
|
|
98
|
+
* the array coerces — since callers hand it plain JSON (a session spec's
|
|
99
|
+
* `sessionConnections`, the CLI's add-connection output).
|
|
100
|
+
*/
|
|
48
101
|
addConnectionConf(connectionConf) {
|
|
49
102
|
const { type } = connectionConf;
|
|
50
103
|
if (!type) {
|
|
51
|
-
throw new Error(
|
|
104
|
+
throw new Error('connection type not specified');
|
|
52
105
|
}
|
|
53
106
|
const length = self.connections.push(connectionConf);
|
|
54
107
|
return self.connections[length - 1];
|
|
55
108
|
},
|
|
109
|
+
/**
|
|
110
|
+
* #action
|
|
111
|
+
*/
|
|
56
112
|
deleteConnectionConf(configuration) {
|
|
57
|
-
|
|
58
|
-
|
|
113
|
+
// key on connectionId: the connection schema's explicitIdentifier means
|
|
114
|
+
// `.id` is undefined on every entry, so an id-based find always matched
|
|
115
|
+
// the first connection and deleted the wrong one
|
|
116
|
+
const elt = self.connections.find(conn => conn.connectionId === configuration.connectionId);
|
|
117
|
+
return elt ? self.connections.remove(elt) : false;
|
|
59
118
|
},
|
|
119
|
+
/**
|
|
120
|
+
* #action
|
|
121
|
+
*/
|
|
60
122
|
deleteTrackConf(trackConf) {
|
|
61
123
|
const trackId = trackConf.trackId;
|
|
62
124
|
self.tracks = self.tracks.filter(t => t.trackId !== trackId);
|
|
63
125
|
},
|
|
126
|
+
/**
|
|
127
|
+
* #action
|
|
128
|
+
* Updates an existing track configuration. Used to sync editable configs
|
|
129
|
+
* back to the frozen tracks array.
|
|
130
|
+
*/
|
|
64
131
|
updateTrackConf(trackConf) {
|
|
65
132
|
const { trackId } = trackConf;
|
|
66
133
|
const idx = self.tracks.findIndex(t => t.trackId === trackId);
|
|
@@ -70,38 +137,72 @@ export function JBrowseModelF({ pluginManager, assemblyConfigSchema, }) {
|
|
|
70
137
|
self.tracks = newTracks;
|
|
71
138
|
}
|
|
72
139
|
},
|
|
140
|
+
/**
|
|
141
|
+
* #action
|
|
142
|
+
*/
|
|
73
143
|
addPlugin(pluginDefinition) {
|
|
74
144
|
self.plugins.push(pluginDefinition);
|
|
75
|
-
|
|
76
|
-
rootModel.setPluginsUpdated(true);
|
|
145
|
+
getParent(self).setPluginsUpdated();
|
|
77
146
|
},
|
|
147
|
+
/**
|
|
148
|
+
* #action
|
|
149
|
+
* Removes the entry that loads from the same url — the version-pinned
|
|
150
|
+
* definition, not every entry sharing a name, so the update flow's
|
|
151
|
+
* remove-then-add swaps one version for another.
|
|
152
|
+
*
|
|
153
|
+
* A definition naming no loader matches nothing (`isPluginUrl`) rather than
|
|
154
|
+
* every other url-less entry: `pluginUrl`'s miss value is the display string
|
|
155
|
+
* 'unknown url', so removing one hand-written broken entry used to filter out
|
|
156
|
+
* all of them. Such an entry has no InstalledPlugin row to remove it from
|
|
157
|
+
* either — it never loads, so it is never in `runtimePluginDefinitions` — so
|
|
158
|
+
* matching nothing costs nothing the UI could reach.
|
|
159
|
+
*/
|
|
78
160
|
removePlugin(pluginDefinition) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
plugin.esmUrl !== pluginDefinition.esmUrl));
|
|
83
|
-
getParent(self).setPluginsUpdated(true);
|
|
161
|
+
const targetUrl = maybePluginUrl(pluginDefinition);
|
|
162
|
+
self.plugins = cast(self.plugins.filter(plugin => !isPluginUrl(plugin, targetUrl)));
|
|
163
|
+
getParent(self).setPluginsUpdated();
|
|
84
164
|
},
|
|
165
|
+
/**
|
|
166
|
+
* #action
|
|
167
|
+
*/
|
|
85
168
|
setDefaultSessionConf(sessionConf) {
|
|
86
|
-
const newDefault = getParent(self).session
|
|
169
|
+
const newDefault = getParent(self).session?.name === sessionConf.name
|
|
87
170
|
? getSnapshot(sessionConf)
|
|
88
171
|
: toJS(sessionConf);
|
|
89
172
|
if (!newDefault.name) {
|
|
90
|
-
throw new Error(
|
|
173
|
+
throw new Error('default session must have a name');
|
|
91
174
|
}
|
|
92
175
|
self.defaultSession = cast(newDefault);
|
|
93
176
|
},
|
|
177
|
+
/**
|
|
178
|
+
* #action
|
|
179
|
+
*/
|
|
94
180
|
addInternetAccountConf(internetAccountConf) {
|
|
95
181
|
const { type } = internetAccountConf;
|
|
96
182
|
if (!type) {
|
|
97
|
-
throw new Error(
|
|
183
|
+
throw new Error('internet account type not specified');
|
|
98
184
|
}
|
|
99
185
|
const length = self.internetAccounts.push(internetAccountConf);
|
|
100
186
|
return self.internetAccounts[length - 1];
|
|
101
187
|
},
|
|
188
|
+
/**
|
|
189
|
+
* #action
|
|
190
|
+
*/
|
|
102
191
|
deleteInternetAccountConf(configuration) {
|
|
103
|
-
|
|
104
|
-
|
|
192
|
+
// key on internetAccountId, not the undefined `.id` (see
|
|
193
|
+
// deleteConnectionConf) so the correct account is removed
|
|
194
|
+
const elt = self.internetAccounts.find(a => a.internetAccountId === configuration.internetAccountId);
|
|
195
|
+
return elt ? self.internetAccounts.remove(elt) : false;
|
|
105
196
|
},
|
|
106
197
|
}));
|
|
198
|
+
// Migrate legacy display types (e.g. LinearPileupDisplay →
|
|
199
|
+
// LinearAlignmentsDisplay) when ingesting config snapshots so saved
|
|
200
|
+
// configs from older JBrowse versions still load. `tracks` stays frozen
|
|
201
|
+
// (ADR-032), so the loose `{ trackId, uri }` form is expanded here, where
|
|
202
|
+
// the track selector and the trackId index read it, and never by a schema.
|
|
203
|
+
return types.snapshotProcessor(model, {
|
|
204
|
+
preProcessor(snapshot) {
|
|
205
|
+
return migrateConfigSnapshot(expandLooseTracks(snapshot, pluginManager));
|
|
206
|
+
},
|
|
207
|
+
});
|
|
107
208
|
}
|
package/esm/RootMenu/index.d.ts
CHANGED
|
@@ -1,13 +1,88 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MenuAction, MenuDefinition } from '../menus.ts';
|
|
2
2
|
import type { MenuItem } from '@jbrowse/core/ui/Menu';
|
|
3
|
+
/**
|
|
4
|
+
* #stateModel RootAppMenuMixin
|
|
5
|
+
*/
|
|
3
6
|
export declare function RootAppMenuMixin(): import("@jbrowse/mobx-state-tree").IModelType<{}, {
|
|
4
7
|
mutableMenuActions: MenuAction[];
|
|
5
8
|
} & {
|
|
6
|
-
|
|
9
|
+
/**
|
|
10
|
+
* #action
|
|
11
|
+
* Replace the menu bar wholesale. Item contributions recorded before
|
|
12
|
+
* this one are dropped along with the menus they targeted, so a plugin
|
|
13
|
+
* adding to the existing bar wants `appendToMenu` instead.
|
|
14
|
+
*
|
|
15
|
+
* @param newMenus - The complete new set of top-level menus.
|
|
16
|
+
*/
|
|
17
|
+
setMenus(newMenus: MenuDefinition[]): void;
|
|
18
|
+
/**
|
|
19
|
+
* #action
|
|
20
|
+
* Add a top-level menu, if the app bar does not already have one with
|
|
21
|
+
* this name.
|
|
22
|
+
*
|
|
23
|
+
* @param menuName - Name of the menu to add.
|
|
24
|
+
*/
|
|
7
25
|
appendMenu(menuName: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* #action
|
|
28
|
+
* Insert a top-level menu, if the app bar does not already have one
|
|
29
|
+
* with this name.
|
|
30
|
+
*
|
|
31
|
+
* @param menuName - Name of the menu to insert.
|
|
32
|
+
*
|
|
33
|
+
* @param position - Position to insert menu. If negative, counts from the
|
|
34
|
+
* end, e.g. `insertMenu('My Menu', -1)` will insert the menu as the
|
|
35
|
+
* second-to-last one.
|
|
36
|
+
*/
|
|
8
37
|
insertMenu(menuName: string, position: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* #action
|
|
40
|
+
* Add a menu item to a top-level menu, creating the menu if it does not
|
|
41
|
+
* exist.
|
|
42
|
+
*
|
|
43
|
+
* @param menuName - Name of the top-level menu to append to.
|
|
44
|
+
*
|
|
45
|
+
* @param menuItem - Menu item to append.
|
|
46
|
+
*/
|
|
9
47
|
appendToMenu(menuName: string, menuItem: MenuItem): void;
|
|
48
|
+
/**
|
|
49
|
+
* #action
|
|
50
|
+
* Insert a menu item into a top-level menu, creating the menu if it
|
|
51
|
+
* does not exist.
|
|
52
|
+
*
|
|
53
|
+
* @param menuName - Name of the top-level menu to insert into
|
|
54
|
+
*
|
|
55
|
+
* @param menuItem - Menu item to insert
|
|
56
|
+
*
|
|
57
|
+
* @param position - Position to insert menu item. If negative, counts
|
|
58
|
+
* from the end, e.g. `insertInMenu('My Menu', item, -1)` will insert the
|
|
59
|
+
* item as the second-to-last one.
|
|
60
|
+
*/
|
|
10
61
|
insertInMenu(menuName: string, menuItem: MenuItem, position: number): void;
|
|
62
|
+
/**
|
|
63
|
+
* #action
|
|
64
|
+
* Add a menu item to a sub-menu, creating any part of the path that
|
|
65
|
+
* does not exist.
|
|
66
|
+
*
|
|
67
|
+
* @param menuPath - Path to the sub-menu to add to, starting with the
|
|
68
|
+
* top-level menu (e.g. `['File', 'Insert']`).
|
|
69
|
+
*
|
|
70
|
+
* @param menuItem - Menu item to append.
|
|
71
|
+
*/
|
|
11
72
|
appendToSubMenu(menuPath: string[], menuItem: MenuItem): void;
|
|
73
|
+
/**
|
|
74
|
+
* #action
|
|
75
|
+
* Insert a menu item into a sub-menu, creating any part of the path
|
|
76
|
+
* that does not exist.
|
|
77
|
+
*
|
|
78
|
+
* @param menuPath - Path to the sub-menu to add to, starting with the
|
|
79
|
+
* top-level menu (e.g. `['File', 'Insert']`).
|
|
80
|
+
*
|
|
81
|
+
* @param menuItem - Menu item to insert.
|
|
82
|
+
*
|
|
83
|
+
* @param position - Position to insert menu item. If negative, counts
|
|
84
|
+
* from the end, e.g. `insertInSubMenu(path, item, -1)` will insert the
|
|
85
|
+
* item as the second-to-last one.
|
|
86
|
+
*/
|
|
12
87
|
insertInSubMenu(menuPath: string[], menuItem: MenuItem, position: number): void;
|
|
13
88
|
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|