@jbrowse/plugin-grid-bookmark 3.7.0 → 4.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.
Files changed (67) hide show
  1. package/esm/GridBookmarkWidget/components/AssemblySelector.d.ts +1 -1
  2. package/esm/GridBookmarkWidget/components/AssemblySelector.js +1 -1
  3. package/esm/GridBookmarkWidget/components/BookmarkGrid.d.ts +1 -1
  4. package/esm/GridBookmarkWidget/components/BookmarkGrid.js +3 -3
  5. package/esm/GridBookmarkWidget/components/GridBookmarkWidget.d.ts +1 -1
  6. package/esm/GridBookmarkWidget/components/GridBookmarkWidget.js +9 -9
  7. package/esm/GridBookmarkWidget/components/Highlight/Highlight.d.ts +1 -1
  8. package/esm/GridBookmarkWidget/components/Highlight/Highlight.js +3 -4
  9. package/esm/GridBookmarkWidget/components/Highlight/OverviewHighlight.d.ts +1 -1
  10. package/esm/GridBookmarkWidget/components/Highlight/OverviewHighlight.js +5 -5
  11. package/esm/GridBookmarkWidget/components/Highlight/index.js +2 -2
  12. package/esm/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.d.ts +1 -1
  13. package/esm/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.js +1 -1
  14. package/esm/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.d.ts +1 -1
  15. package/esm/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.js +2 -3
  16. package/esm/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.d.ts +1 -1
  17. package/esm/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.js +5 -5
  18. package/esm/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.d.ts +1 -1
  19. package/esm/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.js +1 -1
  20. package/esm/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.d.ts +1 -1
  21. package/esm/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.js +5 -5
  22. package/esm/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.d.ts +1 -1
  23. package/esm/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.js +5 -5
  24. package/esm/GridBookmarkWidget/index.js +3 -3
  25. package/esm/GridBookmarkWidget/model.d.ts +94 -94
  26. package/esm/GridBookmarkWidget/model.js +10 -15
  27. package/esm/GridBookmarkWidget/sessionSharing.js +1 -1
  28. package/esm/GridBookmarkWidget/utils.d.ts +2 -2
  29. package/esm/GridBookmarkWidget/utils.js +11 -15
  30. package/esm/index.js +17 -6
  31. package/package.json +32 -36
  32. package/dist/GridBookmarkWidget/components/AssemblySelector.d.ts +0 -5
  33. package/dist/GridBookmarkWidget/components/AssemblySelector.js +0 -22
  34. package/dist/GridBookmarkWidget/components/BookmarkGrid.d.ts +0 -5
  35. package/dist/GridBookmarkWidget/components/BookmarkGrid.js +0 -97
  36. package/dist/GridBookmarkWidget/components/GridBookmarkWidget.d.ts +0 -5
  37. package/dist/GridBookmarkWidget/components/GridBookmarkWidget.js +0 -131
  38. package/dist/GridBookmarkWidget/components/Highlight/Highlight.d.ts +0 -6
  39. package/dist/GridBookmarkWidget/components/Highlight/Highlight.js +0 -89
  40. package/dist/GridBookmarkWidget/components/Highlight/OverviewHighlight.d.ts +0 -8
  41. package/dist/GridBookmarkWidget/components/Highlight/OverviewHighlight.js +0 -60
  42. package/dist/GridBookmarkWidget/components/Highlight/index.d.ts +0 -2
  43. package/dist/GridBookmarkWidget/components/Highlight/index.js +0 -23
  44. package/dist/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.d.ts +0 -6
  45. package/dist/GridBookmarkWidget/components/dialogs/DeleteBookmarksDialog.js +0 -20
  46. package/dist/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.d.ts +0 -6
  47. package/dist/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.js +0 -23
  48. package/dist/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.d.ts +0 -6
  49. package/dist/GridBookmarkWidget/components/dialogs/ExportBookmarksDialog.js +0 -40
  50. package/dist/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.d.ts +0 -6
  51. package/dist/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.js +0 -16
  52. package/dist/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.d.ts +0 -6
  53. package/dist/GridBookmarkWidget/components/dialogs/ImportBookmarksDialog.js +0 -115
  54. package/dist/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.d.ts +0 -6
  55. package/dist/GridBookmarkWidget/components/dialogs/ShareBookmarksDialog.js +0 -77
  56. package/dist/GridBookmarkWidget/index.d.ts +0 -2
  57. package/dist/GridBookmarkWidget/index.js +0 -57
  58. package/dist/GridBookmarkWidget/model.d.ts +0 -228
  59. package/dist/GridBookmarkWidget/model.js +0 -169
  60. package/dist/GridBookmarkWidget/sessionSharing.d.ts +0 -6
  61. package/dist/GridBookmarkWidget/sessionSharing.js +0 -99
  62. package/dist/GridBookmarkWidget/types.d.ts +0 -4
  63. package/dist/GridBookmarkWidget/types.js +0 -2
  64. package/dist/GridBookmarkWidget/utils.d.ts +0 -7
  65. package/dist/GridBookmarkWidget/utils.js +0 -144
  66. package/dist/index.d.ts +0 -7
  67. package/dist/index.js +0 -185
@@ -1,4 +1,4 @@
1
- import type { GridBookmarkModel } from '../model';
1
+ import type { GridBookmarkModel } from '../model.ts';
2
2
  declare const AssemblySelector: ({ model, }: {
3
3
  model: GridBookmarkModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Checkbox, FormControl, InputLabel, ListItemText, MenuItem, OutlinedInput, Select, } from '@mui/material';
3
3
  import { observer } from 'mobx-react';
4
- const AssemblySelector = observer(function ({ model, }) {
4
+ const AssemblySelector = observer(function AssemblySelector({ model, }) {
5
5
  const { validAssemblies, selectedAssemblies } = model;
6
6
  const noAssemblies = validAssemblies.size === 0;
7
7
  const label = 'Select assemblies';
@@ -1,4 +1,4 @@
1
- import type { GridBookmarkModel } from '../model';
1
+ import type { GridBookmarkModel } from '../model.ts';
2
2
  declare const BookmarkGrid: ({ model, }: {
3
3
  model: GridBookmarkModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -2,11 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import ColorPicker from '@jbrowse/core/ui/ColorPicker';
3
3
  import DataGridFlexContainer from '@jbrowse/core/ui/DataGridFlexContainer';
4
4
  import { assembleLocString, getSession, measureGridWidth, measureText, } from '@jbrowse/core/util';
5
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
5
6
  import { Link } from '@mui/material';
6
7
  import { DataGrid, GRID_CHECKBOX_SELECTION_COL_DEF } from '@mui/x-data-grid';
7
8
  import { observer } from 'mobx-react';
8
- import { makeStyles } from 'tss-react/mui';
9
- import { navToBookmark } from '../utils';
9
+ import { navToBookmark } from "../utils.js";
10
10
  const useStyles = makeStyles()(() => ({
11
11
  cell: {
12
12
  whiteSpace: 'nowrap',
@@ -14,7 +14,7 @@ const useStyles = makeStyles()(() => ({
14
14
  textOverflow: 'ellipsis',
15
15
  },
16
16
  }));
17
- const BookmarkGrid = observer(function ({ model, }) {
17
+ const BookmarkGrid = observer(function BookmarkGrid({ model, }) {
18
18
  const { classes } = useStyles();
19
19
  const { bookmarks, bookmarksWithValidAssemblies, selectedAssemblies, selectedBookmarks, } = model;
20
20
  const session = getSession(model);
@@ -1,4 +1,4 @@
1
- import type { GridBookmarkModel } from '../model';
1
+ import type { GridBookmarkModel } from '../model.ts';
2
2
  declare const GridBookmarkWidget: ({ model, }: {
3
3
  model: GridBookmarkModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { lazy } from 'react';
3
3
  import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
4
4
  import { getSession } from '@jbrowse/core/util';
5
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
5
6
  import Delete from '@mui/icons-material/Delete';
6
7
  import GetApp from '@mui/icons-material/GetApp';
7
8
  import Menu from '@mui/icons-material/Menu';
@@ -11,15 +12,14 @@ import Settings from '@mui/icons-material/Settings';
11
12
  import Share from '@mui/icons-material/Share';
12
13
  import { Alert } from '@mui/material';
13
14
  import { observer } from 'mobx-react';
14
- import { makeStyles } from 'tss-react/mui';
15
- import AssemblySelector from './AssemblySelector';
16
- import BookmarkGrid from './BookmarkGrid';
17
- const ExportBookmarksDialog = lazy(() => import('./dialogs/ExportBookmarksDialog'));
18
- const ImportBookmarksDialog = lazy(() => import('./dialogs/ImportBookmarksDialog'));
19
- const ShareBookmarksDialog = lazy(() => import('./dialogs/ShareBookmarksDialog'));
20
- const HighlightSettingsDialog = lazy(() => import('./dialogs/HighlightSettingsDialog'));
21
- const EditHighlightColorDialog = lazy(() => import('./dialogs/EditHighlightColorDialog'));
22
- const DeleteBookmarksDialog = lazy(() => import('./dialogs/DeleteBookmarksDialog'));
15
+ import AssemblySelector from "./AssemblySelector.js";
16
+ import BookmarkGrid from "./BookmarkGrid.js";
17
+ const ExportBookmarksDialog = lazy(() => import("./dialogs/ExportBookmarksDialog.js"));
18
+ const ImportBookmarksDialog = lazy(() => import("./dialogs/ImportBookmarksDialog.js"));
19
+ const ShareBookmarksDialog = lazy(() => import("./dialogs/ShareBookmarksDialog.js"));
20
+ const HighlightSettingsDialog = lazy(() => import("./dialogs/HighlightSettingsDialog.js"));
21
+ const EditHighlightColorDialog = lazy(() => import("./dialogs/EditHighlightColorDialog.js"));
22
+ const DeleteBookmarksDialog = lazy(() => import("./dialogs/DeleteBookmarksDialog.js"));
23
23
  const useStyles = makeStyles()({
24
24
  flex: {
25
25
  display: 'flex',
@@ -1,4 +1,4 @@
1
- import type { IExtendedLGV } from '../../model';
1
+ import type { IExtendedLGV } from '../../model.ts';
2
2
  type LGV = IExtendedLGV;
3
3
  declare const Highlight: ({ model }: {
4
4
  model: LGV;
@@ -3,10 +3,10 @@ import { Fragment, useEffect } from 'react';
3
3
  import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
4
4
  import { getSession, notEmpty } from '@jbrowse/core/util';
5
5
  import { colord } from '@jbrowse/core/util/colord';
6
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
6
7
  import BookmarkIcon from '@mui/icons-material/Bookmark';
7
8
  import { Tooltip } from '@mui/material';
8
9
  import { observer } from 'mobx-react';
9
- import { makeStyles } from 'tss-react/mui';
10
10
  const useStyles = makeStyles()({
11
11
  bookmarkButton: {
12
12
  overflow: 'hidden',
@@ -31,13 +31,12 @@ const Highlight = observer(function Highlight({ model }) {
31
31
  }
32
32
  }, [session, bookmarkWidget]);
33
33
  const set = new Set(model.assemblyNames);
34
- return bookmarkHighlightsVisible && (bookmarkWidget === null || bookmarkWidget === void 0 ? void 0 : bookmarkWidget.bookmarks)
34
+ return bookmarkHighlightsVisible && bookmarkWidget?.bookmarks
35
35
  ? bookmarkWidget.bookmarks
36
36
  .filter(value => set.has(value.assemblyName))
37
37
  .map(r => {
38
- var _a;
39
38
  const asm = assemblyManager.get(r.assemblyName);
40
- const refName = (_a = asm === null || asm === void 0 ? void 0 : asm.getCanonicalRefName(r.refName)) !== null && _a !== void 0 ? _a : r.refName;
39
+ const refName = asm?.getCanonicalRefName(r.refName) ?? r.refName;
41
40
  const s = model.bpToPx({ refName, coord: r.start });
42
41
  const e = model.bpToPx({ refName, coord: r.end });
43
42
  return s && e
@@ -1,4 +1,4 @@
1
- import type { IExtendedLGV } from '../../model';
1
+ import type { IExtendedLGV } from '../../model.ts';
2
2
  import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
3
3
  type LGV = IExtendedLGV;
4
4
  declare const OverviewHighlight: ({ model, overview, }: {
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect } from 'react';
3
3
  import { getSession, notEmpty } from '@jbrowse/core/util';
4
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
4
5
  import { Tooltip } from '@mui/material';
5
6
  import { observer } from 'mobx-react';
6
- import { makeStyles } from 'tss-react/mui';
7
7
  const useStyles = makeStyles()({
8
8
  highlight: {
9
9
  height: '100%',
10
10
  position: 'absolute',
11
+ left: 0,
11
12
  },
12
13
  });
13
14
  const OverviewHighlight = observer(function OverviewHighlight({ model, overview, }) {
@@ -23,13 +24,12 @@ const OverviewHighlight = observer(function OverviewHighlight({ model, overview,
23
24
  }
24
25
  }, [session, bookmarkWidget]);
25
26
  const assemblyNames = new Set(model.assemblyNames);
26
- return bookmarkHighlightsVisible && (bookmarkWidget === null || bookmarkWidget === void 0 ? void 0 : bookmarkWidget.bookmarks)
27
+ return bookmarkHighlightsVisible && bookmarkWidget?.bookmarks
27
28
  ? bookmarkWidget.bookmarks
28
29
  .filter(r => assemblyNames.has(r.assemblyName))
29
30
  .map(r => {
30
- var _a;
31
31
  const asm = assemblyManager.get(r.assemblyName);
32
- const refName = (_a = asm === null || asm === void 0 ? void 0 : asm.getCanonicalRefName(r.refName)) !== null && _a !== void 0 ? _a : r.refName;
32
+ const refName = asm?.getCanonicalRefName(r.refName) ?? r.refName;
33
33
  const rev = r.reversed;
34
34
  const s = overview.bpToPx({ refName, coord: rev ? r.end : r.start });
35
35
  const e = overview.bpToPx({ refName, coord: rev ? r.start : r.end });
@@ -46,7 +46,7 @@ const OverviewHighlight = observer(function OverviewHighlight({ model, overview,
46
46
  .map((obj, idx) => {
47
47
  const { left, width, highlight, label } = obj;
48
48
  return (_jsx(Tooltip, { title: bookmarkLabelsVisible ? label : '', arrow: true, children: _jsx("div", { className: classes.highlight, style: {
49
- left,
49
+ transform: `translateX(${left}px)`,
50
50
  width,
51
51
  background: highlight,
52
52
  borderLeft: `1px solid ${highlight}`,
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import Highlight from './Highlight';
3
- import OverviewHighlight from './OverviewHighlight';
2
+ import Highlight from "./Highlight.js";
3
+ import OverviewHighlight from "./OverviewHighlight.js";
4
4
  export default function AddHighlightModelF(pluginManager) {
5
5
  pluginManager.addToExtensionPoint('LinearGenomeView-TracksContainerComponent', (rest, { model }) => {
6
6
  return [
@@ -1,4 +1,4 @@
1
- import type { GridBookmarkModel } from '../../model';
1
+ import type { GridBookmarkModel } from '../../model.ts';
2
2
  declare const DeleteBookmarksDialog: ({ onClose, model, }: {
3
3
  onClose: () => void;
4
4
  model: GridBookmarkModel;
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { Dialog } from '@jbrowse/core/ui';
3
3
  import { Alert, Button, DialogActions, DialogContent } from '@mui/material';
4
4
  import { observer } from 'mobx-react';
5
- const DeleteBookmarksDialog = observer(function ({ onClose, model, }) {
5
+ const DeleteBookmarksDialog = observer(function DeleteBookmarksDialog({ onClose, model, }) {
6
6
  const { selectedBookmarks } = model;
7
7
  const deleteAll = selectedBookmarks.length === 0;
8
8
  return (_jsxs(Dialog, { open: true, onClose: onClose, title: "Delete bookmarks", children: [_jsx(DialogContent, { children: _jsx(Alert, { severity: "warning", children: deleteAll ? (_jsxs(_Fragment, { children: [_jsx("span", { children: "All bookmarks will be deleted." }), _jsx("br", {}), _jsx("span", { children: "Use the checkboxes to select individual bookmarks to delete." })] })) : ('Only selected bookmarks will be deleted.') }) }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
@@ -1,4 +1,4 @@
1
- import type { GridBookmarkModel } from '../../model';
1
+ import type { GridBookmarkModel } from '../../model.ts';
2
2
  declare const EditHighlightColorDialog: ({ onClose, model, }: {
3
3
  onClose: () => void;
4
4
  model: GridBookmarkModel;
@@ -4,11 +4,10 @@ import { Dialog } from '@jbrowse/core/ui';
4
4
  import { ColorPicker } from '@jbrowse/core/ui/ColorPicker';
5
5
  import { Alert, Button, DialogActions, DialogContent, Typography, } from '@mui/material';
6
6
  import { observer } from 'mobx-react';
7
- const EditHighlightColorDialog = observer(function ({ onClose, model, }) {
8
- var _a, _b;
7
+ const EditHighlightColorDialog = observer(function EditHighlightColorDialog({ onClose, model, }) {
9
8
  const { selectedBookmarks } = model;
10
9
  const editNone = selectedBookmarks.length === 0;
11
- const [color, setColor] = useState((_b = (_a = selectedBookmarks[0]) === null || _a === void 0 ? void 0 : _a.highlight) !== null && _b !== void 0 ? _b : 'rgba(247, 129, 192, 0.35)');
10
+ const [color, setColor] = useState(selectedBookmarks[0]?.highlight ?? 'rgba(247, 129, 192, 0.35)');
12
11
  return (_jsxs(Dialog, { open: true, onClose: onClose, title: "Highlight bookmarks", children: [_jsxs(DialogContent, { children: [_jsx(Typography, { variant: "h6", children: "Bulk highlight selector" }), _jsx(Alert, { severity: "info", children: editNone ? (_jsx("span", { children: "Use the checkboxes to select individual bookmarks to edit." })) : ('Only selected bookmarks will be edited.') }), !editNone ? (_jsx(ColorPicker, { color: color, onChange: event => {
13
12
  setColor(event);
14
13
  } })) : null] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
@@ -1,4 +1,4 @@
1
- import type { GridBookmarkModel } from '../../model';
1
+ import type { GridBookmarkModel } from '../../model.ts';
2
2
  declare const ExportBookmarksDialog: ({ model, onClose, }: {
3
3
  model: GridBookmarkModel;
4
4
  onClose: () => void;
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { Dialog } from '@jbrowse/core/ui';
4
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
4
5
  import GetAppIcon from '@mui/icons-material/GetApp';
5
6
  import { Alert, Button, DialogActions, DialogContent, MenuItem, Select, Typography, } from '@mui/material';
6
7
  import { observer } from 'mobx-react';
7
- import { makeStyles } from 'tss-react/mui';
8
- import { downloadBookmarkFile } from '../../utils';
8
+ import { downloadBookmarkFile } from "../../utils.js";
9
9
  const useStyles = makeStyles()({
10
10
  flexItem: {
11
11
  display: 'flex',
@@ -18,14 +18,14 @@ const useStyles = makeStyles()({
18
18
  gap: '5px',
19
19
  },
20
20
  });
21
- const ExportBookmarksDialog = observer(function ({ model, onClose, }) {
21
+ const ExportBookmarksDialog = observer(function ExportBookmarksDialog({ model, onClose, }) {
22
22
  const { classes } = useStyles();
23
23
  const [fileType, setFileType] = useState('BED');
24
24
  const { selectedBookmarks } = model;
25
25
  const exportAll = selectedBookmarks.length === 0;
26
- return (_jsxs(Dialog, { open: true, onClose: () => {
26
+ return (_jsxs(Dialog, { open: true, title: "Export bookmarks", onClose: () => {
27
27
  onClose();
28
- }, title: "Export bookmarks", children: [_jsxs(DialogContent, { className: classes.container, children: [_jsx(Alert, { severity: "info", children: exportAll ? (_jsxs(_Fragment, { children: [_jsx("span", { children: "All bookmarks will be exported." }), _jsx("br", {}), _jsx("span", { children: "Use the checkboxes to select individual bookmarks to export." })] })) : ('Only selected bookmarks will be exported.') }), _jsxs("div", { className: classes.flexItem, children: [_jsx(Typography, { children: "Format to download:" }), _jsxs(Select, { size: "small", value: fileType, onChange: event => {
28
+ }, children: [_jsxs(DialogContent, { className: classes.container, children: [_jsx(Alert, { severity: "info", children: exportAll ? (_jsxs(_Fragment, { children: [_jsx("span", { children: "All bookmarks will be exported." }), _jsx("br", {}), _jsx("span", { children: "Use the checkboxes to select individual bookmarks to export." })] })) : ('Only selected bookmarks will be exported.') }), _jsxs("div", { className: classes.flexItem, children: [_jsx(Typography, { children: "Format to download:" }), _jsxs(Select, { size: "small", value: fileType, onChange: event => {
29
29
  setFileType(event.target.value);
30
30
  }, children: [_jsx(MenuItem, { value: "BED", children: "BED" }), _jsx(MenuItem, { value: "TSV", children: "TSV" })] })] })] }), _jsx(DialogActions, { children: _jsx(Button, { variant: "contained", color: "primary", startIcon: _jsx(GetAppIcon, {}), onClick: () => {
31
31
  downloadBookmarkFile(fileType, model);
@@ -1,4 +1,4 @@
1
- import type { GridBookmarkModel } from '../../model';
1
+ import type { GridBookmarkModel } from '../../model.ts';
2
2
  declare const HighlightSettingsDialog: ({ onClose, model, }: {
3
3
  onClose: () => void;
4
4
  model: GridBookmarkModel;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Dialog } from '@jbrowse/core/ui';
3
3
  import { Button, DialogActions, DialogContent, Stack, Switch, Typography, } from '@mui/material';
4
4
  import { observer } from 'mobx-react';
5
- const HighlightSettingsDialog = observer(function ({ onClose, model, }) {
5
+ const HighlightSettingsDialog = observer(function HighlightSettingsDialog({ onClose, model, }) {
6
6
  return (_jsxs(Dialog, { open: true, onClose: onClose, title: "Highlight bookmarks", children: [_jsxs(DialogContent, { children: [_jsx(Typography, { variant: "h6", children: "Highlight toggles" }), _jsxs(Stack, { direction: "row", alignItems: "center", children: [_jsx(Switch, { "data-testid": "toggle_highlight_all_switch", checked: model.areBookmarksHighlightedOnAllOpenViews, onChange: () => {
7
7
  model.setBookmarkHighlightsVisible(!model.areBookmarksHighlightedOnAllOpenViews);
8
8
  } }), _jsx(Typography, { children: "Toggle bookmark highlights on all open views" })] }), _jsxs(Stack, { direction: "row", alignItems: "center", children: [_jsx(Switch, { "data-testid": "toggle_highlight_label_all_switch", checked: model.areBookmarksHighlightLabelsOnAllOpenViews, onChange: () => {
@@ -1,4 +1,4 @@
1
- import type { GridBookmarkModel } from '../../model';
1
+ import type { GridBookmarkModel } from '../../model.ts';
2
2
  declare const ImportBookmarksDialog: ({ onClose, model, }: {
3
3
  onClose: () => void;
4
4
  model: GridBookmarkModel;
@@ -3,14 +3,14 @@ import { useState } from 'react';
3
3
  import { AssemblySelector, Dialog, ErrorMessage, FileSelector, } from '@jbrowse/core/ui';
4
4
  import { getSession } from '@jbrowse/core/util';
5
5
  import { openLocation } from '@jbrowse/core/util/io';
6
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
6
7
  import { isSessionWithShareURL } from '@jbrowse/core/util/types';
7
8
  import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
8
9
  import ImportIcon from '@mui/icons-material/Publish';
9
10
  import { Accordion, AccordionDetails, AccordionSummary, Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
10
11
  import { observer } from 'mobx-react';
11
- import { makeStyles } from 'tss-react/mui';
12
- import { readSessionFromDynamo } from '../../sessionSharing';
13
- import { fromUrlSafeB64 } from '../../utils';
12
+ import { readSessionFromDynamo } from "../../sessionSharing.js";
13
+ import { fromUrlSafeB64 } from "../../utils.js";
14
14
  const useStyles = makeStyles()(theme => ({
15
15
  expandIcon: {
16
16
  color: theme.palette.tertiary.contrastText || '#fff',
@@ -24,7 +24,7 @@ async function getBookmarksFromShareLink(shareLink, shareURL) {
24
24
  const urlParams = new URL(shareLink);
25
25
  const sessionQueryParam = urlParams.searchParams.get('bookmarks');
26
26
  const password = urlParams.searchParams.get('password');
27
- const decryptedSession = await readSessionFromDynamo(`${shareURL !== null && shareURL !== void 0 ? shareURL : defaultURL}load`, sessionQueryParam || '', password || '');
27
+ const decryptedSession = await readSessionFromDynamo(`${shareURL ?? defaultURL}load`, sessionQueryParam || '', password || '');
28
28
  const sharedSession = JSON.parse(await fromUrlSafeB64(decryptedSession));
29
29
  return sharedSession.sharedBookmarks;
30
30
  }
@@ -64,7 +64,7 @@ async function getBookmarksFromBEDFile(lines, selectedAsm) {
64
64
  };
65
65
  });
66
66
  }
67
- const ImportBookmarksDialog = observer(function ({ onClose, model, }) {
67
+ const ImportBookmarksDialog = observer(function ImportBookmarksDialog({ onClose, model, }) {
68
68
  const { classes } = useStyles();
69
69
  const [location, setLocation] = useState();
70
70
  const [error, setError] = useState();
@@ -1,4 +1,4 @@
1
- import type { GridBookmarkModel } from '../../model';
1
+ import type { GridBookmarkModel } from '../../model.ts';
2
2
  declare const ShareBookmarksDialog: ({ onClose, model, }: {
3
3
  onClose: () => void;
4
4
  model: GridBookmarkModel;
@@ -2,13 +2,12 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { useEffect, useState } from 'react';
3
3
  import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
4
4
  import { getSession, isSessionWithShareURL } from '@jbrowse/core/util';
5
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
6
+ import { getSnapshot } from '@jbrowse/mobx-state-tree';
5
7
  import ContentCopyIcon from '@mui/icons-material/ContentCopy';
6
8
  import { Alert, Button, DialogActions, DialogContent, DialogContentText, TextField, Typography, } from '@mui/material';
7
- import copy from 'copy-to-clipboard';
8
9
  import { observer } from 'mobx-react';
9
- import { getSnapshot } from 'mobx-state-tree';
10
- import { makeStyles } from 'tss-react/mui';
11
- import { shareSessionToDynamo } from '../../sessionSharing';
10
+ import { shareSessionToDynamo } from "../../sessionSharing.js";
12
11
  const useStyles = makeStyles()(() => ({
13
12
  flexItem: {
14
13
  margin: 5,
@@ -19,7 +18,7 @@ const useStyles = makeStyles()(() => ({
19
18
  gap: '5px',
20
19
  },
21
20
  }));
22
- const ShareBookmarksDialog = observer(function ({ onClose, model, }) {
21
+ const ShareBookmarksDialog = observer(function ShareBookmarksDialog({ onClose, model, }) {
23
22
  const { classes } = useStyles();
24
23
  const [url, setUrl] = useState('');
25
24
  const [error, setError] = useState();
@@ -64,6 +63,7 @@ const ShareBookmarksDialog = observer(function ({ onClose, model, }) {
64
63
  const target = event.target;
65
64
  target.select();
66
65
  } })), _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 () => {
66
+ const { default: copy } = await import('copy-to-clipboard');
67
67
  copy(url);
68
68
  session.notify('Copied to clipboard', 'success');
69
69
  onClose();
@@ -1,8 +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
- import AddHighlightModelF from './components/Highlight';
5
- import stateModelFactory from './model';
4
+ import AddHighlightModelF from "./components/Highlight/index.js";
5
+ import stateModelFactory from "./model.js";
6
6
  const configSchema = ConfigurationSchema('GridBookmarkWidget', {});
7
7
  export default function GridBookmarkWidgetF(pluginManager) {
8
8
  pluginManager.addWidgetType(() => {
@@ -11,7 +11,7 @@ export default function GridBookmarkWidgetF(pluginManager) {
11
11
  heading: 'Bookmarked regions',
12
12
  configSchema,
13
13
  stateModel: stateModelFactory(pluginManager),
14
- ReactComponent: lazy(() => import('./components/GridBookmarkWidget')),
14
+ ReactComponent: lazy(() => import("./components/GridBookmarkWidget.js")),
15
15
  });
16
16
  });
17
17
  AddHighlightModelF(pluginManager);