@jbrowse/plugin-config 1.6.5 → 1.6.8
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/index.d.ts +1 -1
- package/dist/FromConfigAdapter/FromConfigAdapter.d.ts +1 -1
- package/dist/FromConfigAdapter/FromConfigRegionsAdapter.d.ts +2 -2
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.d.ts +2 -2
- package/dist/FromConfigAdapter/configSchema.d.ts +3 -3
- package/dist/RefNameAliasAdapter/configSchema.d.ts +1 -1
- package/dist/plugin-config.cjs.development.js +79 -43
- package/dist/plugin-config.cjs.development.js.map +1 -1
- package/dist/plugin-config.cjs.production.min.js +1 -1
- package/dist/plugin-config.cjs.production.min.js.map +1 -1
- package/dist/plugin-config.esm.js +80 -44
- package/dist/plugin-config.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/ConfigurationEditorWidget/components/CallbackEditor.js +8 -4
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.js +79 -38
- package/src/ConfigurationEditorWidget/components/SlotEditor.js +1 -4
- package/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.js.snap +1584 -1345
- package/src/RefNameAliasAdapter/RefNameAliasAdapter.ts +3 -1
- package/src/RefNameAliasAdapter/configSchema.ts +4 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as stateModelFactory } from "./model";
|
|
2
|
-
export const configSchema: import("@jbrowse/core/configuration
|
|
2
|
+
export const configSchema: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
3
3
|
export const HeadingComponent: import("mobx-react/dist/types/IReactComponent").IReactComponent<any>;
|
|
@@ -16,7 +16,7 @@ export default class FromConfigAdapter extends BaseFeatureDataAdapter {
|
|
|
16
16
|
static makeFeature(data: SimpleFeatureSerialized): SimpleFeature;
|
|
17
17
|
getRefNames(): Promise<string[]>;
|
|
18
18
|
getRefNameAliases(): Promise<{
|
|
19
|
-
refName:
|
|
19
|
+
refName: string;
|
|
20
20
|
aliases: any;
|
|
21
21
|
}[]>;
|
|
22
22
|
getFeatures(region: NoAssemblyRegion): import("rxjs").Observable<Feature>;
|
|
@@ -13,8 +13,8 @@ export default class FromConfigSequenceAdapter extends FromConfigAdapter {
|
|
|
13
13
|
*/
|
|
14
14
|
getRegions(): Promise<{
|
|
15
15
|
refName: string;
|
|
16
|
-
start:
|
|
17
|
-
end:
|
|
16
|
+
start: number;
|
|
17
|
+
end: number;
|
|
18
18
|
}[]>;
|
|
19
19
|
/**
|
|
20
20
|
* called to provide a hint that data tied to a certain region
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const configSchema: import("@jbrowse/core/configuration
|
|
2
|
-
export declare const regionsConfigSchema: import("@jbrowse/core/configuration
|
|
3
|
-
export declare const sequenceConfigSchema: import("@jbrowse/core/configuration
|
|
1
|
+
export declare const configSchema: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
2
|
+
export declare const regionsConfigSchema: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
3
|
+
export declare const sequenceConfigSchema: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@jbrowse/core/configuration
|
|
1
|
+
declare const _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
2
2
|
export default _default;
|
|
@@ -25,10 +25,8 @@ var reactSyntaxHighlighter = require('react-syntax-highlighter');
|
|
|
25
25
|
var json = _interopDefault(require('react-syntax-highlighter/dist/cjs/languages/hljs/json'));
|
|
26
26
|
var a11yDark = _interopDefault(require('react-syntax-highlighter/dist/cjs/styles/hljs/a11y-dark'));
|
|
27
27
|
var a11yLight = _interopDefault(require('react-syntax-highlighter/dist/cjs/styles/hljs/a11y-light'));
|
|
28
|
-
var FormGroup = _interopDefault(require('@material-ui/core/FormGroup'));
|
|
29
|
-
var FormLabel = _interopDefault(require('@material-ui/core/FormLabel'));
|
|
30
|
-
var styles = require('@material-ui/core/styles');
|
|
31
28
|
var pluralize = require('pluralize');
|
|
29
|
+
var ExpandMoreIcon = _interopDefault(require('@material-ui/icons/ExpandMore'));
|
|
32
30
|
var ui = require('@jbrowse/core/ui');
|
|
33
31
|
var mstReflection = require('@jbrowse/core/util/mst-reflection');
|
|
34
32
|
var DeleteIcon = _interopDefault(require('@material-ui/icons/Delete'));
|
|
@@ -40,6 +38,7 @@ var ReactPropTypes = _interopDefault(require('prop-types'));
|
|
|
40
38
|
var TextField = _interopDefault(require('@material-ui/core/TextField'));
|
|
41
39
|
var MenuItem = _interopDefault(require('@material-ui/core/MenuItem'));
|
|
42
40
|
var Paper = _interopDefault(require('@material-ui/core/Paper'));
|
|
41
|
+
var styles = require('@material-ui/core/styles');
|
|
43
42
|
var reactColor = require('react-color');
|
|
44
43
|
|
|
45
44
|
function ownKeys(object, enumerableOnly) {
|
|
@@ -280,10 +279,6 @@ function _slicedToArray(arr, i) {
|
|
|
280
279
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
281
280
|
}
|
|
282
281
|
|
|
283
|
-
function _toArray(arr) {
|
|
284
|
-
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
285
|
-
}
|
|
286
|
-
|
|
287
282
|
function _toConsumableArray(arr) {
|
|
288
283
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
289
284
|
}
|
|
@@ -1664,7 +1659,7 @@ var RefNameAliasAdapter = /*#__PURE__*/function (_BaseAdapter) {
|
|
|
1664
1659
|
key: "getRefNameAliases",
|
|
1665
1660
|
value: function () {
|
|
1666
1661
|
var _getRefNameAliases = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
1667
|
-
var loc, results;
|
|
1662
|
+
var loc, results, refColumn;
|
|
1668
1663
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1669
1664
|
while (1) {
|
|
1670
1665
|
switch (_context.prev = _context.next) {
|
|
@@ -1684,13 +1679,15 @@ var RefNameAliasAdapter = /*#__PURE__*/function (_BaseAdapter) {
|
|
|
1684
1679
|
|
|
1685
1680
|
case 5:
|
|
1686
1681
|
results = _context.sent;
|
|
1682
|
+
refColumn = configuration.readConfObject(this.config, 'refNameColumn');
|
|
1687
1683
|
return _context.abrupt("return", results.trim().split('\n').filter(function (f) {
|
|
1688
1684
|
return !!f && !f.startsWith('#');
|
|
1689
1685
|
}).map(function (row) {
|
|
1690
|
-
var
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1686
|
+
var aliases = row.split('\t');
|
|
1687
|
+
|
|
1688
|
+
var _aliases$splice = aliases.splice(refColumn, 1),
|
|
1689
|
+
_aliases$splice2 = _slicedToArray(_aliases$splice, 1),
|
|
1690
|
+
refName = _aliases$splice2[0];
|
|
1694
1691
|
|
|
1695
1692
|
return {
|
|
1696
1693
|
refName: refName,
|
|
@@ -1698,7 +1695,7 @@ var RefNameAliasAdapter = /*#__PURE__*/function (_BaseAdapter) {
|
|
|
1698
1695
|
};
|
|
1699
1696
|
}));
|
|
1700
1697
|
|
|
1701
|
-
case
|
|
1698
|
+
case 8:
|
|
1702
1699
|
case "end":
|
|
1703
1700
|
return _context.stop();
|
|
1704
1701
|
}
|
|
@@ -1745,6 +1742,10 @@ var refNameAliasAdapterConfigSchema = /*#__PURE__*/configuration.ConfigurationSc
|
|
|
1745
1742
|
uri: '/path/to/my/aliases.txt',
|
|
1746
1743
|
locationType: 'UriLocation'
|
|
1747
1744
|
}
|
|
1745
|
+
},
|
|
1746
|
+
refNameColumn: {
|
|
1747
|
+
type: 'number',
|
|
1748
|
+
defaultValue: 0
|
|
1748
1749
|
}
|
|
1749
1750
|
}, {
|
|
1750
1751
|
explicitlyTyped: true
|
|
@@ -1982,10 +1983,12 @@ function CallbackEditor(_ref) {
|
|
|
1982
1983
|
|
|
1983
1984
|
var jexlDebouncedCode = debouncedCode.startsWith('jexl:') ? debouncedCode : "jexl:".concat(debouncedCode);
|
|
1984
1985
|
jexlStrings.stringToJexlExpression(jexlDebouncedCode, (_getEnv$pluginManager = mobxStateTree.getEnv(slot).pluginManager) === null || _getEnv$pluginManager === void 0 ? void 0 : _getEnv$pluginManager.jexl);
|
|
1985
|
-
slot.set(jexlDebouncedCode);
|
|
1986
|
-
|
|
1986
|
+
slot.set(jexlDebouncedCode);
|
|
1987
1987
|
setCodeError(null);
|
|
1988
1988
|
} catch (e) {
|
|
1989
|
+
console.error({
|
|
1990
|
+
e: e
|
|
1991
|
+
});
|
|
1989
1992
|
setCodeError(e);
|
|
1990
1993
|
}
|
|
1991
1994
|
}, [debouncedCode, slot]); // if default value is a callback, will have to remove jexl:
|
|
@@ -1998,7 +2001,7 @@ function CallbackEditor(_ref) {
|
|
|
1998
2001
|
className: classes.callbackEditor,
|
|
1999
2002
|
value: code.startsWith('jexl:') ? code.split('jexl:')[1] : code,
|
|
2000
2003
|
onValueChange: function onValueChange(newCode) {
|
|
2001
|
-
setCode(newCode);
|
|
2004
|
+
return setCode(newCode);
|
|
2002
2005
|
},
|
|
2003
2006
|
highlight: function highlight(newCode) {
|
|
2004
2007
|
return newCode;
|
|
@@ -2007,7 +2010,11 @@ function CallbackEditor(_ref) {
|
|
|
2007
2010
|
style: {
|
|
2008
2011
|
background: error ? '#fdd' : undefined
|
|
2009
2012
|
}
|
|
2010
|
-
}),
|
|
2013
|
+
}), error ? /*#__PURE__*/React__default.createElement(core.FormHelperText, {
|
|
2014
|
+
style: {
|
|
2015
|
+
color: '#f00'
|
|
2016
|
+
}
|
|
2017
|
+
}, "".concat(error)) : null, /*#__PURE__*/React__default.createElement(core.FormHelperText, null, slot.description)), /*#__PURE__*/React__default.createElement(core.Tooltip, {
|
|
2011
2018
|
title: /*#__PURE__*/React__default.createElement("div", null, "Callbacks are written in Jexl format. Click to learn more.", /*#__PURE__*/React__default.createElement("br", null), " Names of available context items: ", slot.contextVariable),
|
|
2012
2019
|
arrow: true
|
|
2013
2020
|
}, /*#__PURE__*/React__default.createElement(core.IconButton, {
|
|
@@ -2462,13 +2469,10 @@ var useSlotEditorStyles = /*#__PURE__*/core.makeStyles(function (theme) {
|
|
|
2462
2469
|
paper: {
|
|
2463
2470
|
display: 'flex',
|
|
2464
2471
|
marginBottom: theme.spacing(2),
|
|
2465
|
-
position: 'relative'
|
|
2466
|
-
overflow: 'visible'
|
|
2472
|
+
position: 'relative'
|
|
2467
2473
|
},
|
|
2468
2474
|
paperContent: {
|
|
2469
|
-
|
|
2470
|
-
padding: theme.spacing(1),
|
|
2471
|
-
overflow: 'auto'
|
|
2475
|
+
width: '100%'
|
|
2472
2476
|
},
|
|
2473
2477
|
slotModeSwitch: {
|
|
2474
2478
|
width: 24,
|
|
@@ -2540,18 +2544,20 @@ var TypeSelector = /*#__PURE__*/mobxReact.observer(function (_ref) {
|
|
|
2540
2544
|
}))));
|
|
2541
2545
|
});
|
|
2542
2546
|
|
|
2543
|
-
var useStyles$3 = /*#__PURE__*/
|
|
2547
|
+
var useStyles$3 = /*#__PURE__*/core.makeStyles(function (theme) {
|
|
2544
2548
|
return {
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
borderLeft: "1px solid ".concat(theme.palette.secondary.main),
|
|
2548
|
-
paddingLeft: theme.spacing(1),
|
|
2549
|
-
marginBottom: theme.spacing(1)
|
|
2549
|
+
expandIcon: {
|
|
2550
|
+
color: '#fff'
|
|
2550
2551
|
},
|
|
2551
2552
|
root: {
|
|
2552
|
-
padding: theme.spacing(1, 3, 1, 1)
|
|
2553
|
-
|
|
2554
|
-
|
|
2553
|
+
padding: theme.spacing(1, 3, 1, 1)
|
|
2554
|
+
},
|
|
2555
|
+
expansionPanelDetails: {
|
|
2556
|
+
display: 'block',
|
|
2557
|
+
padding: theme.spacing(1)
|
|
2558
|
+
},
|
|
2559
|
+
accordion: {
|
|
2560
|
+
border: "1px solid ".concat(theme.palette.text.primary)
|
|
2555
2561
|
}
|
|
2556
2562
|
};
|
|
2557
2563
|
});
|
|
@@ -2561,19 +2567,21 @@ var Member = /*#__PURE__*/mobxReact.observer(function (props) {
|
|
|
2561
2567
|
slotSchema = props.slotSchema,
|
|
2562
2568
|
schema = props.schema,
|
|
2563
2569
|
_props$slot = props.slot,
|
|
2564
|
-
slot = _props$slot === void 0 ? schema[slotName] : _props$slot
|
|
2570
|
+
slot = _props$slot === void 0 ? schema[slotName] : _props$slot,
|
|
2571
|
+
_props$path = props.path,
|
|
2572
|
+
path = _props$path === void 0 ? [] : _props$path;
|
|
2565
2573
|
var typeSelector;
|
|
2566
2574
|
|
|
2567
2575
|
if (configuration.isConfigurationSchemaType(slotSchema)) {
|
|
2568
2576
|
if (slot.length) {
|
|
2569
|
-
return
|
|
2577
|
+
return slot.map(function (subslot, slotIndex) {
|
|
2570
2578
|
var key = "".concat(pluralize.singular(slotName), " ").concat(slotIndex + 1);
|
|
2571
2579
|
return /*#__PURE__*/React__default.createElement(Member, _extends({}, props, {
|
|
2572
2580
|
key: key,
|
|
2573
2581
|
slot: subslot,
|
|
2574
2582
|
slotName: key
|
|
2575
2583
|
}));
|
|
2576
|
-
})
|
|
2584
|
+
});
|
|
2577
2585
|
} // if this is an explicitly typed schema, make a type-selecting dropdown
|
|
2578
2586
|
// that can be used to change its type
|
|
2579
2587
|
|
|
@@ -2595,10 +2603,22 @@ var Member = /*#__PURE__*/mobxReact.observer(function (props) {
|
|
|
2595
2603
|
});
|
|
2596
2604
|
}
|
|
2597
2605
|
|
|
2598
|
-
return /*#__PURE__*/React__default.createElement(
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2606
|
+
return /*#__PURE__*/React__default.createElement(core.Accordion, {
|
|
2607
|
+
defaultExpanded: true,
|
|
2608
|
+
className: classes.accordion,
|
|
2609
|
+
TransitionProps: {
|
|
2610
|
+
unmountOnExit: true,
|
|
2611
|
+
timeout: 150
|
|
2612
|
+
}
|
|
2613
|
+
}, /*#__PURE__*/React__default.createElement(core.AccordionSummary, {
|
|
2614
|
+
expandIcon: /*#__PURE__*/React__default.createElement(ExpandMoreIcon, {
|
|
2615
|
+
className: classes.expandIcon
|
|
2616
|
+
})
|
|
2617
|
+
}, /*#__PURE__*/React__default.createElement(core.Typography, null, [].concat(_toConsumableArray(path), [slotName]).join('🡒'))), /*#__PURE__*/React__default.createElement(core.AccordionDetails, {
|
|
2618
|
+
className: classes.expansionPanelDetails
|
|
2619
|
+
}, typeSelector, /*#__PURE__*/React__default.createElement(core.FormGroup, null, /*#__PURE__*/React__default.createElement(Schema, {
|
|
2620
|
+
schema: slot,
|
|
2621
|
+
path: [].concat(_toConsumableArray(path), [slotName])
|
|
2602
2622
|
}))));
|
|
2603
2623
|
}
|
|
2604
2624
|
|
|
@@ -2614,8 +2634,11 @@ var Member = /*#__PURE__*/mobxReact.observer(function (props) {
|
|
|
2614
2634
|
return null;
|
|
2615
2635
|
});
|
|
2616
2636
|
var Schema = /*#__PURE__*/mobxReact.observer(function (_ref) {
|
|
2617
|
-
var schema = _ref.schema
|
|
2618
|
-
|
|
2637
|
+
var schema = _ref.schema,
|
|
2638
|
+
_ref$path = _ref.path,
|
|
2639
|
+
path = _ref$path === void 0 ? [] : _ref$path;
|
|
2640
|
+
var properties = mobxStateTree.getMembers(schema).properties;
|
|
2641
|
+
return Object.entries(properties).map(function (_ref2) {
|
|
2619
2642
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
2620
2643
|
slotName = _ref3[0],
|
|
2621
2644
|
slotSchema = _ref3[1];
|
|
@@ -2624,6 +2647,7 @@ var Schema = /*#__PURE__*/mobxReact.observer(function (_ref) {
|
|
|
2624
2647
|
key: slotName,
|
|
2625
2648
|
slotName: slotName,
|
|
2626
2649
|
slotSchema: slotSchema,
|
|
2650
|
+
path: path,
|
|
2627
2651
|
schema: schema
|
|
2628
2652
|
});
|
|
2629
2653
|
});
|
|
@@ -2635,13 +2659,25 @@ var ConfigurationEditor = /*#__PURE__*/mobxReact.observer(function (_ref4) {
|
|
|
2635
2659
|
// see pr #804
|
|
2636
2660
|
|
|
2637
2661
|
var key = model.target && configuration.readConfObject(model.target, 'trackId');
|
|
2638
|
-
|
|
2639
|
-
|
|
2662
|
+
var name = model.target && configuration.readConfObject(model.target, 'name');
|
|
2663
|
+
return /*#__PURE__*/React__default.createElement(core.Accordion, {
|
|
2640
2664
|
key: key,
|
|
2665
|
+
defaultExpanded: true,
|
|
2666
|
+
className: classes.accordion,
|
|
2667
|
+
TransitionProps: {
|
|
2668
|
+
unmountOnExit: true,
|
|
2669
|
+
timeout: 150
|
|
2670
|
+
}
|
|
2671
|
+
}, /*#__PURE__*/React__default.createElement(core.AccordionSummary, {
|
|
2672
|
+
expandIcon: /*#__PURE__*/React__default.createElement(ExpandMoreIcon, {
|
|
2673
|
+
className: classes.expandIcon
|
|
2674
|
+
})
|
|
2675
|
+
}, /*#__PURE__*/React__default.createElement(core.Typography, null, name ? name : 'Configuration')), /*#__PURE__*/React__default.createElement(core.AccordionDetails, {
|
|
2676
|
+
className: classes.expansionPanelDetails,
|
|
2641
2677
|
"data-testid": "configEditor"
|
|
2642
2678
|
}, !model.target ? 'no target set' : /*#__PURE__*/React__default.createElement(Schema, {
|
|
2643
2679
|
schema: model.target
|
|
2644
|
-
}));
|
|
2680
|
+
})));
|
|
2645
2681
|
});
|
|
2646
2682
|
|
|
2647
2683
|
var ConfigurationEditor$1 = {
|