@jbrowse/plugin-grid-bookmark 2.17.0 → 2.18.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/GridBookmarkWidget/components/AssemblySelector.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/AssemblySelector.js +1 -2
- package/dist/GridBookmarkWidget/components/BookmarkGrid.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/BookmarkGrid.js +53 -82
- package/dist/GridBookmarkWidget/components/GridBookmarkWidget.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/GridBookmarkWidget.js +9 -12
- package/dist/GridBookmarkWidget/components/Highlight/Highlight.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/Highlight/Highlight.js +14 -11
- package/dist/GridBookmarkWidget/components/Highlight/OverviewHighlight.d.ts +2 -2
- package/dist/GridBookmarkWidget/components/Highlight/OverviewHighlight.js +5 -5
- package/dist/GridBookmarkWidget/components/Highlight/index.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/Highlight/index.js +2 -7
- package/dist/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.js +2 -2
- package/dist/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.js +2 -2
- package/dist/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.d.ts +2 -2
- package/dist/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.js +8 -7
- package/dist/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.js +4 -4
- package/dist/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.js +8 -11
- package/dist/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.js +5 -7
- package/dist/GridBookmarkWidget/index.d.ts +1 -1
- package/dist/GridBookmarkWidget/index.js +1 -2
- package/dist/GridBookmarkWidget/model.d.ts +10 -86
- package/dist/GridBookmarkWidget/model.js +18 -94
- package/dist/GridBookmarkWidget/sessionSharing.d.ts +1 -1
- package/dist/GridBookmarkWidget/sessionSharing.js +3 -9
- package/dist/GridBookmarkWidget/types.d.ts +1 -1
- package/dist/GridBookmarkWidget/utils.d.ts +2 -16
- package/dist/GridBookmarkWidget/utils.js +2 -23
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -29
- package/esm/GridBookmarkWidget/components/AssemblySelector.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/AssemblySelector.js +1 -2
- package/esm/GridBookmarkWidget/components/BookmarkGrid.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/BookmarkGrid.js +53 -59
- package/esm/GridBookmarkWidget/components/GridBookmarkWidget.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/GridBookmarkWidget.js +9 -12
- package/esm/GridBookmarkWidget/components/Highlight/Highlight.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/Highlight/Highlight.js +14 -11
- package/esm/GridBookmarkWidget/components/Highlight/OverviewHighlight.d.ts +2 -2
- package/esm/GridBookmarkWidget/components/Highlight/OverviewHighlight.js +5 -5
- package/esm/GridBookmarkWidget/components/Highlight/index.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/Highlight/index.js +2 -7
- package/esm/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.js +2 -2
- package/esm/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.js +2 -2
- package/esm/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.d.ts +2 -2
- package/esm/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.js +8 -7
- package/esm/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.js +4 -4
- package/esm/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.js +7 -10
- package/esm/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.js +5 -7
- package/esm/GridBookmarkWidget/index.d.ts +1 -1
- package/esm/GridBookmarkWidget/index.js +1 -2
- package/esm/GridBookmarkWidget/model.d.ts +10 -86
- package/esm/GridBookmarkWidget/model.js +18 -94
- package/esm/GridBookmarkWidget/sessionSharing.d.ts +1 -1
- package/esm/GridBookmarkWidget/sessionSharing.js +3 -9
- package/esm/GridBookmarkWidget/types.d.ts +1 -1
- package/esm/GridBookmarkWidget/utils.d.ts +2 -16
- package/esm/GridBookmarkWidget/utils.js +2 -23
- package/esm/index.d.ts +1 -1
- package/esm/index.js +10 -29
- package/package.json +2 -2
- package/dist/GridBookmarkWidget/components/dialogs/EditBookmarkLabelDialog.d.ts +0 -8
- package/dist/GridBookmarkWidget/components/dialogs/EditBookmarkLabelDialog.js +0 -54
- package/esm/GridBookmarkWidget/components/dialogs/EditBookmarkLabelDialog.d.ts +0 -8
- package/esm/GridBookmarkWidget/components/dialogs/EditBookmarkLabelDialog.js +0 -29
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ColorPicker from '@jbrowse/core/ui/ColorPicker';
|
|
3
|
+
import { assembleLocString, getSession, measureGridWidth, measureText, } from '@jbrowse/core/util';
|
|
3
4
|
import { Link } from '@mui/material';
|
|
4
|
-
import { makeStyles } from 'tss-react/mui';
|
|
5
5
|
import { DataGrid, GRID_CHECKBOX_SELECTION_COL_DEF } from '@mui/x-data-grid';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
// locals
|
|
6
|
+
import { observer } from 'mobx-react';
|
|
7
|
+
import { makeStyles } from 'tss-react/mui';
|
|
9
8
|
import { navToBookmark } from '../utils';
|
|
10
|
-
const EditBookmarkLabelDialog = lazy(() => import('./dialogs/EditBookmarkLabelDialog'));
|
|
11
9
|
const useStyles = makeStyles()(() => ({
|
|
12
10
|
cell: {
|
|
13
11
|
whiteSpace: 'nowrap',
|
|
@@ -39,57 +37,53 @@ const BookmarkGrid = observer(function ({ model, }) {
|
|
|
39
37
|
Math.max(measureText('Assembly', 12) + 30, measureGridWidth(rows.map(row => row.assemblyName))),
|
|
40
38
|
100,
|
|
41
39
|
];
|
|
42
|
-
return (React.createElement(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
...rows[value],
|
|
91
|
-
})));
|
|
92
|
-
}
|
|
93
|
-
}, rowSelectionModel: selectedBookmarks.map(r => r.id), disableRowSelectionOnClick: true }));
|
|
40
|
+
return (React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
41
|
+
React.createElement(DataGrid, { density: "compact", rows: rows, columns: [
|
|
42
|
+
{
|
|
43
|
+
...GRID_CHECKBOX_SELECTION_COL_DEF,
|
|
44
|
+
width: widths[0],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
field: 'locString',
|
|
48
|
+
headerName: 'Bookmark link',
|
|
49
|
+
width: widths[1],
|
|
50
|
+
renderCell: ({ value, row }) => (React.createElement(Link, { className: classes.cell, href: "#", onClick: async (event) => {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
const { views } = session;
|
|
53
|
+
await navToBookmark(value, row.assemblyName, views, model);
|
|
54
|
+
} }, value)),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
field: 'label',
|
|
58
|
+
headerName: 'Label',
|
|
59
|
+
width: widths[2],
|
|
60
|
+
editable: true,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
field: 'assemblyName',
|
|
64
|
+
headerName: 'Assembly',
|
|
65
|
+
width: widths[3],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
field: 'highlight',
|
|
69
|
+
headerName: 'Highlight',
|
|
70
|
+
width: widths[4],
|
|
71
|
+
renderCell: ({ value, row }) => (React.createElement(ColorPicker, { color: value || 'black', onChange: event => {
|
|
72
|
+
model.updateBookmarkHighlight(row, event);
|
|
73
|
+
} })),
|
|
74
|
+
},
|
|
75
|
+
], processRowUpdate: row => {
|
|
76
|
+
const target = rows[row.id];
|
|
77
|
+
model.updateBookmarkLabel(target, row.label);
|
|
78
|
+
return row;
|
|
79
|
+
}, onProcessRowUpdateError: e => {
|
|
80
|
+
session.notifyError(`${e}`, e);
|
|
81
|
+
}, checkboxSelection: true, onRowSelectionModelChange: newRowSelectionModel => {
|
|
82
|
+
if (bookmarksWithValidAssemblies.length > 0) {
|
|
83
|
+
model.setSelectedBookmarks(newRowSelectionModel.map(value => ({
|
|
84
|
+
...rows[value],
|
|
85
|
+
})));
|
|
86
|
+
}
|
|
87
|
+
}, rowSelectionModel: selectedBookmarks.map(r => r.id), disableRowSelectionOnClick: true })));
|
|
94
88
|
});
|
|
95
89
|
export default BookmarkGrid;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import React, { lazy } from 'react';
|
|
2
|
-
import { observer } from 'mobx-react';
|
|
3
|
-
import { makeStyles } from 'tss-react/mui';
|
|
4
|
-
import { getSession } from '@jbrowse/core/util';
|
|
5
|
-
import { Alert } from '@mui/material';
|
|
6
2
|
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
import AssemblySelector from './AssemblySelector';
|
|
10
|
-
// icons
|
|
11
|
-
import Menu from '@mui/icons-material/Menu';
|
|
3
|
+
import { getSession } from '@jbrowse/core/util';
|
|
4
|
+
import Delete from '@mui/icons-material/Delete';
|
|
12
5
|
import GetApp from '@mui/icons-material/GetApp';
|
|
6
|
+
import Menu from '@mui/icons-material/Menu';
|
|
7
|
+
import Palette from '@mui/icons-material/Palette';
|
|
13
8
|
import Publish from '@mui/icons-material/Publish';
|
|
14
9
|
import Settings from '@mui/icons-material/Settings';
|
|
15
|
-
import Palette from '@mui/icons-material/Palette';
|
|
16
10
|
import Share from '@mui/icons-material/Share';
|
|
17
|
-
import
|
|
18
|
-
|
|
11
|
+
import { Alert } from '@mui/material';
|
|
12
|
+
import { observer } from 'mobx-react';
|
|
13
|
+
import { makeStyles } from 'tss-react/mui';
|
|
14
|
+
import AssemblySelector from './AssemblySelector';
|
|
15
|
+
import BookmarkGrid from './BookmarkGrid';
|
|
19
16
|
const ExportBookmarksDialog = lazy(() => import('./dialogs/ExportBookmarksDialog'));
|
|
20
17
|
const ImportBookmarksDialog = lazy(() => import('./dialogs/ImportBookmarksDialog'));
|
|
21
18
|
const ShareBookmarksDialog = lazy(() => import('./dialogs/ShareBookmarksDialog'));
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { makeStyles } from 'tss-react/mui';
|
|
2
|
+
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
|
|
4
3
|
import { getSession, notEmpty } from '@jbrowse/core/util';
|
|
5
4
|
import { colord } from '@jbrowse/core/util/colord';
|
|
6
|
-
import { Tooltip } from '@mui/material';
|
|
7
|
-
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
|
|
8
|
-
// icons
|
|
9
5
|
import BookmarkIcon from '@mui/icons-material/Bookmark';
|
|
6
|
+
import { Tooltip } from '@mui/material';
|
|
7
|
+
import { observer } from 'mobx-react';
|
|
8
|
+
import { makeStyles } from 'tss-react/mui';
|
|
10
9
|
const useStyles = makeStyles()({
|
|
11
10
|
bookmarkButton: {
|
|
12
11
|
overflow: 'hidden',
|
|
@@ -23,7 +22,7 @@ const Highlight = observer(function Highlight({ model }) {
|
|
|
23
22
|
const { classes } = useStyles();
|
|
24
23
|
const session = getSession(model);
|
|
25
24
|
const { assemblyManager } = session;
|
|
26
|
-
const {
|
|
25
|
+
const { bookmarkHighlightsVisible, bookmarkLabelsVisible } = model;
|
|
27
26
|
const bookmarkWidget = session.widgets.get('GridBookmark');
|
|
28
27
|
useEffect(() => {
|
|
29
28
|
if (!bookmarkWidget) {
|
|
@@ -31,7 +30,7 @@ const Highlight = observer(function Highlight({ model }) {
|
|
|
31
30
|
}
|
|
32
31
|
}, [session, bookmarkWidget]);
|
|
33
32
|
const set = new Set(model.assemblyNames);
|
|
34
|
-
return
|
|
33
|
+
return bookmarkHighlightsVisible && (bookmarkWidget === null || bookmarkWidget === void 0 ? void 0 : bookmarkWidget.bookmarks)
|
|
35
34
|
? bookmarkWidget.bookmarks
|
|
36
35
|
.filter(value => set.has(value.assemblyName))
|
|
37
36
|
.map(r => {
|
|
@@ -51,15 +50,13 @@ const Highlight = observer(function Highlight({ model }) {
|
|
|
51
50
|
: undefined;
|
|
52
51
|
})
|
|
53
52
|
.filter(notEmpty)
|
|
54
|
-
.map(({ left, width, highlight, label, bookmark }, idx) => (
|
|
55
|
-
/* biome-ignore lint/suspicious/noArrayIndexKey: */
|
|
56
|
-
React.createElement(React.Fragment, { key: `${left}_${width}_${idx}` },
|
|
53
|
+
.map(({ left, width, highlight, label, bookmark }, idx) => (React.createElement(React.Fragment, { key: `${left}_${width}_${idx}` },
|
|
57
54
|
React.createElement("div", { className: classes.highlight, id: "highlight", style: {
|
|
58
55
|
left,
|
|
59
56
|
width,
|
|
60
57
|
background: highlight,
|
|
61
58
|
} }),
|
|
62
|
-
|
|
59
|
+
bookmarkLabelsVisible && width > 20 ? (React.createElement("div", { className: classes.bookmarkButton, style: { left } },
|
|
63
60
|
React.createElement(CascadingMenuButton, { menuItems: [
|
|
64
61
|
{
|
|
65
62
|
label: 'Open bookmark widget',
|
|
@@ -67,6 +64,12 @@ const Highlight = observer(function Highlight({ model }) {
|
|
|
67
64
|
session.showWidget(bookmarkWidget);
|
|
68
65
|
},
|
|
69
66
|
},
|
|
67
|
+
{
|
|
68
|
+
label: 'Turn off highlights',
|
|
69
|
+
onClick: () => {
|
|
70
|
+
bookmarkWidget.setBookmarkHighlightsVisible(false);
|
|
71
|
+
},
|
|
72
|
+
},
|
|
70
73
|
{
|
|
71
74
|
label: 'Remove bookmark',
|
|
72
75
|
onClick: () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { IExtendedLGV } from '../../model';
|
|
3
|
+
import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
4
4
|
type LGV = IExtendedLGV;
|
|
5
5
|
declare const OverviewHighlight: ({ model, overview, }: {
|
|
6
6
|
model: LGV;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import { observer } from 'mobx-react';
|
|
3
|
-
import { makeStyles } from 'tss-react/mui';
|
|
4
2
|
import { getSession, notEmpty } from '@jbrowse/core/util';
|
|
5
3
|
import { Tooltip } from '@mui/material';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
6
|
const useStyles = makeStyles()({
|
|
7
7
|
highlight: {
|
|
8
8
|
height: '100%',
|
|
@@ -14,7 +14,7 @@ const OverviewHighlight = observer(function OverviewHighlight({ model, overview,
|
|
|
14
14
|
const session = getSession(model);
|
|
15
15
|
const { classes } = useStyles();
|
|
16
16
|
const { assemblyManager } = session;
|
|
17
|
-
const {
|
|
17
|
+
const { bookmarkHighlightsVisible, bookmarkLabelsVisible } = model;
|
|
18
18
|
const bookmarkWidget = session.widgets.get('GridBookmark');
|
|
19
19
|
useEffect(() => {
|
|
20
20
|
if (!bookmarkWidget) {
|
|
@@ -22,7 +22,7 @@ const OverviewHighlight = observer(function OverviewHighlight({ model, overview,
|
|
|
22
22
|
}
|
|
23
23
|
}, [session, bookmarkWidget]);
|
|
24
24
|
const assemblyNames = new Set(model.assemblyNames);
|
|
25
|
-
return
|
|
25
|
+
return bookmarkHighlightsVisible && (bookmarkWidget === null || bookmarkWidget === void 0 ? void 0 : bookmarkWidget.bookmarks)
|
|
26
26
|
? bookmarkWidget.bookmarks
|
|
27
27
|
.filter(r => assemblyNames.has(r.assemblyName))
|
|
28
28
|
.map(r => {
|
|
@@ -44,7 +44,7 @@ const OverviewHighlight = observer(function OverviewHighlight({ model, overview,
|
|
|
44
44
|
.filter(notEmpty)
|
|
45
45
|
.map((obj, idx) => {
|
|
46
46
|
const { left, width, highlight, label } = obj;
|
|
47
|
-
return (React.createElement(Tooltip, { key: `${JSON.stringify(obj)}-${idx}`, title:
|
|
47
|
+
return (React.createElement(Tooltip, { key: `${JSON.stringify(obj)}-${idx}`, title: bookmarkLabelsVisible ? label : '', arrow: true },
|
|
48
48
|
React.createElement("div", { className: classes.highlight, style: {
|
|
49
49
|
left,
|
|
50
50
|
width,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function AddHighlightModelF(pluginManager: PluginManager): void;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
// locals
|
|
3
2
|
import Highlight from './Highlight';
|
|
4
3
|
import OverviewHighlight from './OverviewHighlight';
|
|
5
4
|
export default function AddHighlightModelF(pluginManager) {
|
|
6
|
-
pluginManager.addToExtensionPoint('LinearGenomeView-TracksContainerComponent',
|
|
7
|
-
// @ts-expect-error
|
|
8
|
-
(rest, { model }) => {
|
|
5
|
+
pluginManager.addToExtensionPoint('LinearGenomeView-TracksContainerComponent', (rest, { model }) => {
|
|
9
6
|
return [
|
|
10
7
|
...(rest || []),
|
|
11
8
|
React.createElement(Highlight, { key: "highlight_grid_bookmark", model: model }),
|
|
12
9
|
];
|
|
13
10
|
});
|
|
14
|
-
pluginManager.addToExtensionPoint('LinearGenomeView-OverviewScalebarComponent',
|
|
15
|
-
// @ts-expect-error
|
|
16
|
-
(rest, { model, overview }) => {
|
|
11
|
+
pluginManager.addToExtensionPoint('LinearGenomeView-OverviewScalebarComponent', (rest, { model, overview }) => {
|
|
17
12
|
return [
|
|
18
13
|
...(rest || []),
|
|
19
14
|
React.createElement(OverviewHighlight, { key: "overview_highlight_grid_bookmark", model: model, overview: overview }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { observer } from 'mobx-react';
|
|
3
|
-
import { Button, DialogContent, DialogActions, Alert } from '@mui/material';
|
|
4
2
|
import { Dialog } from '@jbrowse/core/ui';
|
|
3
|
+
import { Alert, Button, DialogActions, DialogContent } from '@mui/material';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
5
|
const DeleteBookmarksDialog = observer(function ({ onClose, model, }) {
|
|
6
6
|
const { selectedBookmarks } = model;
|
|
7
7
|
const deleteAll = selectedBookmarks.length === 0;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { observer } from 'mobx-react';
|
|
3
|
-
import { Button, DialogContent, DialogActions, Alert, Typography, } from '@mui/material';
|
|
4
2
|
import { Dialog } from '@jbrowse/core/ui';
|
|
5
3
|
import { ColorPicker } from '@jbrowse/core/ui/ColorPicker';
|
|
4
|
+
import { Alert, Button, DialogActions, DialogContent, Typography, } from '@mui/material';
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
6
6
|
const EditHighlightColorDialog = observer(function ({ onClose, model, }) {
|
|
7
7
|
var _a, _b;
|
|
8
8
|
const { selectedBookmarks } = model;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { GridBookmarkModel } from '../../model';
|
|
2
|
+
import type { GridBookmarkModel } from '../../model';
|
|
3
3
|
declare const ExportBookmarksDialog: ({ model, onClose, }: {
|
|
4
4
|
model: GridBookmarkModel;
|
|
5
|
-
onClose: (
|
|
5
|
+
onClose: () => void;
|
|
6
6
|
}) => React.JSX.Element;
|
|
7
7
|
export default ExportBookmarksDialog;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { observer } from 'mobx-react';
|
|
3
|
-
import { Button, DialogContent, DialogActions, MenuItem, Select, Typography, Alert, } from '@mui/material';
|
|
4
|
-
import { makeStyles } from 'tss-react/mui';
|
|
5
2
|
import { Dialog } from '@jbrowse/core/ui';
|
|
6
|
-
// Icons
|
|
7
3
|
import GetAppIcon from '@mui/icons-material/GetApp';
|
|
4
|
+
import { Alert, Button, DialogActions, DialogContent, MenuItem, Select, Typography, } from '@mui/material';
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
6
|
+
import { makeStyles } from 'tss-react/mui';
|
|
8
7
|
import { downloadBookmarkFile } from '../../utils';
|
|
9
8
|
const useStyles = makeStyles()({
|
|
10
9
|
flexItem: {
|
|
@@ -18,12 +17,14 @@ const useStyles = makeStyles()({
|
|
|
18
17
|
gap: '5px',
|
|
19
18
|
},
|
|
20
19
|
});
|
|
21
|
-
const ExportBookmarksDialog = observer(function
|
|
20
|
+
const ExportBookmarksDialog = observer(function ({ model, onClose, }) {
|
|
22
21
|
const { classes } = useStyles();
|
|
23
22
|
const [fileType, setFileType] = useState('BED');
|
|
24
23
|
const { selectedBookmarks } = model;
|
|
25
24
|
const exportAll = selectedBookmarks.length === 0;
|
|
26
|
-
return (React.createElement(Dialog, { open: true, onClose:
|
|
25
|
+
return (React.createElement(Dialog, { open: true, onClose: () => {
|
|
26
|
+
onClose();
|
|
27
|
+
}, title: "Export bookmarks" },
|
|
27
28
|
React.createElement(DialogContent, { className: classes.container },
|
|
28
29
|
React.createElement(Alert, { severity: "info" }, exportAll ? (React.createElement(React.Fragment, null,
|
|
29
30
|
React.createElement("span", null, "All bookmarks will be exported."),
|
|
@@ -39,7 +40,7 @@ const ExportBookmarksDialog = observer(function ExportBookmarksDialog({ model, o
|
|
|
39
40
|
React.createElement(DialogActions, null,
|
|
40
41
|
React.createElement(Button, { variant: "contained", color: "primary", startIcon: React.createElement(GetAppIcon, null), onClick: () => {
|
|
41
42
|
downloadBookmarkFile(fileType, model);
|
|
42
|
-
onClose(
|
|
43
|
+
onClose();
|
|
43
44
|
} }, "Download"))));
|
|
44
45
|
});
|
|
45
46
|
export default ExportBookmarksDialog;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { observer } from 'mobx-react';
|
|
3
|
-
import { Button, DialogContent, DialogActions, Stack, Typography, Switch, } from '@mui/material';
|
|
4
2
|
import { Dialog } from '@jbrowse/core/ui';
|
|
3
|
+
import { Button, DialogActions, DialogContent, Stack, Switch, Typography, } from '@mui/material';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
5
|
const HighlightSettingsDialog = observer(function ({ onClose, model, }) {
|
|
6
6
|
return (React.createElement(Dialog, { open: true, onClose: onClose, title: "Highlight bookmarks" },
|
|
7
7
|
React.createElement(DialogContent, null,
|
|
8
8
|
React.createElement(Typography, { variant: "h6" }, "Highlight toggles"),
|
|
9
9
|
React.createElement(Stack, { direction: "row", alignItems: "center" },
|
|
10
10
|
React.createElement(Switch, { "data-testid": "toggle_highlight_all_switch", checked: model.areBookmarksHighlightedOnAllOpenViews, onChange: () => {
|
|
11
|
-
model.
|
|
11
|
+
model.setBookmarkHighlightsVisible(!model.areBookmarksHighlightedOnAllOpenViews);
|
|
12
12
|
} }),
|
|
13
13
|
React.createElement(Typography, null, "Toggle bookmark highlights on all open views")),
|
|
14
14
|
React.createElement(Stack, { direction: "row", alignItems: "center" },
|
|
15
15
|
React.createElement(Switch, { "data-testid": "toggle_highlight_label_all_switch", checked: model.areBookmarksHighlightLabelsOnAllOpenViews, onChange: () => {
|
|
16
|
-
model.
|
|
16
|
+
model.setBookmarkLabelsVisible(!model.areBookmarksHighlightLabelsOnAllOpenViews);
|
|
17
17
|
} }),
|
|
18
18
|
React.createElement(Typography, null, "Toggle 'bookmark' icon on LGV tracks"))),
|
|
19
19
|
React.createElement(DialogActions, null,
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AssemblySelector, Dialog, ErrorMessage, FileSelector, } from '@jbrowse/core/ui';
|
|
3
3
|
import { getSession } from '@jbrowse/core/util';
|
|
4
|
-
import { isSessionWithShareURL } from '@jbrowse/core/util/types';
|
|
5
|
-
import { ErrorMessage, FileSelector } from '@jbrowse/core/ui';
|
|
6
|
-
import { Accordion, AccordionSummary, AccordionDetails, Button, DialogContent, DialogActions, TextField, Typography, } from '@mui/material';
|
|
7
4
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
8
|
-
import {
|
|
9
|
-
import { makeStyles } from 'tss-react/mui';
|
|
10
|
-
// icons
|
|
11
|
-
import ImportIcon from '@mui/icons-material/Publish';
|
|
5
|
+
import { isSessionWithShareURL } from '@jbrowse/core/util/types';
|
|
12
6
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
13
|
-
import
|
|
7
|
+
import ImportIcon from '@mui/icons-material/Publish';
|
|
8
|
+
import { Accordion, AccordionDetails, AccordionSummary, Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
|
|
9
|
+
import { observer } from 'mobx-react';
|
|
10
|
+
import { makeStyles } from 'tss-react/mui';
|
|
14
11
|
import { readSessionFromDynamo } from '../../sessionSharing';
|
|
12
|
+
import { fromUrlSafeB64 } from '../../utils';
|
|
15
13
|
const useStyles = makeStyles()(theme => ({
|
|
16
14
|
expandIcon: {
|
|
17
15
|
color: theme.palette.tertiary.contrastText || '#fff',
|
|
@@ -109,7 +107,6 @@ const ImportBookmarksDialog = observer(function ({ onClose, model, }) {
|
|
|
109
107
|
model.importBookmarks(await getBookmarksFromBEDFile(lines, selectedAsm));
|
|
110
108
|
}
|
|
111
109
|
else {
|
|
112
|
-
// TSV
|
|
113
110
|
model.importBookmarks(await getBookmarksFromTSVFile(lines));
|
|
114
111
|
}
|
|
115
112
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
|
|
3
|
+
import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons';
|
|
4
|
+
import { getSession, isSessionWithShareURL } from '@jbrowse/core/util';
|
|
5
|
+
import { Alert, Button, DialogActions, DialogContent, DialogContentText, TextField, Typography, } from '@mui/material';
|
|
6
|
+
import copy from 'copy-to-clipboard';
|
|
2
7
|
import { observer } from 'mobx-react';
|
|
3
8
|
import { getSnapshot } from 'mobx-state-tree';
|
|
4
|
-
import { Alert, Button, DialogActions, DialogContent, DialogContentText, TextField, Typography, } from '@mui/material';
|
|
5
9
|
import { makeStyles } from 'tss-react/mui';
|
|
6
|
-
import copy from 'copy-to-clipboard';
|
|
7
|
-
import { getSession, isSessionWithShareURL } from '@jbrowse/core/util';
|
|
8
|
-
import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
|
|
9
|
-
import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons';
|
|
10
|
-
// locals
|
|
11
10
|
import { shareSessionToDynamo } from '../../sessionSharing';
|
|
12
11
|
const useStyles = makeStyles()(() => ({
|
|
13
12
|
flexItem: {
|
|
@@ -31,7 +30,6 @@ const ShareBookmarksDialog = observer(function ({ onClose, model, }) {
|
|
|
31
30
|
? model.allBookmarksModel
|
|
32
31
|
: model.sharedBookmarksModel;
|
|
33
32
|
useEffect(() => {
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
35
33
|
;
|
|
36
34
|
(async () => {
|
|
37
35
|
try {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function GridBookmarkWidgetF(pluginManager: PluginManager): void;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
3
|
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
4
|
-
// locals
|
|
5
|
-
import stateModelFactory from './model';
|
|
6
4
|
import AddHighlightModelF from './components/Highlight';
|
|
5
|
+
import stateModelFactory from './model';
|
|
7
6
|
const configSchema = ConfigurationSchema('GridBookmarkWidget', {});
|
|
8
7
|
export default function GridBookmarkWidgetF(pluginManager) {
|
|
9
8
|
pluginManager.addWidgetType(() => {
|