@jbrowse/plugin-grid-bookmark 2.18.0 → 3.0.1
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 -2
- package/dist/GridBookmarkWidget/components/AssemblySelector.js +9 -23
- package/dist/GridBookmarkWidget/components/BookmarkGrid.d.ts +1 -2
- package/dist/GridBookmarkWidget/components/BookmarkGrid.js +6 -7
- package/dist/GridBookmarkWidget/components/GridBookmarkWidget.d.ts +1 -2
- package/dist/GridBookmarkWidget/components/GridBookmarkWidget.js +81 -81
- package/dist/GridBookmarkWidget/components/Highlight/Highlight.d.ts +1 -2
- package/dist/GridBookmarkWidget/components/Highlight/Highlight.js +27 -54
- package/dist/GridBookmarkWidget/components/Highlight/OverviewHighlight.d.ts +1 -2
- package/dist/GridBookmarkWidget/components/Highlight/OverviewHighlight.js +4 -27
- package/dist/GridBookmarkWidget/components/Highlight/index.js +3 -3
- package/dist/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.d.ts +1 -2
- package/dist/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.js +10 -21
- package/dist/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.d.ts +1 -2
- package/dist/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.js +10 -39
- package/dist/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.d.ts +1 -2
- package/dist/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.js +9 -43
- package/dist/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.d.ts +1 -2
- package/dist/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.js +8 -21
- package/dist/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.d.ts +1 -2
- package/dist/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.js +33 -72
- package/dist/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.d.ts +1 -2
- package/dist/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.js +14 -46
- package/dist/GridBookmarkWidget/index.js +17 -7
- package/dist/GridBookmarkWidget/sessionSharing.js +17 -7
- package/dist/GridBookmarkWidget/utils.js +17 -7
- package/esm/GridBookmarkWidget/components/AssemblySelector.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/AssemblySelector.js +9 -20
- package/esm/GridBookmarkWidget/components/BookmarkGrid.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/BookmarkGrid.js +6 -7
- package/esm/GridBookmarkWidget/components/GridBookmarkWidget.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/GridBookmarkWidget.js +64 -74
- package/esm/GridBookmarkWidget/components/Highlight/Highlight.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/Highlight/Highlight.js +27 -31
- package/esm/GridBookmarkWidget/components/Highlight/OverviewHighlight.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/Highlight/OverviewHighlight.js +4 -4
- package/esm/GridBookmarkWidget/components/Highlight/index.js +3 -3
- package/esm/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.js +10 -18
- package/esm/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.js +10 -16
- package/esm/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.js +9 -20
- package/esm/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.js +8 -18
- package/esm/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.js +33 -49
- package/esm/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.d.ts +1 -2
- package/esm/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.js +14 -23
- package/package.json +11 -11
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { AssemblySelector, Dialog, ErrorMessage, FileSelector, } from '@jbrowse/core/ui';
|
|
3
4
|
import { getSession } from '@jbrowse/core/util';
|
|
4
5
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
@@ -72,55 +73,38 @@ const ImportBookmarksDialog = observer(function ({ onClose, model, }) {
|
|
|
72
73
|
const { assemblyNames } = session;
|
|
73
74
|
const [selectedAsm, setSelectedAsm] = useState(assemblyNames[0]);
|
|
74
75
|
const [expanded, setExpanded] = useState('shareLinkAccordion');
|
|
75
|
-
return (
|
|
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
|
-
if (expanded === 'fileAccordion' && location) {
|
|
103
|
-
const data = await openLocation(location).readFile('utf8');
|
|
104
|
-
const lines = data.split(/\n|\r\n|\r/).filter(f => !!f.trim());
|
|
105
|
-
const fileType = guessFileType(lines[0]);
|
|
106
|
-
if (fileType === 'BED') {
|
|
107
|
-
model.importBookmarks(await getBookmarksFromBEDFile(lines, selectedAsm));
|
|
76
|
+
return (_jsxs(Dialog, { open: true, onClose: onClose, maxWidth: "xl", title: "Import bookmarks", children: [_jsxs(DialogContent, { className: classes.minWidth, children: [_jsxs(Accordion, { expanded: expanded === 'shareLinkAccordion', onChange: () => {
|
|
77
|
+
setExpanded('shareLinkAccordion');
|
|
78
|
+
}, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, { className: classes.expandIcon }), children: _jsx(Typography, { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: "Import from share link" }) }), _jsxs(AccordionDetails, { children: [_jsx(Typography, { children: "Paste a bookmark share link generated by the 'Share' button from the bookmarks widget" }), _jsx(TextField, { label: "Enter Share URL", variant: "outlined", fullWidth: true, value: shareLink, onChange: e => {
|
|
79
|
+
setShareLink(e.target.value);
|
|
80
|
+
} })] })] }), _jsxs(Accordion, { expanded: expanded === 'fileAccordion', onChange: () => {
|
|
81
|
+
setExpanded('fileAccordion');
|
|
82
|
+
}, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, { className: classes.expandIcon }), children: _jsx(Typography, { children: "Import from file" }) }), _jsxs(AccordionDetails, { children: [_jsx(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".` }), _jsx(AssemblySelector, { onChange: val => {
|
|
83
|
+
setSelectedAsm(val);
|
|
84
|
+
}, helperText: 'Select the assembly for BED file.', session: session, selected: selectedAsm })] })] }), error ? _jsx(ErrorMessage, { error: error }) : null] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: onClose, children: "Cancel" }), _jsx(Button, { "data-testid": "dialogImport", variant: "contained", color: "primary", disabled: !location && !shareLink, startIcon: _jsx(ImportIcon, {}), onClick: async () => {
|
|
85
|
+
try {
|
|
86
|
+
if (expanded === 'fileAccordion' && location) {
|
|
87
|
+
const data = await openLocation(location).readFile('utf8');
|
|
88
|
+
const lines = data.split(/\n|\r\n|\r/).filter(f => !!f.trim());
|
|
89
|
+
const fileType = guessFileType(lines[0]);
|
|
90
|
+
if (fileType === 'BED') {
|
|
91
|
+
model.importBookmarks(await getBookmarksFromBEDFile(lines, selectedAsm));
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
model.importBookmarks(await getBookmarksFromTSVFile(lines));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else if (expanded === 'shareLinkAccordion' &&
|
|
98
|
+
shareLink &&
|
|
99
|
+
isSessionWithShareURL(session)) {
|
|
100
|
+
model.importBookmarks(await getBookmarksFromShareLink(shareLink, session.shareURL));
|
|
101
|
+
}
|
|
102
|
+
onClose();
|
|
108
103
|
}
|
|
109
|
-
|
|
110
|
-
|
|
104
|
+
catch (e) {
|
|
105
|
+
console.error(e);
|
|
106
|
+
setError(e);
|
|
111
107
|
}
|
|
112
|
-
}
|
|
113
|
-
else if (expanded === 'shareLinkAccordion' &&
|
|
114
|
-
shareLink &&
|
|
115
|
-
isSessionWithShareURL(session)) {
|
|
116
|
-
model.importBookmarks(await getBookmarksFromShareLink(shareLink, session.shareURL));
|
|
117
|
-
}
|
|
118
|
-
onClose();
|
|
119
|
-
}
|
|
120
|
-
catch (e) {
|
|
121
|
-
console.error(e);
|
|
122
|
-
setError(e);
|
|
123
|
-
}
|
|
124
|
-
} }, "Import"))));
|
|
108
|
+
}, children: "Import" })] })] }));
|
|
125
109
|
});
|
|
126
110
|
export default ImportBookmarksDialog;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
|
|
3
4
|
import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons';
|
|
4
5
|
import { getSession, isSessionWithShareURL } from '@jbrowse/core/util';
|
|
@@ -55,27 +56,17 @@ const ShareBookmarksDialog = observer(function ({ onClose, model, }) {
|
|
|
55
56
|
}
|
|
56
57
|
})();
|
|
57
58
|
}, [bookmarksToShare, session]);
|
|
58
|
-
return (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const target = event.target;
|
|
71
|
-
target.select();
|
|
72
|
-
} })),
|
|
73
|
-
React.createElement(DialogContentText, null, "The URL should be pasted into the \"Import from share link\" field in the \"Import\" form found in the \"Bookmarked regions\" drawer.")),
|
|
74
|
-
React.createElement(DialogActions, null,
|
|
75
|
-
React.createElement(Button, { className: classes.flexItem, "data-testid": "dialogShare", variant: "contained", color: "primary", disabled: loading, startIcon: React.createElement(ContentCopyIcon, null), onClick: async () => {
|
|
76
|
-
copy(url);
|
|
77
|
-
session.notify('Copied to clipboard', 'success');
|
|
78
|
-
onClose();
|
|
79
|
-
} }, "Copy share link"))));
|
|
59
|
+
return (_jsxs(Dialog, { open: true, onClose: onClose, title: "Share bookmarks", children: [_jsxs(DialogContent, { className: classes.content, children: [_jsx(Alert, { severity: "info", children: shareAll ? (_jsxs(_Fragment, { children: [_jsx("span", { children: "All bookmarks will be shared." }), _jsx("br", {}), _jsx("span", { children: "Use the checkboxes to select individual bookmarks to share." })] })) : ('Only selected bookmarks will be shared.') }), _jsx(DialogContentText, { children: "Copy the URL below to share your bookmarks." }), error ? (_jsx(ErrorMessage, { error: error })) : loading ? (_jsx(Typography, { children: "Generating short URL..." })) : (_jsx(TextField, { label: "URL", value: url, slotProps: {
|
|
60
|
+
input: {
|
|
61
|
+
readOnly: true,
|
|
62
|
+
},
|
|
63
|
+
}, variant: "filled", fullWidth: true, onClick: event => {
|
|
64
|
+
const target = event.target;
|
|
65
|
+
target.select();
|
|
66
|
+
} })), _jsx(DialogContentText, { children: "The URL should be pasted into the \"Import from share link\" field in the \"Import\" form found in the \"Bookmarked regions\" drawer." })] }), _jsx(DialogActions, { children: _jsx(Button, { className: classes.flexItem, "data-testid": "dialogShare", variant: "contained", color: "primary", disabled: loading, startIcon: _jsx(ContentCopyIcon, {}), onClick: async () => {
|
|
67
|
+
copy(url);
|
|
68
|
+
session.notify('Copied to clipboard', 'success');
|
|
69
|
+
onClose();
|
|
70
|
+
}, children: "Copy share link" }) })] }));
|
|
80
71
|
});
|
|
81
72
|
export default ShareBookmarksDialog;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-grid-bookmark",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "JBrowse 2 grid bookmark widget",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,28 +36,28 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@jbrowse/core": "^3.0.1",
|
|
40
|
+
"@jbrowse/plugin-config": "^3.0.1",
|
|
41
|
+
"@jbrowse/plugin-linear-genome-view": "^3.0.1",
|
|
39
42
|
"@mui/icons-material": "^6.0.0",
|
|
40
|
-
"@types/file-saver": "^2.0.1",
|
|
41
|
-
"copy-to-clipboard": "^3.3.1",
|
|
42
|
-
"file-saver": "^2.0.0"
|
|
43
|
-
},
|
|
44
|
-
"peerDependencies": {
|
|
45
|
-
"@jbrowse/core": "^2.0.0",
|
|
46
|
-
"@jbrowse/plugin-config": "^2.0.0",
|
|
47
|
-
"@jbrowse/plugin-linear-genome-view": "^2.0.0",
|
|
48
43
|
"@mui/material": "^6.0.0",
|
|
49
44
|
"@mui/x-data-grid": "^7.0.0",
|
|
45
|
+
"@types/file-saver": "^2.0.1",
|
|
46
|
+
"copy-to-clipboard": "^3.3.1",
|
|
47
|
+
"file-saver": "^2.0.0",
|
|
50
48
|
"mobx": "^6.0.0",
|
|
51
49
|
"mobx-react": "^9.0.0",
|
|
52
50
|
"mobx-state-tree": "^5.0.0",
|
|
53
|
-
"react": ">=16.8.0",
|
|
54
51
|
"tss-react": "^4.0.0"
|
|
55
52
|
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": ">=18.0.0"
|
|
55
|
+
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"distModule": "esm/index.js",
|
|
60
60
|
"srcModule": "src/index.ts",
|
|
61
61
|
"module": "esm/index.js",
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "aa2f1d1a89d2361c7fd1a93fe29506fa4554f5cc"
|
|
63
63
|
}
|