@jbrowse/plugin-config 1.4.0 → 1.5.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/CodeEditor.d.ts +4 -0
- package/dist/ConfigurationEditorWidget/components/ColorEditor.d.ts +0 -11
- package/dist/ConfigurationEditorWidget/components/ColorPicker.d.ts +14 -0
- package/dist/FromConfigAdapter/FromConfigAdapter.d.ts +3 -1
- package/dist/FromConfigAdapter/FromConfigRegionsAdapter.d.ts +3 -1
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.d.ts +1 -1
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +3 -1
- package/dist/plugin-config.cjs.development.js +180 -147
- 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 +190 -157
- package/dist/plugin-config.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/ConfigurationEditorWidget/components/CodeEditor.js +59 -0
- package/src/ConfigurationEditorWidget/components/ColorEditor.tsx +12 -54
- package/src/ConfigurationEditorWidget/components/ColorPicker.tsx +52 -0
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.test.js +3 -4
- package/src/ConfigurationEditorWidget/components/JsonEditor.js +12 -51
- package/src/ConfigurationEditorWidget/components/SlotEditor.js +7 -3
- package/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.js.snap +40 -23
- package/src/FromConfigAdapter/FromConfigAdapter.ts +8 -2
- package/src/FromConfigAdapter/FromConfigRegionsAdapter.ts +7 -2
- package/src/FromConfigAdapter/FromConfigSequenceAdapter.test.ts +2 -5
- package/src/FromConfigAdapter/FromConfigSequenceAdapter.ts +1 -4
- package/src/RefNameAliasAdapter/RefNameAliasAdapter.test.ts +4 -1
- package/src/RefNameAliasAdapter/RefNameAliasAdapter.ts +14 -4
- package/src/RefNameAliasAdapter/configSchema.ts +4 -1
|
@@ -12,10 +12,7 @@ import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
|
12
12
|
import { toArray } from 'rxjs/operators';
|
|
13
13
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
14
14
|
import { useDebounce, iterMap } from '@jbrowse/core/util';
|
|
15
|
-
import FormControl from '@material-ui/core
|
|
16
|
-
import FormHelperText from '@material-ui/core/FormHelperText';
|
|
17
|
-
import InputLabel from '@material-ui/core/InputLabel';
|
|
18
|
-
import { useTheme, makeStyles } from '@material-ui/core/styles';
|
|
15
|
+
import { FormControl, InputLabel, FormHelperText, makeStyles, useTheme, Paper, IconButton as IconButton$1, TextField as TextField$1, SvgIcon, List, ListItem, InputAdornment, Card, CardHeader, CardContent, FormControlLabel, Checkbox, MenuItem } from '@material-ui/core';
|
|
19
16
|
import Editor from 'react-simple-code-editor';
|
|
20
17
|
import { Light } from 'react-syntax-highlighter';
|
|
21
18
|
import json from 'react-syntax-highlighter/dist/cjs/languages/hljs/json';
|
|
@@ -23,22 +20,25 @@ import a11yDark from 'react-syntax-highlighter/dist/cjs/styles/hljs/a11y-dark';
|
|
|
23
20
|
import a11yLight from 'react-syntax-highlighter/dist/cjs/styles/hljs/a11y-light';
|
|
24
21
|
import FormGroup from '@material-ui/core/FormGroup';
|
|
25
22
|
import FormLabel from '@material-ui/core/FormLabel';
|
|
23
|
+
import { makeStyles as makeStyles$1 } from '@material-ui/core/styles';
|
|
26
24
|
import { singular } from 'pluralize';
|
|
27
25
|
import { FileSelector } from '@jbrowse/core/ui';
|
|
28
26
|
import { getSubType, getUnionSubTypes, getPropertyType } from '@jbrowse/core/util/mst-reflection';
|
|
29
|
-
import { Paper, IconButton as IconButton$1, TextField as TextField$1, SvgIcon, makeStyles as makeStyles$1, InputLabel as InputLabel$1, List, ListItem, InputAdornment, FormHelperText as FormHelperText$1, Card, CardHeader, CardContent, FormControl as FormControl$1, FormControlLabel, Checkbox, MenuItem } from '@material-ui/core';
|
|
30
27
|
import DeleteIcon from '@material-ui/icons/Delete';
|
|
31
28
|
import AddIcon from '@material-ui/icons/Add';
|
|
32
29
|
import RadioButtonUncheckedIcon from '@material-ui/icons/RadioButtonUnchecked';
|
|
33
30
|
import { stringToJexlExpression } from '@jbrowse/core/util/jexlStrings';
|
|
31
|
+
import FormControl$1 from '@material-ui/core/FormControl';
|
|
32
|
+
import FormHelperText$1 from '@material-ui/core/FormHelperText';
|
|
33
|
+
import InputLabel$1 from '@material-ui/core/InputLabel';
|
|
34
34
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
35
35
|
import IconButton from '@material-ui/core/IconButton';
|
|
36
36
|
import HelpIcon from '@material-ui/icons/Help';
|
|
37
37
|
import ReactPropTypes from 'prop-types';
|
|
38
38
|
import TextField from '@material-ui/core/TextField';
|
|
39
|
-
import { ChromePicker } from 'react-color';
|
|
40
39
|
import MenuItem$1 from '@material-ui/core/MenuItem';
|
|
41
40
|
import Paper$1 from '@material-ui/core/Paper';
|
|
41
|
+
import { ChromePicker } from 'react-color';
|
|
42
42
|
|
|
43
43
|
function ownKeys(object, enumerableOnly) {
|
|
44
44
|
var keys = Object.keys(object);
|
|
@@ -224,6 +224,8 @@ function _assertThisInitialized(self) {
|
|
|
224
224
|
function _possibleConstructorReturn(self, call) {
|
|
225
225
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
226
226
|
return call;
|
|
227
|
+
} else if (call !== void 0) {
|
|
228
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
227
229
|
}
|
|
228
230
|
|
|
229
231
|
return _assertThisInitialized(self);
|
|
@@ -548,11 +550,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
548
550
|
|
|
549
551
|
|
|
550
552
|
var IteratorPrototype = {};
|
|
551
|
-
|
|
552
|
-
IteratorPrototype[iteratorSymbol] = function () {
|
|
553
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
553
554
|
return this;
|
|
554
|
-
};
|
|
555
|
-
|
|
555
|
+
});
|
|
556
556
|
var getProto = Object.getPrototypeOf;
|
|
557
557
|
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
558
558
|
|
|
@@ -563,8 +563,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
566
|
-
GeneratorFunction.prototype =
|
|
567
|
-
|
|
566
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
567
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
568
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
568
569
|
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
|
|
569
570
|
// Iterator interface in terms of a single ._invoke method.
|
|
570
571
|
|
|
@@ -669,11 +670,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
669
670
|
}
|
|
670
671
|
|
|
671
672
|
defineIteratorMethods(AsyncIterator.prototype);
|
|
672
|
-
|
|
673
|
-
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
673
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
674
674
|
return this;
|
|
675
|
-
};
|
|
676
|
-
|
|
675
|
+
});
|
|
677
676
|
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
|
|
678
677
|
// AsyncIterator objects; they just return a Promise for the value of
|
|
679
678
|
// the final result produced by the iterator.
|
|
@@ -850,13 +849,12 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
850
849
|
// object to not be returned from this call. This ensures that doesn't happen.
|
|
851
850
|
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
852
851
|
|
|
853
|
-
Gp
|
|
852
|
+
define(Gp, iteratorSymbol, function () {
|
|
854
853
|
return this;
|
|
855
|
-
};
|
|
856
|
-
|
|
857
|
-
Gp.toString = function () {
|
|
854
|
+
});
|
|
855
|
+
define(Gp, "toString", function () {
|
|
858
856
|
return "[object Generator]";
|
|
859
|
-
};
|
|
857
|
+
});
|
|
860
858
|
|
|
861
859
|
function pushTryEntry(locs) {
|
|
862
860
|
var entry = {
|
|
@@ -1168,14 +1166,19 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
1168
1166
|
} catch (accidentalStrictMode) {
|
|
1169
1167
|
// This module should not be running in strict mode, so the above
|
|
1170
1168
|
// assignment should always work unless something is misconfigured. Just
|
|
1171
|
-
// in case runtime.js accidentally runs in strict mode,
|
|
1169
|
+
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
1170
|
+
// we can explicitly access globalThis. In older engines we can escape
|
|
1172
1171
|
// strict mode using a global Function call. This could conceivably fail
|
|
1173
1172
|
// if a Content Security Policy forbids using Function, but in that case
|
|
1174
1173
|
// the proper solution is to fix the accidental strict mode problem. If
|
|
1175
1174
|
// you've misconfigured your bundler to force strict mode and applied a
|
|
1176
1175
|
// CSP to forbid Function, and you're not willing to fix either of those
|
|
1177
1176
|
// problems, please detail your unique predicament in a GitHub issue.
|
|
1178
|
-
|
|
1177
|
+
if (typeof globalThis === "object") {
|
|
1178
|
+
globalThis.regeneratorRuntime = runtime;
|
|
1179
|
+
} else {
|
|
1180
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
1181
|
+
}
|
|
1179
1182
|
}
|
|
1180
1183
|
});
|
|
1181
1184
|
|
|
@@ -1190,12 +1193,12 @@ var FromConfigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
1190
1193
|
|
|
1191
1194
|
var _super = /*#__PURE__*/_createSuper(FromConfigAdapter);
|
|
1192
1195
|
|
|
1193
|
-
function FromConfigAdapter(conf) {
|
|
1196
|
+
function FromConfigAdapter(conf, getSubAdapter, pluginManager) {
|
|
1194
1197
|
var _this;
|
|
1195
1198
|
|
|
1196
1199
|
_classCallCheck(this, FromConfigAdapter);
|
|
1197
1200
|
|
|
1198
|
-
_this = _super.call(this, conf);
|
|
1201
|
+
_this = _super.call(this, conf, getSubAdapter, pluginManager);
|
|
1199
1202
|
var feats = readConfObject(conf, 'features');
|
|
1200
1203
|
_this.features = FromConfigAdapter.makeFeatures(feats || []);
|
|
1201
1204
|
return _this;
|
|
@@ -1296,9 +1299,7 @@ var FromConfigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
1296
1299
|
}
|
|
1297
1300
|
}, {
|
|
1298
1301
|
key: "freeResources",
|
|
1299
|
-
value: function freeResources()
|
|
1300
|
-
/* { region } */
|
|
1301
|
-
{}
|
|
1302
|
+
value: function freeResources() {}
|
|
1302
1303
|
}], [{
|
|
1303
1304
|
key: "makeFeatures",
|
|
1304
1305
|
value: function makeFeatures(fdata) {
|
|
@@ -1359,12 +1360,12 @@ var FromConfigRegionsAdapter = /*#__PURE__*/function (_BaseAdapter) {
|
|
|
1359
1360
|
|
|
1360
1361
|
var _super = /*#__PURE__*/_createSuper(FromConfigRegionsAdapter);
|
|
1361
1362
|
|
|
1362
|
-
function FromConfigRegionsAdapter(config) {
|
|
1363
|
+
function FromConfigRegionsAdapter(config, getSubAdapter, pluginManager) {
|
|
1363
1364
|
var _this;
|
|
1364
1365
|
|
|
1365
1366
|
_classCallCheck(this, FromConfigRegionsAdapter);
|
|
1366
1367
|
|
|
1367
|
-
_this = _super.call(this, config);
|
|
1368
|
+
_this = _super.call(this, config, getSubAdapter, pluginManager);
|
|
1368
1369
|
var features = readConfObject(config, 'features');
|
|
1369
1370
|
_this.features = FromConfigAdapter.makeFeatures(features || []);
|
|
1370
1371
|
return _this;
|
|
@@ -1450,26 +1451,24 @@ var FromConfigRegionsAdapter = /*#__PURE__*/function (_BaseAdapter) {
|
|
|
1450
1451
|
}()
|
|
1451
1452
|
}, {
|
|
1452
1453
|
key: "freeResources",
|
|
1453
|
-
value: function freeResources()
|
|
1454
|
-
/* { region } */
|
|
1455
|
-
{}
|
|
1454
|
+
value: function freeResources() {}
|
|
1456
1455
|
}]);
|
|
1457
1456
|
|
|
1458
1457
|
return FromConfigRegionsAdapter;
|
|
1459
1458
|
}(BaseAdapter);
|
|
1460
1459
|
|
|
1461
|
-
var
|
|
1462
|
-
_inherits(
|
|
1460
|
+
var FromConfigSequenceAdapter = /*#__PURE__*/function (_FromConfigAdapter) {
|
|
1461
|
+
_inherits(FromConfigSequenceAdapter, _FromConfigAdapter);
|
|
1463
1462
|
|
|
1464
|
-
var _super = /*#__PURE__*/_createSuper(
|
|
1463
|
+
var _super = /*#__PURE__*/_createSuper(FromConfigSequenceAdapter);
|
|
1465
1464
|
|
|
1466
|
-
function
|
|
1467
|
-
_classCallCheck(this,
|
|
1465
|
+
function FromConfigSequenceAdapter() {
|
|
1466
|
+
_classCallCheck(this, FromConfigSequenceAdapter);
|
|
1468
1467
|
|
|
1469
1468
|
return _super.apply(this, arguments);
|
|
1470
1469
|
}
|
|
1471
1470
|
|
|
1472
|
-
_createClass(
|
|
1471
|
+
_createClass(FromConfigSequenceAdapter, [{
|
|
1473
1472
|
key: "getFeatures",
|
|
1474
1473
|
value:
|
|
1475
1474
|
/**
|
|
@@ -1484,7 +1483,7 @@ var FromSequenceConfigAdapter = /*#__PURE__*/function (_FromConfigAdapter) {
|
|
|
1484
1483
|
// xref: https://github.com/rollup/rollup/blob/master/CHANGELOG.md#bug-fixes-45
|
|
1485
1484
|
// return ObservableCreate<Feature>(async observer => {
|
|
1486
1485
|
// const feats = await super.getFeatures(region).pipe(toArray()).toPromise()
|
|
1487
|
-
var superGetFeatures = _get(_getPrototypeOf(
|
|
1486
|
+
var superGetFeatures = _get(_getPrototypeOf(FromConfigSequenceAdapter.prototype), "getFeatures", this);
|
|
1488
1487
|
|
|
1489
1488
|
return ObservableCreate( /*#__PURE__*/function () {
|
|
1490
1489
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(observer) {
|
|
@@ -1571,20 +1570,16 @@ var FromSequenceConfigAdapter = /*#__PURE__*/function (_FromConfigAdapter) {
|
|
|
1571
1570
|
if (currentRegion) {
|
|
1572
1571
|
regions.push(currentRegion);
|
|
1573
1572
|
}
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1573
|
+
}
|
|
1576
1574
|
} catch (err) {
|
|
1577
1575
|
_iterator.e(err);
|
|
1578
1576
|
} finally {
|
|
1579
1577
|
_iterator.f();
|
|
1580
1578
|
}
|
|
1581
1579
|
|
|
1582
|
-
regions.sort(function (a, b) {
|
|
1583
|
-
return a.refName.localeCompare(b.refName);
|
|
1584
|
-
});
|
|
1585
1580
|
return _context2.abrupt("return", regions);
|
|
1586
1581
|
|
|
1587
|
-
case
|
|
1582
|
+
case 4:
|
|
1588
1583
|
case "end":
|
|
1589
1584
|
return _context2.stop();
|
|
1590
1585
|
}
|
|
@@ -1606,12 +1601,10 @@ var FromSequenceConfigAdapter = /*#__PURE__*/function (_FromConfigAdapter) {
|
|
|
1606
1601
|
|
|
1607
1602
|
}, {
|
|
1608
1603
|
key: "freeResources",
|
|
1609
|
-
value: function freeResources()
|
|
1610
|
-
/* { region } */
|
|
1611
|
-
{}
|
|
1604
|
+
value: function freeResources() {}
|
|
1612
1605
|
}]);
|
|
1613
1606
|
|
|
1614
|
-
return
|
|
1607
|
+
return FromConfigSequenceAdapter;
|
|
1615
1608
|
}(FromConfigAdapter);
|
|
1616
1609
|
|
|
1617
1610
|
var configSchema$1 = /*#__PURE__*/ConfigurationSchema('FromConfigAdapter', {
|
|
@@ -1659,13 +1652,13 @@ var RefNameAliasAdapter = /*#__PURE__*/function (_BaseAdapter) {
|
|
|
1659
1652
|
|
|
1660
1653
|
var _super = /*#__PURE__*/_createSuper(RefNameAliasAdapter);
|
|
1661
1654
|
|
|
1662
|
-
function RefNameAliasAdapter(config) {
|
|
1655
|
+
function RefNameAliasAdapter(config, getSubAdapter, pluginManager) {
|
|
1663
1656
|
var _this;
|
|
1664
1657
|
|
|
1665
1658
|
_classCallCheck(this, RefNameAliasAdapter);
|
|
1666
1659
|
|
|
1667
|
-
_this = _super.call(this, config);
|
|
1668
|
-
_this.location = openLocation(readConfObject(config, 'location'));
|
|
1660
|
+
_this = _super.call(this, config, getSubAdapter, pluginManager);
|
|
1661
|
+
_this.location = openLocation(readConfObject(config, 'location'), _this.pluginManager);
|
|
1669
1662
|
_this.promise = _this.downloadResults();
|
|
1670
1663
|
return _this;
|
|
1671
1664
|
}
|
|
@@ -1745,41 +1738,27 @@ var refNameAliasAdapterConfigSchema = /*#__PURE__*/ConfigurationSchema('RefNameA
|
|
|
1745
1738
|
location: {
|
|
1746
1739
|
type: 'fileLocation',
|
|
1747
1740
|
defaultValue: {
|
|
1748
|
-
uri: '/path/to/my/aliases.txt'
|
|
1741
|
+
uri: '/path/to/my/aliases.txt',
|
|
1742
|
+
locationType: 'UriLocation'
|
|
1749
1743
|
}
|
|
1750
1744
|
}
|
|
1751
1745
|
}, {
|
|
1752
1746
|
explicitlyTyped: true
|
|
1753
1747
|
});
|
|
1754
1748
|
|
|
1755
|
-
Light.registerLanguage('json', json); // fontSize and fontFamily have to match between Editor and SyntaxHighlighter
|
|
1756
|
-
|
|
1757
|
-
var fontSize = '12px'; // Optimize by using system default fonts: https://css-tricks.com/snippets/css/font-stacks/
|
|
1758
|
-
|
|
1759
|
-
var 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';
|
|
1760
1749
|
var useStyles = /*#__PURE__*/makeStyles({
|
|
1761
|
-
callbackEditor: {
|
|
1762
|
-
fontFamily: fontFamily,
|
|
1763
|
-
fontSize: fontSize,
|
|
1764
|
-
overflowX: 'auto',
|
|
1765
|
-
marginTop: '16px',
|
|
1766
|
-
borderBottom: '1px solid rgba(0,0,0,0.42)'
|
|
1767
|
-
},
|
|
1768
|
-
syntaxHighlighter: {
|
|
1769
|
-
margin: 0,
|
|
1770
|
-
fontFamily: fontFamily,
|
|
1771
|
-
fontSize: fontSize
|
|
1772
|
-
},
|
|
1773
1750
|
error: {
|
|
1774
1751
|
color: 'red',
|
|
1775
1752
|
fontSize: '0.8em'
|
|
1776
1753
|
}
|
|
1777
1754
|
});
|
|
1755
|
+
var CodeEditor = /*#__PURE__*/lazy(function () {
|
|
1756
|
+
return Promise.resolve().then(function () { return CodeEditor$2; });
|
|
1757
|
+
});
|
|
1778
1758
|
|
|
1779
1759
|
function JsonEditor(_ref) {
|
|
1780
1760
|
var slot = _ref.slot;
|
|
1781
1761
|
var classes = useStyles();
|
|
1782
|
-
var theme = useTheme();
|
|
1783
1762
|
|
|
1784
1763
|
var _useState = useState(JSON.stringify(slot.value, null, ' ')),
|
|
1785
1764
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1808,26 +1787,12 @@ function JsonEditor(_ref) {
|
|
|
1808
1787
|
}, /*#__PURE__*/React.createElement(InputLabel, {
|
|
1809
1788
|
shrink: true,
|
|
1810
1789
|
htmlFor: "callback-editor"
|
|
1811
|
-
}, slot.name), /*#__PURE__*/React.createElement(
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
language: "json",
|
|
1818
|
-
style: theme.palette.type === 'dark' ? a11yDark : a11yLight,
|
|
1819
|
-
className: classes.syntaxHighlighter // override some inline style stuff that's higher specificity
|
|
1820
|
-
// than className
|
|
1821
|
-
,
|
|
1822
|
-
customStyle: {
|
|
1823
|
-
background: 'none',
|
|
1824
|
-
padding: 0
|
|
1825
|
-
}
|
|
1826
|
-
}, newCode);
|
|
1827
|
-
},
|
|
1828
|
-
padding: 10,
|
|
1829
|
-
style: {}
|
|
1830
|
-
}), /*#__PURE__*/React.createElement(FormHelperText, null, slot.description)));
|
|
1790
|
+
}, slot.name), /*#__PURE__*/React.createElement(React.Suspense, {
|
|
1791
|
+
fallback: /*#__PURE__*/React.createElement("div", null)
|
|
1792
|
+
}, /*#__PURE__*/React.createElement(CodeEditor, {
|
|
1793
|
+
contents: contents,
|
|
1794
|
+
setContents: setContents
|
|
1795
|
+
})), /*#__PURE__*/React.createElement(FormHelperText, null, slot.description)));
|
|
1831
1796
|
}
|
|
1832
1797
|
|
|
1833
1798
|
JsonEditor.propTypes = {
|
|
@@ -1875,7 +1840,7 @@ var _default = /*#__PURE__*/function (_Plugin) {
|
|
|
1875
1840
|
return new AdapterType({
|
|
1876
1841
|
name: 'FromConfigSequenceAdapter',
|
|
1877
1842
|
configSchema: sequenceConfigSchema,
|
|
1878
|
-
AdapterClass:
|
|
1843
|
+
AdapterClass: FromConfigSequenceAdapter
|
|
1879
1844
|
});
|
|
1880
1845
|
});
|
|
1881
1846
|
pluginManager.addAdapterType(function () {
|
|
@@ -1900,11 +1865,64 @@ var _default = /*#__PURE__*/function (_Plugin) {
|
|
|
1900
1865
|
return _default;
|
|
1901
1866
|
}(Plugin);
|
|
1902
1867
|
|
|
1868
|
+
var fontSize = '12px'; // Optimize by using system default fonts: https://css-tricks.com/snippets/css/font-stacks/
|
|
1869
|
+
|
|
1870
|
+
var 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';
|
|
1871
|
+
var useStyles$1 = /*#__PURE__*/makeStyles({
|
|
1872
|
+
callbackEditor: {
|
|
1873
|
+
fontFamily: fontFamily,
|
|
1874
|
+
fontSize: fontSize,
|
|
1875
|
+
overflowX: 'auto',
|
|
1876
|
+
marginTop: '16px',
|
|
1877
|
+
borderBottom: '1px solid rgba(0,0,0,0.42)'
|
|
1878
|
+
},
|
|
1879
|
+
syntaxHighlighter: {
|
|
1880
|
+
margin: 0,
|
|
1881
|
+
fontFamily: fontFamily,
|
|
1882
|
+
fontSize: fontSize
|
|
1883
|
+
}
|
|
1884
|
+
}); // eslint-disable-next-line react/prop-types
|
|
1885
|
+
|
|
1886
|
+
function CodeEditor$1(_ref) {
|
|
1887
|
+
var contents = _ref.contents,
|
|
1888
|
+
setContents = _ref.setContents;
|
|
1889
|
+
var classes = useStyles$1();
|
|
1890
|
+
var theme = useTheme();
|
|
1891
|
+
useEffect(function () {
|
|
1892
|
+
Light.registerLanguage('json', json);
|
|
1893
|
+
}, []);
|
|
1894
|
+
return /*#__PURE__*/React.createElement(Editor, {
|
|
1895
|
+
className: classes.callbackEditor,
|
|
1896
|
+
value: contents,
|
|
1897
|
+
onValueChange: setContents,
|
|
1898
|
+
highlight: function highlight(newCode) {
|
|
1899
|
+
return /*#__PURE__*/React.createElement(Light, {
|
|
1900
|
+
language: "json",
|
|
1901
|
+
style: theme.palette.type === 'dark' ? a11yDark : a11yLight,
|
|
1902
|
+
className: classes.syntaxHighlighter // override some inline style stuff that's higher specificity
|
|
1903
|
+
// than className
|
|
1904
|
+
,
|
|
1905
|
+
customStyle: {
|
|
1906
|
+
background: 'none',
|
|
1907
|
+
padding: 0
|
|
1908
|
+
}
|
|
1909
|
+
}, newCode);
|
|
1910
|
+
},
|
|
1911
|
+
padding: 10,
|
|
1912
|
+
style: {}
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
var CodeEditor$2 = {
|
|
1917
|
+
__proto__: null,
|
|
1918
|
+
'default': CodeEditor$1
|
|
1919
|
+
};
|
|
1920
|
+
|
|
1903
1921
|
var fontSize$1 = '12px'; // Optimize by using system default fonts:
|
|
1904
1922
|
// https://css-tricks.com/snippets/css/font-stacks/
|
|
1905
1923
|
|
|
1906
1924
|
var fontFamily$1 = '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';
|
|
1907
|
-
var useStyles$
|
|
1925
|
+
var useStyles$2 = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
1908
1926
|
return {
|
|
1909
1927
|
callbackEditor: {
|
|
1910
1928
|
marginTop: '16px',
|
|
@@ -1917,7 +1935,7 @@ var useStyles$1 = /*#__PURE__*/makeStyles(function (theme) {
|
|
|
1917
1935
|
|
|
1918
1936
|
function CallbackEditor(_ref) {
|
|
1919
1937
|
var slot = _ref.slot;
|
|
1920
|
-
var classes = useStyles$
|
|
1938
|
+
var classes = useStyles$2();
|
|
1921
1939
|
|
|
1922
1940
|
var _useState = useState(slot.value),
|
|
1923
1941
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1945,7 +1963,7 @@ function CallbackEditor(_ref) {
|
|
|
1945
1963
|
}, [debouncedCode, slot]); // if default value is a callback, will have to remove jexl:
|
|
1946
1964
|
// do this last
|
|
1947
1965
|
|
|
1948
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormControl, null, /*#__PURE__*/React.createElement(InputLabel, {
|
|
1966
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormControl$1, null, /*#__PURE__*/React.createElement(InputLabel$1, {
|
|
1949
1967
|
shrink: true,
|
|
1950
1968
|
htmlFor: "callback-editor"
|
|
1951
1969
|
}, slot.name), /*#__PURE__*/React.createElement(Editor, {
|
|
@@ -1961,7 +1979,7 @@ function CallbackEditor(_ref) {
|
|
|
1961
1979
|
style: {
|
|
1962
1980
|
background: error ? '#fdd' : undefined
|
|
1963
1981
|
}
|
|
1964
|
-
}), /*#__PURE__*/React.createElement(FormHelperText, null, slot.description)), /*#__PURE__*/React.createElement(Tooltip, {
|
|
1982
|
+
}), /*#__PURE__*/React.createElement(FormHelperText$1, null, slot.description)), /*#__PURE__*/React.createElement(Tooltip, {
|
|
1965
1983
|
title: /*#__PURE__*/React.createElement("div", null, "Callbacks are written in Jexl format. Click to learn more.", /*#__PURE__*/React.createElement("br", null), " Names of available context items: ", slot.contextVariable),
|
|
1966
1984
|
arrow: true
|
|
1967
1985
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
@@ -1981,6 +1999,9 @@ CallbackEditor.propTypes = {
|
|
|
1981
1999
|
};
|
|
1982
2000
|
var CallbackEditor$1 = /*#__PURE__*/observer(CallbackEditor);
|
|
1983
2001
|
|
|
2002
|
+
var ColorPicker = /*#__PURE__*/lazy(function () {
|
|
2003
|
+
return Promise.resolve().then(function () { return ColorPicker$2; });
|
|
2004
|
+
}); // this is needed because passing a entire color object into the react-color
|
|
1984
2005
|
// for alpha, can't pass in an rgba string for example
|
|
1985
2006
|
|
|
1986
2007
|
function serializeColor(color) {
|
|
@@ -1995,58 +2016,16 @@ function serializeColor(color) {
|
|
|
1995
2016
|
return color;
|
|
1996
2017
|
}
|
|
1997
2018
|
|
|
1998
|
-
var useStyles$2 = /*#__PURE__*/makeStyles({
|
|
1999
|
-
popover: {
|
|
2000
|
-
position: 'absolute',
|
|
2001
|
-
zIndex: 2
|
|
2002
|
-
},
|
|
2003
|
-
cover: {
|
|
2004
|
-
position: 'fixed',
|
|
2005
|
-
top: 0,
|
|
2006
|
-
right: 0,
|
|
2007
|
-
bottom: 0,
|
|
2008
|
-
left: 0
|
|
2009
|
-
}
|
|
2010
|
-
});
|
|
2011
|
-
function ColorPicker(props) {
|
|
2012
|
-
var color = props.color,
|
|
2013
|
-
onChange = props.onChange;
|
|
2014
|
-
var classes = useStyles$2();
|
|
2015
|
-
|
|
2016
|
-
var _useState = useState(true),
|
|
2017
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
2018
|
-
displayColorPicker = _useState2[0],
|
|
2019
|
-
setDisplayColorPicker = _useState2[1];
|
|
2020
|
-
|
|
2021
|
-
var handleClose = function handleClose() {
|
|
2022
|
-
setDisplayColorPicker(false);
|
|
2023
|
-
};
|
|
2024
|
-
|
|
2025
|
-
return /*#__PURE__*/React.createElement("div", null, displayColorPicker ? /*#__PURE__*/React.createElement("div", {
|
|
2026
|
-
className: classes.popover
|
|
2027
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
2028
|
-
role: "presentation",
|
|
2029
|
-
className: classes.cover,
|
|
2030
|
-
onClick: handleClose
|
|
2031
|
-
}), /*#__PURE__*/React.createElement(ChromePicker, {
|
|
2032
|
-
color: color,
|
|
2033
|
-
onChange: onChange
|
|
2034
|
-
})) : null);
|
|
2035
|
-
}
|
|
2036
|
-
ColorPicker.propTypes = {
|
|
2037
|
-
color: ReactPropTypes.string.isRequired,
|
|
2038
|
-
onChange: ReactPropTypes.func.isRequired
|
|
2039
|
-
};
|
|
2040
2019
|
var ColorSlot = function ColorSlot(props) {
|
|
2041
2020
|
var value = props.value,
|
|
2042
2021
|
label = props.label,
|
|
2043
2022
|
TextFieldProps = props.TextFieldProps,
|
|
2044
2023
|
_onChange = props.onChange;
|
|
2045
2024
|
|
|
2046
|
-
var
|
|
2047
|
-
|
|
2048
|
-
displayed =
|
|
2049
|
-
setDisplayed =
|
|
2025
|
+
var _useState = useState(false),
|
|
2026
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2027
|
+
displayed = _useState2[0],
|
|
2028
|
+
setDisplayed = _useState2[1];
|
|
2050
2029
|
|
|
2051
2030
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextField, Object.assign({
|
|
2052
2031
|
value: value,
|
|
@@ -2065,12 +2044,14 @@ var ColorSlot = function ColorSlot(props) {
|
|
|
2065
2044
|
onChange: function onChange(event) {
|
|
2066
2045
|
_onChange(event.target.value);
|
|
2067
2046
|
}
|
|
2068
|
-
}, TextFieldProps)), displayed ? /*#__PURE__*/React.createElement(
|
|
2047
|
+
}, TextFieldProps)), displayed ? /*#__PURE__*/React.createElement(React.Suspense, {
|
|
2048
|
+
fallback: /*#__PURE__*/React.createElement("div", null)
|
|
2049
|
+
}, /*#__PURE__*/React.createElement(ColorPicker, {
|
|
2069
2050
|
color: value,
|
|
2070
2051
|
onChange: function onChange(event) {
|
|
2071
2052
|
_onChange(serializeColor(event.rgb));
|
|
2072
2053
|
}
|
|
2073
|
-
}) : null);
|
|
2054
|
+
})) : null);
|
|
2074
2055
|
};
|
|
2075
2056
|
ColorSlot.propTypes = {
|
|
2076
2057
|
onChange: ReactPropTypes.func.isRequired,
|
|
@@ -2150,7 +2131,7 @@ var StringArrayEditor = /*#__PURE__*/observer(function (_ref3) {
|
|
|
2150
2131
|
value = _useState2[0],
|
|
2151
2132
|
setValue = _useState2[1];
|
|
2152
2133
|
|
|
2153
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, slot.name ? /*#__PURE__*/React.createElement(InputLabel
|
|
2134
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, slot.name ? /*#__PURE__*/React.createElement(InputLabel, null, slot.name) : null, /*#__PURE__*/React.createElement(List, {
|
|
2154
2135
|
disablePadding: true
|
|
2155
2136
|
}, slot.value.map(function (val, idx) {
|
|
2156
2137
|
return /*#__PURE__*/React.createElement(ListItem, {
|
|
@@ -2193,9 +2174,9 @@ var StringArrayEditor = /*#__PURE__*/observer(function (_ref3) {
|
|
|
2193
2174
|
"data-testid": "stringArrayAdd-".concat(slot.name)
|
|
2194
2175
|
}, /*#__PURE__*/React.createElement(AddIcon, null)))
|
|
2195
2176
|
}
|
|
2196
|
-
}))), /*#__PURE__*/React.createElement(FormHelperText
|
|
2177
|
+
}))), /*#__PURE__*/React.createElement(FormHelperText, null, slot.description));
|
|
2197
2178
|
});
|
|
2198
|
-
var useMapEditorStyles = /*#__PURE__*/makeStyles
|
|
2179
|
+
var useMapEditorStyles = /*#__PURE__*/makeStyles(function (theme) {
|
|
2199
2180
|
return {
|
|
2200
2181
|
card: {
|
|
2201
2182
|
marginTop: theme.spacing(1)
|
|
@@ -2211,7 +2192,7 @@ var StringArrayMapEditor = /*#__PURE__*/observer(function (_ref4) {
|
|
|
2211
2192
|
value = _useState4[0],
|
|
2212
2193
|
setValue = _useState4[1];
|
|
2213
2194
|
|
|
2214
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputLabel
|
|
2195
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputLabel, null, slot.name), Array.from(slot.value, function (_ref5) {
|
|
2215
2196
|
var _ref6 = _slicedToArray(_ref5, 2),
|
|
2216
2197
|
key = _ref6[0],
|
|
2217
2198
|
val = _ref6[1];
|
|
@@ -2268,7 +2249,7 @@ var StringArrayMapEditor = /*#__PURE__*/observer(function (_ref4) {
|
|
|
2268
2249
|
}, /*#__PURE__*/React.createElement(AddIcon, null)))
|
|
2269
2250
|
}
|
|
2270
2251
|
})
|
|
2271
|
-
})), /*#__PURE__*/React.createElement(FormHelperText
|
|
2252
|
+
})), /*#__PURE__*/React.createElement(FormHelperText, null, slot.description));
|
|
2272
2253
|
});
|
|
2273
2254
|
var NumberMapEditor = /*#__PURE__*/observer(function (_ref7) {
|
|
2274
2255
|
var slot = _ref7.slot;
|
|
@@ -2279,7 +2260,7 @@ var NumberMapEditor = /*#__PURE__*/observer(function (_ref7) {
|
|
|
2279
2260
|
value = _useState6[0],
|
|
2280
2261
|
setValue = _useState6[1];
|
|
2281
2262
|
|
|
2282
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputLabel
|
|
2263
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputLabel, null, slot.name), Array.from(slot.value, function (_ref8) {
|
|
2283
2264
|
var _ref9 = _slicedToArray(_ref8, 2),
|
|
2284
2265
|
key = _ref9[0],
|
|
2285
2266
|
val = _ref9[1];
|
|
@@ -2329,7 +2310,7 @@ var NumberMapEditor = /*#__PURE__*/observer(function (_ref7) {
|
|
|
2329
2310
|
}, /*#__PURE__*/React.createElement(AddIcon, null)))
|
|
2330
2311
|
}
|
|
2331
2312
|
})
|
|
2332
|
-
})), /*#__PURE__*/React.createElement(FormHelperText
|
|
2313
|
+
})), /*#__PURE__*/React.createElement(FormHelperText, null, slot.description));
|
|
2333
2314
|
});
|
|
2334
2315
|
var NumberEditor = /*#__PURE__*/observer(function (_ref10) {
|
|
2335
2316
|
var slot = _ref10.slot;
|
|
@@ -2385,7 +2366,7 @@ var IntegerEditor = /*#__PURE__*/observer(function (_ref11) {
|
|
|
2385
2366
|
});
|
|
2386
2367
|
var booleanEditor = /*#__PURE__*/observer(function (_ref12) {
|
|
2387
2368
|
var slot = _ref12.slot;
|
|
2388
|
-
return /*#__PURE__*/React.createElement(FormControl
|
|
2369
|
+
return /*#__PURE__*/React.createElement(FormControl, null, /*#__PURE__*/React.createElement(FormControlLabel, {
|
|
2389
2370
|
label: slot.name,
|
|
2390
2371
|
control: /*#__PURE__*/React.createElement(Checkbox, {
|
|
2391
2372
|
checked: slot.value,
|
|
@@ -2393,7 +2374,7 @@ var booleanEditor = /*#__PURE__*/observer(function (_ref12) {
|
|
|
2393
2374
|
return slot.set(evt.target.checked);
|
|
2394
2375
|
}
|
|
2395
2376
|
})
|
|
2396
|
-
}), /*#__PURE__*/React.createElement(FormHelperText
|
|
2377
|
+
}), /*#__PURE__*/React.createElement(FormHelperText, null, slot.description));
|
|
2397
2378
|
});
|
|
2398
2379
|
var stringEnumEditor = /*#__PURE__*/observer(function (_ref13) {
|
|
2399
2380
|
var slot = _ref13.slot,
|
|
@@ -2420,6 +2401,8 @@ var stringEnumEditor = /*#__PURE__*/observer(function (_ref13) {
|
|
|
2420
2401
|
}));
|
|
2421
2402
|
});
|
|
2422
2403
|
var FileSelectorWrapper = /*#__PURE__*/observer(function (_ref14) {
|
|
2404
|
+
var _getEnv$pluginManager;
|
|
2405
|
+
|
|
2423
2406
|
var slot = _ref14.slot;
|
|
2424
2407
|
return /*#__PURE__*/React.createElement(FileSelector, {
|
|
2425
2408
|
location: slot.value,
|
|
@@ -2427,7 +2410,8 @@ var FileSelectorWrapper = /*#__PURE__*/observer(function (_ref14) {
|
|
|
2427
2410
|
return slot.set(location);
|
|
2428
2411
|
},
|
|
2429
2412
|
name: slot.name,
|
|
2430
|
-
description: slot.description
|
|
2413
|
+
description: slot.description,
|
|
2414
|
+
rootModel: (_getEnv$pluginManager = getEnv(slot).pluginManager) === null || _getEnv$pluginManager === void 0 ? void 0 : _getEnv$pluginManager.rootModel
|
|
2431
2415
|
});
|
|
2432
2416
|
});
|
|
2433
2417
|
var valueComponents = {
|
|
@@ -2445,7 +2429,7 @@ var valueComponents = {
|
|
|
2445
2429
|
frozen: JsonEditor$1,
|
|
2446
2430
|
configRelationships: JsonEditor$1
|
|
2447
2431
|
};
|
|
2448
|
-
var useSlotEditorStyles = /*#__PURE__*/makeStyles
|
|
2432
|
+
var useSlotEditorStyles = /*#__PURE__*/makeStyles(function (theme) {
|
|
2449
2433
|
return {
|
|
2450
2434
|
paper: {
|
|
2451
2435
|
display: 'flex',
|
|
@@ -2528,7 +2512,7 @@ var TypeSelector = /*#__PURE__*/observer(function (_ref) {
|
|
|
2528
2512
|
}))));
|
|
2529
2513
|
});
|
|
2530
2514
|
|
|
2531
|
-
var useStyles$3 = /*#__PURE__*/makeStyles(function (theme) {
|
|
2515
|
+
var useStyles$3 = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
2532
2516
|
return {
|
|
2533
2517
|
subSchemaContainer: {
|
|
2534
2518
|
marginLeft: theme.spacing(1),
|
|
@@ -2637,6 +2621,55 @@ var ConfigurationEditor$1 = {
|
|
|
2637
2621
|
'default': ConfigurationEditor
|
|
2638
2622
|
};
|
|
2639
2623
|
|
|
2624
|
+
var useStyles$4 = /*#__PURE__*/makeStyles$1({
|
|
2625
|
+
popover: {
|
|
2626
|
+
position: 'absolute',
|
|
2627
|
+
zIndex: 2
|
|
2628
|
+
},
|
|
2629
|
+
cover: {
|
|
2630
|
+
position: 'fixed',
|
|
2631
|
+
top: 0,
|
|
2632
|
+
right: 0,
|
|
2633
|
+
bottom: 0,
|
|
2634
|
+
left: 0
|
|
2635
|
+
}
|
|
2636
|
+
});
|
|
2637
|
+
function ColorPicker$1(props) {
|
|
2638
|
+
var color = props.color,
|
|
2639
|
+
onChange = props.onChange;
|
|
2640
|
+
var classes = useStyles$4();
|
|
2641
|
+
|
|
2642
|
+
var _useState = useState(true),
|
|
2643
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2644
|
+
displayColorPicker = _useState2[0],
|
|
2645
|
+
setDisplayColorPicker = _useState2[1];
|
|
2646
|
+
|
|
2647
|
+
var handleClose = function handleClose() {
|
|
2648
|
+
setDisplayColorPicker(false);
|
|
2649
|
+
};
|
|
2650
|
+
|
|
2651
|
+
return /*#__PURE__*/React.createElement("div", null, displayColorPicker ? /*#__PURE__*/React.createElement("div", {
|
|
2652
|
+
className: classes.popover
|
|
2653
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2654
|
+
role: "presentation",
|
|
2655
|
+
className: classes.cover,
|
|
2656
|
+
onClick: handleClose
|
|
2657
|
+
}), /*#__PURE__*/React.createElement(ChromePicker, {
|
|
2658
|
+
color: color,
|
|
2659
|
+
onChange: onChange
|
|
2660
|
+
})) : null);
|
|
2661
|
+
}
|
|
2662
|
+
ColorPicker$1.propTypes = {
|
|
2663
|
+
color: ReactPropTypes.string.isRequired,
|
|
2664
|
+
onChange: ReactPropTypes.func.isRequired
|
|
2665
|
+
};
|
|
2666
|
+
|
|
2667
|
+
var ColorPicker$2 = {
|
|
2668
|
+
__proto__: null,
|
|
2669
|
+
ColorPicker: ColorPicker$1,
|
|
2670
|
+
'default': ColorPicker$1
|
|
2671
|
+
};
|
|
2672
|
+
|
|
2640
2673
|
export default _default;
|
|
2641
2674
|
export { ConfigurationEditorComponent as ConfigurationEditor, JsonEditor$1 as JsonEditor };
|
|
2642
2675
|
//# sourceMappingURL=plugin-config.esm.js.map
|