@jbrowse/embedded-core 3.7.0 → 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/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { default as ModalWidget } from './ui/ModalWidget';
2
- export { default as EmbeddedViewContainer } from './ui/EmbeddedViewContainer';
1
+ export { default as ModalWidget } from './ui/ModalWidget.tsx';
2
+ export { default as EmbeddedViewContainer } from './ui/EmbeddedViewContainer.tsx';
package/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default as ModalWidget } from './ui/ModalWidget';
2
- export { default as EmbeddedViewContainer } from './ui/EmbeddedViewContainer';
1
+ export { default as ModalWidget } from "./ui/ModalWidget.js";
2
+ export { default as EmbeddedViewContainer } from "./ui/EmbeddedViewContainer.js";
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Suspense } from 'react';
3
3
  import { getSession, useWidthSetter } from '@jbrowse/core/util';
4
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
4
5
  import { Paper, ScopedCssBaseline, useTheme } from '@mui/material';
5
6
  import { observer } from 'mobx-react';
6
- import { makeStyles } from 'tss-react/mui';
7
- import ViewTitle from './ViewTitle';
7
+ import ViewTitle from "./ViewTitle.js";
8
8
  const useStyles = makeStyles()(theme => ({
9
9
  avoidParentStyle: {
10
10
  all: 'initial',
@@ -16,14 +16,14 @@ const useStyles = makeStyles()(theme => ({
16
16
  padding: `0 ${theme.spacing(1)} ${theme.spacing(1)}`,
17
17
  },
18
18
  }));
19
- const ViewContainer = observer(function ({ view, children, }) {
19
+ const ViewContainer = observer(function ViewContainer({ view, children, }) {
20
20
  const { classes } = useStyles();
21
21
  const session = getSession(view);
22
22
  const theme = useTheme();
23
23
  const ref = useWidthSetter(view, theme.spacing(1));
24
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 })] }));
25
25
  });
26
- const ViewContainerWrapper = observer(function ({ view, children, }) {
26
+ const ViewContainerWrapper = observer(function ViewContainerWrapper({ view, children, }) {
27
27
  const { classes } = useStyles();
28
28
  return (_jsx("div", { className: classes.avoidParentStyle, children: _jsx(ScopedCssBaseline, { children: _jsx(ViewContainer, { view: view, children: children }) }) }));
29
29
  });
@@ -1,16 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Suspense } from 'react';
3
3
  import { Dialog } from '@jbrowse/core/ui';
4
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
5
+ import { getEnv } from '@jbrowse/mobx-state-tree';
4
6
  import { AppBar, Paper, Toolbar, Typography } from '@mui/material';
5
7
  import { observer } from 'mobx-react';
6
- import { getEnv } from 'mobx-state-tree';
7
- import { makeStyles } from 'tss-react/mui';
8
8
  const useStyles = makeStyles()({
9
9
  paper: {
10
10
  overflow: 'auto',
11
11
  },
12
12
  });
13
- const ModalWidget = observer(function ({ session, }) {
13
+ const ModalWidget = observer(function ModalWidget({ session, }) {
14
14
  const { classes } = useStyles();
15
15
  const { visibleWidget } = session;
16
16
  const { pluginManager } = getEnv(session);
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Dialog, ExternalLink } from '@jbrowse/core/ui';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
3
4
  import { DialogContent, Typography } from '@mui/material';
4
- import { makeStyles } from 'tss-react/mui';
5
5
  const useStyles = makeStyles()({
6
6
  content: {
7
7
  minWidth: 800,
@@ -1,8 +1,8 @@
1
1
  import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
2
- import type { IconButtonProps as IconButtonPropsType, SvgIconProps } from '@mui/material';
2
+ import type { IconButtonProps, SvgIconProps } from '@mui/material';
3
3
  declare const ViewMenu: ({ model, IconButtonProps, IconProps, }: {
4
4
  model: IBaseViewModel;
5
- IconButtonProps: IconButtonPropsType;
6
- IconProps: SvgIconProps;
5
+ IconButtonProps?: IconButtonProps;
6
+ IconProps?: SvgIconProps;
7
7
  }) => import("react/jsx-runtime").JSX.Element;
8
8
  export default ViewMenu;
@@ -1,15 +1,8 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { CascadingMenu } from '@jbrowse/core/ui';
3
- import { bindPopover, bindTrigger, usePopupState } from '@jbrowse/core/ui/hooks';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CascadingMenuButton } from '@jbrowse/core/ui';
4
3
  import MenuIcon from '@mui/icons-material/Menu';
5
- import { IconButton } from '@mui/material';
6
4
  import { observer } from 'mobx-react';
7
- const ViewMenu = observer(function ({ model, IconButtonProps, IconProps, }) {
8
- const popupState = usePopupState({
9
- variant: 'popover',
10
- });
11
- 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) => {
12
- callback();
13
- }, menuItems: model.menuItems(), popupState: popupState })] }));
5
+ const ViewMenu = observer(function ViewMenu({ model, IconButtonProps, IconProps, }) {
6
+ return (_jsx(CascadingMenuButton, { menuItems: () => model.menuItems(), "data-testid": "view_menu_icon", ...IconButtonProps, children: _jsx(MenuIcon, { ...IconProps }) }));
14
7
  });
15
8
  export default ViewMenu;
@@ -1,5 +1,5 @@
1
1
  import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
2
- declare const ViewTitle: ({ view }: {
2
+ declare const ViewTitle: ({ view, }: {
3
3
  view: IBaseViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
5
5
  export default ViewTitle;
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Suspense, lazy, useState } from 'react';
3
3
  import { Logomark } from '@jbrowse/core/ui';
4
4
  import { getSession } from '@jbrowse/core/util';
5
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
5
6
  import { IconButton, Typography, alpha } from '@mui/material';
6
7
  import { observer } from 'mobx-react';
7
- import { makeStyles } from 'tss-react/mui';
8
- import ViewMenu from './ViewMenu';
9
- const VersionAboutDialog = lazy(() => import('./VersionAboutDialog'));
8
+ import ViewMenu from "./ViewMenu.js";
9
+ const VersionAboutDialog = lazy(() => import("./VersionAboutDialog.js"));
10
10
  const useStyles = makeStyles()(theme => ({
11
11
  icon: {
12
12
  color: theme.palette.secondary.contrastText,
@@ -30,7 +30,7 @@ const useStyles = makeStyles()(theme => ({
30
30
  },
31
31
  },
32
32
  }));
33
- const ViewTitle = observer(({ view }) => {
33
+ const ViewTitle = observer(function ViewTitle({ view, }) {
34
34
  const { classes } = useStyles();
35
35
  const { displayName } = view;
36
36
  const [dialogOpen, setDialogOpen] = useState(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/embedded-core",
3
- "version": "3.7.0",
3
+ "version": "4.0.0",
4
4
  "description": "JBrowse 2 code shared between embedded products",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -18,40 +18,17 @@
18
18
  "directory": "packages/embedded-core"
19
19
  },
20
20
  "author": "JBrowse Team",
21
- "distMain": "dist/index.js",
22
- "distModule": "esm/index.js",
23
- "srcMain": "src/index.ts",
24
- "srcModule": "src/index.ts",
25
- "main": "dist/index.js",
26
- "module": "esm/index.js",
21
+ "main": "esm/index.js",
27
22
  "files": [
28
- "dist",
29
23
  "esm"
30
24
  ],
31
- "scripts": {
32
- "build:esm": "tsc --build tsconfig.build.esm.json",
33
- "build:commonjs": "tsc --build tsconfig.build.commonjs.json",
34
- "build": "npm run build:esm && npm run build:commonjs",
35
- "test": "cd ../..; jest --passWithNoTests packages/embedded-core",
36
- "clean": "rimraf dist esm *.tsbuildinfo",
37
- "prebuild": "yarn clean",
38
- "prepack": "yarn build && yarn useDist",
39
- "postpack": "yarn useSrc",
40
- "useDist": "node ../../scripts/useDist.js",
41
- "useSrc": "node ../../scripts/useSrc.js"
42
- },
43
25
  "dependencies": {
44
- "@babel/runtime": "^7.16.3",
45
- "@jbrowse/core": "^3.7.0",
46
- "@jbrowse/product-core": "^3.7.0",
47
- "@mui/icons-material": "^7.0.0",
48
- "@mui/material": "^7.0.0",
49
- "copy-to-clipboard": "^3.3.1",
50
- "mobx": "^6.0.0",
51
- "mobx-react": "^9.0.0",
52
- "mobx-state-tree": "^5.0.0",
53
- "rxjs": "^7.0.0",
54
- "tss-react": "^4.0.0"
26
+ "@jbrowse/mobx-state-tree": "^5.5.0",
27
+ "@mui/icons-material": "^7.3.6",
28
+ "@mui/material": "^7.3.6",
29
+ "mobx": "^6.15.0",
30
+ "mobx-react": "^9.2.1",
31
+ "@jbrowse/core": "^4.0.0"
55
32
  },
56
33
  "peerDependencies": {
57
34
  "react": ">=18.0.0",
@@ -60,5 +37,19 @@
60
37
  "publishConfig": {
61
38
  "access": "public"
62
39
  },
63
- "gitHead": "85bdd0d58286b7adbfd408146b15847676317635"
64
- }
40
+ "sideEffects": false,
41
+ "scripts": {
42
+ "build:esm": "tsc -p tsconfig.build.esm.json",
43
+ "build": "pnpm build:esm",
44
+ "test": "cd ../..; jest --passWithNoTests packages/embedded-core",
45
+ "clean": "rimraf esm *.tsbuildinfo",
46
+ "prebuild": "pnpm clean"
47
+ },
48
+ "types": "esm/index.d.ts",
49
+ "exports": {
50
+ ".": {
51
+ "types": "./esm/index.d.ts",
52
+ "import": "./esm/index.js"
53
+ }
54
+ }
55
+ }
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { default as ModalWidget } from './ui/ModalWidget';
2
- export { default as EmbeddedViewContainer } from './ui/EmbeddedViewContainer';
package/dist/index.js DELETED
@@ -1,10 +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
- exports.EmbeddedViewContainer = exports.ModalWidget = void 0;
7
- var ModalWidget_1 = require("./ui/ModalWidget");
8
- Object.defineProperty(exports, "ModalWidget", { enumerable: true, get: function () { return __importDefault(ModalWidget_1).default; } });
9
- var EmbeddedViewContainer_1 = require("./ui/EmbeddedViewContainer");
10
- Object.defineProperty(exports, "EmbeddedViewContainer", { enumerable: true, get: function () { return __importDefault(EmbeddedViewContainer_1).default; } });
@@ -1,6 +0,0 @@
1
- import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
2
- declare const ViewContainerWrapper: ({ view, children, }: {
3
- view: IBaseViewModel;
4
- children: React.ReactNode;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default ViewContainerWrapper;
@@ -1,35 +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 ViewTitle_1 = __importDefault(require("./ViewTitle"));
13
- const useStyles = (0, mui_1.makeStyles)()(theme => ({
14
- avoidParentStyle: {
15
- all: 'initial',
16
- },
17
- viewContainer: {
18
- overflow: 'hidden',
19
- background: theme.palette.secondary.main,
20
- margin: theme.spacing(0.5),
21
- padding: `0 ${theme.spacing(1)} ${theme.spacing(1)}`,
22
- },
23
- }));
24
- const ViewContainer = (0, mobx_react_1.observer)(function ({ view, children, }) {
25
- const { classes } = useStyles();
26
- const session = (0, util_1.getSession)(view);
27
- const theme = (0, material_1.useTheme)();
28
- const ref = (0, util_1.useWidthSetter)(view, theme.spacing(1));
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 })] }));
30
- });
31
- const ViewContainerWrapper = (0, mobx_react_1.observer)(function ({ view, children, }) {
32
- const { classes } = useStyles();
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 }) }) }));
34
- });
35
- exports.default = ViewContainerWrapper;
@@ -1,5 +0,0 @@
1
- import type { SessionWithWidgets } from '@jbrowse/core/util';
2
- declare const ModalWidget: ({ session, }: {
3
- session: SessionWithWidgets;
4
- }) => import("react/jsx-runtime").JSX.Element | null;
5
- export default ModalWidget;
@@ -1,34 +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 ui_1 = require("@jbrowse/core/ui");
6
- const material_1 = require("@mui/material");
7
- const mobx_react_1 = require("mobx-react");
8
- const mobx_state_tree_1 = require("mobx-state-tree");
9
- const mui_1 = require("tss-react/mui");
10
- const useStyles = (0, mui_1.makeStyles)()({
11
- paper: {
12
- overflow: 'auto',
13
- },
14
- });
15
- const ModalWidget = (0, mobx_react_1.observer)(function ({ session, }) {
16
- const { classes } = useStyles();
17
- const { visibleWidget } = session;
18
- const { pluginManager } = (0, mobx_state_tree_1.getEnv)(session);
19
- if (!visibleWidget) {
20
- return null;
21
- }
22
- const { ReactComponent, HeadingComponent, heading } = pluginManager.getWidgetType(visibleWidget.type);
23
- const Component = pluginManager.evaluateExtensionPoint('Core-replaceWidget', ReactComponent, {
24
- session,
25
- model: visibleWidget,
26
- });
27
- return ((0, jsx_runtime_1.jsx)(ui_1.Dialog, { open: true, onClose: () => {
28
- session.hideAllWidgets();
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: {
30
- height: (window.innerHeight * 5) / 8,
31
- width: 800,
32
- } }) }) }) }));
33
- });
34
- exports.default = ModalWidget;
@@ -1,5 +0,0 @@
1
- export default function AboutDialog({ open, version, onClose, }: {
2
- open: boolean;
3
- version: string;
4
- onClose: () => void;
5
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = AboutDialog;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const ui_1 = require("@jbrowse/core/ui");
6
- const material_1 = require("@mui/material");
7
- const mui_1 = require("tss-react/mui");
8
- const useStyles = (0, mui_1.makeStyles)()({
9
- content: {
10
- minWidth: 800,
11
- },
12
- });
13
- function AboutDialog({ open, version, onClose, }) {
14
- const { classes } = useStyles();
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)(ui_1.ExternalLink, { href: "https://github.com/GMOD/jbrowse-components/discussions", children: "Question & answer forum" }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_1.ExternalLink, { href: "https://github.com/GMOD/jbrowse-components/issues/new/choose", children: "Report a bug" }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_1.ExternalLink, { href: "https://jbrowse.org/jb2/docs/user_guide", children: "User guide" }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_1.ExternalLink, { href: "https://jbrowse.org/jb2/docs/", children: "Documentation" }) })] })] }) }));
16
- }
@@ -1,8 +0,0 @@
1
- import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
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;
@@ -1,20 +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 ui_1 = require("@jbrowse/core/ui");
8
- const hooks_1 = require("@jbrowse/core/ui/hooks");
9
- const Menu_1 = __importDefault(require("@mui/icons-material/Menu"));
10
- const material_1 = require("@mui/material");
11
- const mobx_react_1 = require("mobx-react");
12
- const ViewMenu = (0, mobx_react_1.observer)(function ({ model, IconButtonProps, IconProps, }) {
13
- const popupState = (0, hooks_1.usePopupState)({
14
- variant: 'popover',
15
- });
16
- 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) => {
17
- callback();
18
- }, menuItems: model.menuItems(), popupState: popupState })] }));
19
- });
20
- exports.default = ViewMenu;
@@ -1,5 +0,0 @@
1
- import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
2
- declare const ViewTitle: ({ view }: {
3
- view: IBaseViewModel;
4
- }) => import("react/jsx-runtime").JSX.Element;
5
- export default ViewTitle;
@@ -1,85 +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 ui_1 = require("@jbrowse/core/ui");
42
- const util_1 = require("@jbrowse/core/util");
43
- const material_1 = require("@mui/material");
44
- const mobx_react_1 = require("mobx-react");
45
- const mui_1 = require("tss-react/mui");
46
- const ViewMenu_1 = __importDefault(require("./ViewMenu"));
47
- const VersionAboutDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./VersionAboutDialog'))));
48
- const useStyles = (0, mui_1.makeStyles)()(theme => ({
49
- icon: {
50
- color: theme.palette.secondary.contrastText,
51
- },
52
- displayName: {
53
- marginTop: 2,
54
- color: theme.palette.secondary.contrastText,
55
- },
56
- grow: {
57
- flexGrow: 1,
58
- },
59
- container: {
60
- display: 'flex',
61
- },
62
- iconRoot: {
63
- '&:hover': {
64
- backgroundColor: (0, material_1.alpha)(theme.palette.secondary.contrastText, theme.palette.action.hoverOpacity),
65
- '@media (hover: none)': {
66
- backgroundColor: 'transparent',
67
- },
68
- },
69
- },
70
- }));
71
- const ViewTitle = (0, mobx_react_1.observer)(({ view }) => {
72
- const { classes } = useStyles();
73
- const { displayName } = view;
74
- const [dialogOpen, setDialogOpen] = (0, react_1.useState)(false);
75
- const session = (0, util_1.getSession)(view);
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] }));
84
- });
85
- exports.default = ViewTitle;