@jbrowse/core 2.2.0 → 2.2.2

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 (80) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail.d.ts +1 -0
  2. package/BaseFeatureWidget/BaseFeatureDetail.js +43 -28
  3. package/BaseFeatureWidget/SequenceBox.js +4 -8
  4. package/BaseFeatureWidget/SequenceFeatureDetails.js +1 -0
  5. package/BaseFeatureWidget/SequenceFeatureSettingsDialog.js +2 -17
  6. package/BaseFeatureWidget/SequenceHelpDialog.js +3 -19
  7. package/Plugin.d.ts +1 -1
  8. package/PluginLoader.d.ts +2 -2
  9. package/PluginManager.d.ts +3 -3
  10. package/assemblyManager/assembly.d.ts +3 -3
  11. package/assemblyManager/assembly.js +1 -1
  12. package/configuration/configurationSchema.d.ts +2 -2
  13. package/data_adapters/BaseAdapter.d.ts +3 -3
  14. package/data_adapters/dataAdapterCache.d.ts +1 -1
  15. package/package.json +2 -2
  16. package/pluggableElementTypes/AdapterType.d.ts +1 -1
  17. package/pluggableElementTypes/AddTrackWorkflowType.d.ts +2 -2
  18. package/pluggableElementTypes/RpcMethodType.d.ts +1 -1
  19. package/pluggableElementTypes/ViewType.d.ts +2 -2
  20. package/pluggableElementTypes/index.d.ts +2 -2
  21. package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +23 -2
  22. package/pluggableElementTypes/models/BaseConnectionModelFactory.js +24 -2
  23. package/pluggableElementTypes/models/BaseDisplayModel.d.ts +2 -2
  24. package/pluggableElementTypes/models/BaseTrackModel.d.ts +49 -4
  25. package/pluggableElementTypes/models/BaseTrackModel.js +77 -26
  26. package/pluggableElementTypes/models/BaseViewModel.d.ts +22 -0
  27. package/pluggableElementTypes/models/BaseViewModel.js +41 -2
  28. package/pluggableElementTypes/models/InternetAccountModel.d.ts +53 -6
  29. package/pluggableElementTypes/models/InternetAccountModel.js +57 -6
  30. package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +0 -3
  31. package/pluggableElementTypes/models/baseTrackConfig.d.ts +2 -2
  32. package/pluggableElementTypes/models/baseTrackConfig.js +9 -0
  33. package/pluggableElementTypes/renderers/BoxRendererType.d.ts +1 -1
  34. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +1 -1
  35. package/pluggableElementTypes/renderers/RendererType.d.ts +1 -1
  36. package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +2 -2
  37. package/pluggableElementTypes/renderers/ServerSideRendererType.js +1 -1
  38. package/pluggableElementTypes/renderers/util/serializableFilterChain.d.ts +2 -2
  39. package/rpc/BaseRpcDriver.js +1 -1
  40. package/rpc/RpcManager.d.ts +2 -2
  41. package/rpc/remoteAbortSignals.d.ts +1 -1
  42. package/tsconfig.build.tsbuildinfo +1 -1
  43. package/ui/AboutDialog.d.ts +1 -1
  44. package/ui/AboutDialog.js +8 -18
  45. package/ui/App.d.ts +2 -2
  46. package/ui/App.js +6 -8
  47. package/ui/AssemblySelector.d.ts +1 -1
  48. package/ui/AssemblySelector.js +12 -10
  49. package/ui/Dialog.d.ts +7 -0
  50. package/ui/Dialog.js +35 -0
  51. package/ui/EditableTypography.d.ts +4 -4
  52. package/ui/EditableTypography.js +7 -11
  53. package/ui/FactoryResetDialog.js +8 -13
  54. package/ui/Logo.d.ts +1 -1
  55. package/ui/Menu.d.ts +2 -2
  56. package/ui/ReturnToImportFormDialog.js +2 -17
  57. package/ui/Snackbar.d.ts +1 -1
  58. package/ui/ViewContainer.d.ts +2 -1
  59. package/ui/ViewContainer.js +34 -22
  60. package/ui/index.d.ts +1 -0
  61. package/ui/index.js +3 -1
  62. package/util/Base1DViewModel.d.ts +72 -2
  63. package/util/Base1DViewModel.js +94 -3
  64. package/util/analytics.js +3 -0
  65. package/util/blockTypes.d.ts +1 -1
  66. package/util/formatFastaStrings.d.ts +1 -1
  67. package/util/formatFastaStrings.js +1 -1
  68. package/util/index.d.ts +3 -1
  69. package/util/index.js +13 -3
  70. package/util/io/RemoteFileWithRangeCache.js +2 -2
  71. package/util/io/index.js +3 -3
  72. package/util/jexl.d.ts +1 -1
  73. package/util/layouts/BaseLayout.d.ts +1 -1
  74. package/util/offscreenCanvasPonyfill.d.ts +2 -2
  75. package/util/offscreenCanvasUtils.d.ts +1 -1
  76. package/util/tracks.d.ts +3 -3
  77. package/util/tracks.js +1 -1
  78. package/util/types/index.d.ts +15 -8
  79. package/util/types/index.js +8 -1
  80. package/util/types/util.d.ts +5 -5
@@ -6,37 +6,67 @@ const configuration_1 = require("../../configuration");
6
6
  const io_1 = require("../../util/io");
7
7
  const mst_1 = require("../../util/types/mst");
8
8
  const inWebWorker = typeof sessionStorage === 'undefined';
9
+ /**
10
+ * #stateModel BaseInternetAccountModel
11
+ */
12
+ function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
9
13
  exports.InternetAccount = mobx_state_tree_1.types
10
14
  .model('InternetAccount', {
15
+ /**
16
+ * #property
17
+ */
11
18
  id: mst_1.ElementId,
19
+ /**
20
+ * #property
21
+ */
12
22
  type: mobx_state_tree_1.types.string,
13
23
  })
14
24
  .views(self => ({
25
+ /**
26
+ * #getter
27
+ */
15
28
  get name() {
16
29
  return (0, configuration_1.getConf)(self, 'name');
17
30
  },
31
+ /**
32
+ * #getter
33
+ */
18
34
  get description() {
19
35
  return (0, configuration_1.getConf)(self, 'description');
20
36
  },
37
+ /**
38
+ * #getter
39
+ */
21
40
  get internetAccountId() {
22
41
  return (0, configuration_1.getConf)(self, 'internetAccountId');
23
42
  },
43
+ /**
44
+ * #getter
45
+ */
24
46
  get authHeader() {
25
47
  return (0, configuration_1.getConf)(self, 'authHeader');
26
48
  },
49
+ /**
50
+ * #getter
51
+ */
27
52
  get tokenType() {
28
53
  return (0, configuration_1.getConf)(self, 'tokenType');
29
54
  },
55
+ /**
56
+ * #getter
57
+ */
30
58
  get domains() {
31
59
  return (0, configuration_1.getConf)(self, 'domains');
32
60
  },
33
61
  /**
62
+ * #getter
34
63
  * Can use this to customize what is displayed in fileSelector's toggle box
35
64
  */
36
65
  get toggleContents() {
37
66
  return null;
38
67
  },
39
68
  /**
69
+ * #getter
40
70
  * Can use this to customize what the fileSelector. It takes a prop called
41
71
  * `setLocation` that should be used to set a UriLocation
42
72
  */
@@ -44,6 +74,7 @@ exports.InternetAccount = mobx_state_tree_1.types
44
74
  return undefined;
45
75
  },
46
76
  /**
77
+ * #getter
47
78
  * Can use this to add a label to the UrlChooser. Has no effect if a custom
48
79
  * SelectorComponent is supplied
49
80
  */
@@ -53,14 +84,16 @@ exports.InternetAccount = mobx_state_tree_1.types
53
84
  }))
54
85
  .views(self => ({
55
86
  /**
87
+ * #method
56
88
  * Determine whether this internetAccount provides credentials for a URL
57
89
  * @param location - UriLocation of resource
58
90
  * @returns true or false
59
91
  */
60
92
  handlesLocation(location) {
61
- return self.domains.some((domain) => location === null || location === void 0 ? void 0 : location.uri.includes(domain));
93
+ return self.domains.some(domain => location === null || location === void 0 ? void 0 : location.uri.includes(domain));
62
94
  },
63
95
  /**
96
+ * #getter
64
97
  * The key used to store this internetAccount's token in sessionStorage
65
98
  */
66
99
  get tokenKey() {
@@ -69,6 +102,7 @@ exports.InternetAccount = mobx_state_tree_1.types
69
102
  }))
70
103
  .actions(self => ({
71
104
  /**
105
+ * #action
72
106
  * Must be implemented by a model extending or composing this one. Pass the
73
107
  * user's token to `resolve`.
74
108
  * @param resolve - Pass the token to this function
@@ -77,16 +111,26 @@ exports.InternetAccount = mobx_state_tree_1.types
77
111
  getTokenFromUser(resolve, reject) {
78
112
  throw new Error('getTokenFromUser must be implemented by extending model');
79
113
  },
114
+ /**
115
+ * #action
116
+ */
80
117
  storeToken(token) {
81
118
  sessionStorage.setItem(self.tokenKey, token);
82
119
  },
120
+ /**
121
+ * #action
122
+ */
83
123
  removeToken() {
84
124
  sessionStorage.removeItem(self.tokenKey);
85
125
  },
126
+ /**
127
+ * #action
128
+ */
86
129
  retrieveToken() {
87
130
  return sessionStorage.getItem(self.tokenKey);
88
131
  },
89
132
  /**
133
+ * #action
90
134
  * This can be used by an internetAccount to validate a token works before
91
135
  * it is used. This is run when preAuthorizationInformation is requested, so
92
136
  * it can be used to check that a token is valid before sending it to a
@@ -95,10 +139,10 @@ exports.InternetAccount = mobx_state_tree_1.types
95
139
  * if the original one was invalid. Should throw an error if a token is
96
140
  * invalid.
97
141
  * @param token - Auth token
98
- * @param location - UriLocation of the resource
142
+ * @param loc - UriLocation of the resource
99
143
  * @returns - Valid auth token
100
144
  */
101
- async validateToken(token, location) {
145
+ async validateToken(token, loc) {
102
146
  return token;
103
147
  },
104
148
  }))
@@ -106,6 +150,7 @@ exports.InternetAccount = mobx_state_tree_1.types
106
150
  let tokenPromise = undefined;
107
151
  return {
108
152
  /**
153
+ * #action
109
154
  * Try to get the token from the location pre-auth, from local storage,
110
155
  * or from a previously cached promise. If token is not available, uses
111
156
  * `getTokenFromUser`.
@@ -146,6 +191,9 @@ exports.InternetAccount = mobx_state_tree_1.types
146
191
  };
147
192
  })
148
193
  .actions(self => ({
194
+ /**
195
+ * #action
196
+ */
149
197
  addAuthHeaderToInit(init = {}, token) {
150
198
  const tokenInfoString = self.tokenType
151
199
  ? `${self.tokenType} ${token}`
@@ -155,6 +203,7 @@ exports.InternetAccount = mobx_state_tree_1.types
155
203
  return { ...init, headers: newHeaders };
156
204
  },
157
205
  /**
206
+ * #action
158
207
  * Gets the token and returns it along with the information needed to
159
208
  * create a new internetAccount.
160
209
  * @param location - UriLocation of the resource
@@ -178,15 +227,16 @@ exports.InternetAccount = mobx_state_tree_1.types
178
227
  }))
179
228
  .actions(self => ({
180
229
  /**
230
+ * #action
181
231
  * Get a fetch method that will add any needed authentication headers to
182
232
  * the request before sending it. If location is provided, it will be
183
233
  * checked to see if it includes a token in it pre-auth information.
184
- * @param location - UriLocation of the resource
234
+ * @param loc - UriLocation of the resource
185
235
  * @returns A function that can be used to fetch
186
236
  */
187
- getFetcher(location) {
237
+ getFetcher(loc) {
188
238
  return async (input, init) => {
189
- const authToken = await self.getToken(location);
239
+ const authToken = await self.getToken(loc);
190
240
  const newInit = self.addAuthHeaderToInit(init, authToken);
191
241
  return fetch(input, newInit);
192
242
  };
@@ -194,6 +244,7 @@ exports.InternetAccount = mobx_state_tree_1.types
194
244
  }))
195
245
  .actions(self => ({
196
246
  /**
247
+ * #action
197
248
  * Gets a filehandle that uses a fetch that adds auth headers
198
249
  * @param location - UriLocation of the resource
199
250
  * @returns A filehandle
@@ -1,4 +1 @@
1
- import { Instance } from 'mobx-state-tree';
2
1
  export declare const BaseInternetAccountConfig: import("../../configuration").AnyConfigurationSchemaType;
3
- export declare type BaseInternetAccountConfigModel = typeof BaseInternetAccountConfig;
4
- export declare type BaseInternetAccountConfig = Instance<BaseInternetAccountConfigModel>;
@@ -4,5 +4,5 @@ import PluginManager from '../../PluginManager';
4
4
  * #config BaseTrack
5
5
  */
6
6
  export declare function createBaseTrackConfig(pluginManager: PluginManager): import("../../configuration").AnyConfigurationSchemaType;
7
- export declare type BaseTrackConfigModel = ReturnType<typeof createBaseTrackConfig>;
8
- export declare type BaseTrackConfig = Instance<BaseTrackConfigModel>;
7
+ export type BaseTrackConfigModel = ReturnType<typeof createBaseTrackConfig>;
8
+ export type BaseTrackConfig = Instance<BaseTrackConfigModel>;
@@ -108,12 +108,18 @@ function createBaseTrackConfig(pluginManager) {
108
108
  },
109
109
  }),
110
110
  formatAbout: (0, configuration_1.ConfigurationSchema)('FormatAbout', {
111
+ /**
112
+ * #slot formatAbout.config
113
+ */
111
114
  config: {
112
115
  type: 'frozen',
113
116
  description: 'formats configuration object in about dialog',
114
117
  defaultValue: {},
115
118
  contextVariable: ['config'],
116
119
  },
120
+ /**
121
+ * #slot formatAbout.hideUris
122
+ */
117
123
  hideUris: {
118
124
  type: 'boolean',
119
125
  defaultValue: false,
@@ -141,6 +147,9 @@ function createBaseTrackConfig(pluginManager) {
141
147
  }
142
148
  return { ...snap, displays };
143
149
  },
150
+ /**
151
+ * #identifier
152
+ */
144
153
  explicitIdentifier: 'trackId',
145
154
  explicitlyTyped: true,
146
155
  actions: (self) => ({
@@ -12,7 +12,7 @@ export interface LayoutSessionProps {
12
12
  bpPerPx: number;
13
13
  filters: SerializableFilterChain;
14
14
  }
15
- export declare type MyMultiLayout = MultiLayout<GranularRectLayout<unknown>, unknown>;
15
+ export type MyMultiLayout = MultiLayout<GranularRectLayout<unknown>, unknown>;
16
16
  export interface CachedLayout {
17
17
  layout: MyMultiLayout;
18
18
  config: AnyConfigurationModel;
@@ -14,7 +14,7 @@ export interface RenderArgsDeserialized extends ServerSideRenderArgsDeserialized
14
14
  blockKey: string;
15
15
  }
16
16
  export type { RenderResults };
17
- export declare type ResultsSerialized = ServerSideResultsSerialized;
17
+ export type ResultsSerialized = ServerSideResultsSerialized;
18
18
  export interface ResultsDeserialized extends ServerSideResultsDeserialized {
19
19
  blockKey: string;
20
20
  }
@@ -3,7 +3,7 @@ import PluggableElementBase from '../PluggableElementBase';
3
3
  import { AnyConfigurationSchemaType } from '../../configuration/configurationSchema';
4
4
  import { AnyReactComponentType } from '../../util';
5
5
  import PluginManager from '../../PluginManager';
6
- export declare type RenderProps = Record<string, unknown>;
6
+ export type RenderProps = Record<string, unknown>;
7
7
  export interface RenderResults {
8
8
  reactElement?: ReactElement;
9
9
  html?: string;
@@ -35,7 +35,7 @@ export interface ResultsSerializedSvgExport extends ResultsSerialized {
35
35
  height: number;
36
36
  reactElement: unknown;
37
37
  }
38
- export declare type ResultsDeserialized = RenderResults;
38
+ export type ResultsDeserialized = RenderResults;
39
39
  export default class ServerSideRenderer extends RendererType {
40
40
  /**
41
41
  * directly modifies the render arguments to prepare them to be serialized and
@@ -74,7 +74,7 @@ export default class ServerSideRenderer extends RendererType {
74
74
  * Render method called on the client. Serializes args, then calls
75
75
  * "CoreRender" with the RPC manager.
76
76
  *
77
- * @param rpcManager - RPC mananger
77
+ * @param rpcManager - RPC manager
78
78
  * @param args - render args
79
79
  */
80
80
  renderInClient(rpcManager: RpcManager, args: RenderArgs): Promise<ResultsSerialized>;
@@ -117,7 +117,7 @@ class ServerSideRenderer extends RendererType_1.default {
117
117
  * Render method called on the client. Serializes args, then calls
118
118
  * "CoreRender" with the RPC manager.
119
119
  *
120
- * @param rpcManager - RPC mananger
120
+ * @param rpcManager - RPC manager
121
121
  * @param args - render args
122
122
  */
123
123
  async renderInClient(rpcManager, args) {
@@ -1,9 +1,9 @@
1
- declare type FilterExpression = (...args: Record<string, any>[] | any[]) => boolean;
1
+ type FilterExpression = (...args: Record<string, any>[] | any[]) => boolean;
2
2
  interface Filter {
3
3
  string: string;
4
4
  expr: FilterExpression;
5
5
  }
6
- export declare type SerializedFilterChain = string[];
6
+ export type SerializedFilterChain = string[];
7
7
  export default class SerializableFilterChain {
8
8
  filterChain: Filter[];
9
9
  constructor({ filters }: {
@@ -110,7 +110,7 @@ class BaseRpcDriver {
110
110
  }
111
111
  async remoteAbort(sessionId, functionName, signalId) {
112
112
  const worker = await this.getWorker(sessionId);
113
- worker.call(functionName, { signalId }, { timeout: 1000000, rpcDriverClassName: this.name });
113
+ await worker.call(functionName, { signalId }, { timeout: 1000000, rpcDriverClassName: this.name });
114
114
  }
115
115
  createWorkerPool() {
116
116
  const hardwareConcurrency = detectHardwareConcurrency();
@@ -2,8 +2,8 @@ import PluginManager from '../PluginManager';
2
2
  import { AnyConfigurationModel } from '../configuration';
3
3
  import WebWorkerRpcDriver from './WebWorkerRpcDriver';
4
4
  import MainThreadRpcDriver from './MainThreadRpcDriver';
5
- declare type DriverClass = WebWorkerRpcDriver | MainThreadRpcDriver;
6
- declare type BackendConfigurations = {
5
+ type DriverClass = WebWorkerRpcDriver | MainThreadRpcDriver;
6
+ type BackendConfigurations = {
7
7
  WebWorkerRpcDriver?: Omit<ConstructorParameters<typeof WebWorkerRpcDriver>[0], 'config'>;
8
8
  MainThreadRpcDriver?: Omit<ConstructorParameters<typeof MainThreadRpcDriver>[0], 'config'>;
9
9
  };
@@ -1,4 +1,4 @@
1
- export declare type RemoteAbortSignal = {
1
+ export type RemoteAbortSignal = {
2
2
  abortSignalId: number;
3
3
  };
4
4
  /**