@jbrowse/plugin-config 1.7.9 → 2.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.
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.d.ts +10 -7
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js +108 -115
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/CodeEditor.d.ts +4 -3
- package/dist/ConfigurationEditorWidget/components/CodeEditor.js +78 -73
- package/dist/ConfigurationEditorWidget/components/CodeEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/ColorEditor.d.ts +9 -33
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js +82 -116
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/ColorPicker.d.ts +0 -7
- package/dist/ConfigurationEditorWidget/components/ColorPicker.js +64 -67
- package/dist/ConfigurationEditorWidget/components/ColorPicker.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +7 -3
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +113 -160
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js +74 -75
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/SlotEditor.d.ts +11 -1
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js +228 -423
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +12 -0
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +81 -0
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/TypeSelector.d.ts +8 -6
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js +16 -46
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js.map +1 -0
- package/dist/ConfigurationEditorWidget/index.js +25 -42
- package/dist/ConfigurationEditorWidget/index.js.map +1 -0
- package/dist/ConfigurationEditorWidget/model.js +18 -26
- package/dist/ConfigurationEditorWidget/model.js.map +1 -0
- package/dist/FromConfigAdapter/FromConfigAdapter.js +172 -204
- package/dist/FromConfigAdapter/FromConfigAdapter.js.map +1 -0
- package/dist/FromConfigAdapter/FromConfigRegionsAdapter.js +151 -142
- package/dist/FromConfigAdapter/FromConfigRegionsAdapter.js.map +1 -0
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.js +182 -181
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.js.map +1 -0
- package/dist/FromConfigAdapter/configSchema.js +33 -49
- package/dist/FromConfigAdapter/configSchema.js.map +1 -0
- package/dist/FromConfigAdapter/index.js +16 -50
- package/dist/FromConfigAdapter/index.js.map +1 -0
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js +111 -123
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js.map +1 -0
- package/dist/RefNameAliasAdapter/configSchema.js +16 -25
- package/dist/RefNameAliasAdapter/configSchema.js.map +1 -0
- package/dist/RefNameAliasAdapter/index.js +10 -22
- package/dist/RefNameAliasAdapter/index.js.map +1 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.js +129 -144
- package/dist/index.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.d.ts +12 -0
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +71 -0
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/CodeEditor.d.ts +5 -0
- package/esm/ConfigurationEditorWidget/components/CodeEditor.js +42 -0
- package/esm/ConfigurationEditorWidget/components/CodeEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/ColorEditor.d.ts +20 -0
- package/esm/ConfigurationEditorWidget/components/ColorEditor.js +37 -0
- package/esm/ConfigurationEditorWidget/components/ColorEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/ColorPicker.d.ts +7 -0
- package/esm/ConfigurationEditorWidget/components/ColorPicker.js +26 -0
- package/esm/ConfigurationEditorWidget/components/ColorPicker.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +8 -0
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +83 -0
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/JsonEditor.d.ts +9 -0
- package/esm/ConfigurationEditorWidget/components/JsonEditor.js +39 -0
- package/esm/ConfigurationEditorWidget/components/JsonEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +16 -0
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js +176 -0
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +12 -0
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +36 -0
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/TypeSelector.d.ts +9 -0
- package/esm/ConfigurationEditorWidget/components/TypeSelector.js +12 -0
- package/esm/ConfigurationEditorWidget/components/TypeSelector.js.map +1 -0
- package/esm/ConfigurationEditorWidget/index.d.ts +3 -0
- package/esm/ConfigurationEditorWidget/index.js +20 -0
- package/esm/ConfigurationEditorWidget/index.js.map +1 -0
- package/esm/ConfigurationEditorWidget/model.d.ts +8 -0
- package/esm/ConfigurationEditorWidget/model.js +16 -0
- package/esm/ConfigurationEditorWidget/model.js.map +1 -0
- package/esm/FromConfigAdapter/FromConfigAdapter.d.ts +24 -0
- package/esm/FromConfigAdapter/FromConfigAdapter.js +63 -0
- package/esm/FromConfigAdapter/FromConfigAdapter.js.map +1 -0
- package/esm/FromConfigAdapter/FromConfigRegionsAdapter.d.ts +23 -0
- package/esm/FromConfigAdapter/FromConfigRegionsAdapter.js +50 -0
- package/esm/FromConfigAdapter/FromConfigRegionsAdapter.js.map +1 -0
- package/esm/FromConfigAdapter/FromConfigSequenceAdapter.d.ts +25 -0
- package/esm/FromConfigAdapter/FromConfigSequenceAdapter.js +73 -0
- package/esm/FromConfigAdapter/FromConfigSequenceAdapter.js.map +1 -0
- package/esm/FromConfigAdapter/configSchema.d.ts +3 -0
- package/esm/FromConfigAdapter/configSchema.js +32 -0
- package/esm/FromConfigAdapter/configSchema.js.map +1 -0
- package/esm/FromConfigAdapter/index.d.ts +4 -0
- package/esm/FromConfigAdapter/index.js +5 -0
- package/esm/FromConfigAdapter/index.js.map +1 -0
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +8 -0
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js +24 -0
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js.map +1 -0
- package/esm/RefNameAliasAdapter/configSchema.d.ts +2 -0
- package/esm/RefNameAliasAdapter/configSchema.js +15 -0
- package/esm/RefNameAliasAdapter/configSchema.js.map +1 -0
- package/esm/RefNameAliasAdapter/index.d.ts +2 -0
- package/esm/RefNameAliasAdapter/index.js +3 -0
- package/esm/RefNameAliasAdapter/index.js.map +1 -0
- package/esm/index.d.ts +18 -0
- package/esm/index.js +72 -0
- package/esm/index.js.map +1 -0
- package/package.json +20 -13
- package/src/ConfigurationEditorWidget/components/{CallbackEditor.js → CallbackEditor.tsx} +36 -21
- package/src/ConfigurationEditorWidget/components/CodeEditor.tsx +59 -0
- package/src/ConfigurationEditorWidget/components/ColorEditor.tsx +8 -33
- package/src/ConfigurationEditorWidget/components/ColorPicker.tsx +4 -13
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.tsx +169 -0
- package/src/ConfigurationEditorWidget/components/JsonEditor.js +4 -8
- package/src/ConfigurationEditorWidget/components/SlotEditor.js +11 -69
- package/src/ConfigurationEditorWidget/components/StringArrayEditor.tsx +115 -0
- package/src/ConfigurationEditorWidget/components/{TypeSelector.js → TypeSelector.tsx} +15 -7
- package/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.js.snap +883 -691
- package/src/ConfigurationEditorWidget/index.js +2 -2
- package/src/RefNameAliasAdapter/RefNameAliasAdapter.ts +1 -1
- package/src/index.ts +20 -14
- package/dist/ConfigurationEditorWidget/components/ColorEditor.test.js +0 -31
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.test.js +0 -121
- package/dist/FromConfigAdapter/FromConfigAdapter.test.js +0 -100
- package/dist/FromConfigAdapter/FromConfigRegionsAdapter.test.js +0 -200
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.test.js +0 -110
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.test.js +0 -41
- package/dist/index.test.js +0 -41
- package/src/ConfigurationEditorWidget/components/CodeEditor.js +0 -60
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.js +0 -154
package/esm/index.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
3
|
+
import WidgetType from '@jbrowse/core/pluggableElementTypes/WidgetType';
|
|
4
|
+
import Plugin from '@jbrowse/core/Plugin';
|
|
5
|
+
import { configSchema as ConfigurationEditorConfigSchema, HeadingComponent as ConfigurationEditorHeadingComponent, stateModelFactory as ConfigurationEditorStateModelFactory, } from './ConfigurationEditorWidget';
|
|
6
|
+
import { configSchema as fromConfigAdapterConfigSchema, regionsConfigSchema as fromConfigRegionsAdapterConfigSchema, sequenceConfigSchema as fromConfigSequenceAdapterConfigSchema, } from './FromConfigAdapter';
|
|
7
|
+
import { configSchema as refNameAliasAdapterConfigSchema } from './RefNameAliasAdapter';
|
|
8
|
+
const LazyConfigurationEditorComponent = lazy(() => import('./ConfigurationEditorWidget/components/ConfigurationEditor'));
|
|
9
|
+
export default class extends Plugin {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.name = 'ConfigurationPlugin';
|
|
13
|
+
}
|
|
14
|
+
install(pluginManager) {
|
|
15
|
+
pluginManager.addAdapterType(() => new AdapterType({
|
|
16
|
+
name: 'FromConfigAdapter',
|
|
17
|
+
configSchema: fromConfigAdapterConfigSchema,
|
|
18
|
+
getAdapterClass: () => import('./FromConfigAdapter/FromConfigAdapter').then(r => r.default),
|
|
19
|
+
adapterMetadata: {
|
|
20
|
+
category: null,
|
|
21
|
+
hiddenFromGUI: true,
|
|
22
|
+
displayName: null,
|
|
23
|
+
description: null,
|
|
24
|
+
},
|
|
25
|
+
}));
|
|
26
|
+
pluginManager.addAdapterType(() => new AdapterType({
|
|
27
|
+
name: 'FromConfigRegionsAdapter',
|
|
28
|
+
configSchema: fromConfigRegionsAdapterConfigSchema,
|
|
29
|
+
getAdapterClass: () => import('./FromConfigAdapter/FromConfigRegionsAdapter').then(r => r.default),
|
|
30
|
+
adapterMetadata: {
|
|
31
|
+
category: null,
|
|
32
|
+
hiddenFromGUI: true,
|
|
33
|
+
displayName: null,
|
|
34
|
+
description: null,
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
37
|
+
pluginManager.addAdapterType(() => new AdapterType({
|
|
38
|
+
name: 'FromConfigSequenceAdapter',
|
|
39
|
+
configSchema: fromConfigSequenceAdapterConfigSchema,
|
|
40
|
+
getAdapterClass: () => import('./FromConfigAdapter/FromConfigSequenceAdapter').then(r => r.default),
|
|
41
|
+
adapterMetadata: {
|
|
42
|
+
category: null,
|
|
43
|
+
hiddenFromGUI: true,
|
|
44
|
+
displayName: null,
|
|
45
|
+
description: null,
|
|
46
|
+
},
|
|
47
|
+
}));
|
|
48
|
+
pluginManager.addAdapterType(() => new AdapterType({
|
|
49
|
+
name: 'RefNameAliasAdapter',
|
|
50
|
+
configSchema: refNameAliasAdapterConfigSchema,
|
|
51
|
+
getAdapterClass: () => import('./RefNameAliasAdapter/RefNameAliasAdapter').then(r => r.default),
|
|
52
|
+
adapterMetadata: {
|
|
53
|
+
category: null,
|
|
54
|
+
hiddenFromGUI: true,
|
|
55
|
+
displayName: null,
|
|
56
|
+
description: null,
|
|
57
|
+
},
|
|
58
|
+
}));
|
|
59
|
+
pluginManager.addWidgetType(() => {
|
|
60
|
+
return new WidgetType({
|
|
61
|
+
name: 'ConfigurationEditorWidget',
|
|
62
|
+
HeadingComponent: ConfigurationEditorHeadingComponent,
|
|
63
|
+
configSchema: ConfigurationEditorConfigSchema,
|
|
64
|
+
stateModel: ConfigurationEditorStateModelFactory(pluginManager),
|
|
65
|
+
ReactComponent: LazyConfigurationEditorComponent,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export { default as JsonEditor } from './ConfigurationEditorWidget/components/JsonEditor';
|
|
71
|
+
export { LazyConfigurationEditorComponent as ConfigurationEditor };
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "JBrowse 2 config utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -20,38 +20,45 @@
|
|
|
20
20
|
"main": "dist/index.js",
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
|
-
"src"
|
|
23
|
+
"src",
|
|
24
|
+
"esm"
|
|
24
25
|
],
|
|
25
26
|
"scripts": {
|
|
26
|
-
"build": "
|
|
27
|
+
"build": "npm-run-all build:*",
|
|
27
28
|
"test": "cd ../..; jest plugins/config",
|
|
28
29
|
"prepublishOnly": "yarn test",
|
|
29
30
|
"prepack": "yarn build; yarn useDist",
|
|
30
31
|
"postpack": "yarn useSrc",
|
|
31
32
|
"useDist": "node ../../scripts/useDist.js",
|
|
32
33
|
"useSrc": "node ../../scripts/useSrc.js",
|
|
33
|
-
"
|
|
34
|
+
"prebuild": "npm run clean",
|
|
35
|
+
"build:esm": "tsc --build tsconfig.build.esm.json",
|
|
36
|
+
"build:es5": "tsc --build tsconfig.build.es5.json",
|
|
37
|
+
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
34
38
|
},
|
|
35
39
|
"dependencies": {
|
|
36
40
|
"@babel/runtime": "^7.17.9",
|
|
37
|
-
"@
|
|
41
|
+
"@mui/icons-material": "^5.0.1",
|
|
38
42
|
"pluralize": "^8.0.0",
|
|
39
|
-
"react-color": "^2.19.3"
|
|
40
|
-
"react-simple-code-editor": "0.9.3",
|
|
41
|
-
"react-syntax-highlighter": "^14.0.0"
|
|
43
|
+
"react-color": "^2.19.3"
|
|
42
44
|
},
|
|
43
45
|
"peerDependencies": {
|
|
44
46
|
"@jbrowse/core": "^1.0.0",
|
|
45
|
-
"@material
|
|
46
|
-
"mobx
|
|
47
|
-
"mobx-
|
|
47
|
+
"@mui/material": "^5.0.0",
|
|
48
|
+
"mobx": "^6.0.0",
|
|
49
|
+
"mobx-react": "^7.0.0",
|
|
50
|
+
"mobx-state-tree": "^5.0.0",
|
|
48
51
|
"prop-types": "^15.0.0",
|
|
49
52
|
"react": ">=16.8.0",
|
|
50
53
|
"react-dom": ">=16.8.0",
|
|
51
|
-
"rxjs": "^6.0.0"
|
|
54
|
+
"rxjs": "^6.0.0",
|
|
55
|
+
"tss-react": "^3.0.0"
|
|
52
56
|
},
|
|
53
57
|
"publishConfig": {
|
|
54
58
|
"access": "public"
|
|
55
59
|
},
|
|
56
|
-
"
|
|
60
|
+
"distModule": "esm/index.js",
|
|
61
|
+
"srcModule": "src/index.ts",
|
|
62
|
+
"module": "esm/index.js",
|
|
63
|
+
"gitHead": "ecc7f5d47351a5ea04bc00f3a6eb6dfb607342e6"
|
|
57
64
|
}
|
|
@@ -7,35 +7,44 @@ import {
|
|
|
7
7
|
InputLabel,
|
|
8
8
|
Tooltip,
|
|
9
9
|
IconButton,
|
|
10
|
-
|
|
11
|
-
} from '@material
|
|
12
|
-
import
|
|
10
|
+
TextField,
|
|
11
|
+
} from '@mui/material'
|
|
12
|
+
import { makeStyles } from 'tss-react/mui'
|
|
13
|
+
import HelpIcon from '@mui/icons-material/Help'
|
|
13
14
|
import { getEnv } from 'mobx-state-tree'
|
|
14
|
-
import { observer
|
|
15
|
-
import Editor from 'react-simple-code-editor'
|
|
16
|
-
|
|
17
|
-
// fontSize and fontFamily have to match between Editor and SyntaxHighlighter
|
|
18
|
-
const fontSize = '12px'
|
|
15
|
+
import { observer } from 'mobx-react'
|
|
19
16
|
|
|
20
17
|
// Optimize by using system default fonts:
|
|
21
18
|
// https://css-tricks.com/snippets/css/font-stacks/
|
|
22
19
|
const fontFamily =
|
|
23
20
|
'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'
|
|
24
21
|
|
|
25
|
-
const useStyles = makeStyles(theme => ({
|
|
22
|
+
const useStyles = makeStyles()(theme => ({
|
|
26
23
|
callbackEditor: {
|
|
27
24
|
marginTop: '16px',
|
|
28
25
|
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
29
26
|
fontFamily,
|
|
30
|
-
|
|
27
|
+
},
|
|
28
|
+
textAreaFont: {
|
|
29
|
+
fontFamily,
|
|
31
30
|
},
|
|
32
31
|
}))
|
|
33
32
|
|
|
34
|
-
function CallbackEditor({
|
|
35
|
-
|
|
33
|
+
function CallbackEditor({
|
|
34
|
+
slot,
|
|
35
|
+
}: {
|
|
36
|
+
slot: {
|
|
37
|
+
set: (arg: string) => void
|
|
38
|
+
description: string
|
|
39
|
+
name: string
|
|
40
|
+
value: string
|
|
41
|
+
contextVariable: string
|
|
42
|
+
}
|
|
43
|
+
}) {
|
|
44
|
+
const { classes } = useStyles()
|
|
36
45
|
|
|
37
46
|
const [code, setCode] = useState(slot.value)
|
|
38
|
-
const [error, setCodeError] = useState()
|
|
47
|
+
const [error, setCodeError] = useState<unknown>()
|
|
39
48
|
const debouncedCode = useDebounce(code, 400)
|
|
40
49
|
|
|
41
50
|
useEffect(() => {
|
|
@@ -43,12 +52,16 @@ function CallbackEditor({ slot }) {
|
|
|
43
52
|
const jexlDebouncedCode = debouncedCode.startsWith('jexl:')
|
|
44
53
|
? debouncedCode
|
|
45
54
|
: `jexl:${debouncedCode}`
|
|
55
|
+
|
|
56
|
+
if (jexlDebouncedCode === 'jexl:') {
|
|
57
|
+
throw new Error('Empty jexl expression is not valid')
|
|
58
|
+
}
|
|
46
59
|
stringToJexlExpression(
|
|
47
60
|
jexlDebouncedCode,
|
|
48
61
|
getEnv(slot).pluginManager?.jexl,
|
|
49
62
|
)
|
|
50
63
|
slot.set(jexlDebouncedCode)
|
|
51
|
-
setCodeError(
|
|
64
|
+
setCodeError(undefined)
|
|
52
65
|
} catch (e) {
|
|
53
66
|
console.error({ e })
|
|
54
67
|
setCodeError(e)
|
|
@@ -63,13 +76,17 @@ function CallbackEditor({ slot }) {
|
|
|
63
76
|
<InputLabel shrink htmlFor="callback-editor">
|
|
64
77
|
{slot.name}
|
|
65
78
|
</InputLabel>
|
|
66
|
-
<
|
|
79
|
+
<TextField
|
|
80
|
+
multiline
|
|
67
81
|
className={classes.callbackEditor}
|
|
68
82
|
value={code.startsWith('jexl:') ? code.split('jexl:')[1] : code}
|
|
69
|
-
|
|
70
|
-
highlight={newCode => newCode}
|
|
71
|
-
padding={10}
|
|
83
|
+
onChange={event => setCode(event.target.value)}
|
|
72
84
|
style={{ background: error ? '#fdd' : undefined }}
|
|
85
|
+
InputProps={{
|
|
86
|
+
classes: {
|
|
87
|
+
input: classes.textAreaFont,
|
|
88
|
+
},
|
|
89
|
+
}}
|
|
73
90
|
/>
|
|
74
91
|
{error ? (
|
|
75
92
|
<FormHelperText
|
|
@@ -106,7 +123,5 @@ function CallbackEditor({ slot }) {
|
|
|
106
123
|
</>
|
|
107
124
|
)
|
|
108
125
|
}
|
|
109
|
-
|
|
110
|
-
slot: PropTypes.objectOrObservableObject.isRequired,
|
|
111
|
-
}
|
|
126
|
+
|
|
112
127
|
export default observer(CallbackEditor)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { TextField } from '@mui/material'
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
4
|
+
|
|
5
|
+
// fontSize and fontFamily have to match between Editor and SyntaxHighlighter
|
|
6
|
+
const fontSize = '12px'
|
|
7
|
+
// Optimize by using system default fonts: https://css-tricks.com/snippets/css/font-stacks/
|
|
8
|
+
const fontFamily =
|
|
9
|
+
'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'
|
|
10
|
+
|
|
11
|
+
const useStyles = makeStyles()(theme => ({
|
|
12
|
+
callbackEditor: {
|
|
13
|
+
fontFamily,
|
|
14
|
+
fontSize,
|
|
15
|
+
background: theme.palette.background.default,
|
|
16
|
+
overflowX: 'auto',
|
|
17
|
+
marginTop: '16px',
|
|
18
|
+
border: '1px solid rgba(0,0,0,0.42)',
|
|
19
|
+
},
|
|
20
|
+
textAreaFont: {
|
|
21
|
+
fontFamily,
|
|
22
|
+
},
|
|
23
|
+
}))
|
|
24
|
+
|
|
25
|
+
export default function CodeEditor({
|
|
26
|
+
contents,
|
|
27
|
+
setContents,
|
|
28
|
+
}: {
|
|
29
|
+
contents: string
|
|
30
|
+
setContents: (arg: string) => void
|
|
31
|
+
}) {
|
|
32
|
+
const { classes } = useStyles()
|
|
33
|
+
const [error, setCodeError] = useState<unknown>()
|
|
34
|
+
const [val, setVal] = useState(contents)
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
try {
|
|
37
|
+
JSON.parse(contents)
|
|
38
|
+
setCodeError(undefined)
|
|
39
|
+
setContents(val)
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.error({ e })
|
|
42
|
+
setCodeError(e)
|
|
43
|
+
}
|
|
44
|
+
}, [val, contents, setContents])
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<TextField
|
|
48
|
+
className={classes.callbackEditor}
|
|
49
|
+
value={contents}
|
|
50
|
+
onChange={event => setVal(event.target.value)}
|
|
51
|
+
style={{ background: error ? '#fdd' : undefined }}
|
|
52
|
+
InputProps={{
|
|
53
|
+
classes: {
|
|
54
|
+
input: classes.textAreaFont,
|
|
55
|
+
},
|
|
56
|
+
}}
|
|
57
|
+
/>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { lazy, useState } from 'react'
|
|
2
2
|
import { observer } from 'mobx-react'
|
|
3
|
-
import
|
|
4
|
-
import TextField from '@material-ui/core/TextField'
|
|
3
|
+
import { TextField } from '@mui/material'
|
|
5
4
|
import { Color, RGBColor } from 'react-color'
|
|
6
5
|
|
|
7
6
|
const ColorPicker = lazy(() => import('./ColorPicker'))
|
|
@@ -18,14 +17,14 @@ function serializeColor(color: Color) {
|
|
|
18
17
|
|
|
19
18
|
export const ColorSlot = (props: {
|
|
20
19
|
value: string
|
|
21
|
-
label
|
|
22
|
-
TextFieldProps
|
|
20
|
+
label?: string
|
|
21
|
+
TextFieldProps?: {
|
|
23
22
|
helperText: string
|
|
24
23
|
fullWidth: boolean
|
|
25
24
|
}
|
|
26
25
|
onChange: (arg: string) => void
|
|
27
26
|
}) => {
|
|
28
|
-
const { value, label, TextFieldProps, onChange } = props
|
|
27
|
+
const { value = '#000', label = '', TextFieldProps = {}, onChange } = props
|
|
29
28
|
const [displayed, setDisplayed] = useState(false)
|
|
30
29
|
|
|
31
30
|
return (
|
|
@@ -42,35 +41,20 @@ export const ColorSlot = (props: {
|
|
|
42
41
|
},
|
|
43
42
|
}}
|
|
44
43
|
onClick={() => setDisplayed(!displayed)}
|
|
45
|
-
onChange={event =>
|
|
46
|
-
onChange(event.target.value)
|
|
47
|
-
}}
|
|
44
|
+
onChange={event => onChange(event.target.value)}
|
|
48
45
|
{...TextFieldProps}
|
|
49
46
|
/>
|
|
50
47
|
{displayed ? (
|
|
51
48
|
<React.Suspense fallback={<div />}>
|
|
52
49
|
<ColorPicker
|
|
53
50
|
color={value}
|
|
54
|
-
onChange={event =>
|
|
55
|
-
onChange(serializeColor(event.rgb))
|
|
56
|
-
}}
|
|
51
|
+
onChange={event => onChange(serializeColor(event.rgb))}
|
|
57
52
|
/>
|
|
58
53
|
</React.Suspense>
|
|
59
54
|
) : null}
|
|
60
55
|
</>
|
|
61
56
|
)
|
|
62
57
|
}
|
|
63
|
-
ColorSlot.propTypes = {
|
|
64
|
-
onChange: ReactPropTypes.func.isRequired,
|
|
65
|
-
label: ReactPropTypes.string,
|
|
66
|
-
TextFieldProps: ReactPropTypes.shape({}),
|
|
67
|
-
value: ReactPropTypes.string,
|
|
68
|
-
}
|
|
69
|
-
ColorSlot.defaultProps = {
|
|
70
|
-
label: '',
|
|
71
|
-
value: '#000',
|
|
72
|
-
TextFieldProps: {},
|
|
73
|
-
}
|
|
74
58
|
|
|
75
59
|
function ColorEditorSlot(props: {
|
|
76
60
|
slot: {
|
|
@@ -85,9 +69,7 @@ function ColorEditorSlot(props: {
|
|
|
85
69
|
<ColorSlot
|
|
86
70
|
label={slot.name}
|
|
87
71
|
value={slot.value}
|
|
88
|
-
onChange={
|
|
89
|
-
slot.set(color)
|
|
90
|
-
}}
|
|
72
|
+
onChange={color => slot.set(color)}
|
|
91
73
|
TextFieldProps={{
|
|
92
74
|
helperText: slot.description,
|
|
93
75
|
fullWidth: true,
|
|
@@ -95,12 +77,5 @@ function ColorEditorSlot(props: {
|
|
|
95
77
|
/>
|
|
96
78
|
)
|
|
97
79
|
}
|
|
98
|
-
|
|
99
|
-
slot: ReactPropTypes.shape({
|
|
100
|
-
name: ReactPropTypes.string.isRequired,
|
|
101
|
-
description: ReactPropTypes.string,
|
|
102
|
-
value: ReactPropTypes.string.isRequired,
|
|
103
|
-
set: ReactPropTypes.func.isRequired,
|
|
104
|
-
}).isRequired,
|
|
105
|
-
}
|
|
80
|
+
|
|
106
81
|
export default observer(ColorEditorSlot)
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { makeStyles } from '
|
|
3
|
-
import ReactPropTypes from 'prop-types'
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
4
3
|
import { ChromePicker, Color, ColorResult } from 'react-color'
|
|
5
4
|
|
|
6
|
-
const useStyles = makeStyles({
|
|
5
|
+
const useStyles = makeStyles()({
|
|
7
6
|
popover: {
|
|
8
7
|
position: 'absolute',
|
|
9
8
|
zIndex: 2,
|
|
@@ -22,12 +21,9 @@ export function ColorPicker(props: {
|
|
|
22
21
|
onChange: (color: ColorResult) => void
|
|
23
22
|
}) {
|
|
24
23
|
const { color, onChange } = props
|
|
25
|
-
const classes = useStyles()
|
|
24
|
+
const { classes } = useStyles()
|
|
26
25
|
const [displayColorPicker, setDisplayColorPicker] = useState(true)
|
|
27
26
|
|
|
28
|
-
const handleClose = () => {
|
|
29
|
-
setDisplayColorPicker(false)
|
|
30
|
-
}
|
|
31
27
|
return (
|
|
32
28
|
<div>
|
|
33
29
|
{displayColorPicker ? (
|
|
@@ -35,7 +31,7 @@ export function ColorPicker(props: {
|
|
|
35
31
|
<div
|
|
36
32
|
role="presentation"
|
|
37
33
|
className={classes.cover}
|
|
38
|
-
onClick={
|
|
34
|
+
onClick={() => setDisplayColorPicker(false)}
|
|
39
35
|
/>
|
|
40
36
|
<ChromePicker color={color} onChange={onChange} />
|
|
41
37
|
</div>
|
|
@@ -44,9 +40,4 @@ export function ColorPicker(props: {
|
|
|
44
40
|
)
|
|
45
41
|
}
|
|
46
42
|
|
|
47
|
-
ColorPicker.propTypes = {
|
|
48
|
-
color: ReactPropTypes.string.isRequired,
|
|
49
|
-
onChange: ReactPropTypes.func.isRequired,
|
|
50
|
-
}
|
|
51
|
-
|
|
52
43
|
export default ColorPicker
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {
|
|
3
|
+
readConfObject,
|
|
4
|
+
getTypeNamesFromExplicitlyTypedUnion,
|
|
5
|
+
isConfigurationSchemaType,
|
|
6
|
+
isConfigurationSlotType,
|
|
7
|
+
AnyConfigurationModel,
|
|
8
|
+
} from '@jbrowse/core/configuration'
|
|
9
|
+
import {
|
|
10
|
+
FormGroup,
|
|
11
|
+
Accordion,
|
|
12
|
+
AccordionDetails,
|
|
13
|
+
AccordionSummary,
|
|
14
|
+
Typography,
|
|
15
|
+
} from '@mui/material'
|
|
16
|
+
import { makeStyles } from 'tss-react/mui'
|
|
17
|
+
import { observer } from 'mobx-react'
|
|
18
|
+
import { getMembers, IAnyType } from 'mobx-state-tree'
|
|
19
|
+
import { singular } from 'pluralize'
|
|
20
|
+
|
|
21
|
+
// icons
|
|
22
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
|
|
23
|
+
|
|
24
|
+
// locals
|
|
25
|
+
import SlotEditor from './SlotEditor'
|
|
26
|
+
import TypeSelector from './TypeSelector'
|
|
27
|
+
|
|
28
|
+
const useStyles = makeStyles()(theme => ({
|
|
29
|
+
expandIcon: {
|
|
30
|
+
color: '#fff',
|
|
31
|
+
},
|
|
32
|
+
root: {
|
|
33
|
+
padding: theme.spacing(1, 3, 1, 1),
|
|
34
|
+
},
|
|
35
|
+
expansionPanelDetails: {
|
|
36
|
+
display: 'block',
|
|
37
|
+
padding: theme.spacing(1),
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
accordion: {
|
|
41
|
+
border: `1px solid ${theme.palette.text.primary}`,
|
|
42
|
+
},
|
|
43
|
+
}))
|
|
44
|
+
|
|
45
|
+
const Member = observer(
|
|
46
|
+
(props: {
|
|
47
|
+
slotName: string
|
|
48
|
+
slotSchema: IAnyType
|
|
49
|
+
schema: AnyConfigurationModel
|
|
50
|
+
slot?: AnyConfigurationModel | AnyConfigurationModel[]
|
|
51
|
+
path?: string[]
|
|
52
|
+
}) => {
|
|
53
|
+
const { classes } = useStyles()
|
|
54
|
+
const {
|
|
55
|
+
slotName,
|
|
56
|
+
slotSchema,
|
|
57
|
+
schema,
|
|
58
|
+
slot = schema[slotName],
|
|
59
|
+
path = [],
|
|
60
|
+
} = props
|
|
61
|
+
let typeSelector
|
|
62
|
+
if (isConfigurationSchemaType(slotSchema)) {
|
|
63
|
+
if (slot.length) {
|
|
64
|
+
return slot.map((subslot: AnyConfigurationModel, slotIndex: number) => {
|
|
65
|
+
const key = `${singular(slotName)} ${slotIndex + 1}`
|
|
66
|
+
return <Member {...props} key={key} slot={subslot} slotName={key} />
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
// if this is an explicitly typed schema, make a type-selecting dropdown
|
|
70
|
+
// that can be used to change its type
|
|
71
|
+
const typeNameChoices = getTypeNamesFromExplicitlyTypedUnion(slotSchema)
|
|
72
|
+
if (typeNameChoices.length) {
|
|
73
|
+
typeSelector = (
|
|
74
|
+
<TypeSelector
|
|
75
|
+
typeNameChoices={typeNameChoices}
|
|
76
|
+
slotName={slotName}
|
|
77
|
+
slot={slot}
|
|
78
|
+
onChange={evt => {
|
|
79
|
+
if (evt.target.value !== slot.type) {
|
|
80
|
+
schema.setSubschema(slotName, { type: evt.target.value })
|
|
81
|
+
}
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
return (
|
|
87
|
+
<Accordion defaultExpanded className={classes.accordion}>
|
|
88
|
+
<AccordionSummary
|
|
89
|
+
expandIcon={<ExpandMoreIcon className={classes.expandIcon} />}
|
|
90
|
+
>
|
|
91
|
+
<Typography>{[...path, slotName].join('🡒')}</Typography>
|
|
92
|
+
</AccordionSummary>
|
|
93
|
+
<AccordionDetails className={classes.expansionPanelDetails}>
|
|
94
|
+
{typeSelector}
|
|
95
|
+
<FormGroup>
|
|
96
|
+
<Schema schema={slot} path={[...path, slotName]} />
|
|
97
|
+
</FormGroup>
|
|
98
|
+
</AccordionDetails>
|
|
99
|
+
</Accordion>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (isConfigurationSlotType(slotSchema)) {
|
|
104
|
+
// this is a regular config slot
|
|
105
|
+
return <SlotEditor key={slotName} slot={slot} slotSchema={slotSchema} />
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return null
|
|
109
|
+
},
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
const Schema = observer(
|
|
113
|
+
({
|
|
114
|
+
schema,
|
|
115
|
+
path = [],
|
|
116
|
+
}: {
|
|
117
|
+
schema: AnyConfigurationModel
|
|
118
|
+
path?: string[]
|
|
119
|
+
}) => {
|
|
120
|
+
const properties = getMembers(schema).properties
|
|
121
|
+
return (
|
|
122
|
+
<>
|
|
123
|
+
{Object.entries(properties).map(([slotName, slotSchema]) => (
|
|
124
|
+
<Member
|
|
125
|
+
key={slotName}
|
|
126
|
+
slotName={slotName}
|
|
127
|
+
slotSchema={slotSchema}
|
|
128
|
+
path={path}
|
|
129
|
+
schema={schema}
|
|
130
|
+
/>
|
|
131
|
+
))}
|
|
132
|
+
</>
|
|
133
|
+
)
|
|
134
|
+
},
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
const ConfigurationEditor = observer(
|
|
138
|
+
({ model }: { model: { target: AnyConfigurationModel } }) => {
|
|
139
|
+
const { classes } = useStyles()
|
|
140
|
+
// key forces a re-render, otherwise the same field can end up being used
|
|
141
|
+
// for different tracks since only the backing model changes for example
|
|
142
|
+
// see pr #804
|
|
143
|
+
const { target } = model
|
|
144
|
+
const key = target && readConfObject(target, 'trackId')
|
|
145
|
+
const name = target && readConfObject(target, 'name')
|
|
146
|
+
return (
|
|
147
|
+
<>
|
|
148
|
+
<Accordion key={key} defaultExpanded className={classes.accordion}>
|
|
149
|
+
<AccordionSummary
|
|
150
|
+
expandIcon={<ExpandMoreIcon className={classes.expandIcon} />}
|
|
151
|
+
>
|
|
152
|
+
<Typography>{name ?? 'Configuration'}</Typography>
|
|
153
|
+
</AccordionSummary>
|
|
154
|
+
<AccordionDetails
|
|
155
|
+
className={classes.expansionPanelDetails}
|
|
156
|
+
data-testid="configEditor"
|
|
157
|
+
>
|
|
158
|
+
{!target ? 'no target set' : <Schema schema={target} />}
|
|
159
|
+
</AccordionDetails>
|
|
160
|
+
</Accordion>
|
|
161
|
+
|
|
162
|
+
{/* blank space at the bottom of screen allows scroll */}
|
|
163
|
+
<div style={{ height: 300 }} />
|
|
164
|
+
</>
|
|
165
|
+
)
|
|
166
|
+
},
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
export default ConfigurationEditor
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import React, { lazy, useEffect, useState } from 'react'
|
|
2
2
|
import { useDebounce } from '@jbrowse/core/util'
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
FormHelperText,
|
|
6
|
-
InputLabel,
|
|
7
|
-
makeStyles,
|
|
8
|
-
} from '@material-ui/core'
|
|
3
|
+
import { FormControl, FormHelperText, InputLabel } from '@mui/material'
|
|
4
|
+
import { makeStyles } from 'tss-react/mui'
|
|
9
5
|
import { observer, PropTypes } from 'mobx-react'
|
|
10
|
-
const useStyles = makeStyles({
|
|
6
|
+
const useStyles = makeStyles()({
|
|
11
7
|
error: {
|
|
12
8
|
color: 'red',
|
|
13
9
|
fontSize: '0.8em',
|
|
@@ -17,7 +13,7 @@ const useStyles = makeStyles({
|
|
|
17
13
|
const CodeEditor = lazy(() => import('./CodeEditor'))
|
|
18
14
|
|
|
19
15
|
function JsonEditor({ slot }) {
|
|
20
|
-
const classes = useStyles()
|
|
16
|
+
const { classes } = useStyles()
|
|
21
17
|
const [contents, setContents] = useState(
|
|
22
18
|
JSON.stringify(slot.value, null, ' '),
|
|
23
19
|
)
|