@jbrowse/app-core 3.6.5 → 4.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.
- package/esm/AppFocus/index.d.ts +3 -3
- package/esm/AppFocus/index.js +1 -1
- package/esm/Assemblies/SessionAssembliesMixin.d.ts +47 -22
- package/esm/Assemblies/SessionAssembliesMixin.js +11 -1
- package/esm/Assemblies/TemporaryAssembliesMixin.d.ts +5 -3
- package/esm/Assemblies/TemporaryAssembliesMixin.js +11 -1
- package/esm/Assemblies/index.d.ts +2 -2
- package/esm/Assemblies/index.js +2 -2
- package/esm/DockviewLayout/index.d.ts +26 -0
- package/esm/DockviewLayout/index.js +107 -0
- package/esm/HistoryManagement/index.d.ts +7 -7
- package/esm/HistoryManagement/index.js +5 -6
- package/esm/JBrowseConfig/RootConfiguration.d.ts +15 -15
- package/esm/JBrowseConfig/index.d.ts +35 -25
- package/esm/JBrowseConfig/index.js +3 -3
- package/esm/JBrowseModel/index.d.ts +52 -34
- package/esm/JBrowseModel/index.js +15 -6
- package/esm/RootMenu/index.d.ts +3 -3
- package/esm/RootMenu/index.js +1 -1
- package/esm/index.d.ts +9 -8
- package/esm/index.js +9 -8
- package/esm/ui/App/App.d.ts +1 -1
- package/esm/ui/App/App.js +8 -8
- package/esm/ui/App/AppFab.js +2 -2
- package/esm/ui/App/AppToolbar.d.ts +1 -1
- package/esm/ui/App/AppToolbar.js +17 -3
- package/esm/ui/App/ClassicViewsContainer.d.ts +12 -0
- package/esm/ui/App/ClassicViewsContainer.js +21 -0
- package/esm/ui/App/DialogQueue.d.ts +2 -2
- package/esm/ui/App/DialogQueue.js +1 -1
- package/esm/ui/App/DockviewContext.d.ts +15 -0
- package/esm/ui/App/DockviewContext.js +21 -0
- package/esm/ui/App/DockviewLeftHeaderActions.d.ts +2 -0
- package/esm/ui/App/DockviewLeftHeaderActions.js +58 -0
- package/esm/ui/App/DockviewRightHeaderActions.d.ts +2 -0
- package/esm/ui/App/DockviewRightHeaderActions.js +100 -0
- package/esm/ui/App/Drawer.js +4 -5
- package/esm/ui/App/DrawerControls.js +1 -1
- package/esm/ui/App/DrawerHeader.js +16 -8
- package/{dist/ui/App/Drawer.d.ts → esm/ui/App/DrawerHeaderHelpButton.d.ts} +3 -3
- package/esm/ui/App/DrawerHeaderHelpButton.js +18 -0
- package/esm/ui/App/DrawerHeaderHelpDialog.d.ts +4 -0
- package/esm/ui/App/DrawerHeaderHelpDialog.js +15 -0
- package/esm/ui/App/DrawerWidget.js +4 -4
- package/esm/ui/App/DrawerWidgetSelector.js +3 -3
- package/esm/ui/App/JBrowseTabMenu.d.ts +5 -0
- package/esm/ui/App/JBrowseTabMenu.js +39 -0
- package/esm/ui/App/JBrowseViewPanel.d.ts +8 -0
- package/esm/ui/App/JBrowseViewPanel.js +49 -0
- package/esm/ui/App/JBrowseViewTab.d.ts +8 -0
- package/esm/ui/App/JBrowseViewTab.js +106 -0
- package/esm/ui/App/ModalWidget.js +3 -3
- package/esm/ui/App/TiledViewsContainer.d.ts +7 -0
- package/esm/ui/App/TiledViewsContainer.js +251 -0
- package/{dist/ui/App/ViewHeader.d.ts → esm/ui/App/ViewButtons.d.ts} +2 -3
- package/esm/ui/App/ViewButtons.js +17 -0
- package/esm/ui/App/ViewContainer.js +7 -8
- package/esm/ui/App/ViewContainerTitle.js +3 -4
- package/esm/ui/App/ViewHeader.js +7 -16
- package/esm/ui/App/ViewLauncher.d.ts +1 -1
- package/esm/ui/App/ViewLauncher.js +3 -4
- package/esm/ui/App/ViewMenu.d.ts +1 -1
- package/esm/ui/App/ViewMenu.js +113 -54
- package/esm/ui/App/ViewWrapper.js +1 -1
- package/esm/ui/App/ViewsContainer.d.ts +2 -2
- package/esm/ui/App/ViewsContainer.js +8 -6
- package/esm/ui/App/copyView.d.ts +1 -0
- package/esm/ui/App/copyView.js +29 -0
- package/esm/ui/App/dockviewUtils.d.ts +44 -0
- package/esm/ui/App/dockviewUtils.js +45 -0
- package/esm/ui/App/index.d.ts +2 -1
- package/esm/ui/App/index.js +2 -1
- package/esm/ui/App/types.d.ts +7 -0
- package/esm/ui/App/types.js +1 -0
- package/esm/ui/index.d.ts +1 -1
- package/esm/ui/index.js +1 -1
- package/package.json +27 -32
- package/dist/AppFocus/index.d.ts +0 -5
- package/dist/AppFocus/index.js +0 -15
- package/dist/Assemblies/SessionAssembliesMixin.d.ts +0 -67
- package/dist/Assemblies/SessionAssembliesMixin.js +0 -46
- package/dist/Assemblies/TemporaryAssembliesMixin.d.ts +0 -8
- package/dist/Assemblies/TemporaryAssembliesMixin.js +0 -30
- package/dist/Assemblies/index.d.ts +0 -2
- package/dist/Assemblies/index.js +0 -18
- package/dist/HistoryManagement/index.d.ts +0 -23
- package/dist/HistoryManagement/index.js +0 -47
- package/dist/JBrowseConfig/RootConfiguration.d.ts +0 -102
- package/dist/JBrowseConfig/RootConfiguration.js +0 -46
- package/dist/JBrowseConfig/index.d.ts +0 -115
- package/dist/JBrowseConfig/index.js +0 -26
- package/dist/JBrowseModel/index.d.ts +0 -142
- package/dist/JBrowseModel/index.js +0 -101
- package/dist/RootMenu/index.d.ts +0 -13
- package/dist/RootMenu/index.js +0 -74
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -24
- package/dist/menus.d.ts +0 -74
- package/dist/menus.js +0 -108
- package/dist/ui/App/App.d.ts +0 -18
- package/dist/ui/App/App.js +0 -82
- package/dist/ui/App/AppFab.d.ts +0 -5
- package/dist/ui/App/AppFab.js +0 -32
- package/dist/ui/App/AppToolbar.d.ts +0 -18
- package/dist/ui/App/AppToolbar.js +0 -44
- package/dist/ui/App/DialogQueue.d.ts +0 -5
- package/dist/ui/App/DialogQueue.js +0 -10
- package/dist/ui/App/Drawer.js +0 -51
- package/dist/ui/App/DrawerControls.d.ts +0 -5
- package/dist/ui/App/DrawerControls.js +0 -30
- package/dist/ui/App/DrawerHeader.d.ts +0 -7
- package/dist/ui/App/DrawerHeader.js +0 -37
- package/dist/ui/App/DrawerWidget.d.ts +0 -5
- package/dist/ui/App/DrawerWidget.js +0 -65
- package/dist/ui/App/DrawerWidgetSelector.d.ts +0 -5
- package/dist/ui/App/DrawerWidgetSelector.js +0 -52
- package/dist/ui/App/ModalWidget.d.ts +0 -6
- package/dist/ui/App/ModalWidget.js +0 -53
- package/dist/ui/App/ViewContainer.d.ts +0 -6
- package/dist/ui/App/ViewContainer.js +0 -55
- package/dist/ui/App/ViewContainerTitle.d.ts +0 -5
- package/dist/ui/App/ViewContainerTitle.js +0 -44
- package/dist/ui/App/ViewHeader.js +0 -60
- package/dist/ui/App/ViewLauncher.d.ts +0 -11
- package/dist/ui/App/ViewLauncher.js +0 -29
- package/dist/ui/App/ViewMenu.d.ts +0 -8
- package/dist/ui/App/ViewMenu.js +0 -74
- package/dist/ui/App/ViewWrapper.d.ts +0 -6
- package/dist/ui/App/ViewWrapper.js +0 -23
- package/dist/ui/App/ViewsContainer.d.ts +0 -12
- package/dist/ui/App/ViewsContainer.js +0 -57
- package/dist/ui/App/index.d.ts +0 -1
- package/dist/ui/App/index.js +0 -17
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/index.js +0 -17
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
9
|
-
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
10
|
-
const material_1 = require("@mui/material");
|
|
11
|
-
const mobx_react_1 = require("mobx-react");
|
|
12
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
13
|
-
const mui_1 = require("tss-react/mui");
|
|
14
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
15
|
-
paper: {
|
|
16
|
-
overflow: 'auto',
|
|
17
|
-
minWidth: 800,
|
|
18
|
-
},
|
|
19
|
-
closeButton: {
|
|
20
|
-
position: 'absolute',
|
|
21
|
-
right: theme.spacing(1),
|
|
22
|
-
top: theme.spacing(1),
|
|
23
|
-
color: theme.palette.grey[500],
|
|
24
|
-
},
|
|
25
|
-
}));
|
|
26
|
-
const DrawerAppBar = (0, mobx_react_1.observer)(function DrawerAppBar({ session, onClose, }) {
|
|
27
|
-
const { classes } = useStyles();
|
|
28
|
-
const { visibleWidget } = session;
|
|
29
|
-
const { pluginManager } = (0, mobx_state_tree_1.getEnv)(session);
|
|
30
|
-
if (!visibleWidget) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
const { HeadingComponent, heading } = pluginManager.getWidgetType(visibleWidget.type);
|
|
34
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.AppBar, { position: "static", children: [(0, jsx_runtime_1.jsx)(material_1.Toolbar, { children: HeadingComponent ? ((0, jsx_runtime_1.jsx)(HeadingComponent, { model: visibleWidget })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", children: heading })) }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { className: classes.closeButton, onClick: onClose, children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) })] }));
|
|
35
|
-
});
|
|
36
|
-
const ModalWidget = (0, mobx_react_1.observer)(function ({ session, onClose, }) {
|
|
37
|
-
const { classes } = useStyles();
|
|
38
|
-
const { visibleWidget } = session;
|
|
39
|
-
const { pluginManager } = (0, mobx_state_tree_1.getEnv)(session);
|
|
40
|
-
if (!visibleWidget) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
const { ReactComponent } = pluginManager.getWidgetType(visibleWidget.type);
|
|
44
|
-
const Component = pluginManager.evaluateExtensionPoint('Core-replaceWidget', ReactComponent, {
|
|
45
|
-
session,
|
|
46
|
-
model: visibleWidget,
|
|
47
|
-
});
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(ui_1.Dialog, { open: true, onClose: onClose, maxWidth: "xl", header: (0, jsx_runtime_1.jsx)(DrawerAppBar, { onClose: onClose, session: session }), children: Component ? ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)("div", { children: "Loading..." }), children: (0, jsx_runtime_1.jsx)(material_1.Paper, { className: classes.paper, children: (0, jsx_runtime_1.jsx)(Component, { model: visibleWidget, session: session, modal: true, overrideDimensions: {
|
|
49
|
-
height: (window.innerHeight * 5) / 8,
|
|
50
|
-
width: 800,
|
|
51
|
-
} }) }) })) : null }));
|
|
52
|
-
});
|
|
53
|
-
exports.default = ModalWidget;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { AbstractViewModel, SessionWithFocusedViewAndDrawerWidgets } from '@jbrowse/core/util';
|
|
2
|
-
declare const ViewContainer: ({ view, session, }: {
|
|
3
|
-
view: AbstractViewModel;
|
|
4
|
-
session: SessionWithFocusedViewAndDrawerWidgets;
|
|
5
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export default ViewContainer;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const util_1 = require("@jbrowse/core/util");
|
|
9
|
-
const material_1 = require("@mui/material");
|
|
10
|
-
const mobx_react_1 = require("mobx-react");
|
|
11
|
-
const mui_1 = require("tss-react/mui");
|
|
12
|
-
const ViewHeader_1 = __importDefault(require("./ViewHeader"));
|
|
13
|
-
const ViewWrapper_1 = __importDefault(require("./ViewWrapper"));
|
|
14
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
15
|
-
viewContainer: {
|
|
16
|
-
margin: theme.spacing(0.5),
|
|
17
|
-
padding: `0 ${theme.spacing(1)} ${theme.spacing(1)}`,
|
|
18
|
-
overflow: 'clip',
|
|
19
|
-
},
|
|
20
|
-
focusedView: {
|
|
21
|
-
background: theme.palette.secondary.main,
|
|
22
|
-
},
|
|
23
|
-
unfocusedView: {
|
|
24
|
-
background: theme.palette.secondary.dark,
|
|
25
|
-
},
|
|
26
|
-
}));
|
|
27
|
-
const ViewContainer = (0, mobx_react_1.observer)(function ({ view, session, }) {
|
|
28
|
-
const theme = (0, material_1.useTheme)();
|
|
29
|
-
const ref = (0, util_1.useWidthSetter)(view, theme.spacing(1));
|
|
30
|
-
const { classes, cx } = useStyles();
|
|
31
|
-
(0, react_1.useEffect)(() => {
|
|
32
|
-
function handleSelectView(e) {
|
|
33
|
-
var _a;
|
|
34
|
-
if (e.target instanceof Element && ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
35
|
-
session.setFocusedViewId(view.id);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
document.addEventListener('mousedown', handleSelectView);
|
|
39
|
-
document.addEventListener('keydown', handleSelectView);
|
|
40
|
-
return () => {
|
|
41
|
-
document.removeEventListener('mousedown', handleSelectView);
|
|
42
|
-
document.removeEventListener('keydown', handleSelectView);
|
|
43
|
-
};
|
|
44
|
-
}, [ref, session, view]);
|
|
45
|
-
const backgroundColorClassName = session.focusedViewId === view.id
|
|
46
|
-
? classes.focusedView
|
|
47
|
-
: classes.unfocusedView;
|
|
48
|
-
const viewContainerClassName = cx(classes.viewContainer, backgroundColorClassName);
|
|
49
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { ref: ref, elevation: 12, className: viewContainerClassName, children: [(0, jsx_runtime_1.jsx)(ViewHeader_1.default, { view: view, onClose: () => {
|
|
50
|
-
session.removeView(view);
|
|
51
|
-
}, onMinimize: () => {
|
|
52
|
-
view.setMinimized(!view.minimized);
|
|
53
|
-
}, className: backgroundColorClassName }), (0, jsx_runtime_1.jsx)(material_1.Paper, { elevation: 0, children: (0, jsx_runtime_1.jsx)(ViewWrapper_1.default, { view: view, session: session }) })] }));
|
|
54
|
-
});
|
|
55
|
-
exports.default = ViewContainer;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const EditableTypography_1 = __importDefault(require("@jbrowse/core/ui/EditableTypography"));
|
|
8
|
-
const util_1 = require("@jbrowse/core/util");
|
|
9
|
-
const material_1 = require("@mui/material");
|
|
10
|
-
const mobx_react_1 = require("mobx-react");
|
|
11
|
-
const mui_1 = require("tss-react/mui");
|
|
12
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
13
|
-
input: {
|
|
14
|
-
paddingBottom: 0,
|
|
15
|
-
paddingTop: 2,
|
|
16
|
-
},
|
|
17
|
-
inputBase: {
|
|
18
|
-
color: theme.palette.secondary.contrastText,
|
|
19
|
-
},
|
|
20
|
-
inputRoot: {
|
|
21
|
-
'&:hover': {
|
|
22
|
-
backgroundColor: theme.palette.secondary.light,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
inputFocused: {
|
|
26
|
-
borderColor: theme.palette.primary.main,
|
|
27
|
-
backgroundColor: theme.palette.secondary.light,
|
|
28
|
-
},
|
|
29
|
-
}));
|
|
30
|
-
const ViewContainerTitle = (0, mobx_react_1.observer)(function ({ view, }) {
|
|
31
|
-
var _a;
|
|
32
|
-
const { classes } = useStyles();
|
|
33
|
-
const { assemblyManager } = (0, util_1.getSession)(view);
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: "Rename view", arrow: true, children: (0, jsx_runtime_1.jsx)(EditableTypography_1.default, { value: view.displayName ||
|
|
35
|
-
`${((_a = view.assemblyNames) === null || _a === void 0 ? void 0 : _a.map(r => { var _a; return (_a = assemblyManager.get(r)) === null || _a === void 0 ? void 0 : _a.displayName; }).join(',')) || 'Untitled view'}${view.minimized ? ' (minimized)' : ''}`, setValue: val => {
|
|
36
|
-
view.setDisplayName(val);
|
|
37
|
-
}, variant: "body2", classes: {
|
|
38
|
-
input: classes.input,
|
|
39
|
-
inputBase: classes.inputBase,
|
|
40
|
-
inputRoot: classes.inputRoot,
|
|
41
|
-
inputFocused: classes.inputFocused,
|
|
42
|
-
} }) }));
|
|
43
|
-
});
|
|
44
|
-
exports.default = ViewContainerTitle;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
9
|
-
const util_1 = require("@jbrowse/core/util");
|
|
10
|
-
const product_core_1 = require("@jbrowse/product-core");
|
|
11
|
-
const Add_1 = __importDefault(require("@mui/icons-material/Add"));
|
|
12
|
-
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
13
|
-
const KeyboardArrowRight_1 = __importDefault(require("@mui/icons-material/KeyboardArrowRight"));
|
|
14
|
-
const Minimize_1 = __importDefault(require("@mui/icons-material/Minimize"));
|
|
15
|
-
const material_1 = require("@mui/material");
|
|
16
|
-
const mobx_react_1 = require("mobx-react");
|
|
17
|
-
const mui_1 = require("tss-react/mui");
|
|
18
|
-
const ViewContainerTitle_1 = __importDefault(require("./ViewContainerTitle"));
|
|
19
|
-
const ViewMenu_1 = __importDefault(require("./ViewMenu"));
|
|
20
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
21
|
-
icon: {
|
|
22
|
-
color: theme.palette.secondary.contrastText,
|
|
23
|
-
},
|
|
24
|
-
grow: {
|
|
25
|
-
flexGrow: 1,
|
|
26
|
-
},
|
|
27
|
-
viewHeader: {
|
|
28
|
-
display: 'flex',
|
|
29
|
-
height: ui_1.VIEW_HEADER_HEIGHT,
|
|
30
|
-
top: 0,
|
|
31
|
-
zIndex: 900,
|
|
32
|
-
background: theme.palette.secondary.main,
|
|
33
|
-
},
|
|
34
|
-
viewTitle: {
|
|
35
|
-
display: 'flex',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
},
|
|
38
|
-
}));
|
|
39
|
-
const ViewButtons = (0, mobx_react_1.observer)(function ({ view, onClose, onMinimize, }) {
|
|
40
|
-
const { classes } = useStyles();
|
|
41
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { "data-testid": "minimize_view", onClick: onMinimize, children: view.minimized ? ((0, jsx_runtime_1.jsx)(Add_1.default, { className: classes.icon, fontSize: "small" })) : ((0, jsx_runtime_1.jsx)(Minimize_1.default, { className: classes.icon, fontSize: "small" })) }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { "data-testid": "close_view", onClick: onClose, children: (0, jsx_runtime_1.jsx)(Close_1.default, { className: classes.icon, fontSize: "small" }) })] }));
|
|
42
|
-
});
|
|
43
|
-
const ViewHeader = (0, mobx_react_1.observer)(function ({ view, onClose, onMinimize, className, }) {
|
|
44
|
-
const { classes, cx } = useStyles();
|
|
45
|
-
const scrollRef = (0, react_1.useRef)(null);
|
|
46
|
-
const session = (0, util_1.getSession)(view);
|
|
47
|
-
let stickyViewHeaders = false;
|
|
48
|
-
if ((0, product_core_1.isSessionWithMultipleViews)(session)) {
|
|
49
|
-
;
|
|
50
|
-
({ stickyViewHeaders } = session);
|
|
51
|
-
}
|
|
52
|
-
(0, react_1.useEffect)(() => {
|
|
53
|
-
var _a;
|
|
54
|
-
if (typeof jest === 'undefined') {
|
|
55
|
-
(_a = scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: 'center' });
|
|
56
|
-
}
|
|
57
|
-
}, []);
|
|
58
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: scrollRef, className: cx(classes.viewHeader, className), style: { position: stickyViewHeaders ? 'sticky' : undefined }, children: [(0, jsx_runtime_1.jsx)(ViewMenu_1.default, { model: view, IconProps: { className: classes.icon } }), (0, jsx_runtime_1.jsx)("div", { className: classes.grow }), (0, jsx_runtime_1.jsxs)("div", { className: classes.viewTitle, children: [session.focusedViewId === view.id ? ((0, jsx_runtime_1.jsx)(KeyboardArrowRight_1.default, { className: classes.icon, fontSize: "small" })) : null, (0, jsx_runtime_1.jsx)(ViewContainerTitle_1.default, { view: view })] }), (0, jsx_runtime_1.jsx)("div", { className: classes.grow }), (0, jsx_runtime_1.jsx)(ViewButtons, { onClose: onClose, onMinimize: onMinimize, view: view })] }));
|
|
59
|
-
});
|
|
60
|
-
exports.default = ViewHeader;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SnackbarMessage } from '@jbrowse/core/ui/SnackbarModel';
|
|
2
|
-
import type { SessionWithDrawerWidgets } from '@jbrowse/core/util';
|
|
3
|
-
type AppSession = SessionWithDrawerWidgets & {
|
|
4
|
-
snackbarMessages: SnackbarMessage[];
|
|
5
|
-
renameCurrentSession: (arg: string) => void;
|
|
6
|
-
popSnackbarMessage: () => unknown;
|
|
7
|
-
};
|
|
8
|
-
declare const ViewLauncher: ({ session }: {
|
|
9
|
-
session: AppSession;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default ViewLauncher;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const util_1 = require("@jbrowse/core/util");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
const mui_1 = require("tss-react/mui");
|
|
9
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
10
|
-
selectPaper: {
|
|
11
|
-
padding: theme.spacing(4),
|
|
12
|
-
},
|
|
13
|
-
m2: {
|
|
14
|
-
margin: 2,
|
|
15
|
-
},
|
|
16
|
-
}));
|
|
17
|
-
const ViewLauncher = (0, mobx_react_1.observer)(({ session }) => {
|
|
18
|
-
var _a;
|
|
19
|
-
const { classes } = useStyles();
|
|
20
|
-
const { pluginManager } = (0, util_1.getEnv)(session);
|
|
21
|
-
const viewTypes = pluginManager.getViewElements();
|
|
22
|
-
const [value, setValue] = (0, react_1.useState)(((_a = viewTypes[0]) === null || _a === void 0 ? void 0 : _a.name) || '');
|
|
23
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { className: classes.selectPaper, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Select a view to launch" }), (0, jsx_runtime_1.jsx)(material_1.FormControl, { className: classes.m2, children: (0, jsx_runtime_1.jsx)(material_1.Select, { value: value, onChange: event => {
|
|
24
|
-
setValue(event.target.value);
|
|
25
|
-
}, children: viewTypes
|
|
26
|
-
.filter(({ viewMetadata }) => !viewMetadata.hiddenFromGUI)
|
|
27
|
-
.map(({ displayName, name }) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: name, children: displayName }, name))) }) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, { className: classes.m2, children: (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => session.addView(value, {}), variant: "contained", color: "primary", children: "Launch view" }) })] }));
|
|
28
|
-
});
|
|
29
|
-
exports.default = ViewLauncher;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
2
|
-
import type { IconButtonProps as IconButtonPropsType, SvgIconProps } from '@mui/material';
|
|
3
|
-
declare const ViewMenu: ({ model, IconButtonProps, IconProps, }: {
|
|
4
|
-
model: IBaseViewModel;
|
|
5
|
-
IconButtonProps?: IconButtonPropsType;
|
|
6
|
-
IconProps: SvgIconProps;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default ViewMenu;
|
package/dist/ui/App/ViewMenu.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const CascadingMenu_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenu"));
|
|
8
|
-
const hooks_1 = require("@jbrowse/core/ui/hooks");
|
|
9
|
-
const util_1 = require("@jbrowse/core/util");
|
|
10
|
-
const KeyboardArrowDown_1 = __importDefault(require("@mui/icons-material/KeyboardArrowDown"));
|
|
11
|
-
const KeyboardArrowUp_1 = __importDefault(require("@mui/icons-material/KeyboardArrowUp"));
|
|
12
|
-
const KeyboardDoubleArrowDown_1 = __importDefault(require("@mui/icons-material/KeyboardDoubleArrowDown"));
|
|
13
|
-
const KeyboardDoubleArrowUp_1 = __importDefault(require("@mui/icons-material/KeyboardDoubleArrowUp"));
|
|
14
|
-
const Menu_1 = __importDefault(require("@mui/icons-material/Menu"));
|
|
15
|
-
const material_1 = require("@mui/material");
|
|
16
|
-
const mobx_react_1 = require("mobx-react");
|
|
17
|
-
const ViewMenu = (0, mobx_react_1.observer)(function ({ model, IconButtonProps, IconProps, }) {
|
|
18
|
-
const session = (0, util_1.getSession)(model);
|
|
19
|
-
const popupState = (0, hooks_1.usePopupState)({
|
|
20
|
-
variant: 'popover',
|
|
21
|
-
});
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { ...IconButtonProps, ...(0, hooks_1.bindTrigger)(popupState), "data-testid": "view_menu_icon", children: (0, jsx_runtime_1.jsx)(Menu_1.default, { ...IconProps, fontSize: "small" }) }), (0, jsx_runtime_1.jsx)(CascadingMenu_1.default, { ...(0, hooks_1.bindPopover)(popupState), onMenuItemClick: (_event, callback) => {
|
|
23
|
-
callback();
|
|
24
|
-
}, menuItems: [
|
|
25
|
-
...(session.views.length > 1
|
|
26
|
-
? [
|
|
27
|
-
{
|
|
28
|
-
label: 'View order',
|
|
29
|
-
type: 'subMenu',
|
|
30
|
-
subMenu: [
|
|
31
|
-
...(session.views.length > 2
|
|
32
|
-
? [
|
|
33
|
-
{
|
|
34
|
-
label: 'Move view to top',
|
|
35
|
-
icon: KeyboardDoubleArrowUp_1.default,
|
|
36
|
-
onClick: () => {
|
|
37
|
-
session.moveViewToTop(model.id);
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
]
|
|
41
|
-
: []),
|
|
42
|
-
{
|
|
43
|
-
label: 'Move view up',
|
|
44
|
-
icon: KeyboardArrowUp_1.default,
|
|
45
|
-
onClick: () => {
|
|
46
|
-
session.moveViewUp(model.id);
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
label: 'Move view down',
|
|
51
|
-
icon: KeyboardArrowDown_1.default,
|
|
52
|
-
onClick: () => {
|
|
53
|
-
session.moveViewDown(model.id);
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
...(session.views.length > 2
|
|
57
|
-
? [
|
|
58
|
-
{
|
|
59
|
-
label: 'Move view to bottom',
|
|
60
|
-
icon: KeyboardDoubleArrowDown_1.default,
|
|
61
|
-
onClick: () => {
|
|
62
|
-
session.moveViewToBottom(model.id);
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
]
|
|
66
|
-
: []),
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
]
|
|
70
|
-
: []),
|
|
71
|
-
...model.menuItems(),
|
|
72
|
-
], popupState: popupState })] }));
|
|
73
|
-
});
|
|
74
|
-
exports.default = ViewMenu;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { AbstractViewModel, SessionWithFocusedViewAndDrawerWidgets } from '@jbrowse/core/util';
|
|
2
|
-
declare const ViewWrapper: ({ view, session, }: {
|
|
3
|
-
view: AbstractViewModel;
|
|
4
|
-
session: SessionWithFocusedViewAndDrawerWidgets;
|
|
5
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
-
export default ViewWrapper;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const LoadingEllipses_1 = __importDefault(require("@jbrowse/core/ui/LoadingEllipses"));
|
|
9
|
-
const util_1 = require("@jbrowse/core/util");
|
|
10
|
-
const mobx_react_1 = require("mobx-react");
|
|
11
|
-
const ViewWrapper = (0, mobx_react_1.observer)(function ({ view, session, }) {
|
|
12
|
-
const { pluginManager } = (0, util_1.getEnv)(session);
|
|
13
|
-
const viewType = pluginManager.getViewType(view.type);
|
|
14
|
-
if (!viewType) {
|
|
15
|
-
throw new Error(`unknown view type ${view.type}`);
|
|
16
|
-
}
|
|
17
|
-
const { ReactComponent } = viewType;
|
|
18
|
-
if (view.minimized) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(LoadingEllipses_1.default, { variant: "h6" }), children: (0, jsx_runtime_1.jsx)(ReactComponent, { model: view, session: session }) }));
|
|
22
|
-
});
|
|
23
|
-
exports.default = ViewWrapper;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { SnackbarMessage } from '@jbrowse/core/ui/SnackbarModel';
|
|
2
|
-
import type { SessionWithFocusedViewAndDrawerWidgets } from '@jbrowse/core/util';
|
|
3
|
-
interface Props {
|
|
4
|
-
HeaderButtons?: React.ReactElement;
|
|
5
|
-
session: SessionWithFocusedViewAndDrawerWidgets & {
|
|
6
|
-
renameCurrentSession: (arg: string) => void;
|
|
7
|
-
snackbarMessages: SnackbarMessage[];
|
|
8
|
-
popSnackbarMessage: () => unknown;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
declare const ViewsContainer: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export default ViewsContainer;
|
|
@@ -1,57 +0,0 @@
|
|
|
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 () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
-
const react_1 = require("react");
|
|
41
|
-
const mobx_react_1 = require("mobx-react");
|
|
42
|
-
const mui_1 = require("tss-react/mui");
|
|
43
|
-
const ViewContainer_1 = __importDefault(require("./ViewContainer"));
|
|
44
|
-
const ViewLauncher = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./ViewLauncher'))));
|
|
45
|
-
const useStyles = (0, mui_1.makeStyles)()({
|
|
46
|
-
viewsContainer: {
|
|
47
|
-
overflowY: 'auto',
|
|
48
|
-
gridRow: 'components',
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
const ViewsContainer = (0, mobx_react_1.observer)(function ViewsContainer(props) {
|
|
52
|
-
const { session } = props;
|
|
53
|
-
const { views } = session;
|
|
54
|
-
const { classes } = useStyles();
|
|
55
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.viewsContainer, children: [views.length > 0 ? (views.map(view => ((0, jsx_runtime_1.jsx)(ViewContainer_1.default, { view: view, session: session }, `view-${view.id}`)))) : ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(ViewLauncher, { ...props }) })), (0, jsx_runtime_1.jsx)("div", { style: { height: 300 } })] }));
|
|
56
|
-
});
|
|
57
|
-
exports.default = ViewsContainer;
|
package/dist/ui/App/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './App';
|
package/dist/ui/App/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
package/dist/ui/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './App';
|
package/dist/ui/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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);
|