@jbrowse/plugin-data-management 2.10.3 → 2.11.1
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/AddConnectionWidget/components/ConnectionTypeSelect.d.ts +1 -1
- package/dist/AddConnectionWidget/index.d.ts +1 -2
- package/dist/AddConnectionWidget/index.js +3 -2
- package/dist/AddTrackWidget/index.d.ts +1 -2
- package/dist/AddTrackWidget/index.js +3 -2
- package/dist/AssemblyManager/AssemblyEditor.d.ts +1 -5
- package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalFab.d.ts +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalFab.js +2 -2
- package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.d.ts +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.js +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/dialogs/CloseConnectionDialog.d.ts +4 -4
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.js +11 -11
- package/dist/HierarchicalTrackSelectorWidget/components/tree/DropdownTrackSelector.d.ts +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackLabelMenu.d.ts +2 -2
- package/dist/HierarchicalTrackSelectorWidget/index.d.ts +1 -2
- package/dist/HierarchicalTrackSelectorWidget/index.js +3 -2
- package/dist/HierarchicalTrackSelectorWidget/model.d.ts +15 -39
- package/dist/HierarchicalTrackSelectorWidget/model.js +98 -89
- package/dist/HierarchicalTrackSelectorWidget/util.d.ts +1 -1
- package/dist/HierarchicalTrackSelectorWidget/util.js +4 -3
- package/dist/PluginStoreWidget/index.d.ts +1 -2
- package/dist/PluginStoreWidget/index.js +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/ucsc-trackhub/doConnect.js +1 -1
- package/dist/ucsc-trackhub/index.d.ts +1 -2
- package/dist/ucsc-trackhub/index.js +3 -2
- package/esm/AddConnectionWidget/components/ConnectionTypeSelect.d.ts +1 -1
- package/esm/AddConnectionWidget/index.d.ts +1 -2
- package/esm/AddConnectionWidget/index.js +2 -2
- package/esm/AddTrackWidget/index.d.ts +1 -2
- package/esm/AddTrackWidget/index.js +2 -2
- package/esm/AssemblyManager/AssemblyEditor.d.ts +1 -5
- package/esm/HierarchicalTrackSelectorWidget/components/HierarchicalFab.d.ts +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/HierarchicalFab.js +2 -2
- package/esm/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.d.ts +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.js +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/dialogs/CloseConnectionDialog.d.ts +4 -4
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.js +11 -11
- package/esm/HierarchicalTrackSelectorWidget/components/tree/DropdownTrackSelector.d.ts +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackLabelMenu.d.ts +2 -2
- package/esm/HierarchicalTrackSelectorWidget/index.d.ts +1 -2
- package/esm/HierarchicalTrackSelectorWidget/index.js +2 -2
- package/esm/HierarchicalTrackSelectorWidget/model.d.ts +15 -39
- package/esm/HierarchicalTrackSelectorWidget/model.js +99 -90
- package/esm/HierarchicalTrackSelectorWidget/util.d.ts +1 -1
- package/esm/HierarchicalTrackSelectorWidget/util.js +4 -3
- package/esm/PluginStoreWidget/index.d.ts +1 -2
- package/esm/PluginStoreWidget/index.js +2 -2
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/ucsc-trackhub/doConnect.js +1 -1
- package/esm/ucsc-trackhub/index.d.ts +1 -2
- package/esm/ucsc-trackhub/index.js +2 -2
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ConnectionType } from '@jbrowse/core/pluggableElementTypes';
|
|
3
3
|
declare const ConnectionTypeSelect: ({ connectionTypeChoices, connectionType, setConnectionType, }: {
|
|
4
4
|
connectionTypeChoices: ConnectionType[];
|
|
5
|
-
connectionType?: ConnectionType
|
|
5
|
+
connectionType?: ConnectionType;
|
|
6
6
|
setConnectionType: (c?: ConnectionType) => void;
|
|
7
7
|
}) => React.JSX.Element;
|
|
8
8
|
export default ConnectionTypeSelect;
|
|
@@ -31,7 +31,7 @@ const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
|
31
31
|
const react_1 = require("react");
|
|
32
32
|
const model_1 = __importDefault(require("./model"));
|
|
33
33
|
const configSchema = (0, configuration_1.ConfigurationSchema)('AddConnectionWidget', {});
|
|
34
|
-
|
|
34
|
+
function AddConnectionWidgetF(pluginManager) {
|
|
35
35
|
pluginManager.addWidgetType(() => {
|
|
36
36
|
return new pluggableElementTypes_1.WidgetType({
|
|
37
37
|
name: 'AddConnectionWidget',
|
|
@@ -41,4 +41,5 @@ exports.default = (pluginManager) => {
|
|
|
41
41
|
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/AddConnectionWidget')))),
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = AddConnectionWidgetF;
|
|
@@ -31,7 +31,7 @@ const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
|
31
31
|
const react_1 = require("react");
|
|
32
32
|
const model_1 = __importDefault(require("./model"));
|
|
33
33
|
const configSchema = (0, configuration_1.ConfigurationSchema)('AddTrackWidget', {});
|
|
34
|
-
|
|
34
|
+
function AddTrackWidgetF(pluginManager) {
|
|
35
35
|
pluginManager.addWidgetType(() => {
|
|
36
36
|
return new pluggableElementTypes_1.WidgetType({
|
|
37
37
|
name: 'AddTrackWidget',
|
|
@@ -41,4 +41,5 @@ exports.default = (pluginManager) => {
|
|
|
41
41
|
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/AddTrackWidget')))),
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = AddTrackWidgetF;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
3
|
declare const AssemblyEditor: ({ assembly, }: {
|
|
4
|
-
assembly?:
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
7
|
-
setSubschema(slotName: string, data: unknown): any;
|
|
8
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | undefined;
|
|
4
|
+
assembly?: AnyConfigurationModel;
|
|
9
5
|
}) => React.JSX.Element;
|
|
10
6
|
export default AssemblyEditor;
|
|
@@ -49,7 +49,7 @@ const HierarchicalFab = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
49
49
|
}
|
|
50
50
|
const hasConnections = (0, util_1.isSessionModelWithConnections)(session);
|
|
51
51
|
const hasAddTrack = (0, util_1.isSessionWithAddTracks)(session);
|
|
52
|
-
return
|
|
52
|
+
return hasAddTrack || hasConnections ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
53
53
|
react_1.default.createElement(material_1.Fab, { color: "secondary", className: classes.fab, onClick: event => setAnchorEl(event.currentTarget) },
|
|
54
54
|
react_1.default.createElement(Add_1.default, null)),
|
|
55
55
|
react_1.default.createElement(material_1.Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: () => setAnchorEl(null) },
|
|
@@ -66,6 +66,6 @@ const HierarchicalFab = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
66
66
|
view: model.view.id,
|
|
67
67
|
}));
|
|
68
68
|
}
|
|
69
|
-
} }, "Add track")) : null))) : null
|
|
69
|
+
} }, "Add track")) : null))) : null;
|
|
70
70
|
});
|
|
71
71
|
exports.default = HierarchicalFab;
|
|
@@ -38,7 +38,7 @@ const AutoSizedHierarchicalTree = ({ tree, model, offset, }) => {
|
|
|
38
38
|
return typeof jest === 'undefined' ? (react_1.default.createElement(react_virtualized_auto_sizer_1.default, { disableWidth: true }, args => (react_1.default.createElement(HierarchicalTree_1.default, { height: (args.height || offset) - offset, model: model, tree: tree })))) : (react_1.default.createElement(HierarchicalTree_1.default, { height: 9000, model: model, tree: tree }));
|
|
39
39
|
};
|
|
40
40
|
const Wrapper = ({ overrideDimensions, children, }) => {
|
|
41
|
-
return overrideDimensions ? (react_1.default.createElement("div", { style: { ...overrideDimensions } }, children)) : (
|
|
41
|
+
return overrideDimensions ? (react_1.default.createElement("div", { style: { ...overrideDimensions } }, children)) : (children);
|
|
42
42
|
};
|
|
43
43
|
const HierarchicalTrackSelectorContainer = (0, mobx_react_1.observer)(function ({ model, toolbarHeight, overrideDimensions, }) {
|
|
44
44
|
return (react_1.default.createElement(Wrapper, { overrideDimensions: overrideDimensions },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const CloseConnectionDialog: ({ modalInfo, onClose, }: {
|
|
3
3
|
modalInfo?: {
|
|
4
|
-
name?: string
|
|
5
|
-
dereferenceTypeCount?: Record<string, number
|
|
6
|
-
safelyBreakConnection?: (
|
|
7
|
-
}
|
|
4
|
+
name?: string;
|
|
5
|
+
dereferenceTypeCount?: Record<string, number>;
|
|
6
|
+
safelyBreakConnection?: () => void;
|
|
7
|
+
};
|
|
8
8
|
onClose: () => void;
|
|
9
9
|
}) => React.JSX.Element;
|
|
10
10
|
export default CloseConnectionDialog;
|
|
@@ -43,7 +43,7 @@ const FacetedSelector = (0, mobx_react_1.observer)(function FacetedSelector({ mo
|
|
|
43
43
|
{
|
|
44
44
|
field: 'name',
|
|
45
45
|
hideable: false,
|
|
46
|
-
renderCell:
|
|
46
|
+
renderCell: params => {
|
|
47
47
|
const { value, row } = params;
|
|
48
48
|
const { id, conf } = row;
|
|
49
49
|
return (react_1.default.createElement("div", { className: classes.cell },
|
|
@@ -54,29 +54,29 @@ const FacetedSelector = (0, mobx_react_1.observer)(function FacetedSelector({ mo
|
|
|
54
54
|
},
|
|
55
55
|
...filteredNonMetadataKeys.map(e => {
|
|
56
56
|
var _a;
|
|
57
|
-
return
|
|
57
|
+
return {
|
|
58
58
|
field: e,
|
|
59
59
|
width: (_a = widthsDebounced[e]) !== null && _a !== void 0 ? _a : 100,
|
|
60
|
-
renderCell:
|
|
60
|
+
renderCell: params => {
|
|
61
61
|
const val = params.value;
|
|
62
|
-
return val ? react_1.default.createElement(SanitizedHTML_1.default, { className: classes.cell, html: val }) : '';
|
|
62
|
+
return val ? (react_1.default.createElement(SanitizedHTML_1.default, { className: classes.cell, html: val })) : ('');
|
|
63
63
|
},
|
|
64
|
-
}
|
|
64
|
+
};
|
|
65
65
|
}),
|
|
66
66
|
...filteredMetadataKeys.map(e => {
|
|
67
67
|
var _a;
|
|
68
|
-
return
|
|
68
|
+
return {
|
|
69
69
|
field: `metadata.${e}`,
|
|
70
70
|
headerName: ['name', ...filteredNonMetadataKeys].includes(e)
|
|
71
71
|
? `${e} (from metadata)`
|
|
72
72
|
: e,
|
|
73
73
|
width: (_a = widthsDebounced['metadata.' + e]) !== null && _a !== void 0 ? _a : 100,
|
|
74
|
-
valueGetter: (
|
|
75
|
-
renderCell:
|
|
76
|
-
const val = params.
|
|
77
|
-
return val ? react_1.default.createElement(SanitizedHTML_1.default, { className: classes.cell, html: val }) : '';
|
|
74
|
+
valueGetter: (_, row) => `${row.metadata[e]}`,
|
|
75
|
+
renderCell: params => {
|
|
76
|
+
const val = params.value;
|
|
77
|
+
return val ? (react_1.default.createElement(SanitizedHTML_1.default, { className: classes.cell, html: val })) : ('');
|
|
78
78
|
},
|
|
79
|
-
}
|
|
79
|
+
};
|
|
80
80
|
}),
|
|
81
81
|
];
|
|
82
82
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -6,7 +6,7 @@ declare const DropdownTrackSelector: ({ model, tracks, extraMenuItems, children,
|
|
|
6
6
|
model: HierarchicalTrackSelectorModel;
|
|
7
7
|
tracks: AnyConfigurationModel[];
|
|
8
8
|
extraMenuItems: MenuItem[];
|
|
9
|
-
onClick?: (
|
|
9
|
+
onClick?: () => void;
|
|
10
10
|
children: React.ReactElement;
|
|
11
11
|
}) => React.JSX.Element | null;
|
|
12
12
|
export default DropdownTrackSelector;
|
|
@@ -4,9 +4,9 @@ import { HierarchicalTrackSelectorModel } from '../../model';
|
|
|
4
4
|
declare const TrackLabelMenu: ({ id, trackId, stopPropagation, model, setOpen, conf, }: {
|
|
5
5
|
id: string;
|
|
6
6
|
trackId: string;
|
|
7
|
-
stopPropagation?: boolean
|
|
7
|
+
stopPropagation?: boolean;
|
|
8
8
|
conf: AnyConfigurationModel;
|
|
9
|
-
setOpen?: (
|
|
9
|
+
setOpen?: (arg: boolean) => void;
|
|
10
10
|
model: HierarchicalTrackSelectorModel;
|
|
11
11
|
}) => React.JSX.Element;
|
|
12
12
|
export default TrackLabelMenu;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
|
|
3
|
-
export default _default;
|
|
2
|
+
export default function HierarchicalTrackSelectorWidgetF(pluginManager: PluginManager): void;
|
|
4
3
|
export { type HierarchicalTrackSelectorModel, default as stateModelFactory, } from './model';
|
|
5
4
|
export { default as configSchema } from './configSchema';
|
|
@@ -31,7 +31,7 @@ const model_1 = __importDefault(require("./model"));
|
|
|
31
31
|
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
32
32
|
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
33
33
|
const react_1 = require("react");
|
|
34
|
-
|
|
34
|
+
function HierarchicalTrackSelectorWidgetF(pluginManager) {
|
|
35
35
|
pluginManager.addWidgetType(() => {
|
|
36
36
|
return new pluggableElementTypes_1.WidgetType({
|
|
37
37
|
name: 'HierarchicalTrackSelectorWidget',
|
|
@@ -41,7 +41,8 @@ exports.default = (pluginManager) => {
|
|
|
41
41
|
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/HierarchicalTrackSelector')))),
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = HierarchicalTrackSelectorWidgetF;
|
|
45
46
|
var model_2 = require("./model");
|
|
46
47
|
Object.defineProperty(exports, "stateModelFactory", { enumerable: true, get: function () { return __importDefault(model_2).default; } });
|
|
47
48
|
var configSchema_2 = require("./configSchema");
|
|
@@ -14,22 +14,6 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
14
14
|
* #property
|
|
15
15
|
*/
|
|
16
16
|
type: import("mobx-state-tree").ISimpleType<"HierarchicalTrackSelectorWidget">;
|
|
17
|
-
/**
|
|
18
|
-
* #property
|
|
19
|
-
*/
|
|
20
|
-
initialized: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
21
|
-
/**
|
|
22
|
-
* #property
|
|
23
|
-
*/
|
|
24
|
-
collapsed: import("mobx-state-tree").IMapType<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
25
|
-
/**
|
|
26
|
-
* #property
|
|
27
|
-
*/
|
|
28
|
-
sortTrackNames: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
29
|
-
/**
|
|
30
|
-
* #property
|
|
31
|
-
*/
|
|
32
|
-
sortCategories: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
33
17
|
/**
|
|
34
18
|
* #property
|
|
35
19
|
*/
|
|
@@ -45,13 +29,9 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
45
29
|
panelWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
46
30
|
}, {
|
|
47
31
|
visible: Record<string, boolean>;
|
|
48
|
-
widths: Record<string, number | undefined>;
|
|
49
|
-
* #property
|
|
50
|
-
*/
|
|
32
|
+
widths: Record<string, number | undefined>;
|
|
51
33
|
useShoppingCart: boolean;
|
|
52
|
-
filters: import("mobx").ObservableMap<string, string[]>;
|
|
53
|
-
* #property
|
|
54
|
-
*/
|
|
34
|
+
filters: import("mobx").ObservableMap<string, string[]>;
|
|
55
35
|
} & {
|
|
56
36
|
setFilter(key: string, value: string[]): void;
|
|
57
37
|
setPanelWidth(width: number): void;
|
|
@@ -111,6 +91,9 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
111
91
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
112
92
|
setSubschema(slotName: string, data: unknown): any;
|
|
113
93
|
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[];
|
|
94
|
+
sortTrackNames: boolean;
|
|
95
|
+
sortCategories: boolean;
|
|
96
|
+
collapsed: import("mobx").ObservableMap<string, boolean>;
|
|
114
97
|
filterText: string;
|
|
115
98
|
recentlyUsedCounter: number;
|
|
116
99
|
favoritesCounter: number;
|
|
@@ -135,6 +118,10 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
135
118
|
* #getter
|
|
136
119
|
*/
|
|
137
120
|
readonly recentlyUsedSet: Set<string>;
|
|
121
|
+
/**
|
|
122
|
+
* #getter
|
|
123
|
+
*/
|
|
124
|
+
readonly assemblyNames: string[];
|
|
138
125
|
} & {
|
|
139
126
|
/**
|
|
140
127
|
* #action
|
|
@@ -212,6 +199,10 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
212
199
|
* #action
|
|
213
200
|
*/
|
|
214
201
|
expandAllCategories(): void;
|
|
202
|
+
/**
|
|
203
|
+
* #action
|
|
204
|
+
*/
|
|
205
|
+
setCollapsedCategories(str: [string, boolean][]): void;
|
|
215
206
|
/**
|
|
216
207
|
* #action
|
|
217
208
|
*/
|
|
@@ -241,24 +232,11 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
241
232
|
/**
|
|
242
233
|
* #getter
|
|
243
234
|
*/
|
|
244
|
-
readonly
|
|
245
|
-
} & {
|
|
246
|
-
/**
|
|
247
|
-
* #getter
|
|
248
|
-
*/
|
|
249
|
-
readonly recentlyUsedLocalStorageKey: string;
|
|
235
|
+
readonly activeSortTrackNames: boolean;
|
|
250
236
|
/**
|
|
251
237
|
* #getter
|
|
252
238
|
*/
|
|
253
|
-
readonly
|
|
254
|
-
/**
|
|
255
|
-
* #getter
|
|
256
|
-
*/
|
|
257
|
-
readonly activeSortTrackNames: any;
|
|
258
|
-
/**
|
|
259
|
-
* #getter
|
|
260
|
-
*/
|
|
261
|
-
readonly activeSortCategories: any;
|
|
239
|
+
readonly activeSortCategories: boolean;
|
|
262
240
|
/**
|
|
263
241
|
* #getter
|
|
264
242
|
* filter out tracks that don't match the current assembly/display types
|
|
@@ -344,8 +322,6 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
344
322
|
* #action
|
|
345
323
|
*/
|
|
346
324
|
collapseTopLevelCategories(): void;
|
|
347
|
-
} & {
|
|
348
|
-
afterCreate(): void;
|
|
349
325
|
} & {
|
|
350
326
|
/**
|
|
351
327
|
* #getter
|
|
@@ -10,21 +10,52 @@ const filterTracks_1 = require("./filterTracks");
|
|
|
10
10
|
const generateHierarchy_1 = require("./generateHierarchy");
|
|
11
11
|
const util_2 = require("./util");
|
|
12
12
|
const facetedModel_1 = require("./facetedModel");
|
|
13
|
-
// for settings that are config dependent
|
|
14
|
-
function
|
|
15
|
-
return typeof window !== undefined
|
|
13
|
+
// for settings that are not config dependent
|
|
14
|
+
function keyNoConfigPostFix() {
|
|
15
|
+
return typeof window !== 'undefined'
|
|
16
16
|
? [window.location.host, window.location.pathname].join('-')
|
|
17
17
|
: 'empty';
|
|
18
18
|
}
|
|
19
|
-
// for settings that are
|
|
20
|
-
function
|
|
21
|
-
return typeof window !== undefined
|
|
19
|
+
// for settings that are config dependent
|
|
20
|
+
function keyConfigPostFix() {
|
|
21
|
+
return typeof window !== 'undefined'
|
|
22
22
|
? [
|
|
23
|
-
|
|
23
|
+
keyNoConfigPostFix(),
|
|
24
24
|
new URLSearchParams(window.location.search).get('config'),
|
|
25
25
|
].join('-')
|
|
26
26
|
: 'empty';
|
|
27
27
|
}
|
|
28
|
+
function recentlyUsedK(assemblyNames) {
|
|
29
|
+
return ['recentlyUsedTracks', keyConfigPostFix(), assemblyNames.join(',')]
|
|
30
|
+
.filter(f => !!f)
|
|
31
|
+
.join('-');
|
|
32
|
+
}
|
|
33
|
+
// this has a extra } at the end because that's how it was initially
|
|
34
|
+
// released
|
|
35
|
+
function favoritesK() {
|
|
36
|
+
return `favoriteTracks-${keyConfigPostFix()}}`;
|
|
37
|
+
}
|
|
38
|
+
function collapsedK(assemblyNames, viewType) {
|
|
39
|
+
return [
|
|
40
|
+
'collapsedCategories',
|
|
41
|
+
keyConfigPostFix(),
|
|
42
|
+
assemblyNames.join(','),
|
|
43
|
+
viewType,
|
|
44
|
+
].join('-');
|
|
45
|
+
}
|
|
46
|
+
function sortTrackNamesK() {
|
|
47
|
+
return 'sortTrackNames';
|
|
48
|
+
}
|
|
49
|
+
function sortCategoriesK() {
|
|
50
|
+
return 'sortCategories';
|
|
51
|
+
}
|
|
52
|
+
function localStorageGetJSON(key, defaultValue) {
|
|
53
|
+
var _a;
|
|
54
|
+
return JSON.parse((_a = (0, util_1.localStorageGetItem)(key)) !== null && _a !== void 0 ? _a : defaultValue);
|
|
55
|
+
}
|
|
56
|
+
function localStorageSetJSON(key, val) {
|
|
57
|
+
(0, util_1.localStorageSetItem)(key, JSON.stringify(val));
|
|
58
|
+
}
|
|
28
59
|
const MAX_RECENTLY_USED = 10;
|
|
29
60
|
/**
|
|
30
61
|
* #stateModel HierarchicalTrackSelectorWidget
|
|
@@ -40,22 +71,6 @@ function stateTreeFactory(pluginManager) {
|
|
|
40
71
|
* #property
|
|
41
72
|
*/
|
|
42
73
|
type: mobx_state_tree_1.types.literal('HierarchicalTrackSelectorWidget'),
|
|
43
|
-
/**
|
|
44
|
-
* #property
|
|
45
|
-
*/
|
|
46
|
-
initialized: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.boolean),
|
|
47
|
-
/**
|
|
48
|
-
* #property
|
|
49
|
-
*/
|
|
50
|
-
collapsed: mobx_state_tree_1.types.map(mobx_state_tree_1.types.boolean),
|
|
51
|
-
/**
|
|
52
|
-
* #property
|
|
53
|
-
*/
|
|
54
|
-
sortTrackNames: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.boolean),
|
|
55
|
-
/**
|
|
56
|
-
* #property
|
|
57
|
-
*/
|
|
58
|
-
sortCategories: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.boolean),
|
|
59
74
|
/**
|
|
60
75
|
* #property
|
|
61
76
|
*/
|
|
@@ -66,9 +81,12 @@ function stateTreeFactory(pluginManager) {
|
|
|
66
81
|
faceted: mobx_state_tree_1.types.optional((0, facetedModel_1.facetedStateTreeF)(), {}),
|
|
67
82
|
})
|
|
68
83
|
.volatile(() => ({
|
|
69
|
-
favorites: [],
|
|
84
|
+
favorites: localStorageGetJSON(favoritesK(), '[]'),
|
|
70
85
|
recentlyUsed: [],
|
|
71
86
|
selection: [],
|
|
87
|
+
sortTrackNames: !!localStorageGetJSON(sortTrackNamesK(), 'false'),
|
|
88
|
+
sortCategories: !!localStorageGetJSON(sortCategoriesK(), 'false'),
|
|
89
|
+
collapsed: mobx_1.observable.map(),
|
|
72
90
|
filterText: '',
|
|
73
91
|
recentlyUsedCounter: 0,
|
|
74
92
|
favoritesCounter: 0,
|
|
@@ -99,6 +117,13 @@ function stateTreeFactory(pluginManager) {
|
|
|
99
117
|
get recentlyUsedSet() {
|
|
100
118
|
return new Set(self.recentlyUsed);
|
|
101
119
|
},
|
|
120
|
+
/**
|
|
121
|
+
* #getter
|
|
122
|
+
*/
|
|
123
|
+
get assemblyNames() {
|
|
124
|
+
var _a;
|
|
125
|
+
return ((_a = self.view) === null || _a === void 0 ? void 0 : _a.assemblyNames) || [];
|
|
126
|
+
},
|
|
102
127
|
}))
|
|
103
128
|
.actions(self => ({
|
|
104
129
|
/**
|
|
@@ -223,6 +248,12 @@ function stateTreeFactory(pluginManager) {
|
|
|
223
248
|
expandAllCategories() {
|
|
224
249
|
self.collapsed.clear();
|
|
225
250
|
},
|
|
251
|
+
/**
|
|
252
|
+
* #action
|
|
253
|
+
*/
|
|
254
|
+
setCollapsedCategories(str) {
|
|
255
|
+
self.collapsed.replace(str);
|
|
256
|
+
},
|
|
226
257
|
/**
|
|
227
258
|
* #action
|
|
228
259
|
*/
|
|
@@ -263,43 +294,17 @@ function stateTreeFactory(pluginManager) {
|
|
|
263
294
|
const assembly = assemblyManager.get(assemblyName);
|
|
264
295
|
const trackConf = assembly === null || assembly === void 0 ? void 0 : assembly.configuration.sequence;
|
|
265
296
|
const viewType = pluginManager.getViewType(self.view.type);
|
|
266
|
-
if (
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
return trackConf;
|
|
297
|
+
if (trackConf) {
|
|
298
|
+
for (const display of trackConf.displays) {
|
|
299
|
+
if (viewType.displayTypes.some(d => d.name === display.type)) {
|
|
300
|
+
return trackConf;
|
|
301
|
+
}
|
|
272
302
|
}
|
|
273
303
|
}
|
|
274
304
|
return undefined;
|
|
275
305
|
},
|
|
276
306
|
}))
|
|
277
307
|
.views(self => ({
|
|
278
|
-
/**
|
|
279
|
-
* #getter
|
|
280
|
-
*/
|
|
281
|
-
get assemblyNames() {
|
|
282
|
-
var _a;
|
|
283
|
-
return ((_a = self.view) === null || _a === void 0 ? void 0 : _a.assemblyNames) || [];
|
|
284
|
-
},
|
|
285
|
-
}))
|
|
286
|
-
.views(self => ({
|
|
287
|
-
/**
|
|
288
|
-
* #getter
|
|
289
|
-
*/
|
|
290
|
-
get recentlyUsedLocalStorageKey() {
|
|
291
|
-
return `recentlyUsedTracks-${[postF(), self.assemblyNames.join(',')]
|
|
292
|
-
.filter(f => !!f)
|
|
293
|
-
.join('-')}`;
|
|
294
|
-
},
|
|
295
|
-
/**
|
|
296
|
-
* #getter
|
|
297
|
-
*/
|
|
298
|
-
get favoritesLocalStorageKey() {
|
|
299
|
-
// this has a extra } at the end because that's how it was initially
|
|
300
|
-
// released
|
|
301
|
-
return `favoriteTracks-${postF()}}`;
|
|
302
|
-
},
|
|
303
308
|
/**
|
|
304
309
|
* #getter
|
|
305
310
|
*/
|
|
@@ -331,7 +336,7 @@ function stateTreeFactory(pluginManager) {
|
|
|
331
336
|
const { connectionInstances = [] } = (0, util_1.getSession)(self);
|
|
332
337
|
return [
|
|
333
338
|
...this.configAndSessionTrackConfigurations,
|
|
334
|
-
...connectionInstances === null || connectionInstances === void 0 ? void 0 : connectionInstances.flatMap(c => c.tracks),
|
|
339
|
+
...((connectionInstances === null || connectionInstances === void 0 ? void 0 : connectionInstances.flatMap(c => c.tracks)) || []),
|
|
335
340
|
];
|
|
336
341
|
},
|
|
337
342
|
/**
|
|
@@ -434,35 +439,6 @@ function stateTreeFactory(pluginManager) {
|
|
|
434
439
|
self.setCategoryCollapsed(path, true);
|
|
435
440
|
}
|
|
436
441
|
},
|
|
437
|
-
}))
|
|
438
|
-
.actions(self => ({
|
|
439
|
-
afterCreate() {
|
|
440
|
-
if (!self.initialized) {
|
|
441
|
-
const session = (0, util_1.getSession)(self);
|
|
442
|
-
if ((0, configuration_1.getConf)(session, [
|
|
443
|
-
'hierarchical',
|
|
444
|
-
'defaultCollapsed',
|
|
445
|
-
'topLevelCategories',
|
|
446
|
-
])) {
|
|
447
|
-
self.collapseTopLevelCategories();
|
|
448
|
-
}
|
|
449
|
-
if ((0, configuration_1.getConf)(session, [
|
|
450
|
-
'hierarchical',
|
|
451
|
-
'defaultCollapsed',
|
|
452
|
-
'subCategories',
|
|
453
|
-
])) {
|
|
454
|
-
self.collapseSubCategories();
|
|
455
|
-
}
|
|
456
|
-
for (const entry of (0, configuration_1.getConf)(session, [
|
|
457
|
-
'hierarchical',
|
|
458
|
-
'defaultCollapsed',
|
|
459
|
-
'categoryNames',
|
|
460
|
-
])) {
|
|
461
|
-
self.collapsed.set(entry, true);
|
|
462
|
-
}
|
|
463
|
-
self.initialized = true;
|
|
464
|
-
}
|
|
465
|
-
},
|
|
466
442
|
}))
|
|
467
443
|
.views(self => ({
|
|
468
444
|
/**
|
|
@@ -476,13 +452,46 @@ function stateTreeFactory(pluginManager) {
|
|
|
476
452
|
afterAttach() {
|
|
477
453
|
// this should be the first autorun to properly initialize
|
|
478
454
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
479
|
-
|
|
480
|
-
self.
|
|
455
|
+
const { assemblyNames, view } = self;
|
|
456
|
+
self.setRecentlyUsed(localStorageGetJSON(recentlyUsedK(assemblyNames), '[]'));
|
|
457
|
+
const val = (0, util_1.localStorageGetItem)(collapsedK(assemblyNames, view.type));
|
|
458
|
+
if (!val) {
|
|
459
|
+
self.expandAllCategories();
|
|
460
|
+
const session = (0, util_1.getSession)(self);
|
|
461
|
+
if ((0, configuration_1.getConf)(session, [
|
|
462
|
+
'hierarchical',
|
|
463
|
+
'defaultCollapsed',
|
|
464
|
+
'topLevelCategories',
|
|
465
|
+
])) {
|
|
466
|
+
self.collapseTopLevelCategories();
|
|
467
|
+
}
|
|
468
|
+
if ((0, configuration_1.getConf)(session, [
|
|
469
|
+
'hierarchical',
|
|
470
|
+
'defaultCollapsed',
|
|
471
|
+
'subCategories',
|
|
472
|
+
])) {
|
|
473
|
+
self.collapseSubCategories();
|
|
474
|
+
}
|
|
475
|
+
for (const entry of (0, configuration_1.getConf)(session, [
|
|
476
|
+
'hierarchical',
|
|
477
|
+
'defaultCollapsed',
|
|
478
|
+
'categoryNames',
|
|
479
|
+
])) {
|
|
480
|
+
self.setCategoryCollapsed(`Tracks-${entry}`, true);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
self.setCollapsedCategories(JSON.parse(val));
|
|
485
|
+
}
|
|
481
486
|
}));
|
|
482
487
|
// this should be the second autorun
|
|
483
488
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
484
|
-
|
|
485
|
-
(
|
|
489
|
+
const { assemblyNames, collapsed, view } = self;
|
|
490
|
+
localStorageSetJSON(recentlyUsedK(assemblyNames), self.recentlyUsed);
|
|
491
|
+
localStorageSetJSON(collapsedK(assemblyNames, view.type), collapsed);
|
|
492
|
+
localStorageSetJSON(favoritesK(), self.favorites);
|
|
493
|
+
localStorageSetJSON(sortTrackNamesK(), self.sortTrackNames);
|
|
494
|
+
localStorageSetJSON(sortCategoriesK(), self.sortCategories);
|
|
486
495
|
}));
|
|
487
496
|
},
|
|
488
497
|
}));
|
|
@@ -7,6 +7,6 @@ interface Node {
|
|
|
7
7
|
children: Node[];
|
|
8
8
|
id: string;
|
|
9
9
|
}
|
|
10
|
-
export declare function findSubCategories(obj: Node[], paths: string[]): boolean;
|
|
10
|
+
export declare function findSubCategories(obj: Node[], paths: string[], depth?: number): boolean;
|
|
11
11
|
export declare function findTopLevelCategories(obj: Node[], paths: string[]): void;
|
|
12
12
|
export {};
|
|
@@ -27,12 +27,13 @@ function matches(query, conf, session) {
|
|
|
27
27
|
!!categories.filter(c => c.toLowerCase().includes(queryLower)).length);
|
|
28
28
|
}
|
|
29
29
|
exports.matches = matches;
|
|
30
|
-
function findSubCategories(obj, paths) {
|
|
30
|
+
function findSubCategories(obj, paths, depth = 0) {
|
|
31
31
|
let hasSubs = false;
|
|
32
32
|
for (const elt of obj) {
|
|
33
33
|
if (elt.children.length) {
|
|
34
|
-
const hasSubCategories = findSubCategories(elt.children, paths);
|
|
35
|
-
|
|
34
|
+
const hasSubCategories = findSubCategories(elt.children, paths, depth + 1);
|
|
35
|
+
// avoid pushing the root "Tracks" node by checking depth>0
|
|
36
|
+
if (hasSubCategories && depth > 0) {
|
|
36
37
|
paths.push(elt.id);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -31,7 +31,7 @@ const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
|
31
31
|
const react_1 = require("react");
|
|
32
32
|
const model_1 = __importDefault(require("./model"));
|
|
33
33
|
const configSchema = (0, configuration_1.ConfigurationSchema)('PluginStoreWidget', {});
|
|
34
|
-
|
|
34
|
+
function PluginStoreWidgetF(pluginManager) {
|
|
35
35
|
pluginManager.addWidgetType(() => {
|
|
36
36
|
return new pluggableElementTypes_1.WidgetType({
|
|
37
37
|
name: 'PluginStoreWidget',
|
|
@@ -41,4 +41,5 @@ exports.default = (pluginManager) => {
|
|
|
41
41
|
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/PluginStoreWidget')))),
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = PluginStoreWidgetF;
|