@jbrowse/core 2.6.3 → 2.7.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/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +0 -9
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +1 -3
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +0 -9
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +0 -9
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +18 -8
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +0 -9
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +0 -9
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +0 -9
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +2 -11
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +5 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.d.ts +1 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +1 -1
- package/BaseFeatureWidget/util.js +0 -4
- package/PluginManager.d.ts +9 -17
- package/ReExports/modules.d.ts +5 -5
- package/ReExports/modules.js +24 -18
- package/TextSearch/TextSearchManager.d.ts +1 -1
- package/assemblyManager/assembly.d.ts +2 -0
- package/assemblyManager/assembly.js +9 -4
- package/assemblyManager/assemblyManager.d.ts +123 -111
- package/assemblyManager/assemblyManager.js +1 -1
- package/configuration/configurationSchema.js +2 -2
- package/configuration/configurationSlot.js +3 -6
- package/data_adapters/BaseAdapter/index.d.ts +1 -3
- package/data_adapters/dataAdapterCache.js +2 -2
- package/package.json +5 -6
- package/pluggableElementTypes/AdapterType.d.ts +2 -2
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +5 -5
- package/pluggableElementTypes/models/BaseTrackModel.js +1 -16
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +2 -2
- package/pluggableElementTypes/models/InternetAccountModel.js +2 -2
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +1 -3
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +3 -0
- package/pluggableElementTypes/renderers/RendererType.js +1 -1
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +7 -3
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +45 -2
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +2 -2
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +49 -12
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +2 -2
- package/rpc/RpcManager.d.ts +2 -2
- package/rpc/WebWorkerRpcDriver.js +3 -3
- package/rpc/methods/CoreGetFeatureDensityStats.js +0 -1
- package/rpc/methods/CoreGetFeatureDetails.js +0 -1
- package/rpc/methods/CoreGetFeatures.js +0 -1
- package/rpc/methods/CoreRender.js +0 -1
- package/rpc/remoteAbortSignals.d.ts +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/ColorPicker.js +3 -6
- package/ui/Dialog.d.ts +2 -2
- package/ui/Dialog.js +2 -1
- package/ui/DropDownMenu.d.ts +3 -4
- package/ui/DropDownMenu.js +8 -12
- package/ui/EditableTypography.js +7 -5
- package/ui/FactoryResetDialog.d.ts +3 -4
- package/ui/FactoryResetDialog.js +3 -2
- package/ui/FileSelector/FileSelector.d.ts +2 -2
- package/ui/FileSelector/FileSelector.js +2 -1
- package/ui/FileSelector/LocalFileChooser.d.ts +2 -2
- package/ui/FileSelector/LocalFileChooser.js +4 -3
- package/ui/FileSelector/UrlChooser.d.ts +5 -5
- package/ui/FileSelector/UrlChooser.js +2 -2
- package/ui/Menu.js +1 -1
- package/ui/MenuButton.d.ts +8 -0
- package/ui/MenuButton.js +42 -0
- package/ui/ResizeBar.d.ts +0 -4
- package/ui/ResizeBar.js +12 -31
- package/ui/ResizeHandle.d.ts +3 -2
- package/ui/ResizeHandle.js +10 -7
- package/ui/ReturnToImportFormDialog.d.ts +4 -5
- package/ui/ReturnToImportFormDialog.js +3 -3
- package/ui/SanitizedHTML.d.ts +1 -2
- package/ui/SanitizedHTML.js +4 -3
- package/ui/Snackbar.d.ts +2 -2
- package/ui/Snackbar.js +2 -1
- package/ui/Tooltip.d.ts +4 -7
- package/ui/Tooltip.js +3 -3
- package/ui/theme.d.ts +1 -3
- package/ui/theme.js +2 -2
- package/ui/useResizeBar.d.ts +5 -0
- package/ui/useResizeBar.js +22 -0
- package/util/Base1DUtils.js +0 -1
- package/util/blobToDataURL.d.ts +1 -0
- package/util/blobToDataURL.js +18 -0
- package/util/blockTypes.d.ts +1 -9
- package/util/blockTypes.js +5 -21
- package/util/calculateDynamicBlocks.js +3 -2
- package/util/calculateStaticBlocks.js +3 -4
- package/util/colord.d.ts +1 -0
- package/util/colord.js +13 -0
- package/util/dedupe.js +1 -2
- package/util/index.d.ts +16 -17
- package/util/index.js +27 -26
- package/util/io/RemoteFileWithRangeCache.js +2 -2
- package/util/layouts/GranularRectLayout.js +1 -2
- package/util/map-obj.d.ts +1 -1
- package/util/nanoid.d.ts +5 -0
- package/util/nanoid.js +73 -0
- package/util/offscreenCanvasPonyfill.js +1 -2
- package/util/offscreenCanvasUtils.js +3 -2
- package/util/tracks.d.ts +2 -6
- package/util/types/index.d.ts +36 -10
- package/util/types/index.js +5 -1
- package/util/types/mst.js +2 -2
- package/BaseFeatureWidget/BaseFeatureDetail/UriLink.d.ts +0 -7
- package/BaseFeatureWidget/BaseFeatureDetail/UriLink.js +0 -13
package/ui/ColorPicker.js
CHANGED
|
@@ -22,13 +22,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
exports.ColorPicker = exports.ColorPopover = exports.PopoverPicker = void 0;
|
|
30
27
|
const react_1 = __importStar(require("react"));
|
|
31
|
-
const
|
|
28
|
+
const colord_1 = require("@jbrowse/core/util/colord");
|
|
32
29
|
const material_1 = require("@mui/material");
|
|
33
30
|
const mui_1 = require("tss-react/mui");
|
|
34
31
|
// locals
|
|
@@ -74,12 +71,12 @@ function ColorPicker({ onChange, color, }) {
|
|
|
74
71
|
const presetColors = paletteColors[val];
|
|
75
72
|
const palettes = Object.keys(paletteColors);
|
|
76
73
|
const [text, setText] = (0, react_1.useState)(color);
|
|
77
|
-
const rgb = (0,
|
|
74
|
+
const rgb = (0, colord_1.colord)(color).toRgbString();
|
|
78
75
|
const rgbDebounced = (0, util_1.useDebounce)(rgb, 1000);
|
|
79
76
|
const handleChange = (val) => {
|
|
80
77
|
setText(val);
|
|
81
78
|
try {
|
|
82
|
-
onChange((0,
|
|
79
|
+
onChange((0, colord_1.colord)(val).toRgbString());
|
|
83
80
|
}
|
|
84
81
|
catch (e) { }
|
|
85
82
|
};
|
package/ui/Dialog.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { DialogProps } from '@mui/material';
|
|
|
3
3
|
interface Props extends DialogProps {
|
|
4
4
|
header?: React.ReactNode;
|
|
5
5
|
}
|
|
6
|
-
declare const
|
|
7
|
-
export default
|
|
6
|
+
declare const Dialog: (props: Props) => React.JSX.Element;
|
|
7
|
+
export default Dialog;
|
package/ui/Dialog.js
CHANGED
|
@@ -24,7 +24,7 @@ function DialogError({ error }) {
|
|
|
24
24
|
return (react_1.default.createElement("div", { style: { width: 800, margin: 40 } },
|
|
25
25
|
react_1.default.createElement(ErrorMessage_1.default, { error: error })));
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
const Dialog = (0, mobx_react_1.observer)(function (props) {
|
|
28
28
|
const { classes } = useStyles();
|
|
29
29
|
const { title, header, children, onClose } = props;
|
|
30
30
|
const theme = (0, material_1.useTheme)();
|
|
@@ -52,3 +52,4 @@ exports.default = (0, mobx_react_1.observer)(function JBrowseDialog(props) {
|
|
|
52
52
|
},
|
|
53
53
|
}) }, children)))));
|
|
54
54
|
});
|
|
55
|
+
exports.default = Dialog;
|
package/ui/DropDownMenu.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MenuItem } from './Menu';
|
|
3
|
-
declare
|
|
3
|
+
declare const DropDownMenu: ({ menuTitle, session, menuItems, }: {
|
|
4
4
|
menuTitle: string;
|
|
5
5
|
session: any;
|
|
6
6
|
menuItems: MenuItem[];
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default _default;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default DropDownMenu;
|
package/ui/DropDownMenu.js
CHANGED
|
@@ -42,24 +42,20 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
}));
|
|
45
|
-
|
|
45
|
+
const DropDownMenu = (0, mobx_react_1.observer)(function ({ menuTitle, session, menuItems, }) {
|
|
46
46
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
47
47
|
const anchorEl = (0, react_1.useRef)(null);
|
|
48
48
|
const { classes } = useStyles();
|
|
49
|
-
function handleToggle() {
|
|
50
|
-
setOpen(!open);
|
|
51
|
-
}
|
|
52
|
-
function handleMenuItemClick(_event, callback) {
|
|
53
|
-
callback(session);
|
|
54
|
-
handleClose();
|
|
55
|
-
}
|
|
56
49
|
function handleClose() {
|
|
57
50
|
setOpen(false);
|
|
58
51
|
}
|
|
59
52
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
60
|
-
react_1.default.createElement(material_1.Button, { ref: anchorEl, onClick:
|
|
53
|
+
react_1.default.createElement(material_1.Button, { ref: anchorEl, onClick: () => setOpen(!open), color: "inherit", "data-testid": "dropDownMenuButton", classes: { root: classes.buttonRoot } },
|
|
61
54
|
menuTitle,
|
|
62
55
|
react_1.default.createElement(ArrowDropDown_1.default, null)),
|
|
63
|
-
react_1.default.createElement(Menu_1.default, { anchorEl: anchorEl.current, anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, onMenuItemClick:
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
react_1.default.createElement(Menu_1.default, { anchorEl: anchorEl.current, anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, onMenuItemClick: (_event, callback) => {
|
|
57
|
+
callback(session);
|
|
58
|
+
handleClose();
|
|
59
|
+
}, open: open, onClose: handleClose, menuItems: menuItems })));
|
|
60
|
+
});
|
|
61
|
+
exports.default = DropDownMenu;
|
package/ui/EditableTypography.js
CHANGED
|
@@ -22,10 +22,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
const react_1 = __importStar(require("react"));
|
|
27
30
|
const material_1 = require("@mui/material");
|
|
28
31
|
const mui_1 = require("tss-react/mui");
|
|
32
|
+
const useMeasure_1 = __importDefault(require("@jbrowse/core/util/useMeasure"));
|
|
29
33
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
30
34
|
input: {},
|
|
31
35
|
inputBase: {},
|
|
@@ -45,10 +49,10 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
45
49
|
},
|
|
46
50
|
}));
|
|
47
51
|
// using forwardRef so that MUI Tooltip can wrap this component
|
|
48
|
-
const EditableTypography = react_1.default.forwardRef(function (props, ref) {
|
|
52
|
+
const EditableTypography = react_1.default.forwardRef(function EditableTypography2(props, ref) {
|
|
49
53
|
const { value, setValue, variant, ...other } = props;
|
|
54
|
+
const [ref2, { width }] = (0, useMeasure_1.default)();
|
|
50
55
|
const [editedValue, setEditedValue] = (0, react_1.useState)();
|
|
51
|
-
const [sizerNode, setSizerNode] = (0, react_1.useState)(null);
|
|
52
56
|
const [inputNode, setInputNode] = (0, react_1.useState)(null);
|
|
53
57
|
const [blur, setBlur] = (0, react_1.useState)(false);
|
|
54
58
|
(0, react_1.useEffect)(() => {
|
|
@@ -62,12 +66,10 @@ const EditableTypography = react_1.default.forwardRef(function (props, ref) {
|
|
|
62
66
|
// @ts-expect-error
|
|
63
67
|
const { classes } = useStyles(props, { props });
|
|
64
68
|
const theme = (0, material_1.useTheme)();
|
|
65
|
-
const clientWidth = sizerNode === null || sizerNode === void 0 ? void 0 : sizerNode.clientWidth;
|
|
66
|
-
const width = clientWidth || 0;
|
|
67
69
|
const val = editedValue === undefined ? value : editedValue;
|
|
68
70
|
return (react_1.default.createElement("div", { ...other, ref: ref },
|
|
69
71
|
react_1.default.createElement("div", { style: { position: 'relative' } },
|
|
70
|
-
react_1.default.createElement(material_1.Typography, { ref:
|
|
72
|
+
react_1.default.createElement(material_1.Typography, { ref: ref2, component: "span", variant: variant, className: classes.typography }, val)),
|
|
71
73
|
react_1.default.createElement(material_1.InputBase, { inputRef: node => setInputNode(node), className: classes.inputBase, inputProps: {
|
|
72
74
|
style: {
|
|
73
75
|
width,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
onClose:
|
|
2
|
+
export default function FactoryResetDialog({ onClose, open, onFactoryReset, }: {
|
|
3
|
+
onClose: () => void;
|
|
4
4
|
open: boolean;
|
|
5
5
|
onFactoryReset: Function;
|
|
6
|
-
})
|
|
7
|
-
export default _default;
|
|
6
|
+
}): React.JSX.Element;
|
package/ui/FactoryResetDialog.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const Dialog_1 = __importDefault(require("@jbrowse/core/ui/Dialog"));
|
|
9
|
-
|
|
9
|
+
function FactoryResetDialog({ onClose, open, onFactoryReset, }) {
|
|
10
10
|
function handleDialogClose(action) {
|
|
11
11
|
if (action === 'reset') {
|
|
12
12
|
onFactoryReset();
|
|
@@ -19,4 +19,5 @@ exports.default = ({ onClose, open, onFactoryReset, }) => {
|
|
|
19
19
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
20
20
|
react_1.default.createElement(material_1.Button, { onClick: () => handleDialogClose(), color: "primary" }, "Cancel"),
|
|
21
21
|
react_1.default.createElement(material_1.Button, { onClick: () => handleDialogClose('reset'), color: "primary", variant: "contained" }, "OK"))));
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
|
+
exports.default = FactoryResetDialog;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FileLocation, AbstractRootModel } from '../../util/types';
|
|
3
|
-
declare const
|
|
3
|
+
declare const FileSelector: (props: {
|
|
4
4
|
location?: FileLocation | undefined;
|
|
5
5
|
setLocation: (param: FileLocation) => void;
|
|
6
6
|
setName?: ((str: string) => void) | undefined;
|
|
@@ -8,4 +8,4 @@ declare const _default: (props: {
|
|
|
8
8
|
description?: string | undefined;
|
|
9
9
|
rootModel?: AbstractRootModel | undefined;
|
|
10
10
|
}) => React.JSX.Element;
|
|
11
|
-
export default
|
|
11
|
+
export default FileSelector;
|
|
@@ -47,7 +47,7 @@ function shorten(str, len) {
|
|
|
47
47
|
}
|
|
48
48
|
return str;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
const FileSelector = (0, mobx_react_1.observer)(function (props) {
|
|
51
51
|
const { location, name, description, rootModel, setLocation } = props;
|
|
52
52
|
const fileOrUrl = !location || (0, types_1.isUriLocation)(location) ? 'url' : 'file';
|
|
53
53
|
const [toggleButtonValue, setToggleButtonValue] = (0, react_1.useState)(location && 'internetAccountId' in location && location.internetAccountId
|
|
@@ -120,3 +120,4 @@ exports.default = (0, mobx_react_1.observer)(function (props) {
|
|
|
120
120
|
locationInput,
|
|
121
121
|
react_1.default.createElement(material_1.FormHelperText, null, description)));
|
|
122
122
|
});
|
|
123
|
+
exports.default = FileSelector;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FileLocation } from '../../util/types';
|
|
3
|
-
declare function LocalFileChooser(
|
|
3
|
+
declare function LocalFileChooser({ location, setLocation, }: {
|
|
4
4
|
location?: FileLocation;
|
|
5
|
-
setLocation:
|
|
5
|
+
setLocation: (arg: FileLocation) => void;
|
|
6
6
|
}): React.JSX.Element;
|
|
7
7
|
export default LocalFileChooser;
|
|
@@ -19,9 +19,8 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
19
19
|
marginLeft: theme.spacing(1),
|
|
20
20
|
},
|
|
21
21
|
}));
|
|
22
|
-
function LocalFileChooser(
|
|
22
|
+
function LocalFileChooser({ location, setLocation, }) {
|
|
23
23
|
const { classes } = useStyles();
|
|
24
|
-
const { location, setLocation } = props;
|
|
25
24
|
const filename = location &&
|
|
26
25
|
((isBlobLocation(location) && location.name) ||
|
|
27
26
|
(isLocalPathLocation(location) && location.localPath));
|
|
@@ -32,7 +31,8 @@ function LocalFileChooser(props) {
|
|
|
32
31
|
react_1.default.createElement(material_1.Button, { variant: "outlined", component: "label" },
|
|
33
32
|
"Choose File",
|
|
34
33
|
react_1.default.createElement("input", { type: "file", hidden: true, onChange: ({ target }) => {
|
|
35
|
-
|
|
34
|
+
var _a;
|
|
35
|
+
const file = (_a = target === null || target === void 0 ? void 0 : target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
36
36
|
if (file) {
|
|
37
37
|
if (util_1.isElectron) {
|
|
38
38
|
setLocation({
|
|
@@ -41,6 +41,7 @@ function LocalFileChooser(props) {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
|
+
// @ts-expect-error
|
|
44
45
|
setLocation((0, tracks_1.storeBlobLocation)({ blob: file }));
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FileLocation } from '../../util/types';
|
|
3
|
-
declare const
|
|
4
|
-
location?: FileLocation;
|
|
5
|
-
setLocation:
|
|
6
|
-
label?: string;
|
|
3
|
+
declare const UrlChooser: ({ location, setLocation, label, }: {
|
|
4
|
+
location?: FileLocation | undefined;
|
|
5
|
+
setLocation: (arg: FileLocation) => void;
|
|
6
|
+
label?: string | undefined;
|
|
7
7
|
}) => React.JSX.Element;
|
|
8
|
-
export default
|
|
8
|
+
export default UrlChooser;
|
|
@@ -7,8 +7,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const mobx_react_1 = require("mobx-react");
|
|
9
9
|
const types_1 = require("../../util/types");
|
|
10
|
-
|
|
11
|
-
const { location, setLocation, label } = props;
|
|
10
|
+
const UrlChooser = (0, mobx_react_1.observer)(function ({ location, setLocation, label, }) {
|
|
12
11
|
return (react_1.default.createElement(material_1.TextField, { fullWidth: true, variant: "outlined", inputProps: { 'data-testid': 'urlInput' }, defaultValue: location && (0, types_1.isUriLocation)(location) ? location.uri : '', label: label || 'Enter URL', onChange: event => {
|
|
13
12
|
setLocation({
|
|
14
13
|
uri: event.target.value.trim(),
|
|
@@ -16,3 +15,4 @@ exports.default = (0, mobx_react_1.observer)(function UrlChooser(props) {
|
|
|
16
15
|
});
|
|
17
16
|
} }));
|
|
18
17
|
});
|
|
18
|
+
exports.default = UrlChooser;
|
package/ui/Menu.js
CHANGED
|
@@ -115,7 +115,7 @@ function findPreviousValidIdx(menuItems, currentIdx) {
|
|
|
115
115
|
menuItem.type !== 'subHeader' &&
|
|
116
116
|
!menuItem.disabled);
|
|
117
117
|
}
|
|
118
|
-
const MenuPage = react_1.default.forwardRef((props, ref)
|
|
118
|
+
const MenuPage = react_1.default.forwardRef(function MenuPage2(props, ref) {
|
|
119
119
|
const [subMenuAnchorEl, setSubMenuAnchorEl] = (0, react_1.useState)();
|
|
120
120
|
const [openSubMenuIdx, setOpenSubMenuIdx] = (0, react_1.useState)();
|
|
121
121
|
const [isSubMenuOpen, setIsSubMenuOpen] = (0, react_1.useState)(false);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuItem } from '@jbrowse/core/ui';
|
|
3
|
+
declare const MenuButton: ({ children, menuItems, ...rest }: {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
6
|
+
menuItems: MenuItem[];
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default MenuButton;
|
package/ui/MenuButton.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const Menu_1 = __importDefault(require("@jbrowse/core/ui/Menu"));
|
|
31
|
+
const material_1 = require("@mui/material");
|
|
32
|
+
const mobx_react_1 = require("mobx-react");
|
|
33
|
+
const MenuButton = (0, mobx_react_1.observer)(function MenuButton({ children, menuItems, ...rest }) {
|
|
34
|
+
const [anchorEl, setAnchorEl] = (0, react_1.useState)();
|
|
35
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
36
|
+
react_1.default.createElement(material_1.IconButton, { ...rest, onClick: event => setAnchorEl(event.currentTarget) }, children),
|
|
37
|
+
react_1.default.createElement(Menu_1.default, { open: !!anchorEl, anchorEl: anchorEl, onClose: () => setAnchorEl(undefined), onMenuItemClick: (_, callback) => {
|
|
38
|
+
callback();
|
|
39
|
+
setAnchorEl(undefined);
|
|
40
|
+
}, menuItems: menuItems })));
|
|
41
|
+
});
|
|
42
|
+
exports.default = MenuButton;
|
package/ui/ResizeBar.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare function useResizeBar(): {
|
|
3
|
-
ref: React.RefObject<HTMLDivElement>;
|
|
4
|
-
scrollLeft: number;
|
|
5
|
-
};
|
|
6
2
|
export default function ResizeBar({ widths, setWidths, checkbox, scrollLeft, }: {
|
|
7
3
|
widths: number[];
|
|
8
4
|
setWidths: (arg: number[]) => void;
|
package/ui/ResizeBar.js
CHANGED
|
@@ -26,7 +26,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.useResizeBar = void 0;
|
|
30
29
|
const react_1 = __importStar(require("react"));
|
|
31
30
|
const mui_1 = require("tss-react/mui");
|
|
32
31
|
// locals
|
|
@@ -51,49 +50,31 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
51
50
|
width: 5,
|
|
52
51
|
},
|
|
53
52
|
}));
|
|
54
|
-
function
|
|
55
|
-
const ref = (0, react_1.useRef)(null);
|
|
56
|
-
const [scrollLeft, setScrollLeft] = (0, react_1.useState)(0);
|
|
57
|
-
(0, react_1.useEffect)(() => {
|
|
58
|
-
const timer = setInterval(() => {
|
|
59
|
-
var _a;
|
|
60
|
-
const elt = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.querySelector('.MuiDataGrid-virtualScroller');
|
|
61
|
-
if (elt) {
|
|
62
|
-
setScrollLeft(elt.scrollLeft);
|
|
63
|
-
}
|
|
64
|
-
}, 100);
|
|
65
|
-
return () => {
|
|
66
|
-
clearInterval(timer);
|
|
67
|
-
};
|
|
68
|
-
}, []);
|
|
69
|
-
return { ref, scrollLeft };
|
|
70
|
-
}
|
|
71
|
-
exports.useResizeBar = useResizeBar;
|
|
72
|
-
function Tick({ left, scrollLeft, idx, onDrag, }) {
|
|
53
|
+
function Tick({ left, scrollLeft, idx, onDrag, onMouseDown, }) {
|
|
73
54
|
const { classes } = useStyles();
|
|
74
|
-
const
|
|
75
|
-
onDrag(d, idx);
|
|
76
|
-
}, [idx, onDrag]);
|
|
55
|
+
const onDragCallback = (0, react_1.useCallback)((lastFrameDistance, totalDistance) => onDrag(lastFrameDistance, totalDistance, idx), [idx, onDrag]);
|
|
77
56
|
// has an invisible wider than tick mark (1px) clickable area (5px)
|
|
78
57
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
79
|
-
react_1.default.createElement(ResizeHandle_1.default, { onDrag:
|
|
58
|
+
react_1.default.createElement(ResizeHandle_1.default, { onDrag: onDragCallback, onMouseDown: onMouseDown, vertical: true, className: classes.hiddenTick, style: { left: left - scrollLeft - 2.5 } }),
|
|
80
59
|
react_1.default.createElement("div", { style: { left: left - scrollLeft }, className: classes.tick })));
|
|
81
60
|
}
|
|
82
61
|
function ResizeBar({ widths, setWidths, checkbox, scrollLeft = 0, }) {
|
|
83
62
|
const { classes } = useStyles();
|
|
84
63
|
const offsets = [];
|
|
64
|
+
const [initial, setInitial] = (0, react_1.useState)();
|
|
85
65
|
let init = checkbox ? 52 : 0;
|
|
86
66
|
for (let i = 0; i < widths.length; i++) {
|
|
87
67
|
const width = widths[i];
|
|
88
68
|
offsets[i] = width + init;
|
|
89
69
|
init += width;
|
|
90
70
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
71
|
+
return (react_1.default.createElement("div", { className: classes.resizeBar }, offsets.map((left, i) => (react_1.default.createElement(Tick, { key: i, onMouseDown: () => {
|
|
72
|
+
setInitial([...widths]);
|
|
73
|
+
}, left: i === offsets.length - 1 ? left - 3 : left, onDrag: (_, totalDistance, idx) => {
|
|
74
|
+
const newWidths = [...widths];
|
|
75
|
+
// mui doesn't allow columns smaller than 50
|
|
76
|
+
newWidths[idx] = Math.max(initial[idx] - totalDistance, 50);
|
|
77
|
+
setWidths(newWidths);
|
|
78
|
+
}, idx: i, scrollLeft: scrollLeft })))));
|
|
98
79
|
}
|
|
99
80
|
exports.default = ResizeBar;
|
package/ui/ResizeHandle.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare function ResizeHandle({ onDrag, vertical, flexbox, className: originalClassName, ...props }: {
|
|
3
|
-
onDrag: (
|
|
2
|
+
declare function ResizeHandle({ onDrag, vertical, flexbox, className: originalClassName, onMouseDown, ...props }: {
|
|
3
|
+
onDrag: (lastFrameDistance: number, totalDistance: number) => number | void;
|
|
4
|
+
onMouseDown?: (event: React.MouseEvent) => void;
|
|
4
5
|
vertical?: boolean;
|
|
5
6
|
flexbox?: boolean;
|
|
6
7
|
className?: string;
|
package/ui/ResizeHandle.js
CHANGED
|
@@ -43,19 +43,19 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
43
43
|
alignSelf: 'stretch', // similar to above
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
|
-
function ResizeHandle({ onDrag, vertical = false, flexbox = false, className: originalClassName, ...props }) {
|
|
46
|
+
function ResizeHandle({ onDrag, vertical = false, flexbox = false, className: originalClassName, onMouseDown, ...props }) {
|
|
47
47
|
const [mouseDragging, setMouseDragging] = (0, react_1.useState)(false);
|
|
48
|
+
const initialPosition = (0, react_1.useRef)(0);
|
|
48
49
|
const prevPos = (0, react_1.useRef)(0);
|
|
49
50
|
const { classes, cx } = useStyles();
|
|
50
51
|
(0, react_1.useEffect)(() => {
|
|
51
52
|
function mouseMove(event) {
|
|
52
53
|
event.preventDefault();
|
|
53
54
|
const pos = vertical ? event.clientX : event.clientY;
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
55
|
+
const totalDistance = initialPosition.current - pos;
|
|
56
|
+
const lastFrameDistance = pos - prevPos.current;
|
|
57
|
+
prevPos.current = pos;
|
|
58
|
+
onDrag(lastFrameDistance, totalDistance);
|
|
59
59
|
}
|
|
60
60
|
function mouseUp() {
|
|
61
61
|
setMouseDragging(false);
|
|
@@ -84,8 +84,11 @@ function ResizeHandle({ onDrag, vertical = false, flexbox = false, className: or
|
|
|
84
84
|
}
|
|
85
85
|
return (react_1.default.createElement("div", { "data-resizer": "true", onMouseDown: event => {
|
|
86
86
|
event.preventDefault();
|
|
87
|
-
|
|
87
|
+
const pos = vertical ? event.clientX : event.clientY;
|
|
88
|
+
initialPosition.current = pos;
|
|
89
|
+
prevPos.current = pos;
|
|
88
90
|
setMouseDragging(true);
|
|
91
|
+
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(event);
|
|
89
92
|
}, className: cx(className, originalClassName), ...props }));
|
|
90
93
|
}
|
|
91
94
|
exports.default = ResizeHandle;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare
|
|
2
|
+
declare const ReturnToImportFormDialog: ({ model, handleClose, }: {
|
|
3
3
|
model: {
|
|
4
|
-
clearView:
|
|
4
|
+
clearView: () => void;
|
|
5
5
|
};
|
|
6
6
|
handleClose: () => void;
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default _default;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default ReturnToImportFormDialog;
|
|
@@ -7,7 +7,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
7
7
|
const mobx_react_1 = require("mobx-react");
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
9
|
const Dialog_1 = __importDefault(require("./Dialog"));
|
|
10
|
-
|
|
10
|
+
const ReturnToImportFormDialog = (0, mobx_react_1.observer)(function ({ model, handleClose, }) {
|
|
11
11
|
return (react_1.default.createElement(Dialog_1.default, { maxWidth: "xl", open: true, onClose: handleClose, title: "Reference sequence" },
|
|
12
12
|
react_1.default.createElement(material_1.DialogContent, null,
|
|
13
13
|
react_1.default.createElement(material_1.Typography, null, "Are you sure you want to return to the import form? This will lose your current view")),
|
|
@@ -17,5 +17,5 @@ function ReturnToImportFormDialog({ model, handleClose, }) {
|
|
|
17
17
|
handleClose();
|
|
18
18
|
}, variant: "contained", color: "primary", autoFocus: true }, "OK"),
|
|
19
19
|
react_1.default.createElement(material_1.Button, { onClick: () => handleClose(), color: "secondary", variant: "contained" }, "Cancel"))));
|
|
20
|
-
}
|
|
21
|
-
exports.default =
|
|
20
|
+
});
|
|
21
|
+
exports.default = ReturnToImportFormDialog;
|
package/ui/SanitizedHTML.d.ts
CHANGED
package/ui/SanitizedHTML.js
CHANGED
|
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isHTML = void 0;
|
|
7
6
|
const react_1 = __importDefault(require("react"));
|
|
8
7
|
const escape_html_1 = __importDefault(require("escape-html"));
|
|
9
8
|
const dompurify_1 = __importDefault(require("dompurify"));
|
|
9
|
+
const util_1 = require("../util");
|
|
10
10
|
// source https://github.com/sindresorhus/html-tags/blob/master/html-tags.json
|
|
11
11
|
// with some random uncommon ones removed. note: we just use this to run the content
|
|
12
12
|
// through dompurify without escaping if we see an htmlTag from this list
|
|
@@ -52,14 +52,15 @@ const full = new RegExp(htmlTags.map(tag => `<${tag}\\b[^>]*>`).join('|'), 'i');
|
|
|
52
52
|
function isHTML(str) {
|
|
53
53
|
return full.test(str);
|
|
54
54
|
}
|
|
55
|
-
exports.isHTML = isHTML;
|
|
56
55
|
// note this is mocked during testing, see
|
|
57
56
|
// packages/__mocks__/@jbrowse/core/ui/SanitizedHTML something about dompurify
|
|
58
57
|
// behavior causes errors during tests, was seen in
|
|
59
58
|
// products/jbrowse-web/src/tests/Connection.test.tsx test (can delete mock to
|
|
60
59
|
// see)
|
|
61
60
|
//
|
|
62
|
-
function SanitizedHTML({ html }) {
|
|
61
|
+
function SanitizedHTML({ html: pre }) {
|
|
62
|
+
// try to add links to the text first
|
|
63
|
+
const html = (0, util_1.linkify)(pre);
|
|
63
64
|
const value = isHTML(html) ? html : (0, escape_html_1.default)(html);
|
|
64
65
|
if (!added) {
|
|
65
66
|
added = true;
|
package/ui/Snackbar.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface SnackbarSession extends AbstractSessionModel {
|
|
|
5
5
|
snackbarMessages: SnackbarMessage[];
|
|
6
6
|
popSnackbarMessage: () => void;
|
|
7
7
|
}
|
|
8
|
-
declare const
|
|
8
|
+
declare const Snackbar: ({ session }: {
|
|
9
9
|
session: SnackbarSession;
|
|
10
10
|
}) => React.JSX.Element | null;
|
|
11
|
-
export default
|
|
11
|
+
export default Snackbar;
|
package/ui/Snackbar.js
CHANGED
|
@@ -8,7 +8,7 @@ const material_1 = require("@mui/material");
|
|
|
8
8
|
const mobx_react_1 = require("mobx-react");
|
|
9
9
|
// icons
|
|
10
10
|
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
11
|
-
|
|
11
|
+
const Snackbar = (0, mobx_react_1.observer)(function ({ session }) {
|
|
12
12
|
const { snackbarMessages } = session;
|
|
13
13
|
const latestMessage = snackbarMessages.at(-1);
|
|
14
14
|
const handleClose = (_event, reason) => {
|
|
@@ -26,3 +26,4 @@ exports.default = (0, mobx_react_1.observer)(function MessageSnackbar({ session,
|
|
|
26
26
|
react_1.default.createElement(material_1.IconButton, { color: "inherit", onClick: handleClose },
|
|
27
27
|
react_1.default.createElement(Close_1.default, null)))) : null, severity: latestMessage.level || 'warning' }, latestMessage.message))) : null;
|
|
28
28
|
});
|
|
29
|
+
exports.default = Snackbar;
|
package/ui/Tooltip.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Feature } from '../util';
|
|
3
|
-
|
|
3
|
+
import { AnyConfigurationModel } from '../configuration';
|
|
4
|
+
declare const Tooltip: ({ offsetX, offsetY, configuration, feature, timeout, }: {
|
|
4
5
|
offsetX: number;
|
|
5
6
|
offsetY: number;
|
|
6
|
-
configuration:
|
|
7
|
-
[x: string]: any;
|
|
8
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
9
|
-
setSubschema(slotName: string, data: unknown): any;
|
|
10
|
-
} & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>;
|
|
7
|
+
configuration: AnyConfigurationModel;
|
|
11
8
|
feature?: Feature | undefined;
|
|
12
9
|
timeout?: number | undefined;
|
|
13
10
|
}) => React.JSX.Element | null;
|
|
14
|
-
export default
|
|
11
|
+
export default Tooltip;
|
package/ui/Tooltip.js
CHANGED
|
@@ -36,7 +36,7 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
36
36
|
zIndex: 10000,
|
|
37
37
|
},
|
|
38
38
|
});
|
|
39
|
-
const Tooltip = ({ offsetX, offsetY, configuration, feature, timeout = 300, })
|
|
39
|
+
const Tooltip = (0, mobx_react_1.observer)(function ({ offsetX, offsetY, configuration, feature, timeout = 300, }) {
|
|
40
40
|
const { classes } = useStyles();
|
|
41
41
|
const [shown, setShown] = (0, react_1.useState)(false);
|
|
42
42
|
(0, react_1.useEffect)(() => {
|
|
@@ -50,5 +50,5 @@ const Tooltip = ({ offsetX, offsetY, configuration, feature, timeout = 300, }) =
|
|
|
50
50
|
return (react_1.default.createElement("div", { className: classes.hoverLabel, style: { left: offsetX, top: offsetY } }, text));
|
|
51
51
|
}
|
|
52
52
|
return null;
|
|
53
|
-
};
|
|
54
|
-
exports.default =
|
|
53
|
+
});
|
|
54
|
+
exports.default = Tooltip;
|
package/ui/theme.d.ts
CHANGED
|
@@ -27,8 +27,6 @@ declare module '@mui/material/styles/createPalette' {
|
|
|
27
27
|
}
|
|
28
28
|
export declare const defaultThemes: ThemeMap;
|
|
29
29
|
export declare function createJBrowseBaseTheme(theme?: ThemeOptions): ThemeOptions;
|
|
30
|
-
type ThemeMap =
|
|
31
|
-
[key: string]: ThemeOptions;
|
|
32
|
-
};
|
|
30
|
+
type ThemeMap = Record<string, ThemeOptions>;
|
|
33
31
|
export declare function createJBrowseTheme(configTheme?: ThemeOptions, themes?: ThemeMap, themeName?: string): import("@mui/material/styles").Theme;
|
|
34
32
|
export {};
|
package/ui/theme.js
CHANGED
|
@@ -361,8 +361,8 @@ function createJBrowseBaseTheme(theme) {
|
|
|
361
361
|
exports.createJBrowseBaseTheme = createJBrowseBaseTheme;
|
|
362
362
|
function createJBrowseTheme(configTheme = {}, themes = exports.defaultThemes, themeName = 'default') {
|
|
363
363
|
return (0, styles_1.createTheme)(createJBrowseBaseTheme(themeName === 'default'
|
|
364
|
-
? (0, deepmerge_1.default)(themes
|
|
365
|
-
: augmentThemePlus(themes[themeName]) || themes
|
|
364
|
+
? (0, deepmerge_1.default)(themes.default, augmentTheme(configTheme))
|
|
365
|
+
: augmentThemePlus(themes[themeName]) || themes.default));
|
|
366
366
|
}
|
|
367
367
|
exports.createJBrowseTheme = createJBrowseTheme;
|
|
368
368
|
function augmentTheme(theme = {}) {
|