@jbrowse/plugin-config 2.16.1 → 2.18.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/dist/ConfigurationEditorWidget/components/BooleanEditor.js +1 -1
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js +8 -11
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js +2 -2
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +2 -2
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +4 -11
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +1 -1
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.js +6 -6
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js +6 -6
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.js +12 -11
- package/dist/ConfigurationEditorWidget/components/SlotEditor.d.ts +1 -1
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js +11 -16
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +24 -21
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.js +12 -12
- package/dist/ConfigurationEditorWidget/components/TypeSelector.d.ts +1 -1
- package/dist/ConfigurationEditorWidget/index.d.ts +1 -1
- package/dist/ConfigurationEditorWidget/index.js +1 -1
- package/dist/ConfigurationEditorWidget/model.d.ts +1 -1
- package/dist/ConfigurationEditorWidget/model.js +1 -3
- package/dist/FromConfigAdapter/FromConfigAdapter.d.ts +5 -5
- package/dist/FromConfigAdapter/FromConfigAdapter.js +3 -4
- package/dist/FromConfigAdapter/configSchema.d.ts +0 -3
- package/dist/FromConfigAdapter/configSchema.js +1 -7
- package/dist/FromConfigAdapter/index.d.ts +1 -1
- package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.d.ts +5 -12
- package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +2 -12
- package/dist/FromConfigRegionsAdapter/configSchema.d.ts +0 -3
- package/dist/FromConfigRegionsAdapter/configSchema.js +1 -8
- package/dist/FromConfigRegionsAdapter/index.d.ts +1 -1
- package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +3 -16
- package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +3 -18
- package/dist/FromConfigSequenceAdapter/configSchema.d.ts +0 -3
- package/dist/FromConfigSequenceAdapter/configSchema.js +1 -7
- package/dist/FromConfigSequenceAdapter/index.d.ts +1 -1
- package/dist/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.d.ts +2 -1
- package/dist/NcbiSequenceReportAliasAdapter/configSchema.d.ts +0 -3
- package/dist/NcbiSequenceReportAliasAdapter/configSchema.js +1 -8
- package/dist/NcbiSequenceReportAliasAdapter/index.d.ts +1 -1
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +2 -1
- package/dist/RefNameAliasAdapter/configSchema.d.ts +0 -8
- package/dist/RefNameAliasAdapter/configSchema.js +1 -14
- package/dist/RefNameAliasAdapter/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.js +1 -1
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +8 -11
- package/esm/ConfigurationEditorWidget/components/ColorEditor.js +2 -2
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +2 -2
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +5 -12
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.js +6 -6
- package/esm/ConfigurationEditorWidget/components/HeadingComponent.js +1 -1
- package/esm/ConfigurationEditorWidget/components/JsonEditor.js +6 -6
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js +12 -11
- package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js +12 -17
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +24 -21
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js +12 -12
- package/esm/ConfigurationEditorWidget/components/TypeSelector.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/index.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/index.js +1 -1
- package/esm/ConfigurationEditorWidget/model.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/model.js +1 -3
- package/esm/FromConfigAdapter/FromConfigAdapter.d.ts +5 -5
- package/esm/FromConfigAdapter/FromConfigAdapter.js +3 -4
- package/esm/FromConfigAdapter/configSchema.d.ts +0 -3
- package/esm/FromConfigAdapter/configSchema.js +1 -7
- package/esm/FromConfigAdapter/index.d.ts +1 -1
- package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.d.ts +5 -12
- package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +3 -13
- package/esm/FromConfigRegionsAdapter/configSchema.d.ts +0 -3
- package/esm/FromConfigRegionsAdapter/configSchema.js +1 -8
- package/esm/FromConfigRegionsAdapter/index.d.ts +1 -1
- package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +3 -16
- package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +3 -18
- package/esm/FromConfigSequenceAdapter/configSchema.d.ts +0 -3
- package/esm/FromConfigSequenceAdapter/configSchema.js +1 -7
- package/esm/FromConfigSequenceAdapter/index.d.ts +1 -1
- package/esm/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.d.ts +2 -1
- package/esm/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.js +1 -1
- package/esm/NcbiSequenceReportAliasAdapter/configSchema.d.ts +0 -3
- package/esm/NcbiSequenceReportAliasAdapter/configSchema.js +1 -8
- package/esm/NcbiSequenceReportAliasAdapter/index.d.ts +1 -1
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +2 -1
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js +1 -1
- package/esm/RefNameAliasAdapter/configSchema.d.ts +0 -8
- package/esm/RefNameAliasAdapter/configSchema.js +1 -14
- package/esm/RefNameAliasAdapter/index.d.ts +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +2 -2
- package/package.json +2 -2
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const mobx_react_1 = require("mobx-react");
|
|
8
7
|
const material_1 = require("@mui/material");
|
|
8
|
+
const mobx_react_1 = require("mobx-react");
|
|
9
9
|
const BooleanEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
10
10
|
return (react_1.default.createElement(material_1.FormControl, null,
|
|
11
11
|
react_1.default.createElement(material_1.FormControlLabel, { label: slot.name, control: react_1.default.createElement(material_1.Checkbox, { checked: slot.value, onChange: evt => {
|
|
@@ -27,16 +27,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
-
const material_1 = require("@mui/material");
|
|
31
30
|
const util_1 = require("@jbrowse/core/util");
|
|
32
31
|
const jexlStrings_1 = require("@jbrowse/core/util/jexlStrings");
|
|
33
|
-
const
|
|
32
|
+
const Help_1 = __importDefault(require("@mui/icons-material/Help"));
|
|
33
|
+
const material_1 = require("@mui/material");
|
|
34
34
|
const mobx_react_1 = require("mobx-react");
|
|
35
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
35
36
|
const mui_1 = require("tss-react/mui");
|
|
36
|
-
// icons
|
|
37
|
-
const Help_1 = __importDefault(require("@mui/icons-material/Help"));
|
|
38
|
-
// Optimize by using system default fonts:
|
|
39
|
-
// https://css-tricks.com/snippets/css/font-stacks/
|
|
40
37
|
const fontFamily = 'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace';
|
|
41
38
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
42
39
|
callbackEditor: {
|
|
@@ -80,16 +77,16 @@ const CallbackEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
|
80
77
|
setCodeError(e);
|
|
81
78
|
}
|
|
82
79
|
}, [debouncedCode, slot]);
|
|
83
|
-
// if default value is a callback, will have to remove jexl:
|
|
84
|
-
// do this last
|
|
85
80
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
86
81
|
error ? react_1.default.createElement("p", { className: classes.error }, `${error}`) : null,
|
|
87
82
|
react_1.default.createElement("div", { className: classes.callbackContainer },
|
|
88
83
|
react_1.default.createElement(material_1.TextField, { multiline: true, className: classes.callbackEditor, value: code.startsWith('jexl:') ? code.split('jexl:')[1] : code, onChange: event => {
|
|
89
84
|
setCode(event.target.value);
|
|
90
|
-
}, style: { background: error ? '#fdd' : undefined },
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
}, style: { background: error ? '#fdd' : undefined }, slotProps: {
|
|
86
|
+
input: {
|
|
87
|
+
classes: {
|
|
88
|
+
input: classes.textAreaFont,
|
|
89
|
+
},
|
|
93
90
|
},
|
|
94
91
|
} }),
|
|
95
92
|
react_1.default.createElement("p", null, slot.description),
|
|
@@ -28,9 +28,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.ColorSlot = void 0;
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
|
-
const mobx_react_1 = require("mobx-react");
|
|
32
|
-
const material_1 = require("@mui/material");
|
|
33
31
|
const ColorPicker_1 = __importDefault(require("@jbrowse/core/ui/ColorPicker"));
|
|
32
|
+
const material_1 = require("@mui/material");
|
|
33
|
+
const mobx_react_1 = require("mobx-react");
|
|
34
34
|
const ColorSlot = (props) => {
|
|
35
35
|
const { value = '#000', label = '', TextFieldProps = {}, onChange } = props;
|
|
36
36
|
const [displayed, setDisplayed] = (0, react_1.useState)(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { AbstractSessionModel } from '@jbrowse/core/util';
|
|
4
4
|
declare const ConfigurationEditor: ({ model, }: {
|
|
5
5
|
model: {
|
|
6
6
|
target: AnyConfigurationModel;
|
|
@@ -4,16 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
8
|
+
const SanitizedHTML_1 = __importDefault(require("@jbrowse/core/ui/SanitizedHTML"));
|
|
9
|
+
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
7
10
|
const material_1 = require("@mui/material");
|
|
8
|
-
const mui_1 = require("tss-react/mui");
|
|
9
11
|
const mobx_react_1 = require("mobx-react");
|
|
10
12
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
11
13
|
const pluralize_1 = require("pluralize");
|
|
12
|
-
const
|
|
13
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
14
|
-
// icons
|
|
15
|
-
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
16
|
-
// locals
|
|
14
|
+
const mui_1 = require("tss-react/mui");
|
|
17
15
|
const SlotEditor_1 = __importDefault(require("./SlotEditor"));
|
|
18
16
|
const TypeSelector_1 = __importDefault(require("./TypeSelector"));
|
|
19
17
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
@@ -44,8 +42,6 @@ const Member = (0, mobx_react_1.observer)(function (props) {
|
|
|
44
42
|
return react_1.default.createElement(Member, { key: key, ...props, slot: subslot, slotName: key });
|
|
45
43
|
});
|
|
46
44
|
}
|
|
47
|
-
// if this is an explicitly typed schema, make a type-selecting dropdown
|
|
48
|
-
// that can be used to change its type
|
|
49
45
|
const typeNameChoices = (0, configuration_1.getTypeNamesFromExplicitlyTypedUnion)(slotSchema);
|
|
50
46
|
return (react_1.default.createElement(material_1.Accordion, { defaultExpanded: true, className: classes.accordion },
|
|
51
47
|
react_1.default.createElement(material_1.AccordionSummary, { expandIcon: react_1.default.createElement(ExpandMore_1.default, { className: classes.icon }) },
|
|
@@ -72,9 +68,6 @@ const Schema = (0, mobx_react_1.observer)(function ({ schema, path = [], }) {
|
|
|
72
68
|
});
|
|
73
69
|
const ConfigurationEditor = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
74
70
|
const { classes } = useStyles();
|
|
75
|
-
// key forces a re-render, otherwise the same field can end up being used for
|
|
76
|
-
// different tracks since only the backing model changes for example see pr
|
|
77
|
-
// #804
|
|
78
71
|
const { target } = model;
|
|
79
72
|
const key = (0, configuration_1.readConfObject)(target, 'trackId');
|
|
80
73
|
const name = (0, configuration_1.readConfObject)(target, 'name');
|
|
@@ -5,13 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = ConfigurationTextField;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const material_1 = require("@mui/material");
|
|
9
8
|
const ui_1 = require("@jbrowse/core/ui");
|
|
10
|
-
|
|
11
|
-
// div because the default is p which does not like div children
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
12
10
|
function ConfigurationTextField(props) {
|
|
13
11
|
const { helperText } = props;
|
|
14
|
-
return (react_1.default.createElement(material_1.TextField, { ...props, helperText: react_1.default.createElement(ui_1.SanitizedHTML, { html: helperText || '' }),
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
return (react_1.default.createElement(material_1.TextField, { ...props, helperText: react_1.default.createElement(ui_1.SanitizedHTML, { html: helperText || '' }), fullWidth: true, slotProps: {
|
|
13
|
+
formHelperText: {
|
|
14
|
+
component: 'div',
|
|
15
|
+
},
|
|
16
|
+
} }));
|
|
17
17
|
}
|
|
@@ -25,11 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const react_1 = __importStar(require("react"));
|
|
27
27
|
const material_1 = require("@mui/material");
|
|
28
|
-
const mui_1 = require("tss-react/mui");
|
|
29
28
|
const mobx_react_1 = require("mobx-react");
|
|
30
|
-
|
|
29
|
+
const mui_1 = require("tss-react/mui");
|
|
31
30
|
const fontSize = '12px';
|
|
32
|
-
// Optimize by using system default fonts: https://css-tricks.com/snippets/css/font-stacks/
|
|
33
31
|
const fontFamily = 'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace';
|
|
34
32
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
35
33
|
error: {
|
|
@@ -72,9 +70,11 @@ const JsonEditor = (0, mobx_react_1.observer)(function JsonEditor({ slot, }) {
|
|
|
72
70
|
react_1.default.createElement(material_1.InputLabel, { shrink: true, htmlFor: "json-editor" }, slot.name),
|
|
73
71
|
react_1.default.createElement(material_1.TextField, { id: "json-editor", className: classes.callbackEditor, value: contents, helperText: slot.description, multiline: true, onChange: event => {
|
|
74
72
|
setContents(event.target.value);
|
|
75
|
-
}, style: { background: error ? '#fdd' : undefined },
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
}, style: { background: error ? '#fdd' : undefined }, slotProps: {
|
|
74
|
+
input: {
|
|
75
|
+
classes: {
|
|
76
|
+
input: classes.textAreaFont,
|
|
77
|
+
},
|
|
78
78
|
},
|
|
79
79
|
} }))));
|
|
80
80
|
});
|
|
@@ -27,12 +27,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
-
const
|
|
30
|
+
const Add_1 = __importDefault(require("@mui/icons-material/Add"));
|
|
31
|
+
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
31
32
|
const material_1 = require("@mui/material");
|
|
33
|
+
const mobx_react_1 = require("mobx-react");
|
|
32
34
|
const mui_1 = require("tss-react/mui");
|
|
33
|
-
// icons
|
|
34
|
-
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
35
|
-
const Add_1 = __importDefault(require("@mui/icons-material/Add"));
|
|
36
35
|
const NumberEditor_1 = __importDefault(require("./NumberEditor"));
|
|
37
36
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
38
37
|
card: {
|
|
@@ -59,13 +58,15 @@ const NumberMapEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
|
59
58
|
react_1.default.createElement(material_1.Card, { raised: true, className: classes.card },
|
|
60
59
|
react_1.default.createElement(material_1.CardHeader, { disableTypography: true, title: react_1.default.createElement(material_1.TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => {
|
|
61
60
|
setValue(event.target.value);
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
react_1.default.createElement(material_1.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
}, slotProps: {
|
|
62
|
+
input: {
|
|
63
|
+
endAdornment: (react_1.default.createElement(material_1.InputAdornment, { position: "end" },
|
|
64
|
+
react_1.default.createElement(material_1.IconButton, { disabled: value === '', onClick: () => {
|
|
65
|
+
slot.add(value, 0);
|
|
66
|
+
setValue('');
|
|
67
|
+
} },
|
|
68
|
+
react_1.default.createElement(Add_1.default, null)))),
|
|
69
|
+
},
|
|
69
70
|
} }) })),
|
|
70
71
|
react_1.default.createElement(material_1.FormHelperText, null, slot.description)));
|
|
71
72
|
});
|
|
@@ -27,24 +27,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
-
const mobx_react_1 = require("mobx-react");
|
|
31
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
32
|
-
const util_1 = require("@jbrowse/core/util");
|
|
33
30
|
const ui_1 = require("@jbrowse/core/ui");
|
|
31
|
+
const util_1 = require("@jbrowse/core/util");
|
|
34
32
|
const mst_reflection_1 = require("@jbrowse/core/util/mst-reflection");
|
|
35
|
-
const material_1 = require("@mui/material");
|
|
36
|
-
// icons
|
|
37
33
|
const RadioButtonUnchecked_1 = __importDefault(require("@mui/icons-material/RadioButtonUnchecked"));
|
|
38
|
-
|
|
39
|
-
const
|
|
34
|
+
const material_1 = require("@mui/material");
|
|
35
|
+
const mobx_react_1 = require("mobx-react");
|
|
36
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
37
|
+
const BooleanEditor_1 = __importDefault(require("./BooleanEditor"));
|
|
40
38
|
const CallbackEditor_1 = __importDefault(require("./CallbackEditor"));
|
|
41
39
|
const ColorEditor_1 = __importDefault(require("./ColorEditor"));
|
|
42
|
-
const JsonEditor_1 = __importDefault(require("./JsonEditor"));
|
|
43
|
-
const StringArrayMapEditor_1 = __importDefault(require("./StringArrayMapEditor"));
|
|
44
40
|
const ConfigurationTextField_1 = __importDefault(require("./ConfigurationTextField"));
|
|
45
|
-
const
|
|
41
|
+
const JsonEditor_1 = __importDefault(require("./JsonEditor"));
|
|
46
42
|
const NumberEditor_1 = __importDefault(require("./NumberEditor"));
|
|
47
|
-
const
|
|
43
|
+
const NumberMapEditor_1 = __importDefault(require("./NumberMapEditor"));
|
|
44
|
+
const StringArrayEditor_1 = __importDefault(require("./StringArrayEditor"));
|
|
45
|
+
const StringArrayMapEditor_1 = __importDefault(require("./StringArrayMapEditor"));
|
|
48
46
|
const useSlotEditorStyles_1 = require("./useSlotEditorStyles");
|
|
49
47
|
const StringEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
50
48
|
return (react_1.default.createElement(ConfigurationTextField_1.default, { label: slot.name, helperText: slot.description, value: slot.value, onChange: evt => {
|
|
@@ -56,7 +54,6 @@ const TextEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
|
56
54
|
slot.set(evt.target.value);
|
|
57
55
|
} }));
|
|
58
56
|
});
|
|
59
|
-
// checked checkbox, looks like a styled (x)
|
|
60
57
|
const SvgCheckbox = () => (react_1.default.createElement(material_1.SvgIcon, null,
|
|
61
58
|
react_1.default.createElement("path", { d: "M20.41,3C21.8,5.71 22.35,8.84 22,12C21.8,15.16 20.7,18.29 18.83,21L17.3,20C18.91,17.57 19.85,14.8 20,12C20.34,9.2 19.89,6.43 18.7,4L20.41,3M5.17,3L6.7,4C5.09,6.43 4.15,9.2 4,12C3.66,14.8 4.12,17.57 5.3,20L3.61,21C2.21,18.29 1.65,15.17 2,12C2.2,8.84 3.3,5.71 5.17,3M12.08,10.68L14.4,7.45H16.93L13.15,12.45L15.35,17.37H13.09L11.71,14L9.28,17.33H6.76L10.66,12.21L8.53,7.45H10.8L12.08,10.68Z" })));
|
|
62
59
|
const IntegerEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
@@ -82,9 +79,7 @@ const FileSelectorWrapper = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
|
82
79
|
var _a;
|
|
83
80
|
return (react_1.default.createElement(ui_1.FileSelector, { location: slot.value, setLocation: location => {
|
|
84
81
|
slot.set(location);
|
|
85
|
-
}, name: slot.name, description: slot.description,
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
87
|
-
rootModel: (_a = (0, util_1.getEnv)(slot).pluginManager) === null || _a === void 0 ? void 0 : _a.rootModel }));
|
|
82
|
+
}, name: slot.name, description: slot.description, rootModel: (_a = (0, util_1.getEnv)(slot).pluginManager) === null || _a === void 0 ? void 0 : _a.rootModel }));
|
|
88
83
|
});
|
|
89
84
|
const valueComponents = {
|
|
90
85
|
string: StringEditor,
|
|
@@ -106,7 +101,7 @@ const SlotEditor = (0, mobx_react_1.observer)(function ({ slot, slotSchema, }) {
|
|
|
106
101
|
const { type } = slot;
|
|
107
102
|
let ValueComponent = slot.isCallback
|
|
108
103
|
? CallbackEditor_1.default
|
|
109
|
-
:
|
|
104
|
+
:
|
|
110
105
|
valueComponents[type];
|
|
111
106
|
if (!ValueComponent) {
|
|
112
107
|
console.warn(`no slot editor defined for ${type}, editing as string`);
|
|
@@ -27,10 +27,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
-
const mobx_react_1 = require("mobx-react");
|
|
31
|
-
const material_1 = require("@mui/material");
|
|
32
|
-
// icons
|
|
33
30
|
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
31
|
+
const material_1 = require("@mui/material");
|
|
32
|
+
const mobx_react_1 = require("mobx-react");
|
|
34
33
|
const StringArrayEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
35
34
|
const [value, setValue] = (0, react_1.useState)('');
|
|
36
35
|
const [addNew, setAddNew] = (0, react_1.useState)(false);
|
|
@@ -40,28 +39,32 @@ const StringArrayEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
|
40
39
|
slot.value.map((val, idx) => (react_1.default.createElement(material_1.ListItem, { key: `${JSON.stringify(val)}-${idx}`, disableGutters: true },
|
|
41
40
|
react_1.default.createElement(material_1.TextField, { value: val, onChange: evt => {
|
|
42
41
|
slot.setAtIndex(idx, evt.target.value);
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
react_1.default.createElement(material_1.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
}, slotProps: {
|
|
43
|
+
input: {
|
|
44
|
+
endAdornment: (react_1.default.createElement(material_1.InputAdornment, { position: "end" },
|
|
45
|
+
react_1.default.createElement(material_1.IconButton, { onClick: () => {
|
|
46
|
+
slot.removeAtIndex(idx);
|
|
47
|
+
} },
|
|
48
|
+
react_1.default.createElement(Delete_1.default, null)))),
|
|
49
|
+
},
|
|
49
50
|
} })))),
|
|
50
51
|
addNew ? (react_1.default.createElement(material_1.ListItem, { disableGutters: true },
|
|
51
52
|
react_1.default.createElement(material_1.TextField, { value: value, placeholder: "add new", onChange: event => {
|
|
52
53
|
setValue(event.target.value);
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
react_1.default.createElement(
|
|
56
|
-
react_1.default.createElement(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
}, slotProps: {
|
|
55
|
+
input: {
|
|
56
|
+
endAdornment: (react_1.default.createElement(material_1.InputAdornment, { position: "end" },
|
|
57
|
+
react_1.default.createElement(react_1.default.Fragment, null,
|
|
58
|
+
react_1.default.createElement(material_1.Button, { color: "primary", variant: "contained", style: { margin: 2 }, "data-testid": `stringArrayAdd-${slot.name}`, onClick: () => {
|
|
59
|
+
setAddNew(false);
|
|
60
|
+
slot.add(value);
|
|
61
|
+
setValue('');
|
|
62
|
+
} }, "OK"),
|
|
63
|
+
react_1.default.createElement(material_1.Button, { color: "primary", variant: "contained", style: { margin: 2 }, onClick: () => {
|
|
64
|
+
setAddNew(false);
|
|
65
|
+
setValue('');
|
|
66
|
+
} }, "Cancel")))),
|
|
67
|
+
},
|
|
65
68
|
} }))) : null,
|
|
66
69
|
react_1.default.createElement(material_1.Button, { color: "primary", variant: "contained", style: { margin: 4 }, disabled: addNew, onClick: () => {
|
|
67
70
|
setAddNew(true);
|
|
@@ -27,13 +27,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
-
const
|
|
30
|
+
const Add_1 = __importDefault(require("@mui/icons-material/Add"));
|
|
31
|
+
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
31
32
|
const material_1 = require("@mui/material");
|
|
33
|
+
const mobx_react_1 = require("mobx-react");
|
|
32
34
|
const mui_1 = require("tss-react/mui");
|
|
33
|
-
// icons
|
|
34
|
-
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
35
|
-
const Add_1 = __importDefault(require("@mui/icons-material/Add"));
|
|
36
|
-
// locals
|
|
37
35
|
const StringArrayEditor_1 = __importDefault(require("./StringArrayEditor"));
|
|
38
36
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
39
37
|
card: {
|
|
@@ -68,13 +66,15 @@ const StringArrayMapEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
|
68
66
|
react_1.default.createElement(material_1.Card, { raised: true, className: classes.card },
|
|
69
67
|
react_1.default.createElement(material_1.CardHeader, { disableTypography: true, title: react_1.default.createElement(material_1.TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => {
|
|
70
68
|
setValue(event.target.value);
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
react_1.default.createElement(material_1.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
}, slotProps: {
|
|
70
|
+
input: {
|
|
71
|
+
endAdornment: (react_1.default.createElement(material_1.InputAdornment, { position: "end" },
|
|
72
|
+
react_1.default.createElement(material_1.IconButton, { disabled: value === '', onClick: () => {
|
|
73
|
+
slot.add(value, []);
|
|
74
|
+
setValue('');
|
|
75
|
+
} },
|
|
76
|
+
react_1.default.createElement(Add_1.default, null)))),
|
|
77
|
+
},
|
|
78
78
|
} }) })),
|
|
79
79
|
react_1.default.createElement(material_1.FormHelperText, null, slot.description)));
|
|
80
80
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
3
|
declare const TypeSelector: ({ typeNameChoices, slot, slotName, onChange, }: {
|
|
4
4
|
typeNameChoices: string[];
|
|
5
5
|
slot: AnyConfigurationModel;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function registerConfigurationEditorWidget(pluginManager: PluginManager): void;
|
|
@@ -30,8 +30,8 @@ exports.default = registerConfigurationEditorWidget;
|
|
|
30
30
|
const react_1 = require("react");
|
|
31
31
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
32
32
|
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
33
|
-
const model_1 = __importDefault(require("./model"));
|
|
34
33
|
const HeadingComponent_1 = __importDefault(require("./components/HeadingComponent"));
|
|
34
|
+
const model_1 = __importDefault(require("./model"));
|
|
35
35
|
const configSchema = (0, configuration_1.ConfigurationSchema)('ConfigurationEditorWidget', {});
|
|
36
36
|
const LazyConfigurationEditorComponent = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ConfigurationEditor'))));
|
|
37
37
|
function registerConfigurationEditorWidget(pluginManager) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
3
3
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
4
4
|
type: import("mobx-state-tree").ISimpleType<"ConfigurationEditorWidget">;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = stateModelFactory;
|
|
4
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
5
4
|
const mst_1 = require("@jbrowse/core/util/types/mst");
|
|
5
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
6
|
function stateModelFactory(pluginManager) {
|
|
7
7
|
return mobx_state_tree_1.types
|
|
8
8
|
.model('ConfigurationEditorWidget', {
|
|
9
9
|
id: mst_1.ElementId,
|
|
10
10
|
type: mobx_state_tree_1.types.literal('ConfigurationEditorWidget'),
|
|
11
|
-
// If you add different types of targets, don't forget to account for that
|
|
12
|
-
// in the key of ./components/ConfigurationEditor.js
|
|
13
11
|
target: mobx_state_tree_1.types.safeReference(pluginManager.pluggableConfigSchemaType('track')),
|
|
14
12
|
})
|
|
15
13
|
.actions(self => ({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
+
import type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
5
|
+
import type { Feature, SimpleFeatureSerialized } from '@jbrowse/core/util/simpleFeature';
|
|
6
|
+
import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
7
7
|
export declare function makeFeatures(fdata: SimpleFeatureSerialized[]): Map<string, Feature[]>;
|
|
8
8
|
export default class FromConfigAdapter extends BaseFeatureDataAdapter {
|
|
9
9
|
protected features: Map<string, Feature[]>;
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.makeFeatures = makeFeatures;
|
|
7
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
7
8
|
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
8
|
-
const simpleFeature_1 = __importDefault(require("@jbrowse/core/util/simpleFeature"));
|
|
9
9
|
const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
10
|
-
const
|
|
10
|
+
const simpleFeature_1 = __importDefault(require("@jbrowse/core/util/simpleFeature"));
|
|
11
11
|
function makeFeatures(fdata) {
|
|
12
12
|
const features = new Map();
|
|
13
13
|
for (const entry of fdata) {
|
|
@@ -20,7 +20,6 @@ function makeFeatures(fdata) {
|
|
|
20
20
|
}
|
|
21
21
|
bucket.push(f);
|
|
22
22
|
}
|
|
23
|
-
// sort the features on each reference sequence by start coordinate
|
|
24
23
|
for (const refFeatures of features.values()) {
|
|
25
24
|
refFeatures.sort((a, b) => a.get('start') - b.get('start'));
|
|
26
25
|
}
|
|
@@ -53,6 +52,6 @@ class FromConfigAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
53
52
|
observer.complete();
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
|
-
freeResources(
|
|
55
|
+
freeResources() { }
|
|
57
56
|
}
|
|
58
57
|
exports.default = FromConfigAdapter;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
|
|
5
|
-
* #config FromConfigAdapter
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
function x() { }
|
|
8
5
|
const configSchema = (0, configuration_1.ConfigurationSchema)('FromConfigAdapter', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
features: {
|
|
13
7
|
type: 'frozen',
|
|
14
8
|
defaultValue: [],
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function FromConfigAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { BaseAdapter
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
* Adapter that just returns the features defined in its `features` configuration
|
|
7
|
-
* key, like:
|
|
8
|
-
* `"features": [ { "refName": "ctgA", "start":1, "end":20 }, ... ]`
|
|
9
|
-
*/
|
|
1
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
+
import type { RegionsAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
5
|
+
import type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
10
6
|
export default class FromConfigRegionsAdapter extends BaseAdapter implements RegionsAdapter {
|
|
11
7
|
private features;
|
|
12
8
|
constructor(config: AnyConfigurationModel, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
|
|
13
|
-
/**
|
|
14
|
-
* Get refName, start, and end for all features after collapsing any overlaps
|
|
15
|
-
*/
|
|
16
9
|
getRegions(): Promise<{
|
|
17
10
|
refName: string;
|
|
18
11
|
start: number;
|
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
4
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
+
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
5
5
|
const FromConfigAdapter_1 = require("../FromConfigAdapter/FromConfigAdapter");
|
|
6
|
-
/**
|
|
7
|
-
* Adapter that just returns the features defined in its `features` configuration
|
|
8
|
-
* key, like:
|
|
9
|
-
* `"features": [ { "refName": "ctgA", "start":1, "end":20 }, ... ]`
|
|
10
|
-
*/
|
|
11
6
|
class FromConfigRegionsAdapter extends BaseAdapter_1.BaseAdapter {
|
|
12
7
|
constructor(config, getSubAdapter, pluginManager) {
|
|
13
8
|
super(config, getSubAdapter, pluginManager);
|
|
14
9
|
const f = (0, configuration_1.readConfObject)(config, 'features');
|
|
15
10
|
this.features = (0, FromConfigAdapter_1.makeFeatures)(f);
|
|
16
11
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Get refName, start, and end for all features after collapsing any overlaps
|
|
19
|
-
*/
|
|
20
12
|
async getRegions() {
|
|
21
13
|
const regions = [];
|
|
22
|
-
// recall: features are stored in this object sorted by start coordinate
|
|
23
14
|
for (const [refName, features] of this.features) {
|
|
24
15
|
let currentRegion;
|
|
25
16
|
for (const feature of features) {
|
|
@@ -43,10 +34,9 @@ class FromConfigRegionsAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
43
34
|
regions.push(currentRegion);
|
|
44
35
|
}
|
|
45
36
|
}
|
|
46
|
-
// sort the regions by refName
|
|
47
37
|
regions.sort((a, b) => a.refName.localeCompare(b.refName));
|
|
48
38
|
return regions;
|
|
49
39
|
}
|
|
50
|
-
freeResources(
|
|
40
|
+
freeResources() { }
|
|
51
41
|
}
|
|
52
42
|
exports.default = FromConfigRegionsAdapter;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
|
|
5
|
-
* #config FromConfigRegionsAdapter
|
|
6
|
-
* used for specifying refNames+sizes of an assembly
|
|
7
|
-
*/
|
|
8
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
function x() { }
|
|
9
5
|
const regionsConfigSchema = (0, configuration_1.ConfigurationSchema)('FromConfigRegionsAdapter', {
|
|
10
|
-
/**
|
|
11
|
-
* #slot
|
|
12
|
-
*/
|
|
13
6
|
features: {
|
|
14
7
|
type: 'frozen',
|
|
15
8
|
defaultValue: [],
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function FromConfigRegionsAdapterF(pluginManager: PluginManager): void;
|