@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,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GridBookmarkModel } from '../model';
|
|
1
|
+
import type { GridBookmarkModel } from '../model';
|
|
3
2
|
declare const AssemblySelector: ({ model, }: {
|
|
4
3
|
model: GridBookmarkModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default AssemblySelector;
|
|
@@ -1,11 +1,8 @@
|
|
|
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");
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
4
|
const material_1 = require("@mui/material");
|
|
5
|
+
const mobx_react_1 = require("mobx-react");
|
|
9
6
|
const AssemblySelector = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
10
7
|
const { validAssemblies, selectedAssemblies } = model;
|
|
11
8
|
const noAssemblies = validAssemblies.size === 0;
|
|
@@ -13,25 +10,13 @@ const AssemblySelector = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
13
10
|
const id = 'select-assemblies-label';
|
|
14
11
|
const selectedSet = new Set(selectedAssemblies);
|
|
15
12
|
const isAllSelected = [...validAssemblies].every(e => selectedSet.has(e));
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
model.setSelectedAssemblies([]);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
model.setSelectedAssemblies(undefined);
|
|
28
|
-
}
|
|
29
|
-
event.preventDefault();
|
|
30
|
-
} },
|
|
31
|
-
react_1.default.createElement(material_1.Checkbox, { checked: isAllSelected, indeterminate: !isAllSelected && selectedAssemblies.length > 0 }),
|
|
32
|
-
react_1.default.createElement(material_1.ListItemText, { primary: "Select all" })),
|
|
33
|
-
[...validAssemblies].map(name => (react_1.default.createElement(material_1.MenuItem, { key: name, value: name },
|
|
34
|
-
react_1.default.createElement(material_1.Checkbox, { checked: selectedAssemblies.includes(name) }),
|
|
35
|
-
react_1.default.createElement(material_1.ListItemText, { primary: name })))))));
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { disabled: noAssemblies, fullWidth: true, children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { id: id, children: label }), (0, jsx_runtime_1.jsxs)(material_1.Select, { labelId: id, multiple: true, value: selectedAssemblies, onChange: event => {
|
|
14
|
+
model.setSelectedAssemblies(typeof event.target.value === 'string'
|
|
15
|
+
? [event.target.value]
|
|
16
|
+
: event.target.value);
|
|
17
|
+
}, input: (0, jsx_runtime_1.jsx)(material_1.OutlinedInput, { label: label }), renderValue: selected => selected.join(', '), children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, { onClickCapture: event => {
|
|
18
|
+
model.setSelectedAssemblies(isAllSelected ? [] : undefined);
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: isAllSelected, indeterminate: !isAllSelected && selectedAssemblies.length > 0 }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: "Select all" })] }), [...validAssemblies].map(name => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { value: name, children: [(0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: selectedAssemblies.includes(name) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: name })] }, name)))] })] }));
|
|
36
21
|
});
|
|
37
22
|
exports.default = AssemblySelector;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GridBookmarkModel } from '../model';
|
|
1
|
+
import type { GridBookmarkModel } from '../model';
|
|
3
2
|
declare const BookmarkGrid: ({ model, }: {
|
|
4
3
|
model: GridBookmarkModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default BookmarkGrid;
|
|
@@ -1,41 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const
|
|
30
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const ColorPicker_1 = __importDefault(require("@jbrowse/core/ui/ColorPicker"));
|
|
8
|
+
const util_1 = require("@jbrowse/core/util");
|
|
31
9
|
const material_1 = require("@mui/material");
|
|
32
|
-
const mui_1 = require("tss-react/mui");
|
|
33
10
|
const x_data_grid_1 = require("@mui/x-data-grid");
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
// locals
|
|
11
|
+
const mobx_react_1 = require("mobx-react");
|
|
12
|
+
const mui_1 = require("tss-react/mui");
|
|
37
13
|
const utils_1 = require("../utils");
|
|
38
|
-
const EditBookmarkLabelDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./dialogs/EditBookmarkLabelDialog'))));
|
|
39
14
|
const useStyles = (0, mui_1.makeStyles)()(() => ({
|
|
40
15
|
cell: {
|
|
41
16
|
whiteSpace: 'nowrap',
|
|
@@ -67,57 +42,52 @@ const BookmarkGrid = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
67
42
|
Math.max((0, util_1.measureText)('Assembly', 12) + 30, (0, util_1.measureGridWidth)(rows.map(row => row.assemblyName))),
|
|
68
43
|
100,
|
|
69
44
|
];
|
|
70
|
-
return (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
model.setSelectedBookmarks(newRowSelectionModel.map(value => ({
|
|
118
|
-
...rows[value],
|
|
119
|
-
})));
|
|
120
|
-
}
|
|
121
|
-
}, rowSelectionModel: selectedBookmarks.map(r => r.id), disableRowSelectionOnClick: true }));
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'column' }, children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { density: "compact", rows: rows, columns: [
|
|
46
|
+
{
|
|
47
|
+
...x_data_grid_1.GRID_CHECKBOX_SELECTION_COL_DEF,
|
|
48
|
+
width: widths[0],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
field: 'locString',
|
|
52
|
+
headerName: 'Bookmark link',
|
|
53
|
+
width: widths[1],
|
|
54
|
+
renderCell: ({ value, row }) => ((0, jsx_runtime_1.jsx)(material_1.Link, { className: classes.cell, href: "#", onClick: async (event) => {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
const { views } = session;
|
|
57
|
+
await (0, utils_1.navToBookmark)(value, row.assemblyName, views, model);
|
|
58
|
+
}, children: value })),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
field: 'label',
|
|
62
|
+
headerName: 'Label',
|
|
63
|
+
width: widths[2],
|
|
64
|
+
editable: true,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
field: 'assemblyName',
|
|
68
|
+
headerName: 'Assembly',
|
|
69
|
+
width: widths[3],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
field: 'highlight',
|
|
73
|
+
headerName: 'Highlight',
|
|
74
|
+
width: widths[4],
|
|
75
|
+
renderCell: ({ value, row }) => ((0, jsx_runtime_1.jsx)(ColorPicker_1.default, { color: value || 'black', onChange: event => {
|
|
76
|
+
model.updateBookmarkHighlight(row, event);
|
|
77
|
+
} })),
|
|
78
|
+
},
|
|
79
|
+
], processRowUpdate: row => {
|
|
80
|
+
const target = rows[row.id];
|
|
81
|
+
model.updateBookmarkLabel(target, row.label);
|
|
82
|
+
return row;
|
|
83
|
+
}, onProcessRowUpdateError: e => {
|
|
84
|
+
session.notifyError(`${e}`, e);
|
|
85
|
+
}, checkboxSelection: true, onRowSelectionModelChange: newRowSelectionModel => {
|
|
86
|
+
if (bookmarksWithValidAssemblies.length > 0) {
|
|
87
|
+
model.setSelectedBookmarks(newRowSelectionModel.map(value => ({
|
|
88
|
+
...rows[value],
|
|
89
|
+
})));
|
|
90
|
+
}
|
|
91
|
+
}, rowSelectionModel: selectedBookmarks.map(r => r.id), disableRowSelectionOnClick: true }) }));
|
|
122
92
|
});
|
|
123
93
|
exports.default = BookmarkGrid;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GridBookmarkModel } from '../model';
|
|
1
|
+
import type { GridBookmarkModel } from '../model';
|
|
3
2
|
declare const GridBookmarkWidget: ({ model, }: {
|
|
4
3
|
model: GridBookmarkModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default GridBookmarkWidget;
|
|
@@ -15,35 +15,43 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const mui_1 = require("tss-react/mui");
|
|
32
|
-
const util_1 = require("@jbrowse/core/util");
|
|
33
|
-
const material_1 = require("@mui/material");
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const react_1 = require("react");
|
|
34
41
|
const CascadingMenuButton_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenuButton"));
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
const AssemblySelector_1 = __importDefault(require("./AssemblySelector"));
|
|
38
|
-
// icons
|
|
39
|
-
const Menu_1 = __importDefault(require("@mui/icons-material/Menu"));
|
|
42
|
+
const util_1 = require("@jbrowse/core/util");
|
|
43
|
+
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
40
44
|
const GetApp_1 = __importDefault(require("@mui/icons-material/GetApp"));
|
|
45
|
+
const Menu_1 = __importDefault(require("@mui/icons-material/Menu"));
|
|
46
|
+
const Palette_1 = __importDefault(require("@mui/icons-material/Palette"));
|
|
41
47
|
const Publish_1 = __importDefault(require("@mui/icons-material/Publish"));
|
|
42
48
|
const Settings_1 = __importDefault(require("@mui/icons-material/Settings"));
|
|
43
|
-
const Palette_1 = __importDefault(require("@mui/icons-material/Palette"));
|
|
44
49
|
const Share_1 = __importDefault(require("@mui/icons-material/Share"));
|
|
45
|
-
const
|
|
46
|
-
|
|
50
|
+
const material_1 = require("@mui/material");
|
|
51
|
+
const mobx_react_1 = require("mobx-react");
|
|
52
|
+
const mui_1 = require("tss-react/mui");
|
|
53
|
+
const AssemblySelector_1 = __importDefault(require("./AssemblySelector"));
|
|
54
|
+
const BookmarkGrid_1 = __importDefault(require("./BookmarkGrid"));
|
|
47
55
|
const ExportBookmarksDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./dialogs/ExportBookmarksDialog'))));
|
|
48
56
|
const ImportBookmarksDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./dialogs/ImportBookmarksDialog'))));
|
|
49
57
|
const ShareBookmarksDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./dialogs/ShareBookmarksDialog'))));
|
|
@@ -57,78 +65,67 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
57
65
|
});
|
|
58
66
|
const GridBookmarkWidget = (0, mobx_react_1.observer)(function GridBookmarkWidget({ model, }) {
|
|
59
67
|
const { classes } = useStyles();
|
|
60
|
-
return (
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
onClick: () => {
|
|
123
|
-
(0, util_1.getSession)(model).queueDialog(onClose => [
|
|
124
|
-
HighlightSettingsDialog,
|
|
125
|
-
{ model, onClose },
|
|
126
|
-
]);
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
] },
|
|
130
|
-
react_1.default.createElement(Menu_1.default, null)),
|
|
131
|
-
react_1.default.createElement(AssemblySelector_1.default, { model: model })),
|
|
132
|
-
react_1.default.createElement(BookmarkGrid_1.default, { model: model })));
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)(material_1.Alert, { severity: "info", children: ["Click and type within the ", (0, jsx_runtime_1.jsx)("strong", { children: "label" }), " field to annotate your bookmark. Double click the ", (0, jsx_runtime_1.jsx)("strong", { children: "label" }), " field to do so within a dialog."] }), (0, jsx_runtime_1.jsxs)("div", { className: classes.flex, children: [(0, jsx_runtime_1.jsx)(CascadingMenuButton_1.default, { "data-testid": "grid_bookmark_menu", menuItems: [
|
|
69
|
+
{
|
|
70
|
+
label: 'Export',
|
|
71
|
+
icon: GetApp_1.default,
|
|
72
|
+
onClick: () => {
|
|
73
|
+
(0, util_1.getSession)(model).queueDialog(onClose => [
|
|
74
|
+
ExportBookmarksDialog,
|
|
75
|
+
{ onClose, model },
|
|
76
|
+
]);
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: 'Import',
|
|
81
|
+
icon: Publish_1.default,
|
|
82
|
+
onClick: () => {
|
|
83
|
+
(0, util_1.getSession)(model).queueDialog(onClose => [
|
|
84
|
+
ImportBookmarksDialog,
|
|
85
|
+
{ model, onClose },
|
|
86
|
+
]);
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: 'Delete',
|
|
91
|
+
icon: Delete_1.default,
|
|
92
|
+
onClick: () => {
|
|
93
|
+
(0, util_1.getSession)(model).queueDialog(onClose => [
|
|
94
|
+
DeleteBookmarksDialog,
|
|
95
|
+
{ model, onClose },
|
|
96
|
+
]);
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: 'Share',
|
|
101
|
+
icon: Share_1.default,
|
|
102
|
+
onClick: () => {
|
|
103
|
+
(0, util_1.getSession)(model).queueDialog(onClose => [
|
|
104
|
+
ShareBookmarksDialog,
|
|
105
|
+
{ model, onClose },
|
|
106
|
+
]);
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
label: 'Edit colors',
|
|
111
|
+
icon: Palette_1.default,
|
|
112
|
+
onClick: () => {
|
|
113
|
+
(0, util_1.getSession)(model).queueDialog(onClose => [
|
|
114
|
+
EditHighlightColorDialog,
|
|
115
|
+
{ model, onClose },
|
|
116
|
+
]);
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: 'Settings',
|
|
121
|
+
icon: Settings_1.default,
|
|
122
|
+
onClick: () => {
|
|
123
|
+
(0, util_1.getSession)(model).queueDialog(onClose => [
|
|
124
|
+
HighlightSettingsDialog,
|
|
125
|
+
{ model, onClose },
|
|
126
|
+
]);
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
], children: (0, jsx_runtime_1.jsx)(Menu_1.default, {}) }), (0, jsx_runtime_1.jsx)(AssemblySelector_1.default, { model: model })] }), (0, jsx_runtime_1.jsx)(BookmarkGrid_1.default, { model: model })] }));
|
|
133
130
|
});
|
|
134
131
|
exports.default = GridBookmarkWidget;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IExtendedLGV } from '../../model';
|
|
1
|
+
import type { IExtendedLGV } from '../../model';
|
|
3
2
|
type LGV = IExtendedLGV;
|
|
4
3
|
declare const Highlight: ({ model }: {
|
|
5
4
|
model: LGV;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element[] | null;
|
|
7
6
|
export default Highlight;
|
|
@@ -1,40 +1,17 @@
|
|
|
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
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const CascadingMenuButton_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenuButton"));
|
|
32
9
|
const util_1 = require("@jbrowse/core/util");
|
|
33
10
|
const colord_1 = require("@jbrowse/core/util/colord");
|
|
34
|
-
const material_1 = require("@mui/material");
|
|
35
|
-
const CascadingMenuButton_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenuButton"));
|
|
36
|
-
// icons
|
|
37
11
|
const Bookmark_1 = __importDefault(require("@mui/icons-material/Bookmark"));
|
|
12
|
+
const material_1 = require("@mui/material");
|
|
13
|
+
const mobx_react_1 = require("mobx-react");
|
|
14
|
+
const mui_1 = require("tss-react/mui");
|
|
38
15
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
39
16
|
bookmarkButton: {
|
|
40
17
|
overflow: 'hidden',
|
|
@@ -51,7 +28,7 @@ const Highlight = (0, mobx_react_1.observer)(function Highlight({ model }) {
|
|
|
51
28
|
const { classes } = useStyles();
|
|
52
29
|
const session = (0, util_1.getSession)(model);
|
|
53
30
|
const { assemblyManager } = session;
|
|
54
|
-
const {
|
|
31
|
+
const { bookmarkHighlightsVisible, bookmarkLabelsVisible } = model;
|
|
55
32
|
const bookmarkWidget = session.widgets.get('GridBookmark');
|
|
56
33
|
(0, react_1.useEffect)(() => {
|
|
57
34
|
if (!bookmarkWidget) {
|
|
@@ -59,7 +36,7 @@ const Highlight = (0, mobx_react_1.observer)(function Highlight({ model }) {
|
|
|
59
36
|
}
|
|
60
37
|
}, [session, bookmarkWidget]);
|
|
61
38
|
const set = new Set(model.assemblyNames);
|
|
62
|
-
return
|
|
39
|
+
return bookmarkHighlightsVisible && (bookmarkWidget === null || bookmarkWidget === void 0 ? void 0 : bookmarkWidget.bookmarks)
|
|
63
40
|
? bookmarkWidget.bookmarks
|
|
64
41
|
.filter(value => set.has(value.assemblyName))
|
|
65
42
|
.map(r => {
|
|
@@ -79,35 +56,34 @@ const Highlight = (0, mobx_react_1.observer)(function Highlight({ model }) {
|
|
|
79
56
|
: undefined;
|
|
80
57
|
})
|
|
81
58
|
.filter(util_1.notEmpty)
|
|
82
|
-
.map(({ left, width, highlight, label, bookmark }, idx) => (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
left,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
59
|
+
.map(({ left, width, highlight, label, bookmark }, idx) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: classes.highlight, id: "highlight", style: {
|
|
60
|
+
left,
|
|
61
|
+
width,
|
|
62
|
+
background: highlight,
|
|
63
|
+
} }), bookmarkLabelsVisible && width > 20 ? ((0, jsx_runtime_1.jsx)("div", { className: classes.bookmarkButton, style: { left }, children: (0, jsx_runtime_1.jsx)(CascadingMenuButton_1.default, { menuItems: [
|
|
64
|
+
{
|
|
65
|
+
label: 'Open bookmark widget',
|
|
66
|
+
onClick: () => {
|
|
67
|
+
session.showWidget(bookmarkWidget);
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: 'Turn off highlights',
|
|
72
|
+
onClick: () => {
|
|
73
|
+
bookmarkWidget.setBookmarkHighlightsVisible(false);
|
|
74
|
+
},
|
|
96
75
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
76
|
+
{
|
|
77
|
+
label: 'Remove bookmark',
|
|
78
|
+
onClick: () => {
|
|
79
|
+
bookmarkWidget.removeBookmarkObject(bookmark);
|
|
80
|
+
},
|
|
102
81
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
? (0, colord_1.colord)(highlight).alpha(0.8).toRgbString()
|
|
109
|
-
: (0, colord_1.colord)(highlight).alpha(0).toRgbString(),
|
|
110
|
-
} }))))) : null)))
|
|
82
|
+
], children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: label, arrow: true, children: (0, jsx_runtime_1.jsx)(Bookmark_1.default, { fontSize: "small", sx: {
|
|
83
|
+
color: (0, colord_1.colord)(highlight).alpha() !== 0
|
|
84
|
+
? (0, colord_1.colord)(highlight).alpha(0.8).toRgbString()
|
|
85
|
+
: (0, colord_1.colord)(highlight).alpha(0).toRgbString(),
|
|
86
|
+
} }) }) }) })) : null] }, `${left}_${width}_${idx}`)))
|
|
111
87
|
: null;
|
|
112
88
|
});
|
|
113
89
|
exports.default = Highlight;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
3
|
-
import { IExtendedLGV } from '../../model';
|
|
1
|
+
import type { IExtendedLGV } from '../../model';
|
|
2
|
+
import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
4
3
|
type LGV = IExtendedLGV;
|
|
5
4
|
declare const OverviewHighlight: ({ model, overview, }: {
|
|
6
5
|
model: LGV;
|
|
7
6
|
overview: Base1DViewModel;
|
|
8
|
-
}) =>
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element[] | null;
|
|
9
8
|
export default OverviewHighlight;
|