@jbrowse/core 1.7.9 → 2.0.0

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 (86) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail.d.ts +14 -7
  2. package/BaseFeatureWidget/BaseFeatureDetail.js +203 -125
  3. package/BaseFeatureWidget/SequenceFeatureDetails.js +20 -15
  4. package/BaseFeatureWidget/index.d.ts +23 -2
  5. package/BaseFeatureWidget/index.js +100 -3
  6. package/BaseFeatureWidget/index.test.js +48 -30
  7. package/PluginManager.d.ts +58 -86
  8. package/ReExports/Attributes.d.ts +2 -0
  9. package/ReExports/Attributes.js +12 -0
  10. package/ReExports/BaseCard.d.ts +2 -0
  11. package/ReExports/BaseCard.js +12 -0
  12. package/ReExports/DataGrid.d.ts +2 -0
  13. package/ReExports/DataGrid.js +13 -0
  14. package/ReExports/FeatureDetails.d.ts +2 -0
  15. package/ReExports/FeatureDetails.js +12 -0
  16. package/ReExports/list.js +1 -1
  17. package/ReExports/material-ui-colors.d.ts +1 -19
  18. package/ReExports/material-ui-colors.js +11 -152
  19. package/ReExports/modules.d.ts +59 -91
  20. package/ReExports/modules.js +683 -127
  21. package/TextSearch/TextSearchManager.d.ts +3 -1
  22. package/assemblyManager/assembly.d.ts +6 -7
  23. package/assemblyManager/assembly.js +27 -16
  24. package/assemblyManager/assemblyManager.d.ts +82 -24
  25. package/assemblyManager/assemblyManager.js +32 -36
  26. package/configuration/util.d.ts +1 -1
  27. package/package.json +15 -15
  28. package/pluggableElementTypes/models/BaseDisplayModel.d.ts +10 -10
  29. package/pluggableElementTypes/models/BaseTrackModel.d.ts +1 -1
  30. package/pluggableElementTypes/models/BaseTrackModel.js +24 -25
  31. package/pluggableElementTypes/models/baseTrackConfig.js +20 -13
  32. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +2 -2
  33. package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +2 -2
  34. package/pluggableElementTypes/renderers/ServerSideRendererType.js +1 -1
  35. package/rpc/BaseRpcDriver.js +1 -1
  36. package/tsconfig.build.tsbuildinfo +1 -1
  37. package/ui/AboutDialog.d.ts +1 -1
  38. package/ui/AboutDialog.js +38 -16
  39. package/ui/App.js +18 -37
  40. package/ui/AssemblySelector.d.ts +1 -1
  41. package/ui/AssemblySelector.js +10 -5
  42. package/ui/CascadingMenu.d.ts +9 -0
  43. package/ui/CascadingMenu.js +207 -0
  44. package/ui/Drawer.js +8 -5
  45. package/ui/DrawerWidget.js +39 -45
  46. package/ui/DropDownMenu.d.ts +0 -8
  47. package/ui/DropDownMenu.js +9 -15
  48. package/ui/EditableTypography.d.ts +1 -1
  49. package/ui/EditableTypography.js +42 -48
  50. package/ui/ErrorMessage.js +13 -23
  51. package/ui/FactoryResetDialog.js +6 -6
  52. package/ui/FatalErrorDialog.js +5 -5
  53. package/ui/FileSelector/FileSelector.js +19 -19
  54. package/ui/FileSelector/LocalFileChooser.js +12 -8
  55. package/ui/FileSelector/UrlChooser.js +2 -2
  56. package/ui/Icons.d.ts +1 -1
  57. package/ui/Icons.js +1 -1
  58. package/ui/Menu.d.ts +11 -1
  59. package/ui/Menu.js +32 -38
  60. package/ui/PrerenderedCanvas.js +10 -1
  61. package/ui/ResizeHandle.js +8 -6
  62. package/ui/ReturnToImportFormDialog.js +14 -10
  63. package/ui/SanitizedHTML.js +15 -21
  64. package/ui/Snackbar.js +11 -9
  65. package/ui/Tooltip.d.ts +3 -1
  66. package/ui/Tooltip.js +5 -3
  67. package/ui/ViewContainer.js +38 -25
  68. package/ui/index.d.ts +1 -0
  69. package/ui/index.js +9 -0
  70. package/ui/theme.d.ts +279 -131
  71. package/ui/theme.js +174 -154
  72. package/ui/theme.test.js +56 -75
  73. package/util/Base1DViewModel.d.ts +1 -8
  74. package/util/Base1DViewModel.js +11 -13
  75. package/util/color/index.js +6 -6
  76. package/util/index.d.ts +4 -8
  77. package/util/index.js +29 -19
  78. package/util/jexl.js +42 -43
  79. package/util/layouts/GranularRectLayout.js +1 -3
  80. package/util/layouts/PrecomputedLayout.js +1 -3
  81. package/util/offscreenCanvasPonyfill.js +10 -12
  82. package/util/tracks.js +4 -2
  83. package/util/types/index.d.ts +14 -4
  84. package/util/types/index.js +6 -0
  85. package/util/types/mst.d.ts +3 -3
  86. package/util/types/mst.js +11 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/core",
3
- "version": "1.7.9",
3
+ "version": "2.0.0",
4
4
  "description": "JBrowse 2 core libraries used by plugins",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -30,11 +30,11 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.17.9",
33
- "@material-ui/icons": "^4.0.1",
33
+ "@mui/icons-material": "^5.0.1",
34
34
  "abortable-promise-cache": "^1.5.0",
35
- "canvas": "^2.8.0",
36
35
  "canvas-sequencer": "^3.1.0",
37
36
  "canvas2svg": "^1.0.16",
37
+ "clone": "^2.1.2",
38
38
  "clsx": "^1.0.4",
39
39
  "color": "^3.1.3",
40
40
  "copy-to-clipboard": "^3.3.1",
@@ -50,29 +50,29 @@
50
50
  "json-stable-stringify": "^1.0.1",
51
51
  "librpc-web-mod": "^1.1.5",
52
52
  "load-script2": "^2.0.5",
53
- "object.fromentries": "^2.0.0",
53
+ "material-ui-popup-state": "^3.0.0",
54
54
  "rbush": "^3.0.1",
55
55
  "react-error-boundary": "^3.0.0",
56
- "react-intersection-observer": "^8.32.5",
56
+ "react-intersection-observer": "^9.3.0",
57
57
  "react-use-measure": "^2.1.1",
58
58
  "shortid": "^2.2.13",
59
59
  "svg-path-generator": "^1.1.0"
60
60
  },
61
61
  "peerDependencies": {
62
- "@material-ui/core": "^4.12.2",
63
- "@material-ui/lab": "^4.0.0-alpha.45",
64
- "@mui/x-data-grid": "^4.0.0",
65
- "mobx": "^5.0.0",
66
- "mobx-react": "^6.0.0",
67
- "mobx-state-tree": "^3.14.1",
62
+ "@mui/material": "^5.0.0",
63
+ "@mui/x-data-grid": "^5.0.0",
64
+ "mobx": "^6.0.0",
65
+ "mobx-react": "^7.0.0",
66
+ "mobx-state-tree": "^5.0.0",
68
67
  "prop-types": "^15.0.0",
69
- "react": "^17.0.0",
70
- "react-dom": "^17.0.0",
71
- "rxjs": "^6.0.0"
68
+ "react": ">=16.8.0",
69
+ "react-dom": ">=16.8.0",
70
+ "rxjs": "^6.0.0",
71
+ "tss-react": "^3.0.0"
72
72
  },
73
73
  "publishConfig": {
74
74
  "access": "public",
75
75
  "directory": "dist"
76
76
  },
77
- "gitHead": "a6504c385d703ce6e755d05652ef659ffe28c864"
77
+ "gitHead": "ecc7f5d47351a5ea04bc00f3a6eb6dfb607342e6"
78
78
  }
@@ -10,11 +10,11 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
10
10
  error: unknown;
11
11
  } & {
12
12
  readonly RenderingComponent: React.FC<{
13
- model: import("mobx-state-tree").ModelInstanceTypeProps<{
14
- id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
15
- type: import("mobx-state-tree").ISimpleType<string>;
16
- rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
17
- }> & {
13
+ model: {
14
+ id: string;
15
+ type: string;
16
+ rpcDriverName: string | undefined;
17
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
18
18
  rendererTypeName: string;
19
19
  error: unknown;
20
20
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
@@ -29,11 +29,11 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
29
29
  blockState?: Record<string, any> | undefined;
30
30
  }>;
31
31
  readonly DisplayBlurb: React.FC<{
32
- model: import("mobx-state-tree").ModelInstanceTypeProps<{
33
- id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
34
- type: import("mobx-state-tree").ISimpleType<string>;
35
- rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
36
- }> & {
32
+ model: {
33
+ id: string;
34
+ type: string;
35
+ rpcDriverName: string | undefined;
36
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
37
37
  rendererTypeName: string;
38
38
  error: unknown;
39
39
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
@@ -21,7 +21,7 @@ export declare function createBaseTrackModel(pluginManager: PluginManager, track
21
21
  activateConfigurationUI(): void;
22
22
  showDisplay(displayId: string, initialSnapshot?: {}): void;
23
23
  hideDisplay(displayId: string): number;
24
- replaceDisplay(oldDisplayId: string, newDisplayId: string, initialSnapshot?: {}): void;
24
+ replaceDisplay(oldId: string, newId: string, initialSnapshot?: {}): void;
25
25
  } & {
26
26
  trackMenuItems(): MenuItem[];
27
27
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
@@ -112,55 +112,54 @@ function createBaseTrackModel(pluginManager, trackType, baseTrackConfig) {
112
112
  },
113
113
  showDisplay: function showDisplay(displayId) {
114
114
  var initialSnapshot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
115
- var displayTypeConfigSchema = pluginManager.pluggableConfigSchemaType('display');
116
- var configuration = (0, _mobxStateTree.resolveIdentifier)(displayTypeConfigSchema, (0, _mobxStateTree.getRoot)(self), displayId);
117
- var displayType = pluginManager.getDisplayType(configuration.type);
115
+ var schema = pluginManager.pluggableConfigSchemaType('display');
116
+ var conf = (0, _mobxStateTree.resolveIdentifier)(schema, (0, _mobxStateTree.getRoot)(self), displayId);
117
+ var displayType = pluginManager.getDisplayType(conf.type);
118
118
 
119
119
  if (!displayType) {
120
- throw new Error("unknown display type ".concat(configuration.type));
120
+ throw new Error("unknown display type ".concat(conf.type));
121
121
  }
122
122
 
123
123
  var display = displayType.stateModel.create(_objectSpread(_objectSpread({}, initialSnapshot), {}, {
124
- type: configuration.type,
125
- configuration: configuration
124
+ type: conf.type,
125
+ configuration: conf
126
126
  }));
127
127
  self.displays.push(display);
128
128
  },
129
129
  hideDisplay: function hideDisplay(displayId) {
130
- var displayTypeConfigSchema = pluginManager.pluggableConfigSchemaType('display');
131
- var configuration = (0, _mobxStateTree.resolveIdentifier)(displayTypeConfigSchema, (0, _mobxStateTree.getRoot)(self), displayId); // if we have any displays with that configuration, turn them off
132
-
133
- var shownDisplays = self.displays.filter(function (d) {
134
- return d.configuration === configuration;
130
+ var schema = pluginManager.pluggableConfigSchemaType('display');
131
+ var conf = (0, _mobxStateTree.resolveIdentifier)(schema, (0, _mobxStateTree.getRoot)(self), displayId);
132
+ var t = self.displays.filter(function (d) {
133
+ return d.conf === conf;
135
134
  });
136
135
  (0, _mobx.transaction)(function () {
137
- return shownDisplays.forEach(function (d) {
136
+ return t.forEach(function (d) {
138
137
  return self.displays.remove(d);
139
138
  });
140
139
  });
141
- return shownDisplays.length;
140
+ return t.length;
142
141
  },
143
- replaceDisplay: function replaceDisplay(oldDisplayId, newDisplayId) {
142
+ replaceDisplay: function replaceDisplay(oldId, newId) {
144
143
  var initialSnapshot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
145
- var displayIdx = self.displays.findIndex(function (d) {
146
- return d.configuration.displayId === oldDisplayId;
144
+ var idx = self.displays.findIndex(function (d) {
145
+ return d.conf.displayId === oldId;
147
146
  });
148
147
 
149
- if (displayIdx === -1) {
150
- throw new Error("could not find display id ".concat(oldDisplayId, " to replace"));
148
+ if (idx === -1) {
149
+ throw new Error("could not find display id ".concat(oldId, " to replace"));
151
150
  }
152
151
 
153
- var displayTypeConfigSchema = pluginManager.pluggableConfigSchemaType('display');
154
- var configuration = (0, _mobxStateTree.resolveIdentifier)(displayTypeConfigSchema, (0, _mobxStateTree.getRoot)(self), newDisplayId);
155
- var displayType = pluginManager.getDisplayType(configuration.type);
152
+ var schema = pluginManager.pluggableConfigSchemaType('display');
153
+ var conf = (0, _mobxStateTree.resolveIdentifier)(schema, (0, _mobxStateTree.getRoot)(self), newId);
154
+ var displayType = pluginManager.getDisplayType(conf.type);
156
155
 
157
156
  if (!displayType) {
158
- throw new Error("unknown display type ".concat(configuration.type));
157
+ throw new Error("unknown display type ".concat(conf.type));
159
158
  }
160
159
 
161
- self.displays.splice(displayIdx, 1, _objectSpread(_objectSpread({}, initialSnapshot), {}, {
162
- type: configuration.type,
163
- configuration: configuration
160
+ self.displays.splice(idx, 1, _objectSpread(_objectSpread({}, initialSnapshot), {}, {
161
+ type: conf.type,
162
+ configuration: conf
164
163
  }));
165
164
  }
166
165
  };
@@ -58,19 +58,26 @@ function createBaseTrackConfig(pluginManager) {
58
58
  },
59
59
  textSearchAdapter: pluginManager.pluggableConfigSchemaType('text search adapter')
60
60
  }),
61
- displays: _mobxStateTree.types.array(pluginManager.pluggableConfigSchemaType('display')) // see corresponding entry in circular-view ChordTrack
62
- // no config slot editor exists for this at the time being
63
- // configRelationships: {
64
- // type: 'configRelationships',
65
- // model: types.array(
66
- // types.model('Relationship', {
67
- // type: types.string,
68
- // target: types.maybe(types.reference(base)),
69
- // }),
70
- // ),
71
- // defaultValue: [],
72
- // },
73
-
61
+ displays: _mobxStateTree.types.array(pluginManager.pluggableConfigSchemaType('display')),
62
+ formatDetails: (0, _configuration.ConfigurationSchema)('FormatDetails', {
63
+ feature: {
64
+ type: 'frozen',
65
+ description: 'adds extra fields to the feature details',
66
+ defaultValue: {},
67
+ contextVariable: ['feature']
68
+ },
69
+ subfeatures: {
70
+ type: 'frozen',
71
+ description: 'adds extra fields to the subfeatures of a feature',
72
+ defaultValue: {},
73
+ contextVariable: ['feature']
74
+ },
75
+ depth: {
76
+ type: 'number',
77
+ defaultValue: 2,
78
+ description: 'depth to iterate on subfeatures'
79
+ }
80
+ })
74
81
  }, {
75
82
  preProcessSnapshot: function preProcessSnapshot(s) {
76
83
  var snap = JSON.parse(JSON.stringify(s));
@@ -11,10 +11,10 @@ exports.default = ServerSideRenderedContent;
11
11
 
12
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
13
 
14
- var _styles = require("@material-ui/core/styles");
15
-
16
14
  var _react = _interopRequireWildcard(require("react"));
17
15
 
16
+ var _styles = require("@mui/material/styles");
17
+
18
18
  var _reactDom = require("react-dom");
19
19
 
20
20
  var _ui = require("../../ui");
@@ -1,4 +1,4 @@
1
- import { ThemeOptions } from '@material-ui/core';
1
+ import { DeprecatedThemeOptions } from '@mui/material';
2
2
  import { SnapshotOrInstance, SnapshotIn } from 'mobx-state-tree';
3
3
  import RendererType, { RenderProps, RenderResults } from './RendererType';
4
4
  import SerializableFilterChain, { SerializedFilterChain } from './util/serializableFilterChain';
@@ -7,7 +7,7 @@ import RpcManager from '../../rpc/RpcManager';
7
7
  interface BaseRenderArgs extends RenderProps {
8
8
  sessionId: string;
9
9
  signal?: AbortSignal;
10
- theme: ThemeOptions;
10
+ theme: DeprecatedThemeOptions;
11
11
  exportSVG: {
12
12
  rasterizeLayers?: boolean;
13
13
  };
@@ -31,7 +31,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
31
31
 
32
32
  var _react = _interopRequireDefault(require("react"));
33
33
 
34
- var _styles = require("@material-ui/core/styles");
34
+ var _styles = require("@mui/material/styles");
35
35
 
36
36
  var _canvasSequencer = require("canvas-sequencer");
37
37
 
@@ -214,7 +214,7 @@ var BaseRpcDriver = /*#__PURE__*/function () {
214
214
  return thing;
215
215
  }
216
216
 
217
- return (0, _util.objectFromEntries)(Object.entries(thing).filter(function (e) {
217
+ return Object.fromEntries(Object.entries(thing).filter(function (e) {
218
218
  return isClonable(e[1]);
219
219
  }).map(function (_ref) {
220
220
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),