@jbrowse/app-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.
- package/esm/AppSession/AppRootModel.d.ts +30 -0
- package/esm/AppSession/AppRootModel.js +1 -0
- package/esm/AppSession/AppSessionMixin.d.ts +1324 -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 +294 -0
- package/esm/Assemblies/AssembliesMixin.js +154 -0
- package/esm/Assemblies/index.d.ts +1 -2
- package/esm/Assemblies/index.js +1 -2
- package/esm/HistoryManagement/index.d.ts +11 -0
- package/esm/HistoryManagement/index.js +43 -10
- package/esm/JBrowseConfig/RootConfiguration.d.ts +123 -78
- package/esm/JBrowseConfig/RootConfiguration.js +79 -7
- package/esm/JBrowseConfig/defaultShareUrl.d.ts +1 -0
- package/esm/JBrowseConfig/defaultShareUrl.js +5 -0
- package/esm/JBrowseConfig/index.d.ts +175 -84
- package/esm/JBrowseConfig/index.js +64 -2
- package/esm/JBrowseModel/index.d.ts +175 -97
- package/esm/JBrowseModel/index.js +132 -31
- package/esm/JbApi/index.d.ts +2 -0
- package/esm/JbApi/index.js +1 -0
- package/esm/JbApi/jbApi.d.ts +2767 -0
- package/esm/JbApi/jbApi.js +1383 -0
- package/esm/RootMenu/index.d.ts +69 -3
- package/esm/RootMenu/index.js +96 -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 +161 -0
- package/esm/SessionSpec/loadSessionSpec.d.ts +75 -0
- package/esm/SessionSpec/loadSessionSpec.js +473 -0
- package/esm/SessionSpec/parseSessionSpecUrl.d.ts +7 -0
- package/esm/SessionSpec/parseSessionSpecUrl.js +181 -0
- package/esm/SessionSpec/types.d.ts +37 -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 +107 -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 +105 -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 +260 -0
- package/esm/WorkspaceLayout/model.js +586 -0
- package/esm/WorkspaceLayout/panelChrome.d.ts +19 -0
- package/esm/WorkspaceLayout/panelChrome.js +4 -0
- package/esm/WorkspaceLayout/spec.d.ts +88 -0
- package/esm/WorkspaceLayout/spec.js +226 -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 +18 -9
- package/esm/index.js +16 -9
- package/esm/menus.d.ts +55 -68
- package/esm/menus.js +117 -86
- package/esm/queryParams.d.ts +9 -0
- package/esm/queryParams.js +93 -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 +39 -19
- package/esm/ui/App/AppFab.d.ts +12 -3
- package/esm/ui/App/AppFab.js +15 -8
- package/esm/ui/App/AppToolbar.d.ts +2 -14
- package/esm/ui/App/AppToolbar.js +45 -31
- package/esm/ui/App/ClassicViewsContainer.d.ts +4 -10
- 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/DrawerHeader.d.ts +2 -3
- package/esm/ui/App/DrawerHeader.js +24 -11
- 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/ThemeModeButton.d.ts +12 -0
- package/esm/ui/App/ThemeModeButton.js +34 -0
- 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 +128 -24
- package/esm/ui/App/ViewContainerTitle.d.ts +1 -1
- package/esm/ui/App/ViewContainerTitle.js +21 -11
- 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 +48 -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 +4 -11
- package/esm/ui/App/ViewsContainer.js +6 -9
- 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/lazyParts.d.ts +32 -0
- package/esm/ui/App/lazyParts.js +8 -0
- package/esm/ui/App/preloadAppShell.d.ts +14 -0
- package/esm/ui/App/preloadAppShell.js +41 -0
- package/esm/ui/App/types.d.ts +17 -3
- package/esm/ui/App/types.js +1 -1
- package/esm/ui/App/useViewVisibility.d.ts +35 -0
- package/esm/ui/App/useViewVisibility.js +88 -0
- package/esm/ui/App/viewTitle.d.ts +12 -0
- package/esm/ui/App/viewTitle.js +17 -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/DrawerControls.d.ts +0 -5
- package/esm/ui/App/DrawerControls.js +0 -25
- 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/copyView.d.ts +0 -1
- package/esm/ui/App/copyView.js +0 -29
- package/esm/ui/App/dockviewUtils.d.ts +0 -46
- package/esm/ui/App/dockviewUtils.js +0 -55
|
@@ -1,117 +1,147 @@
|
|
|
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
|
-
|
|
12
|
+
readonly rpc: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
13
|
+
readonly defaultDriver: {
|
|
14
|
+
type: "string";
|
|
15
|
+
} & {
|
|
16
16
|
defaultValue: string;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
defaultValue: number;
|
|
23
|
-
};
|
|
24
|
-
formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
25
|
-
feature: {
|
|
26
|
-
type: string;
|
|
27
|
-
description: string;
|
|
28
|
-
defaultValue: {};
|
|
29
|
-
contextVariable: string[];
|
|
18
|
+
readonly workerCount: {
|
|
19
|
+
type: "number";
|
|
20
|
+
} & {
|
|
21
|
+
defaultValue: number;
|
|
30
22
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
24
|
+
readonly formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
25
|
+
readonly feature: {
|
|
26
|
+
type: "frozen";
|
|
27
|
+
} & {
|
|
28
|
+
defaultValue: unknown;
|
|
36
29
|
};
|
|
37
|
-
|
|
38
|
-
type:
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
readonly subfeatures: {
|
|
31
|
+
type: "frozen";
|
|
32
|
+
} & {
|
|
33
|
+
defaultValue: unknown;
|
|
41
34
|
};
|
|
42
|
-
|
|
43
|
-
type:
|
|
44
|
-
defaultValue: number;
|
|
45
|
-
description: string;
|
|
35
|
+
readonly depth: {
|
|
36
|
+
type: "maybeNumber";
|
|
46
37
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
config: {
|
|
50
|
-
type: string;
|
|
51
|
-
description: string;
|
|
52
|
-
defaultValue: {};
|
|
53
|
-
contextVariable: string[];
|
|
38
|
+
readonly maxDepth: {
|
|
39
|
+
type: "maybeNumber";
|
|
54
40
|
};
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
42
|
+
readonly formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
43
|
+
readonly config: {
|
|
44
|
+
type: "frozen";
|
|
45
|
+
} & {
|
|
46
|
+
defaultValue: unknown;
|
|
47
|
+
};
|
|
48
|
+
readonly hideUris: {
|
|
49
|
+
type: "boolean";
|
|
50
|
+
} & {
|
|
57
51
|
defaultValue: boolean;
|
|
58
52
|
};
|
|
59
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
60
|
-
shareURL: {
|
|
61
|
-
type: string;
|
|
53
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
54
|
+
readonly shareURL: {
|
|
55
|
+
type: "string";
|
|
56
|
+
} & {
|
|
62
57
|
defaultValue: string;
|
|
63
58
|
};
|
|
64
|
-
disableAnalytics: {
|
|
65
|
-
type:
|
|
59
|
+
readonly disableAnalytics: {
|
|
60
|
+
type: "boolean";
|
|
61
|
+
} & {
|
|
66
62
|
defaultValue: boolean;
|
|
67
63
|
};
|
|
68
|
-
hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
69
|
-
sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
70
|
-
trackNames: {
|
|
71
|
-
type:
|
|
64
|
+
readonly hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
65
|
+
readonly sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
66
|
+
readonly trackNames: {
|
|
67
|
+
type: "boolean";
|
|
68
|
+
} & {
|
|
72
69
|
defaultValue: boolean;
|
|
73
70
|
};
|
|
74
|
-
categories: {
|
|
75
|
-
type:
|
|
71
|
+
readonly categories: {
|
|
72
|
+
type: "boolean";
|
|
73
|
+
} & {
|
|
76
74
|
defaultValue: boolean;
|
|
77
75
|
};
|
|
78
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
79
|
-
defaultFolderCategories: {
|
|
80
|
-
type:
|
|
81
|
-
|
|
82
|
-
defaultValue:
|
|
76
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
77
|
+
readonly defaultFolderCategories: {
|
|
78
|
+
type: "stringArray";
|
|
79
|
+
} & {
|
|
80
|
+
defaultValue: unknown;
|
|
83
81
|
};
|
|
84
|
-
defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
85
|
-
categoryNames: {
|
|
86
|
-
type:
|
|
87
|
-
|
|
82
|
+
readonly defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
83
|
+
readonly categoryNames: {
|
|
84
|
+
type: "stringArray";
|
|
85
|
+
} & {
|
|
86
|
+
defaultValue: unknown;
|
|
88
87
|
};
|
|
89
|
-
topLevelCategories: {
|
|
90
|
-
type:
|
|
88
|
+
readonly topLevelCategories: {
|
|
89
|
+
type: "boolean";
|
|
90
|
+
} & {
|
|
91
91
|
defaultValue: boolean;
|
|
92
92
|
};
|
|
93
|
-
subCategories: {
|
|
94
|
-
type:
|
|
93
|
+
readonly subCategories: {
|
|
94
|
+
type: "boolean";
|
|
95
|
+
} & {
|
|
95
96
|
defaultValue: boolean;
|
|
96
97
|
};
|
|
97
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
98
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
99
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
100
|
+
readonly preferences: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
101
|
+
readonly animationMode: {
|
|
102
|
+
type: "stringEnum";
|
|
103
|
+
} & {
|
|
104
|
+
model: import("@jbrowse/mobx-state-tree").ISimpleType<"disabled" | "enabled" | "system">;
|
|
105
|
+
} & {
|
|
106
|
+
defaultValue: string;
|
|
107
|
+
};
|
|
108
|
+
readonly scrollZoom: {
|
|
109
|
+
type: "boolean";
|
|
110
|
+
} & {
|
|
111
|
+
defaultValue: boolean;
|
|
112
|
+
};
|
|
113
|
+
readonly numberGrouping: {
|
|
114
|
+
type: "boolean";
|
|
115
|
+
} & {
|
|
116
|
+
defaultValue: boolean;
|
|
117
|
+
};
|
|
118
|
+
readonly useWorkspaces: {
|
|
119
|
+
type: "boolean";
|
|
120
|
+
} & {
|
|
121
|
+
defaultValue: boolean;
|
|
122
|
+
};
|
|
123
|
+
readonly developerMode: {
|
|
124
|
+
type: "boolean";
|
|
125
|
+
} & {
|
|
126
|
+
defaultValue: boolean;
|
|
127
|
+
};
|
|
128
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
129
|
+
readonly theme: {
|
|
130
|
+
type: "frozen";
|
|
131
|
+
} & {
|
|
132
|
+
defaultValue: unknown;
|
|
102
133
|
};
|
|
103
|
-
extraThemes: {
|
|
104
|
-
type:
|
|
105
|
-
|
|
134
|
+
readonly extraThemes: {
|
|
135
|
+
type: "frozen";
|
|
136
|
+
} & {
|
|
137
|
+
defaultValue: unknown;
|
|
106
138
|
};
|
|
107
|
-
logoPath: {
|
|
108
|
-
type:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
locationType: string;
|
|
112
|
-
};
|
|
139
|
+
readonly logoPath: {
|
|
140
|
+
type: "fileLocation";
|
|
141
|
+
} & {
|
|
142
|
+
defaultValue: unknown;
|
|
113
143
|
};
|
|
114
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
144
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
115
145
|
plugins: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<PluginDefinition, PluginDefinition, PluginDefinition>>;
|
|
116
146
|
assemblies: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>;
|
|
117
147
|
tracks: import("@jbrowse/mobx-state-tree").IType<{
|
|
@@ -124,42 +154,90 @@ export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, }:
|
|
|
124
154
|
[key: string]: unknown;
|
|
125
155
|
trackId: string;
|
|
126
156
|
}[]>;
|
|
127
|
-
internetAccounts: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/
|
|
128
|
-
aggregateTextSearchAdapters: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/
|
|
129
|
-
connections: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/
|
|
157
|
+
internetAccounts: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/PluginManager").PluggableConfigSchemaType>;
|
|
158
|
+
aggregateTextSearchAdapters: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/PluginManager").PluggableConfigSchemaType>;
|
|
159
|
+
connections: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/PluginManager").PluggableConfigSchemaType>;
|
|
130
160
|
defaultSession: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
131
161
|
preConfiguredSessions: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<any, any, any>>;
|
|
132
162
|
}, {
|
|
163
|
+
/**
|
|
164
|
+
* #getter
|
|
165
|
+
*/
|
|
133
166
|
readonly assemblyNames: string[];
|
|
167
|
+
/**
|
|
168
|
+
* #getter
|
|
169
|
+
*/
|
|
134
170
|
readonly rpcManager: RpcManager;
|
|
135
171
|
} & {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
172
|
+
/**
|
|
173
|
+
* #action
|
|
174
|
+
*/
|
|
175
|
+
addAssemblyConf(conf: AnyConfigurationModel): (import("@jbrowse/core/configuration").ConfigNodeProps<any> & import("@jbrowse/core/configuration").ConfigNodeActions & import("@jbrowse/core/configuration").ConfigNodeBrand<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* #action
|
|
178
|
+
*/
|
|
143
179
|
removeAssemblyConf(assemblyName: string): void;
|
|
144
|
-
|
|
180
|
+
/**
|
|
181
|
+
* #action
|
|
182
|
+
*/
|
|
183
|
+
addTrackConf(loose: {
|
|
145
184
|
trackId: string;
|
|
146
|
-
type
|
|
185
|
+
type?: string;
|
|
147
186
|
}): {
|
|
148
187
|
[key: string]: unknown;
|
|
149
188
|
trackId: string;
|
|
150
189
|
} | undefined;
|
|
151
|
-
|
|
190
|
+
/**
|
|
191
|
+
* #action
|
|
192
|
+
* Adds to the config's own `connections`, which every visitor to this
|
|
193
|
+
* instance loads. Takes a snapshot as readily as a built config model —
|
|
194
|
+
* the array coerces — since callers hand it plain JSON (a session spec's
|
|
195
|
+
* `sessionConnections`, the CLI's add-connection output).
|
|
196
|
+
*/
|
|
197
|
+
addConnectionConf(connectionConf: AnyConfiguration): (import("@jbrowse/core/configuration").PluggableConfigNode & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/PluginManager").PluggableConfigSchemaType>) | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* #action
|
|
200
|
+
*/
|
|
152
201
|
deleteConnectionConf(configuration: AnyConfigurationModel): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* #action
|
|
204
|
+
*/
|
|
153
205
|
deleteTrackConf(trackConf: AnyConfigurationModel | {
|
|
154
206
|
trackId: string;
|
|
155
207
|
}): void;
|
|
208
|
+
/**
|
|
209
|
+
* #action
|
|
210
|
+
* Updates an existing track configuration. Used to sync editable configs
|
|
211
|
+
* back to the frozen tracks array. A trackId the array repeats replaces
|
|
212
|
+
* its last entry, the one the session resolves it to.
|
|
213
|
+
*/
|
|
156
214
|
updateTrackConf(trackConf: {
|
|
157
215
|
trackId: string;
|
|
158
216
|
[key: string]: unknown;
|
|
159
217
|
}): void;
|
|
218
|
+
/**
|
|
219
|
+
* #action
|
|
220
|
+
*/
|
|
160
221
|
addPlugin(pluginDefinition: PluginDefinition): void;
|
|
222
|
+
/**
|
|
223
|
+
* #action
|
|
224
|
+
* Removes the entry the loaded copy came from — the version-pinned
|
|
225
|
+
* definition, or the bare store ref that resolved to it. Not every entry
|
|
226
|
+
* sharing a name or a ref, so the update flow's remove-then-add swaps one
|
|
227
|
+
* version for another; `holdsPluginVersion` argues both halves.
|
|
228
|
+
*/
|
|
161
229
|
removePlugin(pluginDefinition: PluginDefinition): void;
|
|
230
|
+
/**
|
|
231
|
+
* #action
|
|
232
|
+
* takes the live session or a plain session snapshot
|
|
233
|
+
*/
|
|
162
234
|
setDefaultSessionConf(sessionConf: AnyConfigurationModel): void;
|
|
163
|
-
|
|
235
|
+
/**
|
|
236
|
+
* #action
|
|
237
|
+
*/
|
|
238
|
+
addInternetAccountConf(internetAccountConf: AnyConfigurationModel): (import("@jbrowse/core/configuration").PluggableConfigNode & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/PluginManager").PluggableConfigSchemaType>) | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* #action
|
|
241
|
+
*/
|
|
164
242
|
deleteInternetAccountConf(configuration: AnyConfigurationModel): boolean;
|
|
165
|
-
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
243
|
+
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>, Record<string, unknown>, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
@@ -1,107 +1,208 @@
|
|
|
1
1
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
|
-
import {
|
|
2
|
+
import { migrateRetiredDisplays } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
|
+
import { holdsPluginVersion } from '@jbrowse/core/pluginDefinitions';
|
|
4
|
+
import { expandLooseSearchIndex } from '@jbrowse/core/util/expandLooseSearchIndex';
|
|
5
|
+
import { expandLooseTrackConfig } from '@jbrowse/core/util/tracks';
|
|
6
|
+
import { cast, getParent, getSnapshot, isStateTreeNode, types, } from '@jbrowse/mobx-state-tree';
|
|
3
7
|
import { toJS } from 'mobx';
|
|
4
|
-
import { JBrowseConfigF } from
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
import { JBrowseConfigF } from '../JBrowseConfig/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* #stateModel AppCoreJBrowseModel
|
|
11
|
+
* #category root
|
|
12
|
+
* built on the [JBrowseRootConfig](/docs/config/jbrowserootconfig) config model —
|
|
13
|
+
* config models are MST trees themselves, which is why this state model is
|
|
14
|
+
* allowed to build on one. Generally found on a property named rootModel.jbrowse
|
|
15
|
+
*/
|
|
16
|
+
// A config with exactly one assembly is what every loose track and search index
|
|
17
|
+
// is on, so `assemblyNames` may be left off; with several, each has to say.
|
|
18
|
+
function expandLooseTracks(snapshot, pluginManager) {
|
|
19
|
+
const { tracks, assemblies, aggregateTextSearchAdapters: indexes } = snapshot;
|
|
20
|
+
const only = Array.isArray(assemblies) && assemblies.length === 1
|
|
21
|
+
? assemblies[0].name
|
|
22
|
+
: undefined;
|
|
23
|
+
const expandedTracks = Array.isArray(tracks)
|
|
24
|
+
? tracks.map(t => {
|
|
25
|
+
const track = expandLooseTrackConfig(t, pluginManager, only);
|
|
26
|
+
return track && typeof track === 'object'
|
|
27
|
+
? migrateRetiredDisplays(pluginManager, track)
|
|
28
|
+
: track;
|
|
29
|
+
})
|
|
30
|
+
: tracks;
|
|
31
|
+
const expandedIndexes = Array.isArray(indexes)
|
|
32
|
+
? indexes.map(i => expandLooseSearchIndex(i, only ? [only] : undefined))
|
|
33
|
+
: indexes;
|
|
34
|
+
const same = (a, b) => !Array.isArray(a) || a.every((x, i) => x === b[i]);
|
|
35
|
+
return same(expandedTracks, tracks) && same(expandedIndexes, indexes)
|
|
36
|
+
? snapshot
|
|
37
|
+
: {
|
|
38
|
+
...snapshot,
|
|
39
|
+
...(expandedTracks ? { tracks: expandedTracks } : {}),
|
|
40
|
+
...(expandedIndexes
|
|
41
|
+
? { aggregateTextSearchAdapters: expandedIndexes }
|
|
42
|
+
: {}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function JBrowseModelF({ pluginManager, assemblyConfigSchema, extraConfigSlots, }) {
|
|
46
|
+
const model = JBrowseConfigF({
|
|
47
|
+
pluginManager,
|
|
48
|
+
assemblyConfigSchema,
|
|
49
|
+
extraConfigSlots,
|
|
50
|
+
})
|
|
7
51
|
.views(self => ({
|
|
52
|
+
/**
|
|
53
|
+
* #getter
|
|
54
|
+
*/
|
|
8
55
|
get assemblyNames() {
|
|
9
56
|
return self.assemblies.map(assembly => readConfObject(assembly, 'name'));
|
|
10
57
|
},
|
|
58
|
+
/**
|
|
59
|
+
* #getter
|
|
60
|
+
*/
|
|
11
61
|
get rpcManager() {
|
|
12
62
|
return getParent(self).rpcManager;
|
|
13
63
|
},
|
|
14
64
|
}))
|
|
15
65
|
.actions(self => ({
|
|
66
|
+
/**
|
|
67
|
+
* #action
|
|
68
|
+
*/
|
|
16
69
|
addAssemblyConf(conf) {
|
|
17
70
|
const { name } = conf;
|
|
18
71
|
if (!name) {
|
|
19
72
|
throw new Error('Can\'t add assembly with no "name"');
|
|
20
73
|
}
|
|
21
|
-
if (self.
|
|
74
|
+
if (self.assemblies.some(a => a.name === name || a.aliases.includes(name))) {
|
|
22
75
|
throw new Error(`Can't add assembly with name "${name}", an assembly with that name already exists`);
|
|
23
76
|
}
|
|
24
|
-
const length = self.assemblies.push(
|
|
25
|
-
...conf,
|
|
26
|
-
sequence: {
|
|
27
|
-
type: 'ReferenceSequenceTrack',
|
|
28
|
-
trackId: `${name}-${Date.now()}`,
|
|
29
|
-
...conf.sequence,
|
|
30
|
-
},
|
|
31
|
-
});
|
|
77
|
+
const length = self.assemblies.push(conf);
|
|
32
78
|
return self.assemblies[length - 1];
|
|
33
79
|
},
|
|
80
|
+
/**
|
|
81
|
+
* #action
|
|
82
|
+
*/
|
|
34
83
|
removeAssemblyConf(assemblyName) {
|
|
35
84
|
const toRemove = self.assemblies.find(a => a.name === assemblyName);
|
|
36
85
|
if (toRemove) {
|
|
37
86
|
self.assemblies.remove(toRemove);
|
|
38
87
|
}
|
|
39
88
|
},
|
|
40
|
-
|
|
89
|
+
/**
|
|
90
|
+
* #action
|
|
91
|
+
*/
|
|
92
|
+
addTrackConf(loose) {
|
|
93
|
+
const trackConf = expandLooseTrackConfig(loose, pluginManager);
|
|
41
94
|
const { type } = trackConf;
|
|
42
95
|
if (!type) {
|
|
43
|
-
throw new Error(`
|
|
96
|
+
throw new Error(`track type not specified for "${trackConf.trackId}"`);
|
|
44
97
|
}
|
|
45
98
|
self.tracks = [...self.tracks, trackConf];
|
|
46
99
|
return self.tracks.at(-1);
|
|
47
100
|
},
|
|
101
|
+
/**
|
|
102
|
+
* #action
|
|
103
|
+
* Adds to the config's own `connections`, which every visitor to this
|
|
104
|
+
* instance loads. Takes a snapshot as readily as a built config model —
|
|
105
|
+
* the array coerces — since callers hand it plain JSON (a session spec's
|
|
106
|
+
* `sessionConnections`, the CLI's add-connection output).
|
|
107
|
+
*/
|
|
48
108
|
addConnectionConf(connectionConf) {
|
|
49
109
|
const { type } = connectionConf;
|
|
50
110
|
if (!type) {
|
|
51
|
-
throw new Error(
|
|
111
|
+
throw new Error('connection type not specified');
|
|
52
112
|
}
|
|
53
113
|
const length = self.connections.push(connectionConf);
|
|
54
114
|
return self.connections[length - 1];
|
|
55
115
|
},
|
|
116
|
+
/**
|
|
117
|
+
* #action
|
|
118
|
+
*/
|
|
56
119
|
deleteConnectionConf(configuration) {
|
|
57
|
-
|
|
58
|
-
|
|
120
|
+
// key on connectionId: the connection schema's explicitIdentifier means
|
|
121
|
+
// `.id` is undefined on every entry, so an id-based find always matched
|
|
122
|
+
// the first connection and deleted the wrong one
|
|
123
|
+
const elt = self.connections.find(conn => conn.connectionId === configuration.connectionId);
|
|
124
|
+
return elt ? self.connections.remove(elt) : false;
|
|
59
125
|
},
|
|
126
|
+
/**
|
|
127
|
+
* #action
|
|
128
|
+
*/
|
|
60
129
|
deleteTrackConf(trackConf) {
|
|
61
130
|
const trackId = trackConf.trackId;
|
|
62
131
|
self.tracks = self.tracks.filter(t => t.trackId !== trackId);
|
|
63
132
|
},
|
|
133
|
+
/**
|
|
134
|
+
* #action
|
|
135
|
+
* Updates an existing track configuration. Used to sync editable configs
|
|
136
|
+
* back to the frozen tracks array. A trackId the array repeats replaces
|
|
137
|
+
* its last entry, the one the session resolves it to.
|
|
138
|
+
*/
|
|
64
139
|
updateTrackConf(trackConf) {
|
|
65
140
|
const { trackId } = trackConf;
|
|
66
|
-
const idx = self.tracks.
|
|
141
|
+
const idx = self.tracks.findLastIndex(t => t.trackId === trackId);
|
|
67
142
|
if (idx !== -1) {
|
|
68
143
|
const newTracks = [...self.tracks];
|
|
69
144
|
newTracks[idx] = trackConf;
|
|
70
145
|
self.tracks = newTracks;
|
|
71
146
|
}
|
|
72
147
|
},
|
|
148
|
+
/**
|
|
149
|
+
* #action
|
|
150
|
+
*/
|
|
73
151
|
addPlugin(pluginDefinition) {
|
|
74
152
|
self.plugins.push(pluginDefinition);
|
|
75
|
-
|
|
76
|
-
rootModel.setPluginsUpdated(true);
|
|
153
|
+
getParent(self).setPluginsUpdated();
|
|
77
154
|
},
|
|
155
|
+
/**
|
|
156
|
+
* #action
|
|
157
|
+
* Removes the entry the loaded copy came from — the version-pinned
|
|
158
|
+
* definition, or the bare store ref that resolved to it. Not every entry
|
|
159
|
+
* sharing a name or a ref, so the update flow's remove-then-add swaps one
|
|
160
|
+
* version for another; `holdsPluginVersion` argues both halves.
|
|
161
|
+
*/
|
|
78
162
|
removePlugin(pluginDefinition) {
|
|
79
|
-
self.plugins = cast(self.plugins.filter(plugin => plugin
|
|
80
|
-
|
|
81
|
-
plugin.cjsUrl !== pluginDefinition.cjsUrl ||
|
|
82
|
-
plugin.esmUrl !== pluginDefinition.esmUrl));
|
|
83
|
-
getParent(self).setPluginsUpdated(true);
|
|
163
|
+
self.plugins = cast(self.plugins.filter(plugin => !holdsPluginVersion(plugin, pluginDefinition)));
|
|
164
|
+
getParent(self).setPluginsUpdated();
|
|
84
165
|
},
|
|
166
|
+
/**
|
|
167
|
+
* #action
|
|
168
|
+
* takes the live session or a plain session snapshot
|
|
169
|
+
*/
|
|
85
170
|
setDefaultSessionConf(sessionConf) {
|
|
86
|
-
const newDefault =
|
|
171
|
+
const newDefault = isStateTreeNode(sessionConf)
|
|
87
172
|
? getSnapshot(sessionConf)
|
|
88
173
|
: toJS(sessionConf);
|
|
89
174
|
if (!newDefault.name) {
|
|
90
|
-
throw new Error(
|
|
175
|
+
throw new Error('default session must have a name');
|
|
91
176
|
}
|
|
92
177
|
self.defaultSession = cast(newDefault);
|
|
93
178
|
},
|
|
179
|
+
/**
|
|
180
|
+
* #action
|
|
181
|
+
*/
|
|
94
182
|
addInternetAccountConf(internetAccountConf) {
|
|
95
183
|
const { type } = internetAccountConf;
|
|
96
184
|
if (!type) {
|
|
97
|
-
throw new Error(
|
|
185
|
+
throw new Error('internet account type not specified');
|
|
98
186
|
}
|
|
99
187
|
const length = self.internetAccounts.push(internetAccountConf);
|
|
100
188
|
return self.internetAccounts[length - 1];
|
|
101
189
|
},
|
|
190
|
+
/**
|
|
191
|
+
* #action
|
|
192
|
+
*/
|
|
102
193
|
deleteInternetAccountConf(configuration) {
|
|
103
|
-
|
|
104
|
-
|
|
194
|
+
// key on internetAccountId, not the undefined `.id` (see
|
|
195
|
+
// deleteConnectionConf) so the correct account is removed
|
|
196
|
+
const elt = self.internetAccounts.find(a => a.internetAccountId === configuration.internetAccountId);
|
|
197
|
+
return elt ? self.internetAccounts.remove(elt) : false;
|
|
105
198
|
},
|
|
106
199
|
}));
|
|
200
|
+
// `tracks` stays frozen (ADR-032), so the loose `{ trackId, uri }` form is
|
|
201
|
+
// expanded and a retired display type loaded as its successor here, where
|
|
202
|
+
// the track selector and the trackId index read them, and never by a schema.
|
|
203
|
+
return types.snapshotProcessor(model, {
|
|
204
|
+
preProcessor(snapshot) {
|
|
205
|
+
return expandLooseTracks(snapshot, pluginManager);
|
|
206
|
+
},
|
|
207
|
+
});
|
|
107
208
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createJbApi, ensureReExports, safeJson, sessionOf, undeliveredNotifications, waitReady, } from './jbApi.js';
|