@jbrowse/app-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.
- package/LICENSE +201 -0
- package/dist/Assemblies/SessionAssembliesMixin.d.ts +72 -0
- package/dist/Assemblies/SessionAssembliesMixin.js +44 -0
- package/dist/Assemblies/TemporaryAssembliesMixin.d.ts +22 -0
- package/dist/Assemblies/TemporaryAssembliesMixin.js +45 -0
- package/dist/Assemblies/index.d.ts +2 -0
- package/dist/Assemblies/index.js +18 -0
- package/dist/HistoryManagement/index.d.ts +30 -0
- package/dist/HistoryManagement/index.js +54 -0
- package/dist/JBrowseConfig/index.d.ts +158 -0
- package/dist/JBrowseConfig/index.js +155 -0
- package/dist/JBrowseModel/index.d.ts +144 -0
- package/dist/JBrowseModel/index.js +132 -0
- package/dist/RootMenu/index.d.ts +68 -0
- package/dist/RootMenu/index.js +142 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +22 -0
- package/dist/ui/App/App.d.ts +19 -0
- package/dist/ui/App/App.js +95 -0
- package/dist/ui/App/AppFab.d.ts +6 -0
- package/dist/ui/App/AppFab.js +32 -0
- package/dist/ui/App/AppToolbar.d.ts +19 -0
- package/dist/ui/App/AppToolbar.js +54 -0
- package/dist/ui/App/DialogQueue.d.ts +6 -0
- package/dist/ui/App/DialogQueue.js +32 -0
- package/dist/ui/App/Drawer.d.ts +8 -0
- package/dist/ui/App/Drawer.js +34 -0
- package/dist/ui/App/DrawerWidget.d.ts +6 -0
- package/dist/ui/App/DrawerWidget.js +132 -0
- package/dist/ui/App/ViewContainer.d.ts +9 -0
- package/dist/ui/App/ViewContainer.js +76 -0
- package/dist/ui/App/ViewContainerTitle.d.ts +6 -0
- package/dist/ui/App/ViewContainerTitle.js +42 -0
- package/dist/ui/App/ViewLauncher.d.ts +18 -0
- package/dist/ui/App/ViewLauncher.js +50 -0
- package/dist/ui/App/ViewMenu.d.ts +9 -0
- package/dist/ui/App/ViewMenu.js +38 -0
- package/dist/ui/App/ViewPanel.d.ts +19 -0
- package/dist/ui/App/ViewPanel.js +50 -0
- package/dist/ui/App/index.d.ts +1 -0
- package/dist/ui/App/index.js +17 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +17 -0
- package/esm/Assemblies/SessionAssembliesMixin.d.ts +72 -0
- package/esm/Assemblies/SessionAssembliesMixin.js +40 -0
- package/esm/Assemblies/TemporaryAssembliesMixin.d.ts +22 -0
- package/esm/Assemblies/TemporaryAssembliesMixin.js +41 -0
- package/esm/Assemblies/index.d.ts +2 -0
- package/esm/Assemblies/index.js +2 -0
- package/esm/HistoryManagement/index.d.ts +30 -0
- package/esm/HistoryManagement/index.js +47 -0
- package/esm/JBrowseConfig/index.d.ts +158 -0
- package/esm/JBrowseConfig/index.js +148 -0
- package/esm/JBrowseModel/index.d.ts +144 -0
- package/esm/JBrowseModel/index.js +128 -0
- package/esm/RootMenu/index.d.ts +68 -0
- package/esm/RootMenu/index.js +138 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +6 -0
- package/esm/ui/App/App.d.ts +19 -0
- package/esm/ui/App/App.js +66 -0
- package/esm/ui/App/AppFab.d.ts +6 -0
- package/esm/ui/App/AppFab.js +27 -0
- package/esm/ui/App/AppToolbar.d.ts +19 -0
- package/esm/ui/App/AppToolbar.js +49 -0
- package/esm/ui/App/DialogQueue.d.ts +6 -0
- package/esm/ui/App/DialogQueue.js +7 -0
- package/esm/ui/App/Drawer.d.ts +8 -0
- package/esm/ui/App/Drawer.js +29 -0
- package/esm/ui/App/DrawerWidget.d.ts +6 -0
- package/esm/ui/App/DrawerWidget.js +104 -0
- package/esm/ui/App/ViewContainer.d.ts +9 -0
- package/esm/ui/App/ViewContainer.js +48 -0
- package/esm/ui/App/ViewContainerTitle.d.ts +6 -0
- package/esm/ui/App/ViewContainerTitle.js +37 -0
- package/esm/ui/App/ViewLauncher.d.ts +18 -0
- package/esm/ui/App/ViewLauncher.js +25 -0
- package/esm/ui/App/ViewMenu.d.ts +9 -0
- package/esm/ui/App/ViewMenu.js +33 -0
- package/esm/ui/App/ViewPanel.d.ts +19 -0
- package/esm/ui/App/ViewPanel.js +22 -0
- package/esm/ui/App/index.d.ts +1 -0
- package/esm/ui/App/index.js +1 -0
- package/esm/ui/index.d.ts +1 -0
- package/esm/ui/index.js +1 -0
- package/package.json +66 -0
- package/src/Assemblies/SessionAssembliesMixin.ts +50 -0
- package/src/Assemblies/TemporaryAssembliesMixin.ts +51 -0
- package/src/Assemblies/index.ts +2 -0
- package/src/HistoryManagement/index.ts +56 -0
- package/src/JBrowseConfig/index.ts +173 -0
- package/src/JBrowseModel/index.ts +150 -0
- package/src/RootMenu/index.ts +157 -0
- package/src/index.ts +6 -0
- package/src/ui/App/App.tsx +117 -0
- package/src/ui/App/AppFab.tsx +45 -0
- package/src/ui/App/AppToolbar.tsx +89 -0
- package/src/ui/App/DialogQueue.tsx +22 -0
- package/src/ui/App/Drawer.tsx +56 -0
- package/src/ui/App/DrawerWidget.tsx +238 -0
- package/src/ui/App/ViewContainer.tsx +76 -0
- package/src/ui/App/ViewContainerTitle.tsx +55 -0
- package/src/ui/App/ViewLauncher.tsx +64 -0
- package/src/ui/App/ViewMenu.tsx +54 -0
- package/src/ui/App/ViewPanel.tsx +63 -0
- package/src/ui/App/index.ts +1 -0
- package/src/ui/index.ts +1 -0
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const material_1 = require("@mui/material");
|
|
28
|
+
const mobx_react_1 = require("mobx-react");
|
|
29
|
+
const mui_1 = require("tss-react/mui");
|
|
30
|
+
// locals
|
|
31
|
+
const util_1 = require("@jbrowse/core/util");
|
|
32
|
+
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
33
|
+
selectPaper: {
|
|
34
|
+
padding: theme.spacing(4),
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
37
|
+
const ViewLauncher = (0, mobx_react_1.observer)(({ session }) => {
|
|
38
|
+
var _a;
|
|
39
|
+
const { classes } = useStyles();
|
|
40
|
+
const { pluginManager } = (0, util_1.getEnv)(session);
|
|
41
|
+
const viewTypes = pluginManager.getElementTypeRecord('view').all();
|
|
42
|
+
const [value, setValue] = (0, react_1.useState)((_a = viewTypes[0]) === null || _a === void 0 ? void 0 : _a.name);
|
|
43
|
+
return (react_1.default.createElement(material_1.Paper, { className: classes.selectPaper },
|
|
44
|
+
react_1.default.createElement(material_1.Typography, null, "Select a view to launch"),
|
|
45
|
+
react_1.default.createElement(material_1.FormControl, { style: { margin: 2 } },
|
|
46
|
+
react_1.default.createElement(material_1.Select, { value: value, onChange: event => setValue(event.target.value) }, viewTypes.map(({ displayName, name }) => (react_1.default.createElement(material_1.MenuItem, { key: name, value: name }, displayName))))),
|
|
47
|
+
react_1.default.createElement(material_1.FormControl, { style: { margin: 2 } },
|
|
48
|
+
react_1.default.createElement(material_1.Button, { onClick: () => session.addView(value, {}), variant: "contained", color: "primary" }, "Launch view"))));
|
|
49
|
+
});
|
|
50
|
+
exports.default = ViewLauncher;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SvgIconProps, IconButtonProps as IconButtonPropsType } from '@mui/material';
|
|
3
|
+
import { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
4
|
+
declare const ViewMenu: ({ model, IconButtonProps, IconProps, }: {
|
|
5
|
+
model: IBaseViewModel;
|
|
6
|
+
IconButtonProps?: IconButtonPropsType | undefined;
|
|
7
|
+
IconProps: SvgIconProps;
|
|
8
|
+
}) => React.JSX.Element | null;
|
|
9
|
+
export default ViewMenu;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 mobx_react_1 = require("mobx-react");
|
|
8
|
+
const util_1 = require("@jbrowse/core/util");
|
|
9
|
+
const CascadingMenuButton_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenuButton"));
|
|
10
|
+
// icons
|
|
11
|
+
const Menu_1 = __importDefault(require("@mui/icons-material/Menu"));
|
|
12
|
+
const ArrowDownward_1 = __importDefault(require("@mui/icons-material/ArrowDownward"));
|
|
13
|
+
const ArrowUpward_1 = __importDefault(require("@mui/icons-material/ArrowUpward"));
|
|
14
|
+
const ViewMenu = (0, mobx_react_1.observer)(function ({ model, IconButtonProps, IconProps, }) {
|
|
15
|
+
const { menuItems } = model;
|
|
16
|
+
const session = (0, util_1.getSession)(model);
|
|
17
|
+
const items = [
|
|
18
|
+
...(session.views.length > 1
|
|
19
|
+
? [
|
|
20
|
+
{
|
|
21
|
+
label: 'Move view up',
|
|
22
|
+
icon: ArrowUpward_1.default,
|
|
23
|
+
onClick: () => session.moveViewUp(model.id),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: 'Move view down',
|
|
27
|
+
icon: ArrowDownward_1.default,
|
|
28
|
+
onClick: () => session.moveViewDown(model.id),
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
: []),
|
|
32
|
+
// <=1.3.3 didn't use a function, so check as value also
|
|
33
|
+
...((typeof menuItems === 'function' ? menuItems() : menuItems) || []),
|
|
34
|
+
];
|
|
35
|
+
return items.length ? (react_1.default.createElement(CascadingMenuButton_1.default, { menuItems: items, "data-testid": "view_menu_icon" },
|
|
36
|
+
react_1.default.createElement(Menu_1.default, { ...IconProps, fontSize: "small" }))) : null;
|
|
37
|
+
});
|
|
38
|
+
exports.default = ViewMenu;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AbstractViewModel, SessionWithDrawerWidgets } from '@jbrowse/core/util';
|
|
3
|
+
import { SnackbarMessage } from '@jbrowse/core/ui/SnackbarModel';
|
|
4
|
+
import { MenuItem as JBMenuItem } from '@jbrowse/core/ui/Menu';
|
|
5
|
+
type AppSession = SessionWithDrawerWidgets & {
|
|
6
|
+
savedSessionNames: string[];
|
|
7
|
+
menus: {
|
|
8
|
+
label: string;
|
|
9
|
+
menuItems: JBMenuItem[];
|
|
10
|
+
}[];
|
|
11
|
+
snackbarMessages: SnackbarMessage[];
|
|
12
|
+
renameCurrentSession: (arg: string) => void;
|
|
13
|
+
popSnackbarMessage: () => unknown;
|
|
14
|
+
};
|
|
15
|
+
declare const ViewPanel: ({ view, session, }: {
|
|
16
|
+
view: AbstractViewModel;
|
|
17
|
+
session: AppSession;
|
|
18
|
+
}) => React.JSX.Element;
|
|
19
|
+
export default ViewPanel;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 react_error_boundary_1 = require("react-error-boundary");
|
|
31
|
+
const mobx_react_1 = require("mobx-react");
|
|
32
|
+
// locals
|
|
33
|
+
const util_1 = require("@jbrowse/core/util");
|
|
34
|
+
// ui elements
|
|
35
|
+
const ErrorMessage_1 = __importDefault(require("@jbrowse/core/ui/ErrorMessage"));
|
|
36
|
+
const LoadingEllipses_1 = __importDefault(require("@jbrowse/core/ui/LoadingEllipses"));
|
|
37
|
+
// locals
|
|
38
|
+
const ViewContainer_1 = __importDefault(require("./ViewContainer"));
|
|
39
|
+
const ViewPanel = (0, mobx_react_1.observer)(function ({ view, session, }) {
|
|
40
|
+
const { pluginManager } = (0, util_1.getEnv)(session);
|
|
41
|
+
const viewType = pluginManager.getViewType(view.type);
|
|
42
|
+
if (!viewType) {
|
|
43
|
+
throw new Error(`unknown view type ${view.type}`);
|
|
44
|
+
}
|
|
45
|
+
const { ReactComponent } = viewType;
|
|
46
|
+
return (react_1.default.createElement(ViewContainer_1.default, { view: view, onClose: () => session.removeView(view), onMinimize: () => view.setMinimized(!view.minimized) }, !view.minimized ? (react_1.default.createElement(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ({ error }) => react_1.default.createElement(ErrorMessage_1.default, { error: error }) },
|
|
47
|
+
react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement(LoadingEllipses_1.default, { variant: "h6" }) },
|
|
48
|
+
react_1.default.createElement(ReactComponent, { model: view, session: session })))) : (false)));
|
|
49
|
+
});
|
|
50
|
+
exports.default = ViewPanel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './App';
|
|
@@ -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("./App"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './App';
|
package/dist/ui/index.js
ADDED
|
@@ -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("./App"), exports);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import { AnyConfiguration } from '@jbrowse/core/configuration';
|
|
3
|
+
import { BaseAssemblyConfigSchema } from '@jbrowse/core/assemblyManager';
|
|
4
|
+
/**
|
|
5
|
+
* #stateModel SessionAssembliesMixin
|
|
6
|
+
* #category root
|
|
7
|
+
*/
|
|
8
|
+
export declare function SessionAssembliesMixin(pluginManager: PluginManager, assemblyConfigSchemasType: BaseAssemblyConfigSchema): import("mobx-state-tree").IModelType<{
|
|
9
|
+
/**
|
|
10
|
+
* #property
|
|
11
|
+
*/
|
|
12
|
+
sessionAssemblies: import("mobx-state-tree").IArrayType<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
13
|
+
aliases: {
|
|
14
|
+
type: string;
|
|
15
|
+
defaultValue: never[];
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
19
|
+
refNameColors: {
|
|
20
|
+
type: string;
|
|
21
|
+
defaultValue: never[];
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
25
|
+
adapter: import("mobx-state-tree").IAnyModelType;
|
|
26
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
27
|
+
cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
28
|
+
adapter: import("mobx-state-tree").IAnyModelType;
|
|
29
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
30
|
+
displayName: {
|
|
31
|
+
type: string;
|
|
32
|
+
defaultValue: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>>;
|
|
36
|
+
}, {
|
|
37
|
+
/**
|
|
38
|
+
* #action
|
|
39
|
+
*/
|
|
40
|
+
addSessionAssembly(conf: AnyConfiguration): {
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
43
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
44
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
45
|
+
aliases: {
|
|
46
|
+
type: string;
|
|
47
|
+
defaultValue: never[];
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
51
|
+
refNameColors: {
|
|
52
|
+
type: string;
|
|
53
|
+
defaultValue: never[];
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
57
|
+
adapter: import("mobx-state-tree").IAnyModelType;
|
|
58
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
59
|
+
cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
60
|
+
adapter: import("mobx-state-tree").IAnyModelType;
|
|
61
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
62
|
+
displayName: {
|
|
63
|
+
type: string;
|
|
64
|
+
defaultValue: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>>;
|
|
68
|
+
/**
|
|
69
|
+
* #action
|
|
70
|
+
*/
|
|
71
|
+
removeSessionAssembly(assemblyName: string): void;
|
|
72
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { types } from 'mobx-state-tree';
|
|
2
|
+
/**
|
|
3
|
+
* #stateModel SessionAssembliesMixin
|
|
4
|
+
* #category root
|
|
5
|
+
*/
|
|
6
|
+
export function SessionAssembliesMixin(pluginManager, assemblyConfigSchemasType) {
|
|
7
|
+
return types
|
|
8
|
+
.model({
|
|
9
|
+
/**
|
|
10
|
+
* #property
|
|
11
|
+
*/
|
|
12
|
+
sessionAssemblies: types.array(assemblyConfigSchemasType),
|
|
13
|
+
})
|
|
14
|
+
.actions(s => {
|
|
15
|
+
const self = s;
|
|
16
|
+
return {
|
|
17
|
+
/**
|
|
18
|
+
* #action
|
|
19
|
+
*/
|
|
20
|
+
addSessionAssembly(conf) {
|
|
21
|
+
const asm = self.sessionAssemblies.find(f => f.name === conf.name);
|
|
22
|
+
if (asm) {
|
|
23
|
+
console.warn(`Assembly ${conf.name} already exists`);
|
|
24
|
+
return asm;
|
|
25
|
+
}
|
|
26
|
+
const length = self.sessionAssemblies.push(conf);
|
|
27
|
+
return self.sessionAssemblies[length - 1];
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* #action
|
|
31
|
+
*/
|
|
32
|
+
removeSessionAssembly(assemblyName) {
|
|
33
|
+
const elt = self.sessionAssemblies.find(a => a.name === assemblyName);
|
|
34
|
+
if (elt) {
|
|
35
|
+
self.sessionAssemblies.remove(elt);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import { AnyConfiguration } from '@jbrowse/core/configuration';
|
|
3
|
+
/**
|
|
4
|
+
* #stateModel TemporaryAssembliesMixin
|
|
5
|
+
* #category root
|
|
6
|
+
*/
|
|
7
|
+
export declare function TemporaryAssembliesMixin(pluginManager: PluginManager, assemblyConfigSchemasType?: import("mobx-state-tree").IType<any, any, any>): import("mobx-state-tree").IModelType<{
|
|
8
|
+
/**
|
|
9
|
+
* #property
|
|
10
|
+
*/
|
|
11
|
+
temporaryAssemblies: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>;
|
|
12
|
+
}, {
|
|
13
|
+
/**
|
|
14
|
+
* #action
|
|
15
|
+
* used for read vs ref type assemblies.
|
|
16
|
+
*/
|
|
17
|
+
addTemporaryAssembly(conf: AnyConfiguration): any;
|
|
18
|
+
/**
|
|
19
|
+
* #action
|
|
20
|
+
*/
|
|
21
|
+
removeTemporaryAssembly(name: string): void;
|
|
22
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { types } from 'mobx-state-tree';
|
|
2
|
+
/**
|
|
3
|
+
* #stateModel TemporaryAssembliesMixin
|
|
4
|
+
* #category root
|
|
5
|
+
*/
|
|
6
|
+
export function TemporaryAssembliesMixin(pluginManager, assemblyConfigSchemasType = types.frozen()) {
|
|
7
|
+
return types
|
|
8
|
+
.model({
|
|
9
|
+
/**
|
|
10
|
+
* #property
|
|
11
|
+
*/
|
|
12
|
+
temporaryAssemblies: types.array(assemblyConfigSchemasType),
|
|
13
|
+
})
|
|
14
|
+
.actions(s => {
|
|
15
|
+
const self = s;
|
|
16
|
+
return {
|
|
17
|
+
/**
|
|
18
|
+
* #action
|
|
19
|
+
* used for read vs ref type assemblies.
|
|
20
|
+
*/
|
|
21
|
+
addTemporaryAssembly(conf) {
|
|
22
|
+
const asm = self.temporaryAssemblies.find(f => f.name === conf.name);
|
|
23
|
+
if (asm) {
|
|
24
|
+
console.warn(`Assembly ${conf.name} was already existing`);
|
|
25
|
+
return asm;
|
|
26
|
+
}
|
|
27
|
+
const length = self.temporaryAssemblies.push(conf);
|
|
28
|
+
return self.temporaryAssemblies[length - 1];
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* #action
|
|
32
|
+
*/
|
|
33
|
+
removeTemporaryAssembly(name) {
|
|
34
|
+
const elt = self.temporaryAssemblies.find(a => a.name === name);
|
|
35
|
+
if (elt) {
|
|
36
|
+
self.temporaryAssemblies.remove(elt);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #stateModel HistoryManagementMixin
|
|
3
|
+
* #category root
|
|
4
|
+
*/
|
|
5
|
+
export declare function HistoryManagementMixin(): import("mobx-state-tree").IModelType<{
|
|
6
|
+
/**
|
|
7
|
+
* #property
|
|
8
|
+
* used for undo/redo
|
|
9
|
+
*/
|
|
10
|
+
history: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{
|
|
11
|
+
undoIdx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
12
|
+
targetPath: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
13
|
+
}, {
|
|
14
|
+
history: unknown[];
|
|
15
|
+
notTrackingUndo: boolean;
|
|
16
|
+
} & {
|
|
17
|
+
readonly canUndo: boolean;
|
|
18
|
+
readonly canRedo: boolean;
|
|
19
|
+
} & {
|
|
20
|
+
stopTrackingUndo(): void;
|
|
21
|
+
resumeTrackingUndo(): void;
|
|
22
|
+
addUndoState(todos: unknown): void;
|
|
23
|
+
beforeDestroy(): void;
|
|
24
|
+
initialize(): void;
|
|
25
|
+
undo(): void;
|
|
26
|
+
redo(): void;
|
|
27
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
28
|
+
}, {
|
|
29
|
+
afterCreate(): void;
|
|
30
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import TimeTraveller from '@jbrowse/core/util/TimeTraveller';
|
|
2
|
+
import { autorun } from 'mobx';
|
|
3
|
+
import { addDisposer, types } from 'mobx-state-tree';
|
|
4
|
+
/**
|
|
5
|
+
* #stateModel HistoryManagementMixin
|
|
6
|
+
* #category root
|
|
7
|
+
*/
|
|
8
|
+
export function HistoryManagementMixin() {
|
|
9
|
+
return types
|
|
10
|
+
.model({
|
|
11
|
+
/**
|
|
12
|
+
* #property
|
|
13
|
+
* used for undo/redo
|
|
14
|
+
*/
|
|
15
|
+
history: types.optional(TimeTraveller, { targetPath: '../session' }),
|
|
16
|
+
})
|
|
17
|
+
.actions(self => ({
|
|
18
|
+
afterCreate() {
|
|
19
|
+
document.addEventListener('keydown', e => {
|
|
20
|
+
if (self.history.canRedo &&
|
|
21
|
+
// ctrl+shift+z or cmd+shift+z
|
|
22
|
+
(((e.ctrlKey || e.metaKey) && e.shiftKey && e.code === 'KeyZ') ||
|
|
23
|
+
// ctrl+y
|
|
24
|
+
(e.ctrlKey && !e.shiftKey && e.code === 'KeyY'))) {
|
|
25
|
+
self.history.redo();
|
|
26
|
+
}
|
|
27
|
+
if (self.history.canUndo &&
|
|
28
|
+
// ctrl+z or cmd+z
|
|
29
|
+
(e.ctrlKey || e.metaKey) &&
|
|
30
|
+
!e.shiftKey &&
|
|
31
|
+
e.code === 'KeyZ') {
|
|
32
|
+
self.history.undo();
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
addDisposer(self, autorun(() => {
|
|
36
|
+
const { session } = self;
|
|
37
|
+
if (session) {
|
|
38
|
+
// we use a specific initialization routine after session is
|
|
39
|
+
// created to get it to start tracking itself sort of related
|
|
40
|
+
// issue here
|
|
41
|
+
// https://github.com/mobxjs/mobx-state-tree/issues/1089#issuecomment-441207911
|
|
42
|
+
self.history.initialize();
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
},
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
2
|
+
import { PluginDefinition } from '@jbrowse/core/PluginLoader';
|
|
3
|
+
import PluginManager from '@jbrowse/core/PluginManager';
|
|
4
|
+
/**
|
|
5
|
+
* #config JBrowseRootConfig
|
|
6
|
+
* #category root
|
|
7
|
+
* configuration in a config.json/file.jbrowse
|
|
8
|
+
*/
|
|
9
|
+
export declare function JBrowseConfigF({ pluginManager, assemblyConfigSchema, }: {
|
|
10
|
+
pluginManager: PluginManager;
|
|
11
|
+
assemblyConfigSchema: AnyConfigurationSchemaType;
|
|
12
|
+
}): import("mobx-state-tree").IModelType<{
|
|
13
|
+
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
14
|
+
/**
|
|
15
|
+
* #slot configuration.rpc
|
|
16
|
+
*/
|
|
17
|
+
rpc: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
18
|
+
defaultDriver: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string; /**
|
|
21
|
+
* #slot configuration.formatDetails.feature
|
|
22
|
+
*/
|
|
23
|
+
defaultValue: string;
|
|
24
|
+
};
|
|
25
|
+
drivers: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IMapType<import("mobx-state-tree").ITypeUnion<import("mobx-state-tree").ModelCreationType<import("mobx-state-tree/dist/internal").ExtractCFromProps<Record<string, any>>> | undefined, import("mobx-state-tree").ModelSnapshotType<Record<string, any>>, (Partial<import("mobx-state-tree/dist/internal").ExtractCFromProps<Record<string, any>>> & import("mobx-state-tree/dist/internal").NonEmptyObject) | undefined>>, [undefined]>;
|
|
26
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
27
|
+
/**
|
|
28
|
+
* #slot configuration.highResolutionScaling
|
|
29
|
+
*/
|
|
30
|
+
highResolutionScaling: {
|
|
31
|
+
type: string;
|
|
32
|
+
defaultValue: number;
|
|
33
|
+
};
|
|
34
|
+
formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
35
|
+
/**
|
|
36
|
+
* #slot configuration.formatDetails.feature
|
|
37
|
+
*/
|
|
38
|
+
feature: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
defaultValue: {};
|
|
42
|
+
contextVariable: string[];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* #slot configuration.formatDetails.subfeatures
|
|
46
|
+
*/
|
|
47
|
+
subfeatures: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
defaultValue: {};
|
|
51
|
+
contextVariable: string[];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* #slot configuration.formatDetails.depth
|
|
55
|
+
*/
|
|
56
|
+
depth: {
|
|
57
|
+
type: string;
|
|
58
|
+
defaultValue: number;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
62
|
+
formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
63
|
+
/**
|
|
64
|
+
* #slot configuration.formatAbout.config
|
|
65
|
+
*/
|
|
66
|
+
config: {
|
|
67
|
+
type: string;
|
|
68
|
+
description: string;
|
|
69
|
+
defaultValue: {};
|
|
70
|
+
contextVariable: string[];
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* #slot configuration.formatAbout.hideUris
|
|
74
|
+
*/
|
|
75
|
+
hideUris: {
|
|
76
|
+
type: string;
|
|
77
|
+
defaultValue: boolean;
|
|
78
|
+
};
|
|
79
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
80
|
+
shareURL: {
|
|
81
|
+
type: string;
|
|
82
|
+
defaultValue: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* #slot configuration.disableAnalytics
|
|
86
|
+
*/
|
|
87
|
+
disableAnalytics: {
|
|
88
|
+
type: string;
|
|
89
|
+
defaultValue: boolean;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* #slot configuration.theme
|
|
93
|
+
*/
|
|
94
|
+
theme: {
|
|
95
|
+
type: string;
|
|
96
|
+
defaultValue: {};
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* #slot configuration.extraThemes
|
|
100
|
+
*/
|
|
101
|
+
extraThemes: {
|
|
102
|
+
type: string;
|
|
103
|
+
defaultValue: {};
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* #slot configuration.logoPath
|
|
107
|
+
*/
|
|
108
|
+
logoPath: {
|
|
109
|
+
type: string;
|
|
110
|
+
defaultValue: {
|
|
111
|
+
uri: string;
|
|
112
|
+
locationType: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
116
|
+
/**
|
|
117
|
+
* #slot
|
|
118
|
+
* defines plugins of the format
|
|
119
|
+
* ```typescript
|
|
120
|
+
* type PluginDefinition=
|
|
121
|
+
* { umdUrl: string, name:string } |
|
|
122
|
+
* { url: string, name: string } |
|
|
123
|
+
* { esmUrl: string } |
|
|
124
|
+
* { cjsUrl: string } |
|
|
125
|
+
* { umdLoc: { uri: string } } |
|
|
126
|
+
* { esmLoc: { uri: string } } |
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
plugins: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<PluginDefinition, PluginDefinition, PluginDefinition>>;
|
|
130
|
+
/**
|
|
131
|
+
* #slot
|
|
132
|
+
* configuration of the assemblies in the instance, see BaseAssembly
|
|
133
|
+
*/
|
|
134
|
+
assemblies: import("mobx-state-tree").IArrayType<AnyConfigurationSchemaType>;
|
|
135
|
+
/**
|
|
136
|
+
* #slot
|
|
137
|
+
* track configuration is an array of track config schemas. multiple
|
|
138
|
+
* instances of a track can exist that use the same configuration
|
|
139
|
+
*/
|
|
140
|
+
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
141
|
+
/**
|
|
142
|
+
* #slot
|
|
143
|
+
* configuration for internet accounts, see InternetAccounts
|
|
144
|
+
*/
|
|
145
|
+
internetAccounts: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
146
|
+
/**
|
|
147
|
+
* #slot
|
|
148
|
+
*/
|
|
149
|
+
aggregateTextSearchAdapters: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
150
|
+
/**
|
|
151
|
+
* #slot
|
|
152
|
+
*/
|
|
153
|
+
connections: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
154
|
+
/**
|
|
155
|
+
* #slot
|
|
156
|
+
*/
|
|
157
|
+
defaultSession: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
158
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|