@jbrowse/plugin-config 2.17.0 → 3.0.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.
Files changed (118) hide show
  1. package/dist/ConfigurationEditorWidget/components/BooleanEditor.d.ts +1 -2
  2. package/dist/ConfigurationEditorWidget/components/BooleanEditor.js +5 -10
  3. package/dist/ConfigurationEditorWidget/components/CallbackEditor.d.ts +1 -2
  4. package/dist/ConfigurationEditorWidget/components/CallbackEditor.js +19 -57
  5. package/dist/ConfigurationEditorWidget/components/ColorEditor.d.ts +2 -3
  6. package/dist/ConfigurationEditorWidget/components/ColorEditor.js +12 -38
  7. package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +3 -4
  8. package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +14 -32
  9. package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +2 -3
  10. package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.js +3 -8
  11. package/dist/ConfigurationEditorWidget/components/HeadingComponent.d.ts +1 -2
  12. package/dist/ConfigurationEditorWidget/components/HeadingComponent.js +2 -5
  13. package/dist/ConfigurationEditorWidget/components/JsonEditor.d.ts +1 -2
  14. package/dist/ConfigurationEditorWidget/components/JsonEditor.js +12 -40
  15. package/dist/ConfigurationEditorWidget/components/NumberEditor.d.ts +1 -2
  16. package/dist/ConfigurationEditorWidget/components/NumberEditor.js +3 -25
  17. package/dist/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +1 -2
  18. package/dist/ConfigurationEditorWidget/components/NumberMapEditor.js +22 -56
  19. package/dist/ConfigurationEditorWidget/components/SlotEditor.d.ts +2 -3
  20. package/dist/ConfigurationEditorWidget/components/SlotEditor.js +21 -52
  21. package/dist/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +1 -2
  22. package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +28 -64
  23. package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +1 -2
  24. package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.js +30 -65
  25. package/dist/ConfigurationEditorWidget/components/TypeSelector.d.ts +2 -3
  26. package/dist/ConfigurationEditorWidget/components/TypeSelector.js +2 -7
  27. package/dist/ConfigurationEditorWidget/index.d.ts +1 -1
  28. package/dist/ConfigurationEditorWidget/index.js +18 -8
  29. package/dist/ConfigurationEditorWidget/model.d.ts +1 -1
  30. package/dist/ConfigurationEditorWidget/model.js +1 -3
  31. package/dist/FromConfigAdapter/FromConfigAdapter.d.ts +5 -5
  32. package/dist/FromConfigAdapter/FromConfigAdapter.js +3 -4
  33. package/dist/FromConfigAdapter/configSchema.d.ts +0 -3
  34. package/dist/FromConfigAdapter/configSchema.js +1 -7
  35. package/dist/FromConfigAdapter/index.d.ts +1 -1
  36. package/dist/FromConfigAdapter/index.js +17 -7
  37. package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.d.ts +5 -12
  38. package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +2 -12
  39. package/dist/FromConfigRegionsAdapter/configSchema.d.ts +0 -3
  40. package/dist/FromConfigRegionsAdapter/configSchema.js +1 -8
  41. package/dist/FromConfigRegionsAdapter/index.d.ts +1 -1
  42. package/dist/FromConfigRegionsAdapter/index.js +17 -7
  43. package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +3 -16
  44. package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +3 -18
  45. package/dist/FromConfigSequenceAdapter/configSchema.d.ts +0 -3
  46. package/dist/FromConfigSequenceAdapter/configSchema.js +1 -7
  47. package/dist/FromConfigSequenceAdapter/index.d.ts +1 -1
  48. package/dist/FromConfigSequenceAdapter/index.js +17 -7
  49. package/dist/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.d.ts +2 -1
  50. package/dist/NcbiSequenceReportAliasAdapter/configSchema.d.ts +0 -3
  51. package/dist/NcbiSequenceReportAliasAdapter/configSchema.js +1 -8
  52. package/dist/NcbiSequenceReportAliasAdapter/index.d.ts +1 -1
  53. package/dist/NcbiSequenceReportAliasAdapter/index.js +17 -7
  54. package/dist/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +2 -1
  55. package/dist/RefNameAliasAdapter/configSchema.d.ts +0 -8
  56. package/dist/RefNameAliasAdapter/configSchema.js +1 -14
  57. package/dist/RefNameAliasAdapter/index.d.ts +1 -1
  58. package/dist/RefNameAliasAdapter/index.js +17 -7
  59. package/dist/index.d.ts +2 -2
  60. package/dist/index.js +19 -9
  61. package/esm/ConfigurationEditorWidget/components/BooleanEditor.d.ts +1 -2
  62. package/esm/ConfigurationEditorWidget/components/BooleanEditor.js +5 -7
  63. package/esm/ConfigurationEditorWidget/components/CallbackEditor.d.ts +1 -2
  64. package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +19 -34
  65. package/esm/ConfigurationEditorWidget/components/ColorEditor.d.ts +2 -3
  66. package/esm/ConfigurationEditorWidget/components/ColorEditor.js +12 -15
  67. package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +3 -4
  68. package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +15 -33
  69. package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +2 -3
  70. package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.js +3 -5
  71. package/esm/ConfigurationEditorWidget/components/HeadingComponent.d.ts +1 -2
  72. package/esm/ConfigurationEditorWidget/components/HeadingComponent.js +3 -3
  73. package/esm/ConfigurationEditorWidget/components/JsonEditor.d.ts +1 -2
  74. package/esm/ConfigurationEditorWidget/components/JsonEditor.js +12 -17
  75. package/esm/ConfigurationEditorWidget/components/NumberEditor.d.ts +1 -2
  76. package/esm/ConfigurationEditorWidget/components/NumberEditor.js +3 -2
  77. package/esm/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +1 -2
  78. package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js +22 -33
  79. package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +2 -3
  80. package/esm/ConfigurationEditorWidget/components/SlotEditor.js +22 -30
  81. package/esm/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +1 -2
  82. package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +28 -41
  83. package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +1 -2
  84. package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js +30 -42
  85. package/esm/ConfigurationEditorWidget/components/TypeSelector.d.ts +2 -3
  86. package/esm/ConfigurationEditorWidget/components/TypeSelector.js +2 -4
  87. package/esm/ConfigurationEditorWidget/index.d.ts +1 -1
  88. package/esm/ConfigurationEditorWidget/index.js +1 -1
  89. package/esm/ConfigurationEditorWidget/model.d.ts +1 -1
  90. package/esm/ConfigurationEditorWidget/model.js +1 -3
  91. package/esm/FromConfigAdapter/FromConfigAdapter.d.ts +5 -5
  92. package/esm/FromConfigAdapter/FromConfigAdapter.js +3 -4
  93. package/esm/FromConfigAdapter/configSchema.d.ts +0 -3
  94. package/esm/FromConfigAdapter/configSchema.js +1 -7
  95. package/esm/FromConfigAdapter/index.d.ts +1 -1
  96. package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.d.ts +5 -12
  97. package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +3 -13
  98. package/esm/FromConfigRegionsAdapter/configSchema.d.ts +0 -3
  99. package/esm/FromConfigRegionsAdapter/configSchema.js +1 -8
  100. package/esm/FromConfigRegionsAdapter/index.d.ts +1 -1
  101. package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +3 -16
  102. package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +3 -18
  103. package/esm/FromConfigSequenceAdapter/configSchema.d.ts +0 -3
  104. package/esm/FromConfigSequenceAdapter/configSchema.js +1 -7
  105. package/esm/FromConfigSequenceAdapter/index.d.ts +1 -1
  106. package/esm/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.d.ts +2 -1
  107. package/esm/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.js +1 -1
  108. package/esm/NcbiSequenceReportAliasAdapter/configSchema.d.ts +0 -3
  109. package/esm/NcbiSequenceReportAliasAdapter/configSchema.js +1 -8
  110. package/esm/NcbiSequenceReportAliasAdapter/index.d.ts +1 -1
  111. package/esm/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +2 -1
  112. package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js +1 -1
  113. package/esm/RefNameAliasAdapter/configSchema.d.ts +0 -8
  114. package/esm/RefNameAliasAdapter/configSchema.js +1 -14
  115. package/esm/RefNameAliasAdapter/index.d.ts +1 -1
  116. package/esm/index.d.ts +2 -2
  117. package/esm/index.js +2 -2
  118. package/package.json +2 -2
@@ -1,14 +1,12 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { Tooltip, IconButton, TextField } from '@mui/material';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
3
  import { useDebounce } from '@jbrowse/core/util';
4
4
  import { stringToJexlExpression } from '@jbrowse/core/util/jexlStrings';
5
- import { getEnv } from 'mobx-state-tree';
5
+ import HelpIcon from '@mui/icons-material/Help';
6
+ import { IconButton, TextField, Tooltip } from '@mui/material';
6
7
  import { observer } from 'mobx-react';
8
+ import { getEnv } from 'mobx-state-tree';
7
9
  import { makeStyles } from 'tss-react/mui';
8
- // icons
9
- import HelpIcon from '@mui/icons-material/Help';
10
- // Optimize by using system default fonts:
11
- // https://css-tricks.com/snippets/css/font-stacks/
12
10
  const fontFamily = 'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace';
13
11
  const useStyles = makeStyles()(theme => ({
14
12
  callbackEditor: {
@@ -52,32 +50,19 @@ const CallbackEditor = observer(function ({ slot, }) {
52
50
  setCodeError(e);
53
51
  }
54
52
  }, [debouncedCode, slot]);
55
- // if default value is a callback, will have to remove jexl:
56
- // do this last
57
- return (React.createElement(React.Fragment, null,
58
- error ? React.createElement("p", { className: classes.error }, `${error}`) : null,
59
- React.createElement("div", { className: classes.callbackContainer },
60
- React.createElement(TextField, { multiline: true, className: classes.callbackEditor, value: code.startsWith('jexl:') ? code.split('jexl:')[1] : code, onChange: event => {
61
- setCode(event.target.value);
62
- }, style: { background: error ? '#fdd' : undefined }, slotProps: {
63
- input: {
64
- classes: {
65
- input: classes.textAreaFont,
66
- },
67
- },
68
- } }),
69
- React.createElement("p", null, slot.description),
70
- React.createElement(Tooltip, { title: React.createElement("div", null,
71
- "Callbacks are written in Jexl format. Click to learn more.",
72
- React.createElement("br", null),
73
- " Names of available context items: ",
74
- slot.contextVariable), arrow: true },
75
- React.createElement(IconButton, { color: "primary", onClick: () => {
76
- const newWindow = window.open('https://github.com/TomFrost/Jexl', '_blank', 'noopener,noreferrer');
77
- if (newWindow) {
78
- newWindow.opener = null;
79
- }
80
- } },
81
- React.createElement(HelpIcon, null))))));
53
+ return (_jsxs(_Fragment, { children: [error ? _jsx("p", { className: classes.error, children: `${error}` }) : null, _jsxs("div", { className: classes.callbackContainer, children: [_jsx(TextField, { multiline: true, className: classes.callbackEditor, value: code.startsWith('jexl:') ? code.split('jexl:')[1] : code, onChange: event => {
54
+ setCode(event.target.value);
55
+ }, style: { background: error ? '#fdd' : undefined }, slotProps: {
56
+ input: {
57
+ classes: {
58
+ input: classes.textAreaFont,
59
+ },
60
+ },
61
+ } }), _jsx("p", { children: slot.description }), _jsx(Tooltip, { title: _jsxs("div", { children: ["Callbacks are written in Jexl format. Click to learn more.", _jsx("br", {}), " Names of available context items: ", slot.contextVariable] }), arrow: true, children: _jsx(IconButton, { color: "primary", onClick: () => {
62
+ const newWindow = window.open('https://github.com/TomFrost/Jexl', '_blank', 'noopener,noreferrer');
63
+ if (newWindow) {
64
+ newWindow.opener = null;
65
+ }
66
+ }, children: _jsx(HelpIcon, {}) }) })] })] }));
82
67
  });
83
68
  export default CallbackEditor;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  export declare const ColorSlot: (props: {
3
2
  value: string;
4
3
  label?: string;
@@ -7,7 +6,7 @@ export declare const ColorSlot: (props: {
7
6
  fullWidth: boolean;
8
7
  };
9
8
  onChange: (arg: string) => void;
10
- }) => React.JSX.Element;
9
+ }) => import("react/jsx-runtime").JSX.Element;
11
10
  declare const ColorEditor: (props: {
12
11
  slot: {
13
12
  name: string;
@@ -15,5 +14,5 @@ declare const ColorEditor: (props: {
15
14
  description: string;
16
15
  set: (arg: string) => void;
17
16
  };
18
- }) => React.JSX.Element;
17
+ }) => import("react/jsx-runtime").JSX.Element;
19
18
  export default ColorEditor;
@@ -1,25 +1,22 @@
1
- import React, { useState } from 'react';
2
- import { observer } from 'mobx-react';
3
- import { TextField } from '@mui/material';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Suspense, useState } from 'react';
4
3
  import ColorPicker from '@jbrowse/core/ui/ColorPicker';
4
+ import { TextField } from '@mui/material';
5
+ import { observer } from 'mobx-react';
5
6
  export const ColorSlot = (props) => {
6
7
  const { value = '#000', label = '', TextFieldProps = {}, onChange } = props;
7
8
  const [displayed, setDisplayed] = useState(false);
8
- return (React.createElement("div", { style: { display: 'flex' } },
9
- React.createElement(TextField, { value: value, label: label, onClick: () => {
10
- setDisplayed(!displayed);
11
- }, onChange: event => {
12
- onChange(event.target.value);
13
- }, ...TextFieldProps }),
14
- React.createElement("div", { style: { marginTop: 10 } },
15
- React.createElement(React.Suspense, { fallback: null },
16
- React.createElement(ColorPicker, { color: value, onChange: event => {
17
- onChange(event);
18
- } })))));
9
+ return (_jsxs("div", { style: { display: 'flex' }, children: [_jsx(TextField, { value: value, label: label, onClick: () => {
10
+ setDisplayed(!displayed);
11
+ }, onChange: event => {
12
+ onChange(event.target.value);
13
+ }, ...TextFieldProps }), _jsx("div", { style: { marginTop: 10 }, children: _jsx(Suspense, { fallback: null, children: _jsx(ColorPicker, { color: value, onChange: event => {
14
+ onChange(event);
15
+ } }) }) })] }));
19
16
  };
20
17
  const ColorEditor = observer(function (props) {
21
18
  const { slot } = props;
22
- return (React.createElement(ColorSlot, { label: slot.name, value: slot.value, onChange: color => {
19
+ return (_jsx(ColorSlot, { label: slot.name, value: slot.value, onChange: color => {
23
20
  slot.set(color);
24
21
  }, TextFieldProps: {
25
22
  helperText: slot.description,
@@ -1,10 +1,9 @@
1
- import React from 'react';
2
- import { AbstractSessionModel } from '@jbrowse/core/util';
3
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
1
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
+ import type { AbstractSessionModel } from '@jbrowse/core/util';
4
3
  declare const ConfigurationEditor: ({ model, }: {
5
4
  model: {
6
5
  target: AnyConfigurationModel;
7
6
  };
8
7
  session?: AbstractSessionModel;
9
- }) => React.JSX.Element;
8
+ }) => import("react/jsx-runtime").JSX.Element;
10
9
  export default ConfigurationEditor;
@@ -1,14 +1,12 @@
1
- import React from 'react';
2
- import { FormGroup, Accordion, AccordionDetails, AccordionSummary, Typography, } from '@mui/material';
3
- import { makeStyles } from 'tss-react/mui';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { getTypeNamesFromExplicitlyTypedUnion, isConfigurationSchemaType, isConfigurationSlotType, readConfObject, } from '@jbrowse/core/configuration';
3
+ import SanitizedHTML from '@jbrowse/core/ui/SanitizedHTML';
4
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
5
+ import { Accordion, AccordionDetails, AccordionSummary, FormGroup, Typography, } from '@mui/material';
4
6
  import { observer } from 'mobx-react';
5
7
  import { getMembers } from 'mobx-state-tree';
6
8
  import { singular } from 'pluralize';
7
- import SanitizedHTML from '@jbrowse/core/ui/SanitizedHTML';
8
- import { readConfObject, getTypeNamesFromExplicitlyTypedUnion, isConfigurationSchemaType, isConfigurationSlotType, } from '@jbrowse/core/configuration';
9
- // icons
10
- import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
11
- // locals
9
+ import { makeStyles } from 'tss-react/mui';
12
10
  import SlotEditor from './SlotEditor';
13
11
  import TypeSelector from './TypeSelector';
14
12
  const useStyles = makeStyles()(theme => ({
@@ -36,26 +34,18 @@ const Member = observer(function (props) {
36
34
  const key = subslot.type
37
35
  ? `${singular(slotName)} ${subslot.type}`
38
36
  : `${singular(slotName)} ${slotIndex + 1}`;
39
- return React.createElement(Member, { key: key, ...props, slot: subslot, slotName: key });
37
+ return _jsx(Member, { ...props, slot: subslot, slotName: key }, key);
40
38
  });
41
39
  }
42
- // if this is an explicitly typed schema, make a type-selecting dropdown
43
- // that can be used to change its type
44
40
  const typeNameChoices = getTypeNamesFromExplicitlyTypedUnion(slotSchema);
45
- return (React.createElement(Accordion, { defaultExpanded: true, className: classes.accordion },
46
- React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, { className: classes.icon }) },
47
- React.createElement(Typography, null, [...path, slotName].join('➔'))),
48
- React.createElement(AccordionDetails, { className: classes.expansionPanelDetails },
49
- typeNameChoices.length ? (React.createElement(TypeSelector, { typeNameChoices: typeNameChoices, slotName: slotName, slot: slot, onChange: evt => {
50
- if (evt.target.value !== slot.type) {
51
- schema.setSubschema(slotName, { type: evt.target.value });
52
- }
53
- } })) : null,
54
- React.createElement(FormGroup, { className: classes.noOverflow },
55
- React.createElement(Schema, { schema: slot, path: [...path, slotName] })))));
41
+ return (_jsxs(Accordion, { defaultExpanded: true, className: classes.accordion, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, { className: classes.icon }), children: _jsx(Typography, { children: [...path, slotName].join('➔') }) }), _jsxs(AccordionDetails, { className: classes.expansionPanelDetails, children: [typeNameChoices.length ? (_jsx(TypeSelector, { typeNameChoices: typeNameChoices, slotName: slotName, slot: slot, onChange: evt => {
42
+ if (evt.target.value !== slot.type) {
43
+ schema.setSubschema(slotName, { type: evt.target.value });
44
+ }
45
+ } })) : null, _jsx(FormGroup, { className: classes.noOverflow, children: _jsx(Schema, { schema: slot, path: [...path, slotName] }) })] })] }));
56
46
  }
57
47
  else if (isConfigurationSlotType(slotSchema)) {
58
- return React.createElement(SlotEditor, { key: slotName, slot: slot, slotSchema: slotSchema });
48
+ return _jsx(SlotEditor, { slot: slot, slotSchema: slotSchema }, slotName);
59
49
  }
60
50
  else {
61
51
  return null;
@@ -63,21 +53,13 @@ const Member = observer(function (props) {
63
53
  });
64
54
  const Schema = observer(function ({ schema, path = [], }) {
65
55
  const properties = getMembers(schema).properties;
66
- 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 })))));
56
+ return (_jsx(_Fragment, { children: Object.entries(properties).map(([slotName, slotSchema]) => (_jsx(Member, { slotName: slotName, slotSchema: slotSchema, path: path, schema: schema }, slotName))) }));
67
57
  });
68
58
  const ConfigurationEditor = observer(function ({ model, }) {
69
59
  const { classes } = useStyles();
70
- // key forces a re-render, otherwise the same field can end up being used for
71
- // different tracks since only the backing model changes for example see pr
72
- // #804
73
60
  const { target } = model;
74
61
  const key = readConfObject(target, 'trackId');
75
62
  const name = readConfObject(target, 'name');
76
- return (React.createElement(Accordion, { key: key, defaultExpanded: true, className: classes.accordion },
77
- React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, { className: classes.icon }) },
78
- React.createElement(Typography, null,
79
- React.createElement(SanitizedHTML, { html: name !== null && name !== void 0 ? name : 'Configuration' }))),
80
- React.createElement(AccordionDetails, { className: classes.expansionPanelDetails, "data-testid": "configEditor" },
81
- React.createElement(Schema, { schema: target }))));
63
+ return (_jsxs(Accordion, { defaultExpanded: true, className: classes.accordion, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, { className: classes.icon }), children: _jsx(Typography, { children: _jsx(SanitizedHTML, { html: name !== null && name !== void 0 ? name : 'Configuration' }) }) }), _jsx(AccordionDetails, { className: classes.expansionPanelDetails, "data-testid": "configEditor", children: _jsx(Schema, { schema: target }) })] }, key));
82
64
  });
83
65
  export default ConfigurationEditor;
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { TextFieldProps } from '@mui/material';
1
+ import type { TextFieldProps } from '@mui/material';
3
2
  export default function ConfigurationTextField(props: {
4
3
  helperText?: string;
5
- } & TextFieldProps): React.JSX.Element;
4
+ } & TextFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,9 @@
1
- import React from 'react';
2
- import { TextField } from '@mui/material';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
3
2
  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
3
+ import { TextField } from '@mui/material';
6
4
  export default function ConfigurationTextField(props) {
7
5
  const { helperText } = props;
8
- return (React.createElement(TextField, { ...props, helperText: React.createElement(SanitizedHTML, { html: helperText || '' }), fullWidth: true, slotProps: {
6
+ return (_jsx(TextField, { ...props, helperText: _jsx(SanitizedHTML, { html: helperText || '' }), fullWidth: true, slotProps: {
9
7
  formHelperText: {
10
8
  component: 'div',
11
9
  },
@@ -1,9 +1,8 @@
1
- import React from 'react';
2
1
  declare const HeadingComponent: ({ model, }: {
3
2
  model?: {
4
3
  target: {
5
4
  type: string;
6
5
  };
7
6
  };
8
- }) => string | React.JSX.Element;
7
+ }) => string | import("react/jsx-runtime").JSX.Element;
9
8
  export default HeadingComponent;
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { observer } from 'mobx-react';
3
- import { isStateTreeNode, getType } from 'mobx-state-tree';
3
+ import { getType, isStateTreeNode } from 'mobx-state-tree';
4
4
  const HeadingComponent = observer(function ({ model, }) {
5
5
  if (model === null || model === void 0 ? void 0 : model.target) {
6
6
  if (model.target.type) {
@@ -13,6 +13,6 @@ const HeadingComponent = observer(function ({ model, }) {
13
13
  }
14
14
  }
15
15
  }
16
- return React.createElement(React.Fragment, null, "Settings");
16
+ return _jsx(_Fragment, { children: "Settings" });
17
17
  });
18
18
  export default HeadingComponent;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  declare const JsonEditor: ({ slot, }: {
3
2
  slot: {
4
3
  name: string;
@@ -6,5 +5,5 @@ declare const JsonEditor: ({ slot, }: {
6
5
  value: unknown;
7
6
  set: (arg: unknown) => void;
8
7
  };
9
- }) => React.JSX.Element;
8
+ }) => import("react/jsx-runtime").JSX.Element;
10
9
  export default JsonEditor;
@@ -1,10 +1,9 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
2
3
  import { InputLabel, TextField } from '@mui/material';
3
- import { makeStyles } from 'tss-react/mui';
4
4
  import { observer } from 'mobx-react';
5
- // fontSize and fontFamily have to match between Editor and SyntaxHighlighter
5
+ import { makeStyles } from 'tss-react/mui';
6
6
  const fontSize = '12px';
7
- // Optimize by using system default fonts: https://css-tricks.com/snippets/css/font-stacks/
8
7
  const fontFamily = 'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace';
9
8
  const useStyles = makeStyles()(theme => ({
10
9
  error: {
@@ -41,18 +40,14 @@ const JsonEditor = observer(function JsonEditor({ slot, }) {
41
40
  setError(e);
42
41
  }
43
42
  }, [contents, slot]);
44
- return (React.createElement(React.Fragment, null,
45
- error ? React.createElement("p", { className: classes.error }, `${error}`) : null,
46
- React.createElement("div", { className: classes.callbackContainer },
47
- React.createElement(InputLabel, { shrink: true, htmlFor: "json-editor" }, slot.name),
48
- React.createElement(TextField, { id: "json-editor", className: classes.callbackEditor, value: contents, helperText: slot.description, multiline: true, onChange: event => {
49
- setContents(event.target.value);
50
- }, style: { background: error ? '#fdd' : undefined }, slotProps: {
51
- input: {
52
- classes: {
53
- input: classes.textAreaFont,
54
- },
55
- },
56
- } }))));
43
+ return (_jsxs(_Fragment, { children: [error ? _jsx("p", { className: classes.error, children: `${error}` }) : null, _jsxs("div", { className: classes.callbackContainer, children: [_jsx(InputLabel, { shrink: true, htmlFor: "json-editor", children: slot.name }), _jsx(TextField, { id: "json-editor", className: classes.callbackEditor, value: contents, helperText: slot.description, multiline: true, onChange: event => {
44
+ setContents(event.target.value);
45
+ }, style: { background: error ? '#fdd' : undefined }, slotProps: {
46
+ input: {
47
+ classes: {
48
+ input: classes.textAreaFont,
49
+ },
50
+ },
51
+ } })] })] }));
57
52
  });
58
53
  export default JsonEditor;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  declare const NumberEditor: ({ slot, }: {
3
2
  slot: {
4
3
  name?: string;
@@ -7,5 +6,5 @@ declare const NumberEditor: ({ slot, }: {
7
6
  set: (val: number) => void;
8
7
  reset?: () => void;
9
8
  };
10
- }) => React.JSX.Element;
9
+ }) => import("react/jsx-runtime").JSX.Element;
11
10
  export default NumberEditor;
@@ -1,4 +1,5 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
2
3
  import { observer } from 'mobx-react';
3
4
  import ConfigurationTextField from './ConfigurationTextField';
4
5
  const NumberEditor = observer(function ({ slot, }) {
@@ -13,7 +14,7 @@ const NumberEditor = observer(function ({ slot, }) {
13
14
  slot.set(num);
14
15
  }
15
16
  }, [slot, val]);
16
- return (React.createElement(ConfigurationTextField, { label: slot.name, helperText: slot.description, value: val, type: "number", onChange: evt => {
17
+ return (_jsx(ConfigurationTextField, { label: slot.name, helperText: slot.description, value: val, type: "number", onChange: evt => {
17
18
  setVal(evt.target.value);
18
19
  } }));
19
20
  });
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  declare const NumberMapEditor: ({ slot, }: {
3
2
  slot: {
4
3
  name: string;
@@ -7,5 +6,5 @@ declare const NumberMapEditor: ({ slot, }: {
7
6
  add: (key: string, val: number) => void;
8
7
  description: string;
9
8
  };
10
- }) => React.JSX.Element;
9
+ }) => import("react/jsx-runtime").JSX.Element;
11
10
  export default NumberMapEditor;
@@ -1,10 +1,10 @@
1
- import React, { useState } from 'react';
2
- import { observer } from 'mobx-react';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import AddIcon from '@mui/icons-material/Add';
4
+ import DeleteIcon from '@mui/icons-material/Delete';
3
5
  import { Card, CardContent, CardHeader, FormHelperText, IconButton, InputAdornment, InputLabel, TextField, } from '@mui/material';
6
+ import { observer } from 'mobx-react';
4
7
  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
8
  import NumberEditor from './NumberEditor';
9
9
  const useStyles = makeStyles()(theme => ({
10
10
  card: {
@@ -14,33 +14,22 @@ const useStyles = makeStyles()(theme => ({
14
14
  const NumberMapEditor = observer(function ({ slot, }) {
15
15
  const { classes } = useStyles();
16
16
  const [value, setValue] = useState('');
17
- return (React.createElement(React.Fragment, null,
18
- React.createElement(InputLabel, null, slot.name),
19
- [...slot.value].map(([key, val]) => (React.createElement(Card, { raised: true, key: key, className: classes.card },
20
- React.createElement(CardHeader, { title: key, action: React.createElement(IconButton, { onClick: () => {
21
- slot.remove(key);
22
- } },
23
- React.createElement(DeleteIcon, null)) }),
24
- React.createElement(CardContent, null,
25
- React.createElement(NumberEditor, { slot: {
26
- value: val,
27
- set: (val) => {
28
- slot.add(key, val);
29
- },
30
- } }))))),
31
- React.createElement(Card, { raised: true, className: classes.card },
32
- React.createElement(CardHeader, { disableTypography: true, title: React.createElement(TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => {
33
- setValue(event.target.value);
34
- }, slotProps: {
35
- input: {
36
- endAdornment: (React.createElement(InputAdornment, { position: "end" },
37
- React.createElement(IconButton, { disabled: value === '', onClick: () => {
38
- slot.add(value, 0);
39
- setValue('');
40
- } },
41
- React.createElement(AddIcon, null)))),
42
- },
43
- } }) })),
44
- React.createElement(FormHelperText, null, slot.description)));
17
+ return (_jsxs(_Fragment, { children: [_jsx(InputLabel, { children: slot.name }), [...slot.value].map(([key, val]) => (_jsxs(Card, { raised: true, className: classes.card, children: [_jsx(CardHeader, { title: key, action: _jsx(IconButton, { onClick: () => {
18
+ slot.remove(key);
19
+ }, children: _jsx(DeleteIcon, {}) }) }), _jsx(CardContent, { children: _jsx(NumberEditor, { slot: {
20
+ value: val,
21
+ set: (val) => {
22
+ slot.add(key, val);
23
+ },
24
+ } }) })] }, key))), _jsx(Card, { raised: true, className: classes.card, children: _jsx(CardHeader, { disableTypography: true, title: _jsx(TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => {
25
+ setValue(event.target.value);
26
+ }, slotProps: {
27
+ input: {
28
+ endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { disabled: value === '', onClick: () => {
29
+ slot.add(value, 0);
30
+ setValue('');
31
+ }, children: _jsx(AddIcon, {}) }) })),
32
+ },
33
+ } }) }) }), _jsx(FormHelperText, { children: slot.description })] }));
45
34
  });
46
35
  export default NumberMapEditor;
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
- import { IAnyType } from 'mobx-state-tree';
1
+ import type { IAnyType } from 'mobx-state-tree';
3
2
  declare const SlotEditor: ({ slot, slotSchema, }: {
4
3
  slot: any;
5
4
  slotSchema: IAnyType;
6
- }) => React.JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
7
6
  export default SlotEditor;
@@ -1,36 +1,33 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { observer } from 'mobx-react';
3
- import { getPropertyMembers } from 'mobx-state-tree';
4
- import { getEnv } from '@jbrowse/core/util';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
5
3
  import { FileSelector } from '@jbrowse/core/ui';
6
- import { getSubType, getUnionSubTypes, } from '@jbrowse/core/util/mst-reflection';
7
- import { IconButton, MenuItem, Paper, SvgIcon, TextField } from '@mui/material';
8
- // icons
4
+ import { getEnv } from '@jbrowse/core/util';
5
+ import { getSubType, getUnionSubTypes } from '@jbrowse/core/util/mst-reflection';
9
6
  import RadioButtonUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked';
10
- // locals
11
- import StringArrayEditor from './StringArrayEditor';
7
+ import { IconButton, MenuItem, Paper, SvgIcon, TextField } from '@mui/material';
8
+ import { observer } from 'mobx-react';
9
+ import { getPropertyMembers } from 'mobx-state-tree';
10
+ import BooleanEditor from './BooleanEditor';
12
11
  import CallbackEditor from './CallbackEditor';
13
12
  import ColorEditor from './ColorEditor';
14
- import JsonEditor from './JsonEditor';
15
- import StringArrayMapEditor from './StringArrayMapEditor';
16
13
  import ConfigurationTextField from './ConfigurationTextField';
17
- import NumberMapEditor from './NumberMapEditor';
14
+ import JsonEditor from './JsonEditor';
18
15
  import NumberEditor from './NumberEditor';
19
- import BooleanEditor from './BooleanEditor';
16
+ import NumberMapEditor from './NumberMapEditor';
17
+ import StringArrayEditor from './StringArrayEditor';
18
+ import StringArrayMapEditor from './StringArrayMapEditor';
20
19
  import { useSlotEditorStyles } from './useSlotEditorStyles';
21
20
  const StringEditor = observer(function ({ slot, }) {
22
- return (React.createElement(ConfigurationTextField, { label: slot.name, helperText: slot.description, value: slot.value, onChange: evt => {
21
+ return (_jsx(ConfigurationTextField, { label: slot.name, helperText: slot.description, value: slot.value, onChange: evt => {
23
22
  slot.set(evt.target.value);
24
23
  } }));
25
24
  });
26
25
  const TextEditor = observer(function ({ slot, }) {
27
- return (React.createElement(TextField, { label: slot.name, helperText: slot.description, multiline: true, value: slot.value, onChange: evt => {
26
+ return (_jsx(TextField, { label: slot.name, helperText: slot.description, multiline: true, value: slot.value, onChange: evt => {
28
27
  slot.set(evt.target.value);
29
28
  } }));
30
29
  });
31
- // checked checkbox, looks like a styled (x)
32
- const SvgCheckbox = () => (React.createElement(SvgIcon, null,
33
- 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" })));
30
+ const SvgCheckbox = () => (_jsx(SvgIcon, { children: _jsx("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" }) }));
34
31
  const IntegerEditor = observer(function ({ slot, }) {
35
32
  const [val, setVal] = useState(slot.value);
36
33
  useEffect(() => {
@@ -39,24 +36,22 @@ const IntegerEditor = observer(function ({ slot, }) {
39
36
  slot.set(num);
40
37
  }
41
38
  }, [slot, val]);
42
- return (React.createElement(ConfigurationTextField, { label: slot.name, helperText: slot.description, value: val, type: "number", onChange: evt => {
39
+ return (_jsx(ConfigurationTextField, { label: slot.name, helperText: slot.description, value: val, type: "number", onChange: evt => {
43
40
  setVal(evt.target.value);
44
41
  } }));
45
42
  });
46
43
  const StringEnumEditor = observer(function ({ slot, slotSchema, }) {
47
44
  const p = getPropertyMembers(getSubType(slotSchema));
48
45
  const choices = getUnionSubTypes(getUnionSubTypes(getSubType(p.properties.value))[1]).map(t => t.value);
49
- return (React.createElement(ConfigurationTextField, { value: slot.value, label: slot.name, select: true, helperText: slot.description, onChange: evt => {
46
+ return (_jsx(ConfigurationTextField, { value: slot.value, label: slot.name, select: true, helperText: slot.description, onChange: evt => {
50
47
  slot.set(evt.target.value);
51
- } }, choices.map(str => (React.createElement(MenuItem, { key: str, value: str }, str)))));
48
+ }, children: choices.map(str => (_jsx(MenuItem, { value: str, children: str }, str))) }));
52
49
  });
53
50
  const FileSelectorWrapper = observer(function ({ slot, }) {
54
51
  var _a;
55
- return (React.createElement(FileSelector, { location: slot.value, setLocation: location => {
52
+ return (_jsx(FileSelector, { location: slot.value, setLocation: location => {
56
53
  slot.set(location);
57
- }, name: slot.name, description: slot.description,
58
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
59
- rootModel: (_a = getEnv(slot).pluginManager) === null || _a === void 0 ? void 0 : _a.rootModel }));
54
+ }, name: slot.name, description: slot.description, rootModel: (_a = getEnv(slot).pluginManager) === null || _a === void 0 ? void 0 : _a.rootModel }));
60
55
  });
61
56
  const valueComponents = {
62
57
  string: StringEditor,
@@ -78,7 +73,7 @@ const SlotEditor = observer(function ({ slot, slotSchema, }) {
78
73
  const { type } = slot;
79
74
  let ValueComponent = slot.isCallback
80
75
  ? CallbackEditor
81
- : // @ts-expect-error
76
+ :
82
77
  valueComponents[type];
83
78
  if (!ValueComponent) {
84
79
  console.warn(`no slot editor defined for ${type}, editing as string`);
@@ -87,9 +82,6 @@ const SlotEditor = observer(function ({ slot, slotSchema, }) {
87
82
  if (!(type in valueComponents)) {
88
83
  console.warn(`SlotEditor needs to implement ${type}`);
89
84
  }
90
- return (React.createElement(Paper, { className: classes.paper },
91
- React.createElement("div", { className: classes.paperContent },
92
- React.createElement(ValueComponent, { slot: slot, slotSchema: slotSchema })),
93
- React.createElement("div", { className: classes.slotModeSwitch }, slot.contextVariable.length ? (React.createElement(IconButton, { onClick: () => slot.isCallback ? slot.convertToValue() : slot.convertToCallback(), title: `convert to ${slot.isCallback ? 'regular value' : 'callback'}` }, slot.isCallback ? React.createElement(SvgCheckbox, null) : React.createElement(RadioButtonUncheckedIcon, null))) : null)));
85
+ return (_jsxs(Paper, { className: classes.paper, children: [_jsx("div", { className: classes.paperContent, children: _jsx(ValueComponent, { slot: slot, slotSchema: slotSchema }) }), _jsx("div", { className: classes.slotModeSwitch, children: slot.contextVariable.length ? (_jsx(IconButton, { onClick: () => slot.isCallback ? slot.convertToValue() : slot.convertToCallback(), title: `convert to ${slot.isCallback ? 'regular value' : 'callback'}`, children: slot.isCallback ? _jsx(SvgCheckbox, {}) : _jsx(RadioButtonUncheckedIcon, {}) })) : null })] }));
94
86
  });
95
87
  export default SlotEditor;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  declare const StringArrayEditor: ({ slot, }: {
3
2
  slot: {
4
3
  name: string;
@@ -8,5 +7,5 @@ declare const StringArrayEditor: ({ slot, }: {
8
7
  add: (arg: string) => void;
9
8
  description: string;
10
9
  };
11
- }) => React.JSX.Element;
10
+ }) => import("react/jsx-runtime").JSX.Element;
12
11
  export default StringArrayEditor;