@jbrowse/app-core 5.0.0-beta.1 → 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.
Files changed (75) hide show
  1. package/esm/AppSession/AppSessionMixin.d.ts +42 -316
  2. package/esm/Assemblies/AssembliesMixin.d.ts +172 -103
  3. package/esm/Assemblies/AssembliesMixin.js +13 -8
  4. package/esm/HistoryManagement/index.d.ts +3 -11
  5. package/esm/HistoryManagement/index.js +24 -28
  6. package/esm/JBrowseConfig/RootConfiguration.d.ts +80 -124
  7. package/esm/JBrowseConfig/RootConfiguration.js +5 -11
  8. package/esm/JBrowseConfig/defaultShareUrl.d.ts +1 -0
  9. package/esm/JBrowseConfig/defaultShareUrl.js +5 -0
  10. package/esm/JBrowseConfig/index.d.ts +89 -83
  11. package/esm/JBrowseConfig/index.js +6 -4
  12. package/esm/JBrowseModel/index.d.ts +93 -96
  13. package/esm/JBrowseModel/index.js +43 -43
  14. package/esm/JbApi/index.d.ts +2 -0
  15. package/esm/JbApi/index.js +1 -0
  16. package/esm/JbApi/jbApi.d.ts +2767 -0
  17. package/esm/JbApi/jbApi.js +1383 -0
  18. package/esm/RootMenu/index.d.ts +2 -11
  19. package/esm/RootMenu/index.js +0 -11
  20. package/esm/SessionSpec/index.d.ts +1 -1
  21. package/esm/SessionSpec/index.js +1 -1
  22. package/esm/SessionSpec/lgvUrlInit.js +5 -2
  23. package/esm/SessionSpec/loadSessionSpec.d.ts +56 -2
  24. package/esm/SessionSpec/loadSessionSpec.js +285 -123
  25. package/esm/SessionSpec/parseSessionSpecUrl.d.ts +2 -8
  26. package/esm/SessionSpec/parseSessionSpecUrl.js +2 -17
  27. package/esm/SessionSpec/types.d.ts +16 -12
  28. package/esm/WorkspaceLayout/WorkspaceContainer.js +4 -2
  29. package/esm/WorkspaceLayout/WorkspaceTab.js +2 -6
  30. package/esm/WorkspaceLayout/model.d.ts +24 -4
  31. package/esm/WorkspaceLayout/model.js +76 -17
  32. package/esm/WorkspaceLayout/spec.d.ts +40 -10
  33. package/esm/WorkspaceLayout/spec.js +81 -8
  34. package/esm/index.d.ts +4 -2
  35. package/esm/index.js +4 -1
  36. package/esm/menus.d.ts +15 -29
  37. package/esm/menus.js +76 -92
  38. package/esm/queryParams.d.ts +1 -1
  39. package/esm/queryParams.js +10 -9
  40. package/esm/ui/App/App.js +18 -11
  41. package/esm/ui/App/AppToolbar.js +23 -8
  42. package/esm/ui/App/ClassicViewsContainer.d.ts +2 -2
  43. package/esm/ui/App/DialogQueue.d.ts +2 -2
  44. package/esm/ui/App/DialogQueue.js +3 -3
  45. package/esm/ui/App/DrawerHeader.js +2 -3
  46. package/esm/ui/App/ThemeModeButton.d.ts +12 -0
  47. package/esm/ui/App/ThemeModeButton.js +34 -0
  48. package/esm/ui/App/ViewButtons.js +2 -2
  49. package/esm/ui/App/ViewContainer.js +1 -17
  50. package/esm/ui/App/ViewContainerTitle.js +15 -12
  51. package/esm/ui/App/ViewLauncher.js +1 -1
  52. package/esm/ui/App/ViewMenu.js +2 -2
  53. package/esm/ui/App/ViewStack.js +7 -1
  54. package/esm/ui/App/ViewsContainer.d.ts +2 -4
  55. package/esm/ui/App/ViewsContainer.js +3 -9
  56. package/esm/ui/App/index.d.ts +1 -1
  57. package/esm/ui/App/index.js +1 -1
  58. package/esm/ui/App/lazyParts.d.ts +32 -0
  59. package/esm/ui/App/lazyParts.js +8 -0
  60. package/esm/ui/App/preloadAppShell.d.ts +14 -0
  61. package/esm/ui/App/preloadAppShell.js +41 -0
  62. package/esm/ui/App/types.d.ts +12 -7
  63. package/esm/ui/App/useViewVisibility.d.ts +9 -8
  64. package/esm/ui/App/useViewVisibility.js +11 -10
  65. package/esm/ui/App/viewTitle.d.ts +10 -3
  66. package/esm/ui/App/viewTitle.js +13 -5
  67. package/esm/ui/index.d.ts +1 -1
  68. package/esm/ui/index.js +1 -1
  69. package/package.json +7 -7
  70. package/esm/ui/App/AppReadyMarker.d.ts +0 -34
  71. package/esm/ui/App/AppReadyMarker.js +0 -56
  72. package/esm/ui/App/DrawerControls.d.ts +0 -1
  73. package/esm/ui/App/DrawerControls.js +0 -1
  74. package/esm/ui/App/copyView.d.ts +0 -1
  75. package/esm/ui/App/copyView.js +0 -29
@@ -14,86 +14,87 @@ export declare function AssembliesMixin(_pluginManager: PluginManager, assemblyC
14
14
  */
15
15
  sessionAssemblies: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
16
16
  readonly aliases: {
17
- readonly type: "stringArray";
18
- readonly defaultValue: readonly [];
19
- readonly description: "Other possible names for the assembly";
17
+ type: "stringArray";
18
+ } & {
19
+ defaultValue: unknown;
20
20
  };
21
21
  readonly sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
22
22
  readonly refNameColors: {
23
- readonly type: "stringArray";
24
- readonly defaultValue: readonly [];
25
- readonly description: "Define custom colors for each reference sequence. Will cycle through this list if there are not enough colors for every sequence.";
23
+ type: "stringArray";
24
+ } & {
25
+ defaultValue: unknown;
26
26
  };
27
27
  readonly geneticCodes: {
28
- readonly type: "frozen";
29
- readonly defaultValue: {};
30
- readonly description: "Map of reference sequence name to NCBI genetic-code (translation table) id for sequences not using the standard code, e.g. { \"chrM\": 2 }";
28
+ type: "frozen";
29
+ } & {
30
+ defaultValue: unknown;
31
31
  };
32
32
  readonly geneticCodesLocation: {
33
- readonly type: "fileLocation";
34
- readonly defaultValue: {
35
- readonly uri: "";
36
- readonly locationType: "UriLocation";
37
- };
38
- readonly description: "Optional TSV file of refName<TAB>geneticCodeId, an alternative to inlining the geneticCodes map";
33
+ type: "maybeFileLocation";
39
34
  };
40
35
  readonly refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
41
- readonly adapter: import("@jbrowse/mobx-state-tree").IAnyType;
42
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
36
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
37
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
43
38
  readonly cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
44
- readonly adapter: import("@jbrowse/mobx-state-tree").IAnyType;
45
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
39
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
40
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
46
41
  readonly displayName: {
47
- readonly type: "string";
48
- readonly defaultValue: "";
49
- readonly description: "A human readable display name for the assembly e.g. \"Homo sapiens (hg38)\" while the assembly name may just be \"hg38\"";
42
+ type: "string";
43
+ } & {
44
+ defaultValue: string;
50
45
  };
51
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>>, [undefined]>;
46
+ name: {
47
+ type: "string";
48
+ } & {
49
+ defaultValue: string;
50
+ };
51
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name", undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>>, [undefined]>;
52
52
  /**
53
53
  * #property
54
54
  */
55
55
  temporaryAssemblies: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
56
56
  readonly aliases: {
57
- readonly type: "stringArray";
58
- readonly defaultValue: readonly [];
59
- readonly description: "Other possible names for the assembly";
57
+ type: "stringArray";
58
+ } & {
59
+ defaultValue: unknown;
60
60
  };
61
61
  readonly sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
62
62
  readonly refNameColors: {
63
- readonly type: "stringArray";
64
- readonly defaultValue: readonly [];
65
- readonly description: "Define custom colors for each reference sequence. Will cycle through this list if there are not enough colors for every sequence.";
63
+ type: "stringArray";
64
+ } & {
65
+ defaultValue: unknown;
66
66
  };
67
67
  readonly geneticCodes: {
68
- readonly type: "frozen";
69
- readonly defaultValue: {};
70
- readonly description: "Map of reference sequence name to NCBI genetic-code (translation table) id for sequences not using the standard code, e.g. { \"chrM\": 2 }";
68
+ type: "frozen";
69
+ } & {
70
+ defaultValue: unknown;
71
71
  };
72
72
  readonly geneticCodesLocation: {
73
- readonly type: "fileLocation";
74
- readonly defaultValue: {
75
- readonly uri: "";
76
- readonly locationType: "UriLocation";
77
- };
78
- readonly description: "Optional TSV file of refName<TAB>geneticCodeId, an alternative to inlining the geneticCodes map";
73
+ type: "maybeFileLocation";
79
74
  };
80
75
  readonly refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
81
- readonly adapter: import("@jbrowse/mobx-state-tree").IAnyType;
82
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
76
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
77
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
83
78
  readonly cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
84
- readonly adapter: import("@jbrowse/mobx-state-tree").IAnyType;
85
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
79
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
80
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
86
81
  readonly displayName: {
87
- readonly type: "string";
88
- readonly defaultValue: "";
89
- readonly description: "A human readable display name for the assembly e.g. \"Homo sapiens (hg38)\" while the assembly name may just be \"hg38\"";
82
+ type: "string";
83
+ } & {
84
+ defaultValue: string;
85
+ };
86
+ name: {
87
+ type: "string";
88
+ } & {
89
+ defaultValue: string;
90
90
  };
91
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>>, [undefined]>;
91
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name", undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>>, [undefined]>;
92
92
  }, {
93
93
  /**
94
94
  * #method
95
- * The assembly config already carrying `name`, from any of the three
96
- * arrays the assemblyManager draws on, or undefined.
95
+ * The assembly config answering to `name`, as its name or one of its
96
+ * aliases, from any of the three arrays the assemblyManager draws on,
97
+ * or undefined.
97
98
  *
98
99
  * One namespace, because `name` is the assembly config's MST
99
100
  * identifier: a second config carrying a name one of the others
@@ -102,52 +103,87 @@ export declare function AssembliesMixin(_pluginManager: PluginManager, assemblyC
102
103
  * MST then throws on every read of one — inside the manager's own
103
104
  * autorun and inside `assemblyNameMap`, which takes the session down.
104
105
  * So each add path checks all three, not just the array it pushes to.
106
+ * Aliases count too: a new assembly named `GRCh38` beside an `hg38`
107
+ * aliased `GRCh38` would leave `get('GRCh38')` to array order.
105
108
  */
106
- findAssemblyConf(name: unknown): BaseAssemblyConfigModel | undefined;
109
+ findAssemblyConf(name: string): BaseAssemblyConfigModel | undefined;
107
110
  } & {
108
111
  /**
109
112
  * #action
110
113
  */
111
- addSessionAssembly(conf: AnyConfiguration): (import("@jbrowse/mobx-state-tree").ModelInstanceTypeProps<Record<string, any>> & {
112
- setSubschema(slotName: string, data: Record<string, unknown>): any;
113
- setSlot(slotName: string, value: unknown): void;
114
- } & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
114
+ addSessionAssembly(conf: AnyConfiguration): (import("@jbrowse/core/configuration").ConfigNodeProps<{
115
+ readonly aliases: {
116
+ type: "stringArray";
117
+ } & {
118
+ defaultValue: unknown;
119
+ };
120
+ readonly sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
121
+ readonly refNameColors: {
122
+ type: "stringArray";
123
+ } & {
124
+ defaultValue: unknown;
125
+ };
126
+ readonly geneticCodes: {
127
+ type: "frozen";
128
+ } & {
129
+ defaultValue: unknown;
130
+ };
131
+ readonly geneticCodesLocation: {
132
+ type: "maybeFileLocation";
133
+ };
134
+ readonly refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
135
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
136
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
137
+ readonly cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
138
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
139
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
140
+ readonly displayName: {
141
+ type: "string";
142
+ } & {
143
+ defaultValue: string;
144
+ };
145
+ name: {
146
+ type: "string";
147
+ } & {
148
+ defaultValue: string;
149
+ };
150
+ }> & import("@jbrowse/core/configuration").ConfigNodeActions & import("@jbrowse/core/configuration").ConfigNodeBrand<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
115
151
  readonly aliases: {
116
- readonly type: "stringArray";
117
- readonly defaultValue: readonly [];
118
- readonly description: "Other possible names for the assembly";
152
+ type: "stringArray";
153
+ } & {
154
+ defaultValue: unknown;
119
155
  };
120
156
  readonly sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
121
157
  readonly refNameColors: {
122
- readonly type: "stringArray";
123
- readonly defaultValue: readonly [];
124
- readonly description: "Define custom colors for each reference sequence. Will cycle through this list if there are not enough colors for every sequence.";
158
+ type: "stringArray";
159
+ } & {
160
+ defaultValue: unknown;
125
161
  };
126
162
  readonly geneticCodes: {
127
- readonly type: "frozen";
128
- readonly defaultValue: {};
129
- readonly description: "Map of reference sequence name to NCBI genetic-code (translation table) id for sequences not using the standard code, e.g. { \"chrM\": 2 }";
163
+ type: "frozen";
164
+ } & {
165
+ defaultValue: unknown;
130
166
  };
131
167
  readonly geneticCodesLocation: {
132
- readonly type: "fileLocation";
133
- readonly defaultValue: {
134
- readonly uri: "";
135
- readonly locationType: "UriLocation";
136
- };
137
- readonly description: "Optional TSV file of refName<TAB>geneticCodeId, an alternative to inlining the geneticCodes map";
168
+ type: "maybeFileLocation";
138
169
  };
139
170
  readonly refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
140
- readonly adapter: import("@jbrowse/mobx-state-tree").IAnyType;
141
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
171
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
172
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
142
173
  readonly cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
143
- readonly adapter: import("@jbrowse/mobx-state-tree").IAnyType;
144
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
174
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
175
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
145
176
  readonly displayName: {
146
- readonly type: "string";
147
- readonly defaultValue: "";
148
- readonly description: "A human readable display name for the assembly e.g. \"Homo sapiens (hg38)\" while the assembly name may just be \"hg38\"";
177
+ type: "string";
178
+ } & {
179
+ defaultValue: string;
149
180
  };
150
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>>) | undefined;
181
+ name: {
182
+ type: "string";
183
+ } & {
184
+ defaultValue: string;
185
+ };
186
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name", undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>>) | undefined;
151
187
  /**
152
188
  * #action
153
189
  */
@@ -164,46 +200,79 @@ export declare function AssembliesMixin(_pluginManager: PluginManager, assemblyC
164
200
  * #action
165
201
  * used for read vs ref type assemblies.
166
202
  */
167
- addTemporaryAssembly(conf: AnyConfiguration): (import("@jbrowse/mobx-state-tree").ModelInstanceTypeProps<Record<string, any>> & {
168
- setSubschema(slotName: string, data: Record<string, unknown>): any;
169
- setSlot(slotName: string, value: unknown): void;
170
- } & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
203
+ addTemporaryAssembly(conf: AnyConfiguration): (import("@jbrowse/core/configuration").ConfigNodeProps<{
204
+ readonly aliases: {
205
+ type: "stringArray";
206
+ } & {
207
+ defaultValue: unknown;
208
+ };
209
+ readonly sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
210
+ readonly refNameColors: {
211
+ type: "stringArray";
212
+ } & {
213
+ defaultValue: unknown;
214
+ };
215
+ readonly geneticCodes: {
216
+ type: "frozen";
217
+ } & {
218
+ defaultValue: unknown;
219
+ };
220
+ readonly geneticCodesLocation: {
221
+ type: "maybeFileLocation";
222
+ };
223
+ readonly refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
224
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
225
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
226
+ readonly cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
227
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
228
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
229
+ readonly displayName: {
230
+ type: "string";
231
+ } & {
232
+ defaultValue: string;
233
+ };
234
+ name: {
235
+ type: "string";
236
+ } & {
237
+ defaultValue: string;
238
+ };
239
+ }> & import("@jbrowse/core/configuration").ConfigNodeActions & import("@jbrowse/core/configuration").ConfigNodeBrand<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
171
240
  readonly aliases: {
172
- readonly type: "stringArray";
173
- readonly defaultValue: readonly [];
174
- readonly description: "Other possible names for the assembly";
241
+ type: "stringArray";
242
+ } & {
243
+ defaultValue: unknown;
175
244
  };
176
245
  readonly sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
177
246
  readonly refNameColors: {
178
- readonly type: "stringArray";
179
- readonly defaultValue: readonly [];
180
- readonly description: "Define custom colors for each reference sequence. Will cycle through this list if there are not enough colors for every sequence.";
247
+ type: "stringArray";
248
+ } & {
249
+ defaultValue: unknown;
181
250
  };
182
251
  readonly geneticCodes: {
183
- readonly type: "frozen";
184
- readonly defaultValue: {};
185
- readonly description: "Map of reference sequence name to NCBI genetic-code (translation table) id for sequences not using the standard code, e.g. { \"chrM\": 2 }";
252
+ type: "frozen";
253
+ } & {
254
+ defaultValue: unknown;
186
255
  };
187
256
  readonly geneticCodesLocation: {
188
- readonly type: "fileLocation";
189
- readonly defaultValue: {
190
- readonly uri: "";
191
- readonly locationType: "UriLocation";
192
- };
193
- readonly description: "Optional TSV file of refName<TAB>geneticCodeId, an alternative to inlining the geneticCodes map";
257
+ type: "maybeFileLocation";
194
258
  };
195
259
  readonly refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
196
- readonly adapter: import("@jbrowse/mobx-state-tree").IAnyType;
197
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
260
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
261
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
198
262
  readonly cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
199
- readonly adapter: import("@jbrowse/mobx-state-tree").IAnyType;
200
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
263
+ readonly adapter: import("@jbrowse/core/PluginManager").PluggableConfigSchemaType;
264
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
201
265
  readonly displayName: {
202
- readonly type: "string";
203
- readonly defaultValue: "";
204
- readonly description: "A human readable display name for the assembly e.g. \"Homo sapiens (hg38)\" while the assembly name may just be \"hg38\"";
266
+ type: "string";
267
+ } & {
268
+ defaultValue: string;
269
+ };
270
+ name: {
271
+ type: "string";
272
+ } & {
273
+ defaultValue: string;
205
274
  };
206
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>>) | undefined;
275
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name", undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>>) | undefined;
207
276
  /**
208
277
  * #action
209
278
  */
@@ -25,8 +25,9 @@ export function AssembliesMixin(_pluginManager, assemblyConfigSchemasType) {
25
25
  return {
26
26
  /**
27
27
  * #method
28
- * The assembly config already carrying `name`, from any of the three
29
- * arrays the assemblyManager draws on, or undefined.
28
+ * The assembly config answering to `name`, as its name or one of its
29
+ * aliases, from any of the three arrays the assemblyManager draws on,
30
+ * or undefined.
30
31
  *
31
32
  * One namespace, because `name` is the assembly config's MST
32
33
  * identifier: a second config carrying a name one of the others
@@ -35,13 +36,17 @@ export function AssembliesMixin(_pluginManager, assemblyConfigSchemasType) {
35
36
  * MST then throws on every read of one — inside the manager's own
36
37
  * autorun and inside `assemblyNameMap`, which takes the session down.
37
38
  * So each add path checks all three, not just the array it pushes to.
39
+ * Aliases count too: a new assembly named `GRCh38` beside an `hg38`
40
+ * aliased `GRCh38` would leave `get('GRCh38')` to array order.
38
41
  */
39
42
  findAssemblyConf(name) {
40
- return [
43
+ const confs = [
41
44
  ...self.jbrowse.assemblies,
42
45
  ...self.sessionAssemblies,
43
46
  ...self.temporaryAssemblies,
44
- ].find(f => f.name === name);
47
+ ];
48
+ return (confs.find(f => f.name === name) ??
49
+ confs.find(f => f.aliases.includes(name)));
45
50
  },
46
51
  };
47
52
  })
@@ -83,12 +88,12 @@ export function AssembliesMixin(_pluginManager, assemblyConfigSchemasType) {
83
88
  * #action
84
89
  */
85
90
  removeAssembly(name) {
86
- if (self.adminMode) {
87
- self.jbrowse.removeAssemblyConf(name);
88
- }
89
- else {
91
+ if (self.sessionAssemblies.some(a => a.name === name)) {
90
92
  this.removeSessionAssembly(name);
91
93
  }
94
+ else if (self.adminMode) {
95
+ self.jbrowse.removeAssemblyConf(name);
96
+ }
92
97
  },
93
98
  /**
94
99
  * #action
@@ -1,14 +1,5 @@
1
- /**
2
- * Whether the user is typing into something with an undo stack of its own.
3
- *
4
- * Session undo must not steal the text editor's. The keydown listener below is
5
- * on `document`, so it sees ctrl+z no matter what has focus — including the
6
- * multiline TextFields the config editor, the jexl/JSON monospace field, and
7
- * the paste-config workflows are built from. Those render a `<textarea>`, not
8
- * an `<input>`, so an INPUT-only check let a keystroke meant to undo typing
9
- * roll back the whole session instead.
10
- */
11
- export declare function isTextEntryFocused(): boolean;
1
+ type ShortcutKeys = Pick<KeyboardEvent, 'key' | 'code' | 'ctrlKey' | 'metaKey' | 'shiftKey'>;
2
+ export declare function historyShortcut(e: ShortcutKeys): "redo" | "undo" | undefined;
12
3
  /**
13
4
  * #stateModel HistoryManagementMixin
14
5
  * #category root
@@ -40,3 +31,4 @@ export declare function HistoryManagementMixin(): import("@jbrowse/mobx-state-tr
40
31
  afterCreate(): void;
41
32
  beforeDestroy(): void;
42
33
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
34
+ export {};
@@ -1,26 +1,29 @@
1
1
  import TimeTraveller from '@jbrowse/core/util/TimeTraveller';
2
+ import { isTextEntryFocused } from '@jbrowse/core/util/isTextEntryFocused';
2
3
  import { addDisposer, types } from '@jbrowse/mobx-state-tree';
3
4
  import { asRoot } from '@jbrowse/product-core';
4
5
  import { autorun } from 'mobx';
5
- /**
6
- * Whether the user is typing into something with an undo stack of its own.
7
- *
8
- * Session undo must not steal the text editor's. The keydown listener below is
9
- * on `document`, so it sees ctrl+z no matter what has focus — including the
10
- * multiline TextFields the config editor, the jexl/JSON monospace field, and
11
- * the paste-config workflows are built from. Those render a `<textarea>`, not
12
- * an `<input>`, so an INPUT-only check let a keystroke meant to undo typing
13
- * roll back the whole session instead.
14
- */
15
- export function isTextEntryFocused() {
16
- const el = document.activeElement;
17
- if (!(el instanceof HTMLElement)) {
18
- return false;
6
+ // `key` follows the layout, so undo is wherever the user's Z is (QWERTZ reports
7
+ // it as `code: 'KeyY'`, AZERTY as `KeyW`); a non-Latin layout has no letter
8
+ // there, and the physical key stands in
9
+ function shortcutLetter(e) {
10
+ const key = e.key.toLowerCase();
11
+ return /^[a-z]$/.test(key) ? key : e.code.replace(/^Key/, '').toLowerCase();
12
+ }
13
+ // modifiers first: a synthetic keydown (autofill, an extension) is a bare Event
14
+ // with no `key` to read
15
+ export function historyShortcut(e) {
16
+ if (!e.ctrlKey && !e.metaKey) {
17
+ return undefined;
18
+ }
19
+ const letter = shortcutLetter(e);
20
+ if (letter === 'z') {
21
+ return e.shiftKey ? 'redo' : 'undo';
22
+ }
23
+ if (e.ctrlKey && !e.shiftKey && letter === 'y') {
24
+ return 'redo';
19
25
  }
20
- const tag = el.tagName.toUpperCase();
21
- // coerced: isContentEditable is declared boolean but is undefined in jsdom,
22
- // so the raw expression returns undefined for an ordinary focused element
23
- return tag === 'INPUT' || tag === 'TEXTAREA' || !!el.isContentEditable;
26
+ return undefined;
24
27
  }
25
28
  /**
26
29
  * #stateModel HistoryManagementMixin
@@ -40,18 +43,11 @@ export function HistoryManagementMixin() {
40
43
  if (isTextEntryFocused()) {
41
44
  return;
42
45
  }
43
- if (self.history.canRedo &&
44
- // ctrl+shift+z or cmd+shift+z
45
- (((e.ctrlKey || e.metaKey) && e.shiftKey && e.code === 'KeyZ') ||
46
- // ctrl+y
47
- (e.ctrlKey && !e.shiftKey && e.code === 'KeyY'))) {
46
+ const shortcut = historyShortcut(e);
47
+ if (shortcut === 'redo' && self.history.canRedo) {
48
48
  self.history.redo();
49
49
  }
50
- if (self.history.canUndo &&
51
- // ctrl+z or cmd+z
52
- (e.ctrlKey || e.metaKey) &&
53
- !e.shiftKey &&
54
- e.code === 'KeyZ') {
50
+ else if (shortcut === 'undo' && self.history.canUndo) {
55
51
  self.history.undo();
56
52
  }
57
53
  };