@jbrowse/app-core 5.0.0-beta.1 → 5.0.0-beta.11
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/AppSessionMixin.d.ts +42 -316
- package/esm/Assemblies/AssembliesMixin.d.ts +172 -103
- package/esm/Assemblies/AssembliesMixin.js +13 -8
- package/esm/HistoryManagement/index.d.ts +6 -11
- package/esm/HistoryManagement/index.js +24 -28
- package/esm/JBrowseConfig/RootConfiguration.d.ts +80 -124
- package/esm/JBrowseConfig/RootConfiguration.js +5 -11
- package/esm/JBrowseConfig/defaultShareUrl.d.ts +1 -0
- package/esm/JBrowseConfig/defaultShareUrl.js +5 -0
- package/esm/JBrowseConfig/index.d.ts +89 -83
- package/esm/JBrowseConfig/index.js +6 -4
- package/esm/JBrowseModel/index.d.ts +93 -96
- package/esm/JBrowseModel/index.js +43 -43
- 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 +2 -11
- package/esm/RootMenu/index.js +0 -11
- package/esm/SessionSpec/index.d.ts +1 -1
- package/esm/SessionSpec/index.js +1 -1
- package/esm/SessionSpec/lgvUrlInit.js +5 -2
- package/esm/SessionSpec/loadSessionSpec.d.ts +56 -2
- package/esm/SessionSpec/loadSessionSpec.js +285 -123
- package/esm/SessionSpec/parseSessionSpecUrl.d.ts +2 -8
- package/esm/SessionSpec/parseSessionSpecUrl.js +2 -17
- package/esm/SessionSpec/types.d.ts +16 -12
- package/esm/WorkspaceLayout/WorkspaceContainer.js +4 -2
- package/esm/WorkspaceLayout/WorkspaceTab.js +2 -6
- package/esm/WorkspaceLayout/model.d.ts +25 -5
- package/esm/WorkspaceLayout/model.js +77 -18
- package/esm/WorkspaceLayout/spec.d.ts +40 -10
- package/esm/WorkspaceLayout/spec.js +81 -8
- package/esm/index.d.ts +4 -2
- package/esm/index.js +4 -1
- package/esm/menus.d.ts +15 -29
- package/esm/menus.js +76 -92
- package/esm/queryParams.d.ts +1 -1
- package/esm/queryParams.js +10 -9
- package/esm/ui/App/App.js +18 -11
- package/esm/ui/App/AppToolbar.js +23 -8
- package/esm/ui/App/ClassicViewsContainer.d.ts +2 -2
- package/esm/ui/App/DialogQueue.d.ts +2 -2
- package/esm/ui/App/DialogQueue.js +3 -3
- package/esm/ui/App/DrawerHeader.js +2 -3
- package/esm/ui/App/ThemeModeButton.d.ts +12 -0
- package/esm/ui/App/ThemeModeButton.js +34 -0
- package/esm/ui/App/ViewButtons.js +2 -2
- package/esm/ui/App/ViewContainer.js +1 -17
- package/esm/ui/App/ViewContainerTitle.js +15 -12
- package/esm/ui/App/ViewLauncher.js +1 -1
- package/esm/ui/App/ViewMenu.js +2 -2
- package/esm/ui/App/ViewStack.js +7 -1
- package/esm/ui/App/ViewsContainer.d.ts +2 -4
- package/esm/ui/App/ViewsContainer.js +3 -9
- package/esm/ui/App/index.d.ts +1 -1
- package/esm/ui/App/index.js +1 -1
- 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 +12 -7
- package/esm/ui/App/useViewVisibility.d.ts +10 -9
- package/esm/ui/App/useViewVisibility.js +12 -11
- package/esm/ui/App/viewTitle.d.ts +10 -3
- package/esm/ui/App/viewTitle.js +13 -5
- package/esm/ui/index.d.ts +1 -1
- package/esm/ui/index.js +1 -1
- package/package.json +7 -7
- package/esm/ui/App/AppReadyMarker.d.ts +0 -34
- package/esm/ui/App/AppReadyMarker.js +0 -56
- package/esm/ui/App/DrawerControls.d.ts +0 -1
- package/esm/ui/App/DrawerControls.js +0 -1
- package/esm/ui/App/copyView.d.ts +0 -1
- package/esm/ui/App/copyView.js +0 -29
|
@@ -11,133 +11,137 @@ export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, ext
|
|
|
11
11
|
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
12
12
|
readonly rpc: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
13
13
|
readonly defaultDriver: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
readonly advanced: true;
|
|
14
|
+
type: "string";
|
|
15
|
+
} & {
|
|
16
|
+
defaultValue: string;
|
|
18
17
|
};
|
|
19
18
|
readonly workerCount: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly advanced: true;
|
|
19
|
+
type: "number";
|
|
20
|
+
} & {
|
|
21
|
+
defaultValue: number;
|
|
24
22
|
};
|
|
25
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
23
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
26
24
|
readonly formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
27
25
|
readonly feature: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
readonly contextVariable: ["feature"];
|
|
26
|
+
type: "frozen";
|
|
27
|
+
} & {
|
|
28
|
+
defaultValue: unknown;
|
|
32
29
|
};
|
|
33
30
|
readonly subfeatures: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
readonly contextVariable: ["feature"];
|
|
31
|
+
type: "frozen";
|
|
32
|
+
} & {
|
|
33
|
+
defaultValue: unknown;
|
|
38
34
|
};
|
|
39
35
|
readonly depth: {
|
|
40
|
-
|
|
41
|
-
readonly description: "levels of subfeature the formatDetails.subfeatures callback runs on, default 2";
|
|
36
|
+
type: "maybeNumber";
|
|
42
37
|
};
|
|
43
38
|
readonly maxDepth: {
|
|
44
|
-
|
|
45
|
-
readonly description: "hide subfeatures nested deeper than this, default no limit";
|
|
39
|
+
type: "maybeNumber";
|
|
46
40
|
};
|
|
47
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
41
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
48
42
|
readonly formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
49
43
|
readonly config: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
readonly contextVariable: ["config"];
|
|
44
|
+
type: "frozen";
|
|
45
|
+
} & {
|
|
46
|
+
defaultValue: unknown;
|
|
54
47
|
};
|
|
55
48
|
readonly hideUris: {
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
type: "boolean";
|
|
50
|
+
} & {
|
|
51
|
+
defaultValue: boolean;
|
|
58
52
|
};
|
|
59
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
53
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
60
54
|
readonly shareURL: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
type: "string";
|
|
56
|
+
} & {
|
|
57
|
+
defaultValue: string;
|
|
64
58
|
};
|
|
65
59
|
readonly disableAnalytics: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
type: "boolean";
|
|
61
|
+
} & {
|
|
62
|
+
defaultValue: boolean;
|
|
69
63
|
};
|
|
70
64
|
readonly hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
71
65
|
readonly sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
72
66
|
readonly trackNames: {
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
type: "boolean";
|
|
68
|
+
} & {
|
|
69
|
+
defaultValue: boolean;
|
|
75
70
|
};
|
|
76
71
|
readonly categories: {
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
type: "boolean";
|
|
73
|
+
} & {
|
|
74
|
+
defaultValue: boolean;
|
|
79
75
|
};
|
|
80
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
76
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
81
77
|
readonly defaultFolderCategories: {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
type: "stringArray";
|
|
79
|
+
} & {
|
|
80
|
+
defaultValue: unknown;
|
|
85
81
|
};
|
|
86
82
|
readonly defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
87
83
|
readonly categoryNames: {
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
type: "stringArray";
|
|
85
|
+
} & {
|
|
86
|
+
defaultValue: unknown;
|
|
90
87
|
};
|
|
91
88
|
readonly topLevelCategories: {
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
type: "boolean";
|
|
90
|
+
} & {
|
|
91
|
+
defaultValue: boolean;
|
|
94
92
|
};
|
|
95
93
|
readonly subCategories: {
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
type: "boolean";
|
|
95
|
+
} & {
|
|
96
|
+
defaultValue: boolean;
|
|
98
97
|
};
|
|
99
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
100
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
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>>;
|
|
101
100
|
readonly preferences: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
102
101
|
readonly animationMode: {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
type: "stringEnum";
|
|
103
|
+
} & {
|
|
104
|
+
model: import("@jbrowse/mobx-state-tree").ISimpleType<"disabled" | "enabled" | "system">;
|
|
105
|
+
} & {
|
|
106
|
+
defaultValue: string;
|
|
106
107
|
};
|
|
107
108
|
readonly scrollZoom: {
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
type: "boolean";
|
|
110
|
+
} & {
|
|
111
|
+
defaultValue: boolean;
|
|
110
112
|
};
|
|
111
113
|
readonly numberGrouping: {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
type: "boolean";
|
|
115
|
+
} & {
|
|
116
|
+
defaultValue: boolean;
|
|
114
117
|
};
|
|
115
118
|
readonly useWorkspaces: {
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
type: "boolean";
|
|
120
|
+
} & {
|
|
121
|
+
defaultValue: boolean;
|
|
118
122
|
};
|
|
119
|
-
|
|
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>>;
|
|
120
129
|
readonly theme: {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
130
|
+
type: "frozen";
|
|
131
|
+
} & {
|
|
132
|
+
defaultValue: unknown;
|
|
124
133
|
};
|
|
125
134
|
readonly extraThemes: {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
readonly advanced: true;
|
|
135
|
+
type: "frozen";
|
|
136
|
+
} & {
|
|
137
|
+
defaultValue: unknown;
|
|
130
138
|
};
|
|
131
139
|
readonly logoPath: {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
readonly uri: "";
|
|
136
|
-
readonly locationType: "UriLocation";
|
|
137
|
-
};
|
|
138
|
-
readonly advanced: true;
|
|
140
|
+
type: "fileLocation";
|
|
141
|
+
} & {
|
|
142
|
+
defaultValue: unknown;
|
|
139
143
|
};
|
|
140
|
-
}, 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>>;
|
|
141
145
|
plugins: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<PluginDefinition, PluginDefinition, PluginDefinition>>;
|
|
142
146
|
assemblies: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>;
|
|
143
147
|
tracks: import("@jbrowse/mobx-state-tree").IType<{
|
|
@@ -150,9 +154,9 @@ export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, ext
|
|
|
150
154
|
[key: string]: unknown;
|
|
151
155
|
trackId: string;
|
|
152
156
|
}[]>;
|
|
153
|
-
internetAccounts: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/
|
|
154
|
-
aggregateTextSearchAdapters: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/
|
|
155
|
-
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>;
|
|
156
160
|
defaultSession: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
157
161
|
preConfiguredSessions: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<any, any, any>>;
|
|
158
162
|
}, {
|
|
@@ -168,10 +172,7 @@ export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, ext
|
|
|
168
172
|
/**
|
|
169
173
|
* #action
|
|
170
174
|
*/
|
|
171
|
-
addAssemblyConf(conf: AnyConfigurationModel): (import("@jbrowse/
|
|
172
|
-
setSubschema(slotName: string, data: Record<string, unknown>): any;
|
|
173
|
-
setSlot(slotName: string, value: unknown): void;
|
|
174
|
-
} & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | undefined;
|
|
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;
|
|
175
176
|
/**
|
|
176
177
|
* #action
|
|
177
178
|
*/
|
|
@@ -193,7 +194,7 @@ export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, ext
|
|
|
193
194
|
* the array coerces — since callers hand it plain JSON (a session spec's
|
|
194
195
|
* `sessionConnections`, the CLI's add-connection output).
|
|
195
196
|
*/
|
|
196
|
-
addConnectionConf(connectionConf: AnyConfiguration):
|
|
197
|
+
addConnectionConf(connectionConf: AnyConfiguration): (import("@jbrowse/core/configuration").PluggableConfigNode & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/PluginManager").PluggableConfigSchemaType>) | undefined;
|
|
197
198
|
/**
|
|
198
199
|
* #action
|
|
199
200
|
*/
|
|
@@ -207,7 +208,8 @@ export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, ext
|
|
|
207
208
|
/**
|
|
208
209
|
* #action
|
|
209
210
|
* Updates an existing track configuration. Used to sync editable configs
|
|
210
|
-
* back to the frozen tracks array.
|
|
211
|
+
* back to the frozen tracks array. A trackId the array repeats replaces
|
|
212
|
+
* its last entry, the one the session resolves it to.
|
|
211
213
|
*/
|
|
212
214
|
updateTrackConf(trackConf: {
|
|
213
215
|
trackId: string;
|
|
@@ -219,26 +221,21 @@ export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, ext
|
|
|
219
221
|
addPlugin(pluginDefinition: PluginDefinition): void;
|
|
220
222
|
/**
|
|
221
223
|
* #action
|
|
222
|
-
* Removes the entry
|
|
223
|
-
* definition,
|
|
224
|
-
* remove-then-add swaps one
|
|
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.
|
|
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.
|
|
232
228
|
*/
|
|
233
229
|
removePlugin(pluginDefinition: PluginDefinition): void;
|
|
234
230
|
/**
|
|
235
231
|
* #action
|
|
232
|
+
* takes the live session or a plain session snapshot
|
|
236
233
|
*/
|
|
237
234
|
setDefaultSessionConf(sessionConf: AnyConfigurationModel): void;
|
|
238
235
|
/**
|
|
239
236
|
* #action
|
|
240
237
|
*/
|
|
241
|
-
addInternetAccountConf(internetAccountConf: AnyConfigurationModel):
|
|
238
|
+
addInternetAccountConf(internetAccountConf: AnyConfigurationModel): (import("@jbrowse/core/configuration").PluggableConfigNode & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/PluginManager").PluggableConfigSchemaType>) | undefined;
|
|
242
239
|
/**
|
|
243
240
|
* #action
|
|
244
241
|
*/
|
|
@@ -1,8 +1,9 @@
|
|
|
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';
|
|
3
5
|
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';
|
|
6
|
+
import { cast, getParent, getSnapshot, isStateTreeNode, types, } from '@jbrowse/mobx-state-tree';
|
|
6
7
|
import { toJS } from 'mobx';
|
|
7
8
|
import { JBrowseConfigF } from '../JBrowseConfig/index.js';
|
|
8
9
|
/**
|
|
@@ -12,21 +13,34 @@ import { JBrowseConfigF } from '../JBrowseConfig/index.js';
|
|
|
12
13
|
* config models are MST trees themselves, which is why this state model is
|
|
13
14
|
* allowed to build on one. Generally found on a property named rootModel.jbrowse
|
|
14
15
|
*/
|
|
15
|
-
// A config with exactly one assembly is what every loose track
|
|
16
|
-
// `assemblyNames` may be left off; with several,
|
|
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.
|
|
17
18
|
function expandLooseTracks(snapshot, pluginManager) {
|
|
18
|
-
const tracks = snapshot
|
|
19
|
-
if (!Array.isArray(tracks)) {
|
|
20
|
-
return snapshot;
|
|
21
|
-
}
|
|
22
|
-
const assemblies = snapshot.assemblies;
|
|
19
|
+
const { tracks, assemblies, aggregateTextSearchAdapters: indexes } = snapshot;
|
|
23
20
|
const only = Array.isArray(assemblies) && assemblies.length === 1
|
|
24
21
|
? assemblies[0].name
|
|
25
22
|
: undefined;
|
|
26
|
-
const
|
|
27
|
-
|
|
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)
|
|
28
36
|
? snapshot
|
|
29
|
-
: {
|
|
37
|
+
: {
|
|
38
|
+
...snapshot,
|
|
39
|
+
...(expandedTracks ? { tracks: expandedTracks } : {}),
|
|
40
|
+
...(expandedIndexes
|
|
41
|
+
? { aggregateTextSearchAdapters: expandedIndexes }
|
|
42
|
+
: {}),
|
|
43
|
+
};
|
|
30
44
|
}
|
|
31
45
|
export function JBrowseModelF({ pluginManager, assemblyConfigSchema, extraConfigSlots, }) {
|
|
32
46
|
const model = JBrowseConfigF({
|
|
@@ -57,17 +71,10 @@ export function JBrowseModelF({ pluginManager, assemblyConfigSchema, extraConfig
|
|
|
57
71
|
if (!name) {
|
|
58
72
|
throw new Error('Can\'t add assembly with no "name"');
|
|
59
73
|
}
|
|
60
|
-
if (self.
|
|
74
|
+
if (self.assemblies.some(a => a.name === name || a.aliases.includes(name))) {
|
|
61
75
|
throw new Error(`Can't add assembly with name "${name}", an assembly with that name already exists`);
|
|
62
76
|
}
|
|
63
|
-
const length = self.assemblies.push(
|
|
64
|
-
...conf,
|
|
65
|
-
sequence: {
|
|
66
|
-
type: 'ReferenceSequenceTrack',
|
|
67
|
-
trackId: `${name}-${Date.now()}`,
|
|
68
|
-
...conf.sequence,
|
|
69
|
-
},
|
|
70
|
-
});
|
|
77
|
+
const length = self.assemblies.push(conf);
|
|
71
78
|
return self.assemblies[length - 1];
|
|
72
79
|
},
|
|
73
80
|
/**
|
|
@@ -126,11 +133,12 @@ export function JBrowseModelF({ pluginManager, assemblyConfigSchema, extraConfig
|
|
|
126
133
|
/**
|
|
127
134
|
* #action
|
|
128
135
|
* Updates an existing track configuration. Used to sync editable configs
|
|
129
|
-
* back to the frozen tracks array.
|
|
136
|
+
* back to the frozen tracks array. A trackId the array repeats replaces
|
|
137
|
+
* its last entry, the one the session resolves it to.
|
|
130
138
|
*/
|
|
131
139
|
updateTrackConf(trackConf) {
|
|
132
140
|
const { trackId } = trackConf;
|
|
133
|
-
const idx = self.tracks.
|
|
141
|
+
const idx = self.tracks.findLastIndex(t => t.trackId === trackId);
|
|
134
142
|
if (idx !== -1) {
|
|
135
143
|
const newTracks = [...self.tracks];
|
|
136
144
|
newTracks[idx] = trackConf;
|
|
@@ -146,27 +154,21 @@ export function JBrowseModelF({ pluginManager, assemblyConfigSchema, extraConfig
|
|
|
146
154
|
},
|
|
147
155
|
/**
|
|
148
156
|
* #action
|
|
149
|
-
* Removes the entry
|
|
150
|
-
* definition,
|
|
151
|
-
* remove-then-add swaps one
|
|
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.
|
|
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.
|
|
159
161
|
*/
|
|
160
162
|
removePlugin(pluginDefinition) {
|
|
161
|
-
|
|
162
|
-
self.plugins = cast(self.plugins.filter(plugin => !isPluginUrl(plugin, targetUrl)));
|
|
163
|
+
self.plugins = cast(self.plugins.filter(plugin => !holdsPluginVersion(plugin, pluginDefinition)));
|
|
163
164
|
getParent(self).setPluginsUpdated();
|
|
164
165
|
},
|
|
165
166
|
/**
|
|
166
167
|
* #action
|
|
168
|
+
* takes the live session or a plain session snapshot
|
|
167
169
|
*/
|
|
168
170
|
setDefaultSessionConf(sessionConf) {
|
|
169
|
-
const newDefault =
|
|
171
|
+
const newDefault = isStateTreeNode(sessionConf)
|
|
170
172
|
? getSnapshot(sessionConf)
|
|
171
173
|
: toJS(sessionConf);
|
|
172
174
|
if (!newDefault.name) {
|
|
@@ -195,14 +197,12 @@ export function JBrowseModelF({ pluginManager, assemblyConfigSchema, extraConfig
|
|
|
195
197
|
return elt ? self.internetAccounts.remove(elt) : false;
|
|
196
198
|
},
|
|
197
199
|
}));
|
|
198
|
-
//
|
|
199
|
-
//
|
|
200
|
-
//
|
|
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.
|
|
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
203
|
return types.snapshotProcessor(model, {
|
|
204
204
|
preProcessor(snapshot) {
|
|
205
|
-
return
|
|
205
|
+
return expandLooseTracks(snapshot, pluginManager);
|
|
206
206
|
},
|
|
207
207
|
});
|
|
208
208
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createJbApi, ensureReExports, safeJson, sessionOf, undeliveredNotifications, waitReady, } from './jbApi.js';
|