@jbrowse/product-core 2.6.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 (92) hide show
  1. package/LICENSE +201 -0
  2. package/dist/RootModel/BaseRootModel.d.ts +607 -0
  3. package/dist/RootModel/BaseRootModel.js +101 -0
  4. package/dist/RootModel/InternetAccounts.d.ts +31 -0
  5. package/dist/RootModel/InternetAccounts.js +99 -0
  6. package/dist/RootModel/index.d.ts +2 -0
  7. package/dist/RootModel/index.js +18 -0
  8. package/dist/Session/BaseSession.d.ts +99 -0
  9. package/dist/Session/BaseSession.js +112 -0
  10. package/dist/Session/Connections.d.ts +174 -0
  11. package/dist/Session/Connections.js +113 -0
  12. package/dist/Session/DialogQueue.d.ts +34 -0
  13. package/dist/Session/DialogQueue.js +55 -0
  14. package/dist/Session/DrawerWidgets.d.ts +88 -0
  15. package/dist/Session/DrawerWidgets.js +167 -0
  16. package/dist/Session/MultipleViews.d.ts +1798 -0
  17. package/dist/Session/MultipleViews.js +105 -0
  18. package/dist/Session/ReferenceManagement.d.ts +34 -0
  19. package/dist/Session/ReferenceManagement.js +91 -0
  20. package/dist/Session/SessionTracks.d.ts +1866 -0
  21. package/dist/Session/SessionTracks.js +75 -0
  22. package/dist/Session/Themes.d.ts +38 -0
  23. package/dist/Session/Themes.js +64 -0
  24. package/dist/Session/Tracks.d.ts +1821 -0
  25. package/dist/Session/Tracks.js +51 -0
  26. package/dist/Session/index.d.ts +10 -0
  27. package/dist/Session/index.js +26 -0
  28. package/dist/index.d.ts +3 -0
  29. package/dist/index.js +19 -0
  30. package/dist/ui/AboutDialog.d.ts +6 -0
  31. package/dist/ui/AboutDialog.js +20 -0
  32. package/dist/ui/AboutDialogContents.d.ts +5 -0
  33. package/dist/ui/AboutDialogContents.js +70 -0
  34. package/dist/ui/FileInfoPanel.d.ts +5 -0
  35. package/dist/ui/FileInfoPanel.js +76 -0
  36. package/dist/ui/index.d.ts +1 -0
  37. package/dist/ui/index.js +17 -0
  38. package/esm/RootModel/BaseRootModel.d.ts +607 -0
  39. package/esm/RootModel/BaseRootModel.js +93 -0
  40. package/esm/RootModel/InternetAccounts.d.ts +31 -0
  41. package/esm/RootModel/InternetAccounts.js +95 -0
  42. package/esm/RootModel/index.d.ts +2 -0
  43. package/esm/RootModel/index.js +2 -0
  44. package/esm/Session/BaseSession.d.ts +99 -0
  45. package/esm/Session/BaseSession.js +103 -0
  46. package/esm/Session/Connections.d.ts +174 -0
  47. package/esm/Session/Connections.js +108 -0
  48. package/esm/Session/DialogQueue.d.ts +34 -0
  49. package/esm/Session/DialogQueue.js +50 -0
  50. package/esm/Session/DrawerWidgets.d.ts +88 -0
  51. package/esm/Session/DrawerWidgets.js +162 -0
  52. package/esm/Session/MultipleViews.d.ts +1798 -0
  53. package/esm/Session/MultipleViews.js +100 -0
  54. package/esm/Session/ReferenceManagement.d.ts +34 -0
  55. package/esm/Session/ReferenceManagement.js +86 -0
  56. package/esm/Session/SessionTracks.d.ts +1866 -0
  57. package/esm/Session/SessionTracks.js +70 -0
  58. package/esm/Session/Themes.d.ts +38 -0
  59. package/esm/Session/Themes.js +59 -0
  60. package/esm/Session/Tracks.d.ts +1821 -0
  61. package/esm/Session/Tracks.js +46 -0
  62. package/esm/Session/index.d.ts +10 -0
  63. package/esm/Session/index.js +10 -0
  64. package/esm/index.d.ts +3 -0
  65. package/esm/index.js +3 -0
  66. package/esm/ui/AboutDialog.d.ts +6 -0
  67. package/esm/ui/AboutDialog.js +13 -0
  68. package/esm/ui/AboutDialogContents.d.ts +5 -0
  69. package/esm/ui/AboutDialogContents.js +41 -0
  70. package/esm/ui/FileInfoPanel.d.ts +5 -0
  71. package/esm/ui/FileInfoPanel.js +47 -0
  72. package/esm/ui/index.d.ts +1 -0
  73. package/esm/ui/index.js +1 -0
  74. package/package.json +66 -0
  75. package/src/RootModel/BaseRootModel.ts +131 -0
  76. package/src/RootModel/InternetAccounts.ts +126 -0
  77. package/src/RootModel/index.ts +2 -0
  78. package/src/Session/BaseSession.ts +129 -0
  79. package/src/Session/Connections.ts +145 -0
  80. package/src/Session/DialogQueue.ts +63 -0
  81. package/src/Session/DrawerWidgets.ts +222 -0
  82. package/src/Session/MultipleViews.ts +151 -0
  83. package/src/Session/ReferenceManagement.ts +134 -0
  84. package/src/Session/SessionTracks.ts +98 -0
  85. package/src/Session/Themes.ts +85 -0
  86. package/src/Session/Tracks.ts +72 -0
  87. package/src/Session/index.ts +10 -0
  88. package/src/index.ts +3 -0
  89. package/src/ui/AboutDialog.tsx +31 -0
  90. package/src/ui/AboutDialogContents.tsx +88 -0
  91. package/src/ui/FileInfoPanel.tsx +75 -0
  92. package/src/ui/index.ts +1 -0
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isSessionWithTracks = exports.TracksManagerSessionMixin = void 0;
4
+ const mobx_state_tree_1 = require("mobx-state-tree");
5
+ const BaseSession_1 = require("./BaseSession");
6
+ const ReferenceManagement_1 = require("./ReferenceManagement");
7
+ /**
8
+ * #stateModel TracksManagerSessionMixin
9
+ * composed of
10
+ * - BaseSessionModel
11
+ * - ReferenceManagementSessionMixin
12
+ */
13
+ function TracksManagerSessionMixin(pluginManager) {
14
+ return mobx_state_tree_1.types
15
+ .compose('TracksManagerSessionMixin', (0, BaseSession_1.BaseSessionModel)(pluginManager), (0, ReferenceManagement_1.ReferenceManagementSessionMixin)(pluginManager))
16
+ .views(self => ({
17
+ /**
18
+ * #getter
19
+ */
20
+ get tracks() {
21
+ return self.jbrowse.tracks;
22
+ },
23
+ }))
24
+ .actions(self => ({
25
+ /**
26
+ * #action
27
+ */
28
+ addTrackConf(trackConf) {
29
+ return self.jbrowse.addTrackConf(trackConf);
30
+ },
31
+ /**
32
+ * #action
33
+ */
34
+ deleteTrackConf(trackConf) {
35
+ const callbacksToDereferenceTrack = [];
36
+ const dereferenceTypeCount = {};
37
+ const referring = self.getReferring(trackConf);
38
+ self.removeReferring(referring, trackConf, callbacksToDereferenceTrack, dereferenceTypeCount);
39
+ callbacksToDereferenceTrack.forEach(cb => cb());
40
+ if (self.adminMode) {
41
+ return self.jbrowse.deleteTrackConf(trackConf);
42
+ }
43
+ },
44
+ }));
45
+ }
46
+ exports.TracksManagerSessionMixin = TracksManagerSessionMixin;
47
+ /** Type guard for SessionWithTracks */
48
+ function isSessionWithTracks(thing) {
49
+ return (0, BaseSession_1.isBaseSession)(thing) && 'tracks' in thing;
50
+ }
51
+ exports.isSessionWithTracks = isSessionWithTracks;
@@ -0,0 +1,10 @@
1
+ export * from './ReferenceManagement';
2
+ export * from './Connections';
3
+ export * from './DrawerWidgets';
4
+ export * from './DialogQueue';
5
+ export * from './Themes';
6
+ export * from './Tracks';
7
+ export * from './MultipleViews';
8
+ export * from './BaseSession';
9
+ export * from './SessionTracks';
10
+ export * from './BaseSession';
@@ -0,0 +1,26 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ReferenceManagement"), exports);
18
+ __exportStar(require("./Connections"), exports);
19
+ __exportStar(require("./DrawerWidgets"), exports);
20
+ __exportStar(require("./DialogQueue"), exports);
21
+ __exportStar(require("./Themes"), exports);
22
+ __exportStar(require("./Tracks"), exports);
23
+ __exportStar(require("./MultipleViews"), exports);
24
+ __exportStar(require("./BaseSession"), exports);
25
+ __exportStar(require("./SessionTracks"), exports);
26
+ __exportStar(require("./BaseSession"), exports);
@@ -0,0 +1,3 @@
1
+ export * from './RootModel';
2
+ export * from './Session';
3
+ export * from './ui';
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./RootModel"), exports);
18
+ __exportStar(require("./Session"), exports);
19
+ __exportStar(require("./ui"), exports);
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
+ export declare function AboutDialog({ config, handleClose, }: {
4
+ config: AnyConfigurationModel;
5
+ handleClose: () => void;
6
+ }): React.JSX.Element;
@@ -0,0 +1,20 @@
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
+ exports.AboutDialog = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const Dialog_1 = __importDefault(require("@jbrowse/core/ui/Dialog"));
9
+ const util_1 = require("@jbrowse/core/util");
10
+ const tracks_1 = require("@jbrowse/core/util/tracks");
11
+ const AboutDialogContents_1 = __importDefault(require("./AboutDialogContents"));
12
+ function AboutDialog({ config, handleClose, }) {
13
+ const session = (0, util_1.getSession)(config);
14
+ const trackName = (0, tracks_1.getTrackName)(config, session);
15
+ const { pluginManager } = (0, util_1.getEnv)(session);
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 })));
19
+ }
20
+ exports.AboutDialog = AboutDialog;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
+ export default function AboutContents({ config, }: {
4
+ config: AnyConfigurationModel;
5
+ }): React.JSX.Element;
@@ -0,0 +1,70 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const react_1 = __importStar(require("react"));
30
+ const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
31
+ const material_1 = require("@mui/material");
32
+ const mui_1 = require("tss-react/mui");
33
+ const configuration_1 = require("@jbrowse/core/configuration");
34
+ const util_1 = require("@jbrowse/core/util");
35
+ const BaseFeatureDetail_1 = require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail");
36
+ const FileInfoPanel_1 = __importDefault(require("./FileInfoPanel"));
37
+ const useStyles = (0, mui_1.makeStyles)()({
38
+ content: {
39
+ minWidth: 800,
40
+ },
41
+ });
42
+ function AboutContents({ config, }) {
43
+ const [copied, setCopied] = (0, react_1.useState)(false);
44
+ const conf = (0, configuration_1.readConfObject)(config);
45
+ const session = (0, util_1.getSession)(config);
46
+ const { classes } = useStyles();
47
+ const hideUris = (0, configuration_1.getConf)(session, ['formatAbout', 'hideUris']) ||
48
+ (0, configuration_1.readConfObject)(config, ['formatAbout', 'hideUris']);
49
+ const { pluginManager } = (0, util_1.getEnv)(session);
50
+ const confPostExt = pluginManager.evaluateExtensionPoint('Core-customizeAbout', {
51
+ config: {
52
+ ...conf,
53
+ ...(0, configuration_1.getConf)(session, ['formatAbout', 'config'], { config: conf }),
54
+ ...(0, configuration_1.readConfObject)(config, ['formatAbout', 'config'], { config: conf }),
55
+ },
56
+ }, { session, config });
57
+ const ExtraPanel = pluginManager.evaluateExtensionPoint('Core-extraAboutPanel', null, { session, config });
58
+ return (react_1.default.createElement("div", { className: classes.content },
59
+ react_1.default.createElement(BaseFeatureDetail_1.BaseCard, { title: "Configuration" },
60
+ !hideUris ? (react_1.default.createElement(material_1.Button, { variant: "contained", style: { float: 'right' }, onClick: () => {
61
+ (0, copy_to_clipboard_1.default)(JSON.stringify(conf, null, 2));
62
+ setCopied(true);
63
+ setTimeout(() => setCopied(false), 1000);
64
+ } }, copied ? 'Copied to clipboard!' : 'Copy config')) : null,
65
+ react_1.default.createElement(BaseFeatureDetail_1.Attributes, { attributes: confPostExt, omit: ['displays', 'baseUri', 'refNames', 'formatAbout'], hideUris: hideUris })),
66
+ ExtraPanel ? (react_1.default.createElement(BaseFeatureDetail_1.BaseCard, { title: ExtraPanel.name },
67
+ react_1.default.createElement(ExtraPanel.Component, { config: config }))) : null,
68
+ react_1.default.createElement(FileInfoPanel_1.default, { config: config })));
69
+ }
70
+ exports.default = AboutContents;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
+ export default function FileInfoPanel({ config, }: {
4
+ config: AnyConfigurationModel;
5
+ }): React.JSX.Element | null;
@@ -0,0 +1,76 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const react_1 = __importStar(require("react"));
30
+ const material_1 = require("@mui/material");
31
+ const configuration_1 = require("@jbrowse/core/configuration");
32
+ const LoadingEllipses_1 = __importDefault(require("@jbrowse/core/ui/LoadingEllipses"));
33
+ const util_1 = require("@jbrowse/core/util");
34
+ const BaseFeatureDetail_1 = require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail");
35
+ function FileInfoPanel({ config, }) {
36
+ const [error, setError] = (0, react_1.useState)();
37
+ const [info, setInfo] = (0, react_1.useState)();
38
+ const session = (0, util_1.getSession)(config);
39
+ const { rpcManager } = session;
40
+ (0, react_1.useEffect)(() => {
41
+ const aborter = new AbortController();
42
+ const { signal } = aborter;
43
+ let cancelled = false;
44
+ (async () => {
45
+ try {
46
+ const adapterConfig = (0, configuration_1.readConfObject)(config, 'adapter');
47
+ const result = await rpcManager.call(config.trackId, 'CoreGetInfo', {
48
+ adapterConfig,
49
+ signal,
50
+ });
51
+ if (!cancelled) {
52
+ setInfo(result);
53
+ }
54
+ }
55
+ catch (e) {
56
+ if (!cancelled) {
57
+ console.error(e);
58
+ setError(e);
59
+ }
60
+ }
61
+ })();
62
+ return () => {
63
+ aborter.abort();
64
+ cancelled = true;
65
+ };
66
+ }, [config, rpcManager]);
67
+ const details = typeof info === 'string'
68
+ ? {
69
+ header: `<pre>${info
70
+ .replaceAll('<', '&lt;')
71
+ .replaceAll('>', '&gt;')}</pre>`,
72
+ }
73
+ : info || {};
74
+ return info !== null ? (react_1.default.createElement(BaseFeatureDetail_1.BaseCard, { title: "File info" }, error ? (react_1.default.createElement(material_1.Typography, { color: "error" }, `${error}`)) : info === undefined ? (react_1.default.createElement(LoadingEllipses_1.default, { message: "Loading file data" })) : (react_1.default.createElement(BaseFeatureDetail_1.Attributes, { attributes: details })))) : null;
75
+ }
76
+ exports.default = FileInfoPanel;
@@ -0,0 +1 @@
1
+ export * from './AboutDialog';
@@ -0,0 +1,17 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./AboutDialog"), exports);