@jbrowse/core 2.6.3 → 2.7.1

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 (110) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +0 -9
  2. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +2 -3
  3. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +1 -3
  4. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +0 -9
  5. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +2 -3
  6. package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +0 -9
  7. package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +18 -8
  8. package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +0 -9
  9. package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +2 -3
  10. package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +0 -9
  11. package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +2 -3
  12. package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +0 -9
  13. package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +2 -3
  14. package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +2 -11
  15. package/BaseFeatureWidget/BaseFeatureDetail/index.js +5 -4
  16. package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.d.ts +1 -3
  17. package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +1 -1
  18. package/BaseFeatureWidget/util.js +0 -4
  19. package/PluginManager.d.ts +9 -17
  20. package/ReExports/modules.d.ts +5 -5
  21. package/ReExports/modules.js +24 -18
  22. package/TextSearch/TextSearchManager.d.ts +1 -1
  23. package/assemblyManager/assembly.d.ts +2 -0
  24. package/assemblyManager/assembly.js +9 -4
  25. package/assemblyManager/assemblyManager.d.ts +123 -111
  26. package/assemblyManager/assemblyManager.js +1 -1
  27. package/configuration/configurationSchema.js +2 -2
  28. package/configuration/configurationSlot.js +3 -6
  29. package/data_adapters/BaseAdapter/index.d.ts +1 -3
  30. package/data_adapters/dataAdapterCache.js +2 -2
  31. package/package.json +5 -6
  32. package/pluggableElementTypes/AdapterType.d.ts +2 -2
  33. package/pluggableElementTypes/models/BaseTrackModel.d.ts +5 -5
  34. package/pluggableElementTypes/models/BaseTrackModel.js +1 -16
  35. package/pluggableElementTypes/models/InternetAccountModel.d.ts +2 -2
  36. package/pluggableElementTypes/models/InternetAccountModel.js +2 -2
  37. package/pluggableElementTypes/renderers/BoxRendererType.d.ts +1 -3
  38. package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +3 -0
  39. package/pluggableElementTypes/renderers/RendererType.js +1 -1
  40. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +7 -3
  41. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +45 -2
  42. package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +2 -2
  43. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +49 -12
  44. package/pluggableElementTypes/renderers/util/serializableFilterChain.js +2 -2
  45. package/rpc/RpcManager.d.ts +2 -2
  46. package/rpc/WebWorkerRpcDriver.js +3 -3
  47. package/rpc/methods/CoreGetFeatureDensityStats.js +0 -1
  48. package/rpc/methods/CoreGetFeatureDetails.js +0 -1
  49. package/rpc/methods/CoreGetFeatures.js +0 -1
  50. package/rpc/methods/CoreRender.js +0 -1
  51. package/rpc/remoteAbortSignals.d.ts +2 -2
  52. package/tsconfig.build.tsbuildinfo +1 -1
  53. package/ui/ColorPicker.js +3 -6
  54. package/ui/Dialog.d.ts +2 -2
  55. package/ui/Dialog.js +2 -1
  56. package/ui/DropDownMenu.d.ts +3 -4
  57. package/ui/DropDownMenu.js +8 -12
  58. package/ui/EditableTypography.js +7 -5
  59. package/ui/FactoryResetDialog.d.ts +3 -4
  60. package/ui/FactoryResetDialog.js +3 -2
  61. package/ui/FileSelector/FileSelector.d.ts +2 -2
  62. package/ui/FileSelector/FileSelector.js +2 -1
  63. package/ui/FileSelector/LocalFileChooser.d.ts +2 -2
  64. package/ui/FileSelector/LocalFileChooser.js +4 -3
  65. package/ui/FileSelector/UrlChooser.d.ts +5 -5
  66. package/ui/FileSelector/UrlChooser.js +2 -2
  67. package/ui/Menu.js +1 -1
  68. package/ui/MenuButton.d.ts +8 -0
  69. package/ui/MenuButton.js +42 -0
  70. package/ui/ResizeBar.d.ts +0 -4
  71. package/ui/ResizeBar.js +12 -31
  72. package/ui/ResizeHandle.d.ts +3 -2
  73. package/ui/ResizeHandle.js +10 -7
  74. package/ui/ReturnToImportFormDialog.d.ts +4 -5
  75. package/ui/ReturnToImportFormDialog.js +3 -3
  76. package/ui/SanitizedHTML.d.ts +1 -2
  77. package/ui/SanitizedHTML.js +4 -3
  78. package/ui/Snackbar.d.ts +2 -2
  79. package/ui/Snackbar.js +2 -1
  80. package/ui/Tooltip.d.ts +4 -7
  81. package/ui/Tooltip.js +3 -3
  82. package/ui/theme.d.ts +1 -3
  83. package/ui/theme.js +2 -2
  84. package/ui/useResizeBar.d.ts +5 -0
  85. package/ui/useResizeBar.js +22 -0
  86. package/util/Base1DUtils.js +0 -1
  87. package/util/blobToDataURL.d.ts +1 -0
  88. package/util/blobToDataURL.js +18 -0
  89. package/util/blockTypes.d.ts +1 -9
  90. package/util/blockTypes.js +5 -21
  91. package/util/calculateDynamicBlocks.js +3 -2
  92. package/util/calculateStaticBlocks.js +3 -4
  93. package/util/colord.d.ts +1 -0
  94. package/util/colord.js +13 -0
  95. package/util/dedupe.js +1 -2
  96. package/util/index.d.ts +16 -17
  97. package/util/index.js +27 -26
  98. package/util/io/RemoteFileWithRangeCache.js +2 -2
  99. package/util/layouts/GranularRectLayout.js +1 -2
  100. package/util/map-obj.d.ts +1 -1
  101. package/util/nanoid.d.ts +5 -0
  102. package/util/nanoid.js +73 -0
  103. package/util/offscreenCanvasPonyfill.js +1 -2
  104. package/util/offscreenCanvasUtils.js +3 -2
  105. package/util/tracks.d.ts +2 -6
  106. package/util/types/index.d.ts +36 -10
  107. package/util/types/index.js +5 -1
  108. package/util/types/mst.js +2 -2
  109. package/BaseFeatureWidget/BaseFeatureDetail/UriLink.d.ts +0 -7
  110. package/BaseFeatureWidget/BaseFeatureDetail/UriLink.js +0 -13
@@ -8,6 +8,7 @@ import { NoAssemblyRegion as MUNoAssemblyRegion, Region as MUIRegion, LocalPathL
8
8
  import RpcManager from '../../rpc/RpcManager';
9
9
  import { Feature } from '../simpleFeature';
10
10
  import { BaseInternetAccountModel } from '../../pluggableElementTypes/models';
11
+ import { ThemeOptions } from '@mui/material';
11
12
  export * from './util';
12
13
  /** abstract type for a model that contains multiple views */
13
14
  export interface AbstractViewContainer extends IStateTreeNode<IType<any, unknown, any>> {
@@ -42,16 +43,25 @@ export interface JBrowsePlugin {
42
43
  export type DialogComponentType = React.LazyExoticComponent<React.FC<any>> | React.FC<any>;
43
44
  /** minimum interface that all session state models must implement */
44
45
  export interface AbstractSessionModel extends AbstractViewContainer {
46
+ jbrowse: IAnyStateTreeNode;
45
47
  drawerPosition?: string;
46
- setSelection(feature: Feature): void;
47
- clearSelection(): void;
48
48
  configuration: AnyConfigurationModel;
49
49
  rpcManager: RpcManager;
50
50
  assemblyNames: string[];
51
51
  assemblies: AnyConfigurationModel[];
52
52
  selection?: unknown;
53
- duplicateCurrentSession?(): void;
54
- notify(message: string, level?: NotificationLevel, action?: SnackAction): void;
53
+ focusedViewId?: string;
54
+ themeName?: string;
55
+ setFocusedViewId?: (id: string) => void;
56
+ allThemes?: () => Record<string, ThemeOptions | undefined>;
57
+ setSelection: (feature: Feature) => void;
58
+ setSession?: (arg: {
59
+ name: string;
60
+ [key: string]: unknown;
61
+ }) => void;
62
+ clearSelection: () => void;
63
+ duplicateCurrentSession?: () => void;
64
+ notify: (message: string, level?: NotificationLevel, action?: SnackAction) => void;
55
65
  assemblyManager: AssemblyManager;
56
66
  version: string;
57
67
  getTrackActionMenuItems?: Function;
@@ -60,13 +70,19 @@ export interface AbstractSessionModel extends AbstractViewContainer {
60
70
  textSearchManager?: TextSearchManager;
61
71
  connections: AnyConfigurationModel[];
62
72
  deleteConnection?: Function;
73
+ temporaryAssemblies?: unknown[];
74
+ addTemporaryAssembly?: (arg: Record<string, unknown>) => void;
75
+ removeTemporaryAssembly?: (arg: string) => void;
63
76
  sessionConnections?: AnyConfigurationModel[];
77
+ sessionTracks?: AnyConfigurationModel[];
64
78
  connectionInstances?: {
65
79
  name: string;
66
80
  tracks: AnyConfigurationModel[];
67
81
  configuration: AnyConfigurationModel;
68
82
  }[];
69
83
  makeConnection?: Function;
84
+ breakConnection?: Function;
85
+ prepareToBreakConnection?: (arg: AnyConfigurationModel) => any;
70
86
  adminMode?: boolean;
71
87
  showWidget?: Function;
72
88
  addWidget?: Function;
@@ -88,6 +104,11 @@ export interface SessionWithConfigEditing extends AbstractSessionModel {
88
104
  addTrackConf(configuration: AnyConfigurationModel | SnapshotIn<AnyConfigurationModel>): void;
89
105
  }
90
106
  export declare function isSessionWithAddTracks(thing: unknown): thing is SessionWithConfigEditing;
107
+ /** abstract interface for a session allows adding tracks */
108
+ export interface SessionWithShareURL extends AbstractSessionModel {
109
+ shareURL: string;
110
+ }
111
+ export declare function isSessionWithShareURL(thing: unknown): thing is SessionWithShareURL;
91
112
  export interface Widget {
92
113
  type: string;
93
114
  id: string;
@@ -134,6 +155,11 @@ export interface SelectionContainer extends AbstractSessionModel {
134
155
  setSelection(thing: unknown): void;
135
156
  }
136
157
  export declare function isSelectionContainer(thing: unknown): thing is SelectionContainer;
158
+ /** abstract interface for a session allows applying focus to views and widgets */
159
+ export interface SessionWithFocusedViewAndDrawerWidgets extends SessionWithDrawerWidgets {
160
+ focusedViewId: string | undefined;
161
+ setFocusedViewId(id: string): void;
162
+ }
137
163
  /** minimum interface that all view state models must implement */
138
164
  export interface AbstractViewModel {
139
165
  id: string;
@@ -228,14 +254,14 @@ export declare function isRetryException(exception: Error): boolean;
228
254
  export interface BlobLocation extends SnapshotIn<typeof MUBlobLocation> {
229
255
  }
230
256
  export type FileLocation = LocalPathLocation | UriLocation | BlobLocation;
231
- export type PreUriLocation = {
257
+ export interface PreUriLocation {
232
258
  uri: string;
233
- };
234
- export type PreLocalPathLocation = {
259
+ }
260
+ export interface PreLocalPathLocation {
235
261
  localPath: string;
236
- };
237
- export type PreBlobLocation = {
262
+ }
263
+ export interface PreBlobLocation {
238
264
  blob: File;
239
- };
265
+ }
240
266
  export type PreFileLocation = PreUriLocation | PreLocalPathLocation | PreBlobLocation;
241
267
  export { type default as TextSearchManager } from '../../TextSearch/TextSearchManager';
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.isRetryException = exports.isAuthNeededException = exports.RetryError = exports.AuthNeededError = exports.isBlobLocation = exports.isLocalPathLocation = exports.isUriLocation = exports.isAbstractMenuManager = exports.isRootModelWithInternetAccounts = exports.isAppRootModel = exports.isTrackViewModel = exports.isDisplayModel = exports.isTrackModel = exports.isViewModel = exports.isSelectionContainer = exports.isSessionWithSessionPlugins = exports.isSessionModelWithConnectionEditing = exports.isSessionModelWithConnections = exports.isSessionModelWithWidgets = exports.isSessionWithAddTracks = exports.isSessionModelWithConfigEditing = exports.isSessionModel = exports.isViewContainer = void 0;
17
+ exports.isRetryException = exports.isAuthNeededException = exports.RetryError = exports.AuthNeededError = exports.isBlobLocation = exports.isLocalPathLocation = exports.isUriLocation = exports.isAbstractMenuManager = exports.isRootModelWithInternetAccounts = exports.isAppRootModel = exports.isTrackViewModel = exports.isDisplayModel = exports.isTrackModel = exports.isViewModel = exports.isSelectionContainer = exports.isSessionWithSessionPlugins = exports.isSessionModelWithConnectionEditing = exports.isSessionModelWithConnections = exports.isSessionModelWithWidgets = exports.isSessionWithShareURL = exports.isSessionWithAddTracks = exports.isSessionModelWithConfigEditing = exports.isSessionModel = exports.isViewContainer = void 0;
18
18
  const mobx_state_tree_1 = require("mobx-state-tree");
19
19
  __exportStar(require("./util"), exports);
20
20
  function isViewContainer(thing) {
@@ -41,6 +41,10 @@ function isSessionWithAddTracks(thing) {
41
41
  isSessionModel(thing) && 'addTrackConf' in thing && !thing.disableAddTracks);
42
42
  }
43
43
  exports.isSessionWithAddTracks = isSessionWithAddTracks;
44
+ function isSessionWithShareURL(thing) {
45
+ return isSessionModel(thing) && 'shareURL' in thing && !!thing.shareURL;
46
+ }
47
+ exports.isSessionWithShareURL = isSessionWithShareURL;
44
48
  function isSessionModelWithWidgets(thing) {
45
49
  return isSessionModel(thing) && 'widgets' in thing;
46
50
  }
package/util/types/mst.js CHANGED
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.FileLocation = exports.UriLocation = exports.UriLocationRaw = exports.BlobLocation = exports.LocalPathLocation = exports.Region = exports.NoAssemblyRegion = exports.PropTypes = exports.ElementId = void 0;
7
- const shortid_1 = __importDefault(require("shortid"));
8
7
  const mobx_state_tree_1 = require("mobx-state-tree");
9
8
  const prop_types_1 = __importDefault(require("prop-types"));
10
9
  const mobx_react_1 = require("mobx-react");
11
- exports.ElementId = mobx_state_tree_1.types.optional(mobx_state_tree_1.types.identifier, shortid_1.default.generate);
10
+ const nanoid_1 = require("../nanoid");
11
+ exports.ElementId = mobx_state_tree_1.types.optional(mobx_state_tree_1.types.identifier, () => (0, nanoid_1.nanoid)());
12
12
  // PropTypes that are useful when working with instances of these in react components
13
13
  exports.PropTypes = {
14
14
  Region: prop_types_1.default.shape({
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export default function UriLink({ value, }: {
3
- value: {
4
- uri: string;
5
- baseUri?: string;
6
- };
7
- }): React.JSX.Element;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const util_1 = require("../../util");
8
- const ui_1 = require("../../ui");
9
- function UriLink({ value, }) {
10
- const href = (0, util_1.getUriLink)(value);
11
- return react_1.default.createElement(ui_1.SanitizedHTML, { html: `<a href="${href}">${href}</a>` });
12
- }
13
- exports.default = UriLink;