@jbrowse/core 5.0.0-beta.11 → 5.0.0-beta.13

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 (99) hide show
  1. package/README.md +97 -75
  2. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +3 -0
  3. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +14 -1
  4. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +2 -0
  5. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +5 -5
  6. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +1 -1
  7. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/FeatureSequenceDialog.d.ts +3 -1
  8. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/FeatureSequenceDialog.js +2 -2
  9. package/esm/BaseFeatureWidget/SequenceFeatureDetails/featureTypeUtil.d.ts +2 -1
  10. package/esm/BaseFeatureWidget/SequenceFeatureDetails/featureTypeUtil.js +7 -14
  11. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +3 -3
  12. package/esm/BaseFeatureWidget/stateModelFactory.d.ts +7 -0
  13. package/esm/BaseFeatureWidget/stateModelFactory.js +11 -0
  14. package/esm/BaseFeatureWidget/types.d.ts +2 -0
  15. package/esm/PluginManager.d.ts +6 -3
  16. package/esm/PluginManager.js +6 -3
  17. package/esm/ReExports/coreModules.generated.js +291 -285
  18. package/esm/ReExports/coreWorkerModules.generated.js +288 -283
  19. package/esm/ReExports/list.js +7 -0
  20. package/esm/TextSearch/TextSearchManager.d.ts +3 -3
  21. package/esm/TextSearch/TextSearchManager.js +6 -13
  22. package/esm/configuration/configurationSchema.d.ts +33 -95
  23. package/esm/configuration/configurationSchema.js +50 -218
  24. package/esm/configuration/configurationSlot.d.ts +18 -64
  25. package/esm/configuration/configurationSlot.js +31 -97
  26. package/esm/configuration/formatDetailsConfigSchema.js +2 -0
  27. package/esm/configuration/getConf.d.ts +7 -36
  28. package/esm/configuration/getConf.js +7 -37
  29. package/esm/configuration/index.d.ts +3 -2
  30. package/esm/configuration/index.js +2 -1
  31. package/esm/configuration/partitionAdvanced.d.ts +12 -0
  32. package/esm/configuration/partitionAdvanced.js +42 -0
  33. package/esm/configuration/plot.d.ts +6 -0
  34. package/esm/configuration/plot.js +34 -1
  35. package/esm/configuration/readConfObject.d.ts +15 -17
  36. package/esm/configuration/readConfObject.js +19 -50
  37. package/esm/configuration/schemaTypes.js +5 -1
  38. package/esm/configuration/snapshotPreprocess.js +1 -3
  39. package/esm/configuration/types.d.ts +60 -159
  40. package/esm/pluggableElementTypes/DisplayType.d.ts +7 -0
  41. package/esm/pluggableElementTypes/DisplayType.js +7 -0
  42. package/esm/pluggableElementTypes/RpcMethodType.d.ts +7 -0
  43. package/esm/pluggableElementTypes/RpcMethodType.js +9 -0
  44. package/esm/pluggableElementTypes/addMenuItems.d.ts +2 -1
  45. package/esm/pluggableElementTypes/addMenuItems.js +2 -1
  46. package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -2
  47. package/esm/pluggableElementTypes/models/BaseDisplayModel.js +5 -5
  48. package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +2 -4
  49. package/esm/pluggableElementTypes/models/BaseTrackModel.js +2 -4
  50. package/esm/pluggableElementTypes/models/baseTrackConfig.js +3 -0
  51. package/esm/rpc/RpcRegistry.d.ts +2 -1
  52. package/esm/rpc/byteBudget.d.ts +7 -0
  53. package/esm/rpc/byteBudget.js +10 -0
  54. package/esm/rpc/coreRpcMethods.d.ts +1 -1
  55. package/esm/rpc/coreRpcMethods.js +1 -1
  56. package/esm/rpc/explainTransferError.js +3 -3
  57. package/esm/rpc/methods/CoreLoadTrackCode.d.ts +17 -0
  58. package/esm/rpc/methods/CoreLoadTrackCode.js +24 -0
  59. package/esm/ui/AppLogo.js +43 -3
  60. package/esm/ui/buildExtraTrackMenuItems.d.ts +2 -2
  61. package/esm/ui/colors.d.ts +41 -30
  62. package/esm/ui/colors.js +81 -44
  63. package/esm/ui/multiTrackMenuItems.d.ts +2 -2
  64. package/esm/util/alignedBytes.d.ts +19 -0
  65. package/esm/util/alignedBytes.js +37 -0
  66. package/esm/util/analytics.d.ts +5 -6
  67. package/esm/util/analytics.js +5 -3
  68. package/esm/util/bezierConnector.js +5 -1
  69. package/esm/util/categoricalField.d.ts +23 -3
  70. package/esm/util/categoricalField.js +36 -3
  71. package/esm/util/cellMatches.js +14 -14
  72. package/esm/util/cellsStep.d.ts +3 -5
  73. package/esm/util/cellsStep.js +31 -29
  74. package/esm/util/color-bits/parse.js +22 -11
  75. package/esm/util/colorRamp.js +6 -0
  76. package/esm/util/colorScale.d.ts +9 -2
  77. package/esm/util/colorScale.js +33 -2
  78. package/esm/util/colorSchemes.d.ts +4 -2
  79. package/esm/util/colorSchemes.js +4 -1
  80. package/esm/util/isoformRank.d.ts +39 -0
  81. package/esm/util/isoformRank.js +118 -0
  82. package/esm/util/markEncodingTypes.d.ts +3 -1
  83. package/esm/util/quantileExtent.d.ts +22 -0
  84. package/esm/util/quantileExtent.js +24 -1
  85. package/esm/util/systemColorScheme.d.ts +4 -0
  86. package/esm/util/systemColorScheme.js +21 -0
  87. package/esm/util/tabix.d.ts +1 -1
  88. package/esm/util/tabix.js +1 -1
  89. package/esm/util/temporaryAssembly.d.ts +2 -2
  90. package/esm/util/temporaryAssembly.js +2 -3
  91. package/esm/util/trackConfigDelta.d.ts +1 -1
  92. package/esm/util/tracks.d.ts +25 -15
  93. package/esm/util/tracks.js +67 -43
  94. package/esm/util/types/index.d.ts +15 -7
  95. package/esm/util/types/index.js +21 -2
  96. package/esm/util/useRowVirtualScroll.d.ts +1 -0
  97. package/package.json +7 -4
  98. package/esm/rpc/methods/CoreLoadAdapterCode.d.ts +0 -13
  99. package/esm/rpc/methods/CoreLoadAdapterCode.js +0 -16
@@ -1,6 +1,6 @@
1
1
  import type { ViewSnapshotInput } from '../../PluginManager.ts';
2
2
  import type TextSearchManager from '../../TextSearch/TextSearchManager.ts';
3
- import type { AnyConfigurationModel } from '../../configuration/index.ts';
3
+ import type { AnyConfigurationModel, AnyTrackConfig, TrackConfigEntry } from '../../configuration/index.ts';
4
4
  import type { BaseInternetAccountModel, BaseTrackConfig } from '../../pluggableElementTypes/models/index.ts';
5
5
  import type { PluginDefinition } from '../../pluginDefinitions.ts';
6
6
  import type RpcManager from '../../rpc/RpcManager.ts';
@@ -53,17 +53,17 @@ export type AnimationMode = 'system' | 'enabled' | 'disabled';
53
53
  * in `./services.ts`, which is the file that stays cheap to name.
54
54
  */
55
55
  export interface TrackCatalog {
56
- tracks: AnyConfigurationModel[];
56
+ tracks: TrackConfigEntry[];
57
57
  assemblies: AnyConfigurationModel[];
58
58
  connectionInstances?: {
59
59
  tracks: AnyConfigurationModel[];
60
60
  }[];
61
- getTrackById: (id: string) => AnyConfigurationModel | undefined;
61
+ getTrackById: (id: string) => AnyTrackConfig | undefined;
62
62
  }
63
63
  /** minimum interface that all session state models must implement */
64
64
  export interface AbstractSessionModel extends AbstractViewContainer, RenderingServices, NotificationSink, DialogHost, TrackCatalog {
65
65
  /** @deprecated prefer the per-id reactive `getTrackById(id)` */
66
- getTracksById: () => Record<string, AnyConfigurationModel>;
66
+ getTracksById: () => Record<string, AnyTrackConfig>;
67
67
  jbrowse: IAnyStateTreeNode;
68
68
  drawerPosition?: DrawerPosition;
69
69
  stickyViewHeaders?: boolean;
@@ -112,8 +112,8 @@ export interface AbstractSessionModel extends AbstractViewContainer, RenderingSe
112
112
  config: BaseTrackConfig;
113
113
  view?: TrackActionView;
114
114
  }) => MenuItem[];
115
- getTrackActions?: (arg: BaseTrackConfig, view?: TrackActionView) => MenuItem[];
116
- getTrackListMenuItems?: (arg: BaseTrackConfig, view?: TrackActionView) => MenuItem[];
115
+ getTrackActions?: (arg: AnyTrackConfig, view?: TrackActionView) => MenuItem[];
116
+ getTrackListMenuItems?: (arg: AnyTrackConfig, view?: TrackActionView) => MenuItem[];
117
117
  addAssembly?: (conf: Record<string, unknown>) => void;
118
118
  addSessionAssembly?: (conf: Record<string, unknown>) => void;
119
119
  sessionAssemblies?: AnyConfigurationModel[];
@@ -184,6 +184,14 @@ export interface SessionWithEditableTrackConfig extends AbstractSessionModel {
184
184
  getEditableTrackConfig(trackId: string, schemaType: IAnyType): AnyConfigurationModel | undefined;
185
185
  }
186
186
  export declare function isSessionWithEditableTrackConfig(t: unknown): t is SessionWithEditableTrackConfig;
187
+ /**
188
+ * The working copy `trackId` resolves to (ADR-032), through its track type's
189
+ * own schema, which is the one a shown track's `configuration` reference
190
+ * holds, so both reach one node. Re-resolves on every read: an undo or a
191
+ * session restore replaces the working copy. Undefined when the session keeps
192
+ * no working copies or nothing answers the id.
193
+ */
194
+ export declare function getEditableTrackConfigById(session: unknown, trackId: string): AnyConfigurationModel | undefined;
187
195
  /**
188
196
  * abstract interface for a session that keeps a list of views, so that `addView`
189
197
  * appends and the view a launch came out of survives it.
@@ -304,7 +312,7 @@ export interface SessionWithAddAssembly extends AbstractSessionModel {
304
312
  export declare function isSessionWithAddAssembly(t: unknown): t is SessionWithAddAssembly;
305
313
  /** abstract interface for a session that allows deleting track configs */
306
314
  export interface SessionWithDeleteTrackConf extends AbstractSessionModel {
307
- deleteTrackConf(configuration: AnyConfigurationModel): void;
315
+ deleteTrackConf(configuration: AnyTrackConfig): void;
308
316
  }
309
317
  export declare function isSessionWithDeleteTrackConf(t: unknown): t is SessionWithDeleteTrackConf;
310
318
  /** abstract interface for a session allows adding tracks */
@@ -1,4 +1,4 @@
1
- import { isStateTreeNode } from '@jbrowse/mobx-state-tree';
1
+ import { getEnv, isStateTreeNode } from '@jbrowse/mobx-state-tree';
2
2
  import { isSessionServices } from './services.js';
3
3
  export { isSessionServices } from './services.js';
4
4
  // The plain-data half of this file's former self, kept re-exported here so
@@ -24,6 +24,23 @@ export function isSessionWithBaseTrackConfig(t) {
24
24
  export function isSessionWithEditableTrackConfig(t) {
25
25
  return isSessionModel(t) && 'getEditableTrackConfig' in t;
26
26
  }
27
+ /**
28
+ * The working copy `trackId` resolves to (ADR-032), through its track type's
29
+ * own schema, which is the one a shown track's `configuration` reference
30
+ * holds, so both reach one node. Re-resolves on every read: an undo or a
31
+ * session restore replaces the working copy. Undefined when the session keeps
32
+ * no working copies or nothing answers the id.
33
+ */
34
+ export function getEditableTrackConfigById(session, trackId) {
35
+ if (!isSessionWithEditableTrackConfig(session)) {
36
+ return undefined;
37
+ }
38
+ const type = session.getTrackById(trackId)?.type;
39
+ const schema = typeof type === 'string'
40
+ ? getEnv(session).pluginManager.getTrackType(type).configSchema
41
+ : undefined;
42
+ return schema ? session.getEditableTrackConfig(trackId, schema) : undefined;
43
+ }
27
44
  export function isSessionWithMultipleViews(t) {
28
45
  return isSessionModel(t) && isStateTreeNode(t.views);
29
46
  }
@@ -106,7 +123,9 @@ export function isSessionModelWithConnections(thing) {
106
123
  return isSessionModel(thing) && 'makeConnection' in thing;
107
124
  }
108
125
  export function isSessionModelWithConnectionEditing(thing) {
109
- return isSessionModel(thing) && 'addConnectionConf' in thing;
126
+ return (isSessionModel(thing) &&
127
+ 'addConnectionConf' in thing &&
128
+ !('disableAddTracks' in thing && thing.disableAddTracks));
110
129
  }
111
130
  export function isSessionWithSessionPlugins(thing) {
112
131
  return isSessionModel(thing) && 'sessionPlugins' in thing;
@@ -1,4 +1,5 @@
1
1
  import type { RowResizeTarget } from './applyRowResizeWheel.ts';
2
+ export type { RowResizeTarget } from './applyRowResizeWheel.ts';
2
3
  /**
3
4
  * Wheel gestures over a **row-stack** panel — the multi-sample variant displays
4
5
  * and MAF: `shift`+wheel resizes the rows, keeping the row under the cursor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/core",
3
- "version": "5.0.0-beta.11",
3
+ "version": "5.0.0-beta.13",
4
4
  "type": "module",
5
5
  "description": "JBrowse 2 core libraries used by plugins",
6
6
  "keywords": [
@@ -130,6 +130,7 @@
130
130
  "./ui/Snackbar": "./esm/ui/Snackbar.js",
131
131
  "./ui/SnackbarModel": "./esm/ui/SnackbarModel.js",
132
132
  "./ui/StackTraceButton": "./esm/ui/StackTraceButton.js",
133
+ "./ui/SubmitDialog": "./esm/ui/SubmitDialog.js",
133
134
  "./ui/SvgColorLegend": "./esm/ui/SvgColorLegend.js",
134
135
  "./ui/VerticalScrollbar": "./esm/ui/VerticalScrollbar.js",
135
136
  "./ui/buildExtraTrackMenuItems": "./esm/ui/buildExtraTrackMenuItems.js",
@@ -161,6 +162,7 @@
161
162
  "./util/adapterMetadata": "./esm/util/adapterMetadata.js",
162
163
  "./util/addRelativeUris": "./esm/util/addRelativeUris.js",
163
164
  "./util/aggregateFieldName": "./esm/util/aggregateFieldName.js",
165
+ "./util/alignedBytes": "./esm/util/alignedBytes.js",
164
166
  "./util/analytics": "./esm/util/analytics.js",
165
167
  "./util/animationAllowed": "./esm/util/animationAllowed.js",
166
168
  "./util/assemblyConfigUtils": "./esm/util/assemblyConfigUtils.js",
@@ -217,6 +219,7 @@
217
219
  "./util/io/RemoteFileWithRangeCache": "./esm/util/io/RemoteFileWithRangeCache.js",
218
220
  "./util/isDataCurrent": "./esm/util/isDataCurrent.js",
219
221
  "./util/isTextEntryFocused": "./esm/util/isTextEntryFocused.js",
222
+ "./util/isoformRank": "./esm/util/isoformRank.js",
220
223
  "./util/jexl": "./esm/util/jexl.js",
221
224
  "./util/jexlFilters": "./esm/util/jexlFilters.js",
222
225
  "./util/jexlStrings": "./esm/util/jexlStrings.js",
@@ -314,12 +317,12 @@
314
317
  "dompurify": "^3.4.16",
315
318
  "generic-filehandle2": "^2.5.0",
316
319
  "idb": "^8.0.3",
317
- "mobx": "^7.0.5",
320
+ "mobx": "^7.0.6",
318
321
  "mobx-react": "^10.0.2",
319
322
  "rxjs": "^7.8.2",
320
323
  "source-map-js": "^1.2.2",
321
- "@jbrowse/add-track-core": "^5.0.0-beta.11",
322
- "@jbrowse/render-core": "^5.0.0-beta.11"
324
+ "@jbrowse/add-track-core": "^5.0.0-beta.13",
325
+ "@jbrowse/render-core": "^5.0.0-beta.13"
323
326
  },
324
327
  "peerDependencies": {
325
328
  "react": ">=19.0.0",
@@ -1,13 +0,0 @@
1
- import RpcMethodType from '../../pluggableElementTypes/RpcMethodType.ts';
2
- import type { RpcExecuteArgs } from '../RpcRegistry.ts';
3
- /**
4
- * Load these adapter types' code in the worker a track is about to use. An
5
- * adapter's class arrives by dynamic import on the track's first request
6
- * otherwise, and that download waits for the view to lay out and the assembly
7
- * to load.
8
- */
9
- export default class CoreLoadAdapterCode extends RpcMethodType<'CoreLoadAdapterCode'> {
10
- name: 'CoreLoadAdapterCode';
11
- execute({ adapterTypes }: RpcExecuteArgs<'CoreLoadAdapterCode'>): Promise<void>;
12
- serializeArguments(args: Record<string, unknown>): Promise<Record<string, unknown>>;
13
- }
@@ -1,16 +0,0 @@
1
- import RpcMethodType from '../../pluggableElementTypes/RpcMethodType.js';
2
- /**
3
- * Load these adapter types' code in the worker a track is about to use. An
4
- * adapter's class arrives by dynamic import on the track's first request
5
- * otherwise, and that download waits for the view to lay out and the assembly
6
- * to load.
7
- */
8
- export default class CoreLoadAdapterCode extends RpcMethodType {
9
- name = 'CoreLoadAdapterCode';
10
- async execute({ adapterTypes }) {
11
- await Promise.all(adapterTypes.map(type => this.pluginManager.getAdapterType(type).getAdapterClass()));
12
- }
13
- async serializeArguments(args) {
14
- return args;
15
- }
16
- }