@jbrowse/core 2.4.1 → 2.4.2
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/BaseFeatureWidget/BaseFeatureDetail.d.ts +1 -3
- package/BaseFeatureWidget/SequenceFeatureDetails.js +3 -10
- package/BaseFeatureWidget/index.d.ts +1 -1
- package/BaseFeatureWidget/index.js +6 -9
- package/PluginManager.d.ts +1 -3
- package/ReExports/modules.d.ts +1 -3
- package/configuration/configurationSchema.d.ts +3 -1
- package/configuration/configurationSlot.d.ts +1 -0
- package/package.json +2 -3
- package/pluggableElementTypes/models/baseTrackConfig.js +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/ViewContainer.d.ts +2 -3
- package/ui/ViewContainer.js +7 -39
- package/ui/ViewContainerTitle.d.ts +6 -0
- package/ui/ViewContainerTitle.js +42 -0
- package/util/index.d.ts +5 -2
- package/util/index.js +19 -4
- package/util/io/index.d.ts +3 -1
- package/util/io/index.js +9 -4
- package/util/mst-reflection.d.ts +12 -17
- package/util/mst-reflection.js +13 -12
- package/util/types/index.d.ts +1 -0
- package/util/useMeasure.d.ts +5 -0
- package/util/useMeasure.js +34 -0
|
@@ -3,9 +3,7 @@ import { IAnyStateTreeNode } from 'mobx-state-tree';
|
|
|
3
3
|
import { BaseCardProps, BaseProps } from './types';
|
|
4
4
|
import { SimpleFeatureSerializedNoId } from '../util/simpleFeature';
|
|
5
5
|
export declare const useStyles: (params: void, styleOverrides?: {
|
|
6
|
-
props:
|
|
7
|
-
classes?: Record<string, string> | undefined;
|
|
8
|
-
} & Record<string, unknown>;
|
|
6
|
+
props: any;
|
|
9
7
|
ownerState?: Record<string, unknown> | undefined;
|
|
10
8
|
} | undefined) => {
|
|
11
9
|
classes: Record<"expansionPanelDetails" | "expandIcon" | "field" | "fieldDescription" | "fieldName" | "fieldValue" | "fieldSubvalue", string>;
|
|
@@ -48,9 +48,6 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
48
48
|
formControl: {
|
|
49
49
|
margin: 0,
|
|
50
50
|
},
|
|
51
|
-
container: {
|
|
52
|
-
margin: theme.spacing(1),
|
|
53
|
-
},
|
|
54
51
|
container2: {
|
|
55
52
|
marginTop: theme.spacing(1),
|
|
56
53
|
},
|
|
@@ -60,14 +57,10 @@ const BPLIMIT = 500000;
|
|
|
60
57
|
// sequence. this is a best effort and weird genomic phenomena could lead these
|
|
61
58
|
// to not be 100% accurate
|
|
62
59
|
function SequenceFeatureDetails({ model, feature }) {
|
|
63
|
-
var _a;
|
|
64
60
|
const { classes } = useStyles();
|
|
65
|
-
const parentFeature = feature;
|
|
66
|
-
const hasCDS = !!((_a = parentFeature.subfeatures) === null || _a === void 0 ? void 0 : _a.find(sub => sub.type === 'CDS'));
|
|
67
|
-
const isGene = feature.type === 'gene';
|
|
68
61
|
const [shown, setShown] = (0, react_1.useState)(false);
|
|
69
62
|
const [helpShown, setHelpShown] = (0, react_1.useState)(false);
|
|
70
|
-
return
|
|
63
|
+
return !model ? null : (react_1.default.createElement("div", { className: classes.container2 },
|
|
71
64
|
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => setShown(!shown) }, shown ? 'Hide feature sequence' : 'Show feature sequence'),
|
|
72
65
|
react_1.default.createElement(material_1.FormControl, { className: classes.formControl },
|
|
73
66
|
react_1.default.createElement(material_1.IconButton, { onClick: () => setHelpShown(true) },
|
|
@@ -79,7 +72,7 @@ function SequenceFeatureDetails({ model, feature }) {
|
|
|
79
72
|
}
|
|
80
73
|
exports.default = SequenceFeatureDetails;
|
|
81
74
|
function FeatureSequence({ model, feature }) {
|
|
82
|
-
var _a;
|
|
75
|
+
var _a, _b;
|
|
83
76
|
const { classes } = useStyles();
|
|
84
77
|
const parentFeature = feature;
|
|
85
78
|
const hasCDS = !!((_a = parentFeature.subfeatures) === null || _a === void 0 ? void 0 : _a.find(sub => sub.type === 'CDS'));
|
|
@@ -166,7 +159,7 @@ function FeatureSequence({ model, feature }) {
|
|
|
166
159
|
// only attempt fetching gene type sequence on a bare CDS if it has no parent
|
|
167
160
|
const attemptGeneType = feature.type === 'CDS'
|
|
168
161
|
? sequenceTypes.includes('CDS') && !feature.parentId
|
|
169
|
-
: sequenceTypes.includes(feature.type);
|
|
162
|
+
: sequenceTypes.includes(feature.type) && ((_b = feature.subfeatures) === null || _b === void 0 ? void 0 : _b.length);
|
|
170
163
|
const val = attemptGeneType ? (hasCDS ? 'cds' : 'cdna') : 'genomic';
|
|
171
164
|
// this useEffect is needed to reset the mode/setMode useState because the
|
|
172
165
|
// contents of the select box can completely change depending on whether we
|
|
@@ -28,8 +28,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
28
28
|
trackId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
29
29
|
trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
30
30
|
}>>, {
|
|
31
|
-
id: string;
|
|
32
31
|
type: "BaseFeatureWidget";
|
|
32
|
+
id: string;
|
|
33
33
|
track: import("mobx-state-tree").ReferenceIdentifier | undefined;
|
|
34
34
|
view: import("mobx-state-tree").ReferenceIdentifier | undefined;
|
|
35
35
|
trackId: string | undefined;
|
|
@@ -60,20 +60,17 @@ function stateModelFactory(pluginManager) {
|
|
|
60
60
|
const session = (0, util_1.getSession)(self);
|
|
61
61
|
if (unformattedFeatureData) {
|
|
62
62
|
const feature = (0, clone_1.default)(unformattedFeatureData);
|
|
63
|
-
const
|
|
63
|
+
const combine = (arg2, feature) => ({
|
|
64
|
+
...(0, configuration_1.getConf)(session, ['formatDetails', arg2], { feature }),
|
|
65
|
+
...(0, configuration_1.getConf)(track, ['formatDetails', arg2], { feature }),
|
|
66
|
+
});
|
|
64
67
|
if (track) {
|
|
65
68
|
// eslint-disable-next-line no-underscore-dangle
|
|
66
|
-
feature.__jbrowsefmt =
|
|
67
|
-
...f(session, 'feature'),
|
|
68
|
-
...f(track, 'feature'),
|
|
69
|
-
};
|
|
69
|
+
feature.__jbrowsefmt = combine('feature', feature);
|
|
70
70
|
const depth = (0, configuration_1.getConf)(track, ['formatDetails', 'depth']);
|
|
71
71
|
formatSubfeatures(feature, depth, sub => {
|
|
72
72
|
// eslint-disable-next-line no-underscore-dangle
|
|
73
|
-
sub.__jbrowsefmt =
|
|
74
|
-
...f(session, 'subfeature'),
|
|
75
|
-
...f(track, 'subfeature'),
|
|
76
|
-
};
|
|
73
|
+
sub.__jbrowsefmt = combine('subfeatures', sub);
|
|
77
74
|
});
|
|
78
75
|
}
|
|
79
76
|
self.setFormattedData(feature);
|
package/PluginManager.d.ts
CHANGED
|
@@ -228,9 +228,7 @@ export default class PluginManager {
|
|
|
228
228
|
name?: string | Record<string, unknown> | undefined;
|
|
229
229
|
uniqId?: string | undefined;
|
|
230
230
|
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme: import("@mui/material").Theme, params: Params, classes: Record<RuleNameSubsetReferencableInNestedSelectors, string>) => Record<RuleNameSubsetReferencableInNestedSelectors | RuleName, import("tss-react").CSSObject>)) => (params: Params, styleOverrides?: {
|
|
231
|
-
props:
|
|
232
|
-
classes?: Record<string, string> | undefined;
|
|
233
|
-
} & Record<string, unknown>;
|
|
231
|
+
props: any;
|
|
234
232
|
ownerState?: Record<string, unknown> | undefined;
|
|
235
233
|
} | undefined) => {
|
|
236
234
|
classes: Record<RuleName, string>;
|
package/ReExports/modules.d.ts
CHANGED
|
@@ -145,9 +145,7 @@ declare const libs: {
|
|
|
145
145
|
name?: string | Record<string, unknown> | undefined;
|
|
146
146
|
uniqId?: string | undefined;
|
|
147
147
|
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme: MUIStyles.Theme, params: Params, classes: Record<RuleNameSubsetReferencableInNestedSelectors, string>) => Record<RuleNameSubsetReferencableInNestedSelectors | RuleName, import("tss-react").CSSObject>)) => (params: Params, styleOverrides?: {
|
|
148
|
-
props:
|
|
149
|
-
classes?: Record<string, string> | undefined;
|
|
150
|
-
} & Record<string, unknown>;
|
|
148
|
+
props: any;
|
|
151
149
|
ownerState?: Record<string, unknown> | undefined;
|
|
152
150
|
} | undefined) => {
|
|
153
151
|
classes: Record<RuleName, string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Instance, IAnyType } from 'mobx-state-tree';
|
|
2
|
-
import { ConfigSlotDefinition } from './configurationSlot';
|
|
2
|
+
import ConfigSlot, { ConfigSlotDefinition } from './configurationSlot';
|
|
3
3
|
export interface ConfigurationSchemaDefinition {
|
|
4
4
|
[n: string]: ConfigSlotDefinition | ConfigurationSchemaDefinition | string | number | IAnyType;
|
|
5
5
|
}
|
|
@@ -23,6 +23,8 @@ export interface AnyConfigurationSchemaType extends ReturnType<typeof makeConfig
|
|
|
23
23
|
type: string;
|
|
24
24
|
}
|
|
25
25
|
export type AnyConfigurationModel = Instance<AnyConfigurationSchemaType>;
|
|
26
|
+
export type AnyConfigurationSlotType = ReturnType<typeof ConfigSlot>;
|
|
27
|
+
export type AnyConfigurationSlot = Instance<AnyConfigurationSlotType>;
|
|
26
28
|
export type ConfigurationModel<SCHEMA extends AnyConfigurationSchemaType> = Instance<SCHEMA>;
|
|
27
29
|
export declare function ConfigurationSchema<DEFINITION extends ConfigurationSchemaDefinition, OPTIONS extends ConfigurationSchemaOptions>(modelName: string, inputSchemaDefinition: DEFINITION, inputOptions?: OPTIONS): AnyConfigurationSchemaType;
|
|
28
30
|
export declare function ConfigurationReference(schemaType: IAnyType): import("mobx-state-tree").ITypeUnion<any, any, any>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IAnyModelType, IAnyComplexType } from 'mobx-state-tree';
|
|
2
2
|
export interface ConfigSlotDefinition {
|
|
3
|
+
/** human-readable description of the slot's meaning */
|
|
3
4
|
description?: string;
|
|
4
5
|
/** custom base MST model for the slot's value */
|
|
5
6
|
model?: IAnyModelType | IAnyComplexType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"material-ui-popup-state": "^5.0.0",
|
|
55
55
|
"rbush": "^3.0.1",
|
|
56
56
|
"react-error-boundary": "^3.0.0",
|
|
57
|
-
"react-use-measure": "^2.1.1",
|
|
58
57
|
"serialize-error": "^8.0.0",
|
|
59
58
|
"shortid": "^2.2.13",
|
|
60
59
|
"svg-path-generator": "^1.1.0"
|
|
@@ -75,5 +74,5 @@
|
|
|
75
74
|
"access": "public",
|
|
76
75
|
"directory": "dist"
|
|
77
76
|
},
|
|
78
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "36e382a70e7d220343b873e7e6aba5c83e5342c8"
|
|
79
78
|
}
|
|
@@ -158,7 +158,7 @@ function createBaseTrackConfig(pluginManager) {
|
|
|
158
158
|
if (!type) {
|
|
159
159
|
throw new Error(`unknown display type ${type}`);
|
|
160
160
|
}
|
|
161
|
-
const display = self.displays.find((d) => d
|
|
161
|
+
const display = self.displays.find((d) => (d === null || d === void 0 ? void 0 : d.displayId) === conf.displayId);
|
|
162
162
|
if (display) {
|
|
163
163
|
return display;
|
|
164
164
|
}
|