@jbrowse/plugin-config 2.3.4 → 2.4.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.d.ts +10 -0
- package/dist/ConfigurationEditorWidget/components/BooleanEditor.js +14 -0
- package/dist/ConfigurationEditorWidget/components/BooleanEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +25 -22
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +1 -1
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +5 -0
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.js +19 -0
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/NumberEditor.d.ts +11 -0
- package/dist/ConfigurationEditorWidget/components/NumberEditor.js +46 -0
- package/dist/ConfigurationEditorWidget/components/NumberEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +11 -0
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.js +66 -0
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js +15 -97
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js.map +1 -1
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +1 -1
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js.map +1 -1
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +14 -0
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.js +71 -0
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.js.map +1 -0
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js +3 -4
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js.map +1 -1
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.d.ts +10 -0
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.js +9 -0
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +25 -22
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +1 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +5 -0
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.js +13 -0
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/NumberEditor.d.ts +11 -0
- package/esm/ConfigurationEditorWidget/components/NumberEditor.js +18 -0
- package/esm/ConfigurationEditorWidget/components/NumberEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +11 -0
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js +38 -0
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js +13 -95
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js.map +1 -1
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +1 -1
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js.map +1 -1
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +14 -0
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js +43 -0
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js.map +1 -0
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js +3 -4
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js.map +1 -1
- package/package.json +2 -2
- package/src/ConfigurationEditorWidget/components/BooleanEditor.tsx +35 -0
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.tsx +116 -123
- package/src/ConfigurationEditorWidget/components/ConfigurationTextField.tsx +22 -0
- package/src/ConfigurationEditorWidget/components/NumberEditor.tsx +34 -0
- package/src/ConfigurationEditorWidget/components/NumberMapEditor.tsx +94 -0
- package/src/ConfigurationEditorWidget/components/SlotEditor.tsx +57 -304
- package/src/ConfigurationEditorWidget/components/StringArrayEditor.tsx +1 -4
- package/src/ConfigurationEditorWidget/components/StringArrayMapEditor.tsx +104 -0
- package/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap +113 -58
- package/src/RefNameAliasAdapter/RefNameAliasAdapter.ts +3 -4
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
4
4
|
const io_1 = require("@jbrowse/core/util/io");
|
|
5
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
6
5
|
class RefNameAliasAdapter extends BaseAdapter_1.BaseAdapter {
|
|
7
6
|
async getRefNameAliases() {
|
|
8
|
-
const loc =
|
|
7
|
+
const loc = this.getConf('location');
|
|
9
8
|
if (loc.uri === '' || loc.uri === '/path/to/my/aliases.txt') {
|
|
10
9
|
return [];
|
|
11
10
|
}
|
|
12
|
-
const results = await (0, io_1.openLocation)(loc).readFile('utf8');
|
|
13
|
-
const refColumn =
|
|
11
|
+
const results = await (0, io_1.openLocation)(loc, this.pluginManager).readFile('utf8');
|
|
12
|
+
const refColumn = this.getConf('refNameColumn');
|
|
14
13
|
return results
|
|
15
14
|
.trim()
|
|
16
15
|
.split(/\n|\r\n|\r/)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefNameAliasAdapter.js","sourceRoot":"","sources":["../../src/RefNameAliasAdapter/RefNameAliasAdapter.ts"],"names":[],"mappings":";;AAAA,yEAGgD;AAChD,8CAAoD;
|
|
1
|
+
{"version":3,"file":"RefNameAliasAdapter.js","sourceRoot":"","sources":["../../src/RefNameAliasAdapter/RefNameAliasAdapter.ts"],"names":[],"mappings":";;AAAA,yEAGgD;AAChD,8CAAoD;AAEpD,MAAqB,mBACnB,SAAQ,yBAAW;IAGnB,KAAK,CAAC,iBAAiB;QACrB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QACpC,IAAI,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,GAAG,KAAK,yBAAyB,EAAE;YAC3D,OAAO,EAAE,CAAA;SACV;QACD,MAAM,OAAO,GAAG,MAAM,IAAA,iBAAY,EAAC,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAC5E,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;QAC/C,OAAO,OAAO;aACX,IAAI,EAAE;aACN,KAAK,CAAC,YAAY,CAAC;aACnB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aACtC,GAAG,CAAC,GAAG,CAAC,EAAE;YACT,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAC/B,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;YAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAA;QAC9D,CAAC,CAAC,CAAA;IACN,CAAC;IAED,KAAK,CAAC,aAAa,KAAI,CAAC;CACzB;AAvBD,sCAuBC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import { Checkbox, FormControl, FormControlLabel, FormHelperText, } from '@mui/material';
|
|
4
|
+
export default observer(function ({ slot, }) {
|
|
5
|
+
return (React.createElement(FormControl, null,
|
|
6
|
+
React.createElement(FormControlLabel, { label: slot.name, control: React.createElement(Checkbox, { checked: slot.value, onChange: evt => slot.set(evt.target.checked) }) }),
|
|
7
|
+
React.createElement(FormHelperText, null, slot.description)));
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=BooleanEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BooleanEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/BooleanEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,cAAc,GACf,MAAM,eAAe,CAAA;AAEtB,eAAe,QAAQ,CAAC,UAAU,EAChC,IAAI,GAQL;IACC,OAAO,CACL,oBAAC,WAAW;QACV,oBAAC,gBAAgB,IACf,KAAK,EAAE,IAAI,CAAC,IAAI,EAChB,OAAO,EACL,oBAAC,QAAQ,IACP,OAAO,EAAE,IAAI,CAAC,KAAK,EACnB,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAC7C,GAEJ;QACF,oBAAC,cAAc,QAAE,IAAI,CAAC,WAAW,CAAkB,CACvC,CACf,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -10,26 +10,29 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
|
10
10
|
// locals
|
|
11
11
|
import SlotEditor from './SlotEditor';
|
|
12
12
|
import TypeSelector from './TypeSelector';
|
|
13
|
-
const useStyles = makeStyles()(theme =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
const useStyles = makeStyles()(theme => {
|
|
14
|
+
var _a;
|
|
15
|
+
return ({
|
|
16
|
+
expandIcon: {
|
|
17
|
+
color: ((_a = theme.palette.tertiary) === null || _a === void 0 ? void 0 : _a.contrastText) || '#fff',
|
|
18
|
+
},
|
|
19
|
+
root: {
|
|
20
|
+
padding: theme.spacing(1, 3, 1, 1),
|
|
21
|
+
},
|
|
22
|
+
expansionPanelDetails: {
|
|
23
|
+
display: 'block',
|
|
24
|
+
padding: theme.spacing(1),
|
|
25
|
+
},
|
|
26
|
+
accordion: {
|
|
27
|
+
border: `1px solid ${theme.palette.text.primary}`,
|
|
28
|
+
},
|
|
29
|
+
noOverflow: {
|
|
30
|
+
width: '100%',
|
|
31
|
+
overflowX: 'auto',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
const Member = observer(function (props) {
|
|
33
36
|
const { classes } = useStyles();
|
|
34
37
|
const { slotName, slotSchema, schema, slot = schema[slotName], path = [], } = props;
|
|
35
38
|
let typeSelector;
|
|
@@ -64,11 +67,11 @@ const Member = observer((props) => {
|
|
|
64
67
|
}
|
|
65
68
|
return null;
|
|
66
69
|
});
|
|
67
|
-
const Schema = observer(({ schema, path = [], })
|
|
70
|
+
const Schema = observer(function ({ schema, path = [], }) {
|
|
68
71
|
const properties = getMembers(schema).properties;
|
|
69
72
|
return (React.createElement(React.Fragment, null, Object.entries(properties).map(([slotName, slotSchema]) => (React.createElement(Member, { key: slotName, slotName: slotName, slotSchema: slotSchema, path: path, schema: schema })))));
|
|
70
73
|
});
|
|
71
|
-
const ConfigurationEditor = observer(({ model, })
|
|
74
|
+
const ConfigurationEditor = observer(function ({ model, }) {
|
|
72
75
|
const { classes } = useStyles();
|
|
73
76
|
// key forces a re-render, otherwise the same field can end up being used
|
|
74
77
|
// for different tracks since only the backing model changes for example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/ConfigurationEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,cAAc,EACd,oCAAoC,EACpC,yBAAyB,EACzB,uBAAuB,GAExB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAY,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,QAAQ;AACR,OAAO,cAAc,MAAM,gCAAgC,CAAA;AAE3D,SAAS;AACT,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAGzC,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"ConfigurationEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/ConfigurationEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,cAAc,EACd,oCAAoC,EACpC,yBAAyB,EACzB,uBAAuB,GAExB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAY,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,QAAQ,EA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,EAAE,OAAO,CAAC,UAAU,GAAI;gBAE7D,oBAAC,UAAU,QAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,eAAe,CAAc,CACjC;YACnB,oBAAC,gBAAgB,IACf,SAAS,EAAE,OAAO,CAAC,qBAAqB,iBAC5B,cAAc,IAEzB,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,oBAAC,MAAM,IAAC,MAAM,EAAE,MAAM,GAAI,CACtC,CACT;QAGZ,6BAAK,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,GAAI,CAC9B,CACJ,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextField } from '@mui/material';
|
|
3
|
+
import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
4
|
+
// adds ability to have html in helperText. note that FormHelperTextProps is
|
|
5
|
+
// div because the default is p which does not like div children
|
|
6
|
+
export default function ConfigurationTextField(props) {
|
|
7
|
+
const { helperText } = props;
|
|
8
|
+
return (React.createElement(TextField, { ...props, helperText: React.createElement(SanitizedHTML, { html: helperText || '' }), FormHelperTextProps: {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
component: 'div',
|
|
11
|
+
}, fullWidth: true }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ConfigurationTextField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigurationTextField.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/ConfigurationTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAkB,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,4EAA4E;AAC5E,gEAAgE;AAChE,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,KAA+C;IAE/C,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAA;IAC5B,OAAO,CACL,oBAAC,SAAS,OACJ,KAAK,EACT,UAAU,EAAE,oBAAC,aAAa,IAAC,IAAI,EAAE,UAAU,IAAI,EAAE,GAAI,EACrD,mBAAmB,EAAE;YACnB,aAAa;YACb,SAAS,EAAE,KAAK;SACjB,EACD,SAAS,SACT,CACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: ({ slot, }: {
|
|
3
|
+
slot: {
|
|
4
|
+
name?: string | undefined;
|
|
5
|
+
value: string;
|
|
6
|
+
description?: string | undefined;
|
|
7
|
+
set: (val: number) => void;
|
|
8
|
+
reset?: (() => void) | undefined;
|
|
9
|
+
};
|
|
10
|
+
}) => JSX.Element;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import ConfigurationTextField from './ConfigurationTextField';
|
|
4
|
+
export default observer(function ({ slot, }) {
|
|
5
|
+
const [val, setVal] = useState(slot.value);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
var _a;
|
|
8
|
+
const num = parseFloat(val);
|
|
9
|
+
if (!Number.isNaN(num)) {
|
|
10
|
+
slot.set(num);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
(_a = slot.reset) === null || _a === void 0 ? void 0 : _a.call(slot);
|
|
14
|
+
}
|
|
15
|
+
}, [slot, val]);
|
|
16
|
+
return (React.createElement(ConfigurationTextField, { label: slot.name, helperText: slot.description, value: val, type: "number", onChange: evt => setVal(evt.target.value) }));
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=NumberEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/NumberEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,sBAAsB,MAAM,0BAA0B,CAAA;AAE7D,eAAe,QAAQ,CAAC,UAAU,EAChC,IAAI,GASL;IACC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC1C,SAAS,CAAC,GAAG,EAAE;;QACb,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,CAAA;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACtB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;SACd;aAAM;YACL,MAAA,IAAI,CAAC,KAAK,oDAAI,CAAA;SACf;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;IACf,OAAO,CACL,oBAAC,sBAAsB,IACrB,KAAK,EAAE,IAAI,CAAC,IAAI,EAChB,UAAU,EAAE,IAAI,CAAC,WAAW,EAC5B,KAAK,EAAE,GAAG,EACV,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GACzC,CACH,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: ({ slot, }: {
|
|
3
|
+
slot: {
|
|
4
|
+
name: string;
|
|
5
|
+
value: Map<string, string>;
|
|
6
|
+
remove: (key: string) => void;
|
|
7
|
+
add: (key: string, val: number) => void;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
}) => JSX.Element;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import { Card, CardContent, CardHeader, FormHelperText, IconButton, InputAdornment, InputLabel, TextField, } from '@mui/material';
|
|
4
|
+
import { makeStyles } from 'tss-react/mui';
|
|
5
|
+
// icons
|
|
6
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
7
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
8
|
+
import NumberEditor from './NumberEditor';
|
|
9
|
+
const useStyles = makeStyles()(theme => ({
|
|
10
|
+
card: {
|
|
11
|
+
marginTop: theme.spacing(1),
|
|
12
|
+
},
|
|
13
|
+
}));
|
|
14
|
+
export default observer(function ({ slot, }) {
|
|
15
|
+
const { classes } = useStyles();
|
|
16
|
+
const [value, setValue] = useState('');
|
|
17
|
+
return (React.createElement(React.Fragment, null,
|
|
18
|
+
React.createElement(InputLabel, null, slot.name),
|
|
19
|
+
Array.from(slot.value, ([key, val]) => (React.createElement(Card, { raised: true, key: key, className: classes.card },
|
|
20
|
+
React.createElement(CardHeader, { title: key, action: React.createElement(IconButton, { onClick: () => slot.remove(key) },
|
|
21
|
+
React.createElement(DeleteIcon, null)) }),
|
|
22
|
+
React.createElement(CardContent, null,
|
|
23
|
+
React.createElement(NumberEditor, { slot: {
|
|
24
|
+
value: val,
|
|
25
|
+
set: (val) => slot.add(key, val),
|
|
26
|
+
} }))))),
|
|
27
|
+
React.createElement(Card, { raised: true, className: classes.card },
|
|
28
|
+
React.createElement(CardHeader, { disableTypography: true, title: React.createElement(TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => setValue(event.target.value), InputProps: {
|
|
29
|
+
endAdornment: (React.createElement(InputAdornment, { position: "end" },
|
|
30
|
+
React.createElement(IconButton, { disabled: value === '', onClick: () => {
|
|
31
|
+
slot.add(value, 0);
|
|
32
|
+
setValue('');
|
|
33
|
+
} },
|
|
34
|
+
React.createElement(AddIcon, null)))),
|
|
35
|
+
} }) })),
|
|
36
|
+
React.createElement(FormHelperText, null, slot.description)));
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=NumberMapEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberMapEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/NumberMapEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EACL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,cAAc,EACd,UAAU,EACV,cAAc,EACd,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,QAAQ;AACR,OAAO,UAAU,MAAM,4BAA4B,CAAA;AACnD,OAAO,OAAO,MAAM,yBAAyB,CAAA;AAC7C,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvC,IAAI,EAAE;QACJ,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;KAC5B;CACF,CAAC,CAAC,CAAA;AAEH,eAAe,QAAQ,CAAC,UAAU,EAChC,IAAI,GASL;IACC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAA;IAC/B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IACtC,OAAO,CACL;QACE,oBAAC,UAAU,QAAE,IAAI,CAAC,IAAI,CAAc;QACnC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CACtC,oBAAC,IAAI,IAAC,MAAM,QAAC,GAAG,EAAE,GAAG,EAA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{ getPropertyMembers } from 'mobx-state-tree';
|
|
4
4
|
import { getEnv } from '@jbrowse/core/util';
|
|
5
|
-
import { FileSelector
|
|
5
|
+
import { FileSelector } from '@jbrowse/core/ui';
|
|
6
6
|
import { getPropertyType, getSubType, getUnionSubTypes, } from '@jbrowse/core/util/mst-reflection';
|
|
7
|
-
import {
|
|
7
|
+
import { IconButton, MenuItem, Paper, SvgIcon, TextField } from '@mui/material';
|
|
8
8
|
import { makeStyles } from 'tss-react/mui';
|
|
9
9
|
// icons
|
|
10
|
-
import DeleteIcon from '@mui/icons-material/Delete';
|
|
11
|
-
import AddIcon from '@mui/icons-material/Add';
|
|
12
10
|
import RadioButtonUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked';
|
|
13
11
|
// locals
|
|
14
12
|
import StringArrayEditor from './StringArrayEditor';
|
|
15
13
|
import CallbackEditor from './CallbackEditor';
|
|
16
14
|
import ColorEditor from './ColorEditor';
|
|
17
15
|
import JsonEditor from './JsonEditor';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
component: 'div',
|
|
25
|
-
}, fullWidth: true }));
|
|
26
|
-
}
|
|
27
|
-
const StringEditor = observer(({ slot, }) => (React.createElement(MyTextField, { label: slot.name, helperText: slot.description, value: slot.value, onChange: evt => slot.set(evt.target.value) })));
|
|
16
|
+
import StringArrayMapEditor from './StringArrayMapEditor';
|
|
17
|
+
import ConfigurationTextField from './ConfigurationTextField';
|
|
18
|
+
import NumberMapEditor from './NumberMapEditor';
|
|
19
|
+
import NumberEditor from './NumberEditor';
|
|
20
|
+
import BooleanEditor from './BooleanEditor';
|
|
21
|
+
const StringEditor = observer(({ slot, }) => (React.createElement(ConfigurationTextField, { label: slot.name, helperText: slot.description, value: slot.value, onChange: evt => slot.set(evt.target.value) })));
|
|
28
22
|
const TextEditor = observer(({ slot, }) => (React.createElement(TextField, { label: slot.name, helperText: slot.description, multiline: true, value: slot.value, onChange: evt => slot.set(evt.target.value) })));
|
|
29
23
|
// checked checkbox, looks like a styled (x)
|
|
30
24
|
const SvgCheckbox = () => (React.createElement(SvgIcon, null,
|
|
31
25
|
React.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" })));
|
|
32
|
-
const useMapEditorStyles = makeStyles()(theme => ({
|
|
33
|
-
card: {
|
|
34
|
-
marginTop: theme.spacing(1),
|
|
35
|
-
},
|
|
36
|
-
}));
|
|
37
|
-
const StringArrayMapEditor = observer(({ slot, }) => {
|
|
38
|
-
const { classes } = useMapEditorStyles();
|
|
39
|
-
const [value, setValue] = useState('');
|
|
40
|
-
return (React.createElement(React.Fragment, null,
|
|
41
|
-
React.createElement(InputLabel, null, slot.name),
|
|
42
|
-
Array.from(slot.value, ([key, val]) => (React.createElement(Card, { raised: true, key: key, className: classes.card },
|
|
43
|
-
React.createElement(CardHeader, { title: key, action: React.createElement(IconButton, { color: "secondary", onClick: () => slot.remove(key) },
|
|
44
|
-
React.createElement(DeleteIcon, null)) }),
|
|
45
|
-
React.createElement(CardContent, null,
|
|
46
|
-
React.createElement(StringArrayEditor, { slot: {
|
|
47
|
-
name: slot.name,
|
|
48
|
-
value: val,
|
|
49
|
-
description: `Values associated with entry ${key}`,
|
|
50
|
-
setAtIndex: (idx, val) => slot.setAtKeyIndex(key, idx, val),
|
|
51
|
-
removeAtIndex: (idx) => slot.removeAtKeyIndex(key, idx),
|
|
52
|
-
add: (val) => slot.addToKey(key, val),
|
|
53
|
-
} }))))),
|
|
54
|
-
React.createElement(Card, { raised: true, className: classes.card },
|
|
55
|
-
React.createElement(CardHeader, { disableTypography: true, title: React.createElement(TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => setValue(event.target.value), InputProps: {
|
|
56
|
-
endAdornment: (React.createElement(InputAdornment, { position: "end" },
|
|
57
|
-
React.createElement(IconButton, { disabled: value === '', onClick: () => {
|
|
58
|
-
slot.add(value, []);
|
|
59
|
-
setValue('');
|
|
60
|
-
}, color: "secondary" },
|
|
61
|
-
React.createElement(AddIcon, null)))),
|
|
62
|
-
} }) })),
|
|
63
|
-
React.createElement(FormHelperText, null, slot.description)));
|
|
64
|
-
});
|
|
65
|
-
const NumberMapEditor = observer(({ slot, }) => {
|
|
66
|
-
const { classes } = useMapEditorStyles();
|
|
67
|
-
const [value, setValue] = useState('');
|
|
68
|
-
return (React.createElement(React.Fragment, null,
|
|
69
|
-
React.createElement(InputLabel, null, slot.name),
|
|
70
|
-
Array.from(slot.value, ([key, val]) => (React.createElement(Card, { raised: true, key: key, className: classes.card },
|
|
71
|
-
React.createElement(CardHeader, { title: key, action: React.createElement(IconButton, { color: "secondary", onClick: () => slot.remove(key) },
|
|
72
|
-
React.createElement(DeleteIcon, null)) }),
|
|
73
|
-
React.createElement(CardContent, null,
|
|
74
|
-
React.createElement(NumberEditor, { slot: {
|
|
75
|
-
value: val,
|
|
76
|
-
set: (val) => slot.add(key, val),
|
|
77
|
-
} }))))),
|
|
78
|
-
React.createElement(Card, { raised: true, className: classes.card },
|
|
79
|
-
React.createElement(CardHeader, { disableTypography: true, title: React.createElement(TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => setValue(event.target.value), InputProps: {
|
|
80
|
-
endAdornment: (React.createElement(InputAdornment, { position: "end" },
|
|
81
|
-
React.createElement(IconButton, { disabled: value === '', onClick: () => {
|
|
82
|
-
slot.add(value, 0);
|
|
83
|
-
setValue('');
|
|
84
|
-
}, color: "secondary" },
|
|
85
|
-
React.createElement(AddIcon, null)))),
|
|
86
|
-
} }) })),
|
|
87
|
-
React.createElement(FormHelperText, null, slot.description)));
|
|
88
|
-
});
|
|
89
|
-
const NumberEditor = observer(({ slot, }) => {
|
|
90
|
-
const [val, setVal] = useState(slot.value);
|
|
91
|
-
useEffect(() => {
|
|
92
|
-
var _a;
|
|
93
|
-
const num = parseFloat(val);
|
|
94
|
-
if (!Number.isNaN(num)) {
|
|
95
|
-
slot.set(num);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
(_a = slot.reset) === null || _a === void 0 ? void 0 : _a.call(slot);
|
|
99
|
-
}
|
|
100
|
-
}, [slot, val]);
|
|
101
|
-
return (React.createElement(MyTextField, { label: slot.name, helperText: slot.description, value: val, type: "number", onChange: evt => setVal(evt.target.value) }));
|
|
102
|
-
});
|
|
103
26
|
const IntegerEditor = observer(({ slot, }) => {
|
|
104
27
|
const [val, setVal] = useState(slot.value);
|
|
105
28
|
useEffect(() => {
|
|
@@ -108,19 +31,14 @@ const IntegerEditor = observer(({ slot, }) => {
|
|
|
108
31
|
slot.set(num);
|
|
109
32
|
}
|
|
110
33
|
}, [slot, val]);
|
|
111
|
-
return (React.createElement(
|
|
34
|
+
return (React.createElement(ConfigurationTextField, { label: slot.name, helperText: slot.description, value: val, type: "number", onChange: evt => setVal(evt.target.value) }));
|
|
112
35
|
});
|
|
113
|
-
const
|
|
114
|
-
React.createElement(FormControlLabel, { label: slot.name, control: React.createElement(Checkbox, { checked: slot.value, onChange: evt => slot.set(evt.target.checked) }) }),
|
|
115
|
-
React.createElement(FormHelperText, null, slot.description))));
|
|
116
|
-
const StringEnumEditor = observer(
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
|
-
({ slot, slotSchema }) => {
|
|
36
|
+
const StringEnumEditor = observer(function ({ slot, slotSchema, }) {
|
|
119
37
|
const p = getPropertyMembers(getSubType(slotSchema));
|
|
120
38
|
const choices = getUnionSubTypes(getUnionSubTypes(getSubType(getPropertyType(p, 'value')))[1]).map(t => t.value);
|
|
121
|
-
return (React.createElement(
|
|
39
|
+
return (React.createElement(ConfigurationTextField, { value: slot.value, label: slot.name, select: true, helperText: slot.description, onChange: evt => slot.set(evt.target.value) }, choices.map(str => (React.createElement(MenuItem, { key: str, value: str }, str)))));
|
|
122
40
|
});
|
|
123
|
-
const FileSelectorWrapper = observer(({ slot, })
|
|
41
|
+
const FileSelectorWrapper = observer(function ({ slot, }) {
|
|
124
42
|
var _a;
|
|
125
43
|
return (React.createElement(FileSelector, { location: slot.value, setLocation: location => slot.set(location), name: slot.name, description: slot.description, rootModel: (_a = getEnv(slot).pluginManager) === null || _a === void 0 ? void 0 : _a.rootModel }));
|
|
126
44
|
});
|
|
@@ -177,7 +95,7 @@ const SlotEditor = observer(
|
|
|
177
95
|
React.createElement(ValueComponent, { slot: slot, slotSchema: slotSchema })),
|
|
178
96
|
React.createElement("div", { className: classes.slotModeSwitch }, slot.contextVariable.length ? (React.createElement(IconButton, { onClick: () => slot.isCallback
|
|
179
97
|
? slot.convertToValue()
|
|
180
|
-
: slot.convertToCallback(), title: `convert to ${slot.isCallback ? 'regular value' : 'callback'}
|
|
98
|
+
: slot.convertToCallback(), title: `convert to ${slot.isCallback ? 'regular value' : 'callback'}` }, !slot.isCallback ? (React.createElement(RadioButtonUncheckedIcon, null)) : (React.createElement(SvgCheckbox, null)))) : null)));
|
|
181
99
|
});
|
|
182
100
|
export default SlotEditor;
|
|
183
101
|
//# sourceMappingURL=SlotEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlotEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/SlotEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,kBAAkB,EAAY,MAAM,iBA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;QAClC,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,aAAa;YACb,eAAe,CAAC,IAAI,CAAC,CAAA;IACzB,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,CAAC,IAAI,CAAC,8BAA8B,IAAI,qBAAqB,CAAC,CAAA;QACrE,cAAc,GAAG,YAAY,CAAA;KAC9B;IACD,IAAI,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,EAAE;QAC9B,OAAO,CAAC,IAAI,CAAC,iCAAiC,IAAI,EAAE,CAAC,CAAA;KACtD;IACD,OAAO,CACL,oBAAC,KAAK,IAAC,SAAS,EAAE,OAAO,CAAC,KAAK;QAC7B,6BAAK,SAAS,EAAE,OAAO,CAAC,YAAY;YAClC,oBAAC,cAAc,IAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,GAAI,CAClD;QACN,6BAAK,SAAS,EAAE,OAAO,CAAC,cAAc,IACnC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAC7B,oBAAC,UAAU,IACT,OAAO,EAAE,GAAG,EAAE,CACZ,IAAI,CAAC,UAAU;gBACb,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE;gBACvB,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAE9B,KAAK,EAAE,cACL,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,UACtC,EAAE,IAED,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAClB,oBAAC,wBAAwB,OAAG,CAC7B,CAAC,CAAC,CAAC,CACF,oBAAC,WAAW,OAAG,CAChB,CACU,CACd,CAAC,CAAC,CAAC,IAAI,CACJ,CACA,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -12,7 +12,7 @@ const StringArrayEditor = observer(({ slot, }) => {
|
|
|
12
12
|
slot.value.map((val, idx) => (React.createElement(ListItem, { key: idx, disableGutters: true },
|
|
13
13
|
React.createElement(TextField, { value: val, onChange: evt => slot.setAtIndex(idx, evt.target.value), InputProps: {
|
|
14
14
|
endAdornment: (React.createElement(InputAdornment, { position: "end" },
|
|
15
|
-
React.createElement(IconButton, {
|
|
15
|
+
React.createElement(IconButton, { onClick: () => slot.removeAtIndex(idx) },
|
|
16
16
|
React.createElement(DeleteIcon, null)))),
|
|
17
17
|
} })))),
|
|
18
18
|
addNew ? (React.createElement(ListItem, { disableGutters: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringArrayEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/StringArrayEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EACL,MAAM,EACN,cAAc,EACd,UAAU,EACV,cAAc,EACd,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,QAAQ;AACR,OAAO,UAAU,MAAM,4BAA4B,CAAA;AAEnD,MAAM,iBAAiB,GAAG,QAAQ,CAChC,CAAC,EACC,IAAI,GAUL,EAAE,EAAE;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IACtC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC3C,OAAO,CACL;QACG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,UAAU,QAAE,IAAI,CAAC,IAAI,CAAc,CAAC,CAAC,CAAC,IAAI;QACxD,oBAAC,IAAI,IAAC,cAAc;YACjB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5B,oBAAC,QAAQ,IAAC,GAAG,EAAE,GAAG,EAAE,cAAc;gBAChC,oBAAC,SAAS,IACR,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EACvD,UAAU,EAAE;wBACV,YAAY,EAAE,CACZ,oBAAC,cAAc,IAAC,QAAQ,EAAC,KAAK;4BAC5B,oBAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"StringArrayEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/StringArrayEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EACL,MAAM,EACN,cAAc,EACd,UAAU,EACV,cAAc,EACd,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,QAAQ;AACR,OAAO,UAAU,MAAM,4BAA4B,CAAA;AAEnD,MAAM,iBAAiB,GAAG,QAAQ,CAChC,CAAC,EACC,IAAI,GAUL,EAAE,EAAE;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IACtC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC3C,OAAO,CACL;QACG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,UAAU,QAAE,IAAI,CAAC,IAAI,CAAc,CAAC,CAAC,CAAC,IAAI;QACxD,oBAAC,IAAI,IAAC,cAAc;YACjB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5B,oBAAC,QAAQ,IAAC,GAAG,EAAE,GAAG,EAAE,cAAc;gBAChC,oBAAC,SAAS,IACR,KAAK,EAA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,aAGM,CACR,CACY,CAClB;qBACF,GACD,CACO,CACZ,CAAC,CAAC,CAAC,IAAI;YACR,oBAAC,MAAM,IACL,KAAK,EAAC,SAAS,EACf,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,eAGvB,CACJ;QACP,oBAAC,cAAc,QAAE,IAAI,CAAC,WAAW,CAAkB,CAClD,CACJ,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: ({ slot, }: {
|
|
3
|
+
slot: {
|
|
4
|
+
name: string;
|
|
5
|
+
value: Map<string, string[]>;
|
|
6
|
+
remove: (key: string) => void;
|
|
7
|
+
add: (key: string, val: string[]) => void;
|
|
8
|
+
description: string;
|
|
9
|
+
setAtKeyIndex: (key: string, idx: number, val: string) => void;
|
|
10
|
+
removeAtKeyIndex: (key: string, idx: number) => void;
|
|
11
|
+
addToKey: (key: string, val: string) => void;
|
|
12
|
+
};
|
|
13
|
+
}) => JSX.Element;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import { Card, CardContent, CardHeader, FormHelperText, IconButton, InputAdornment, InputLabel, TextField, } from '@mui/material';
|
|
4
|
+
import { makeStyles } from 'tss-react/mui';
|
|
5
|
+
// icons
|
|
6
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
7
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
8
|
+
// locals
|
|
9
|
+
import StringArrayEditor from './StringArrayEditor';
|
|
10
|
+
const useStyles = makeStyles()(theme => ({
|
|
11
|
+
card: {
|
|
12
|
+
marginTop: theme.spacing(1),
|
|
13
|
+
},
|
|
14
|
+
}));
|
|
15
|
+
export default observer(function ({ slot, }) {
|
|
16
|
+
const { classes } = useStyles();
|
|
17
|
+
const [value, setValue] = useState('');
|
|
18
|
+
return (React.createElement(React.Fragment, null,
|
|
19
|
+
React.createElement(InputLabel, null, slot.name),
|
|
20
|
+
Array.from(slot.value, ([key, val]) => (React.createElement(Card, { raised: true, key: key, className: classes.card },
|
|
21
|
+
React.createElement(CardHeader, { title: key, action: React.createElement(IconButton, { onClick: () => slot.remove(key) },
|
|
22
|
+
React.createElement(DeleteIcon, null)) }),
|
|
23
|
+
React.createElement(CardContent, null,
|
|
24
|
+
React.createElement(StringArrayEditor, { slot: {
|
|
25
|
+
name: slot.name,
|
|
26
|
+
value: val,
|
|
27
|
+
description: `Values associated with entry ${key}`,
|
|
28
|
+
setAtIndex: (idx, val) => slot.setAtKeyIndex(key, idx, val),
|
|
29
|
+
removeAtIndex: (idx) => slot.removeAtKeyIndex(key, idx),
|
|
30
|
+
add: (val) => slot.addToKey(key, val),
|
|
31
|
+
} }))))),
|
|
32
|
+
React.createElement(Card, { raised: true, className: classes.card },
|
|
33
|
+
React.createElement(CardHeader, { disableTypography: true, title: React.createElement(TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => setValue(event.target.value), InputProps: {
|
|
34
|
+
endAdornment: (React.createElement(InputAdornment, { position: "end" },
|
|
35
|
+
React.createElement(IconButton, { disabled: value === '', onClick: () => {
|
|
36
|
+
slot.add(value, []);
|
|
37
|
+
setValue('');
|
|
38
|
+
} },
|
|
39
|
+
React.createElement(AddIcon, null)))),
|
|
40
|
+
} }) })),
|
|
41
|
+
React.createElement(FormHelperText, null, slot.description)));
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=StringArrayMapEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringArrayMapEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/StringArrayMapEditor.tsx"],"names":[],"mappings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|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { BaseAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
2
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
|
-
import { readConfObject } from '@jbrowse/core/configuration';
|
|
4
3
|
export default class RefNameAliasAdapter extends BaseAdapter {
|
|
5
4
|
async getRefNameAliases() {
|
|
6
|
-
const loc =
|
|
5
|
+
const loc = this.getConf('location');
|
|
7
6
|
if (loc.uri === '' || loc.uri === '/path/to/my/aliases.txt') {
|
|
8
7
|
return [];
|
|
9
8
|
}
|
|
10
|
-
const results = await openLocation(loc).readFile('utf8');
|
|
11
|
-
const refColumn =
|
|
9
|
+
const results = await openLocation(loc, this.pluginManager).readFile('utf8');
|
|
10
|
+
const refColumn = this.getConf('refNameColumn');
|
|
12
11
|
return results
|
|
13
12
|
.trim()
|
|
14
13
|
.split(/\n|\r\n|\r/)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefNameAliasAdapter.js","sourceRoot":"","sources":["../../src/RefNameAliasAdapter/RefNameAliasAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,GACZ,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"RefNameAliasAdapter.js","sourceRoot":"","sources":["../../src/RefNameAliasAdapter/RefNameAliasAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,GACZ,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,mBACnB,SAAQ,WAAW;IAGnB,KAAK,CAAC,iBAAiB;QACrB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QACpC,IAAI,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,GAAG,KAAK,yBAAyB,EAAE;YAC3D,OAAO,EAAE,CAAA;SACV;QACD,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAC5E,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;QAC/C,OAAO,OAAO;aACX,IAAI,EAAE;aACN,KAAK,CAAC,YAAY,CAAC;aACnB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aACtC,GAAG,CAAC,GAAG,CAAC,EAAE;YACT,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAC/B,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;YAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAA;QAC9D,CAAC,CAAC,CAAA;IACN,CAAC;IAED,KAAK,CAAC,aAAa,KAAI,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "JBrowse 2 config utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"distModule": "esm/index.js",
|
|
58
58
|
"srcModule": "src/index.ts",
|
|
59
59
|
"module": "esm/index.js",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "78707a2bc3ba8489f26a590ef83f62ede945d048"
|
|
61
61
|
}
|