@jbrowse/product-core 2.17.0 → 3.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 (77) hide show
  1. package/dist/RootModel/BaseRootModel.d.ts +6 -43
  2. package/dist/RootModel/BaseRootModel.js +5 -41
  3. package/dist/RootModel/FormatAbout.d.ts +0 -10
  4. package/dist/RootModel/FormatAbout.js +0 -10
  5. package/dist/RootModel/FormatDetails.d.ts +0 -17
  6. package/dist/RootModel/FormatDetails.js +0 -17
  7. package/dist/RootModel/HierarchicalConfig.d.ts +0 -19
  8. package/dist/RootModel/HierarchicalConfig.js +0 -19
  9. package/dist/RootModel/InternetAccounts.d.ts +4 -20
  10. package/dist/RootModel/InternetAccounts.js +0 -20
  11. package/dist/Session/BaseSession.d.ts +5 -96
  12. package/dist/Session/BaseSession.js +1 -63
  13. package/dist/Session/Connections.d.ts +5 -56
  14. package/dist/Session/Connections.js +0 -30
  15. package/dist/Session/DialogQueue.d.ts +3 -22
  16. package/dist/Session/DialogQueue.js +0 -17
  17. package/dist/Session/DrawerWidgets.d.ts +3 -63
  18. package/dist/Session/DrawerWidgets.js +2 -61
  19. package/dist/Session/MultipleViews.d.ts +8 -1760
  20. package/dist/Session/MultipleViews.js +2 -40
  21. package/dist/Session/ReferenceManagement.d.ts +2 -21
  22. package/dist/Session/ReferenceManagement.js +0 -23
  23. package/dist/Session/SessionTracks.d.ts +7 -1748
  24. package/dist/Session/SessionTracks.js +1 -21
  25. package/dist/Session/Themes.d.ts +3 -21
  26. package/dist/Session/Themes.js +1 -17
  27. package/dist/Session/Tracks.d.ts +6 -1737
  28. package/dist/Session/Tracks.js +0 -16
  29. package/dist/rpcWorker.d.ts +2 -2
  30. package/dist/rpcWorker.js +3 -17
  31. package/dist/ui/AboutDialog.d.ts +2 -3
  32. package/dist/ui/AboutDialog.js +2 -3
  33. package/dist/ui/AboutDialogContents.d.ts +2 -3
  34. package/dist/ui/AboutDialogContents.js +20 -53
  35. package/dist/ui/FileInfoPanel.d.ts +2 -3
  36. package/dist/ui/FileInfoPanel.js +5 -28
  37. package/dist/ui/RefNameInfoDialog.d.ts +2 -3
  38. package/dist/ui/RefNameInfoDialog.js +17 -44
  39. package/esm/RootModel/BaseRootModel.d.ts +6 -43
  40. package/esm/RootModel/BaseRootModel.js +6 -42
  41. package/esm/RootModel/FormatAbout.d.ts +0 -10
  42. package/esm/RootModel/FormatAbout.js +0 -10
  43. package/esm/RootModel/FormatDetails.d.ts +0 -17
  44. package/esm/RootModel/FormatDetails.js +0 -17
  45. package/esm/RootModel/HierarchicalConfig.d.ts +0 -19
  46. package/esm/RootModel/HierarchicalConfig.js +0 -19
  47. package/esm/RootModel/InternetAccounts.d.ts +4 -20
  48. package/esm/RootModel/InternetAccounts.js +0 -20
  49. package/esm/Session/BaseSession.d.ts +5 -96
  50. package/esm/Session/BaseSession.js +1 -63
  51. package/esm/Session/Connections.d.ts +5 -56
  52. package/esm/Session/Connections.js +1 -31
  53. package/esm/Session/DialogQueue.d.ts +3 -22
  54. package/esm/Session/DialogQueue.js +0 -17
  55. package/esm/Session/DrawerWidgets.d.ts +3 -63
  56. package/esm/Session/DrawerWidgets.js +2 -61
  57. package/esm/Session/MultipleViews.d.ts +8 -1760
  58. package/esm/Session/MultipleViews.js +2 -40
  59. package/esm/Session/ReferenceManagement.d.ts +2 -21
  60. package/esm/Session/ReferenceManagement.js +0 -23
  61. package/esm/Session/SessionTracks.d.ts +7 -1748
  62. package/esm/Session/SessionTracks.js +1 -21
  63. package/esm/Session/Themes.d.ts +3 -21
  64. package/esm/Session/Themes.js +1 -17
  65. package/esm/Session/Tracks.d.ts +6 -1737
  66. package/esm/Session/Tracks.js +0 -16
  67. package/esm/rpcWorker.d.ts +2 -2
  68. package/esm/rpcWorker.js +3 -17
  69. package/esm/ui/AboutDialog.d.ts +2 -3
  70. package/esm/ui/AboutDialog.js +3 -4
  71. package/esm/ui/AboutDialogContents.d.ts +2 -3
  72. package/esm/ui/AboutDialogContents.js +20 -30
  73. package/esm/ui/FileInfoPanel.d.ts +2 -3
  74. package/esm/ui/FileInfoPanel.js +5 -5
  75. package/esm/ui/RefNameInfoDialog.d.ts +2 -3
  76. package/esm/ui/RefNameInfoDialog.js +18 -22
  77. package/package.json +3 -3
@@ -5,33 +5,18 @@ exports.isSessionWithTracks = isSessionWithTracks;
5
5
  const mobx_state_tree_1 = require("mobx-state-tree");
6
6
  const BaseSession_1 = require("./BaseSession");
7
7
  const ReferenceManagement_1 = require("./ReferenceManagement");
8
- /**
9
- * #stateModel TracksManagerSessionMixin
10
- * composed of
11
- * - BaseSessionModel
12
- * - ReferenceManagementSessionMixin
13
- */
14
8
  function TracksManagerSessionMixin(pluginManager) {
15
9
  return mobx_state_tree_1.types
16
10
  .compose('TracksManagerSessionMixin', (0, BaseSession_1.BaseSessionModel)(pluginManager), (0, ReferenceManagement_1.ReferenceManagementSessionMixin)(pluginManager))
17
11
  .views(self => ({
18
- /**
19
- * #getter
20
- */
21
12
  get tracks() {
22
13
  return self.jbrowse.tracks;
23
14
  },
24
15
  }))
25
16
  .actions(self => ({
26
- /**
27
- * #action
28
- */
29
17
  addTrackConf(trackConf) {
30
18
  return self.jbrowse.addTrackConf(trackConf);
31
19
  },
32
- /**
33
- * #action
34
- */
35
20
  deleteTrackConf(trackConf) {
36
21
  const callbacksToDereferenceTrack = [];
37
22
  const dereferenceTypeCount = {};
@@ -46,7 +31,6 @@ function TracksManagerSessionMixin(pluginManager) {
46
31
  },
47
32
  }));
48
33
  }
49
- /** Type guard for SessionWithTracks */
50
34
  function isSessionWithTracks(thing) {
51
35
  return (0, BaseSession_1.isBaseSession)(thing) && 'tracks' in thing;
52
36
  }
@@ -1,5 +1,5 @@
1
- import { LoadedPlugin } from '@jbrowse/core/PluginLoader';
2
- import { PluginConstructor } from '@jbrowse/core/Plugin';
1
+ import type { PluginConstructor } from '@jbrowse/core/Plugin';
2
+ import type { LoadedPlugin } from '@jbrowse/core/PluginLoader';
3
3
  export declare function initializeWorker(corePlugins: PluginConstructor[], opts: {
4
4
  fetchESM?: (url: string) => Promise<LoadedPlugin>;
5
5
  fetchCJS?: (url: string) => Promise<LoadedPlugin>;
package/dist/rpcWorker.js CHANGED
@@ -4,13 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.initializeWorker = initializeWorker;
7
- const librpc_web_mod_1 = __importDefault(require("librpc-web-mod"));
8
- const PluginManager_1 = __importDefault(require("@jbrowse/core/PluginManager"));
9
- const remoteAbortSignals_1 = require("@jbrowse/core/rpc/remoteAbortSignals");
10
7
  const PluginLoader_1 = __importDefault(require("@jbrowse/core/PluginLoader"));
8
+ const PluginManager_1 = __importDefault(require("@jbrowse/core/PluginManager"));
9
+ const librpc_web_mod_1 = __importDefault(require("librpc-web-mod"));
11
10
  const serialize_error_1 = require("serialize-error");
12
- // waits for a message from the main thread containing our configuration, which
13
- // must be sent on boot
14
11
  function receiveConfiguration() {
15
12
  const configurationP = new Promise(resolve => {
16
13
  function listener(e) {
@@ -25,7 +22,6 @@ function receiveConfiguration() {
25
22
  return configurationP;
26
23
  }
27
24
  async function getPluginManager(corePlugins, opts) {
28
- // Load runtime plugins
29
25
  const config = await receiveConfiguration();
30
26
  const pluginLoader = new PluginLoader_1.default(config.plugins, opts).installGlobalReExports(self);
31
27
  return new PluginManager_1.default([
@@ -41,7 +37,6 @@ function wrapForRpc(func) {
41
37
  return func({
42
38
  ...args,
43
39
  statusCallback: (message) => {
44
- // @ts-expect-error
45
40
  self.rpcServer.emit(channel, message);
46
41
  },
47
42
  }, rpcDriverClassName);
@@ -53,19 +48,10 @@ async function initializeWorker(corePlugins, opts) {
53
48
  const rpcConfig = Object.fromEntries(pluginManager
54
49
  .getRpcElements()
55
50
  .map(e => [e.name, wrapForRpc(e.execute.bind(e))]));
56
- // @ts-expect-error
57
- self.rpcServer = new librpc_web_mod_1.default.Server({
58
- ...rpcConfig,
59
- ...(0, remoteAbortSignals_1.remoteAbortRpcHandler)(),
60
- ping: async () => {
61
- // the ping method is required by the worker driver for checking the
62
- // health of the worker
63
- },
64
- });
51
+ self.rpcServer = new librpc_web_mod_1.default.Server(rpcConfig);
65
52
  postMessage({ message: 'ready' });
66
53
  }
67
54
  catch (e) {
68
55
  postMessage({ message: 'error', error: (0, serialize_error_1.serializeError)(e) });
69
56
  }
70
- /* do nothing */
71
57
  }
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
1
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
2
  export declare function AboutDialog({ config, handleClose, }: {
4
3
  config: AnyConfigurationModel;
5
4
  handleClose: () => void;
6
- }): React.JSX.Element;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AboutDialog = AboutDialog;
7
- const react_1 = __importDefault(require("react"));
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const Dialog_1 = __importDefault(require("@jbrowse/core/ui/Dialog"));
9
9
  const util_1 = require("@jbrowse/core/util");
10
10
  const tracks_1 = require("@jbrowse/core/util/tracks");
@@ -14,6 +14,5 @@ function AboutDialog({ config, handleClose, }) {
14
14
  const trackName = (0, tracks_1.getTrackName)(config, session);
15
15
  const { pluginManager } = (0, util_1.getEnv)(session);
16
16
  const AboutComponent = pluginManager.evaluateExtensionPoint('Core-replaceAbout', AboutDialogContents_1.default, { session, config });
17
- return (react_1.default.createElement(Dialog_1.default, { open: true, onClose: handleClose, title: trackName, maxWidth: "xl" },
18
- react_1.default.createElement(AboutComponent, { config: config })));
17
+ return ((0, jsx_runtime_1.jsx)(Dialog_1.default, { open: true, onClose: handleClose, title: trackName, maxWidth: "xl", children: (0, jsx_runtime_1.jsx)(AboutComponent, { config: config }) }));
19
18
  }
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
1
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
2
  declare const AboutDialogContents: ({ config, }: {
4
3
  config: AnyConfigurationModel;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default AboutDialogContents;
@@ -1,42 +1,18 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
- const react_1 = __importStar(require("react"));
30
- const mobx_react_1 = require("mobx-react");
31
- const clone_1 = __importDefault(require("clone"));
32
- const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
33
- const material_1 = require("@mui/material");
34
- const mui_1 = require("tss-react/mui");
35
- const configuration_1 = require("@jbrowse/core/configuration");
36
- const util_1 = require("@jbrowse/core/util");
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
37
8
  const Attributes_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attributes"));
38
9
  const BaseCard_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard"));
39
- // locals
10
+ const configuration_1 = require("@jbrowse/core/configuration");
11
+ const util_1 = require("@jbrowse/core/util");
12
+ const material_1 = require("@mui/material");
13
+ const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
14
+ const mobx_react_1 = require("mobx-react");
15
+ const mui_1 = require("tss-react/mui");
40
16
  const FileInfoPanel_1 = __importDefault(require("./FileInfoPanel"));
41
17
  const RefNameInfoDialog_1 = __importDefault(require("./RefNameInfoDialog"));
42
18
  const useStyles = (0, mui_1.makeStyles)()({
@@ -75,26 +51,17 @@ const AboutDialogContents = (0, mobx_react_1.observer)(function ({ config, }) {
75
51
  },
76
52
  }, { session, config });
77
53
  const ExtraPanel = pluginManager.evaluateExtensionPoint('Core-extraAboutPanel', null, { session, config });
78
- return (react_1.default.createElement("div", { className: classes.content },
79
- react_1.default.createElement(BaseCard_1.default, { title: "Configuration" },
80
- !hideUris ? (react_1.default.createElement("span", { className: classes.button },
81
- react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
82
- setShowRefNames(true);
83
- } }, "Show ref names"),
84
- react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => {
85
- const snap = removeAttr((0, clone_1.default)(conf), 'baseUri');
86
- (0, copy_to_clipboard_1.default)(JSON.stringify(snap, null, 2));
87
- setCopied(true);
88
- setTimeout(() => {
89
- setCopied(false);
90
- }, 1000);
91
- } }, copied ? 'Copied to clipboard!' : 'Copy config'))) : null,
92
- react_1.default.createElement(Attributes_1.default, { attributes: confPostExt, omit: ['displays', 'baseUri', 'refNames', 'formatAbout'], hideUris: hideUris })),
93
- ExtraPanel ? (react_1.default.createElement(BaseCard_1.default, { title: ExtraPanel.name },
94
- react_1.default.createElement(ExtraPanel.Component, { config: config }))) : null,
95
- react_1.default.createElement(FileInfoPanel_1.default, { config: config }),
96
- showRefNames ? (react_1.default.createElement(RefNameInfoDialog_1.default, { config: config, onClose: () => {
97
- setShowRefNames(false);
98
- } })) : null));
54
+ return ((0, jsx_runtime_1.jsxs)("div", { className: classes.content, children: [(0, jsx_runtime_1.jsxs)(BaseCard_1.default, { title: "Configuration", children: [!hideUris ? ((0, jsx_runtime_1.jsxs)("span", { className: classes.button, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
55
+ setShowRefNames(true);
56
+ }, children: "Show ref names" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
57
+ const snap = removeAttr(structuredClone(conf), 'baseUri');
58
+ (0, copy_to_clipboard_1.default)(JSON.stringify(snap, null, 2));
59
+ setCopied(true);
60
+ setTimeout(() => {
61
+ setCopied(false);
62
+ }, 1000);
63
+ }, children: copied ? 'Copied to clipboard!' : 'Copy config' })] })) : null, (0, jsx_runtime_1.jsx)(Attributes_1.default, { attributes: confPostExt.config, omit: ['displays', 'baseUri', 'refNames', 'formatAbout', 'metadata'], hideUris: hideUris })] }), confPostExt.config.metadata ? ((0, jsx_runtime_1.jsx)(BaseCard_1.default, { title: "Metadata", children: (0, jsx_runtime_1.jsx)(Attributes_1.default, { attributes: confPostExt.config.metadata, omit: ['displays', 'baseUri', 'refNames', 'formatAbout'], hideUris: hideUris }) })) : null, ExtraPanel ? ((0, jsx_runtime_1.jsx)(BaseCard_1.default, { title: ExtraPanel.name, children: (0, jsx_runtime_1.jsx)(ExtraPanel.Component, { config: config }) })) : null, (0, jsx_runtime_1.jsx)(FileInfoPanel_1.default, { config: config }), showRefNames ? ((0, jsx_runtime_1.jsx)(RefNameInfoDialog_1.default, { config: config, onClose: () => {
64
+ setShowRefNames(false);
65
+ } })) : null] }));
99
66
  });
100
67
  exports.default = AboutDialogContents;
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
1
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
2
  export default function FileInfoPanel({ config, }: {
4
3
  config: AnyConfigurationModel;
5
- }): React.JSX.Element;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,45 +1,22 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
6
  exports.default = FileInfoPanel;
30
- const react_1 = __importStar(require("react"));
31
- const configuration_1 = require("@jbrowse/core/configuration");
32
- const util_1 = require("@jbrowse/core/util");
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
33
9
  const Attributes_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attributes"));
34
10
  const BaseCard_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard"));
11
+ const configuration_1 = require("@jbrowse/core/configuration");
35
12
  const ui_1 = require("@jbrowse/core/ui");
13
+ const util_1 = require("@jbrowse/core/util");
36
14
  function FileInfoPanel({ config, }) {
37
15
  const [error, setError] = (0, react_1.useState)();
38
16
  const [info, setInfo] = (0, react_1.useState)();
39
17
  const session = (0, util_1.getSession)(config);
40
18
  const { rpcManager } = session;
41
19
  (0, react_1.useEffect)(() => {
42
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
43
20
  ;
44
21
  (async () => {
45
22
  try {
@@ -62,5 +39,5 @@ function FileInfoPanel({ config, }) {
62
39
  .replaceAll('>', '&gt;')}</pre>`,
63
40
  }
64
41
  : info || {};
65
- return (react_1.default.createElement(BaseCard_1.default, { title: "File info" }, error ? (react_1.default.createElement(ui_1.ErrorMessage, { error: error })) : info === undefined ? (react_1.default.createElement(ui_1.LoadingEllipses, { message: "Loading file data" })) : (react_1.default.createElement(Attributes_1.default, { attributes: details }))));
42
+ return ((0, jsx_runtime_1.jsx)(BaseCard_1.default, { title: "File info", children: error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : info === undefined ? ((0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { message: "Loading file data" })) : ((0, jsx_runtime_1.jsx)(Attributes_1.default, { attributes: details })) }));
66
43
  }
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
1
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
2
  declare const RefNameInfoDialog: ({ config, onClose, }: {
4
3
  config: AnyConfigurationModel;
5
4
  onClose: () => void;
6
- }) => React.JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
7
6
  export default RefNameInfoDialog;
@@ -1,40 +1,18 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
- const react_1 = __importStar(require("react"));
30
- const material_1 = require("@mui/material");
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
31
8
  const configuration_1 = require("@jbrowse/core/configuration");
32
9
  const ui_1 = require("@jbrowse/core/ui");
33
10
  const util_1 = require("@jbrowse/core/util");
34
11
  const tracks_1 = require("@jbrowse/core/util/tracks");
12
+ const material_1 = require("@mui/material");
13
+ const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
35
14
  const mobx_react_1 = require("mobx-react");
36
15
  const mui_1 = require("tss-react/mui");
37
- const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
38
16
  const MAX_REF_NAMES = 10000;
39
17
  const useStyles = (0, mui_1.makeStyles)()(theme => ({
40
18
  container: {
@@ -54,7 +32,6 @@ const RefNameInfoDialog = (0, mobx_react_1.observer)(function ({ config, onClose
54
32
  const [copied, setCopied] = (0, react_1.useState)(false);
55
33
  const { rpcManager } = (0, util_1.getSession)(config);
56
34
  (0, react_1.useEffect)(() => {
57
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
58
35
  ;
59
36
  (async () => {
60
37
  try {
@@ -64,7 +41,6 @@ const RefNameInfoDialog = (0, mobx_react_1.observer)(function ({ config, onClose
64
41
  assemblyName,
65
42
  (await rpcManager.call(config.trackId, 'CoreGetRefNames', {
66
43
  adapterConfig,
67
- // hack for synteny adapters
68
44
  regions: [
69
45
  {
70
46
  assemblyName,
@@ -94,21 +70,18 @@ const RefNameInfoDialog = (0, mobx_react_1.observer)(function ({ config, onClose
94
70
  })
95
71
  .filter(f => !!f)
96
72
  .join('\n');
97
- return (react_1.default.createElement(ui_1.Dialog, { open: true, title: "Reference sequence names used in track", onClose: onClose, maxWidth: "xl" },
98
- react_1.default.createElement(material_1.DialogContent, { className: classes.container }, error ? (react_1.default.createElement(ui_1.ErrorMessage, { error: error })) : refNames === undefined ? (react_1.default.createElement(ui_1.LoadingEllipses, { message: "Loading refNames" })) : (react_1.default.createElement(react_1.default.Fragment, null,
99
- react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => {
100
- (0, copy_to_clipboard_1.default)(names
101
- .flatMap(([assemblyName, refNames]) => [
102
- `--- ${assemblyName} ---`,
103
- ...refNames,
104
- ])
105
- .filter(f => !!f)
106
- .join('\n'));
107
- setCopied(true);
108
- setTimeout(() => {
109
- setCopied(false);
110
- }, 1000);
111
- } }, copied ? 'Copied to clipboard!' : 'Copy ref names'),
112
- react_1.default.createElement("pre", { className: classes.refNames }, result))))));
73
+ return ((0, jsx_runtime_1.jsx)(ui_1.Dialog, { open: true, title: "Reference sequence names used in track", onClose: onClose, maxWidth: "xl", children: (0, jsx_runtime_1.jsx)(material_1.DialogContent, { className: classes.container, children: error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : refNames === undefined ? ((0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { message: "Loading refNames" })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
74
+ (0, copy_to_clipboard_1.default)(names
75
+ .flatMap(([assemblyName, refNames]) => [
76
+ `--- ${assemblyName} ---`,
77
+ ...refNames,
78
+ ])
79
+ .filter(f => !!f)
80
+ .join('\n'));
81
+ setCopied(true);
82
+ setTimeout(() => {
83
+ setCopied(false);
84
+ }, 1000);
85
+ }, children: copied ? 'Copied to clipboard!' : 'Copy ref names' }), (0, jsx_runtime_1.jsx)("pre", { className: classes.refNames, children: result })] })) }) }));
113
86
  });
114
87
  exports.default = RefNameInfoDialog;
@@ -1,38 +1,17 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
2
- import { BaseAssemblyConfigSchema } from '@jbrowse/core/assemblyManager';
3
- import RpcManager from '@jbrowse/core/rpc/RpcManager';
4
- import { IAnyType, Instance, SnapshotIn } from 'mobx-state-tree';
5
1
  import TextSearchManager from '@jbrowse/core/TextSearch/TextSearchManager';
6
- /**
7
- * #stateModel BaseRootModel
8
- * #category root
9
- * factory function for the Base-level root model shared by all products
10
- */
2
+ import RpcManager from '@jbrowse/core/rpc/RpcManager';
3
+ import type PluginManager from '@jbrowse/core/PluginManager';
4
+ import type { BaseAssemblyConfigSchema } from '@jbrowse/core/assemblyManager';
5
+ import type { IAnyType, Instance, SnapshotIn } from 'mobx-state-tree';
11
6
  export declare function BaseRootModelFactory({ pluginManager, jbrowseModelType, sessionModelType, assemblyConfigSchema, }: {
12
7
  pluginManager: PluginManager;
13
8
  jbrowseModelType: IAnyType;
14
9
  sessionModelType: IAnyType;
15
10
  assemblyConfigSchema: BaseAssemblyConfigSchema;
16
11
  }): import("mobx-state-tree").IModelType<{
17
- /**
18
- * #property
19
- * `jbrowse` is a mapping of the config.json into the in-memory state
20
- * tree
21
- */
22
12
  jbrowse: IAnyType;
23
- /**
24
- * #property
25
- * `session` encompasses the currently active state of the app, including
26
- * views open, tracks open in those views, etc.
27
- */
28
13
  session: import("mobx-state-tree").IMaybe<IAnyType>;
29
- /**
30
- * #property
31
- */
32
14
  sessionPath: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
33
- /**
34
- * #property
35
- */
36
15
  assemblyManager: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{
37
16
  assemblies: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
38
17
  configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<IAnyType>>;
@@ -537,7 +516,7 @@ export declare function BaseRootModelFactory({ pluginManager, jbrowseModelType,
537
516
  getRefNameMapForAdapter(adapterConf: {
538
517
  [x: string]: unknown;
539
518
  }, assemblyName: string | undefined, opts: {
540
- signal?: AbortSignal;
519
+ stopToken?: string;
541
520
  sessionId: string;
542
521
  }): Promise<{
543
522
  [x: string]: string;
@@ -545,7 +524,7 @@ export declare function BaseRootModelFactory({ pluginManager, jbrowseModelType,
545
524
  getReverseRefNameMapForAdapter(adapterConf: {
546
525
  [x: string]: unknown;
547
526
  }, assemblyName: string | undefined, opts: {
548
- signal?: AbortSignal;
527
+ stopToken?: string;
549
528
  sessionId: string;
550
529
  }): Promise<{
551
530
  [x: string]: string;
@@ -563,28 +542,12 @@ export declare function BaseRootModelFactory({ pluginManager, jbrowseModelType,
563
542
  textSearchManager: TextSearchManager;
564
543
  pluginManager: PluginManager;
565
544
  } & {
566
- /**
567
- * #action
568
- */
569
545
  setError(error: unknown): void;
570
- /**
571
- * #action
572
- */
573
546
  setSession(sessionSnapshot?: SnapshotIn<IAnyType>): void;
574
- /**
575
- * #action
576
- */
577
547
  setDefaultSession(): void;
578
- /**
579
- * #action
580
- */
581
548
  setSessionPath(path: string): void;
582
- /**
583
- * #action
584
- */
585
549
  renameCurrentSession(newName: string): void;
586
550
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
587
551
  export type BaseRootModelType = ReturnType<typeof BaseRootModelFactory>;
588
552
  export type BaseRootModel = Instance<BaseRootModelType>;
589
- /** Type guard for checking if something is a JB root model */
590
553
  export declare function isRootModel(thing: unknown): thing is BaseRootModelType;
@@ -1,34 +1,13 @@
1
+ import TextSearchManager from '@jbrowse/core/TextSearch/TextSearchManager';
1
2
  import assemblyManagerFactory from '@jbrowse/core/assemblyManager';
2
3
  import RpcManager from '@jbrowse/core/rpc/RpcManager';
3
- import { cast, getSnapshot, isStateTreeNode, types, } from 'mobx-state-tree';
4
- import TextSearchManager from '@jbrowse/core/TextSearch/TextSearchManager';
5
- /**
6
- * #stateModel BaseRootModel
7
- * #category root
8
- * factory function for the Base-level root model shared by all products
9
- */
4
+ import { cast, getSnapshot, isStateTreeNode, types } from 'mobx-state-tree';
10
5
  export function BaseRootModelFactory({ pluginManager, jbrowseModelType, sessionModelType, assemblyConfigSchema, }) {
11
6
  return types
12
7
  .model('BaseRootModel', {
13
- /**
14
- * #property
15
- * `jbrowse` is a mapping of the config.json into the in-memory state
16
- * tree
17
- */
18
8
  jbrowse: jbrowseModelType,
19
- /**
20
- * #property
21
- * `session` encompasses the currently active state of the app, including
22
- * views open, tracks open in those views, etc.
23
- */
24
9
  session: types.maybe(sessionModelType),
25
- /**
26
- * #property
27
- */
28
10
  sessionPath: types.optional(types.string, ''),
29
- /**
30
- * #property
31
- */
32
11
  assemblyManager: types.optional(assemblyManagerFactory(assemblyConfigSchema, pluginManager), {}),
33
12
  })
34
13
  .volatile(self => ({
@@ -41,43 +20,28 @@ export function BaseRootModelFactory({ pluginManager, jbrowseModelType, sessionM
41
20
  pluginManager,
42
21
  }))
43
22
  .actions(self => ({
44
- /**
45
- * #action
46
- */
47
23
  setError(error) {
48
24
  self.error = error;
49
25
  },
50
- /**
51
- * #action
52
- */
53
26
  setSession(sessionSnapshot) {
54
27
  self.session = cast(sessionSnapshot);
55
28
  },
56
- /**
57
- * #action
58
- */
59
29
  setDefaultSession() {
60
30
  this.setSession(self.jbrowse.defaultSession);
61
31
  },
62
- /**
63
- * #action
64
- */
65
32
  setSessionPath(path) {
66
33
  self.sessionPath = path;
67
34
  },
68
- /**
69
- * #action
70
- */
71
35
  renameCurrentSession(newName) {
72
36
  if (self.session) {
73
- const snapshot = JSON.parse(JSON.stringify(getSnapshot(self.session)));
74
- snapshot.name = newName;
75
- this.setSession(snapshot);
37
+ this.setSession({
38
+ ...getSnapshot(self.session),
39
+ name: newName,
40
+ });
76
41
  }
77
42
  },
78
43
  }));
79
44
  }
80
- /** Type guard for checking if something is a JB root model */
81
45
  export function isRootModel(thing) {
82
46
  return (isStateTreeNode(thing) &&
83
47
  'session' in thing &&
@@ -1,20 +1,10 @@
1
- /**
2
- * #config FormatAbout
3
- * generally exists on the config.json or root config as configuration.formatAbout
4
- */
5
1
  export declare function FormatAboutConfigSchemaFactory(): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
6
- /**
7
- * #slot configuration.formatAbout.config
8
- */
9
2
  config: {
10
3
  type: string;
11
4
  description: string;
12
5
  defaultValue: {};
13
6
  contextVariable: string[];
14
7
  };
15
- /**
16
- * #slot configuration.formatAbout.hideUris
17
- */
18
8
  hideUris: {
19
9
  type: string;
20
10
  defaultValue: boolean;
@@ -1,22 +1,12 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
- /**
3
- * #config FormatAbout
4
- * generally exists on the config.json or root config as configuration.formatAbout
5
- */
6
2
  export function FormatAboutConfigSchemaFactory() {
7
3
  return ConfigurationSchema('FormatAbout', {
8
- /**
9
- * #slot configuration.formatAbout.config
10
- */
11
4
  config: {
12
5
  type: 'frozen',
13
6
  description: 'formats configuration object in about dialog',
14
7
  defaultValue: {},
15
8
  contextVariable: ['config'],
16
9
  },
17
- /**
18
- * #slot configuration.formatAbout.hideUris
19
- */
20
10
  hideUris: {
21
11
  type: 'boolean',
22
12
  defaultValue: false,