@jbrowse/plugin-menus 3.7.0 → 4.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/esm/AboutWidget/components/AboutWidget.d.ts +1 -1
- package/esm/AboutWidget/components/AboutWidget.js +4 -4
- package/esm/AboutWidget/index.js +2 -2
- package/esm/HelpWidget/components/HelpWidget.d.ts +1 -1
- package/esm/HelpWidget/components/HelpWidget.js +1 -1
- package/esm/HelpWidget/index.js +2 -2
- package/esm/ImportSessionWidget/components/ImportError.js +1 -1
- package/esm/ImportSessionWidget/components/ImportSessionWidget.d.ts +1 -1
- package/esm/ImportSessionWidget/components/ImportSessionWidget.js +17 -19
- package/esm/ImportSessionWidget/index.js +2 -2
- package/esm/SessionManager/components/SessionManager.d.ts +1 -1
- package/esm/SessionManager/components/SessionManager.js +6 -5
- package/esm/SessionManager/index.d.ts +5 -5
- package/esm/SessionManager/index.js +2 -2
- package/esm/index.js +5 -8
- package/package.json +26 -32
- package/dist/AboutWidget/components/AboutWidget.d.ts +0 -5
- package/dist/AboutWidget/components/AboutWidget.js +0 -41
- package/dist/AboutWidget/index.d.ts +0 -2
- package/dist/AboutWidget/index.js +0 -57
- package/dist/HelpWidget/components/HelpWidget.d.ts +0 -5
- package/dist/HelpWidget/components/HelpWidget.js +0 -22
- package/dist/HelpWidget/index.d.ts +0 -2
- package/dist/HelpWidget/index.js +0 -57
- package/dist/ImportSessionWidget/components/ImportError.d.ts +0 -3
- package/dist/ImportSessionWidget/components/ImportError.js +0 -28
- package/dist/ImportSessionWidget/components/ImportSessionWidget.d.ts +0 -5
- package/dist/ImportSessionWidget/components/ImportSessionWidget.js +0 -76
- package/dist/ImportSessionWidget/index.d.ts +0 -2
- package/dist/ImportSessionWidget/index.js +0 -57
- package/dist/SessionManager/components/SessionManager.d.ts +0 -5
- package/dist/SessionManager/components/SessionManager.js +0 -96
- package/dist/SessionManager/components/util.d.ts +0 -26
- package/dist/SessionManager/components/util.js +0 -2
- package/dist/SessionManager/index.d.ts +0 -7
- package/dist/SessionManager/index.js +0 -58
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -46
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ExternalLink } from '@jbrowse/core/ui';
|
|
3
3
|
import { getSession } from '@jbrowse/core/util';
|
|
4
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
5
|
+
import { getEnv } from '@jbrowse/mobx-state-tree';
|
|
4
6
|
import { Typography } from '@mui/material';
|
|
5
7
|
import { observer } from 'mobx-react';
|
|
6
|
-
import { getEnv } from 'mobx-state-tree';
|
|
7
|
-
import { makeStyles } from 'tss-react/mui';
|
|
8
8
|
const useStyles = makeStyles()(theme => ({
|
|
9
9
|
root: {
|
|
10
10
|
margin: theme.spacing(2),
|
|
@@ -18,13 +18,13 @@ const useStyles = makeStyles()(theme => ({
|
|
|
18
18
|
marginTop: theme.spacing(5),
|
|
19
19
|
},
|
|
20
20
|
}));
|
|
21
|
-
const AboutWidget = observer(function ({ model, }) {
|
|
21
|
+
const AboutWidget = observer(function AboutWidget({ model, }) {
|
|
22
22
|
const { classes } = useStyles();
|
|
23
23
|
const { version } = getSession(model);
|
|
24
24
|
const { pluginManager } = getEnv(model);
|
|
25
25
|
const { plugins } = pluginManager;
|
|
26
26
|
const corePlugins = new Set(plugins
|
|
27
|
-
.filter(p =>
|
|
27
|
+
.filter(p => pluginManager.pluginMetadata[p.name]?.isCore)
|
|
28
28
|
.map(p => p.name));
|
|
29
29
|
return (_jsxs("div", { className: classes.root, children: [_jsx(Typography, { variant: "h4", align: "center", children: "JBrowse 2" }), _jsx(Typography, { variant: "h6", align: "center", className: classes.subtitle, children: version }), _jsxs(Typography, { align: "center", children: ["JBrowse is a ", _jsx(ExternalLink, { href: "http://gmod.org/", children: "GMOD" }), ' ', "project"] }), _jsx("br", {}), _jsx(Typography, { align: "center", children: "\u00A9 2019-2022 The Evolutionary Software Foundation" }), _jsxs("div", { className: classes.pluginList, children: [_jsx(Typography, { children: "External plugins loaded" }), _jsx("ul", { children: plugins
|
|
30
30
|
.filter(plugin => !corePlugins.has(plugin.name))
|
package/esm/AboutWidget/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { lazy } from 'react';
|
|
|
2
2
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
3
|
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
4
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
|
-
import { types } from 'mobx-state-tree';
|
|
5
|
+
import { types } from '@jbrowse/mobx-state-tree';
|
|
6
6
|
const configSchema = ConfigurationSchema('AboutWidget', {});
|
|
7
7
|
const stateModel = types.model('AboutWidget', {
|
|
8
8
|
id: ElementId,
|
|
@@ -15,7 +15,7 @@ export default function AboutWidgetF(pluginManager) {
|
|
|
15
15
|
heading: 'About',
|
|
16
16
|
configSchema,
|
|
17
17
|
stateModel,
|
|
18
|
-
ReactComponent: lazy(() => import(
|
|
18
|
+
ReactComponent: lazy(() => import("./components/AboutWidget.js")),
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ExternalLink } from '@jbrowse/core/ui';
|
|
3
3
|
import { getSession } from '@jbrowse/core/util';
|
|
4
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
4
5
|
import { Typography } from '@mui/material';
|
|
5
6
|
import { observer } from 'mobx-react';
|
|
6
|
-
import { makeStyles } from 'tss-react/mui';
|
|
7
7
|
const useStyles = makeStyles()(theme => ({
|
|
8
8
|
root: {
|
|
9
9
|
margin: theme.spacing(2),
|
package/esm/HelpWidget/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { lazy } from 'react';
|
|
|
2
2
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
3
|
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
4
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
|
-
import { types } from 'mobx-state-tree';
|
|
5
|
+
import { types } from '@jbrowse/mobx-state-tree';
|
|
6
6
|
const configSchema = ConfigurationSchema('HelpWidget', {});
|
|
7
7
|
const stateModel = types.model('HelpWidget', {
|
|
8
8
|
id: ElementId,
|
|
@@ -15,7 +15,7 @@ export default function HelpWidgetF(pluginManager) {
|
|
|
15
15
|
heading: 'Help',
|
|
16
16
|
configSchema,
|
|
17
17
|
stateModel,
|
|
18
|
-
ReactComponent: lazy(() => import(
|
|
18
|
+
ReactComponent: lazy(() => import("./components/HelpWidget.js")),
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
2
3
|
import ErrorIcon from '@mui/icons-material/Error';
|
|
3
4
|
import { Paper, Typography } from '@mui/material';
|
|
4
|
-
import { makeStyles } from 'tss-react/mui';
|
|
5
5
|
const useStyles = makeStyles()(theme => ({
|
|
6
6
|
error: {
|
|
7
7
|
margin: theme.spacing(2),
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { getSession } from '@jbrowse/core/util';
|
|
4
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
4
5
|
import CloudUploadIcon from '@mui/icons-material/CloudUpload';
|
|
5
6
|
import { Button, Paper, Typography, alpha } from '@mui/material';
|
|
6
7
|
import { observer } from 'mobx-react';
|
|
7
8
|
import { useDropzone } from 'react-dropzone';
|
|
8
|
-
import
|
|
9
|
-
import ImportError from './ImportError';
|
|
9
|
+
import ImportError from "./ImportError.js";
|
|
10
10
|
const MAX_FILE_SIZE = 512 * 1024 ** 2;
|
|
11
|
-
function styledBy(property, mapping) {
|
|
12
|
-
return (props) => mapping[props[property]];
|
|
13
|
-
}
|
|
14
11
|
const useStyles = makeStyles()(theme => ({
|
|
15
12
|
root: {
|
|
16
13
|
margin: theme.spacing(1),
|
|
@@ -25,39 +22,38 @@ const useStyles = makeStyles()(theme => ({
|
|
|
25
22
|
padding: theme.spacing(2),
|
|
26
23
|
borderWidth: 2,
|
|
27
24
|
borderRadius: 2,
|
|
28
|
-
borderColor: styledBy('isDragActive', {
|
|
29
|
-
true: theme.palette.secondary.light,
|
|
30
|
-
false: theme.palette.divider,
|
|
31
|
-
}),
|
|
32
25
|
borderStyle: 'dashed',
|
|
33
|
-
backgroundColor: styledBy('isDragActive', {
|
|
34
|
-
true: alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
|
|
35
|
-
false: theme.palette.background.default,
|
|
36
|
-
}),
|
|
37
26
|
outline: 'none',
|
|
38
|
-
transition: 'border .24s ease-in-out',
|
|
27
|
+
transition: 'border .24s ease-in-out, background-color .24s ease-in-out',
|
|
39
28
|
'&:focus': {
|
|
40
29
|
borderColor: theme.palette.secondary.light,
|
|
41
30
|
},
|
|
42
31
|
},
|
|
32
|
+
dropZoneActive: {
|
|
33
|
+
borderColor: theme.palette.secondary.light,
|
|
34
|
+
backgroundColor: alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
|
|
35
|
+
},
|
|
36
|
+
dropZoneInactive: {
|
|
37
|
+
borderColor: theme.palette.divider,
|
|
38
|
+
backgroundColor: theme.palette.background.default,
|
|
39
|
+
},
|
|
43
40
|
uploadIcon: {
|
|
44
41
|
color: theme.palette.text.secondary,
|
|
45
42
|
},
|
|
46
43
|
}));
|
|
47
|
-
const ImportSessionWidget = observer(function ({ model, }) {
|
|
44
|
+
const ImportSessionWidget = observer(function ImportSessionWidget({ model, }) {
|
|
48
45
|
const [error, setError] = useState();
|
|
49
46
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
50
47
|
accept: 'application/json',
|
|
51
48
|
maxSize: MAX_FILE_SIZE,
|
|
52
49
|
multiple: false,
|
|
53
50
|
onDrop: async (acceptedFiles, rejectedFiles) => {
|
|
54
|
-
var _a, _b;
|
|
55
51
|
try {
|
|
56
52
|
if (rejectedFiles.length > 0) {
|
|
57
53
|
throw new Error(rejectedFiles[0].errors.map(e => `${e}`).join(', '));
|
|
58
54
|
}
|
|
59
55
|
const sessionText = await acceptedFiles[0].text();
|
|
60
|
-
|
|
56
|
+
getSession(model).setSession?.(JSON.parse(sessionText).session);
|
|
61
57
|
}
|
|
62
58
|
catch (e) {
|
|
63
59
|
console.error(e);
|
|
@@ -65,7 +61,9 @@ const ImportSessionWidget = observer(function ({ model, }) {
|
|
|
65
61
|
}
|
|
66
62
|
},
|
|
67
63
|
});
|
|
68
|
-
const { classes } = useStyles(
|
|
69
|
-
return (_jsxs("div", { className: classes.root, children: [_jsx(Paper, { className: classes.paper, children: _jsxs("div", { ...getRootProps({
|
|
64
|
+
const { classes, cx } = useStyles();
|
|
65
|
+
return (_jsxs("div", { className: classes.root, children: [_jsx(Paper, { className: classes.paper, children: _jsxs("div", { ...getRootProps({
|
|
66
|
+
className: cx(classes.dropZone, isDragActive ? classes.dropZoneActive : classes.dropZoneInactive),
|
|
67
|
+
}), children: [_jsx("input", { ...getInputProps() }), _jsx(CloudUploadIcon, { className: classes.uploadIcon, fontSize: "large" }), _jsx(Typography, { color: "textSecondary", align: "center", variant: "body1", children: "Drag and drop files here" }), _jsx(Typography, { color: "textSecondary", align: "center", variant: "body2", children: "or" }), _jsx(Button, { color: "primary", variant: "contained", children: "Browse Files" })] }) }), error ? _jsx(ImportError, { error: error }) : null] }));
|
|
70
68
|
});
|
|
71
69
|
export default ImportSessionWidget;
|
|
@@ -2,7 +2,7 @@ import { lazy } from 'react';
|
|
|
2
2
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
3
|
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
4
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
|
-
import { types } from 'mobx-state-tree';
|
|
5
|
+
import { types } from '@jbrowse/mobx-state-tree';
|
|
6
6
|
const configSchema = ConfigurationSchema('ImportSessionWidget', {});
|
|
7
7
|
const stateModel = types.model('ImportSessionWidget', {
|
|
8
8
|
id: ElementId,
|
|
@@ -15,7 +15,7 @@ export default function ImportSessionWidgetF(pluginManager) {
|
|
|
15
15
|
heading: 'Import session',
|
|
16
16
|
configSchema,
|
|
17
17
|
stateModel,
|
|
18
|
-
ReactComponent: lazy(() => import(
|
|
18
|
+
ReactComponent: lazy(() => import("./components/ImportSessionWidget.js")),
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import DataGridFlexContainer from '@jbrowse/core/ui/DataGridFlexContainer';
|
|
3
3
|
import { measureGridWidth, useLocalStorage } from '@jbrowse/core/util';
|
|
4
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
4
5
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
5
6
|
import StarIcon from '@mui/icons-material/Star';
|
|
6
7
|
import StarBorderIcon from '@mui/icons-material/StarBorder';
|
|
@@ -8,23 +9,23 @@ import { Button, Checkbox, FormControlLabel, IconButton, Link, Tooltip, } from '
|
|
|
8
9
|
import { DataGrid } from '@mui/x-data-grid';
|
|
9
10
|
import { differenceInDays, formatDistanceToNow } from 'date-fns';
|
|
10
11
|
import { observer } from 'mobx-react';
|
|
11
|
-
import { makeStyles } from 'tss-react/mui';
|
|
12
12
|
const useStyles = makeStyles()(theme => ({
|
|
13
13
|
mb: {
|
|
14
14
|
margin: theme.spacing(1),
|
|
15
15
|
marginBottom: theme.spacing(4),
|
|
16
16
|
},
|
|
17
17
|
}));
|
|
18
|
-
const SessionManager = observer(function ({ session, }) {
|
|
19
|
-
var _a;
|
|
18
|
+
const SessionManager = observer(function SessionManager({ session, }) {
|
|
20
19
|
const { classes } = useStyles();
|
|
21
20
|
const [showOnlyFavs, setShowOnlyFavs] = useLocalStorage('sessionManager-showOnlyFavs', false);
|
|
22
|
-
const rows =
|
|
21
|
+
const rows = session.savedSessionMetadata
|
|
22
|
+
?.map(r => ({
|
|
23
23
|
id: r.id,
|
|
24
24
|
name: r.name,
|
|
25
25
|
createdAt: r.createdAt,
|
|
26
26
|
fav: r.favorite,
|
|
27
|
-
}))
|
|
27
|
+
}))
|
|
28
|
+
.filter(f => (showOnlyFavs ? f.fav : true));
|
|
28
29
|
return (_jsxs("div", { children: [_jsxs("div", { className: classes.mb, children: [_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: showOnlyFavs, onChange: () => {
|
|
29
30
|
setShowOnlyFavs(val => !val);
|
|
30
31
|
} }), label: "Show favorites only?" }), _jsx(Button, { variant: "contained", onClick: () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
export declare const configSchema: import("
|
|
3
|
-
export declare const stateModel: import("mobx-state-tree").IModelType<{
|
|
4
|
-
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
5
|
-
type: import("mobx-state-tree").ISimpleType<"SessionManager">;
|
|
6
|
-
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
2
|
+
export declare const configSchema: import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaType<{}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
3
|
+
export declare const stateModel: import("@jbrowse/mobx-state-tree").IModelType<{
|
|
4
|
+
id: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
5
|
+
type: import("@jbrowse/mobx-state-tree").ISimpleType<"SessionManager">;
|
|
6
|
+
}, {}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
7
7
|
export default function SessionManagerF(pluginManager: PluginManager): void;
|
|
@@ -2,7 +2,7 @@ import { lazy } from 'react';
|
|
|
2
2
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
3
|
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
4
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
|
-
import { types } from 'mobx-state-tree';
|
|
5
|
+
import { types } from '@jbrowse/mobx-state-tree';
|
|
6
6
|
export const configSchema = ConfigurationSchema('SessionManager', {});
|
|
7
7
|
export const stateModel = types.model('SessionManager', {
|
|
8
8
|
id: ElementId,
|
|
@@ -15,7 +15,7 @@ export default function SessionManagerF(pluginManager) {
|
|
|
15
15
|
heading: 'Recent sessions',
|
|
16
16
|
configSchema,
|
|
17
17
|
stateModel,
|
|
18
|
-
ReactComponent: lazy(() => import(
|
|
18
|
+
ReactComponent: lazy(() => import("./components/SessionManager.js")),
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
}
|
package/esm/index.js
CHANGED
|
@@ -2,15 +2,12 @@ import Plugin from '@jbrowse/core/Plugin';
|
|
|
2
2
|
import { isAbstractMenuManager } from '@jbrowse/core/util';
|
|
3
3
|
import HelpIcon from '@mui/icons-material/Help';
|
|
4
4
|
import InfoIcon from '@mui/icons-material/Info';
|
|
5
|
-
import AboutWidgetF from
|
|
6
|
-
import HelpWidgetF from
|
|
7
|
-
import ImportSessionWidgetF from
|
|
8
|
-
import SessionManagerF from
|
|
5
|
+
import AboutWidgetF from "./AboutWidget/index.js";
|
|
6
|
+
import HelpWidgetF from "./HelpWidget/index.js";
|
|
7
|
+
import ImportSessionWidgetF from "./ImportSessionWidget/index.js";
|
|
8
|
+
import SessionManagerF from "./SessionManager/index.js";
|
|
9
9
|
export default class MenusPlugin extends Plugin {
|
|
10
|
-
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.name = 'MenusPlugin';
|
|
13
|
-
}
|
|
10
|
+
name = 'MenusPlugin';
|
|
14
11
|
install(pluginManager) {
|
|
15
12
|
AboutWidgetF(pluginManager);
|
|
16
13
|
HelpWidgetF(pluginManager);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-menus",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "JBrowse 2 basic menus",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -15,47 +15,41 @@
|
|
|
15
15
|
"directory": "plugins/menus"
|
|
16
16
|
},
|
|
17
17
|
"author": "JBrowse Team",
|
|
18
|
-
"
|
|
19
|
-
"srcMain": "src/index.ts",
|
|
20
|
-
"main": "dist/index.js",
|
|
18
|
+
"main": "esm/index.js",
|
|
21
19
|
"files": [
|
|
22
|
-
"dist",
|
|
23
20
|
"esm"
|
|
24
21
|
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "npm-run-all build:*",
|
|
27
|
-
"test": "cd ../..; jest --passWithNoTests plugins/menus",
|
|
28
|
-
"prepublishOnly": "yarn test",
|
|
29
|
-
"prepack": "yarn build && yarn useDist",
|
|
30
|
-
"postpack": "yarn useSrc",
|
|
31
|
-
"useDist": "node ../../scripts/useDist.js",
|
|
32
|
-
"useSrc": "node ../../scripts/useSrc.js",
|
|
33
|
-
"prebuild": "npm run clean",
|
|
34
|
-
"build:esm": "tsc --build tsconfig.build.esm.json",
|
|
35
|
-
"build:commonjs": "tsc --build tsconfig.build.commonjs.json",
|
|
36
|
-
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
|
-
},
|
|
38
22
|
"dependencies": {
|
|
39
|
-
"@jbrowse/
|
|
40
|
-
"@mui/icons-material": "^7.
|
|
41
|
-
"@mui/material": "^7.
|
|
23
|
+
"@jbrowse/mobx-state-tree": "^5.5.0",
|
|
24
|
+
"@mui/icons-material": "^7.3.6",
|
|
25
|
+
"@mui/material": "^7.3.6",
|
|
26
|
+
"@mui/x-data-grid": "^8.23.0",
|
|
42
27
|
"date-fns": "^4.1.0",
|
|
43
|
-
"mobx": "^6.
|
|
44
|
-
"mobx-react": "^9.
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"react-dropzone": "^14.2.1",
|
|
48
|
-
"tss-react": "^4.0.0"
|
|
28
|
+
"mobx": "^6.15.0",
|
|
29
|
+
"mobx-react": "^9.2.1",
|
|
30
|
+
"react-dropzone": "^14.3.8",
|
|
31
|
+
"@jbrowse/core": "^4.0.0"
|
|
49
32
|
},
|
|
50
33
|
"peerDependencies": {
|
|
51
34
|
"react": ">=18.0.0",
|
|
52
35
|
"react-dom": ">=18.0.0"
|
|
53
36
|
},
|
|
54
|
-
"distModule": "esm/index.js",
|
|
55
|
-
"srcModule": "src/index.ts",
|
|
56
|
-
"module": "esm/index.js",
|
|
57
37
|
"publishConfig": {
|
|
58
38
|
"access": "public"
|
|
59
39
|
},
|
|
60
|
-
"
|
|
61
|
-
|
|
40
|
+
"sideEffects": false,
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "pnpm run /^build:/",
|
|
43
|
+
"test": "cd ../..; jest --passWithNoTests plugins/menus",
|
|
44
|
+
"prebuild": "pnpm clean",
|
|
45
|
+
"build:esm": "tsc -p tsconfig.build.esm.json",
|
|
46
|
+
"clean": "rimraf esm *.tsbuildinfo"
|
|
47
|
+
},
|
|
48
|
+
"types": "esm/index.d.ts",
|
|
49
|
+
"exports": {
|
|
50
|
+
".": {
|
|
51
|
+
"types": "./esm/index.d.ts",
|
|
52
|
+
"import": "./esm/index.js"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
5
|
-
const util_1 = require("@jbrowse/core/util");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
9
|
-
const mui_1 = require("tss-react/mui");
|
|
10
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
11
|
-
root: {
|
|
12
|
-
margin: theme.spacing(2),
|
|
13
|
-
paddingTop: theme.spacing(2),
|
|
14
|
-
},
|
|
15
|
-
subtitle: {
|
|
16
|
-
margin: theme.spacing(1),
|
|
17
|
-
},
|
|
18
|
-
pluginList: {
|
|
19
|
-
margin: theme.spacing(1),
|
|
20
|
-
marginTop: theme.spacing(5),
|
|
21
|
-
},
|
|
22
|
-
}));
|
|
23
|
-
const AboutWidget = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
24
|
-
const { classes } = useStyles();
|
|
25
|
-
const { version } = (0, util_1.getSession)(model);
|
|
26
|
-
const { pluginManager } = (0, mobx_state_tree_1.getEnv)(model);
|
|
27
|
-
const { plugins } = pluginManager;
|
|
28
|
-
const corePlugins = new Set(plugins
|
|
29
|
-
.filter(p => { var _a; return (_a = pluginManager.pluginMetadata[p.name]) === null || _a === void 0 ? void 0 : _a.isCore; })
|
|
30
|
-
.map(p => p.name));
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.root, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h4", align: "center", children: "JBrowse 2" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", align: "center", className: classes.subtitle, children: version }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { align: "center", children: ["JBrowse is a ", (0, jsx_runtime_1.jsx)(ui_1.ExternalLink, { href: "http://gmod.org/", children: "GMOD" }), ' ', "project"] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(material_1.Typography, { align: "center", children: "\u00A9 2019-2022 The Evolutionary Software Foundation" }), (0, jsx_runtime_1.jsxs)("div", { className: classes.pluginList, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "External plugins loaded" }), (0, jsx_runtime_1.jsx)("ul", { children: plugins
|
|
32
|
-
.filter(plugin => !corePlugins.has(plugin.name))
|
|
33
|
-
.map(plugin => {
|
|
34
|
-
const { url, name, version = '' } = plugin;
|
|
35
|
-
const text = `${name} ${version || ''}`;
|
|
36
|
-
return ((0, jsx_runtime_1.jsx)("li", { children: plugin.url ? ((0, jsx_runtime_1.jsx)(ui_1.ExternalLink, { href: url, children: text })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { children: text })) }, plugin.name));
|
|
37
|
-
}) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Core plugins loaded" }), (0, jsx_runtime_1.jsx)("ul", { children: plugins
|
|
38
|
-
.filter(plugin => corePlugins.has(plugin.name))
|
|
39
|
-
.map(plugin => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, { children: [plugin.name, " ", plugin.version || ''] }) }, plugin.name))) })] })] }));
|
|
40
|
-
});
|
|
41
|
-
exports.default = AboutWidget;
|
|
@@ -1,57 +0,0 @@
|
|
|
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 () {
|
|
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
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.default = AboutWidgetF;
|
|
37
|
-
const react_1 = require("react");
|
|
38
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
39
|
-
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
40
|
-
const mst_1 = require("@jbrowse/core/util/types/mst");
|
|
41
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
42
|
-
const configSchema = (0, configuration_1.ConfigurationSchema)('AboutWidget', {});
|
|
43
|
-
const stateModel = mobx_state_tree_1.types.model('AboutWidget', {
|
|
44
|
-
id: mst_1.ElementId,
|
|
45
|
-
type: mobx_state_tree_1.types.literal('AboutWidget'),
|
|
46
|
-
});
|
|
47
|
-
function AboutWidgetF(pluginManager) {
|
|
48
|
-
pluginManager.addWidgetType(() => {
|
|
49
|
-
return new pluggableElementTypes_1.WidgetType({
|
|
50
|
-
name: 'AboutWidget',
|
|
51
|
-
heading: 'About',
|
|
52
|
-
configSchema,
|
|
53
|
-
stateModel,
|
|
54
|
-
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/AboutWidget')))),
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
5
|
-
const util_1 = require("@jbrowse/core/util");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
const mui_1 = require("tss-react/mui");
|
|
9
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
10
|
-
root: {
|
|
11
|
-
margin: theme.spacing(2),
|
|
12
|
-
},
|
|
13
|
-
subtitle: {
|
|
14
|
-
margin: theme.spacing(1),
|
|
15
|
-
},
|
|
16
|
-
}));
|
|
17
|
-
const HelpWidget = (0, mobx_react_1.observer)(function Help({ model, }) {
|
|
18
|
-
const { classes } = useStyles();
|
|
19
|
-
const root = model ? (0, util_1.getSession)(model) : { version: '' };
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.root, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h4", align: "center", children: "JBrowse 2" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", align: "center", className: classes.subtitle, children: root.version }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Here are some resources to get help. Please report the version number above when asking questions. Thanks!" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_1.ExternalLink, { href: "https://github.com/GMOD/jbrowse-components/discussions", children: "Question & answer forum" }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_1.ExternalLink, { href: "https://github.com/GMOD/jbrowse-components/issues/new/choose", children: "Report a bug" }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_1.ExternalLink, { href: "https://jbrowse.org/jb2/docs/user_guide", children: "User guide" }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_1.ExternalLink, { href: "https://jbrowse.org/jb2/docs/", children: "Documentation" }) })] })] }));
|
|
21
|
-
});
|
|
22
|
-
exports.default = HelpWidget;
|
package/dist/HelpWidget/index.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
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 () {
|
|
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
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.default = HelpWidgetF;
|
|
37
|
-
const react_1 = require("react");
|
|
38
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
39
|
-
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
40
|
-
const mst_1 = require("@jbrowse/core/util/types/mst");
|
|
41
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
42
|
-
const configSchema = (0, configuration_1.ConfigurationSchema)('HelpWidget', {});
|
|
43
|
-
const stateModel = mobx_state_tree_1.types.model('HelpWidget', {
|
|
44
|
-
id: mst_1.ElementId,
|
|
45
|
-
type: mobx_state_tree_1.types.literal('HelpWidget'),
|
|
46
|
-
});
|
|
47
|
-
function HelpWidgetF(pluginManager) {
|
|
48
|
-
pluginManager.addWidgetType(() => {
|
|
49
|
-
return new pluggableElementTypes_1.WidgetType({
|
|
50
|
-
name: 'HelpWidget',
|
|
51
|
-
heading: 'Help',
|
|
52
|
-
configSchema,
|
|
53
|
-
stateModel,
|
|
54
|
-
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/HelpWidget')))),
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = ImportError;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const Error_1 = __importDefault(require("@mui/icons-material/Error"));
|
|
9
|
-
const material_1 = require("@mui/material");
|
|
10
|
-
const mui_1 = require("tss-react/mui");
|
|
11
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
12
|
-
error: {
|
|
13
|
-
margin: theme.spacing(2),
|
|
14
|
-
},
|
|
15
|
-
errorHeader: {
|
|
16
|
-
background: theme.palette.error.light,
|
|
17
|
-
color: theme.palette.error.contrastText,
|
|
18
|
-
padding: theme.spacing(2),
|
|
19
|
-
textAlign: 'center',
|
|
20
|
-
},
|
|
21
|
-
errorMessage: {
|
|
22
|
-
padding: theme.spacing(2),
|
|
23
|
-
},
|
|
24
|
-
}));
|
|
25
|
-
function ImportError({ error }) {
|
|
26
|
-
const { classes } = useStyles();
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { className: classes.error, children: [(0, jsx_runtime_1.jsxs)("div", { className: classes.errorHeader, children: [(0, jsx_runtime_1.jsx)(Error_1.default, { color: "inherit", fontSize: "large" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", color: "inherit", align: "center", children: "Import error" }) })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { className: classes.errorMessage, children: `${error}` })] }));
|
|
28
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const util_1 = require("@jbrowse/core/util");
|
|
9
|
-
const CloudUpload_1 = __importDefault(require("@mui/icons-material/CloudUpload"));
|
|
10
|
-
const material_1 = require("@mui/material");
|
|
11
|
-
const mobx_react_1 = require("mobx-react");
|
|
12
|
-
const react_dropzone_1 = require("react-dropzone");
|
|
13
|
-
const mui_1 = require("tss-react/mui");
|
|
14
|
-
const ImportError_1 = __importDefault(require("./ImportError"));
|
|
15
|
-
const MAX_FILE_SIZE = 512 * 1024 ** 2;
|
|
16
|
-
function styledBy(property, mapping) {
|
|
17
|
-
return (props) => mapping[props[property]];
|
|
18
|
-
}
|
|
19
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
20
|
-
root: {
|
|
21
|
-
margin: theme.spacing(1),
|
|
22
|
-
},
|
|
23
|
-
paper: {
|
|
24
|
-
display: 'flex',
|
|
25
|
-
flexDirection: 'column',
|
|
26
|
-
},
|
|
27
|
-
dropZone: {
|
|
28
|
-
textAlign: 'center',
|
|
29
|
-
margin: theme.spacing(2),
|
|
30
|
-
padding: theme.spacing(2),
|
|
31
|
-
borderWidth: 2,
|
|
32
|
-
borderRadius: 2,
|
|
33
|
-
borderColor: styledBy('isDragActive', {
|
|
34
|
-
true: theme.palette.secondary.light,
|
|
35
|
-
false: theme.palette.divider,
|
|
36
|
-
}),
|
|
37
|
-
borderStyle: 'dashed',
|
|
38
|
-
backgroundColor: styledBy('isDragActive', {
|
|
39
|
-
true: (0, material_1.alpha)(theme.palette.text.primary, theme.palette.action.hoverOpacity),
|
|
40
|
-
false: theme.palette.background.default,
|
|
41
|
-
}),
|
|
42
|
-
outline: 'none',
|
|
43
|
-
transition: 'border .24s ease-in-out',
|
|
44
|
-
'&:focus': {
|
|
45
|
-
borderColor: theme.palette.secondary.light,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
uploadIcon: {
|
|
49
|
-
color: theme.palette.text.secondary,
|
|
50
|
-
},
|
|
51
|
-
}));
|
|
52
|
-
const ImportSessionWidget = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
53
|
-
const [error, setError] = (0, react_1.useState)();
|
|
54
|
-
const { getRootProps, getInputProps, isDragActive } = (0, react_dropzone_1.useDropzone)({
|
|
55
|
-
accept: 'application/json',
|
|
56
|
-
maxSize: MAX_FILE_SIZE,
|
|
57
|
-
multiple: false,
|
|
58
|
-
onDrop: async (acceptedFiles, rejectedFiles) => {
|
|
59
|
-
var _a, _b;
|
|
60
|
-
try {
|
|
61
|
-
if (rejectedFiles.length > 0) {
|
|
62
|
-
throw new Error(rejectedFiles[0].errors.map(e => `${e}`).join(', '));
|
|
63
|
-
}
|
|
64
|
-
const sessionText = await acceptedFiles[0].text();
|
|
65
|
-
(_b = (_a = (0, util_1.getSession)(model)).setSession) === null || _b === void 0 ? void 0 : _b.call(_a, JSON.parse(sessionText).session);
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
console.error(e);
|
|
69
|
-
setError(e);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
const { classes } = useStyles({ isDragActive });
|
|
74
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.root, children: [(0, jsx_runtime_1.jsx)(material_1.Paper, { className: classes.paper, children: (0, jsx_runtime_1.jsxs)("div", { ...getRootProps({ className: classes.dropZone }), children: [(0, jsx_runtime_1.jsx)("input", { ...getInputProps() }), (0, jsx_runtime_1.jsx)(CloudUpload_1.default, { className: classes.uploadIcon, fontSize: "large" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { color: "textSecondary", align: "center", variant: "body1", children: "Drag and drop files here" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { color: "textSecondary", align: "center", variant: "body2", children: "or" }), (0, jsx_runtime_1.jsx)(material_1.Button, { color: "primary", variant: "contained", children: "Browse Files" })] }) }), error ? (0, jsx_runtime_1.jsx)(ImportError_1.default, { error: error }) : null] }));
|
|
75
|
-
});
|
|
76
|
-
exports.default = ImportSessionWidget;
|
|
@@ -1,57 +0,0 @@
|
|
|
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 () {
|
|
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
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.default = ImportSessionWidgetF;
|
|
37
|
-
const react_1 = require("react");
|
|
38
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
39
|
-
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
40
|
-
const mst_1 = require("@jbrowse/core/util/types/mst");
|
|
41
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
42
|
-
const configSchema = (0, configuration_1.ConfigurationSchema)('ImportSessionWidget', {});
|
|
43
|
-
const stateModel = mobx_state_tree_1.types.model('ImportSessionWidget', {
|
|
44
|
-
id: mst_1.ElementId,
|
|
45
|
-
type: mobx_state_tree_1.types.literal('ImportSessionWidget'),
|
|
46
|
-
});
|
|
47
|
-
function ImportSessionWidgetF(pluginManager) {
|
|
48
|
-
pluginManager.addWidgetType(() => {
|
|
49
|
-
return new pluggableElementTypes_1.WidgetType({
|
|
50
|
-
name: 'ImportSessionWidget',
|
|
51
|
-
heading: 'Import session',
|
|
52
|
-
configSchema,
|
|
53
|
-
stateModel,
|
|
54
|
-
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ImportSessionWidget')))),
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const DataGridFlexContainer_1 = __importDefault(require("@jbrowse/core/ui/DataGridFlexContainer"));
|
|
8
|
-
const util_1 = require("@jbrowse/core/util");
|
|
9
|
-
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
10
|
-
const Star_1 = __importDefault(require("@mui/icons-material/Star"));
|
|
11
|
-
const StarBorder_1 = __importDefault(require("@mui/icons-material/StarBorder"));
|
|
12
|
-
const material_1 = require("@mui/material");
|
|
13
|
-
const x_data_grid_1 = require("@mui/x-data-grid");
|
|
14
|
-
const date_fns_1 = require("date-fns");
|
|
15
|
-
const mobx_react_1 = require("mobx-react");
|
|
16
|
-
const mui_1 = require("tss-react/mui");
|
|
17
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
18
|
-
mb: {
|
|
19
|
-
margin: theme.spacing(1),
|
|
20
|
-
marginBottom: theme.spacing(4),
|
|
21
|
-
},
|
|
22
|
-
}));
|
|
23
|
-
const SessionManager = (0, mobx_react_1.observer)(function ({ session, }) {
|
|
24
|
-
var _a;
|
|
25
|
-
const { classes } = useStyles();
|
|
26
|
-
const [showOnlyFavs, setShowOnlyFavs] = (0, util_1.useLocalStorage)('sessionManager-showOnlyFavs', false);
|
|
27
|
-
const rows = (_a = session.savedSessionMetadata) === null || _a === void 0 ? void 0 : _a.map(r => ({
|
|
28
|
-
id: r.id,
|
|
29
|
-
name: r.name,
|
|
30
|
-
createdAt: r.createdAt,
|
|
31
|
-
fav: r.favorite,
|
|
32
|
-
})).filter(f => (showOnlyFavs ? f.fav : true));
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: classes.mb, children: [(0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: showOnlyFavs, onChange: () => {
|
|
34
|
-
setShowOnlyFavs(val => !val);
|
|
35
|
-
} }), label: "Show favorites only?" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
|
|
36
|
-
let i = 0;
|
|
37
|
-
if (session.savedSessionMetadata) {
|
|
38
|
-
for (const elt of session.savedSessionMetadata) {
|
|
39
|
-
if ((0, date_fns_1.differenceInDays)(Date.now(), elt.createdAt) > 1 &&
|
|
40
|
-
!elt.favorite) {
|
|
41
|
-
session.deleteSavedSession(elt.id);
|
|
42
|
-
i++;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
session.notify(`${i} sessions deleted`, 'info');
|
|
47
|
-
}, children: "Delete non-fav sessions older than 7 days?" })] }), rows ? ((0, jsx_runtime_1.jsx)(DataGridFlexContainer_1.default, { children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { disableRowSelectionOnClick: true, columnHeaderHeight: 35, rowHeight: 25, hideFooter: rows.length < 100, slotProps: {
|
|
48
|
-
toolbar: {
|
|
49
|
-
showQuickFilter: true,
|
|
50
|
-
},
|
|
51
|
-
}, rows: rows, columns: [
|
|
52
|
-
{
|
|
53
|
-
field: 'fav',
|
|
54
|
-
headerName: 'Fav',
|
|
55
|
-
width: 20,
|
|
56
|
-
renderCell: ({ row }) => ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
|
|
57
|
-
if (row.fav) {
|
|
58
|
-
session.unfavoriteSavedSession(row.id);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
session.favoriteSavedSession(row.id);
|
|
62
|
-
}
|
|
63
|
-
}, children: row.fav ? (0, jsx_runtime_1.jsx)(Star_1.default, {}) : (0, jsx_runtime_1.jsx)(StarBorder_1.default, {}) })),
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
field: 'name',
|
|
67
|
-
headerName: 'Name',
|
|
68
|
-
editable: true,
|
|
69
|
-
width: (0, util_1.measureGridWidth)(rows.map(r => r.name)),
|
|
70
|
-
renderCell: ({ row }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Link, { href: "#", onClick: event => {
|
|
71
|
-
event.preventDefault();
|
|
72
|
-
session.activateSession(row.id);
|
|
73
|
-
}, children: row.name }), session.id === row.id ? ' (current)' : ''] })),
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
headerName: 'Created at',
|
|
77
|
-
field: 'createdAt',
|
|
78
|
-
renderCell: ({ row }) => ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { disableInteractive: true, slotProps: {
|
|
79
|
-
transition: {
|
|
80
|
-
timeout: 0,
|
|
81
|
-
},
|
|
82
|
-
}, title: row.createdAt.toLocaleString(), children: (0, jsx_runtime_1.jsx)("div", { children: (0, date_fns_1.formatDistanceToNow)(row.createdAt, {
|
|
83
|
-
addSuffix: true,
|
|
84
|
-
}) }) })),
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
field: 'delete',
|
|
88
|
-
width: 10,
|
|
89
|
-
headerName: 'Delete',
|
|
90
|
-
renderCell: ({ row }) => ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
|
|
91
|
-
session.deleteSavedSession(row.id);
|
|
92
|
-
}, children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) })),
|
|
93
|
-
},
|
|
94
|
-
] }) })) : ((0, jsx_runtime_1.jsx)("div", { children: "No sessions loaded" }))] }));
|
|
95
|
-
});
|
|
96
|
-
exports.default = SessionManager;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { AbstractSessionModel } from '@jbrowse/core/util';
|
|
2
|
-
export interface SessionMetadata {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
createdAt: Date;
|
|
6
|
-
configPath: string;
|
|
7
|
-
favorite: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface SessionSnap {
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
session: {
|
|
12
|
-
name: string;
|
|
13
|
-
id: string;
|
|
14
|
-
views?: {
|
|
15
|
-
tracks?: unknown[];
|
|
16
|
-
}[];
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export interface SessionModel extends AbstractSessionModel {
|
|
21
|
-
savedSessionMetadata?: SessionMetadata[];
|
|
22
|
-
removeSavedSession: (arg: SessionSnap) => void;
|
|
23
|
-
activateSession: (arg: string) => void;
|
|
24
|
-
loadAutosaveSession: () => void;
|
|
25
|
-
previousAutosaveId: string;
|
|
26
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
export declare const configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
3
|
-
export declare const stateModel: import("mobx-state-tree").IModelType<{
|
|
4
|
-
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
5
|
-
type: import("mobx-state-tree").ISimpleType<"SessionManager">;
|
|
6
|
-
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
7
|
-
export default function SessionManagerF(pluginManager: PluginManager): void;
|
|
@@ -1,58 +0,0 @@
|
|
|
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 () {
|
|
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
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.stateModel = exports.configSchema = void 0;
|
|
37
|
-
exports.default = SessionManagerF;
|
|
38
|
-
const react_1 = require("react");
|
|
39
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
40
|
-
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
41
|
-
const mst_1 = require("@jbrowse/core/util/types/mst");
|
|
42
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
43
|
-
exports.configSchema = (0, configuration_1.ConfigurationSchema)('SessionManager', {});
|
|
44
|
-
exports.stateModel = mobx_state_tree_1.types.model('SessionManager', {
|
|
45
|
-
id: mst_1.ElementId,
|
|
46
|
-
type: mobx_state_tree_1.types.literal('SessionManager'),
|
|
47
|
-
});
|
|
48
|
-
function SessionManagerF(pluginManager) {
|
|
49
|
-
pluginManager.addWidgetType(() => {
|
|
50
|
-
return new pluggableElementTypes_1.WidgetType({
|
|
51
|
-
name: 'SessionManager',
|
|
52
|
-
heading: 'Recent sessions',
|
|
53
|
-
configSchema: exports.configSchema,
|
|
54
|
-
stateModel: exports.stateModel,
|
|
55
|
-
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SessionManager')))),
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
-
export default class MenusPlugin extends Plugin {
|
|
4
|
-
name: string;
|
|
5
|
-
install(pluginManager: PluginManager): void;
|
|
6
|
-
configure(pluginManager: PluginManager): void;
|
|
7
|
-
}
|
package/dist/index.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
|
|
7
|
-
const util_1 = require("@jbrowse/core/util");
|
|
8
|
-
const Help_1 = __importDefault(require("@mui/icons-material/Help"));
|
|
9
|
-
const Info_1 = __importDefault(require("@mui/icons-material/Info"));
|
|
10
|
-
const AboutWidget_1 = __importDefault(require("./AboutWidget"));
|
|
11
|
-
const HelpWidget_1 = __importDefault(require("./HelpWidget"));
|
|
12
|
-
const ImportSessionWidget_1 = __importDefault(require("./ImportSessionWidget"));
|
|
13
|
-
const SessionManager_1 = __importDefault(require("./SessionManager"));
|
|
14
|
-
class MenusPlugin extends Plugin_1.default {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
this.name = 'MenusPlugin';
|
|
18
|
-
}
|
|
19
|
-
install(pluginManager) {
|
|
20
|
-
(0, AboutWidget_1.default)(pluginManager);
|
|
21
|
-
(0, HelpWidget_1.default)(pluginManager);
|
|
22
|
-
(0, ImportSessionWidget_1.default)(pluginManager);
|
|
23
|
-
(0, SessionManager_1.default)(pluginManager);
|
|
24
|
-
}
|
|
25
|
-
configure(pluginManager) {
|
|
26
|
-
if ((0, util_1.isAbstractMenuManager)(pluginManager.rootModel)) {
|
|
27
|
-
pluginManager.rootModel.appendToMenu('Help', {
|
|
28
|
-
label: 'About',
|
|
29
|
-
icon: Info_1.default,
|
|
30
|
-
onClick: (session) => {
|
|
31
|
-
const widget = session.addWidget('AboutWidget', 'aboutWidget');
|
|
32
|
-
session.showWidget(widget);
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
pluginManager.rootModel.appendToMenu('Help', {
|
|
36
|
-
label: 'Help',
|
|
37
|
-
icon: Help_1.default,
|
|
38
|
-
onClick: (session) => {
|
|
39
|
-
const widget = session.addWidget('HelpWidget', 'helpWidget');
|
|
40
|
-
session.showWidget(widget);
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.default = MenusPlugin;
|