@jbrowse/plugin-menus 5.0.0-beta.1 → 5.0.0-beta.11
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.js +2 -5
- package/esm/AboutWidget/index.js +3 -2
- package/esm/HelpWidget/index.js +3 -2
- package/esm/ImportSessionWidget/components/ImportSessionWidget.js +2 -1
- package/esm/ImportSessionWidget/index.js +3 -2
- package/esm/SessionManager/index.d.ts +1 -1
- package/esm/SessionManager/index.js +3 -2
- package/esm/index.js +2 -4
- package/package.json +9 -8
|
@@ -19,9 +19,6 @@ const useStyles = makeStyles()(theme => ({
|
|
|
19
19
|
accordions: {
|
|
20
20
|
marginTop: theme.spacing(3),
|
|
21
21
|
},
|
|
22
|
-
icon: {
|
|
23
|
-
color: theme.palette.tertiary.contrastText || '#fff',
|
|
24
|
-
},
|
|
25
22
|
}));
|
|
26
23
|
const AboutWidget = observer(function AboutWidget({ model, }) {
|
|
27
24
|
const { classes } = useStyles();
|
|
@@ -35,9 +32,9 @@ const AboutWidget = observer(function AboutWidget({ model, }) {
|
|
|
35
32
|
.filter(p => pluginManager.pluginMetadata[p.name]?.isCore)
|
|
36
33
|
.map(p => p.name));
|
|
37
34
|
const externalPlugins = plugins.filter(plugin => !corePlugins.has(plugin.name));
|
|
38
|
-
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 }), gitCommit ? (_jsxs(Typography, { variant: "body2", align: "center", children: ["Commit: ", gitCommit] })) : null, _jsxs(Typography, { align: "center", children: ["JBrowse is a ", _jsx(ExternalLink, { href: "https://gmod.org/", children: "GMOD" }), ' ', "project"] }), _jsx("br", {}), _jsx(Typography, { align: "center", children: "\u00A9 2019-2026 The Evolutionary Software Foundation" }), _jsxs("div", { className: classes.accordions, children: [_jsxs(Accordion, { defaultExpanded: true, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, {
|
|
35
|
+
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 }), gitCommit ? (_jsxs(Typography, { variant: "body2", align: "center", children: ["Commit: ", gitCommit] })) : null, _jsxs(Typography, { align: "center", children: ["JBrowse is a ", _jsx(ExternalLink, { href: "https://gmod.org/", children: "GMOD" }), ' ', "project"] }), _jsx("br", {}), _jsx(Typography, { align: "center", children: "\u00A9 2019-2026 The Evolutionary Software Foundation" }), _jsxs("div", { className: classes.accordions, children: [_jsxs(Accordion, { defaultExpanded: true, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, {}), children: _jsx(Typography, { children: "Browser settings" }) }), _jsx(AccordionDetails, { children: _jsxs("ul", { children: [graphicsCapabilities ? (_jsxs("li", { children: ["Graphics: ", effectiveRenderer(graphicsCapabilities)] })) : null, _jsxs("li", { children: ["Rendering:", ' ', defaultRpcDriver === 'WebWorkerRpcDriver'
|
|
39
36
|
? 'off main thread'
|
|
40
|
-
: 'on main thread'] })] }) })] }), _jsxs(Accordion, { defaultExpanded: true, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, {
|
|
37
|
+
: 'on main thread'] })] }) })] }), _jsxs(Accordion, { defaultExpanded: true, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, {}), children: _jsx(Typography, { children: "Plugins loaded" }) }), _jsxs(AccordionDetails, { children: [_jsx(Typography, { children: "External plugins" }), externalPlugins.length ? (_jsx("ul", { children: externalPlugins.map(plugin => {
|
|
41
38
|
const { url, name, version = '' } = plugin;
|
|
42
39
|
const text = `${name} ${version || ''}`;
|
|
43
40
|
return (_jsx("li", { children: plugin.url ? (_jsx(ExternalLink, { href: url, children: text })) : (_jsx("span", { children: text })) }, plugin.name));
|
package/esm/AboutWidget/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { lazy } from 'react';
|
|
2
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
2
|
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
3
|
+
import { lazyWithPreload } from '@jbrowse/core/util/lazyWithPreload';
|
|
4
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
5
|
import { types } from '@jbrowse/mobx-state-tree';
|
|
6
6
|
const configSchema = ConfigurationSchema('AboutWidget', {});
|
|
@@ -12,10 +12,11 @@ export default function AboutWidgetF(pluginManager) {
|
|
|
12
12
|
pluginManager.addWidgetType(() => {
|
|
13
13
|
return new WidgetType({
|
|
14
14
|
name: 'AboutWidget',
|
|
15
|
+
discardOnClose: true,
|
|
15
16
|
heading: 'About',
|
|
16
17
|
configSchema,
|
|
17
18
|
stateModel,
|
|
18
|
-
ReactComponent:
|
|
19
|
+
ReactComponent: lazyWithPreload(() => import('./components/AboutWidget.js')),
|
|
19
20
|
});
|
|
20
21
|
});
|
|
21
22
|
}
|
package/esm/HelpWidget/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { lazy } from 'react';
|
|
2
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
2
|
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
3
|
+
import { lazyWithPreload } from '@jbrowse/core/util/lazyWithPreload';
|
|
4
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
5
|
import { types } from '@jbrowse/mobx-state-tree';
|
|
6
6
|
const configSchema = ConfigurationSchema('HelpWidget', {});
|
|
@@ -12,10 +12,11 @@ export default function HelpWidgetF(pluginManager) {
|
|
|
12
12
|
pluginManager.addWidgetType(() => {
|
|
13
13
|
return new WidgetType({
|
|
14
14
|
name: 'HelpWidget',
|
|
15
|
+
discardOnClose: true,
|
|
15
16
|
heading: 'Help',
|
|
16
17
|
configSchema,
|
|
17
18
|
stateModel,
|
|
18
|
-
ReactComponent:
|
|
19
|
+
ReactComponent: lazyWithPreload(() => import('./components/HelpWidget.js')),
|
|
19
20
|
});
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { FileDropZone } from '@jbrowse/core/ui';
|
|
4
|
-
import { getSession } from '@jbrowse/core/util';
|
|
4
|
+
import { getEnv, getSession } from '@jbrowse/core/util';
|
|
5
5
|
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
6
6
|
import { Button, Paper, Typography } from '@mui/material';
|
|
7
7
|
import { observer } from 'mobx-react';
|
|
@@ -33,6 +33,7 @@ const ImportSessionWidget = observer(function ImportSessionWidget({ model, }) {
|
|
|
33
33
|
if (!session || typeof session !== 'object') {
|
|
34
34
|
throw new Error('No session found in file. Expected a JBrowse session export (a JSON file with a top-level "session" key).');
|
|
35
35
|
}
|
|
36
|
+
await getEnv(model).pluginManager.preloadSessionTypes(session);
|
|
36
37
|
getSession(model).setSession?.(session);
|
|
37
38
|
}
|
|
38
39
|
catch (e) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { lazy } from 'react';
|
|
2
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
2
|
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
3
|
+
import { lazyWithPreload } from '@jbrowse/core/util/lazyWithPreload';
|
|
4
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
5
|
import { types } from '@jbrowse/mobx-state-tree';
|
|
6
6
|
const configSchema = ConfigurationSchema('ImportSessionWidget', {});
|
|
@@ -12,10 +12,11 @@ export default function ImportSessionWidgetF(pluginManager) {
|
|
|
12
12
|
pluginManager.addWidgetType(() => {
|
|
13
13
|
return new WidgetType({
|
|
14
14
|
name: 'ImportSessionWidget',
|
|
15
|
+
discardOnClose: true,
|
|
15
16
|
heading: 'Import session',
|
|
16
17
|
configSchema,
|
|
17
18
|
stateModel,
|
|
18
|
-
ReactComponent:
|
|
19
|
+
ReactComponent: lazyWithPreload(() => import('./components/ImportSessionWidget.js')),
|
|
19
20
|
});
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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>>;
|
|
2
|
+
export declare const configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
|
|
3
3
|
export declare const stateModel: import("@jbrowse/mobx-state-tree").IModelType<{
|
|
4
4
|
id: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
5
5
|
type: import("@jbrowse/mobx-state-tree").ILiteralType<"SessionManager">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { lazy } from 'react';
|
|
2
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
2
|
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
3
|
+
import { lazyWithPreload } from '@jbrowse/core/util/lazyWithPreload';
|
|
4
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
5
|
import { types } from '@jbrowse/mobx-state-tree';
|
|
6
6
|
export const configSchema = ConfigurationSchema('SessionManager', {});
|
|
@@ -12,10 +12,11 @@ export default function SessionManagerF(pluginManager) {
|
|
|
12
12
|
pluginManager.addWidgetType(() => {
|
|
13
13
|
return new WidgetType({
|
|
14
14
|
name: 'SessionManager',
|
|
15
|
+
discardOnClose: true,
|
|
15
16
|
heading: 'Recent sessions',
|
|
16
17
|
configSchema,
|
|
17
18
|
stateModel,
|
|
18
|
-
ReactComponent:
|
|
19
|
+
ReactComponent: lazyWithPreload(() => import('./components/SessionManager.js')),
|
|
19
20
|
});
|
|
20
21
|
});
|
|
21
22
|
}
|
package/esm/index.js
CHANGED
|
@@ -20,16 +20,14 @@ export default class MenusPlugin extends Plugin {
|
|
|
20
20
|
label: 'About',
|
|
21
21
|
icon: InfoIcon,
|
|
22
22
|
onClick: (session) => {
|
|
23
|
-
|
|
24
|
-
session.showWidget(widget);
|
|
23
|
+
session.openWidget('AboutWidget', 'aboutWidget');
|
|
25
24
|
},
|
|
26
25
|
});
|
|
27
26
|
pluginManager.rootModel.appendToMenu('Help', {
|
|
28
27
|
label: 'Help',
|
|
29
28
|
icon: HelpIcon,
|
|
30
29
|
onClick: (session) => {
|
|
31
|
-
|
|
32
|
-
session.showWidget(widget);
|
|
30
|
+
session.openWidget('HelpWidget', 'helpWidget');
|
|
33
31
|
},
|
|
34
32
|
});
|
|
35
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-menus",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JBrowse 2 basic menus",
|
|
6
6
|
"keywords": [
|
|
@@ -21,14 +21,15 @@
|
|
|
21
21
|
"esm"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@jbrowse/mobx-state-tree": "^6.
|
|
25
|
-
"@mui/icons-material": "^9.
|
|
26
|
-
"@mui/material": "^9.
|
|
27
|
-
"@mui/
|
|
28
|
-
"
|
|
24
|
+
"@jbrowse/mobx-state-tree": "^6.7.0",
|
|
25
|
+
"@mui/icons-material": "^9.4.0",
|
|
26
|
+
"@mui/material": "^9.4.0",
|
|
27
|
+
"@mui/system": "^9.4.0",
|
|
28
|
+
"@mui/x-data-grid": "^9.14.0",
|
|
29
|
+
"mobx": "^7.0.5",
|
|
29
30
|
"mobx-react": "^10.0.2",
|
|
30
|
-
"@jbrowse/core": "^5.0.0-beta.
|
|
31
|
-
"@jbrowse/render-core": "^5.0.0-beta.
|
|
31
|
+
"@jbrowse/core": "^5.0.0-beta.11",
|
|
32
|
+
"@jbrowse/render-core": "^5.0.0-beta.11"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"react": ">=19.0.0",
|