@jbrowse/product-core 3.6.3 → 3.6.4
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/RootModel/BaseRootModel.d.ts +1 -0
- package/dist/Session/MultipleViews.d.ts +3 -0
- package/dist/Session/SessionTracks.d.ts +3 -0
- package/dist/Session/Tracks.d.ts +3 -0
- package/dist/ui/AboutDialogContents.js +8 -34
- package/dist/ui/HeaderButtons.d.ts +6 -0
- package/dist/ui/HeaderButtons.js +31 -0
- package/dist/ui/util.d.ts +12 -0
- package/dist/ui/util.js +28 -0
- package/esm/RootModel/BaseRootModel.d.ts +1 -0
- package/esm/Session/MultipleViews.d.ts +3 -0
- package/esm/Session/SessionTracks.d.ts +3 -0
- package/esm/Session/Tracks.d.ts +3 -0
- package/esm/ui/AboutDialogContents.js +8 -34
- package/esm/ui/HeaderButtons.d.ts +6 -0
- package/esm/ui/HeaderButtons.js +26 -0
- package/esm/ui/util.d.ts +12 -0
- package/esm/ui/util.js +24 -0
- package/package.json +3 -3
|
@@ -215,6 +215,7 @@ export declare function BaseRootModelFactory({ pluginManager, jbrowseModelType,
|
|
|
215
215
|
afterCreate(): void;
|
|
216
216
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
217
217
|
} & {
|
|
218
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
218
219
|
get(asmName: string): ({
|
|
219
220
|
configuration: any;
|
|
220
221
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -291,6 +291,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
291
291
|
afterCreate(): void;
|
|
292
292
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
293
293
|
} & {
|
|
294
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
294
295
|
get(asmName: string): ({
|
|
295
296
|
configuration: any;
|
|
296
297
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -785,6 +786,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
785
786
|
afterCreate(): void;
|
|
786
787
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
787
788
|
} & {
|
|
789
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
788
790
|
get(asmName: string): ({
|
|
789
791
|
configuration: any;
|
|
790
792
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -1296,6 +1298,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
1296
1298
|
afterCreate(): void;
|
|
1297
1299
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
1298
1300
|
} & {
|
|
1301
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
1299
1302
|
get(asmName: string): ({
|
|
1300
1303
|
configuration: any;
|
|
1301
1304
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -284,6 +284,7 @@ export declare function SessionTracksManagerSessionMixin(pluginManager: PluginMa
|
|
|
284
284
|
afterCreate(): void;
|
|
285
285
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
286
286
|
} & {
|
|
287
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
287
288
|
get(asmName: string): ({
|
|
288
289
|
configuration: any;
|
|
289
290
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -778,6 +779,7 @@ export declare function SessionTracksManagerSessionMixin(pluginManager: PluginMa
|
|
|
778
779
|
afterCreate(): void;
|
|
779
780
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
780
781
|
} & {
|
|
782
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
781
783
|
get(asmName: string): ({
|
|
782
784
|
configuration: any;
|
|
783
785
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -1289,6 +1291,7 @@ export declare function SessionTracksManagerSessionMixin(pluginManager: PluginMa
|
|
|
1289
1291
|
afterCreate(): void;
|
|
1290
1292
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
1291
1293
|
} & {
|
|
1294
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
1292
1295
|
get(asmName: string): ({
|
|
1293
1296
|
configuration: any;
|
|
1294
1297
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
package/dist/Session/Tracks.d.ts
CHANGED
|
@@ -282,6 +282,7 @@ export declare function TracksManagerSessionMixin(pluginManager: PluginManager):
|
|
|
282
282
|
afterCreate(): void;
|
|
283
283
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
284
284
|
} & {
|
|
285
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
285
286
|
get(asmName: string): ({
|
|
286
287
|
configuration: any;
|
|
287
288
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -776,6 +777,7 @@ export declare function TracksManagerSessionMixin(pluginManager: PluginManager):
|
|
|
776
777
|
afterCreate(): void;
|
|
777
778
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
778
779
|
} & {
|
|
780
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
779
781
|
get(asmName: string): ({
|
|
780
782
|
configuration: any;
|
|
781
783
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -1287,6 +1289,7 @@ export declare function TracksManagerSessionMixin(pluginManager: PluginManager):
|
|
|
1287
1289
|
afterCreate(): void;
|
|
1288
1290
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
1289
1291
|
} & {
|
|
1292
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
1290
1293
|
get(asmName: string): ({
|
|
1291
1294
|
configuration: any;
|
|
1292
1295
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -9,33 +9,18 @@ const Attributes_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/Ba
|
|
|
9
9
|
const BaseCard_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard"));
|
|
10
10
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
11
11
|
const util_1 = require("@jbrowse/core/util");
|
|
12
|
-
const material_1 = require("@mui/material");
|
|
13
|
-
const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
|
|
14
12
|
const mobx_react_1 = require("mobx-react");
|
|
15
13
|
const mui_1 = require("tss-react/mui");
|
|
16
14
|
const FileInfoPanel_1 = __importDefault(require("./FileInfoPanel"));
|
|
15
|
+
const HeaderButtons_1 = __importDefault(require("./HeaderButtons"));
|
|
17
16
|
const RefNameInfoDialog_1 = __importDefault(require("./RefNameInfoDialog"));
|
|
17
|
+
const util_2 = require("./util");
|
|
18
18
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
19
19
|
content: {
|
|
20
20
|
minWidth: 800,
|
|
21
21
|
},
|
|
22
|
-
button: {
|
|
23
|
-
float: 'right',
|
|
24
|
-
},
|
|
25
22
|
});
|
|
26
|
-
function removeAttr(obj, attr) {
|
|
27
|
-
for (const prop in obj) {
|
|
28
|
-
if (prop === attr) {
|
|
29
|
-
delete obj[prop];
|
|
30
|
-
}
|
|
31
|
-
else if (typeof obj[prop] === 'object') {
|
|
32
|
-
removeAttr(obj[prop], attr);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return obj;
|
|
36
|
-
}
|
|
37
23
|
const AboutDialogContents = (0, mobx_react_1.observer)(function ({ config, }) {
|
|
38
|
-
const [copied, setCopied] = (0, react_1.useState)(false);
|
|
39
24
|
const conf = (0, configuration_1.readConfObject)(config);
|
|
40
25
|
const session = (0, util_1.getSession)(config);
|
|
41
26
|
const { classes } = useStyles();
|
|
@@ -43,24 +28,13 @@ const AboutDialogContents = (0, mobx_react_1.observer)(function ({ config, }) {
|
|
|
43
28
|
const hideUris = (0, configuration_1.getConf)(session, ['formatAbout', 'hideUris']) ||
|
|
44
29
|
(0, configuration_1.readConfObject)(config, ['formatAbout', 'hideUris']);
|
|
45
30
|
const { pluginManager } = (0, util_1.getEnv)(session);
|
|
46
|
-
const confPostExt =
|
|
47
|
-
config
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
...(0, configuration_1.readConfObject)(config, ['formatAbout', 'config'], { config: conf }),
|
|
51
|
-
},
|
|
52
|
-
}, { session, config });
|
|
31
|
+
const confPostExt = (0, util_2.generateDisplayableConfig)({
|
|
32
|
+
config,
|
|
33
|
+
pluginManager,
|
|
34
|
+
});
|
|
53
35
|
const ExtraPanel = pluginManager.evaluateExtensionPoint('Core-extraAboutPanel', null, { session, config });
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, children: "Show ref names" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
|
|
57
|
-
const snap = removeAttr(structuredClone(conf), 'baseUri');
|
|
58
|
-
(0, copy_to_clipboard_1.default)(JSON.stringify(snap, null, 2));
|
|
59
|
-
setCopied(true);
|
|
60
|
-
setTimeout(() => {
|
|
61
|
-
setCopied(false);
|
|
62
|
-
}, 1000);
|
|
63
|
-
}, children: copied ? 'Copied to clipboard!' : 'Copy config' })] })) : null, (0, jsx_runtime_1.jsx)(Attributes_1.default, { attributes: confPostExt.config, omit: ['displays', 'baseUri', 'refNames', 'formatAbout', 'metadata'], hideUris: hideUris })] }), confPostExt.config.metadata ? ((0, jsx_runtime_1.jsx)(BaseCard_1.default, { title: "Metadata", children: (0, jsx_runtime_1.jsx)(Attributes_1.default, { attributes: confPostExt.config.metadata, omit: ['displays', 'baseUri', 'refNames', 'formatAbout'], hideUris: hideUris }) })) : null, ExtraPanel ? ((0, jsx_runtime_1.jsx)(BaseCard_1.default, { title: ExtraPanel.name, children: (0, jsx_runtime_1.jsx)(ExtraPanel.Component, { config: config }) })) : null, (0, jsx_runtime_1.jsx)(FileInfoPanel_1.default, { config: config }), showRefNames ? ((0, jsx_runtime_1.jsx)(RefNameInfoDialog_1.default, { config: config, onClose: () => {
|
|
36
|
+
const hideFields = ['displays', 'baseUri', 'refNames', 'formatAbout'];
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.content, children: [(0, jsx_runtime_1.jsxs)(BaseCard_1.default, { title: "Configuration", children: [!hideUris ? ((0, jsx_runtime_1.jsx)(HeaderButtons_1.default, { conf: conf, setShowRefNames: setShowRefNames })) : null, (0, jsx_runtime_1.jsx)(Attributes_1.default, { attributes: confPostExt.config, omit: [...hideFields, 'metadata'], hideUris: hideUris })] }), confPostExt.config.metadata ? ((0, jsx_runtime_1.jsx)(BaseCard_1.default, { title: "Metadata", children: (0, jsx_runtime_1.jsx)(Attributes_1.default, { attributes: confPostExt.config.metadata, omit: hideFields, hideUris: hideUris }) })) : null, ExtraPanel ? ((0, jsx_runtime_1.jsx)(BaseCard_1.default, { title: ExtraPanel.name, children: (0, jsx_runtime_1.jsx)(ExtraPanel.Component, { config: config }) })) : null, (0, jsx_runtime_1.jsx)(FileInfoPanel_1.default, { config: config }), showRefNames ? ((0, jsx_runtime_1.jsx)(RefNameInfoDialog_1.default, { config: config, onClose: () => {
|
|
64
38
|
setShowRefNames(false);
|
|
65
39
|
} })) : null] }));
|
|
66
40
|
});
|
|
@@ -0,0 +1,31 @@
|
|
|
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 material_1 = require("@mui/material");
|
|
9
|
+
const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
|
|
10
|
+
const mui_1 = require("tss-react/mui");
|
|
11
|
+
const util_1 = require("./util");
|
|
12
|
+
const useStyles = (0, mui_1.makeStyles)()({
|
|
13
|
+
button: {
|
|
14
|
+
float: 'right',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
function HeaderButtons({ conf, setShowRefNames }) {
|
|
18
|
+
const [copied, setCopied] = (0, react_1.useState)(false);
|
|
19
|
+
const { classes } = useStyles();
|
|
20
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: classes.button, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
21
|
+
setShowRefNames(true);
|
|
22
|
+
}, children: "Show ref names" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
|
|
23
|
+
const snap = (0, util_1.removeAttr)(structuredClone(conf), 'baseUri');
|
|
24
|
+
(0, copy_to_clipboard_1.default)(JSON.stringify(snap, null, 2));
|
|
25
|
+
setCopied(true);
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
setCopied(false);
|
|
28
|
+
}, 1000);
|
|
29
|
+
}, children: copied ? 'Copied to clipboard!' : 'Copy config' })] }));
|
|
30
|
+
}
|
|
31
|
+
exports.default = HeaderButtons;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
export declare function removeAttr(obj: Record<string, unknown>, attr: string): Record<string, unknown>;
|
|
4
|
+
export declare function generateDisplayableConfig({ config, pluginManager, }: {
|
|
5
|
+
config: AnyConfigurationModel;
|
|
6
|
+
pluginManager: PluginManager;
|
|
7
|
+
}): {
|
|
8
|
+
config: {
|
|
9
|
+
metadata?: Record<string, unknown>;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
};
|
package/dist/ui/util.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeAttr = removeAttr;
|
|
4
|
+
exports.generateDisplayableConfig = generateDisplayableConfig;
|
|
5
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
6
|
+
const util_1 = require("@jbrowse/core/util");
|
|
7
|
+
function removeAttr(obj, attr) {
|
|
8
|
+
for (const prop in obj) {
|
|
9
|
+
if (prop === attr) {
|
|
10
|
+
delete obj[prop];
|
|
11
|
+
}
|
|
12
|
+
else if (typeof obj[prop] === 'object') {
|
|
13
|
+
removeAttr(obj[prop], attr);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return obj;
|
|
17
|
+
}
|
|
18
|
+
function generateDisplayableConfig({ config, pluginManager, }) {
|
|
19
|
+
const session = (0, util_1.getSession)(config);
|
|
20
|
+
const conf = (0, configuration_1.readConfObject)(config);
|
|
21
|
+
return pluginManager.evaluateExtensionPoint('Core-customizeAbout', {
|
|
22
|
+
config: {
|
|
23
|
+
...conf,
|
|
24
|
+
...(0, configuration_1.getConf)(session, ['formatAbout', 'config'], { config: conf }),
|
|
25
|
+
...(0, configuration_1.readConfObject)(config, ['formatAbout', 'config'], { config: conf }),
|
|
26
|
+
},
|
|
27
|
+
}, { session, config });
|
|
28
|
+
}
|
|
@@ -215,6 +215,7 @@ export declare function BaseRootModelFactory({ pluginManager, jbrowseModelType,
|
|
|
215
215
|
afterCreate(): void;
|
|
216
216
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
217
217
|
} & {
|
|
218
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
218
219
|
get(asmName: string): ({
|
|
219
220
|
configuration: any;
|
|
220
221
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -291,6 +291,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
291
291
|
afterCreate(): void;
|
|
292
292
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
293
293
|
} & {
|
|
294
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
294
295
|
get(asmName: string): ({
|
|
295
296
|
configuration: any;
|
|
296
297
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -785,6 +786,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
785
786
|
afterCreate(): void;
|
|
786
787
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
787
788
|
} & {
|
|
789
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
788
790
|
get(asmName: string): ({
|
|
789
791
|
configuration: any;
|
|
790
792
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -1296,6 +1298,7 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
|
|
|
1296
1298
|
afterCreate(): void;
|
|
1297
1299
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
1298
1300
|
} & {
|
|
1301
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
1299
1302
|
get(asmName: string): ({
|
|
1300
1303
|
configuration: any;
|
|
1301
1304
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -284,6 +284,7 @@ export declare function SessionTracksManagerSessionMixin(pluginManager: PluginMa
|
|
|
284
284
|
afterCreate(): void;
|
|
285
285
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
286
286
|
} & {
|
|
287
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
287
288
|
get(asmName: string): ({
|
|
288
289
|
configuration: any;
|
|
289
290
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -778,6 +779,7 @@ export declare function SessionTracksManagerSessionMixin(pluginManager: PluginMa
|
|
|
778
779
|
afterCreate(): void;
|
|
779
780
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
780
781
|
} & {
|
|
782
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
781
783
|
get(asmName: string): ({
|
|
782
784
|
configuration: any;
|
|
783
785
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -1289,6 +1291,7 @@ export declare function SessionTracksManagerSessionMixin(pluginManager: PluginMa
|
|
|
1289
1291
|
afterCreate(): void;
|
|
1290
1292
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
1291
1293
|
} & {
|
|
1294
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
1292
1295
|
get(asmName: string): ({
|
|
1293
1296
|
configuration: any;
|
|
1294
1297
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
package/esm/Session/Tracks.d.ts
CHANGED
|
@@ -282,6 +282,7 @@ export declare function TracksManagerSessionMixin(pluginManager: PluginManager):
|
|
|
282
282
|
afterCreate(): void;
|
|
283
283
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
284
284
|
} & {
|
|
285
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
285
286
|
get(asmName: string): ({
|
|
286
287
|
configuration: any;
|
|
287
288
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -776,6 +777,7 @@ export declare function TracksManagerSessionMixin(pluginManager: PluginManager):
|
|
|
776
777
|
afterCreate(): void;
|
|
777
778
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
778
779
|
} & {
|
|
780
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
779
781
|
get(asmName: string): ({
|
|
780
782
|
configuration: any;
|
|
781
783
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -1287,6 +1289,7 @@ export declare function TracksManagerSessionMixin(pluginManager: PluginManager):
|
|
|
1287
1289
|
afterCreate(): void;
|
|
1288
1290
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
1289
1291
|
} & {
|
|
1292
|
+
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
1290
1293
|
get(asmName: string): ({
|
|
1291
1294
|
configuration: any;
|
|
1292
1295
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -4,33 +4,18 @@ import Attributes from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attrib
|
|
|
4
4
|
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard';
|
|
5
5
|
import { getConf, readConfObject } from '@jbrowse/core/configuration';
|
|
6
6
|
import { getEnv, getSession } from '@jbrowse/core/util';
|
|
7
|
-
import { Button } from '@mui/material';
|
|
8
|
-
import copy from 'copy-to-clipboard';
|
|
9
7
|
import { observer } from 'mobx-react';
|
|
10
8
|
import { makeStyles } from 'tss-react/mui';
|
|
11
9
|
import FileInfoPanel from './FileInfoPanel';
|
|
10
|
+
import HeaderButtons from './HeaderButtons';
|
|
12
11
|
import RefNameInfoDialog from './RefNameInfoDialog';
|
|
12
|
+
import { generateDisplayableConfig } from './util';
|
|
13
13
|
const useStyles = makeStyles()({
|
|
14
14
|
content: {
|
|
15
15
|
minWidth: 800,
|
|
16
16
|
},
|
|
17
|
-
button: {
|
|
18
|
-
float: 'right',
|
|
19
|
-
},
|
|
20
17
|
});
|
|
21
|
-
function removeAttr(obj, attr) {
|
|
22
|
-
for (const prop in obj) {
|
|
23
|
-
if (prop === attr) {
|
|
24
|
-
delete obj[prop];
|
|
25
|
-
}
|
|
26
|
-
else if (typeof obj[prop] === 'object') {
|
|
27
|
-
removeAttr(obj[prop], attr);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return obj;
|
|
31
|
-
}
|
|
32
18
|
const AboutDialogContents = observer(function ({ config, }) {
|
|
33
|
-
const [copied, setCopied] = useState(false);
|
|
34
19
|
const conf = readConfObject(config);
|
|
35
20
|
const session = getSession(config);
|
|
36
21
|
const { classes } = useStyles();
|
|
@@ -38,24 +23,13 @@ const AboutDialogContents = observer(function ({ config, }) {
|
|
|
38
23
|
const hideUris = getConf(session, ['formatAbout', 'hideUris']) ||
|
|
39
24
|
readConfObject(config, ['formatAbout', 'hideUris']);
|
|
40
25
|
const { pluginManager } = getEnv(session);
|
|
41
|
-
const confPostExt =
|
|
42
|
-
config
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
...readConfObject(config, ['formatAbout', 'config'], { config: conf }),
|
|
46
|
-
},
|
|
47
|
-
}, { session, config });
|
|
26
|
+
const confPostExt = generateDisplayableConfig({
|
|
27
|
+
config,
|
|
28
|
+
pluginManager,
|
|
29
|
+
});
|
|
48
30
|
const ExtraPanel = pluginManager.evaluateExtensionPoint('Core-extraAboutPanel', null, { session, config });
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, children: "Show ref names" }), _jsx(Button, { variant: "contained", onClick: () => {
|
|
52
|
-
const snap = removeAttr(structuredClone(conf), 'baseUri');
|
|
53
|
-
copy(JSON.stringify(snap, null, 2));
|
|
54
|
-
setCopied(true);
|
|
55
|
-
setTimeout(() => {
|
|
56
|
-
setCopied(false);
|
|
57
|
-
}, 1000);
|
|
58
|
-
}, children: copied ? 'Copied to clipboard!' : 'Copy config' })] })) : null, _jsx(Attributes, { attributes: confPostExt.config, omit: ['displays', 'baseUri', 'refNames', 'formatAbout', 'metadata'], hideUris: hideUris })] }), confPostExt.config.metadata ? (_jsx(BaseCard, { title: "Metadata", children: _jsx(Attributes, { attributes: confPostExt.config.metadata, omit: ['displays', 'baseUri', 'refNames', 'formatAbout'], hideUris: hideUris }) })) : null, ExtraPanel ? (_jsx(BaseCard, { title: ExtraPanel.name, children: _jsx(ExtraPanel.Component, { config: config }) })) : null, _jsx(FileInfoPanel, { config: config }), showRefNames ? (_jsx(RefNameInfoDialog, { config: config, onClose: () => {
|
|
31
|
+
const hideFields = ['displays', 'baseUri', 'refNames', 'formatAbout'];
|
|
32
|
+
return (_jsxs("div", { className: classes.content, children: [_jsxs(BaseCard, { title: "Configuration", children: [!hideUris ? (_jsx(HeaderButtons, { conf: conf, setShowRefNames: setShowRefNames })) : null, _jsx(Attributes, { attributes: confPostExt.config, omit: [...hideFields, 'metadata'], hideUris: hideUris })] }), confPostExt.config.metadata ? (_jsx(BaseCard, { title: "Metadata", children: _jsx(Attributes, { attributes: confPostExt.config.metadata, omit: hideFields, hideUris: hideUris }) })) : null, ExtraPanel ? (_jsx(BaseCard, { title: ExtraPanel.name, children: _jsx(ExtraPanel.Component, { config: config }) })) : null, _jsx(FileInfoPanel, { config: config }), showRefNames ? (_jsx(RefNameInfoDialog, { config: config, onClose: () => {
|
|
59
33
|
setShowRefNames(false);
|
|
60
34
|
} })) : null] }));
|
|
61
35
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Button } from '@mui/material';
|
|
4
|
+
import copy from 'copy-to-clipboard';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
|
+
import { removeAttr } from './util';
|
|
7
|
+
const useStyles = makeStyles()({
|
|
8
|
+
button: {
|
|
9
|
+
float: 'right',
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
function HeaderButtons({ conf, setShowRefNames }) {
|
|
13
|
+
const [copied, setCopied] = useState(false);
|
|
14
|
+
const { classes } = useStyles();
|
|
15
|
+
return (_jsxs("span", { className: classes.button, children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
16
|
+
setShowRefNames(true);
|
|
17
|
+
}, children: "Show ref names" }), _jsx(Button, { variant: "contained", onClick: () => {
|
|
18
|
+
const snap = removeAttr(structuredClone(conf), 'baseUri');
|
|
19
|
+
copy(JSON.stringify(snap, null, 2));
|
|
20
|
+
setCopied(true);
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
setCopied(false);
|
|
23
|
+
}, 1000);
|
|
24
|
+
}, children: copied ? 'Copied to clipboard!' : 'Copy config' })] }));
|
|
25
|
+
}
|
|
26
|
+
export default HeaderButtons;
|
package/esm/ui/util.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
export declare function removeAttr(obj: Record<string, unknown>, attr: string): Record<string, unknown>;
|
|
4
|
+
export declare function generateDisplayableConfig({ config, pluginManager, }: {
|
|
5
|
+
config: AnyConfigurationModel;
|
|
6
|
+
pluginManager: PluginManager;
|
|
7
|
+
}): {
|
|
8
|
+
config: {
|
|
9
|
+
metadata?: Record<string, unknown>;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
};
|
package/esm/ui/util.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getConf, readConfObject } from '@jbrowse/core/configuration';
|
|
2
|
+
import { getSession } from '@jbrowse/core/util';
|
|
3
|
+
export function removeAttr(obj, attr) {
|
|
4
|
+
for (const prop in obj) {
|
|
5
|
+
if (prop === attr) {
|
|
6
|
+
delete obj[prop];
|
|
7
|
+
}
|
|
8
|
+
else if (typeof obj[prop] === 'object') {
|
|
9
|
+
removeAttr(obj[prop], attr);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
export function generateDisplayableConfig({ config, pluginManager, }) {
|
|
15
|
+
const session = getSession(config);
|
|
16
|
+
const conf = readConfObject(config);
|
|
17
|
+
return pluginManager.evaluateExtensionPoint('Core-customizeAbout', {
|
|
18
|
+
config: {
|
|
19
|
+
...conf,
|
|
20
|
+
...getConf(session, ['formatAbout', 'config'], { config: conf }),
|
|
21
|
+
...readConfObject(config, ['formatAbout', 'config'], { config: conf }),
|
|
22
|
+
},
|
|
23
|
+
}, { session, config });
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/product-core",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "JBrowse 2 code shared between products but not used by plugins",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@babel/runtime": "^7.16.3",
|
|
46
|
-
"@jbrowse/core": "^3.6.
|
|
46
|
+
"@jbrowse/core": "^3.6.4",
|
|
47
47
|
"@mui/icons-material": "^7.0.0",
|
|
48
48
|
"@mui/material": "^7.0.0",
|
|
49
49
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "3db8e50ce2bd9c081efbf6c2e7ae5f342380a25a"
|
|
66
66
|
}
|