@jbrowse/plugin-config 3.6.5 → 4.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/esm/ConfigurationEditorWidget/components/BooleanEditor.js +1 -1
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +25 -25
- package/esm/ConfigurationEditorWidget/components/ColorEditor.js +2 -2
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +12 -9
- package/esm/ConfigurationEditorWidget/components/HeadingComponent.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/components/HeadingComponent.js +8 -7
- package/esm/ConfigurationEditorWidget/components/JsonEditor.js +1 -1
- package/esm/ConfigurationEditorWidget/components/NumberEditor.js +3 -4
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js +3 -3
- package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js +18 -19
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +1 -1
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js +3 -3
- package/esm/ConfigurationEditorWidget/components/TypeSelector.js +2 -2
- package/esm/ConfigurationEditorWidget/components/useSlotEditorStyles.d.ts +6 -5
- package/esm/ConfigurationEditorWidget/components/useSlotEditorStyles.js +1 -1
- package/esm/ConfigurationEditorWidget/index.js +3 -3
- package/esm/ConfigurationEditorWidget/model.d.ts +9 -6
- package/esm/ConfigurationEditorWidget/model.js +20 -3
- package/esm/FromConfigAdapter/FromConfigAdapter.js +1 -0
- package/esm/FromConfigAdapter/configSchema.d.ts +2 -2
- package/esm/FromConfigAdapter/index.js +2 -2
- package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +2 -1
- package/esm/FromConfigRegionsAdapter/configSchema.d.ts +2 -2
- package/esm/FromConfigRegionsAdapter/index.js +2 -2
- package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +1 -1
- package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +1 -1
- package/esm/FromConfigSequenceAdapter/configSchema.d.ts +2 -2
- package/esm/FromConfigSequenceAdapter/index.js +2 -2
- package/esm/NcbiSequenceReportAliasAdapter/configSchema.d.ts +2 -2
- package/esm/NcbiSequenceReportAliasAdapter/index.js +2 -2
- package/esm/RefNameAliasAdapter/configSchema.d.ts +2 -2
- package/esm/RefNameAliasAdapter/index.js +2 -2
- package/esm/index.d.ts +1 -1
- package/esm/index.js +8 -11
- package/package.json +25 -31
- package/dist/ConfigurationEditorWidget/components/BooleanEditor.d.ts +0 -9
- package/dist/ConfigurationEditorWidget/components/BooleanEditor.js +0 -11
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.d.ts +0 -10
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js +0 -73
- package/dist/ConfigurationEditorWidget/components/ColorEditor.d.ts +0 -18
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js +0 -33
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +0 -9
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +0 -72
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +0 -4
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.js +0 -14
- package/dist/ConfigurationEditorWidget/components/HeadingComponent.d.ts +0 -8
- package/dist/ConfigurationEditorWidget/components/HeadingComponent.js +0 -20
- package/dist/ConfigurationEditorWidget/components/JsonEditor.d.ts +0 -9
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js +0 -55
- package/dist/ConfigurationEditorWidget/components/NumberEditor.d.ts +0 -10
- package/dist/ConfigurationEditorWidget/components/NumberEditor.js +0 -26
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +0 -10
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.js +0 -40
- package/dist/ConfigurationEditorWidget/components/SlotEditor.d.ts +0 -6
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js +0 -92
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +0 -11
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +0 -39
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +0 -13
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.js +0 -48
- package/dist/ConfigurationEditorWidget/components/TypeSelector.d.ts +0 -8
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js +0 -11
- package/dist/ConfigurationEditorWidget/components/useSlotEditorStyles.d.ts +0 -9
- package/dist/ConfigurationEditorWidget/components/useSlotEditorStyles.js +0 -21
- package/dist/ConfigurationEditorWidget/index.d.ts +0 -2
- package/dist/ConfigurationEditorWidget/index.js +0 -57
- package/dist/ConfigurationEditorWidget/model.d.ts +0 -8
- package/dist/ConfigurationEditorWidget/model.js +0 -18
- package/dist/FromConfigAdapter/FromConfigAdapter.d.ts +0 -17
- package/dist/FromConfigAdapter/FromConfigAdapter.js +0 -56
- package/dist/FromConfigAdapter/configSchema.d.ts +0 -7
- package/dist/FromConfigAdapter/configSchema.js +0 -11
- package/dist/FromConfigAdapter/index.d.ts +0 -2
- package/dist/FromConfigAdapter/index.js +0 -51
- package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.d.ts +0 -14
- package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +0 -41
- package/dist/FromConfigRegionsAdapter/configSchema.d.ts +0 -7
- package/dist/FromConfigRegionsAdapter/configSchema.js +0 -14
- package/dist/FromConfigRegionsAdapter/index.d.ts +0 -2
- package/dist/FromConfigRegionsAdapter/index.js +0 -51
- package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +0 -12
- package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +0 -56
- package/dist/FromConfigSequenceAdapter/configSchema.d.ts +0 -7
- package/dist/FromConfigSequenceAdapter/configSchema.js +0 -14
- package/dist/FromConfigSequenceAdapter/index.d.ts +0 -2
- package/dist/FromConfigSequenceAdapter/index.js +0 -51
- package/dist/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.d.ts +0 -9
- package/dist/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.js +0 -41
- package/dist/NcbiSequenceReportAliasAdapter/configSchema.d.ts +0 -15
- package/dist/NcbiSequenceReportAliasAdapter/configSchema.js +0 -32
- package/dist/NcbiSequenceReportAliasAdapter/index.d.ts +0 -2
- package/dist/NcbiSequenceReportAliasAdapter/index.js +0 -53
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +0 -8
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js +0 -39
- package/dist/RefNameAliasAdapter/configSchema.d.ts +0 -19
- package/dist/RefNameAliasAdapter/configSchema.js +0 -36
- package/dist/RefNameAliasAdapter/index.d.ts +0 -2
- package/dist/RefNameAliasAdapter/index.js +0 -51
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -64
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const RefNameAliasAdapter: import("
|
|
1
|
+
declare const RefNameAliasAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
location: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: {
|
|
@@ -15,5 +15,5 @@ declare const RefNameAliasAdapter: import("@jbrowse/core/configuration/configura
|
|
|
15
15
|
description: string;
|
|
16
16
|
defaultValue: string;
|
|
17
17
|
};
|
|
18
|
-
}, import("
|
|
18
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
19
19
|
export default RefNameAliasAdapter;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AdapterType } from '@jbrowse/core/pluggableElementTypes';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function RefNameAliasAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => new AdapterType({
|
|
5
5
|
name: 'RefNameAliasAdapter',
|
|
6
6
|
configSchema,
|
|
7
|
-
getAdapterClass: () => import(
|
|
7
|
+
getAdapterClass: () => import("./RefNameAliasAdapter.js").then(r => r.default),
|
|
8
8
|
adapterMetadata: {
|
|
9
9
|
hiddenFromGUI: true,
|
|
10
10
|
},
|
package/esm/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import Plugin from '@jbrowse/core/Plugin';
|
|
|
2
2
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
3
|
declare const LazyConfigurationEditorComponent: import("react").LazyExoticComponent<({ model, }: {
|
|
4
4
|
model: {
|
|
5
|
-
target
|
|
5
|
+
target?: import("@jbrowse/core/configuration").AnyConfigurationModel;
|
|
6
6
|
};
|
|
7
7
|
session?: import("@jbrowse/core/util").AbstractSessionModel;
|
|
8
8
|
}) => import("react/jsx-runtime").JSX.Element>;
|
package/esm/index.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
import Plugin from '@jbrowse/core/Plugin';
|
|
3
|
-
import ConfigurationEditorWidgetF from
|
|
4
|
-
import FromConfigAdapterF from
|
|
5
|
-
import FromConfigRegionsAdapterF from
|
|
6
|
-
import FromConfigSequenceAdapterF from
|
|
7
|
-
import NcbiSequenceReportAliasAdapterF from
|
|
8
|
-
import RefNameAliasAdapterF from
|
|
9
|
-
const LazyConfigurationEditorComponent = lazy(() => import(
|
|
3
|
+
import ConfigurationEditorWidgetF from "./ConfigurationEditorWidget/index.js";
|
|
4
|
+
import FromConfigAdapterF from "./FromConfigAdapter/index.js";
|
|
5
|
+
import FromConfigRegionsAdapterF from "./FromConfigRegionsAdapter/index.js";
|
|
6
|
+
import FromConfigSequenceAdapterF from "./FromConfigSequenceAdapter/index.js";
|
|
7
|
+
import NcbiSequenceReportAliasAdapterF from "./NcbiSequenceReportAliasAdapter/index.js";
|
|
8
|
+
import RefNameAliasAdapterF from "./RefNameAliasAdapter/index.js";
|
|
9
|
+
const LazyConfigurationEditorComponent = lazy(() => import("./ConfigurationEditorWidget/components/ConfigurationEditor.js"));
|
|
10
10
|
export default class ConfigurationPlugin extends Plugin {
|
|
11
|
-
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.name = 'ConfigurationPlugin';
|
|
14
|
-
}
|
|
11
|
+
name = 'ConfigurationPlugin';
|
|
15
12
|
install(pluginManager) {
|
|
16
13
|
FromConfigAdapterF(pluginManager);
|
|
17
14
|
FromConfigRegionsAdapterF(pluginManager);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "JBrowse 2 config utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -15,36 +15,19 @@
|
|
|
15
15
|
"directory": "plugins/config"
|
|
16
16
|
},
|
|
17
17
|
"author": "JBrowse Team",
|
|
18
|
-
"
|
|
19
|
-
"srcMain": "src/index.ts",
|
|
20
|
-
"main": "dist/index.js",
|
|
18
|
+
"main": "esm/index.js",
|
|
21
19
|
"files": [
|
|
22
|
-
"dist",
|
|
23
20
|
"esm"
|
|
24
21
|
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "npm-run-all build:*",
|
|
27
|
-
"test": "cd ../..; jest --passWithNoTests plugins/config",
|
|
28
|
-
"prepublishOnly": "yarn test",
|
|
29
|
-
"prepack": "yarn build && yarn useDist",
|
|
30
|
-
"postpack": "yarn useSrc",
|
|
31
|
-
"useDist": "node ../../scripts/useDist.js",
|
|
32
|
-
"useSrc": "node ../../scripts/useSrc.js",
|
|
33
|
-
"prebuild": "npm run clean",
|
|
34
|
-
"build:esm": "tsc --build tsconfig.build.esm.json",
|
|
35
|
-
"build:commonjs": "tsc --build tsconfig.build.commonjs.json",
|
|
36
|
-
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
|
-
},
|
|
38
22
|
"dependencies": {
|
|
39
|
-
"@jbrowse/
|
|
40
|
-
"@mui/icons-material": "^7.
|
|
41
|
-
"@mui/material": "^7.
|
|
42
|
-
"mobx": "^6.
|
|
43
|
-
"mobx-react": "^9.
|
|
44
|
-
"mobx-state-tree": "^5.0.0",
|
|
23
|
+
"@jbrowse/mobx-state-tree": "^5.5.0",
|
|
24
|
+
"@mui/icons-material": "^7.3.6",
|
|
25
|
+
"@mui/material": "^7.3.6",
|
|
26
|
+
"mobx": "^6.15.0",
|
|
27
|
+
"mobx-react": "^9.2.1",
|
|
45
28
|
"pluralize": "^8.0.0",
|
|
46
|
-
"rxjs": "^7.
|
|
47
|
-
"
|
|
29
|
+
"rxjs": "^7.8.2",
|
|
30
|
+
"@jbrowse/core": "^4.0.0"
|
|
48
31
|
},
|
|
49
32
|
"peerDependencies": {
|
|
50
33
|
"react": ">=18.0.0",
|
|
@@ -53,8 +36,19 @@
|
|
|
53
36
|
"publishConfig": {
|
|
54
37
|
"access": "public"
|
|
55
38
|
},
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "pnpm run /^build:/",
|
|
42
|
+
"test": "cd ../..; jest --passWithNoTests plugins/config",
|
|
43
|
+
"prebuild": "pnpm clean",
|
|
44
|
+
"build:esm": "tsc -p tsconfig.build.esm.json",
|
|
45
|
+
"clean": "rimraf esm *.tsbuildinfo"
|
|
46
|
+
},
|
|
47
|
+
"types": "esm/index.d.ts",
|
|
48
|
+
"exports": {
|
|
49
|
+
".": {
|
|
50
|
+
"types": "./esm/index.d.ts",
|
|
51
|
+
"import": "./esm/index.js"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const material_1 = require("@mui/material");
|
|
5
|
-
const mobx_react_1 = require("mobx-react");
|
|
6
|
-
const BooleanEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
7
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { children: [(0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { label: slot.name, control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: slot.value, onChange: evt => {
|
|
8
|
-
slot.set(evt.target.checked);
|
|
9
|
-
} }) }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: slot.description })] }));
|
|
10
|
-
});
|
|
11
|
-
exports.default = BooleanEditor;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const util_1 = require("@jbrowse/core/util");
|
|
9
|
-
const jexlStrings_1 = require("@jbrowse/core/util/jexlStrings");
|
|
10
|
-
const Help_1 = __importDefault(require("@mui/icons-material/Help"));
|
|
11
|
-
const material_1 = require("@mui/material");
|
|
12
|
-
const mobx_react_1 = require("mobx-react");
|
|
13
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
14
|
-
const mui_1 = require("tss-react/mui");
|
|
15
|
-
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';
|
|
16
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
17
|
-
callbackEditor: {
|
|
18
|
-
marginTop: '16px',
|
|
19
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
20
|
-
width: '100%',
|
|
21
|
-
fontFamily,
|
|
22
|
-
},
|
|
23
|
-
textAreaFont: {
|
|
24
|
-
fontFamily,
|
|
25
|
-
},
|
|
26
|
-
callbackContainer: {
|
|
27
|
-
width: '100%',
|
|
28
|
-
overflowX: 'auto',
|
|
29
|
-
},
|
|
30
|
-
error: {
|
|
31
|
-
color: 'red',
|
|
32
|
-
fontSize: '0.8em',
|
|
33
|
-
},
|
|
34
|
-
}));
|
|
35
|
-
const CallbackEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
36
|
-
const { classes } = useStyles();
|
|
37
|
-
const [code, setCode] = (0, react_1.useState)(slot.value);
|
|
38
|
-
const [error, setCodeError] = (0, react_1.useState)();
|
|
39
|
-
const debouncedCode = (0, util_1.useDebounce)(code, 400);
|
|
40
|
-
(0, react_1.useEffect)(() => {
|
|
41
|
-
var _a;
|
|
42
|
-
try {
|
|
43
|
-
const jexlDebouncedCode = debouncedCode.startsWith('jexl:')
|
|
44
|
-
? debouncedCode
|
|
45
|
-
: `jexl:${debouncedCode}`;
|
|
46
|
-
if (jexlDebouncedCode === 'jexl:') {
|
|
47
|
-
throw new Error('Empty jexl expression is not valid');
|
|
48
|
-
}
|
|
49
|
-
(0, jexlStrings_1.stringToJexlExpression)(jexlDebouncedCode, (_a = (0, mobx_state_tree_1.getEnv)(slot).pluginManager) === null || _a === void 0 ? void 0 : _a.jexl);
|
|
50
|
-
slot.set(jexlDebouncedCode);
|
|
51
|
-
setCodeError(undefined);
|
|
52
|
-
}
|
|
53
|
-
catch (e) {
|
|
54
|
-
console.error({ e });
|
|
55
|
-
setCodeError(e);
|
|
56
|
-
}
|
|
57
|
-
}, [debouncedCode, slot]);
|
|
58
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [error ? (0, jsx_runtime_1.jsx)("p", { className: classes.error, children: `${error}` }) : null, (0, jsx_runtime_1.jsxs)("div", { className: classes.callbackContainer, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, className: classes.callbackEditor, value: code.startsWith('jexl:') ? code.split('jexl:')[1] : code, onChange: event => {
|
|
59
|
-
setCode(event.target.value);
|
|
60
|
-
}, style: { background: error ? '#fdd' : undefined }, slotProps: {
|
|
61
|
-
input: {
|
|
62
|
-
classes: {
|
|
63
|
-
input: classes.textAreaFont,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
} }), (0, jsx_runtime_1.jsx)("p", { children: slot.description }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: (0, jsx_runtime_1.jsxs)("div", { children: ["Callbacks are written in Jexl format. Click to learn more.", (0, jsx_runtime_1.jsx)("br", {}), " Names of available context items: ", slot.contextVariable] }), arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { color: "primary", onClick: () => {
|
|
67
|
-
const newWindow = window.open('https://github.com/TomFrost/Jexl', '_blank', 'noopener,noreferrer');
|
|
68
|
-
if (newWindow) {
|
|
69
|
-
newWindow.opener = null;
|
|
70
|
-
}
|
|
71
|
-
}, children: (0, jsx_runtime_1.jsx)(Help_1.default, {}) }) })] })] }));
|
|
72
|
-
});
|
|
73
|
-
exports.default = CallbackEditor;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const ColorSlot: (props: {
|
|
2
|
-
value: string;
|
|
3
|
-
label?: string;
|
|
4
|
-
TextFieldProps?: {
|
|
5
|
-
helperText: string;
|
|
6
|
-
fullWidth: boolean;
|
|
7
|
-
};
|
|
8
|
-
onChange: (arg: string) => void;
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
declare const ColorEditor: (props: {
|
|
11
|
-
slot: {
|
|
12
|
-
name: string;
|
|
13
|
-
value: string;
|
|
14
|
-
description: string;
|
|
15
|
-
set: (arg: string) => void;
|
|
16
|
-
};
|
|
17
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export default ColorEditor;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ColorSlot = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const ColorPicker_1 = __importDefault(require("@jbrowse/core/ui/ColorPicker"));
|
|
10
|
-
const material_1 = require("@mui/material");
|
|
11
|
-
const mobx_react_1 = require("mobx-react");
|
|
12
|
-
const ColorSlot = (props) => {
|
|
13
|
-
const { value = '#000', label = '', TextFieldProps = {}, onChange } = props;
|
|
14
|
-
const [displayed, setDisplayed] = (0, react_1.useState)(false);
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { value: value, label: label, onClick: () => {
|
|
16
|
-
setDisplayed(!displayed);
|
|
17
|
-
}, onChange: event => {
|
|
18
|
-
onChange(event.target.value);
|
|
19
|
-
}, ...TextFieldProps }), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: 10 }, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.default, { color: value, onChange: event => {
|
|
20
|
-
onChange(event);
|
|
21
|
-
} }) }) })] }));
|
|
22
|
-
};
|
|
23
|
-
exports.ColorSlot = ColorSlot;
|
|
24
|
-
const ColorEditor = (0, mobx_react_1.observer)(function (props) {
|
|
25
|
-
const { slot } = props;
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)(exports.ColorSlot, { label: slot.name, value: slot.value, onChange: color => {
|
|
27
|
-
slot.set(color);
|
|
28
|
-
}, TextFieldProps: {
|
|
29
|
-
helperText: slot.description,
|
|
30
|
-
fullWidth: true,
|
|
31
|
-
} }));
|
|
32
|
-
});
|
|
33
|
-
exports.default = ColorEditor;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
|
-
import type { AbstractSessionModel } from '@jbrowse/core/util';
|
|
3
|
-
declare const ConfigurationEditor: ({ model, }: {
|
|
4
|
-
model: {
|
|
5
|
-
target: AnyConfigurationModel;
|
|
6
|
-
};
|
|
7
|
-
session?: AbstractSessionModel;
|
|
8
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default ConfigurationEditor;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
8
|
-
const SanitizedHTML_1 = __importDefault(require("@jbrowse/core/ui/SanitizedHTML"));
|
|
9
|
-
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
10
|
-
const material_1 = require("@mui/material");
|
|
11
|
-
const mobx_react_1 = require("mobx-react");
|
|
12
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
13
|
-
const pluralize_1 = require("pluralize");
|
|
14
|
-
const mui_1 = require("tss-react/mui");
|
|
15
|
-
const SlotEditor_1 = __importDefault(require("./SlotEditor"));
|
|
16
|
-
const TypeSelector_1 = __importDefault(require("./TypeSelector"));
|
|
17
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
18
|
-
icon: {
|
|
19
|
-
color: theme.palette.tertiary.contrastText || '#fff',
|
|
20
|
-
},
|
|
21
|
-
expansionPanelDetails: {
|
|
22
|
-
display: 'block',
|
|
23
|
-
padding: theme.spacing(1),
|
|
24
|
-
},
|
|
25
|
-
accordion: {
|
|
26
|
-
border: `1px solid ${theme.palette.text.primary}`,
|
|
27
|
-
},
|
|
28
|
-
noOverflow: {
|
|
29
|
-
width: '100%',
|
|
30
|
-
overflowX: 'auto',
|
|
31
|
-
},
|
|
32
|
-
}));
|
|
33
|
-
const Member = (0, mobx_react_1.observer)(function (props) {
|
|
34
|
-
const { classes } = useStyles();
|
|
35
|
-
const { slotName, slotSchema, schema, slot = schema[slotName], path = [], } = props;
|
|
36
|
-
if ((0, configuration_1.isConfigurationSchemaType)(slotSchema)) {
|
|
37
|
-
if (slot.length) {
|
|
38
|
-
return slot.map((subslot, slotIndex) => {
|
|
39
|
-
const key = subslot.type
|
|
40
|
-
? `${(0, pluralize_1.singular)(slotName)} ${subslot.type}`
|
|
41
|
-
: `${(0, pluralize_1.singular)(slotName)} ${slotIndex + 1}`;
|
|
42
|
-
return (0, jsx_runtime_1.jsx)(Member, { ...props, slot: subslot, slotName: key }, key);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
const typeNameChoices = (0, configuration_1.getTypeNamesFromExplicitlyTypedUnion)(slotSchema);
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Accordion, { defaultExpanded: true, className: classes.accordion, children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, { expandIcon: (0, jsx_runtime_1.jsx)(ExpandMore_1.default, { className: classes.icon }), children: (0, jsx_runtime_1.jsx)(material_1.Typography, { children: [...path, slotName].join('➔') }) }), (0, jsx_runtime_1.jsxs)(material_1.AccordionDetails, { className: classes.expansionPanelDetails, children: [typeNameChoices.length ? ((0, jsx_runtime_1.jsx)(TypeSelector_1.default, { typeNameChoices: typeNameChoices, slotName: slotName, slot: slot, onChange: evt => {
|
|
47
|
-
if (evt.target.value !== slot.type) {
|
|
48
|
-
schema.setSubschema(slotName, {
|
|
49
|
-
type: evt.target.value,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
} })) : null, (0, jsx_runtime_1.jsx)(material_1.FormGroup, { className: classes.noOverflow, children: (0, jsx_runtime_1.jsx)(Schema, { schema: slot, path: [...path, slotName] }) })] })] }));
|
|
53
|
-
}
|
|
54
|
-
else if ((0, configuration_1.isConfigurationSlotType)(slotSchema)) {
|
|
55
|
-
return (0, jsx_runtime_1.jsx)(SlotEditor_1.default, { slot: slot, slotSchema: slotSchema }, slotName);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
const Schema = (0, mobx_react_1.observer)(function ({ schema, path = [], }) {
|
|
62
|
-
const properties = (0, mobx_state_tree_1.getMembers)(schema).properties;
|
|
63
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Object.entries(properties).map(([slotName, slotSchema]) => ((0, jsx_runtime_1.jsx)(Member, { slotName: slotName, slotSchema: slotSchema, path: path, schema: schema }, slotName))) }));
|
|
64
|
-
});
|
|
65
|
-
const ConfigurationEditor = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
66
|
-
const { classes } = useStyles();
|
|
67
|
-
const { target } = model;
|
|
68
|
-
const key = (0, configuration_1.readConfObject)(target, 'trackId');
|
|
69
|
-
const name = (0, configuration_1.readConfObject)(target, 'name');
|
|
70
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Accordion, { defaultExpanded: true, className: classes.accordion, children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, { expandIcon: (0, jsx_runtime_1.jsx)(ExpandMore_1.default, { className: classes.icon }), children: (0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(SanitizedHTML_1.default, { html: name !== null && name !== void 0 ? name : 'Configuration' }) }) }), (0, jsx_runtime_1.jsx)(material_1.AccordionDetails, { className: classes.expansionPanelDetails, "data-testid": "configEditor", children: (0, jsx_runtime_1.jsx)(Schema, { schema: target }) })] }, key));
|
|
71
|
-
});
|
|
72
|
-
exports.default = ConfigurationEditor;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = ConfigurationTextField;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
function ConfigurationTextField(props) {
|
|
8
|
-
const { helperText } = props;
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TextField, { ...props, helperText: (0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: helperText || '' }), fullWidth: true, slotProps: {
|
|
10
|
-
formHelperText: {
|
|
11
|
-
component: 'div',
|
|
12
|
-
},
|
|
13
|
-
} }));
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const mobx_react_1 = require("mobx-react");
|
|
5
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
|
-
const HeadingComponent = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
7
|
-
if (model === null || model === void 0 ? void 0 : model.target) {
|
|
8
|
-
if (model.target.type) {
|
|
9
|
-
return `${model.target.type} settings`;
|
|
10
|
-
}
|
|
11
|
-
if ((0, mobx_state_tree_1.isStateTreeNode)(model.target)) {
|
|
12
|
-
const type = (0, mobx_state_tree_1.getType)(model.target);
|
|
13
|
-
if (type.name) {
|
|
14
|
-
return `${type.name.replace('ConfigurationSchema', '')} settings`;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Settings" });
|
|
19
|
-
});
|
|
20
|
-
exports.default = HeadingComponent;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const material_1 = require("@mui/material");
|
|
6
|
-
const mobx_react_1 = require("mobx-react");
|
|
7
|
-
const mui_1 = require("tss-react/mui");
|
|
8
|
-
const fontSize = '12px';
|
|
9
|
-
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';
|
|
10
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
11
|
-
error: {
|
|
12
|
-
color: 'red',
|
|
13
|
-
fontSize: '0.8em',
|
|
14
|
-
},
|
|
15
|
-
callbackEditor: {
|
|
16
|
-
fontFamily,
|
|
17
|
-
fontSize,
|
|
18
|
-
background: theme.palette.background.default,
|
|
19
|
-
width: 800,
|
|
20
|
-
marginTop: '16px',
|
|
21
|
-
border: '1px solid rgba(0,0,0,0.42)',
|
|
22
|
-
},
|
|
23
|
-
callbackContainer: {
|
|
24
|
-
width: '100%',
|
|
25
|
-
overflowX: 'auto',
|
|
26
|
-
},
|
|
27
|
-
textAreaFont: {
|
|
28
|
-
fontFamily,
|
|
29
|
-
},
|
|
30
|
-
}));
|
|
31
|
-
const JsonEditor = (0, mobx_react_1.observer)(function JsonEditor({ slot, }) {
|
|
32
|
-
const { classes } = useStyles();
|
|
33
|
-
const [contents, setContents] = (0, react_1.useState)(JSON.stringify(slot.value, null, 2));
|
|
34
|
-
const [error, setError] = (0, react_1.useState)();
|
|
35
|
-
(0, react_1.useEffect)(() => {
|
|
36
|
-
try {
|
|
37
|
-
setError(undefined);
|
|
38
|
-
slot.set(JSON.parse(contents));
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
console.error({ e });
|
|
42
|
-
setError(e);
|
|
43
|
-
}
|
|
44
|
-
}, [contents, slot]);
|
|
45
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [error ? (0, jsx_runtime_1.jsx)("p", { className: classes.error, children: `${error}` }) : null, (0, jsx_runtime_1.jsxs)("div", { className: classes.callbackContainer, children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { shrink: true, htmlFor: "json-editor", children: slot.name }), (0, jsx_runtime_1.jsx)(material_1.TextField, { id: "json-editor", className: classes.callbackEditor, value: contents, helperText: slot.description, multiline: true, onChange: event => {
|
|
46
|
-
setContents(event.target.value);
|
|
47
|
-
}, style: { background: error ? '#fdd' : undefined }, slotProps: {
|
|
48
|
-
input: {
|
|
49
|
-
classes: {
|
|
50
|
-
input: classes.textAreaFont,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
} })] })] }));
|
|
54
|
-
});
|
|
55
|
-
exports.default = JsonEditor;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const mobx_react_1 = require("mobx-react");
|
|
9
|
-
const ConfigurationTextField_1 = __importDefault(require("./ConfigurationTextField"));
|
|
10
|
-
const NumberEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
11
|
-
const [val, setVal] = (0, react_1.useState)(slot.value);
|
|
12
|
-
(0, react_1.useEffect)(() => {
|
|
13
|
-
var _a;
|
|
14
|
-
const num = Number.parseFloat(val);
|
|
15
|
-
if (Number.isNaN(num)) {
|
|
16
|
-
(_a = slot.reset) === null || _a === void 0 ? void 0 : _a.call(slot);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
slot.set(num);
|
|
20
|
-
}
|
|
21
|
-
}, [slot, val]);
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(ConfigurationTextField_1.default, { label: slot.name, helperText: slot.description, value: val, type: "number", onChange: evt => {
|
|
23
|
-
setVal(evt.target.value);
|
|
24
|
-
} }));
|
|
25
|
-
});
|
|
26
|
-
exports.default = NumberEditor;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare const NumberMapEditor: ({ slot, }: {
|
|
2
|
-
slot: {
|
|
3
|
-
name: string;
|
|
4
|
-
value: Map<string, string>;
|
|
5
|
-
remove: (key: string) => void;
|
|
6
|
-
add: (key: string, val: number) => void;
|
|
7
|
-
description: string;
|
|
8
|
-
};
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default NumberMapEditor;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const Add_1 = __importDefault(require("@mui/icons-material/Add"));
|
|
9
|
-
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
10
|
-
const material_1 = require("@mui/material");
|
|
11
|
-
const mobx_react_1 = require("mobx-react");
|
|
12
|
-
const mui_1 = require("tss-react/mui");
|
|
13
|
-
const NumberEditor_1 = __importDefault(require("./NumberEditor"));
|
|
14
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
15
|
-
card: {
|
|
16
|
-
marginTop: theme.spacing(1),
|
|
17
|
-
},
|
|
18
|
-
}));
|
|
19
|
-
const NumberMapEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
20
|
-
const { classes } = useStyles();
|
|
21
|
-
const [value, setValue] = (0, react_1.useState)('');
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: slot.name }), [...slot.value].map(([key, val]) => ((0, jsx_runtime_1.jsxs)(material_1.Card, { raised: true, className: classes.card, children: [(0, jsx_runtime_1.jsx)(material_1.CardHeader, { title: key, action: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
|
|
23
|
-
slot.remove(key);
|
|
24
|
-
}, children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(material_1.CardContent, { children: (0, jsx_runtime_1.jsx)(NumberEditor_1.default, { slot: {
|
|
25
|
-
value: val,
|
|
26
|
-
set: (val) => {
|
|
27
|
-
slot.add(key, val);
|
|
28
|
-
},
|
|
29
|
-
} }) })] }, key))), (0, jsx_runtime_1.jsx)(material_1.Card, { raised: true, className: classes.card, children: (0, jsx_runtime_1.jsx)(material_1.CardHeader, { disableTypography: true, title: (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => {
|
|
30
|
-
setValue(event.target.value);
|
|
31
|
-
}, slotProps: {
|
|
32
|
-
input: {
|
|
33
|
-
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { disabled: value === '', onClick: () => {
|
|
34
|
-
slot.add(value, 0);
|
|
35
|
-
setValue('');
|
|
36
|
-
}, children: (0, jsx_runtime_1.jsx)(Add_1.default, {}) }) })),
|
|
37
|
-
},
|
|
38
|
-
} }) }) }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: slot.description })] }));
|
|
39
|
-
});
|
|
40
|
-
exports.default = NumberMapEditor;
|