@jbrowse/embedded-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.
- package/dist/ui/EmbeddedViewContainer.d.ts +2 -3
- package/dist/ui/EmbeddedViewContainer.js +6 -36
- package/dist/ui/ModalWidget.d.ts +2 -3
- package/dist/ui/ModalWidget.js +7 -33
- package/dist/ui/VersionAboutDialog.d.ts +1 -2
- package/dist/ui/VersionAboutDialog.js +3 -18
- package/dist/ui/ViewMenu.d.ts +3 -4
- package/dist/ui/ViewMenu.js +7 -10
- package/dist/ui/ViewTitle.d.ts +2 -3
- package/dist/ui/ViewTitle.js +29 -28
- package/esm/ui/EmbeddedViewContainer.d.ts +2 -3
- package/esm/ui/EmbeddedViewContainer.js +6 -13
- package/esm/ui/ModalWidget.d.ts +2 -3
- package/esm/ui/ModalWidget.js +7 -10
- package/esm/ui/VersionAboutDialog.d.ts +1 -2
- package/esm/ui/VersionAboutDialog.js +3 -15
- package/esm/ui/ViewMenu.d.ts +3 -4
- package/esm/ui/ViewMenu.js +7 -10
- package/esm/ui/ViewTitle.d.ts +2 -3
- package/esm/ui/ViewTitle.js +12 -21
- package/package.json +4 -4
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
1
|
+
import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
3
2
|
declare const ViewContainerWrapper: ({ view, children, }: {
|
|
4
3
|
view: IBaseViewModel;
|
|
5
4
|
children: React.ReactNode;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default ViewContainerWrapper;
|
|
@@ -1,40 +1,16 @@
|
|
|
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
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const util_1 = require("@jbrowse/core/util");
|
|
30
9
|
const material_1 = require("@mui/material");
|
|
31
|
-
const mui_1 = require("tss-react/mui");
|
|
32
10
|
const mobx_react_1 = require("mobx-react");
|
|
33
|
-
const
|
|
11
|
+
const mui_1 = require("tss-react/mui");
|
|
34
12
|
const ViewTitle_1 = __importDefault(require("./ViewTitle"));
|
|
35
13
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
36
|
-
// avoid parent styles getting into this div
|
|
37
|
-
// https://css-tricks.com/almanac/properties/a/all/
|
|
38
14
|
avoidParentStyle: {
|
|
39
15
|
all: 'initial',
|
|
40
16
|
},
|
|
@@ -50,16 +26,10 @@ const ViewContainer = (0, mobx_react_1.observer)(function ({ view, children, })
|
|
|
50
26
|
const session = (0, util_1.getSession)(view);
|
|
51
27
|
const theme = (0, material_1.useTheme)();
|
|
52
28
|
const ref = (0, util_1.useWidthSetter)(view, theme.spacing(1));
|
|
53
|
-
return (
|
|
54
|
-
session.DialogComponent ? (react_1.default.createElement(react_1.Suspense, { fallback: null },
|
|
55
|
-
react_1.default.createElement(session.DialogComponent, { ...session.DialogProps }))) : null,
|
|
56
|
-
react_1.default.createElement(ViewTitle_1.default, { view: view }),
|
|
57
|
-
react_1.default.createElement(material_1.Paper, null, children)));
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { elevation: 12, ref: ref, className: classes.viewContainer, children: [session.DialogComponent ? ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(session.DialogComponent, { ...session.DialogProps }) })) : null, (0, jsx_runtime_1.jsx)(ViewTitle_1.default, { view: view }), (0, jsx_runtime_1.jsx)(material_1.Paper, { children: children })] }));
|
|
58
30
|
});
|
|
59
31
|
const ViewContainerWrapper = (0, mobx_react_1.observer)(function ({ view, children, }) {
|
|
60
32
|
const { classes } = useStyles();
|
|
61
|
-
return (
|
|
62
|
-
react_1.default.createElement(material_1.ScopedCssBaseline, null,
|
|
63
|
-
react_1.default.createElement(ViewContainer, { view: view }, children))));
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: classes.avoidParentStyle, children: (0, jsx_runtime_1.jsx)(material_1.ScopedCssBaseline, { children: (0, jsx_runtime_1.jsx)(ViewContainer, { view: view, children: children }) }) }));
|
|
64
34
|
});
|
|
65
35
|
exports.default = ViewContainerWrapper;
|
package/dist/ui/ModalWidget.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SessionWithWidgets } from '@jbrowse/core/util';
|
|
1
|
+
import type { SessionWithWidgets } from '@jbrowse/core/util';
|
|
3
2
|
declare const ModalWidget: ({ session, }: {
|
|
4
3
|
session: SessionWithWidgets;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
5
|
export default ModalWidget;
|
package/dist/ui/ModalWidget.js
CHANGED
|
@@ -1,34 +1,12 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const
|
|
27
|
-
const
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
28
5
|
const ui_1 = require("@jbrowse/core/ui");
|
|
29
|
-
const
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
30
7
|
const mobx_react_1 = require("mobx-react");
|
|
31
8
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
9
|
+
const mui_1 = require("tss-react/mui");
|
|
32
10
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
33
11
|
paper: {
|
|
34
12
|
overflow: 'auto',
|
|
@@ -46,15 +24,11 @@ const ModalWidget = (0, mobx_react_1.observer)(function ({ session, }) {
|
|
|
46
24
|
session,
|
|
47
25
|
model: visibleWidget,
|
|
48
26
|
});
|
|
49
|
-
return (
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(ui_1.Dialog, { open: true, onClose: () => {
|
|
50
28
|
session.hideAllWidgets();
|
|
51
|
-
}, maxWidth: "xl", header:
|
|
52
|
-
react_1.default.createElement(material_1.Toolbar, null, HeadingComponent ? (react_1.default.createElement(HeadingComponent, { model: visibleWidget })) : (react_1.default.createElement(material_1.Typography, { variant: "h6" }, heading)))) },
|
|
53
|
-
react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement("div", null, "Loading...") },
|
|
54
|
-
react_1.default.createElement(material_1.Paper, { className: classes.paper },
|
|
55
|
-
react_1.default.createElement(Component, { model: visibleWidget, session: session, overrideDimensions: {
|
|
29
|
+
}, maxWidth: "xl", header: (0, jsx_runtime_1.jsx)(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 })) }) }), children: (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, overrideDimensions: {
|
|
56
30
|
height: (window.innerHeight * 5) / 8,
|
|
57
31
|
width: 800,
|
|
58
|
-
} })))));
|
|
32
|
+
} }) }) }) }));
|
|
59
33
|
});
|
|
60
34
|
exports.default = ModalWidget;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.default = AboutDialog;
|
|
7
|
-
const
|
|
8
|
-
const material_1 = require("@mui/material");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
5
|
const ui_1 = require("@jbrowse/core/ui");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
10
7
|
const mui_1 = require("tss-react/mui");
|
|
11
8
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
12
9
|
content: {
|
|
@@ -15,17 +12,5 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
15
12
|
});
|
|
16
13
|
function AboutDialog({ open, version, onClose, }) {
|
|
17
14
|
const { classes } = useStyles();
|
|
18
|
-
return (
|
|
19
|
-
react_1.default.createElement(material_1.DialogContent, { className: classes.content },
|
|
20
|
-
react_1.default.createElement(material_1.Typography, null, "JBrowse is a GMOD project \u00A9 2019-2021, The Evolutionary Software Foundation"),
|
|
21
|
-
react_1.default.createElement(material_1.Typography, null, "Here are some resources and documentation. Please report the version number above when asking questions. Thanks!"),
|
|
22
|
-
react_1.default.createElement("ul", null,
|
|
23
|
-
react_1.default.createElement("li", null,
|
|
24
|
-
react_1.default.createElement(material_1.Link, { href: "https://github.com/GMOD/jbrowse-components/discussions", target: "_blank", rel: "noopener noreferrer" }, "Question & answer forum")),
|
|
25
|
-
react_1.default.createElement("li", null,
|
|
26
|
-
react_1.default.createElement(material_1.Link, { href: "https://github.com/GMOD/jbrowse-components/issues/new/choose", target: "_blank", rel: "noopener noreferrer" }, "Report a bug")),
|
|
27
|
-
react_1.default.createElement("li", null,
|
|
28
|
-
react_1.default.createElement(material_1.Link, { href: "https://jbrowse.org/jb2/docs/user_guide", target: "_blank", rel: "noopener noreferrer" }, "User guide")),
|
|
29
|
-
react_1.default.createElement("li", null,
|
|
30
|
-
react_1.default.createElement(material_1.Link, { href: "https://jbrowse.org/jb2/docs/", target: "_blank", rel: "noopener noreferrer" }, "Documentation"))))));
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(ui_1.Dialog, { open: open, onClose: onClose, maxWidth: "xl", title: `JBrowse v${version}`, children: (0, jsx_runtime_1.jsxs)(material_1.DialogContent, { className: classes.content, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "JBrowse is a GMOD project \u00A9 2019-2021, The Evolutionary Software Foundation" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Here are some resources and documentation. Please report the version number above when asking questions. Thanks!" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: "https://github.com/GMOD/jbrowse-components/discussions", target: "_blank", rel: "noopener noreferrer", children: "Question & answer forum" }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: "https://github.com/GMOD/jbrowse-components/issues/new/choose", target: "_blank", rel: "noopener noreferrer", children: "Report a bug" }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: "https://jbrowse.org/jb2/docs/user_guide", target: "_blank", rel: "noopener noreferrer", children: "User guide" }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: "https://jbrowse.org/jb2/docs/", target: "_blank", rel: "noopener noreferrer", children: "Documentation" }) })] })] }) }));
|
|
31
16
|
}
|
package/dist/ui/ViewMenu.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IconButtonProps as IconButtonPropsType, SvgIconProps } from '@mui/material';
|
|
3
|
-
import { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
1
|
+
import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
2
|
+
import type { IconButtonProps as IconButtonPropsType, SvgIconProps } from '@mui/material';
|
|
4
3
|
declare const ViewMenu: ({ model, IconButtonProps, IconProps, }: {
|
|
5
4
|
model: IBaseViewModel;
|
|
6
5
|
IconButtonProps: IconButtonPropsType;
|
|
7
6
|
IconProps: SvgIconProps;
|
|
8
|
-
}) =>
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default ViewMenu;
|
package/dist/ui/ViewMenu.js
CHANGED
|
@@ -3,22 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const material_1 = require("@mui/material");
|
|
8
|
-
const Menu_1 = __importDefault(require("@mui/icons-material/Menu"));
|
|
9
|
-
const mobx_react_1 = require("mobx-react");
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
7
|
const ui_1 = require("@jbrowse/core/ui");
|
|
8
|
+
const Menu_1 = __importDefault(require("@mui/icons-material/Menu"));
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
11
10
|
const hooks_1 = require("material-ui-popup-state/hooks");
|
|
11
|
+
const mobx_react_1 = require("mobx-react");
|
|
12
12
|
const ViewMenu = (0, mobx_react_1.observer)(function ({ model, IconButtonProps, IconProps, }) {
|
|
13
13
|
const popupState = (0, hooks_1.usePopupState)({
|
|
14
14
|
popupId: 'viewMenu',
|
|
15
15
|
variant: 'popover',
|
|
16
16
|
});
|
|
17
|
-
return (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
react_1.default.createElement(ui_1.CascadingMenu, { ...(0, hooks_1.bindPopover)(popupState), onMenuItemClick: (_event, callback) => {
|
|
21
|
-
callback();
|
|
22
|
-
}, menuItems: model.menuItems(), popupState: popupState })));
|
|
17
|
+
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 }) }), (0, jsx_runtime_1.jsx)(ui_1.CascadingMenu, { ...(0, hooks_1.bindPopover)(popupState), onMenuItemClick: (_event, callback) => {
|
|
18
|
+
callback();
|
|
19
|
+
}, menuItems: model.menuItems(), popupState: popupState })] }));
|
|
23
20
|
});
|
|
24
21
|
exports.default = ViewMenu;
|
package/dist/ui/ViewTitle.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
1
|
+
import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
3
2
|
declare const ViewTitle: ({ view }: {
|
|
4
3
|
view: IBaseViewModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default ViewTitle;
|
package/dist/ui/ViewTitle.js
CHANGED
|
@@ -15,24 +15,34 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const react_1 = require("react");
|
|
41
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
42
|
+
const util_1 = require("@jbrowse/core/util");
|
|
30
43
|
const material_1 = require("@mui/material");
|
|
31
44
|
const mobx_react_1 = require("mobx-react");
|
|
32
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
33
45
|
const mui_1 = require("tss-react/mui");
|
|
34
|
-
const util_1 = require("@jbrowse/core/util");
|
|
35
|
-
// locals
|
|
36
46
|
const ViewMenu_1 = __importDefault(require("./ViewMenu"));
|
|
37
47
|
const VersionAboutDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./VersionAboutDialog'))));
|
|
38
48
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
@@ -63,22 +73,13 @@ const ViewTitle = (0, mobx_react_1.observer)(({ view }) => {
|
|
|
63
73
|
const { displayName } = view;
|
|
64
74
|
const [dialogOpen, setDialogOpen] = (0, react_1.useState)(false);
|
|
65
75
|
const session = (0, util_1.getSession)(view);
|
|
66
|
-
return (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
react_1.default.createElement(material_1.IconButton, { onClick: () => {
|
|
75
|
-
setDialogOpen(true);
|
|
76
|
-
} },
|
|
77
|
-
react_1.default.createElement("div", { style: { width: 22, height: 22 } },
|
|
78
|
-
react_1.default.createElement(ui_1.Logomark, { variant: "white" }))),
|
|
79
|
-
dialogOpen ? (react_1.default.createElement(react_1.Suspense, { fallback: null },
|
|
80
|
-
react_1.default.createElement(VersionAboutDialog, { open: true, onClose: () => {
|
|
81
|
-
setDialogOpen(false);
|
|
82
|
-
}, version: session.version }))) : null));
|
|
76
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.container, children: [(0, jsx_runtime_1.jsx)(ViewMenu_1.default, { model: view, IconButtonProps: {
|
|
77
|
+
classes: { root: classes.iconRoot },
|
|
78
|
+
edge: 'start',
|
|
79
|
+
}, IconProps: { className: classes.icon } }), (0, jsx_runtime_1.jsx)("div", { className: classes.grow }), displayName ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", className: classes.displayName, children: displayName })) : null, (0, jsx_runtime_1.jsx)("div", { className: classes.grow }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
|
|
80
|
+
setDialogOpen(true);
|
|
81
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: { width: 22, height: 22 }, children: (0, jsx_runtime_1.jsx)(ui_1.Logomark, { variant: "white" }) }) }), dialogOpen ? ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(VersionAboutDialog, { open: true, onClose: () => {
|
|
82
|
+
setDialogOpen(false);
|
|
83
|
+
}, version: session.version }) })) : null] }));
|
|
83
84
|
});
|
|
84
85
|
exports.default = ViewTitle;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
1
|
+
import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
3
2
|
declare const ViewContainerWrapper: ({ view, children, }: {
|
|
4
3
|
view: IBaseViewModel;
|
|
5
4
|
children: React.ReactNode;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default ViewContainerWrapper;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
|
+
import { getSession, useWidthSetter } from '@jbrowse/core/util';
|
|
2
4
|
import { Paper, ScopedCssBaseline, useTheme } from '@mui/material';
|
|
3
|
-
import { makeStyles } from 'tss-react/mui';
|
|
4
5
|
import { observer } from 'mobx-react';
|
|
5
|
-
import {
|
|
6
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
7
|
import ViewTitle from './ViewTitle';
|
|
7
8
|
const useStyles = makeStyles()(theme => ({
|
|
8
|
-
// avoid parent styles getting into this div
|
|
9
|
-
// https://css-tricks.com/almanac/properties/a/all/
|
|
10
9
|
avoidParentStyle: {
|
|
11
10
|
all: 'initial',
|
|
12
11
|
},
|
|
@@ -22,16 +21,10 @@ const ViewContainer = observer(function ({ view, children, }) {
|
|
|
22
21
|
const session = getSession(view);
|
|
23
22
|
const theme = useTheme();
|
|
24
23
|
const ref = useWidthSetter(view, theme.spacing(1));
|
|
25
|
-
return (
|
|
26
|
-
session.DialogComponent ? (React.createElement(Suspense, { fallback: null },
|
|
27
|
-
React.createElement(session.DialogComponent, { ...session.DialogProps }))) : null,
|
|
28
|
-
React.createElement(ViewTitle, { view: view }),
|
|
29
|
-
React.createElement(Paper, null, children)));
|
|
24
|
+
return (_jsxs(Paper, { elevation: 12, ref: ref, className: classes.viewContainer, children: [session.DialogComponent ? (_jsx(Suspense, { fallback: null, children: _jsx(session.DialogComponent, { ...session.DialogProps }) })) : null, _jsx(ViewTitle, { view: view }), _jsx(Paper, { children: children })] }));
|
|
30
25
|
});
|
|
31
26
|
const ViewContainerWrapper = observer(function ({ view, children, }) {
|
|
32
27
|
const { classes } = useStyles();
|
|
33
|
-
return (
|
|
34
|
-
React.createElement(ScopedCssBaseline, null,
|
|
35
|
-
React.createElement(ViewContainer, { view: view }, children))));
|
|
28
|
+
return (_jsx("div", { className: classes.avoidParentStyle, children: _jsx(ScopedCssBaseline, { children: _jsx(ViewContainer, { view: view, children: children }) }) }));
|
|
36
29
|
});
|
|
37
30
|
export default ViewContainerWrapper;
|
package/esm/ui/ModalWidget.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SessionWithWidgets } from '@jbrowse/core/util';
|
|
1
|
+
import type { SessionWithWidgets } from '@jbrowse/core/util';
|
|
3
2
|
declare const ModalWidget: ({ session, }: {
|
|
4
3
|
session: SessionWithWidgets;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
5
|
export default ModalWidget;
|
package/esm/ui/ModalWidget.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
3
|
import { Dialog } from '@jbrowse/core/ui';
|
|
4
|
-
import {
|
|
4
|
+
import { AppBar, Paper, Toolbar, Typography } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
6
|
import { getEnv } from 'mobx-state-tree';
|
|
7
|
+
import { makeStyles } from 'tss-react/mui';
|
|
7
8
|
const useStyles = makeStyles()({
|
|
8
9
|
paper: {
|
|
9
10
|
overflow: 'auto',
|
|
@@ -21,15 +22,11 @@ const ModalWidget = observer(function ({ session, }) {
|
|
|
21
22
|
session,
|
|
22
23
|
model: visibleWidget,
|
|
23
24
|
});
|
|
24
|
-
return (
|
|
25
|
+
return (_jsx(Dialog, { open: true, onClose: () => {
|
|
25
26
|
session.hideAllWidgets();
|
|
26
|
-
}, maxWidth: "xl", header:
|
|
27
|
-
React.createElement(Toolbar, null, HeadingComponent ? (React.createElement(HeadingComponent, { model: visibleWidget })) : (React.createElement(Typography, { variant: "h6" }, heading)))) },
|
|
28
|
-
React.createElement(Suspense, { fallback: React.createElement("div", null, "Loading...") },
|
|
29
|
-
React.createElement(Paper, { className: classes.paper },
|
|
30
|
-
React.createElement(Component, { model: visibleWidget, session: session, overrideDimensions: {
|
|
27
|
+
}, maxWidth: "xl", header: _jsx(AppBar, { position: "static", children: _jsx(Toolbar, { children: HeadingComponent ? (_jsx(HeadingComponent, { model: visibleWidget })) : (_jsx(Typography, { variant: "h6", children: heading })) }) }), children: _jsx(Suspense, { fallback: _jsx("div", { children: "Loading..." }), children: _jsx(Paper, { className: classes.paper, children: _jsx(Component, { model: visibleWidget, session: session, overrideDimensions: {
|
|
31
28
|
height: (window.innerHeight * 5) / 8,
|
|
32
29
|
width: 800,
|
|
33
|
-
} })))));
|
|
30
|
+
} }) }) }) }));
|
|
34
31
|
});
|
|
35
32
|
export default ModalWidget;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DialogContent, Link, Typography } from '@mui/material';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { Dialog } from '@jbrowse/core/ui';
|
|
3
|
+
import { DialogContent, Link, Typography } from '@mui/material';
|
|
4
4
|
import { makeStyles } from 'tss-react/mui';
|
|
5
5
|
const useStyles = makeStyles()({
|
|
6
6
|
content: {
|
|
@@ -9,17 +9,5 @@ const useStyles = makeStyles()({
|
|
|
9
9
|
});
|
|
10
10
|
export default function AboutDialog({ open, version, onClose, }) {
|
|
11
11
|
const { classes } = useStyles();
|
|
12
|
-
return (
|
|
13
|
-
React.createElement(DialogContent, { className: classes.content },
|
|
14
|
-
React.createElement(Typography, null, "JBrowse is a GMOD project \u00A9 2019-2021, The Evolutionary Software Foundation"),
|
|
15
|
-
React.createElement(Typography, null, "Here are some resources and documentation. Please report the version number above when asking questions. Thanks!"),
|
|
16
|
-
React.createElement("ul", null,
|
|
17
|
-
React.createElement("li", null,
|
|
18
|
-
React.createElement(Link, { href: "https://github.com/GMOD/jbrowse-components/discussions", target: "_blank", rel: "noopener noreferrer" }, "Question & answer forum")),
|
|
19
|
-
React.createElement("li", null,
|
|
20
|
-
React.createElement(Link, { href: "https://github.com/GMOD/jbrowse-components/issues/new/choose", target: "_blank", rel: "noopener noreferrer" }, "Report a bug")),
|
|
21
|
-
React.createElement("li", null,
|
|
22
|
-
React.createElement(Link, { href: "https://jbrowse.org/jb2/docs/user_guide", target: "_blank", rel: "noopener noreferrer" }, "User guide")),
|
|
23
|
-
React.createElement("li", null,
|
|
24
|
-
React.createElement(Link, { href: "https://jbrowse.org/jb2/docs/", target: "_blank", rel: "noopener noreferrer" }, "Documentation"))))));
|
|
12
|
+
return (_jsx(Dialog, { open: open, onClose: onClose, maxWidth: "xl", title: `JBrowse v${version}`, children: _jsxs(DialogContent, { className: classes.content, children: [_jsx(Typography, { children: "JBrowse is a GMOD project \u00A9 2019-2021, The Evolutionary Software Foundation" }), _jsx(Typography, { children: "Here are some resources and documentation. Please report the version number above when asking questions. Thanks!" }), _jsxs("ul", { children: [_jsx("li", { children: _jsx(Link, { href: "https://github.com/GMOD/jbrowse-components/discussions", target: "_blank", rel: "noopener noreferrer", children: "Question & answer forum" }) }), _jsx("li", { children: _jsx(Link, { href: "https://github.com/GMOD/jbrowse-components/issues/new/choose", target: "_blank", rel: "noopener noreferrer", children: "Report a bug" }) }), _jsx("li", { children: _jsx(Link, { href: "https://jbrowse.org/jb2/docs/user_guide", target: "_blank", rel: "noopener noreferrer", children: "User guide" }) }), _jsx("li", { children: _jsx(Link, { href: "https://jbrowse.org/jb2/docs/", target: "_blank", rel: "noopener noreferrer", children: "Documentation" }) })] })] }) }));
|
|
25
13
|
}
|
package/esm/ui/ViewMenu.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IconButtonProps as IconButtonPropsType, SvgIconProps } from '@mui/material';
|
|
3
|
-
import { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
1
|
+
import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
2
|
+
import type { IconButtonProps as IconButtonPropsType, SvgIconProps } from '@mui/material';
|
|
4
3
|
declare const ViewMenu: ({ model, IconButtonProps, IconProps, }: {
|
|
5
4
|
model: IBaseViewModel;
|
|
6
5
|
IconButtonProps: IconButtonPropsType;
|
|
7
6
|
IconProps: SvgIconProps;
|
|
8
|
-
}) =>
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default ViewMenu;
|
package/esm/ui/ViewMenu.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CascadingMenu } from '@jbrowse/core/ui';
|
|
3
3
|
import MenuIcon from '@mui/icons-material/Menu';
|
|
4
|
+
import { IconButton } from '@mui/material';
|
|
5
|
+
import { bindPopover, bindTrigger, usePopupState, } from 'material-ui-popup-state/hooks';
|
|
4
6
|
import { observer } from 'mobx-react';
|
|
5
|
-
import { CascadingMenu } from '@jbrowse/core/ui';
|
|
6
|
-
import { bindTrigger, bindPopover, usePopupState, } from 'material-ui-popup-state/hooks';
|
|
7
7
|
const ViewMenu = observer(function ({ model, IconButtonProps, IconProps, }) {
|
|
8
8
|
const popupState = usePopupState({
|
|
9
9
|
popupId: 'viewMenu',
|
|
10
10
|
variant: 'popover',
|
|
11
11
|
});
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
React.createElement(CascadingMenu, { ...bindPopover(popupState), onMenuItemClick: (_event, callback) => {
|
|
16
|
-
callback();
|
|
17
|
-
}, menuItems: model.menuItems(), popupState: popupState })));
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsx(IconButton, { ...IconButtonProps, ...bindTrigger(popupState), "data-testid": "view_menu_icon", children: _jsx(MenuIcon, { ...IconProps }) }), _jsx(CascadingMenu, { ...bindPopover(popupState), onMenuItemClick: (_event, callback) => {
|
|
13
|
+
callback();
|
|
14
|
+
}, menuItems: model.menuItems(), popupState: popupState })] }));
|
|
18
15
|
});
|
|
19
16
|
export default ViewMenu;
|
package/esm/ui/ViewTitle.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
1
|
+
import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
3
2
|
declare const ViewTitle: ({ view }: {
|
|
4
3
|
view: IBaseViewModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default ViewTitle;
|
package/esm/ui/ViewTitle.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, lazy, useState } from 'react';
|
|
3
|
+
import { Logomark } from '@jbrowse/core/ui';
|
|
4
|
+
import { getSession } from '@jbrowse/core/util';
|
|
2
5
|
import { IconButton, Typography, alpha } from '@mui/material';
|
|
3
6
|
import { observer } from 'mobx-react';
|
|
4
|
-
import { Logomark } from '@jbrowse/core/ui';
|
|
5
7
|
import { makeStyles } from 'tss-react/mui';
|
|
6
|
-
import { getSession } from '@jbrowse/core/util';
|
|
7
|
-
// locals
|
|
8
8
|
import ViewMenu from './ViewMenu';
|
|
9
9
|
const VersionAboutDialog = lazy(() => import('./VersionAboutDialog'));
|
|
10
10
|
const useStyles = makeStyles()(theme => ({
|
|
@@ -35,22 +35,13 @@ const ViewTitle = observer(({ view }) => {
|
|
|
35
35
|
const { displayName } = view;
|
|
36
36
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
37
37
|
const session = getSession(view);
|
|
38
|
-
return (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
React.createElement(IconButton, { onClick: () => {
|
|
47
|
-
setDialogOpen(true);
|
|
48
|
-
} },
|
|
49
|
-
React.createElement("div", { style: { width: 22, height: 22 } },
|
|
50
|
-
React.createElement(Logomark, { variant: "white" }))),
|
|
51
|
-
dialogOpen ? (React.createElement(Suspense, { fallback: null },
|
|
52
|
-
React.createElement(VersionAboutDialog, { open: true, onClose: () => {
|
|
53
|
-
setDialogOpen(false);
|
|
54
|
-
}, version: session.version }))) : null));
|
|
38
|
+
return (_jsxs("div", { className: classes.container, children: [_jsx(ViewMenu, { model: view, IconButtonProps: {
|
|
39
|
+
classes: { root: classes.iconRoot },
|
|
40
|
+
edge: 'start',
|
|
41
|
+
}, IconProps: { className: classes.icon } }), _jsx("div", { className: classes.grow }), displayName ? (_jsx(Typography, { variant: "body2", className: classes.displayName, children: displayName })) : null, _jsx("div", { className: classes.grow }), _jsx(IconButton, { onClick: () => {
|
|
42
|
+
setDialogOpen(true);
|
|
43
|
+
}, children: _jsx("div", { style: { width: 22, height: 22 }, children: _jsx(Logomark, { variant: "white" }) }) }), dialogOpen ? (_jsx(Suspense, { fallback: null, children: _jsx(VersionAboutDialog, { open: true, onClose: () => {
|
|
44
|
+
setDialogOpen(false);
|
|
45
|
+
}, version: session.version }) })) : null] }));
|
|
55
46
|
});
|
|
56
47
|
export default ViewTitle;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/embedded-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "JBrowse 2 code shared between embedded products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/runtime": "^7.16.3",
|
|
45
|
-
"@jbrowse/core": "^
|
|
46
|
-
"@jbrowse/product-core": "^
|
|
45
|
+
"@jbrowse/core": "^3.0.0",
|
|
46
|
+
"@jbrowse/product-core": "^3.0.0",
|
|
47
47
|
"@mui/icons-material": "^6.0.0",
|
|
48
48
|
"@mui/material": "^6.0.0",
|
|
49
49
|
"copy-to-clipboard": "^3.3.1"
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "2c6897f1fa732b1db5b094d1dca197e333e95319"
|
|
64
64
|
}
|