@jbrowse/app-core 5.0.0-beta.7 → 5.0.0-beta.9

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.
@@ -11,137 +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
- 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;
14
+ type: "string";
15
+ } & {
16
+ defaultValue: string;
18
17
  };
19
18
  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;
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>>>;
26
24
  readonly formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
27
25
  readonly feature: {
28
- readonly type: "frozen";
29
- readonly description: "adds extra fields to the feature details";
30
- readonly defaultValue: {};
31
- readonly contextVariable: ["feature"];
26
+ type: "frozen";
27
+ } & {
28
+ defaultValue: unknown;
32
29
  };
33
30
  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"];
31
+ type: "frozen";
32
+ } & {
33
+ defaultValue: unknown;
38
34
  };
39
35
  readonly depth: {
40
- readonly type: "maybeNumber";
41
- readonly description: "levels of subfeature the formatDetails.subfeatures callback runs on, default 2";
36
+ type: "maybeNumber";
42
37
  };
43
38
  readonly maxDepth: {
44
- readonly type: "maybeNumber";
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>>>;
48
42
  readonly formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
49
43
  readonly config: {
50
- readonly type: "frozen";
51
- readonly description: "formats configuration object in about dialog";
52
- readonly defaultValue: {};
53
- readonly contextVariable: ["config"];
44
+ type: "frozen";
45
+ } & {
46
+ defaultValue: unknown;
54
47
  };
55
48
  readonly hideUris: {
56
- readonly type: "boolean";
57
- readonly defaultValue: false;
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>>>;
60
54
  readonly shareURL: {
61
- readonly type: "string";
62
- readonly defaultValue: "https://share.jbrowse.org/api/v1/";
63
- readonly advanced: true;
55
+ type: "string";
56
+ } & {
57
+ defaultValue: string;
64
58
  };
65
59
  readonly disableAnalytics: {
66
- readonly type: "boolean";
67
- readonly defaultValue: false;
68
- readonly advanced: true;
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
- readonly type: "boolean";
74
- readonly defaultValue: false;
67
+ type: "boolean";
68
+ } & {
69
+ defaultValue: boolean;
75
70
  };
76
71
  readonly categories: {
77
- readonly type: "boolean";
78
- readonly defaultValue: false;
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>>>;
81
77
  readonly defaultFolderCategories: {
82
- readonly type: "stringArray";
83
- readonly description: "list of category names to display as folders by default";
84
- readonly defaultValue: readonly [];
78
+ type: "stringArray";
79
+ } & {
80
+ defaultValue: unknown;
85
81
  };
86
82
  readonly defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
87
83
  readonly categoryNames: {
88
- readonly type: "stringArray";
89
- readonly defaultValue: readonly [];
84
+ type: "stringArray";
85
+ } & {
86
+ defaultValue: unknown;
90
87
  };
91
88
  readonly topLevelCategories: {
92
- readonly type: "boolean";
93
- readonly defaultValue: false;
89
+ type: "boolean";
90
+ } & {
91
+ defaultValue: boolean;
94
92
  };
95
93
  readonly subCategories: {
96
- readonly type: "boolean";
97
- readonly defaultValue: false;
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>>>;
99
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>>>;
101
100
  readonly preferences: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
102
101
  readonly animationMode: {
103
- readonly model: import("@jbrowse/mobx-state-tree").ISimpleType<"disabled" | "enabled" | "system">;
104
- readonly type: "stringEnum";
105
- readonly defaultValue: "enabled";
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
- readonly type: "boolean";
109
- readonly defaultValue: false;
109
+ type: "boolean";
110
+ } & {
111
+ defaultValue: boolean;
110
112
  };
111
113
  readonly numberGrouping: {
112
- readonly type: "boolean";
113
- readonly defaultValue: true;
114
+ type: "boolean";
115
+ } & {
116
+ defaultValue: boolean;
114
117
  };
115
118
  readonly useWorkspaces: {
116
- readonly type: "boolean";
117
- readonly defaultValue: false;
119
+ type: "boolean";
120
+ } & {
121
+ defaultValue: boolean;
118
122
  };
119
123
  readonly developerMode: {
120
- readonly type: "boolean";
121
- readonly defaultValue: false;
124
+ type: "boolean";
125
+ } & {
126
+ defaultValue: boolean;
122
127
  };
123
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
128
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>>>;
124
129
  readonly theme: {
125
- readonly type: "frozen";
126
- readonly description: "Material UI theme overrides applied to the JBrowse UI";
127
- readonly defaultValue: {};
130
+ type: "frozen";
131
+ } & {
132
+ defaultValue: unknown;
128
133
  };
129
134
  readonly extraThemes: {
130
- readonly type: "frozen";
131
- readonly description: "additional named themes the user can switch between";
132
- readonly defaultValue: {};
133
- readonly advanced: true;
135
+ type: "frozen";
136
+ } & {
137
+ defaultValue: unknown;
134
138
  };
135
139
  readonly logoPath: {
136
- readonly type: "fileLocation";
137
- readonly description: "path to a custom logo image displayed in the app header";
138
- readonly defaultValue: {
139
- readonly uri: "";
140
- readonly locationType: "UriLocation";
141
- };
142
- readonly advanced: true;
140
+ type: "fileLocation";
141
+ } & {
142
+ defaultValue: unknown;
143
143
  };
144
- }, 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>>>;
145
145
  plugins: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<PluginDefinition, PluginDefinition, PluginDefinition>>;
146
146
  assemblies: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>;
147
147
  tracks: import("@jbrowse/mobx-state-tree").IType<{
@@ -172,10 +172,7 @@ export declare function JBrowseModelF({ pluginManager, assemblyConfigSchema, ext
172
172
  /**
173
173
  * #action
174
174
  */
175
- addAssemblyConf(conf: AnyConfigurationModel): (import("@jbrowse/mobx-state-tree").ModelInstanceTypeProps<Record<string, any>> & {
176
- setSubschema(slotName: string, data: Record<string, unknown>): any;
177
- setSlot(slotName: string, value: unknown): void;
178
- } & 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;
179
176
  /**
180
177
  * #action
181
178
  */
@@ -1,5 +1,6 @@
1
1
  import { readConfObject } from '@jbrowse/core/configuration';
2
2
  import { isPluginUrl, maybePluginUrl } from '@jbrowse/core/pluginDefinitions';
3
+ import { expandLooseSearchIndex } from '@jbrowse/core/util/expandLooseSearchIndex';
3
4
  import { expandLooseTrackConfig } from '@jbrowse/core/util/tracks';
4
5
  import { cast, getParent, getSnapshot, types } from '@jbrowse/mobx-state-tree';
5
6
  import { migrateConfigSnapshot } from '@jbrowse/product-core';
@@ -12,21 +13,29 @@ 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 is on, so
16
- // `assemblyNames` may be left off; with several, the track has to say.
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.tracks;
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 expanded = tracks.map(t => expandLooseTrackConfig(t, pluginManager, only));
27
- return expanded.every((t, i) => t === tracks[i])
23
+ const expandedTracks = Array.isArray(tracks)
24
+ ? tracks.map(t => expandLooseTrackConfig(t, pluginManager, only))
25
+ : tracks;
26
+ const expandedIndexes = Array.isArray(indexes)
27
+ ? indexes.map(i => expandLooseSearchIndex(i, only ? [only] : undefined))
28
+ : indexes;
29
+ const same = (a, b) => !Array.isArray(a) || a.every((x, i) => x === b[i]);
30
+ return same(expandedTracks, tracks) && same(expandedIndexes, indexes)
28
31
  ? snapshot
29
- : { ...snapshot, tracks: expanded };
32
+ : {
33
+ ...snapshot,
34
+ ...(expandedTracks ? { tracks: expandedTracks } : {}),
35
+ ...(expandedIndexes
36
+ ? { aggregateTextSearchAdapters: expandedIndexes }
37
+ : {}),
38
+ };
30
39
  }
31
40
  export function JBrowseModelF({ pluginManager, assemblyConfigSchema, extraConfigSlots, }) {
32
41
  const model = JBrowseConfigF({