@jbrowse/app-core 2.10.3 → 2.11.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/App/AppToolbar.d.ts +1 -1
- package/dist/ui/App/DialogQueue.d.ts +1 -1
- package/dist/ui/App/DialogQueue.js +2 -2
- package/dist/ui/App/Drawer.js +3 -3
- package/dist/ui/App/ViewContainer.js +2 -1
- package/dist/ui/App/ViewMenu.d.ts +1 -1
- package/dist/ui/App/ViewMenu.js +44 -26
- package/esm/ui/App/AppToolbar.d.ts +1 -1
- package/esm/ui/App/DialogQueue.d.ts +1 -1
- package/esm/ui/App/DialogQueue.js +2 -2
- package/esm/ui/App/Drawer.js +3 -3
- package/esm/ui/App/ViewContainer.js +2 -1
- package/esm/ui/App/ViewMenu.d.ts +1 -1
- package/esm/ui/App/ViewMenu.js +44 -26
- package/package.json +3 -3
|
@@ -13,7 +13,7 @@ type AppSession = SessionWithDrawerWidgets & {
|
|
|
13
13
|
popSnackbarMessage: () => unknown;
|
|
14
14
|
};
|
|
15
15
|
declare const AppToolbar: ({ session, HeaderButtons, }: {
|
|
16
|
-
HeaderButtons?: React.ReactElement
|
|
16
|
+
HeaderButtons?: React.ReactElement;
|
|
17
17
|
session: AppSession;
|
|
18
18
|
}) => React.JSX.Element;
|
|
19
19
|
export default AppToolbar;
|
|
@@ -27,7 +27,7 @@ const react_1 = __importStar(require("react"));
|
|
|
27
27
|
const mobx_react_1 = require("mobx-react");
|
|
28
28
|
const DialogQueue = (0, mobx_react_1.observer)(function ({ session, }) {
|
|
29
29
|
const { DialogComponent, DialogProps } = session;
|
|
30
|
-
return
|
|
31
|
-
react_1.default.createElement(DialogComponent, { ...DialogProps }))) : null
|
|
30
|
+
return DialogComponent ? (react_1.default.createElement(react_1.Suspense, { fallback: null },
|
|
31
|
+
react_1.default.createElement(DialogComponent, { ...DialogProps }))) : null;
|
|
32
32
|
});
|
|
33
33
|
exports.default = DialogQueue;
|
package/dist/ui/App/Drawer.js
CHANGED
|
@@ -52,11 +52,11 @@ const Drawer = (0, mobx_react_1.observer)(function ({ children, session, }) {
|
|
|
52
52
|
const ref = (0, react_1.useRef)(null);
|
|
53
53
|
(0, react_1.useEffect)(() => {
|
|
54
54
|
function handleSelectView(e) {
|
|
55
|
-
var _a, _b;
|
|
55
|
+
var _a, _b, _c;
|
|
56
56
|
if (e.target instanceof Element) {
|
|
57
|
-
if ((ref === null || ref === void 0 ? void 0 : ref.current)
|
|
57
|
+
if ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
|
|
58
58
|
// @ts-ignore
|
|
59
|
-
const visibleWidgetId = (
|
|
59
|
+
const visibleWidgetId = (_c = (_b = session.visibleWidget) === null || _b === void 0 ? void 0 : _b.view) === null || _c === void 0 ? void 0 : _c.id;
|
|
60
60
|
if (visibleWidgetId) {
|
|
61
61
|
session.setFocusedViewId(visibleWidgetId);
|
|
62
62
|
}
|
|
@@ -53,8 +53,9 @@ const ViewContainer = (0, mobx_react_1.observer)(function ({ view, onClose, onMi
|
|
|
53
53
|
const session = (0, util_1.getSession)(view);
|
|
54
54
|
(0, react_1.useEffect)(() => {
|
|
55
55
|
function handleSelectView(e) {
|
|
56
|
+
var _a;
|
|
56
57
|
if (e.target instanceof Element) {
|
|
57
|
-
if ((ref === null || ref === void 0 ? void 0 : ref.current)
|
|
58
|
+
if ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
|
|
58
59
|
session.setFocusedViewId(view.id);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
@@ -3,7 +3,7 @@ import { SvgIconProps, IconButtonProps as IconButtonPropsType } from '@mui/mater
|
|
|
3
3
|
import { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
4
4
|
declare const ViewMenu: ({ model, IconButtonProps, IconProps, }: {
|
|
5
5
|
model: IBaseViewModel;
|
|
6
|
-
IconButtonProps?: IconButtonPropsType
|
|
6
|
+
IconButtonProps?: IconButtonPropsType;
|
|
7
7
|
IconProps: SvgIconProps;
|
|
8
8
|
}) => React.JSX.Element;
|
|
9
9
|
export default ViewMenu;
|
package/dist/ui/App/ViewMenu.js
CHANGED
|
@@ -11,8 +11,10 @@ const hooks_1 = require("material-ui-popup-state/hooks");
|
|
|
11
11
|
const CascadingMenu_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenu"));
|
|
12
12
|
// icons
|
|
13
13
|
const Menu_1 = __importDefault(require("@mui/icons-material/Menu"));
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const KeyboardDoubleArrowDown_1 = __importDefault(require("@mui/icons-material/KeyboardDoubleArrowDown"));
|
|
15
|
+
const KeyboardDoubleArrowUp_1 = __importDefault(require("@mui/icons-material/KeyboardDoubleArrowUp"));
|
|
16
|
+
const KeyboardArrowDown_1 = __importDefault(require("@mui/icons-material/KeyboardArrowDown"));
|
|
17
|
+
const KeyboardArrowUp_1 = __importDefault(require("@mui/icons-material/KeyboardArrowUp"));
|
|
16
18
|
const ViewMenu = (0, mobx_react_1.observer)(function ({ model, IconButtonProps, IconProps, }) {
|
|
17
19
|
const { menuItems } = model;
|
|
18
20
|
const session = (0, util_1.getSession)(model);
|
|
@@ -20,33 +22,49 @@ const ViewMenu = (0, mobx_react_1.observer)(function ({ model, IconButtonProps,
|
|
|
20
22
|
popupId: 'viewMenu',
|
|
21
23
|
variant: 'popover',
|
|
22
24
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
label: 'Move view up',
|
|
28
|
-
icon: ArrowUpward_1.default,
|
|
29
|
-
onClick: () => session.moveViewUp(model.id),
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: 'Move view down',
|
|
33
|
-
icon: ArrowDownward_1.default,
|
|
34
|
-
onClick: () => session.moveViewDown(model.id),
|
|
35
|
-
},
|
|
36
|
-
]
|
|
37
|
-
: []),
|
|
38
|
-
// <=1.3.3 didn't use a function, so check as value also
|
|
39
|
-
...((typeof menuItems === 'function' ? menuItems() : menuItems) || []),
|
|
40
|
-
];
|
|
41
|
-
// note: This does not use CascadingMenuButton on purpose, because there was a confusing bug related to it!
|
|
42
|
-
// see https://github.com/GMOD/jbrowse-components/issues/4115
|
|
25
|
+
// note: This does not use CascadingMenuButton on purpose, because there was
|
|
26
|
+
// a confusing bug related to it! see
|
|
27
|
+
// https://github.com/GMOD/jbrowse-components/issues/4115
|
|
43
28
|
//
|
|
44
|
-
// Make sure to test the Breakpoint split view menu checkboxes if you
|
|
29
|
+
// Make sure to test the Breakpoint split view menu checkboxes if you
|
|
30
|
+
// intend to change this
|
|
45
31
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
46
32
|
react_1.default.createElement(material_1.IconButton, { ...IconButtonProps, ...(0, hooks_1.bindTrigger)(popupState), "data-testid": "view_menu_icon" },
|
|
47
33
|
react_1.default.createElement(Menu_1.default, { ...IconProps, fontSize: "small" })),
|
|
48
|
-
react_1.default.createElement(CascadingMenu_1.default, { ...(0, hooks_1.bindPopover)(popupState), onMenuItemClick: (_event, callback) =>
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
react_1.default.createElement(CascadingMenu_1.default, { ...(0, hooks_1.bindPopover)(popupState), onMenuItemClick: (_event, callback) => callback(), menuItems: [
|
|
35
|
+
...(session.views.length > 1
|
|
36
|
+
? [
|
|
37
|
+
{
|
|
38
|
+
label: 'View order',
|
|
39
|
+
type: 'subMenu',
|
|
40
|
+
subMenu: [
|
|
41
|
+
{
|
|
42
|
+
label: 'Move view to top',
|
|
43
|
+
icon: KeyboardDoubleArrowUp_1.default,
|
|
44
|
+
onClick: () => session.moveViewToTop(model.id),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Move view up',
|
|
48
|
+
icon: KeyboardArrowUp_1.default,
|
|
49
|
+
onClick: () => session.moveViewUp(model.id),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: 'Move view down',
|
|
53
|
+
icon: KeyboardArrowDown_1.default,
|
|
54
|
+
onClick: () => session.moveViewDown(model.id),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'Move view to bottom',
|
|
58
|
+
icon: KeyboardDoubleArrowDown_1.default,
|
|
59
|
+
onClick: () => session.moveViewToBottom(model.id),
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
: []),
|
|
65
|
+
// <=1.3.3 didn't use a function, so check as value also
|
|
66
|
+
...((typeof menuItems === 'function' ? menuItems() : menuItems) ||
|
|
67
|
+
[]),
|
|
68
|
+
], popupState: popupState })));
|
|
51
69
|
});
|
|
52
70
|
exports.default = ViewMenu;
|
|
@@ -13,7 +13,7 @@ type AppSession = SessionWithDrawerWidgets & {
|
|
|
13
13
|
popSnackbarMessage: () => unknown;
|
|
14
14
|
};
|
|
15
15
|
declare const AppToolbar: ({ session, HeaderButtons, }: {
|
|
16
|
-
HeaderButtons?: React.ReactElement
|
|
16
|
+
HeaderButtons?: React.ReactElement;
|
|
17
17
|
session: AppSession;
|
|
18
18
|
}) => React.JSX.Element;
|
|
19
19
|
export default AppToolbar;
|
|
@@ -2,7 +2,7 @@ import React, { Suspense } from 'react';
|
|
|
2
2
|
import { observer } from 'mobx-react';
|
|
3
3
|
const DialogQueue = observer(function ({ session, }) {
|
|
4
4
|
const { DialogComponent, DialogProps } = session;
|
|
5
|
-
return
|
|
6
|
-
React.createElement(DialogComponent, { ...DialogProps }))) : null
|
|
5
|
+
return DialogComponent ? (React.createElement(Suspense, { fallback: null },
|
|
6
|
+
React.createElement(DialogComponent, { ...DialogProps }))) : null;
|
|
7
7
|
});
|
|
8
8
|
export default DialogQueue;
|
package/esm/ui/App/Drawer.js
CHANGED
|
@@ -24,11 +24,11 @@ const Drawer = observer(function ({ children, session, }) {
|
|
|
24
24
|
const ref = useRef(null);
|
|
25
25
|
useEffect(() => {
|
|
26
26
|
function handleSelectView(e) {
|
|
27
|
-
var _a, _b;
|
|
27
|
+
var _a, _b, _c;
|
|
28
28
|
if (e.target instanceof Element) {
|
|
29
|
-
if ((ref === null || ref === void 0 ? void 0 : ref.current)
|
|
29
|
+
if ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
|
|
30
30
|
// @ts-ignore
|
|
31
|
-
const visibleWidgetId = (
|
|
31
|
+
const visibleWidgetId = (_c = (_b = session.visibleWidget) === null || _b === void 0 ? void 0 : _b.view) === null || _c === void 0 ? void 0 : _c.id;
|
|
32
32
|
if (visibleWidgetId) {
|
|
33
33
|
session.setFocusedViewId(visibleWidgetId);
|
|
34
34
|
}
|
|
@@ -25,8 +25,9 @@ const ViewContainer = observer(function ({ view, onClose, onMinimize, children,
|
|
|
25
25
|
const session = getSession(view);
|
|
26
26
|
useEffect(() => {
|
|
27
27
|
function handleSelectView(e) {
|
|
28
|
+
var _a;
|
|
28
29
|
if (e.target instanceof Element) {
|
|
29
|
-
if ((ref === null || ref === void 0 ? void 0 : ref.current)
|
|
30
|
+
if ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
|
|
30
31
|
session.setFocusedViewId(view.id);
|
|
31
32
|
}
|
|
32
33
|
}
|
package/esm/ui/App/ViewMenu.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { SvgIconProps, IconButtonProps as IconButtonPropsType } from '@mui/mater
|
|
|
3
3
|
import { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
4
4
|
declare const ViewMenu: ({ model, IconButtonProps, IconProps, }: {
|
|
5
5
|
model: IBaseViewModel;
|
|
6
|
-
IconButtonProps?: IconButtonPropsType
|
|
6
|
+
IconButtonProps?: IconButtonPropsType;
|
|
7
7
|
IconProps: SvgIconProps;
|
|
8
8
|
}) => React.JSX.Element;
|
|
9
9
|
export default ViewMenu;
|
package/esm/ui/App/ViewMenu.js
CHANGED
|
@@ -6,8 +6,10 @@ import { bindTrigger, bindPopover, usePopupState, } from 'material-ui-popup-stat
|
|
|
6
6
|
import CascadingMenu from '@jbrowse/core/ui/CascadingMenu';
|
|
7
7
|
// icons
|
|
8
8
|
import MenuIcon from '@mui/icons-material/Menu';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import KeyboardDoubleArrowDownIcon from '@mui/icons-material/KeyboardDoubleArrowDown';
|
|
10
|
+
import KeyboardDoubleArrowUpIcon from '@mui/icons-material/KeyboardDoubleArrowUp';
|
|
11
|
+
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
|
12
|
+
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
|
|
11
13
|
const ViewMenu = observer(function ({ model, IconButtonProps, IconProps, }) {
|
|
12
14
|
const { menuItems } = model;
|
|
13
15
|
const session = getSession(model);
|
|
@@ -15,33 +17,49 @@ const ViewMenu = observer(function ({ model, IconButtonProps, IconProps, }) {
|
|
|
15
17
|
popupId: 'viewMenu',
|
|
16
18
|
variant: 'popover',
|
|
17
19
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
label: 'Move view up',
|
|
23
|
-
icon: ArrowUpward,
|
|
24
|
-
onClick: () => session.moveViewUp(model.id),
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: 'Move view down',
|
|
28
|
-
icon: ArrowDownward,
|
|
29
|
-
onClick: () => session.moveViewDown(model.id),
|
|
30
|
-
},
|
|
31
|
-
]
|
|
32
|
-
: []),
|
|
33
|
-
// <=1.3.3 didn't use a function, so check as value also
|
|
34
|
-
...((typeof menuItems === 'function' ? menuItems() : menuItems) || []),
|
|
35
|
-
];
|
|
36
|
-
// note: This does not use CascadingMenuButton on purpose, because there was a confusing bug related to it!
|
|
37
|
-
// see https://github.com/GMOD/jbrowse-components/issues/4115
|
|
20
|
+
// note: This does not use CascadingMenuButton on purpose, because there was
|
|
21
|
+
// a confusing bug related to it! see
|
|
22
|
+
// https://github.com/GMOD/jbrowse-components/issues/4115
|
|
38
23
|
//
|
|
39
|
-
// Make sure to test the Breakpoint split view menu checkboxes if you
|
|
24
|
+
// Make sure to test the Breakpoint split view menu checkboxes if you
|
|
25
|
+
// intend to change this
|
|
40
26
|
return (React.createElement(React.Fragment, null,
|
|
41
27
|
React.createElement(IconButton, { ...IconButtonProps, ...bindTrigger(popupState), "data-testid": "view_menu_icon" },
|
|
42
28
|
React.createElement(MenuIcon, { ...IconProps, fontSize: "small" })),
|
|
43
|
-
React.createElement(CascadingMenu, { ...bindPopover(popupState), onMenuItemClick: (_event, callback) =>
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
React.createElement(CascadingMenu, { ...bindPopover(popupState), onMenuItemClick: (_event, callback) => callback(), menuItems: [
|
|
30
|
+
...(session.views.length > 1
|
|
31
|
+
? [
|
|
32
|
+
{
|
|
33
|
+
label: 'View order',
|
|
34
|
+
type: 'subMenu',
|
|
35
|
+
subMenu: [
|
|
36
|
+
{
|
|
37
|
+
label: 'Move view to top',
|
|
38
|
+
icon: KeyboardDoubleArrowUpIcon,
|
|
39
|
+
onClick: () => session.moveViewToTop(model.id),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: 'Move view up',
|
|
43
|
+
icon: KeyboardArrowUpIcon,
|
|
44
|
+
onClick: () => session.moveViewUp(model.id),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Move view down',
|
|
48
|
+
icon: KeyboardArrowDownIcon,
|
|
49
|
+
onClick: () => session.moveViewDown(model.id),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: 'Move view to bottom',
|
|
53
|
+
icon: KeyboardDoubleArrowDownIcon,
|
|
54
|
+
onClick: () => session.moveViewToBottom(model.id),
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
]
|
|
59
|
+
: []),
|
|
60
|
+
// <=1.3.3 didn't use a function, so check as value also
|
|
61
|
+
...((typeof menuItems === 'function' ? menuItems() : menuItems) ||
|
|
62
|
+
[]),
|
|
63
|
+
], popupState: popupState })));
|
|
46
64
|
});
|
|
47
65
|
export default ViewMenu;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/app-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "JBrowse 2 code shared between the 'full featured' apps e.g. jbrowse-web and jbrowse-desktop",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/runtime": "^7.16.3",
|
|
45
|
-
"@jbrowse/product-core": "^2.
|
|
45
|
+
"@jbrowse/product-core": "^2.11.0",
|
|
46
46
|
"@mui/icons-material": "^5.0.0",
|
|
47
47
|
"@mui/material": "^5.10.17",
|
|
48
48
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "3d43a820b9274a6160aa4dc15616147f390d9094"
|
|
64
64
|
}
|