@jbrowse/plugin-grid-bookmark 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/GridBookmarkWidget/components/AssemblySelector.d.ts +2 -3
- package/dist/GridBookmarkWidget/components/AssemblySelector.js +10 -25
- package/dist/GridBookmarkWidget/components/BookmarkGrid.d.ts +2 -3
- package/dist/GridBookmarkWidget/components/BookmarkGrid.js +52 -82
- package/dist/GridBookmarkWidget/components/GridBookmarkWidget.d.ts +2 -3
- package/dist/GridBookmarkWidget/components/GridBookmarkWidget.js +90 -93
- package/dist/GridBookmarkWidget/components/Highlight/Highlight.d.ts +2 -3
- package/dist/GridBookmarkWidget/components/Highlight/Highlight.js +34 -58
- package/dist/GridBookmarkWidget/components/Highlight/OverviewHighlight.d.ts +3 -4
- package/dist/GridBookmarkWidget/components/Highlight/OverviewHighlight.js +8 -31
- package/dist/GridBookmarkWidget/components/Highlight/index.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/Highlight/index.js +5 -10
- package/dist/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.d.ts +2 -3
- package/dist/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.js +12 -23
- package/dist/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.d.ts +2 -3
- package/dist/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.js +12 -41
- package/dist/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.d.ts +3 -4
- package/dist/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.js +14 -47
- package/dist/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.d.ts +2 -3
- package/dist/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.js +10 -23
- package/dist/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.d.ts +2 -3
- package/dist/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.js +39 -81
- package/dist/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.d.ts +2 -3
- package/dist/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.js +19 -53
- package/dist/GridBookmarkWidget/index.d.ts +1 -1
- package/dist/GridBookmarkWidget/index.js +18 -9
- 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 +20 -16
- package/dist/GridBookmarkWidget/types.d.ts +1 -1
- package/dist/GridBookmarkWidget/utils.d.ts +2 -16
- package/dist/GridBookmarkWidget/utils.js +19 -30
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -29
- package/esm/GridBookmarkWidget/components/AssemblySelector.d.ts +2 -3
- package/esm/GridBookmarkWidget/components/AssemblySelector.js +10 -22
- package/esm/GridBookmarkWidget/components/BookmarkGrid.d.ts +2 -3
- package/esm/GridBookmarkWidget/components/BookmarkGrid.js +52 -59
- package/esm/GridBookmarkWidget/components/GridBookmarkWidget.d.ts +2 -3
- package/esm/GridBookmarkWidget/components/GridBookmarkWidget.js +73 -86
- package/esm/GridBookmarkWidget/components/Highlight/Highlight.d.ts +2 -3
- package/esm/GridBookmarkWidget/components/Highlight/Highlight.js +34 -35
- package/esm/GridBookmarkWidget/components/Highlight/OverviewHighlight.d.ts +3 -4
- package/esm/GridBookmarkWidget/components/Highlight/OverviewHighlight.js +8 -8
- package/esm/GridBookmarkWidget/components/Highlight/index.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/Highlight/index.js +5 -10
- package/esm/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.d.ts +2 -3
- package/esm/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.js +12 -20
- package/esm/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.d.ts +2 -3
- package/esm/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.js +12 -18
- package/esm/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.d.ts +3 -4
- package/esm/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.js +14 -24
- package/esm/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.d.ts +2 -3
- package/esm/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.js +10 -20
- package/esm/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.d.ts +2 -3
- package/esm/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.js +40 -59
- package/esm/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.d.ts +2 -3
- package/esm/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.js +19 -30
- 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,33 +1,11 @@
|
|
|
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
|
|
28
|
-
const mui_1 = require("tss-react/mui");
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
29
5
|
const util_1 = require("@jbrowse/core/util");
|
|
30
6
|
const material_1 = require("@mui/material");
|
|
7
|
+
const mobx_react_1 = require("mobx-react");
|
|
8
|
+
const mui_1 = require("tss-react/mui");
|
|
31
9
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
32
10
|
highlight: {
|
|
33
11
|
height: '100%',
|
|
@@ -39,7 +17,7 @@ const OverviewHighlight = (0, mobx_react_1.observer)(function OverviewHighlight(
|
|
|
39
17
|
const session = (0, util_1.getSession)(model);
|
|
40
18
|
const { classes } = useStyles();
|
|
41
19
|
const { assemblyManager } = session;
|
|
42
|
-
const {
|
|
20
|
+
const { bookmarkHighlightsVisible, bookmarkLabelsVisible } = model;
|
|
43
21
|
const bookmarkWidget = session.widgets.get('GridBookmark');
|
|
44
22
|
(0, react_1.useEffect)(() => {
|
|
45
23
|
if (!bookmarkWidget) {
|
|
@@ -47,7 +25,7 @@ const OverviewHighlight = (0, mobx_react_1.observer)(function OverviewHighlight(
|
|
|
47
25
|
}
|
|
48
26
|
}, [session, bookmarkWidget]);
|
|
49
27
|
const assemblyNames = new Set(model.assemblyNames);
|
|
50
|
-
return
|
|
28
|
+
return bookmarkHighlightsVisible && (bookmarkWidget === null || bookmarkWidget === void 0 ? void 0 : bookmarkWidget.bookmarks)
|
|
51
29
|
? bookmarkWidget.bookmarks
|
|
52
30
|
.filter(r => assemblyNames.has(r.assemblyName))
|
|
53
31
|
.map(r => {
|
|
@@ -69,14 +47,13 @@ const OverviewHighlight = (0, mobx_react_1.observer)(function OverviewHighlight(
|
|
|
69
47
|
.filter(util_1.notEmpty)
|
|
70
48
|
.map((obj, idx) => {
|
|
71
49
|
const { left, width, highlight, label } = obj;
|
|
72
|
-
return (
|
|
73
|
-
react_1.default.createElement("div", { className: classes.highlight, style: {
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: bookmarkLabelsVisible ? label : '', arrow: true, children: (0, jsx_runtime_1.jsx)("div", { className: classes.highlight, style: {
|
|
74
51
|
left,
|
|
75
52
|
width,
|
|
76
53
|
background: highlight,
|
|
77
54
|
borderLeft: `1px solid ${highlight}`,
|
|
78
55
|
borderRight: `1px solid ${highlight}`,
|
|
79
|
-
} })));
|
|
56
|
+
} }) }, `${JSON.stringify(obj)}-${idx}`));
|
|
80
57
|
})
|
|
81
58
|
: null;
|
|
82
59
|
});
|
|
@@ -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;
|
|
@@ -4,25 +4,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = AddHighlightModelF;
|
|
7
|
-
const
|
|
8
|
-
// locals
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
8
|
const Highlight_1 = __importDefault(require("./Highlight"));
|
|
10
9
|
const OverviewHighlight_1 = __importDefault(require("./OverviewHighlight"));
|
|
11
10
|
function AddHighlightModelF(pluginManager) {
|
|
12
|
-
pluginManager.addToExtensionPoint('LinearGenomeView-TracksContainerComponent',
|
|
13
|
-
// @ts-expect-error
|
|
14
|
-
(rest, { model }) => {
|
|
11
|
+
pluginManager.addToExtensionPoint('LinearGenomeView-TracksContainerComponent', (rest, { model }) => {
|
|
15
12
|
return [
|
|
16
13
|
...(rest || []),
|
|
17
|
-
|
|
14
|
+
(0, jsx_runtime_1.jsx)(Highlight_1.default, { model: model }, "highlight_grid_bookmark"),
|
|
18
15
|
];
|
|
19
16
|
});
|
|
20
|
-
pluginManager.addToExtensionPoint('LinearGenomeView-OverviewScalebarComponent',
|
|
21
|
-
// @ts-expect-error
|
|
22
|
-
(rest, { model, overview }) => {
|
|
17
|
+
pluginManager.addToExtensionPoint('LinearGenomeView-OverviewScalebarComponent', (rest, { model, overview }) => {
|
|
23
18
|
return [
|
|
24
19
|
...(rest || []),
|
|
25
|
-
|
|
20
|
+
(0, jsx_runtime_1.jsx)(OverviewHighlight_1.default, { model: model, overview: overview }, "overview_highlight_grid_bookmark"),
|
|
26
21
|
];
|
|
27
22
|
});
|
|
28
23
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GridBookmarkModel } from '../../model';
|
|
1
|
+
import type { GridBookmarkModel } from '../../model';
|
|
3
2
|
declare const DeleteBookmarksDialog: ({ onClose, model, }: {
|
|
4
3
|
onClose: () => void;
|
|
5
4
|
model: GridBookmarkModel;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default DeleteBookmarksDialog;
|
|
@@ -1,31 +1,20 @@
|
|
|
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
|
-
const
|
|
7
|
-
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
const material_1 = require("@mui/material");
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
4
|
const ui_1 = require("@jbrowse/core/ui");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const mobx_react_1 = require("mobx-react");
|
|
10
7
|
const DeleteBookmarksDialog = (0, mobx_react_1.observer)(function ({ onClose, model, }) {
|
|
11
8
|
const { selectedBookmarks } = model;
|
|
12
9
|
const deleteAll = selectedBookmarks.length === 0;
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} }, "Cancel"),
|
|
23
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", onClick: () => {
|
|
24
|
-
if (deleteAll) {
|
|
25
|
-
model.clearAllBookmarks();
|
|
26
|
-
}
|
|
27
|
-
model.clearSelectedBookmarks();
|
|
28
|
-
onClose();
|
|
29
|
-
} }, "Confirm"))));
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: onClose, title: "Delete bookmarks", children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "warning", children: deleteAll ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { children: "All bookmarks will be deleted." }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("span", { children: "Use the checkboxes to select individual bookmarks to delete." })] })) : ('Only selected bookmarks will be deleted.') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
11
|
+
onClose();
|
|
12
|
+
}, children: "Cancel" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", onClick: () => {
|
|
13
|
+
if (deleteAll) {
|
|
14
|
+
model.clearAllBookmarks();
|
|
15
|
+
}
|
|
16
|
+
model.clearSelectedBookmarks();
|
|
17
|
+
onClose();
|
|
18
|
+
}, children: "Confirm" })] })] }));
|
|
30
19
|
});
|
|
31
20
|
exports.default = DeleteBookmarksDialog;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GridBookmarkModel } from '../../model';
|
|
1
|
+
import type { GridBookmarkModel } from '../../model';
|
|
3
2
|
declare const EditHighlightColorDialog: ({ onClose, model, }: {
|
|
4
3
|
onClose: () => void;
|
|
5
4
|
model: GridBookmarkModel;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default EditHighlightColorDialog;
|
|
@@ -1,52 +1,23 @@
|
|
|
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
|
|
28
|
-
const material_1 = require("@mui/material");
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
29
5
|
const ui_1 = require("@jbrowse/core/ui");
|
|
30
6
|
const ColorPicker_1 = require("@jbrowse/core/ui/ColorPicker");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const mobx_react_1 = require("mobx-react");
|
|
31
9
|
const EditHighlightColorDialog = (0, mobx_react_1.observer)(function ({ onClose, model, }) {
|
|
32
10
|
var _a, _b;
|
|
33
11
|
const { selectedBookmarks } = model;
|
|
34
12
|
const editNone = selectedBookmarks.length === 0;
|
|
35
13
|
const [color, setColor] = (0, react_1.useState)((_b = (_a = selectedBookmarks[0]) === null || _a === void 0 ? void 0 : _a.highlight) !== null && _b !== void 0 ? _b : 'rgba(247, 129, 192, 0.35)');
|
|
36
|
-
return (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
45
|
-
onClose();
|
|
46
|
-
} }, "Cancel"),
|
|
47
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", onClick: () => {
|
|
48
|
-
model.updateBulkBookmarkHighlights(color);
|
|
49
|
-
onClose();
|
|
50
|
-
} }, "Confirm"))));
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: onClose, title: "Highlight bookmarks", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", children: "Bulk highlight selector" }), (0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "info", children: editNone ? ((0, jsx_runtime_1.jsx)("span", { children: "Use the checkboxes to select individual bookmarks to edit." })) : ('Only selected bookmarks will be edited.') }), !editNone ? ((0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { color: color, onChange: event => {
|
|
15
|
+
setColor(event);
|
|
16
|
+
} })) : null] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
17
|
+
onClose();
|
|
18
|
+
}, children: "Cancel" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", onClick: () => {
|
|
19
|
+
model.updateBulkBookmarkHighlights(color);
|
|
20
|
+
onClose();
|
|
21
|
+
}, children: "Confirm" })] })] }));
|
|
51
22
|
});
|
|
52
23
|
exports.default = EditHighlightColorDialog;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GridBookmarkModel } from '../../model';
|
|
1
|
+
import type { GridBookmarkModel } from '../../model';
|
|
3
2
|
declare const ExportBookmarksDialog: ({ model, onClose, }: {
|
|
4
3
|
model: GridBookmarkModel;
|
|
5
|
-
onClose: (
|
|
6
|
-
}) =>
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default ExportBookmarksDialog;
|
|
@@ -1,38 +1,15 @@
|
|
|
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
|
|
30
|
-
const
|
|
31
|
-
const material_1 = require("@mui/material");
|
|
32
|
-
const mui_1 = require("tss-react/mui");
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
33
8
|
const ui_1 = require("@jbrowse/core/ui");
|
|
34
|
-
// Icons
|
|
35
9
|
const GetApp_1 = __importDefault(require("@mui/icons-material/GetApp"));
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const mobx_react_1 = require("mobx-react");
|
|
12
|
+
const mui_1 = require("tss-react/mui");
|
|
36
13
|
const utils_1 = require("../../utils");
|
|
37
14
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
38
15
|
flexItem: {
|
|
@@ -46,28 +23,18 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
46
23
|
gap: '5px',
|
|
47
24
|
},
|
|
48
25
|
});
|
|
49
|
-
const ExportBookmarksDialog = (0, mobx_react_1.observer)(function
|
|
26
|
+
const ExportBookmarksDialog = (0, mobx_react_1.observer)(function ({ model, onClose, }) {
|
|
50
27
|
const { classes } = useStyles();
|
|
51
28
|
const [fileType, setFileType] = (0, react_1.useState)('BED');
|
|
52
29
|
const { selectedBookmarks } = model;
|
|
53
30
|
const exportAll = selectedBookmarks.length === 0;
|
|
54
|
-
return (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
react_1.default.createElement(material_1.Select, { size: "small", value: fileType, onChange: event => {
|
|
63
|
-
setFileType(event.target.value);
|
|
64
|
-
} },
|
|
65
|
-
react_1.default.createElement(material_1.MenuItem, { value: "BED" }, "BED"),
|
|
66
|
-
react_1.default.createElement(material_1.MenuItem, { value: "TSV" }, "TSV")))),
|
|
67
|
-
react_1.default.createElement(material_1.DialogActions, null,
|
|
68
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", startIcon: react_1.default.createElement(GetApp_1.default, null), onClick: () => {
|
|
69
|
-
(0, utils_1.downloadBookmarkFile)(fileType, model);
|
|
70
|
-
onClose(false);
|
|
71
|
-
} }, "Download"))));
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: () => {
|
|
32
|
+
onClose();
|
|
33
|
+
}, title: "Export bookmarks", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { className: classes.container, children: [(0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "info", children: exportAll ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { children: "All bookmarks will be exported." }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("span", { children: "Use the checkboxes to select individual bookmarks to export." })] })) : ('Only selected bookmarks will be exported.') }), (0, jsx_runtime_1.jsxs)("div", { className: classes.flexItem, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Format to download:" }), (0, jsx_runtime_1.jsxs)(material_1.Select, { size: "small", value: fileType, onChange: event => {
|
|
34
|
+
setFileType(event.target.value);
|
|
35
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "BED", children: "BED" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "TSV", children: "TSV" })] })] })] }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", startIcon: (0, jsx_runtime_1.jsx)(GetApp_1.default, {}), onClick: () => {
|
|
36
|
+
(0, utils_1.downloadBookmarkFile)(fileType, model);
|
|
37
|
+
onClose();
|
|
38
|
+
}, children: "Download" }) })] }));
|
|
72
39
|
});
|
|
73
40
|
exports.default = ExportBookmarksDialog;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GridBookmarkModel } from '../../model';
|
|
1
|
+
import type { GridBookmarkModel } from '../../model';
|
|
3
2
|
declare const HighlightSettingsDialog: ({ onClose, model, }: {
|
|
4
3
|
onClose: () => void;
|
|
5
4
|
model: GridBookmarkModel;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default HighlightSettingsDialog;
|
|
@@ -1,29 +1,16 @@
|
|
|
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
|
-
const
|
|
7
|
-
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
const material_1 = require("@mui/material");
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
4
|
const ui_1 = require("@jbrowse/core/ui");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const mobx_react_1 = require("mobx-react");
|
|
10
7
|
const HighlightSettingsDialog = (0, mobx_react_1.observer)(function ({ onClose, model, }) {
|
|
11
|
-
return (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} })
|
|
18
|
-
react_1.default.createElement(material_1.Typography, null, "Toggle bookmark highlights on all open views")),
|
|
19
|
-
react_1.default.createElement(material_1.Stack, { direction: "row", alignItems: "center" },
|
|
20
|
-
react_1.default.createElement(material_1.Switch, { "data-testid": "toggle_highlight_label_all_switch", checked: model.areBookmarksHighlightLabelsOnAllOpenViews, onChange: () => {
|
|
21
|
-
model.setLabelToggle(!model.areBookmarksHighlightLabelsOnAllOpenViews);
|
|
22
|
-
} }),
|
|
23
|
-
react_1.default.createElement(material_1.Typography, null, "Toggle 'bookmark' icon on LGV tracks"))),
|
|
24
|
-
react_1.default.createElement(material_1.DialogActions, null,
|
|
25
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", onClick: () => {
|
|
26
|
-
onClose();
|
|
27
|
-
} }, "Close"))));
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: onClose, title: "Highlight bookmarks", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", children: "Highlight toggles" }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { "data-testid": "toggle_highlight_all_switch", checked: model.areBookmarksHighlightedOnAllOpenViews, onChange: () => {
|
|
9
|
+
model.setBookmarkHighlightsVisible(!model.areBookmarksHighlightedOnAllOpenViews);
|
|
10
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Toggle bookmark highlights on all open views" })] }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { "data-testid": "toggle_highlight_label_all_switch", checked: model.areBookmarksHighlightLabelsOnAllOpenViews, onChange: () => {
|
|
11
|
+
model.setBookmarkLabelsVisible(!model.areBookmarksHighlightLabelsOnAllOpenViews);
|
|
12
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Toggle 'bookmark' icon on LGV tracks" })] })] }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", onClick: () => {
|
|
13
|
+
onClose();
|
|
14
|
+
}, children: "Close" }) })] }));
|
|
28
15
|
});
|
|
29
16
|
exports.default = HighlightSettingsDialog;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GridBookmarkModel } from '../../model';
|
|
1
|
+
import type { GridBookmarkModel } from '../../model';
|
|
3
2
|
declare const ImportBookmarksDialog: ({ onClose, model, }: {
|
|
4
3
|
onClose: () => void;
|
|
5
4
|
model: GridBookmarkModel;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default ImportBookmarksDialog;
|
|
@@ -1,45 +1,21 @@
|
|
|
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
|
|
30
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
31
9
|
const util_1 = require("@jbrowse/core/util");
|
|
10
|
+
const io_1 = require("@jbrowse/core/util/io");
|
|
32
11
|
const types_1 = require("@jbrowse/core/util/types");
|
|
33
|
-
const
|
|
12
|
+
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
13
|
+
const Publish_1 = __importDefault(require("@mui/icons-material/Publish"));
|
|
34
14
|
const material_1 = require("@mui/material");
|
|
35
|
-
const
|
|
36
|
-
const ui_2 = require("@jbrowse/core/ui");
|
|
15
|
+
const mobx_react_1 = require("mobx-react");
|
|
37
16
|
const mui_1 = require("tss-react/mui");
|
|
38
|
-
// icons
|
|
39
|
-
const Publish_1 = __importDefault(require("@mui/icons-material/Publish"));
|
|
40
|
-
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
41
|
-
const utils_1 = require("../../utils");
|
|
42
17
|
const sessionSharing_1 = require("../../sessionSharing");
|
|
18
|
+
const utils_1 = require("../../utils");
|
|
43
19
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
44
20
|
expandIcon: {
|
|
45
21
|
color: theme.palette.tertiary.contrastText || '#fff',
|
|
@@ -102,56 +78,38 @@ const ImportBookmarksDialog = (0, mobx_react_1.observer)(function ({ onClose, mo
|
|
|
102
78
|
const { assemblyNames } = session;
|
|
103
79
|
const [selectedAsm, setSelectedAsm] = (0, react_1.useState)(assemblyNames[0]);
|
|
104
80
|
const [expanded, setExpanded] = (0, react_1.useState)('shareLinkAccordion');
|
|
105
|
-
return (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (expanded === 'fileAccordion' && location) {
|
|
133
|
-
const data = await (0, io_1.openLocation)(location).readFile('utf8');
|
|
134
|
-
const lines = data.split(/\n|\r\n|\r/).filter(f => !!f.trim());
|
|
135
|
-
const fileType = guessFileType(lines[0]);
|
|
136
|
-
if (fileType === 'BED') {
|
|
137
|
-
model.importBookmarks(await getBookmarksFromBEDFile(lines, selectedAsm));
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: onClose, maxWidth: "xl", title: "Import bookmarks", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { className: classes.minWidth, children: [(0, jsx_runtime_1.jsxs)(material_1.Accordion, { expanded: expanded === 'shareLinkAccordion', onChange: () => {
|
|
82
|
+
setExpanded('shareLinkAccordion');
|
|
83
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, { expandIcon: (0, jsx_runtime_1.jsx)(ExpandMore_1.default, { className: classes.expandIcon }), children: (0, jsx_runtime_1.jsx)(material_1.Typography, { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: "Import from share link" }) }), (0, jsx_runtime_1.jsxs)(material_1.AccordionDetails, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Paste a bookmark share link generated by the 'Share' button from the bookmarks widget" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Enter Share URL", variant: "outlined", fullWidth: true, value: shareLink, onChange: e => {
|
|
84
|
+
setShareLink(e.target.value);
|
|
85
|
+
} })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Accordion, { expanded: expanded === 'fileAccordion', onChange: () => {
|
|
86
|
+
setExpanded('fileAccordion');
|
|
87
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, { expandIcon: (0, jsx_runtime_1.jsx)(ExpandMore_1.default, { className: classes.expandIcon }), children: (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Import from file" }) }), (0, jsx_runtime_1.jsxs)(material_1.AccordionDetails, { children: [(0, jsx_runtime_1.jsx)(ui_1.FileSelector, { location: location, setLocation: setLocation, name: "File", description: `Choose a BED or TSV format file to import. Required TSV column headers are "chrom, start, end, label, assembly_name".` }), (0, jsx_runtime_1.jsx)(ui_1.AssemblySelector, { onChange: val => {
|
|
88
|
+
setSelectedAsm(val);
|
|
89
|
+
}, helperText: 'Select the assembly for BED file.', session: session, selected: selectedAsm })] })] }), error ? (0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error }) : null] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: onClose, children: "Cancel" }), (0, jsx_runtime_1.jsx)(material_1.Button, { "data-testid": "dialogImport", variant: "contained", color: "primary", disabled: !location && !shareLink, startIcon: (0, jsx_runtime_1.jsx)(Publish_1.default, {}), onClick: async () => {
|
|
90
|
+
try {
|
|
91
|
+
if (expanded === 'fileAccordion' && location) {
|
|
92
|
+
const data = await (0, io_1.openLocation)(location).readFile('utf8');
|
|
93
|
+
const lines = data.split(/\n|\r\n|\r/).filter(f => !!f.trim());
|
|
94
|
+
const fileType = guessFileType(lines[0]);
|
|
95
|
+
if (fileType === 'BED') {
|
|
96
|
+
model.importBookmarks(await getBookmarksFromBEDFile(lines, selectedAsm));
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
model.importBookmarks(await getBookmarksFromTSVFile(lines));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else if (expanded === 'shareLinkAccordion' &&
|
|
103
|
+
shareLink &&
|
|
104
|
+
(0, types_1.isSessionWithShareURL)(session)) {
|
|
105
|
+
model.importBookmarks(await getBookmarksFromShareLink(shareLink, session.shareURL));
|
|
106
|
+
}
|
|
107
|
+
onClose();
|
|
138
108
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
109
|
+
catch (e) {
|
|
110
|
+
console.error(e);
|
|
111
|
+
setError(e);
|
|
142
112
|
}
|
|
143
|
-
}
|
|
144
|
-
else if (expanded === 'shareLinkAccordion' &&
|
|
145
|
-
shareLink &&
|
|
146
|
-
(0, types_1.isSessionWithShareURL)(session)) {
|
|
147
|
-
model.importBookmarks(await getBookmarksFromShareLink(shareLink, session.shareURL));
|
|
148
|
-
}
|
|
149
|
-
onClose();
|
|
150
|
-
}
|
|
151
|
-
catch (e) {
|
|
152
|
-
console.error(e);
|
|
153
|
-
setError(e);
|
|
154
|
-
}
|
|
155
|
-
} }, "Import"))));
|
|
113
|
+
}, children: "Import" })] })] }));
|
|
156
114
|
});
|
|
157
115
|
exports.default = ImportBookmarksDialog;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GridBookmarkModel } from '../../model';
|
|
1
|
+
import type { GridBookmarkModel } from '../../model';
|
|
3
2
|
declare const ShareBookmarksDialog: ({ onClose, model, }: {
|
|
4
3
|
onClose: () => void;
|
|
5
4
|
model: GridBookmarkModel;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default ShareBookmarksDialog;
|